sigpro 2.0.10 → 2.1.2

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.
@@ -1,81 +0,0 @@
1
- var Kd;function wa(e,t){if(Kd)try{Kd(e,t)}catch{}else console.error("[sigpro] error in",t,e)}function tv({update:e,notify:t,unwatched:s}){return{link:i,unlink:o,propagate:r,checkDirty:n,shallowPropagate:a};function i(c,d,u){let h=d.depsTail;if(h!==void 0&&h.dep===c)return;let g=h!==void 0?h.nextDep:d.deps;if(g!==void 0&&g.dep===c){g.version=u,d.depsTail=g;return}let p=c.subsTail;if(p!==void 0&&p.version===u&&p.sub===d)return;let f=d.depsTail=c.subsTail={version:u,dep:c,sub:d,prevDep:h,nextDep:g,prevSub:p,nextSub:void 0};if(g!==void 0)g.prevDep=f;if(h!==void 0)h.nextDep=f;else d.deps=f;if(p!==void 0)p.nextSub=f;else c.subs=f}function o(c,d=c.sub){let{dep:u,prevDep:h,nextDep:g,nextSub:p,prevSub:f}=c;if(g!==void 0)g.prevDep=h;else d.depsTail=h;if(h!==void 0)h.nextDep=g;else d.deps=g;if(p!==void 0)p.prevSub=f;else u.subsTail=f;if(f!==void 0)f.nextSub=p;else if((u.subs=p)===void 0)s(u);return g}function r(c,d){let u=c.nextSub,h;e:do{let g=c.sub,p=g.flags;if(!(p&60)){if(g.flags=p|32,d)g.flags|=8}else if(!(p&12))p=0;else if(!(p&4))g.flags=p&-9|32;else if(!(p&48)&&l(c,g))g.flags=p|8|32,p&=1;else p=0;if(p&2)t(g);if(p&1){let f=g.subs;if(f!==void 0){let m=(c=f).nextSub;if(m!==void 0)h={value:u,prev:h},u=m;continue}}if((c=u)!==void 0){u=c.nextSub;continue}while(h!==void 0)if(c=h.value,h=h.prev,c!==void 0){u=c.nextSub;continue e}break}while(!0)}function n(c,d){let u,h=0,g=!1;e:do{let p=c.dep,f=p.flags;if(d.flags&16)g=!0;else if((f&17)===17){let m=p.subs;if(e(p)){if(m.nextSub!==void 0)a(m);g=!0}}else if((f&33)===33){u={value:c,prev:u},c=p.deps,d=p,++h;continue}if(!g){let m=c.nextDep;if(m!==void 0){c=m;continue}}while(h--){if(c=u.value,u=u.prev,g){let C=d.subs;if(e(d)){if(C.nextSub!==void 0)a(C);d=c.sub;continue}g=!1}else d.flags&=-33;d=c.sub;let m=c.nextDep;if(m!==void 0){c=m;continue e}}return g&&!!d.flags}while(!0)}function a(c){do{let d=c.sub,u=d.flags;if((u&48)===32){if(d.flags=u|16,(u&6)===2)t(d)}}while((c=c.nextSub)!==void 0)}function l(c,d){let u=d.depsTail;while(u!==void 0){if(u===c)return!0;u=u.prevDep}return!1}}var ba=0,po=0,sv=0,Xs=0,go=0,Pe,Rt=[],{link:Sa,unlink:fo,propagate:iv,checkDirty:ov,shallowPropagate:rv}=tv({update(e){if("getter"in e)return nv(e);if("currentValue"in e)return jd(e);return e.flags=1,!0},notify(e){let t=go,s=t;do if(Rt[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);go=t;while(s<--t){let i=Rt[s];Rt[s++]=Rt[t],Rt[t]=i}},unwatched(e){if("getter"in e){if(e.depsTail!==void 0)e.flags=17,Er(e)}else if("currentValue"in e);else if("fn"in e)Yd.call(e);else ya.call(e)}});function Fr(e){return cv.bind({currentValue:e,pendingValue:e,subs:void 0,subsTail:void 0,flags:1})}function es(e){if(typeof e!=="function")return console.error("[sigpro] effect() expects a function, got",typeof e),()=>{};let t={fn:e,cleanup:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:6},s=Pe;if(Pe=t,s!==void 0)Sa(t,s,0),s.flags|=64;try{++po;let i=t.fn();t.cleanup=typeof i==="function"?i:void 0}catch(i){t.flags=0,Er(t),wa(i,t.fn)}finally{--po,Pe=s,t.flags&=-5}return Yd.bind(t)}function $d(e){let t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:1},s=Pe;if(Pe=t,s!==void 0)Sa(t,s,0),s.flags|=64;try{e()}finally{Pe=s}return ya.bind(t)}function nv(e){if(e.flags&64){let s=e.depsTail;while(s!==void 0){let i=s.prevDep,o=s.dep;if(!("getter"in o)&&!("currentValue"in o))fo(s,e);s=i}}e.depsTail=void 0,e.flags=5;let t=Pe;Pe=e;try{++ba;let s=e.value;return!Object.is(s,e.value=e.getter(s))}finally{Pe=t,e.flags&=-5,Xd(e)}}function jd(e){return e.flags=1,!Object.is(e.currentValue,e.currentValue=e.pendingValue)}function av(e){let t=e.flags;if(t&16||t&32&&ov(e.deps,e)){if(t&64){let i=e.depsTail;while(i!==void 0){let o=i.prevDep,r=i.dep;if(!("getter"in r)&&!("currentValue"in r))fo(i,e);i=o}}if(e.cleanup){if(qd(e),!e.flags)return}e.depsTail=void 0,e.flags=6;let s=Pe;Pe=e;try{++ba,++po;let i=e.fn();e.cleanup=typeof i==="function"?i:void 0}catch(i){e.flags=0,Er(e),wa(i,e.fn)}finally{--po,Pe=s,e.flags&=-5,Xd(e)}}else if(e.deps!==void 0)e.flags=2|t&64}function lv(){try{while(Xs<go){let e=Rt[Xs];Rt[Xs++]=void 0,av(e)}}finally{while(Xs<go){let e=Rt[Xs];Rt[Xs++]=void 0,e.flags|=10}if(Xs=0,go=0,Rt.length>64)Rt.length=64}}function cv(...e){if(e.length){if(!Object.is(this.pendingValue,this.pendingValue=e[0])){this.flags=17;let t=this.subs;if(t!==void 0){if(iv(t,!!po),!sv)lv()}}}else{if(this.flags&16){if(jd(this)){let s=this.subs;if(s!==void 0)rv(s)}}let t=Pe;if(t!==void 0)Sa(this,t,ba);return this.currentValue}}function qd(e){let t=e.cleanup;e.cleanup=void 0;let s=Pe;Pe=void 0;try{t()}finally{Pe=s}}function Yd(){if(ya.call(this),this.cleanup)qd(this)}function ya(){this.flags=0,Er(this);let e=this.subs;if(e!==void 0)fo(e)}function Er(e){let t=e.depsTail;while(t!==void 0){let s=t.prevDep;fo(t,e),t=s}}function Xd(e){let t=e.depsTail,s=t!==void 0?t.nextDep:e.deps;while(s!==void 0)s=fo(s,e)}function Pr(e){let t=Pe;Pe=void 0;try{return e()}finally{Pe=t}}var ms=typeof document<"u"?document:null,dv="http://www.w3.org/2000/svg",uv=new Set("svg path circle rect line polyline polygon g defs text textPath tspan use symbol image marker ellipse foreignObject clipPath mask linearGradient radialGradient pattern filter stop animate animateMotion animateTransform view desc metadata title switch feGaussianBlur feOffset feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feImage feMerge feMergeNode feMorphology fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" ")),hv=new Set(["allowFullscreen","async","autofocus","autoplay","checked","controls","defer","disabled","formNoValidate","hidden","inert","loop","multiple","muted","noValidate","open","playsInline","readOnly","required","reversed","selected"]);function xr(e,t,s,i){let o=t.toLowerCase();if(o==="innerhtml"||o==="outerhtml"||o==="srcdoc")return;if(o.startsWith("on")&&s!=null&&s!==!1)return;if(/^(href|src|action|formaction|poster|data|xlink:href)$/i.test(t)&&s!=null&&s!==!1){if(typeof s!=="string")return;try{let r=new URL(s,"https://placeholder.invalid/").protocol,n=r==="data:"&&o==="src"&&/^(img|source|video|audio|track|input)$/i.test(e.tagName)&&/^data:image\/(png|jpe?g|gif|webp|avif|bmp);/i.test(s.trim());if(!/^(https?|mailto|tel|blob):$/.test(r)&&!n)return}catch{return}}if(t==="class"||t==="className"){if(i)if(s==null||s===!1)e.removeAttribute("class");else e.setAttribute("class",s===!0?"":s);else e.className=s??"";return}if(hv.has(t)&&!i&&t in e){let r=s!=null&&s!==!1;if(e[t]=r,r)e.setAttribute(t,"");else e.removeAttribute(t);return}if(s==null||s===!1){if(t==="style")e._lastStyle=void 0;e.removeAttribute(t);return}if(t==="style"){let r=e._lastStyle;if(typeof s==="string"){if(r!==void 0)e.removeAttribute("style"),e._lastStyle=void 0;e.setAttribute("style",s);return}if(typeof s==="object"){if(r){for(let n in r)if(!(n in s))if(n.startsWith("--"))e.style.removeProperty(n);else e.style[n]=""}for(let n in s){let a=s[n];if(n.startsWith("--"))if(a==null||a===!1)e.style.removeProperty(n);else e.style.setProperty(n,String(a));else e.style[n]=a==null||a===!1?"":String(a)}e._lastStyle=s;return}}if(i){e.setAttribute(t,s===!0?"":s);return}if(t in e&&typeof e[t]!=="function")e[t]=s;else e.setAttribute(t,s===!0?"":s)}function Zd(e){let t=[e];while(t.length){let s=t.pop();if(s._stopScope)s._stopScope(),s._stopScope=null;if(s._cln){for(let o of s._cln)o();s._cln=null}let i=s.childNodes;for(let o=0,r=i.length;o<r;o++)t.push(i[o])}}function Rr(e,t={},...s){if(e==null)return console.error("[sigpro] h() called with no tag"),ms.createComment("invalid tag");if(typeof e==="function"){let a,l=$d(()=>{try{a=e(t,s)}catch(d){wa(d,e),a=ms.createComment("error")}}),c=(d)=>{if(d instanceof Node)d._stopScope=l;else if(Array.isArray(d))d.forEach(c)};return c(a),a}if(typeof e!=="string")return console.error("[sigpro] h() tag must be string or function, got",typeof e),ms.createComment("invalid tag");if(t instanceof Node||Array.isArray(t)||t!==null&&typeof t!=="object")s=[t,...s],t={};let i=uv.has(e),o=i?ms.createElementNS(dv,e):ms.createElement(e),r;for(let a of Object.keys(t||{})){let l=t[a];if(a==="ref"){if(typeof l==="function")l(o);else if(l!=null&&typeof l==="object")l.current=o;continue}if(e==="select"&&a==="value"){r=l;continue}if(a.startsWith("on")&&typeof l==="function"){let c=a.slice(2).toLowerCase();o.addEventListener(c,l),(o._cln||(o._cln=[])).push(()=>o.removeEventListener(c,l))}else if(a.startsWith("on")&&l!=null&&l!==!1)console.error(`[sigpro] "${a}" expects a function, got ${typeof l}`);else if(typeof l==="function")es(()=>xr(o,a,l(),i));else xr(o,a,l,i)}if(e==="a"&&o.target==="_blank"&&!o.rel)o.rel="noopener noreferrer";let n=(a)=>{if(Array.isArray(a)){for(let l of a)n(l);return}if(a==null||a===!1||a===!0)return;if(typeof a==="function"){let l=ms.createComment("");o.appendChild(l);let c=es(()=>{let d=a(),u=Array.isArray(d)?d:[d],h=[];for(let g of u){if(g==null||g===!1||g===!0)continue;h.push(g instanceof Node?g:ms.createTextNode(String(g)))}for(let g of h)o.insertBefore(g,l);return()=>{for(let g of h)Zd(g),g.remove()}});(o._cln||(o._cln=[])).push(c);return}o.appendChild(a instanceof Node?a:ms.createTextNode(String(a)))};if(n(s),r!==void 0)if(typeof r==="function")es(()=>xr(o,"value",r(),i));else xr(o,"value",r,i);return o}var xa=Fr(typeof window<"u"?window.location.hash.slice(1)||"/":"/"),gv=Fr({});if(typeof window<"u")window.addEventListener("hashchange",()=>{xa(window.location.hash.slice(1)||"/")});var Qd=new Map,va=Fr(0);if(typeof window<"u")window.__sigpro_hmr_page__=(e,t)=>{Qd.set(e,t),va(va()+1)};var Ra=(e)=>()=>{e=[...e].sort((a,l)=>(a.path==="*")-(l.path==="*")||a.path.split("/").filter((c)=>c[0]===":").length-l.path.split("/").filter((c)=>c[0]===":").length);let t=Rr("div",{class:"router-hook"}),s,i,o,r=()=>{for(let a of t.childNodes)Zd(a);t.replaceChildren()},n=es(()=>{va();let a=xa(),c=a.split(/[?#]/)[0].split("/").filter(Boolean),d=e.find((g)=>{let p=g.path.split("/").filter(Boolean);return p.length===c.length&&p.every((f,m)=>f[0]===":"||f===c[m])})||e.find((g)=>g.path==="*");if(!d){if(s)s(),s=void 0;r(),i=o=void 0;return}let u={};d.path.split("/").filter(Boolean).forEach((g,p)=>{if(g[0]===":")try{u[g.slice(1)]=decodeURIComponent(c[p])}catch{u[g.slice(1)]=c[p]}});let h=Qd.get(d.path)??d.component;if(a===i&&h===o)return;if(i=a,o=h,s)s(),s=void 0;r(),gv(u),s=$d(()=>{let g=typeof h==="function"?Rr(h,u):h,p=g==null?[]:Array.isArray(g)?g:[g];t.replaceChildren(...p)})});return t._stopScope=()=>{if(s)s(),s=void 0;n()},t};Ra.to=(e)=>{if(typeof window<"u")window.location.hash=e.replace(/^#?\/?/,"#/")};Ra.back=()=>{if(typeof window<"u")window.history.back()};Ra.path=()=>xa();var Y4=Fr("en");function k(e){if(!e?.length)return;return e[e.length-1]}function se(e,t,s){if(e===t)return!0;if(!e||!t)return e==null&&t==null;let i=e.length;if(i!==t.length)return!1;if(s){for(let o=0;o<i;++o)if(e[o]!==t[o]&&!s(e[o],t[o]))return!1;return!0}for(let o=0;o<i;++o)if(e[o]!==t[o])return!1;return!0}function Ll(e,t){if(!t)return[];let s=t.length;if(e&&e!==t&&e.length===s){for(let i=0;i<s;++i)if(e[i]!==t[i])return t.slice();return e}return t.slice()}function mo(e,t){if(!e)return;for(let s of e)if(t(s))return!0}function ae(e,t){let s=e.indexOf(t);if(s>=0)e.splice(s,1)}function Ho(e,t){let s=0,i=0;for(;s<e.length;s++)if(!t.includes(e[s]))e[i]=e[s],i++;while(i<e.length)e.pop()}function Jd(e,t,s){for(let i=0;i<t.length;i++)ae(e,t[i]);for(let i=t.length-1;i>=0;i--)e.splice(s,0,t[i])}var de=(e)=>{if(e==null||e==="")return null;return e};function M(e){return e!=null&&e!==""}function q(e){return!M(e)}var je=(e)=>e!=null&&typeof e.toString==="function"?e.toString():null,vn=(e,t)=>{let s=e?JSON.stringify(e):null,i=t?JSON.stringify(t):null;return s===i},Yi=(e,t,s=!1)=>{if(typeof e==="object"&&e!==null&&typeof e.toNumber==="function")e=e.toNumber();if(typeof t==="object"&&t!==null&&typeof t.toNumber==="function")t=t.toNumber();if(e==null)return t==null?0:-1;if(t==null)return 1;if(!s||typeof e!=="string"){if(e>t)return 1;if(e<t)return-1;return 0}return e.localeCompare(t)},Dt=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,s){let i=t?this.allAsyncListeners:this.allSyncListeners,o=i.get(e);if(!o&&s)o=new Set,i.set(e,o);return o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,s=!1){this.getListeners(e,s,!0).add(t)}removeEventListener(e,t,s=!1){let i=this.getListeners(e,s,!1);if(!i)return;if(i.delete(t),i.size===0)(s?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){if(!this.firedEvents[e.type])this.dispatchEvent(e)}dispatchToListeners(e,t){let s=e.type;if(t&&"event"in e){let a=e.event;if(a instanceof Event)e.eventPath=a.composedPath()}let{frameworkOverrides:i}=this,o=(a)=>{let l=i?()=>i.wrapIncoming(a):a;if(t)this.dispatchAsync(l);else l()},r=this.getListeners(s,t,!1);if((r?.size??0)>0){let a=new Set(r);for(let l of a){if(!r?.has(l))continue;o(()=>l(e))}}let n=this.getGlobalListeners(t);if(n.size>0){let a=new Set(n);for(let l of a)o(()=>l(s,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){let t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},s=this.frameworkOverrides;if(s)s.wrapIncoming(t);else t();this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;let e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(let t of e)t()}},pv=/[&<>"']/g,fv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function zo(e){return e?.toString().toString()??null}function he(e){return zo(e)?.replace(pv,(t)=>fv[t])??null}function Gl(e){return typeof e==="string"&&e.length>1&&e.codePointAt(0)===61}function mv(e){if(!e||e==null)return null;let t=/([a-z])([A-Z])/g,s=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(s,"$1 $2$3").replace(/\./g," ").split(" ").map((o)=>o.substring(0,1).toUpperCase()+(o.length>1?o.substring(1,o.length):"")).join(" ")}function Ue(e){return e.eRootDiv.getRootNode()}function j(e){return Ue(e).activeElement}function ce(e){let{gos:t,eRootDiv:s}=e,i=null,o=t.get("getDocument");if(o&&M(o))i=o();else if(s)i=s.ownerDocument;if(i&&M(i))return i;return document}function ks(e){let t=j(e);return t===null||t===ce(e).body}function Ol(e){return ce(e).defaultView||window}function Ls(e){let t=null,s;try{t=ce(e).fullscreenElement}catch{}finally{if(!t)t=Ue(e);let i=t.querySelector("body");if(i)s=i;else if(t instanceof ShadowRoot)s=t;else if(t instanceof Document)s=t?.documentElement;else s=t}return s}function Cv(e){return Ls(e)?.clientWidth??(window.innerWidth||-1)}function vv(e){return Ls(e)?.clientHeight??(window.innerHeight||-1)}function Xe(e,t,s){if(s==null||typeof s==="string"&&s=="")Bl(e,t);else mt(e,t,s)}function mt(e,t,s){e.setAttribute(Sh(t),s.toString())}function Bl(e,t){e.removeAttribute(Sh(t))}function Sh(e){return`aria-${e}`}function ge(e,t){if(t)e.setAttribute("role",t);else e.removeAttribute("role")}function wv(e){let t=e?.direction;if(t==="asc")return"ascending";else if(t==="desc")return"descending";else if(t==="mixed")return"other";return"none"}function yh(e){return Number.parseInt(e.getAttribute("aria-posinset"),10)}function bv(e){return e.getAttribute("aria-label")}function fe(e,t){Xe(e,"label",t)}function ri(e,t){Xe(e,"labelledby",t)}function Xi(e,t){Xe(e,"describedby",t)}function xh(e,t){Xe(e,"live",t)}function Sv(e,t){Xe(e,"atomic",t)}function yv(e,t){Xe(e,"relevant",t)}function Vl(e,t){Xe(e,"invalid",t)}function wn(e,t){Xe(e,"level",t)}function Rh(e,t){Xe(e,"disabled",t)}function bn(e,t){Xe(e,"hidden",t)}function De(e,t){mt(e,"expanded",t)}function Fh(e){Bl(e,"expanded")}function Wo(e,t){mt(e,"setsize",t)}function Uo(e,t){mt(e,"posinset",t)}function xv(e,t){mt(e,"multiselectable",t)}function Rv(e,t){mt(e,"rowcount",t)}function qr(e,t){mt(e,"rowindex",t)}function Fv(e,t){mt(e,"colcount",t)}function Eh(e,t){mt(e,"colindex",t)}function Ev(e,t){mt(e,"colspan",t)}function Pv(e,t){mt(e,"sort",t)}function Mv(e){Bl(e,"sort")}function Sn(e,t){Xe(e,"selected",t)}function yn(e,t){mt(e,"checked",t===void 0?"mixed":t)}function Tv(e,t){Xe(e,"controls",t)}function Nl(e,t){Tv(e,t.id),ri(t,e.id)}function eu(e,t){Xe(e,"owns",t)}function Ph(e,t){Xe(e,"haspopup",t===!1?null:t)}function _l(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function Hl(e,t,s){let i=e.parentElement,o=i&&i.firstChild;while(o){if(t)o.classList.toggle(t,o===e);if(s)o.classList.toggle(s,o!==e);o=o.nextSibling}}var Dv="[tabindex], input, select, button, textarea, [href]",Mh="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function yo(e){if(!e)return!1;if(!e.matches("input, select, button, textarea"))return!1;if(!e.matches(Mh))return!1;return ve(e)}function G(e,t,s={}){let{skipAriaHidden:i}=s;if(e.classList.toggle("ag-hidden",!t),!i)bn(e,!t)}function Av(e,t,s={}){let{skipAriaHidden:i}=s;if(e.classList.toggle("ag-invisible",!t),!i)bn(e,!t)}function To(e,t){let i=t?(r)=>r.setAttribute("disabled",""):(r)=>r.removeAttribute("disabled");i(e);let o=e.querySelectorAll("input")??[];for(let r of o)i(r)}function ti(e,t,s){let i=0;while(e){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof s=="number"){if(++i>s)break}else if(e===s)break}return!1}function Zi(e){let{height:t,width:s,borderTopWidth:i,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:n,paddingTop:a,paddingRight:l,paddingBottom:c,paddingLeft:d,marginTop:u,marginRight:h,marginBottom:g,marginLeft:p,boxSizing:f}=window.getComputedStyle(e),m=Number.parseFloat;return{height:m(t||"0"),width:m(s||"0"),borderTopWidth:m(i||"0"),borderRightWidth:m(o||"0"),borderBottomWidth:m(r||"0"),borderLeftWidth:m(n||"0"),paddingTop:m(a||"0"),paddingRight:m(l||"0"),paddingBottom:m(c||"0"),paddingLeft:m(d||"0"),marginTop:m(u||"0"),marginRight:m(h||"0"),marginBottom:m(g||"0"),marginLeft:m(p||"0"),boxSizing:f}}function Ko(e){let t=Zi(e);if(t.boxSizing==="border-box")return t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth;return t.height}function ni(e){let t=Zi(e);if(t.boxSizing==="border-box")return t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth;return t.width}function Th(e){let{height:t,marginBottom:s,marginTop:i}=Zi(e);return Math.floor(t+s+i)}function Yr(e){let{width:t,marginLeft:s,marginRight:i}=Zi(e);return Math.floor(t+s+i)}function Dh(e){let t=e.getBoundingClientRect(),{borderTopWidth:s,borderLeftWidth:i,borderRightWidth:o,borderBottomWidth:r}=Zi(e);return{top:t.top+(s||0),left:t.left+(i||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function Xr(e,t){let s=e.scrollLeft;if(t)s=Math.abs(s);return s}function Zr(e,t,s){if(s)t*=-1;e.scrollLeft=t}function te(e){while(e?.firstChild)e.firstChild.remove()}function Me(e){if(e?.parentNode)e.remove()}function Ah(e){return!!e.offsetParent}function ve(e){if(e.checkVisibility)return e.checkVisibility({checkVisibilityCSS:!0});return!(!Ah(e)||window.getComputedStyle(e).visibility!=="visible")}function zl(e){let t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function Ih(e,t,s){if(s?.nextSibling===t)return;if(!e.firstChild)e.appendChild(t);else if(s)if(s.nextSibling)e.insertBefore(t,s.nextSibling);else e.appendChild(t);else if(e.firstChild&&e.firstChild!==t)e.prepend(t)}function kh(e,t){for(let s=0;s<t.length;s++){let i=t[s],o=e.children[s];if(o!==i)e.insertBefore(i,o)}}function Iv(e){return e.replace(/[A-Z]/g,(t)=>`-${t.toLocaleLowerCase()}`)}function $o(e,t){if(!t)return;for(let s of Object.keys(t)){let i=t[s];if(!s?.length||i==null)continue;let o=Iv(s),r=i.toString(),n=r.replace(/\s*!important/g,""),a=n.length!=r.length?"important":void 0;e.style.setProperty(o,n,a)}}function Hi(e){return()=>{let t=e();if(!t)return!0;return Lh(t)||kv(t)}}function Lh(e){return e.clientWidth<e.scrollWidth}function kv(e){return e.clientHeight<e.scrollHeight}function Qr(e,t){if(t==="flex")e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto";else Kt(e,t)}function Kt(e,t){t=Wl(t),e.style.width=t,e.style.maxWidth=t,e.style.minWidth=t}function xo(e,t){t=Wl(t),e.style.height=t,e.style.maxHeight=t,e.style.minHeight=t}function Wl(e){return typeof e==="number"?`${e}px`:e}function jo(e){return e instanceof Node||e instanceof HTMLElement}function Mt(e,t,s){if(s==null||s==="")e.removeAttribute(t);else e.setAttribute(t,s.toString())}function Lv(e,t){if(!t.isContentEditable)return;let s=Ol(e).getSelection();if(!s)return;let i=ce(e).createRange();i.selectNodeContents(t),i.collapse(!1),s.removeAllRanges(),s.addRange(i)}function It(e,t,s){let o=Ol(e).ResizeObserver,r=o?new o(s):null;return r?.observe(t),()=>r?.disconnect()}function et(e,t){let s=Ol(e);if(s.requestAnimationFrame)s.requestAnimationFrame(t);else if(s.webkitRequestAnimationFrame)s.webkitRequestAnimationFrame(t);else s.setTimeout(t,0)}var Gh="data-ref",Fa;function tu(){return Fa??(Fa=document.createTextNode(" ")),Fa.cloneNode()}function me(e){let{attrs:t,children:s,cls:i,ref:o,role:r,tag:n}=e,a=document.createElement(n);if(i)a.className=i;if(o)a.setAttribute(Gh,o);if(r)a.setAttribute("role",r);if(t)for(let l of Object.keys(t))a.setAttribute(l,t[l]);if(s)if(typeof s==="string")a.textContent=s;else{let l=!0;for(let c of s)if(c)if(typeof c==="string")a.appendChild(document.createTextNode(c)),l=!1;else if(typeof c==="function")a.appendChild(c());else{if(l)a.appendChild(tu()),l=!1;a.append(me(c)),a.appendChild(tu())}}return a}var Gv=["touchstart","touchend","touchmove","touchcancel","scroll"],Ov=["wheel"],Ea={},il=(()=>{let e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return(s)=>{if(typeof Ea[s]==="boolean")return Ea[s];let i=document.createElement(e[s]||"div");return s="on"+s,Ea[s]=s in i}})();function xn(e,t){if(!t||!e)return!1;return Vv(t).indexOf(e)>=0}function Bv(e){let t=[],s=e.target;while(s)t.push(s),s=s.parentElement;return t}function Vv(e){let t=e;if(t.path)return t.path;if(t.composedPath)return t.composedPath();return Bv(t)}function Nv(e,t,s){let i=_v(t),o;if(i!=null)o={passive:i};e.addEventListener(t,s,o)}var _v=(e)=>{let t=Gv.includes(e),s=Ov.includes(e);if(t)return!0;if(s)return!1};function Oh(e,t,s){if(s===0)return!1;let i=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(i,o)<=s}var Li=(e,t)=>{let s=e.identifier;for(let i=0,o=t.length;i<o;++i){let r=t[i];if(r.identifier===s)return r}return null};function Do(e,t){return e.gos.isElementInThisInstance(t.target)}function Rn(e,t,s){let o=e.getBoundingClientRect().height,r=Cv(s)-2,n=vv(s)-2;if(!e.offsetParent)return;let l=Dh(e.offsetParent),{clientY:c,clientX:d}=t,u=c-l.top-o/2,h=d-l.left-10,g=ce(s),p=g.defaultView||window,f=p.pageYOffset||g.documentElement.scrollTop,m=p.pageXOffset||g.documentElement.scrollLeft;if(r>0&&h+e.clientWidth>r+m)h=r+m-e.clientWidth;if(h<0)h=0;if(n>0&&u+e.clientHeight>n+f)u=n+f-e.clientHeight;if(u<0)u=0;e.style.left=`${h}px`,e.style.top=`${u}px`}var Vr=(e,...t)=>{for(let s of t){let[i,o,r,n]=s;i.addEventListener(o,r,n),e.push(s)}},Ul=(e)=>{if(e){for(let[t,s,i,o]of e)t.removeEventListener(s,i,o);e.length=0}},Ti=(e)=>{if(e.cancelable)e.preventDefault()};function Hv(e,t){return t}function Bh(e){return e?.getLocaleTextFunc()??Hv}function Kl(e,t,s,i){let o=t[s];return e.getLocaleTextFunc()(s,typeof o==="function"?o(i):o,i)}var xe=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(){let{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,s){if(!this.localEventService)this.localEventService=new Dt;this.localEventService.addEventListener(e,t,s)}removeEventListener(e,t,s){this.localEventService?.removeEventListener(e,t,s)}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){let s=[];for(let i of Object.keys(t)){let o=t[i];if(o)s.push(this._setupListener(e,i,o))}return s}_setupListener(e,t,s){if(this.destroyed)return()=>null;let i;if(zv(e))e.__addEventListener(t,s),i=()=>(e.__removeEventListener(t,s),null);else{let o=Wv(e);if(e instanceof HTMLElement)Nv(e,t,s);else if(o)e.addListener(t,s);else e.addEventListener(t,s);i=o?()=>(e.removeListener(t,s),null):()=>(e.removeEventListener(t,s),null)}return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter((o)=>o!==i),null)}setupPropertyListener(e,t){let{gos:s}=this;s.addPropertyEventListener(e,t);let i=()=>(s.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter((o)=>o!==i),null)}addManagedPropertyListener(e,t){if(this.destroyed)return()=>null;return this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;let s=e.join("-")+this.propertyListenerId++,i=(o)=>{if(o.changeSet){if(o.changeSet?.id===this.lastChangeSetIdLookup[s])return;this.lastChangeSetIdLookup[s]=o.changeSet.id}let r={type:"propertyChanged",changeSet:o.changeSet,source:o.source};t(r)};for(let o of e)this.setupPropertyListener(o,i)}getLocaleTextFunc(){return Bh(this.beans.localeSvc)}addDestroyFunc(e){if(this.isAlive())this.destroyFunctions.push(e);else e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){let s=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),s}createBean(e,t,s){return(t||this.stubContext).createBean(e,s)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function zv(e){return e.__addEventListener!==void 0}function Wv(e){return e.eventServiceType==="global"}var y=class extends xe{},ol=new Set,Fn=(e,t)=>{if(!ol.has(t))ol.add(t),e()};Fn._set=ol;var Uv={pending:!1,funcs:[]},Kv={pending:!1,funcs:[]};function rl(e,t="setTimeout",s){let i=t==="raf"?Kv:Uv;if(i.funcs.push(e),i.pending)return;i.pending=!0;let o=()=>{let r=i.funcs.slice();i.funcs.length=0,i.pending=!1;for(let n of r)n()};if(t==="raf")et(s,o);else window.setTimeout(o,0)}function $e(e,t,s){let i;return function(...o){let r=this;return window.clearTimeout(i),i=window.setTimeout(function(){if(e.isAlive())t.apply(r,o)},s),i}}function su(e,t){let s=0;return function(...i){let o=this,r=Date.now();if(r-s<t)return;s=r,e.apply(o,i)}}function $l(e,t,s,i=100){let o=Date.now(),r=null,n=!1,a=()=>{if(r!=null)window.clearInterval(r),r=null};e.addDestroyFunc(a);let l=()=>{let c=Date.now()-o>i;if(t()||c)s(),n=!0,a()};if(l(),!n)r=window.setInterval(l,10)}var $v=new Set(["__proto__","constructor","prototype"]);function jv(e,t){if(e==null)return;if(Array.isArray(e)){for(let s=0;s<e.length;s++)t(s.toString(),e[s]);return}for(let s of Object.keys(e).filter((i)=>!$v.has(i)))t(s,e[s])}function Se(e,t,s=!0,i=!1){if(!M(t))return;jv(t,(o,r)=>{let n=e[o];if(n===r)return;if(i){if(n==null&&r!=null){if(typeof r==="object"&&r.constructor===Object)n={},e[o]=n}}if(iu(r)&&iu(n)&&!Array.isArray(n))Se(n,r,s,i);else if(s||r!==void 0)e[o]=r})}function iu(e){return typeof e==="object"&&e!==null}var jl=class e{static applyGlobalGridOptions(t){if(!e.gridOptions)return{...t};let s={};if(Se(s,e.gridOptions,!0,!0),e.mergeStrategy==="deep")Se(s,t,!0,!0);else s={...s,...t};if(e.gridOptions.context)s.context=e.gridOptions.context;if(t.context){if(e.mergeStrategy==="deep"&&s.context)Se(t.context,s.context,!0,!0);s.context=t.context}return s}static applyGlobalGridOption(t,s){if(e.mergeStrategy==="deep"){let i=qv(t);if(i&&typeof i==="object"&&typeof s==="object")return e.applyGlobalGridOptions({[t]:s})[t]}return s}};jl.gridOptions=void 0;jl.mergeStrategy="shallow";var ql=jl;function qv(e){return ql.gridOptions?.[e]}var Yv={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2000,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,noteTrigger:"hover",noteShowDelay:180,noteHideDelay:220,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1000,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupHideColumnsUntilExpanded:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1},Vh="https://www.ag-grid.com";function Ao(e,t,...s){if(e.get("debug"))console.log("AG Grid: "+t,...s)}function Ht(e,...t){Fn(()=>Nh(e,...t),e+t?.join(""))}function Gi(e,...t){Fn(()=>Xv(e,...t),e+t?.join(""))}function Xv(e,...t){console.error("AG Grid: "+e,...t)}function Nh(e,...t){console.warn("AG Grid: "+e,...t)}var _h=new Set,Jr={},si={},Nr,Hh=!1,zh=!1,Zv=!1;function Qv(e){let[t,s]=e.version.split(".")||[],[i,o]=Nr.split(".")||[];return t===i&&s===o}function Jv(e){if(!Nr)Nr=e.version;let t=(i)=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${i} Please update all modules to the same version.`;if(!e.version)Gi(t(`'${e.moduleName}' is incompatible.`));else if(!Qv(e))Gi(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${Nr}.`));let s=e.validate?.();if(s&&!s.isValid)Gi(`${s.message}`)}function Io(e,t,s=!1){if(!s)Hh=!0;Jv(e);let i=e.rowModels??["all"];_h.add(e);let o;if(t!==void 0){if(zh=!0,si[t]===void 0)si[t]={};o=si[t]}else o=Jr;for(let r of i){if(o[r]===void 0)o[r]={};o[r][e.moduleName]=e}if(e.dependsOn)for(let r of e.dependsOn)Io(r,t,s)}function ew(e){delete si[e]}function nl(e,t,s){let i=(o)=>!!Jr[o]?.[e]||!!si[t]?.[o]?.[e];return i(s)||i("all")}function Yl(){return zh}function tw(e,t){let s=si[e]??{};return[...Object.values(Jr.all??{}),...Object.values(s.all??{}),...Object.values(Jr[t]??{}),...Object.values(s[t]??{})]}function sw(){return new Set(_h)}function Wh(e,t){let s=si[e]??{};return[...Object.values(s.all??{}),...Object.values(s[t]??{})]}function iw(){return Hh}function Xl(){return Zv}var Uh=class{static register(e){Io(e,void 0)}static registerModules(e){for(let t of e)Io(t,void 0)}};var z="35.3.1",ou=2000,ru=100,Kh="_version_",$h=null,Oi=`${Vh}/javascript-data-grid`;function ow(e){$h=e}function rw(e){Oi=e}function jh(e,t,s){return $h?.(e,t)??[cw(e,t,s)]}function En(e,t,s,i,o){e(`${i?"warning":"error"} #${t}`,...jh(t,s,o))}function nw(e){if(!e)return String(e);let t={};for(let s of Object.keys(e))if(typeof e[s]!=="object"&&typeof e[s]!=="function")t[s]=e[s];return JSON.stringify(t)}function aw(e){let t=e;if(e instanceof Error)t=e.toString();else if(typeof e==="object")t=nw(e);return t}function _r(e){return e===void 0?"undefined":e===null?"null":e}function al(e,t){return`${e}?${t.toString()}`}function lw(e,t,s){let i=Array.from(t.entries()).sort((r,n)=>n[1].length-r[1].length),o=al(e,t);for(let[r,n]of i){if(r===Kh)continue;let a=o.length-s;if(a<=0)break;let l="...",c=a+l.length,d=n.length-c>ru?n.slice(0,n.length-c)+l:n.slice(0,ru)+l;t.set(r,d),o=al(e,t)}return o}function qh(e,t){let s=new URLSearchParams;if(s.append(Kh,z),t)for(let r of Object.keys(t))s.append(r,aw(t[r]));let i=`${Oi}/errors/${e}`,o=al(i,s);return o.length<=ou?o:lw(i,s,ou)}var cw=(e,t,s)=>{let i=qh(e,t),o=`${s?s+`
2
- `:""}Visit ${i}`;if(Xl())return o;return`${o}${s?"":`
3
- Alternatively register the ValidationModule to see the full message in the console.`}`};function F(...e){En(Ht,e[0],e[1],!0)}function X(...e){En(Gi,e[0],e[1],!1)}function bo(e,t,s){En(Gi,e,t,!1,s)}function Yh(e,t,s){En(Ht,e,t,!0,s)}function dw(e,t){let s=t[0];return`error #${s} `+jh(s,t[1],e).join(" ")}function ct(...e){return dw(void 0,e)}function Xh(e,t){return e.get("rowModelType")===t}function J(e,t){return Xh(e,"clientSide")}function Gs(e,t){return Xh(e,"serverSide")}function Te(e,t){return e.get("domLayout")===t}function ss(e){return en(e)!==void 0}function Zh(e){return typeof e.get("getRowHeight")==="function"}function uw(e,t){if(t)return!e.get("enableStrictPivotColumnOrder");return e.get("maintainColumnOrder")}function hw({gos:e,formula:t}){let s=e.get("rowNumbers");return s||!!t?.active&&s!==!1}function ko(e,t,s=!1,i){let{gos:o,environment:r}=e;if(i==null)i=r.getDefaultRowHeight();if(Zh(o)){if(s)return{height:i,estimated:!0};let l={node:t,data:t.data},c=o.getCallback("getRowHeight")(l);if(ll(c)){if(c===0)F(23);return{height:Math.max(1,c),estimated:!1}}}if(t.detail&&o.get("masterDetail"))return gw(o);let n=o.get("rowHeight");return{height:n&&ll(n)?n:i,estimated:!1}}function gw(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};let t=e.get("detailRowHeight");if(ll(t))return{height:t,estimated:!1};return{height:300,estimated:!1}}function Qh(e){let{environment:t,gos:s}=e,i=s.get("rowHeight");if(!i||q(i))return t.getDefaultRowHeight();let o=t.refreshRowHeightVariable();if(o!==-1)return o;return F(24),t.getDefaultRowHeight()}function ll(e){return!isNaN(e)&&typeof e==="number"&&isFinite(e)}function Jh(e,t,s){let i=t[e.getDomDataKey()];return i?i[s]:void 0}function ai(e,t,s,i){let o=e.getDomDataKey(),r=t[o];if(q(r))r={},t[o]=r;r[s]=i}function Bi(e){if(e.get("ensureDomOrder"))return!1;return e.get("animateRows")}function Qi(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||Te(e,"print"))}function zt(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function qt(e){let t=e.get("groupAggFiltering");if(typeof t==="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0;return}function Xt(e){return e.get("grandTotalRow")}function eg(e){switch(e){case"pinnedTop":return"top";case"pinnedBottom":return"bottom";default:return null}}function Pn(e){let t=e.get("groupTotalRow");if(typeof t==="function")return e.getCallback("groupTotalRow");return()=>t??void 0}function qo(e){if(!!e.get("groupHideOpenParents"))return!0;return e.get("groupDisplayType")==="multipleColumns"}function Zl(e){return qo(e)&&e.get("groupHideColumnsUntilExpanded")&&J(e)}function Mn(e,t){if(t)return!1;return e.get("groupDisplayType")==="groupRows"}function tg(e,t,s){return!!t.group&&!t.footer&&Mn(e,s)}function cl(e){let t=e.getCallback("getRowId");if(t===void 0)return t;return(s)=>{let i=t(s);if(typeof i!=="string")Fn(()=>F(25,{id:i}),"getRowIdString"),i=String(i);return i}}function pw(e,t){let s=e.get("groupHideParentOfSingleChild");if(s===!0)return!0;if(s==="leafGroupsOnly"&&t.leafGroup)return!0;if(e.get("groupRemoveSingleChildren"))return!0;if(e.get("groupRemoveLowestSingleChildren")&&t.leafGroup)return!0;return!1}function Tn(e,t){let s=e.get("suppressGroupChangesColumnVisibility");if(s===!0)return!1;if(t&&s==="suppressHideOnGroup")return!1;if(!t&&s==="suppressShowOnUngroup")return!1;let i=e.get("suppressRowGroupHidesColumns");if(t&&i===!0)return!1;let o=e.get("suppressMakeColumnVisibleAfterUnGroup");if(!t&&o===!0)return!1;return!0}function Es(e){return e?.checkboxes??!0}function Hr(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function zi(e){if(typeof e!=="object")return;return e.checkboxLocation??"selectionColumn"}function Pa(e){return e?.hideDisabledCheckboxes??!1}function fw(e){return typeof e.get("rowSelection")!=="string"}function sg(e){return e.get("cellSelection")!==void 0}function ig(e){let t=e.get("cellSelection");if(t===void 0)return e.get("suppressMultiRangeSelection");return typeof t!=="boolean"?t?.suppressMultiRanges??!1:!1}function qe(e){let t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function Dn(e){let t=e.get("cellSelection");if(t===void 0)return{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")};return typeof t!=="boolean"&&t.handle?.mode==="fill"?t.handle:void 0}function is(e){let t=e.get("cellSelection")??!1;return(typeof t==="object"&&t.enableColumnSelection)??!1}function og(e){let t=e.get("rowSelection")??"single";if(typeof t==="string"){let s=e.get("suppressRowClickSelection"),i=e.get("suppressRowDeselection");if(s&&i)return!1;else if(s)return"enableDeselection";else if(i)return"enableSelection";else return!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function mw(e){let t=og(e);return t===!0||t==="enableSelection"}function Cw(e){let t=og(e);return t===!0||t==="enableDeselection"}function dl(e){let t=e.get("rowSelection");if(typeof t==="string")return e.get("isRowSelectable");return t?.isRowSelectable}function en(e){let 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 Lo(e){return en(e)==="multiRow"}function vw(e){let t=e.get("rowSelection");if(typeof t==="string")return e.get("rowMultiSelectWithClick");return t?.enableSelectionWithoutKeys??!1}function tn(e){let t=e.get("rowSelection");if(typeof t==="string"){let s=e.get("groupSelectsChildren"),i=e.get("groupSelectsFiltered");if(s&&i)return"filteredDescendants";else if(s)return"descendants";else return"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function rg(e,t=!0){let s=e.get("rowSelection");if(typeof s!=="object")return t?"all":void 0;return s.mode==="multiRow"?s.selectAll:"all"}function ww(e){let t=e.get("rowSelection");if(typeof t==="string")return!1;return t?.mode==="multiRow"?t.ctrlASelectsRows??!1:!1}function Go(e){let t=tn(e);return t==="descendants"||t==="filteredDescendants"}function nu(e){let t=e.get("rowSelection");return typeof t==="object"&&t.masterSelects||"self"}function bw(e){return e.isModuleRegistered("SetFilter")&&!e.get("suppressSetFilterByDefault")}function be(e){return e.get("columnMenu")==="legacy"}function Ql(e){return!be(e)}function Sw(e){if(!e||e.length<2)return e;return"on"+e[0].toUpperCase()+e.substring(1)}function I(e,t){return e.addCommon(t)}function Jl({gos:e},t){return t.button===2||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var yw={resizable:!0,sortable:!0},xw=0;function ng(){return xw++}function ht(e){return e instanceof Ct}var Rw=["asc","desc",null],Fw=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],Ct=class extends y{constructor(e,t,s,i){super();this.colDef=e,this.userProvidedColDef=t,this.colId=s,this.primary=i,this.isColumn=!0,this.instanceId=ng(),this.autoHeaderHeight=null,this.sortDef=nt(),this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.formulaRef=null,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new Dt,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=he(s)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){let{colDef:e,beans:{sortSvc:t,pinnedCols:s,colFlex:i}}=this;t?.initCol(this);let o=e.hide;if(o!==void 0)this.visible=!o;else this.visible=!e.initialHide;s?.initCol(this),i?.initCol(this)}setColDef(e,t,s){let i=e.spanRows!==this.colDef.spanRows;if(this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),i)this.beans.rowSpanSvc?.deregister(this),this.initRowSpan();this.dispatchColEvent("colDefChanged",s)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){let{gos:e,colDef:{field:t,tooltipField:s}}=this,i=e.get("suppressFieldDotNotation");this.fieldContainsDots=M(t)&&t.includes(".")&&!i,this.tooltipFieldContainsDots=M(s)&&s.includes(".")&&!i}initMinAndMaxWidths(){let 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(){if(this.colDef.spanRows)this.beans.rowSpanSvc?.register(this)}addPivotListener(){let e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;if(!e||!t)return;this.addManagedListeners(t,{colDefChanged:(s)=>{let i=e.recreateColDef(this.colDef);this.setColDef(i,i,s.source)}})}resetActualWidth(e){let t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let 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);let s=this.frameworkEventListenerService?.wrap(e,t)??t;this.colEventSvc.addEventListener(e,s)}removeEventListener(e,t){let s=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc.removeEventListener(e,s)}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]??yw[e]}isColumnFunc(e,t){if(typeof t==="boolean")return t;if(typeof t==="function"){let s=this.createColumnFunctionCallbackParams(e);return t(s)}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(){if(!this.sortDef.direction)return null;return this.sortDef}getColDefAllowedSortTypes(){let e=[],{sort:t,initialSort:s}=this.colDef,i=t===null?t:At(t?.type),o=s===null?s:At(s?.type);if(i)e.push(i);if(o)e.push(o);return e}getSortingOrder(){let e=this.getColDefAllowedSortTypes().includes("absolute")?Fw:Rw;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??e).map((t)=>nt(t))}getAvailableSortTypes(){let e=this.getSortingOrder().reduce((t,s)=>{if(s.direction)t.push(s.type);return t},this.getColDefAllowedSortTypes());return new Set(e)}setSortDef(e){this.sortDef=e}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.getSort()==="asc"}isSortDescending(){return this.getSort()==="desc"}isSortNone(){return q(this.getSort())}isSorting(){return M(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){if(this.oldLeft=this.left,this.left!==e)this.left=e,this.dispatchColEvent("leftChanged",t)}isFilterActive(){return this.filterActive}isHovered(){return F(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){if(this.firstRightPinned!==e)this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t)}setLastLeftPinned(e,t){if(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){let s=e===!0;if(this.visible!==s)this.visible=s,this.dispatchColEvent("visibleChanged",t);this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.colDef.suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();while(e?.isPadding())e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.parent;if(!e?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};let t=e.getPaddingLevel()+1,s=!0;while(e){if(!e.isPadding()){s=!1;break}e=e.parent}return{numberOfParents:t,isSpanningTotal:s}}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){let 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(q(this.colDef.colSpan))return 1;let t=this.createBaseColDefParams(e),s=this.colDef.colSpan(t);return Math.max(s,1)}getRowSpan(e){if(q(this.colDef.rowSpan))return 1;let t=this.createBaseColDefParams(e),s=this.colDef.rowSpan(t);return Math.max(s,1)}setActualWidth(e,t,s=!1){if(e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e){if(this.actualWidth=e,this.flex!=null&&t!=="flex"&&t!=="gridInitializing")this.flex=null;if(!s)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,s){let i=this.createColumnEvent(e,t);if(s)Se(i,s);this.colEventSvc.dispatchEvent(i)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function nt(e){if(Vi(e))return{direction:e.direction,type:e.type};return{direction:An(e),type:At(e)}}function Ps(e){return e==="asc"||e==="desc"||e===null}function ec(e){return e==="default"||e==="absolute"}function Vi(e){if(!e||typeof e!=="object")return!1;let t=e;return ec(t.type)&&Ps(t.direction)}function zr(e,t){if(!e)return t?t.direction===null:!0;if(!t)return e?e.direction===null:!0;return e.type===t.type&&e.direction===t.direction}function An(e){return Ps(e)?e:null}function At(e){return ec(e)?e:"default"}function tc(e,t,s){let o=s?.()??t.sortSvc.getDisplaySortForColumn(e),r=At(o?.type),n=An(o?.direction),a=e.getAvailableSortTypes(),l=a.has("default"),c=a.has("absolute");return{isDefaultSortAllowed:l,isAbsoluteSortAllowed:c,isAbsoluteSort:r==="absolute",isDefaultSort:r==="default",isAscending:n==="asc",isDescending:n==="desc",direction:n}}function ue(e){return e instanceof ii}var ii=class extends y{constructor(e,t,s,i){super();this.colGroupDef=e,this.groupId=t,this.padding=s,this.level=i,this.isColumn=!1,this.expandable=!1,this.instanceId=ng(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){if(this.expandableListenerRemoveCallback)this.reset(null,void 0);super.destroy()}reset(e,t){if(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(){if(this.children)return this.children.some((e)=>e.isVisible());return!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(){let e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(!this.children)return;for(let t of this.children)if(ht(t))e(t);else if(ue(t))t.forEachLeafColumn(e)}addLeafColumns(e){if(!this.children)return;for(let t of this.children)if(ht(t))e.push(t);else if(ue(t))t.addLeafColumns(e)}getColumnGroupShow(){let e=this.colGroupDef;if(!e)return;return e.columnGroupShow}setupExpandable(){if(this.setExpandable(),this.expandableListenerRemoveCallback)this.expandableListenerRemoveCallback();let e=this.onColumnVisibilityChanged.bind(this);for(let t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(let t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,s=!1,i=this.findChildrenRemovingPadding();for(let r=0,n=i.length;r<n;r++){let a=i[r];if(!a.isVisible())continue;let l=a.getColumnGroupShow();if(l==="open")e=!0,s=!0;else if(l==="closed")t=!0,s=!0;else e=!0,t=!0}let o=e&&t&&s;if(this.expandable!==o)this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"})}findChildrenRemovingPadding(){let e=[],t=(s)=>{for(let i of s)if(ue(i)&&i.isPadding())t(i.children);else e.push(i)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},Ew={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function ul(e,t,s){let i={},o=e.gos;return Object.assign(i,o.get("defaultColGroupDef")),Object.assign(i,t),o.validateColDef(i,s),i}var Pw=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=je(e);let s=0;while(!0){let i=e??t;if(i){if(s!==0)i+="_"+s}else i=s;if(!this.existingKeys[i]){let o=String(i);if(e&&s>0)F(273,{providedId:e,usedId:o});return this.existingKeys[o]=!0,o}s++}}},ag=(e,t)=>{if(ue(e))e.setupExpandable();e.originalParent=t};function lg(e,t=null,s,i,o){let{existingCols:r,existingGroups:n}=cg(i),a=new Map(r.map((f)=>[f.getId(),f])),l=new Map(n.map((f)=>[f.getId(),f])),c=0,d=(f,m)=>{if(c=Math.max(c,m),gg(f)){if(!e.colGroupSvc)return null;let S=f.groupId,x=l.get(S),R=ul(e,f,S),P=new ii(R,S,!1,m);if(e.context.createBean(P),x)P.setExpanded(x.isExpanded());return P.setChildren(f.children.map((D)=>d(D,m+1))),P}let C=f.colId,v=a.get(C),w=ns(e,f,v?.colId??C);if(!v)v=new Ct(w,f,C,s),e.context.createBean(v);else v.setColDef(w,f,o),hg(e,v,w,o);return e.dataTypeSvc?.addColumnListeners(v),v},u=t?.map((f)=>d(f,0))??[],h=0,g={getUniqueKey:(f,m)=>String(++h)},p=e.colGroupSvc?e.colGroupSvc.balanceColumnTree(u,0,c,g):u;return $t(null,p,ag),{columnTree:p,treeDepth:c}}function sc(e,t=null,s,i,o){let r=new Pw,{existingCols:n,existingGroups:a,existingColKeys:l}=cg(i);r.addExistingKeys(l);let c=dg(e,t,0,s,n,r,a,o),{colGroupSvc:d}=e,u=d?.findMaxDepth(c,0)??0,h=d?d.balanceColumnTree(c,0,u,r):c;return $t(null,h,ag),{columnTree:h,treeDepth:u}}function cg(e){let t=[],s=[],i=[];if(e)$t(null,e,(o)=>{if(ue(o)){let r=o;s.push(r)}else{let r=o;i.push(r.getId()),t.push(r)}});return{existingCols:t,existingGroups:s,existingColKeys:i}}function dg(e,t,s,i,o,r,n,a){if(!t)return[];let{colGroupSvc:l}=e,c=Array(t.length);for(let d=0;d<c.length;d++){let u=t[d];if(l&&gg(u))c[d]=l.createProvidedColumnGroup(i,u,s,o,r,n,a);else c[d]=Mw(e,i,u,o,r,a)}return c}function Mw(e,t,s,i,o,r){let n=Tw(s,i);if(n)i?.splice(n.idx,1);let a=n?.column;if(!a){let l=o.getUniqueKey(s.colId,s.field),c=ns(e,s,l);a=new Ct(c,s,l,t),e.context.createBean(a)}else{let l=ns(e,s,a.colId);a.setColDef(l,s,r),hg(e,a,l,r)}return e.dataTypeSvc?.addColumnListeners(a),a}function ug(e,t,s,i,o,r,n,a){let{sortSvc:l,pinnedCols:c,colFlex:d}=e;if(s!==void 0)t.setVisible(!s,a);if(l){if(l.updateColSort(t,i,a),o!==void 0)l.setColSortIndex(t,o)}if(r!==void 0)c?.setColPinned(t,r);if(n!==void 0)d?.setColFlex(t,n)}function hg(e,t,s,i){ug(e,t,s.hide,s.sort,s.sortIndex,s.pinned,s.flex,i);let o=t.getFlex();if(o!=null&&o>0)return;if(s.width!=null)t.setActualWidth(s.width,i);else{let r=t.getActualWidth();t.setActualWidth(r,i)}}function Tw(e,t){if(!t)return;for(let s=0;s<t.length;s++){let i=t[s].getUserProvidedColDef();if(!i)continue;if(e.colId!=null){if(t[s].getId()===e.colId)return{idx:s,column:t[s]};continue}if(e.field!=null){if(i.field===e.field)return{idx:s,column:t[s]};continue}if(i===e)return{idx:s,column:t[s]}}return}function ns(e,t,s,i){let{gos:o,dataTypeSvc:r}=e,n={},a=o.get("defaultColDef");Se(n,a,!1,!0);let l=Dw(e,n,t,s);if(l)Aw(e,l,n);let c=n.cellDataType;if(Se(n,t,!1,!0),c!==void 0)n.cellDataType=c;let d=o.get("autoGroupColumnDef"),u=zt(o);if(t.rowGroup&&d&&u)Se(n,{sort:d.sort,initialSort:d.initialSort},!1,!0);return r?.postProcess(n),r?.validateColDef(n,t,a,s),o.validateColDef(n,s,i),n}function Dw(e,t,s,i){let o=e.dataTypeSvc?.updateColDefAndGetColumnType(t,s,i),r=s.type??o??t.type;return t.type=r,r?sn(r):void 0}function Aw(e,t,s){if(!t.length)return;let i=Object.assign({},Ew),o=e.gos.get("columnTypes")||{};for(let r of Object.keys(o)){let n=o[r];if(r in i)F(34,{key:r});else{if(n.type)F(35);i[r]=n}}for(let r of t){let n=i[r.trim()];if(n)Se(s,n,!1,!0);else F(36,{t:r})}}function gg(e){return e.children!==void 0}function $t(e,t,s){if(!t)return;for(let i=0;i<t.length;i++){let o=t[i];if(ue(o))$t(o,o.getChildren(),s);s(o,e)}}var hi="ag-Grid-AutoColumn",pg="ag-Grid-SelectionColumn",fg="ag-Grid-RowNumbersColumn",mg="ag-Grid-HierarchyColumn";function In(e){let t=[],s=(i)=>{for(let o=0;o<i.length;o++){let r=i[o];if(ht(r))t.push(r);else if(ue(r))s(r.getChildren())}};return s(e),t}function ts(e){return e.reduce((t,s)=>t+s.getActualWidth(),0)}function gt(e,t,s){let i={};if(!t)return;if($t(null,t,(r)=>{i[r.getInstanceId()]=r}),s)$t(null,s,(r)=>{i[r.getInstanceId()]=null});let o=Object.values(i).filter((r)=>r!=null);e.context.destroyBeans(o)}function gi(e){return e.getId().startsWith(hi)}function Zt(e){return(typeof e==="string"?e:("getColId"in e)?e.getColId():e.colId)?.startsWith(pg)??!1}function Oe(e){return(typeof e==="string"?e:("getColId"in e)?e.getColId():e.colId)?.startsWith(fg)??!1}function Yo(e){return Zt(e)||Oe(e)}function sn(e){let t=[];if(e instanceof Array)t=e;else if(typeof e==="string")t=e.split(",");return t}function Xo(e,t){return se(e,t,(s,i)=>s.colId===i.colId)}function Zo(e){e.map={};for(let t of e.list)e.map[t.getId()]=t}function Ms(e){return e==="optionsUpdated"?"gridOptionsChanged":e}function jt(e,t){return e===t||e.colId==t||e.colDef===t}var Iw=(e,t)=>(s,i)=>{let o={value1:void 0,value2:void 0},r=!1;if(e){if(e[s]!==void 0)o.value1=e[s],r=!0;if(M(i)&&e[i]!==void 0)o.value2=e[i],r=!0}if(!r&&t){if(t[s]!==void 0)o.value1=t[s];if(M(i)&&t[i]!==void 0)o.value2=t[i]}return o};function ic(e,t){let s={...e,sort:void 0,colId:t},i=Cg(e);if(i)s.sort=i.direction,s.sortType=i.type;return s}function Cg(e){let{sort:t,initialSort:s}=e,i=Vi(t)||Ps(t),o=Vi(s)||Ps(s);if(i)return nt(t);if(o)return nt(s);return null}function vg(e,t){return e+"_"+t}function we(e){return e instanceof Oo}var Oo=class extends y{constructor(e,t,s,i){super();this.providedColumnGroup=e,this.groupId=t,this.partId=s,this.pinned=i,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=he(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return vg(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){let e=this.getProvidedColumnGroup().getLeafColumns();if(!e||e.length===0)return!1;return e.every((t)=>t.isMoving())}checkLeft(){for(let e of this.displayedChildren)if(we(e))e.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){let t=k(this.displayedChildren).getLeft();this.setLeft(t)}else{let e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){if(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(let t of this.displayedChildren??[])e+=t.getActualWidth();return e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;for(let t of this.displayedChildren)if(t.isResizable())e=!0;return e}getMinWidth(){let e=0;for(let t of this.displayedChildren)e+=t.getMinWidth();return e}addChild(e){if(!this.children)this.children=[];this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){let e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){let 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){let t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){for(let t of this.displayedChildren??[])if(ht(t))e.push(t);else if(we(t))t.addDisplayedLeafColumns(e)}addLeafColumns(e){for(let t of this.children??[])if(ht(t))e.push(t);else if(we(t))t.addLeafColumns(e)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){let e=this.parent;if(!this.isPadding()||!e?.isPadding())return 0;return 1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;while(e?.isPadding())e=e.parent;if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}for(let s of this.children??[]){if(we(s)&&!s.displayedChildren?.length)continue;switch(s.getColumnGroupShow()){case"open":if(e.getProvidedColumnGroup().isExpanded())this.displayedChildren.push(s);break;case"closed":if(!e.getProvidedColumnGroup().isExpanded())this.displayedChildren.push(s);break;default:this.displayedChildren.push(s);break}}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},oc="ROOT_NODE_ID",Bo="rowGroupFooter_",on="detail_",kw=Bo+oc,b={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"},Lw=65,Gw=67,Ow=86,Bw=68,Vw=90,Nw=89;function wg(e){let{keyCode:t}=e,s;switch(t){case Lw:s=b.A;break;case Gw:s=b.C;break;case Ow:s=b.V;break;case Bw:s=b.D;break;case Vw:s=b.Z;break;case Nw:s=b.Y;break;default:s=e.code}return s}function bg(e){return typeof e.then==="function"}function _w(e,t){return new B((s)=>{s(window.setInterval(e,t))})}var B=class e{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t((s)=>this.onDone(s),(s)=>this.onReject(s))}static all(t){return t.length?new e((s)=>{let i=t.length,o=Array(i);t.forEach((r,n)=>{r.then((a)=>{if(o[n]=a,i--,i===0)s(o)})})}):e.resolve()}static resolve(t=null){return new e((s)=>s(t))}then(t){return new e((s)=>{if(this.status===1)s(t(this.resolution));else this.waiters.push((i)=>s(t(i)))})}onDone(t){this.status=1,this.resolution=t;for(let s of this.waiters)s(t)}onReject(t){}},Hw=class extends xe{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){let s={capturePointer:!0,dragSource:e,eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:(i)=>this.onDragStart(e,i),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push(s),this.beans.dragSvc.addDragSource(s)}setDragImageCompIcon(e,t=!1){let s=this.dragImageComp;if(s&&(t||this.dragImageLastIcon!==e))this.dragImageLastIcon=e,s.setIcon(e,t)}removeDragSource(e){let{dragSourceAndParamsList:t,beans:s}=this;for(let i=0,o=t.length;i<o;i++)if(t[i].dragSource===e){let r=t[i];s.dragSvc?.removeDragSource(r),t.splice(i,1);break}}destroy(){let{dragSourceAndParamsList:e,dropTargets:t,beans:s}=this,i=s.dragSvc;for(let o of e)i?.removeDragSource(o);e.length=0,t.length=0,this.externalDropZoneCount=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){let e=this.lastMouseEvent;if(e)this.onDragging(e,!0)}onDragStart(e,t){this.lastMouseEvent=t,this.dragSource=e,this.dragItem=e.getDragItem();let s=e.eElement.getBoundingClientRect();this.dragInitialSourcePointerOffsetX=t.clientX-s.left,this.dragInitialSourcePointerOffsetY=t.clientY-s.top,e.onDragStarted?.(),this.createAndUpdateDragImageComp(e)}onDragStop(e){let{dragSource:t,lastDropTarget:s}=this;if(t?.onDragStopped?.(),s){let i=this.dropTargetEvent(s,e,!1);s.onDragStop?.(i)}this.clearDragAndDropProperties()}onDragCancel(){let{dragSource:e,lastDropTarget:t,lastMouseEvent:s}=this;if(e?.onDragCancelled?.(),t&&s){let i=this.dropTargetEvent(t,s,!1);t.onDragCancel?.(i)}this.clearDragAndDropProperties()}onDragging(e,t=!1){this.positionDragImageComp(e);let s=this.findCurrentDropTarget(e),{lastDropTarget:i,dragSource:o,dragItem:r}=this,n=!1;if(s!==i){if(n=!0,i){let a=this.dropTargetEvent(i,e,t);i.onDragLeave?.(a)}if(i!==null&&!s)this.handleExit(o,r);else if(i===null&&s)this.handleEnter(o,r);if(s){let a=this.dropTargetEvent(s,e,t);s.onDragEnter?.(a)}this.lastDropTarget=s}else if(s){let a=this.dropTargetEvent(s,e,t);if(s.onDragging?.(a),a?.changed)n=!0}if(this.lastMouseEvent=e,n)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){let t=e.getContainer(),s=e.getSecondaryContainers?.(),i=s?.length;if(!i)return[[t]];let o=Array(i+1);o[0]=[t];for(let r=0;r<i;++r)o[r+1]=s[r];return o}isMouseOnDropTarget(e,t){let s=this.getAllContainersFromDropTarget(t),i=!1,o=(a,l)=>{for(let c of l){let{width:d,height:u,left:h,right:g,top:p,bottom:f}=c.getBoundingClientRect();if(d===0||u===0)return!1;let m=a.clientX>=h&&a.clientX<g,C=a.clientY>=p&&a.clientY<f;if(!m||!C)return!1}return!0};for(let a of s)if(o(e,a)){i=!0;break}let{eElement:r,type:n}=this.dragSource;if(t.targetContainsSource&&!t.getContainer().contains(r))return!1;return i&&t.isInterestedIn(n,r)}findCurrentDropTarget(e){let t=[],s=this.dropTargets;for(let n=0,a=s.length;n<a;++n){let l=s[n];if(this.isMouseOnDropTarget(e,l))t.push(l)}let i=t.length;if(i===0)return null;if(i===1)return t[0];let r=Ue(this.beans).elementsFromPoint(e.clientX,e.clientY);for(let n=0,a=r.length;n<a;++n){let l=r[n];for(let c=0,d=t.length;c<d;c++){let u=t[c],h=this.getAllContainersFromDropTarget(u),g=!1;for(let p=0,f=h.length;p<f&&!g;p++){let m=h[p];for(let C=0,v=m.length;C<v;C++)if(m[C]===l){g=!0;break}}if(g)return u}}return null}addDropTarget(e){if(this.dropTargets.push(e),e.external)this.externalDropZoneCount++}removeDropTarget(e){let t=e.getContainer(),s=this.dropTargets,i=0;for(let o=0,r=s.length;o<r;++o){let n=s[o];if(n.getContainer()===t){if(n.external)--this.externalDropZoneCount;continue}if(i!==o)s[i]=n;++i}s.length=i}hasExternalDropZones(){return this.externalDropZoneCount>0}findExternalZone(e){let t=this.dropTargets;for(let s=0,i=t.length;s<i;++s){let o=t[s];if(o.external&&o.getContainer()===e)return o}return null}dropTargetEvent(e,t,s){let{dragSource:i,dragItem:o,lastDraggingEvent:r,lastMouseEvent:n,dragInitialSourcePointerOffsetX:a,dragInitialSourcePointerOffsetY:l}=this,c=e.getContainer(),d=c.getBoundingClientRect(),{clientX:u,clientY:h}=t,g=u-(n?.clientX||0),p=h-(n?.clientY||0),f=this.createEvent({event:t,x:u-d.left,y:h-d.top,vDirection:p>0?"down":p<0?"up":null,hDirection:g<0?"left":g>0?"right":null,initialSourcePointerOffsetX:a,initialSourcePointerOffsetY:l,dragSource:i,fromNudge:s,dragItem:o,dropZoneTarget:c,dropTarget:r?.dropTarget??null,changed:!!r?.changed});return this.lastDraggingEvent=f,f}positionDragImageComp(e){let t=this.dragImageComp?.getGui();if(t)Rn(t,e,this.beans)}removeDragImageComp(e){if(this.dragImageComp===e)this.dragImageComp=null;if(e)e.getGui()?.remove(),this.destroyBean(e)}createAndUpdateDragImageComp(e){let t=this.createDragImageComp(e)??null;this.dragImageCompPromise=t,t?.then((s)=>{let i=this.lastMouseEvent;if(t!==this.dragImageCompPromise||!i||!this.isAlive()){this.destroyBean(s);return}this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;let o=this.dragImageComp;if(o!==s)this.dragImageComp=s,this.removeDragImageComp(o);if(s)this.appendDragImageComp(s),this.updateDragImageComp(),this.positionDragImageComp(i)})}appendDragImageComp(e){let t=e.getGui(),s=t.style;if(s.position="absolute",s.zIndex="9999",this.beans.dragSvc?.hasPointerCapture())s.pointerEvents="none";this.gos.setInstanceDomData(t),this.beans.environment.applyThemeClasses(t),s.top="20px",s.left="20px";let i=Ls(this.beans);if(!i)this.warnNoBody();else i.appendChild(t)}updateDragImageComp(){let{dragImageComp:e,dragSource:t,lastDropTarget:s,lastDraggingEvent:i,dragImageLastLabel:o}=this;if(!e)return;this.setDragImageCompIcon(s?.getIconName?.(i)??null);let r=t?.dragItemName;if(typeof r==="function")r=r(i);if(r||(r=""),o!==r)this.dragImageLastLabel=r,e.setLabel(r)}};function Sg(e){return typeof e==="object"&&!!e.component}function zw(e){if(!e)return!1;return e.prototype&&"getGui"in e.prototype}function yg(e,t,s,i){let{name:o}=s,r,n,a,l,c,d;if(t){let u=t,h=u[o+"Selector"],g=h?h(i):null,p=(f)=>{if(typeof f==="string")r=f;else if(f!=null&&f!==!0)if(e.isFrameworkComponent(f))a=f;else n=f};if(g)p(g.component),l=g.params,c=g.popup,d=g.popupPosition;else p(u[o])}return{compName:r,jsComp:n,fwComp:a,paramsFromSelector:l,popupFromSelector:c,popupPositionFromSelector:d}}var Ww=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,s,i=!1){return this.getCompDetails(this.gridOptions,e,t,s,i)}getCompDetails(e,t,s,i,o=!1){let{name:r,cellRenderer:n}=t,{compName:a,jsComp:l,fwComp:c,paramsFromSelector:d,popupFromSelector:u,popupPositionFromSelector:h}=yg(this.beans.frameworkOverrides,e,t,i),g,p,f=(w)=>{let S=this.registry.getUserComponent(r,w);if(S)l=!S.componentFromFramework?S.component:void 0,c=S.componentFromFramework?S.component:void 0,g=S.params,p=S.processParams};if(a!=null)f(a);if(l==null&&c==null&&s!=null)f(s);if(l&&n&&!zw(l))l=this.agCompUtils?.adaptFunction(t,l);if(!l&&!c){let{validation:w}=this.beans;if(o&&(a!==s||!s))if(a){if(!w?.isProvidedUserComp(a))X(50,{compName:a})}else if(s){if(!w)X(260,{...this.gos.getModuleErrorParams(),propName:r,compName:s})}else X(216,{name:r});else if(s&&!w)X(146,{comp:s});return}let m=this.mergeParams(e,t,i,d,g,p),C=l==null,v=l??c;return{componentFromFramework:C,componentClass:v,params:m,type:t,popupFromSelector:u,popupPositionFromSelector:h,newAgStackInstance:()=>this.newAgStackInstance(v,C,m,t)}}newAgStackInstance(e,t,s,i){let o=!t,r;if(o)r=new e;else r=this.frameworkCompWrapper.wrap(e,i.mandatoryMethods,i.optionalMethods,i);this.createBean(r);let n=r.init?.(s);if(n==null)return B.resolve(r);return n.then(()=>r)}mergeParams(e,t,s,i=null,o,r){let n={...s,...o},l=e?.[t.name+"Params"];if(typeof l==="function"){let c=l(s);Se(n,c)}else if(typeof l==="object")Se(n,l);return Se(n,i),r?r(n):n}},Uw={name:"dateComponent",mandatoryMethods:["getDate","setDate"],optionalMethods:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","refresh"]},Kw={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},$w={name:"headerComponent",optionalMethods:["refresh"]},jw={name:"innerHeaderComponent"},qw={name:"innerHeaderGroupComponent"},Yw={name:"headerGroupComponent"},Xw={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},Zw={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0};var Qw={name:"loadingCellRenderer",cellRenderer:!0},Jw={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},eb={name:"tooltipComponent"},rc={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},tb={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},sb={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},ib={name:"loadingCellRenderer",cellRenderer:!0},ob={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},rb={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function nb(e,t){return e.getCompDetailsFromGridOptions(Kw,"agDragAndDropImage",t,!0)}function Qo(e,t,s){return e.getCompDetails(t,Xw,void 0,s)}function ab(e,t,s){return e.getCompDetails(t,$w,"agColumnHeader",s)}function lb(e,t,s){return e.getCompDetails(t,jw,void 0,s)}function cb(e,t){let s=t.columnGroup.getColGroupDef();return e.getCompDetails(s,Yw,"agColumnGroupHeader",t)}function db(e,t,s){return e.getCompDetails(t,qw,void 0,s)}function ub(e,t){return e.getCompDetailsFromGridOptions(sb,void 0,t,!0)}function hb(e,t){return e.getCompDetailsFromGridOptions(ib,"agLoadingCellRenderer",t,!0)}function gb(e,t){return e.getCompDetailsFromGridOptions(ob,"agGroupRowRenderer",t,!0)}function pb(e,t){return e.getCompDetailsFromGridOptions(rb,"agDetailCellRenderer",t,!0)}function Ds(e,t,s){return e.getCompDetails(t,Zw,void 0,s)}function au(e,t,s){return e.getCompDetails(t,Qw,"agSkeletonCellRenderer",s,!0)}function xg(e,t,s){return e.getCompDetails(t,Jw,"agCellEditor",s,!0)}function nc(e,t,s,i){let o=t.filter;if(Sg(o))t={filter:o.component,filterParams:t.filterParams};return e.getCompDetails(t,rc,i,s,!0)}function fb(e,t,s){return e.getCompDetails(t,Uw,"agDateInput",s,!0)}function mb(e,t){return e.getCompDetails(t.colDef,eb,"agTooltipComponent",t,!0)}function ac(e,t,s,i){return e.getCompDetails(t,tb,i,s)}function Rg(e,t){return yg(e,t,rc)}function Ma(e,t,s){return e.mergeParams(t,rc,s)}var vt=((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))(vt||{}),Cb=class extends Hw{createEvent(e){return I(this.gos,e)}createDragImageComp(e){let{gos:t,beans:s}=this;return nb(s.userCompFactory,I(t,{dragSource:e}))?.newAgStackInstance()}handleEnter(e,t){e?.onGridEnter?.(t)}handleExit(e,t){e?.onGridExit?.(t)}warnNoBody(){F(54)}isDropZoneWithinThisGrid(e){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(e.dropZoneTarget)}registerGridDropTarget(e,t){let s={getContainer:e,isInterestedIn:(i)=>i===1||i===0,getIconName:()=>"notAllowed"};this.addDropTarget(s),t.addDestroyFunc(()=>this.removeDropTarget(s))}};function Fg(e){return!!e.operator}var Eg="ag-resizer-wrapper",Cs=(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}),vb={tag:"div",cls:Eg,children:[Cs("eTopLeft","topLeft"),Cs("eTop","top"),Cs("eTopRight","topRight"),Cs("eRight","right"),Cs("eBottomRight","bottomRight"),Cs("eBottom","bottom"),Cs("eBottomLeft","bottomLeft"),Cs("eLeft","left")]},lc=class extends xe{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){let{clientHeight:t,clientWidth:s}=this.offsetParent,i=s/2-this.getWidth()/2,o=t/2-this.getHeight()/2;this.offsetElement(i,o,e)}initialisePosition(e){if(this.positioned)return;let{centered:t,forcePopupParentAsOffsetParent:s,minWidth:i,width:o,minHeight:r,height:n,x:a,y:l}=this.config;if(!this.offsetParent)this.setOffsetParent();let c=0,d=0,u=ve(this.element);if(u){let h=this.findBoundaryElement(),g=window.getComputedStyle(h);if(g.minWidth!=null){let p=h.offsetWidth-this.element.offsetWidth;d=Number.parseInt(g.minWidth,10)-p}if(g.minHeight!=null){let p=h.offsetHeight-this.element.offsetHeight;c=Number.parseInt(g.minHeight,10)-p}}if(this.minHeight=r||c,this.minWidth=i||d,o)this.setWidth(o);if(n)this.setHeight(n);if(!o||!n)this.refreshSize();if(t)this.center(e);else if(a||l)this.offsetElement(a,l,e);else if(u&&s){let h=this.boundaryEl,g=!0;if(!h)h=this.findBoundaryElement(),g=!1;if(h){let p=Number.parseFloat(h.style.top),f=Number.parseFloat(h.style.left);if(g)this.offsetElement(Number.isNaN(f)?0:f,Number.isNaN(p)?0:p,e);else 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;let s=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};if(e)this.dragSvc?.addDragSource(s),this.moveElementDragListener=s;else this.dragSvc?.removeDragSource(s),this.moveElementDragListener=void 0}setResizable(e){if(this.clearResizeListeners(),e)this.addResizers();else this.removeResizers();if(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(let t of Object.keys(e)){let s=!!e[t],i=this.getResizerElement(t),o={dragStartPixels:0,eElement:i,onDragStart:(r)=>this.onResizeStart(r,t),onDragging:this.onResize.bind(this),onDragStop:(r)=>this.onResizeEnd(r,t)};if(s||!this.isAlive()&&!s){if(s)this.dragSvc?.addDragSource(o),this.resizeListeners.push(o),i.style.pointerEvents="all";else i.style.pointerEvents="none";this.resizable[t]=s}}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";let{height:e,width:t}=this.lastSize;if(t!==-1)this.element.style.width=`${t}px`;if(e!==-1)this.element.style.height=`${e}px`}getHeight(){return this.element.offsetHeight}setHeight(e){let{popup:t}=this.config,s=this.element,i=!1;if(typeof e==="string"&&e.includes("%"))xo(s,e),e=Th(s),i=!0;else if(e=Math.max(this.minHeight,e),this.positioned){let o=this.getAvailableHeight();if(o&&e>o)e=o}if(this.getHeight()===e)return;if(i)s.style.maxHeight="unset",s.style.minHeight="unset";else if(t)xo(s,e);else s.style.height=`${e}px`,s.style.flex="0 0 auto",this.lastSize.height=typeof e==="number"?e:Number.parseFloat(e)}getAvailableHeight(){let{popup:e,forcePopupParentAsOffsetParent:t}=this.config;if(!this.positioned)this.initialisePosition();let{clientHeight:s}=this.offsetParent;if(!s)return null;let i=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:i.top,n=e?0:o.top,a=0;if(t){let c=this.element.parentElement;if(c){let{bottom:d}=c.getBoundingClientRect();a=d-i.bottom}}return s+n-r-a}getWidth(){return this.element.offsetWidth}setWidth(e){let t=this.element,{popup:s}=this.config,i=!1;if(typeof e==="string"&&e.includes("%"))Kt(t,e),e=Yr(t),i=!0;else if(this.positioned){e=Math.max(this.minWidth,e);let{clientWidth:o}=this.offsetParent,r=s?this.position.x:this.element.getBoundingClientRect().left;if(o&&e+r>o)e=o-r}if(this.getWidth()===e)return;if(i)t.style.maxWidth="unset",t.style.minWidth="unset";else if(this.config.popup)Kt(t,e);else t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e==="number"?e:Number.parseFloat(e)}offsetElement(e=0,t=0,s){let{forcePopupParentAsOffsetParent:i}=this.config,o=i?this.boundaryEl:this.element;if(!o)return;this.popupSvc?.positionPopup({ePopup:o,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t}),postProcessCallback:s}),this.setPosition(Number.parseFloat(o.style.left),Number.parseFloat(o.style.top))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;let t=()=>{let s=this.getAvailableHeight();this.element.style.setProperty("max-height",`${s}px`)};if(e&&this.popupSvc)this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=It(this.beans,this.popupSvc?.getPopupParent(),t);else if(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){let{e:t,isLeft:s,isTop:i,anywhereWithin:o,topBuffer:r}=e,n=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y,l=this.shouldSkipX(t,!!s,!!o,n)?0:n,c=this.shouldSkipY(t,!!i,r,a)?0:a;return{movementX:l,movementY:c}}shouldSkipX(e,t,s,i){let o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:o.left,l=a<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=n.right;if(l)return!0;if(t)l=i<0&&e.clientX>a+r.left||i>0&&e.clientX<a+r.left;else if(s)l=i<0&&e.clientX>n.right||i>0&&e.clientX<a+r.left;else l=i<0&&e.clientX>n.right||i>0&&e.clientX<n.right;return l}shouldSkipY(e,t,s=0,i){let o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:o.top,l=a<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=n.bottom;if(l)return!0;if(t)l=i<0&&e.clientY>a+r.top+s||i>0&&e.clientY<a+r.top;else l=i<0&&e.clientY>n.bottom||i>0&&e.clientY<n.bottom;return l}createResizeMap(){let 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;let e=this.element;if(!e)return;e.appendChild(me(vb)),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${Eg}`)?.remove(),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){if(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");let{popup:s,forcePopupParentAsOffsetParent:i}=this.config;if(!s&&!i)this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop);this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){let t=this.element.parentElement;if(!t)return null;return Array.prototype.slice.call(t.children).filter((s)=>!s.classList.contains("ag-hidden"))}getMinSizeOfSiblings(){let e=this.getSiblings()||[],t=0,s=0;for(let i of e){let o=!!i.style.flex&&i.style.flex!=="0 0 auto";if(i===this.element)continue;let r=this.minHeight||0,n=this.minWidth||0;if(o){let a=window.getComputedStyle(i);if(a.minHeight)r=Number.parseInt(a.minHeight,10);if(a.minWidth)n=Number.parseInt(a.minWidth,10)}else r=i.offsetHeight,n=i.offsetWidth;t+=r,s+=n}return{height:t,width:s}}applySizeToSiblings(e){let t=null,s=this.getSiblings();if(!s)return;for(let i=0;i<s.length;i++){let o=s[i];if(o===t)continue;if(e)o.style.height=`${o.offsetHeight}px`;else o.style.width=`${o.offsetWidth}px`;if(o.style.flex="0 0 auto",o===this.element)t=s[i+1]}if(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;let{popup:t,forcePopupParentAsOffsetParent:s}=this.config,{isTop:i,isRight:o,isBottom:r,isLeft:n}=this.currentResizer,a=o||n,l=r||i,{movementX:c,movementY:d}=this.calculateMouseMovement({e,isLeft:n,isTop:i}),u=this.position.x,h=this.position.y,g=0,p=0;if(a&&c){let f=n?-1:1,m=this.getWidth(),C=m+c*f,v=!1;if(n){if(g=m-C,u+g<=0||C<=this.minWidth)v=!0,g=0}if(!v)this.setWidth(C)}if(l&&d){let f=i?-1:1,m=this.getHeight(),C=m+d*f,v=!1;if(i){if(p=m-C,h+p<=0||C<=this.minHeight)v=!0,p=0}else if(!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&m<C&&this.getMinSizeOfSiblings().height+C>this.element.parentElement.offsetHeight)v=!0;if(!v)this.setHeight(C)}if(this.updateDragStartPosition(e.clientX,e.clientY),(t||s)&&g||p)this.offsetElement(u+g,h+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(){let e=this.element;if(this.config.popup){if(!this.config.width)this.setWidth(e.offsetWidth);if(!this.config.height)this.setHeight(e.offsetHeight)}}onMoveStart(e){if(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;let{x:t,y:s}=this.position,i;if(this.config.calculateTopBuffer)i=this.config.calculateTopBuffer();let{movementX:o,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:i});this.offsetElement(t+o,s+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){if(this.config.forcePopupParentAsOffsetParent&&this.popupSvc)this.offsetParent=this.popupSvc.getPopupParent();else this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;while(e){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){while(this.resizeListeners.length){let e=this.resizeListeners.pop();this.dragSvc?.removeDragSource(e)}}destroy(){if(super.destroy(),this.moveElementDragListener)this.dragSvc?.removeDragSource(this.moveElementDragListener);this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},Jo=class extends lc{},E=null;function Wi(e){return typeof e?.getGui==="function"}var Pg=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(!e)return;if(e.includes(" ")){let i=(e||"").split(" ");if(i.length>1){for(let o of i)this.toggleCss(o,t);return}}if(this.cssClassStates[e]!==t&&e.length)this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t}},wb=0,Le=class extends xe{constructor(e,t){super();if(this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=wb++,this.cssManager=new Pg(()=>this.eGui),this.componentSelectors=new Map((t??[]).map((s)=>[s.selector,s])),e)this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(e,t){if(e&&this.gos)this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t)}getCompId(){return this.compId}getDataRefAttribute(e){if(e.getAttribute)return e.getAttribute(Gh);return null}applyElementsToComponent(e,t,s,i=null){if(t===void 0)t=this.getDataRefAttribute(e);if(t){let o=this[t];if(o===E)this[t]=i??e;else{let r=s?.[t];if(!this.suppressDataRefValidation&&!r)throw Error(`data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){let s=[];for(let i of e.childNodes??[])s.push(i);for(let i of s){if(!(i instanceof HTMLElement))continue;let o=this.createComponentFromElement(i,(r)=>{let n=r.getGui();if(n)for(let a of i.attributes??[])n.setAttribute(a.name,a.value)},t);if(o){if(o.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);let r=Array.prototype.slice.call(i.children);o.addItems(r)}this.swapComponentForNode(o,e,i)}else if(i.childNodes)this.createChildComponentsFromTags(i,t)}}createComponentFromElement(e,t,s){let i=e.nodeName,o=this.getDataRefAttribute(e),r=i.indexOf("AG-")===0,n=r?this.componentSelectors.get(i):null,a=null;if(n){let l=s&&o?s[o]:void 0;a=new n.component(l),a.setParentComponent(this),this.createBean(a,null,t)}else if(r)throw Error(`selector: ${i}`);return this.applyElementsToComponent(e,o,s,a),a}swapComponentForNode(e,t,s){let i=e.getGui();t.replaceChild(i,s),t.insertBefore(document.createComment(s.nodeName),i),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e,t){let s=t??this.gos.get("tabIndex");if(!e)e=[];if(!e.length)e.push(this.getGui());for(let i of e)i.setAttribute("tabindex",s.toString())}setTemplate(e,t,s){let i;if(typeof e==="string"||e==null)i=zl(e);else i=me(e);this.setTemplateFromElement(i,t,s)}setTemplateFromElement(e,t,s,i=!1){if(this.eGui=e,this.suppressDataRefValidation=i,t)for(let o=0;o<t.length;o++){let r=t[o];this.componentSelectors.set(r.selector,r)}this.wireTemplate(e,s)}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 s=t;if(e==null)return null;if(!s)s=this.eGui;if(jo(e))return{element:e,parent:s};return{element:e.getGui(),parent:s}}prependChild(e,t){let{element:s,parent:i}=this.getContainerAndElement(e,t)||{};if(!s||!i)return;i.prepend(s)}appendChild(e,t){let{element:s,parent:i}=this.getContainerAndElement(e,t)||{};if(!s||!i)return;i.appendChild(s)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;let{skipAriaHidden:s}=t;Av(this.eGui,e,{skipAriaHidden:s})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;let{skipAriaHidden:s}=t;G(this.eGui,e,{skipAriaHidden:s});let i={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(i)}}destroy(){if(this.parentComponent)this.parentComponent=void 0;super.destroy()}addGuiEventListener(e,t,s){this.eGui.addEventListener(e,t,s),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){if(this.css===lu)this.css=[e],this.addGlobalCss();else this.css||(this.css=[]),this.css.push(e)}addGlobalCss(){if(Array.isArray(this.css)){let e="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(let t of this.css??[])this.beans.environment.addGlobalCSS(t,e)}this.css=lu}},lu=Symbol(),L=class extends Le{},Ta,Da,Aa,Ia,hl,gl,ka;function Os(){if(Ta===void 0)Ta=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return Ta}function li(){if(Da===void 0)Da=/(firefox)/i.test(navigator.userAgent);return Da}function Mg(){if(Aa===void 0)Aa=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);return Aa}function os(){if(Ia===void 0)Ia=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return Ia}function pl(e){if(!e)return null;let t=e.tabIndex,s=e.getAttribute("tabIndex");if(t===-1&&(s===null||s===""&&!li()))return null;return t.toString()}function bb(){if(ka!==void 0)return ka;if(!document.body)return-1;let e=1e6,t=li()?6000000:1e9,s=document.createElement("div");document.body.appendChild(s);while(!0){let i=e*2;if(s.style.height=i+"px",i>t||s.clientHeight!==i)break;else e=i}return s.remove(),ka=e,e}function cc(){if(gl==null)Tg();return gl}function Tg(){let 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 s=t.offsetWidth-t.clientWidth;if(s===0&&t.clientWidth===0)s=null;if(t.parentNode)t.remove();if(s!=null)gl=s,hl=s===0}function Dg(){if(hl==null)Tg();return hl}var fl=!1,rn=0;function Sb(e){if(rn>0)return;e.addEventListener("keydown",nn),e.addEventListener("mousedown",nn)}function yb(e){if(rn>0)return;e.removeEventListener("keydown",nn),e.removeEventListener("mousedown",nn)}function nn(e){let t=fl,s=e.type==="keydown";if(s){if(e.ctrlKey||e.metaKey||e.altKey)return}if(t===s)return;fl=s}function xb(e){let t=ce(e);return Sb(t),rn++,()=>{rn--,yb(t)}}function Ji(){return fl}function dt(e,t,s=!1){let i=Dv,o=Mh;if(t)o+=", "+t;if(s)o+=', [tabindex="-1"]';let r=Array.prototype.slice.apply(e.querySelectorAll(i)).filter((l)=>ve(l)),n=Array.prototype.slice.apply(e.querySelectorAll(o));if(!n.length)return r;return((l,c)=>l.filter((d)=>c.indexOf(d)===-1))(r,n)}function pe(e,t=!1,s=!1,i=!1){let o=dt(e,i?".ag-tab-guard":null,s),r=t?k(o):o[0];if(r)return r.focus({preventScroll:!0}),!0;return!1}function Ie(e,t,s,i){let o=dt(t,s?':not([tabindex="-1"])':null),r=j(e),n;if(s)n=o.findIndex((l)=>l.contains(r));else n=o.indexOf(r);let a=n+(i?-1:1);if(a<0||a>=o.length)return null;return o[a]}function kn(e,t=5){let s=0;while(e&&pl(e)===null&&++s<=t)e=e.parentElement;if(pl(e)===null)return null;return e}var dc="ag-focus-managed",Ag=class extends xe{constructor(e,t={isStopPropagation:()=>!1,stopPropagation:()=>{}},s={}){super();this.eFocusable=e,this.stopPropagationCallbacks=t,this.callbacks=s,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:(i)=>{if(i.defaultPrevented)return;let o=Ie(this.beans,this.eFocusable,!1,i.shiftKey);if(!o)return;o.focus(),i.preventDefault()},...s}}postConstruct(){let{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:s}}=this;if(e.classList.add(dc),this.addKeyDownListeners(e),t)this.addManagedElementListeners(e,{focusin:t});if(s)this.addManagedElementListeners(e,{focusout:s})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:(t)=>{if(t.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(t))return;let{callbacks:s}=this;if(s.shouldStopEventPropagation(t)){this.stopPropagationCallbacks.stopPropagation(t);return}if(t.key===b.TAB)s.onTabKeyDown(t);else if(s.handleKeyDown)s.handleKeyDown(t)}})}},Ig="__ag_Grid_Stop_Propagation";function Qe(e){e[Ig]=!0}function ut(e){return e[Ig]===!0}var Bs={isStopPropagation:ut,stopPropagation:Qe},ls=class extends Ag{constructor(e,t){super(e,Bs,t)}},Rb={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 Pt(e,t,s){return Kl(e,Rb,t,s)}function uc(e,t){let{debounceMs:s}=e;if(eo(e)){if(s!=null)F(71);return 0}return s??t}function eo(e){return(e.buttons?.indexOf("apply")??-1)>=0}function kg(e,t,s,i){let o=Pt(e,s);if(typeof t==="function"){let r=Pt(e,i);o=t({filterOptionKey:i,filterOption:r,placeholder:o})}else if(typeof t==="string")o=t;return o}var pi=class extends L{constructor(e,t){super();this.filterNameKey=e,this.cssIdentifier=t,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){let e={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(e,this.getAgComponents()),this.createManagedBean(new ls(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new Jo(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(e){}init(e){let t=e;this.setParams(t),this.setModelIntoUi(t.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(e,t){return e===t}refresh(e){let t=e,s=this.params;this.params=t;let{source:i,state:o,additionalEventAttributes:r}=t;if(i==="colDef")this.updateParams(t,s);let n=this.state;this.state=o;let a=r?.fromAction;if(a&&a!=="apply"||o.model!==n.model||!this.areStatesEqual(o.state,n.state))this.setModelIntoUi(o.model);return!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=eo(e),this.setupApplyDebounced()}doesFilterPass(e){F(283);let{getHandler:t,model:s,column:i}=this.params;return t().doesFilterPass({...e,model:s,handlerParams:this.beans.colFilter.getHandlerParams(i)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return F(284),this.params.model!=null}setupApplyDebounced(){let e=uc(this.params,this.defaultDebounceMs),t=$e(this,this.checkApplyDebounce.bind(this),e);this.applyDebounced=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){if(this.debouncePending)this.debouncePending=!1,this.doApplyModel()}getModel(){return F(285),this.params.model}setModel(e){F(286);let{beans:t,params:s}=this;return t.colFilter.setModelForColumnLegacy(s.column,e)}applyModel(e="api"){return this.doApplyModel()}canApply(e){return!0}doApplyModel(e){let{params:t,state:{valid:s=!0,model:i}}=this;if(!s)return!1;let o=!this.areModelsEqual(t.model,i);if(o)t.onAction("apply",e);return o}onNewRowsLoaded(){}onUiChanged(e,t=!1){this.updateUiVisibility();let s=this.getModelFromUi(),i={model:s,state:this.getState(),valid:this.canApply(s)};this.state=i;let{params:o,gos:r,eventSvc:n,applyActive:a}=this;if(o.onStateChange(i),o.onUiChange(this.getUiChangeEventParams()),!r.get("enableFilterHandlers"))n.dispatchEvent({type:"filterModified",column:o.column,filterInstance:this});if(!i.valid)return;if(e??(e=a?void 0:"debounce"),e==="immediately")this.doApplyModel({afterFloatingFilter:t,afterDataChange:!1});else if(e==="debounce")this.applyDebounced()}getState(){return}getUiChangeEventParams(){return}afterGuiAttached(e){this.lastContainerType=e?.container,this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){let{positionableFeature:t,gos:s}=this;if(!t)return;let i=e==="floatingFilter"||e==="columnFilter";if(i)t.restoreLastSize(),t.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0});else t.removeSizeFromEl(),t.setResizable(!1);t.constrainSizeToAvailableHeight(i)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(e,t){return Pt(this,e,t)}getPositionableElement(){return this.getGui()}areModelsEqual(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;return this.areNonNullModelsEqual(e,t)}};var hc=class extends Le{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){let e=this.parentComponent;if(e?.isAlive())e.getGui().classList.remove("ag-has-popup");super.destroy()}},Fb=class extends hc{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 gc(e){let t=e.rowModel;return t.getType()==="clientSide"?t:void 0}var cu="row-group-",Eb="t-",Pb="b-",Mb=0,Vs=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=Mb++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=e}get groupData(){let e=this._groupData;if(e!==void 0)return e;if(this.footer)return this.sibling?.groupData;return this.beans.groupStage?.loadGroupData(this)??null}set groupData(e){this._groupData=e}get primaryRow(){let e=this.footer&&this.sibling||this;if(e.rowPinned){let t=e.pinnedSibling;if(t){if(e=t,e.footer)e=e.sibling??e}}return e}get allLeafChildren(){let e=this._leafs;return e===void 0?this.beans.groupStage?.loadLeafs?.(this)??null:e}set allLeafChildren(e){this._leafs=e}get expanded(){let 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,"set")}updateData(e){this.setDataCommon(e,"update")}_updateDataNoSibling(e){this.setDataCommon(e,"updateNoSibling")}setDataCommon(e,t){let{valueCache:s,eventSvc:i}=this.beans,o=this.data,r=t!=="set";this.data=e,s?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();let n=this.createDataChangedEvent(e,o,r);if(this.__localEventService?.dispatchEvent(n),t!=="updateNoSibling"){let l=this.sibling;if(l){l.data=e;let c=l.createDataChangedEvent(e,o,r);l.__localEventService?.dispatchEvent(c)}}i.dispatchEvent({type:"rowNodeDataChanged",node:this});let a=this.pinnedSibling;if(a)a.data=e,a.__localEventService?.dispatchEvent(a.createDataChangedEvent(e,o,r)),i.dispatchEvent({type:"rowNodeDataChanged",node:a})}updateDataOnDetailNode(){let e=this.detailNode;if(e)e.data=this.data}createDataChangedEvent(e,t,s){return{type:"dataChanged",node:this,oldData:t,newData:e,update:s}}getRowIndexString(){if(this.rowIndex==null)return X(13),null;if(this.rowPinned==="top")return Eb+this.rowIndex;if(this.rowPinned==="bottom")return Pb+this.rowIndex;return this.rowIndex.toString()}setDataAndId(e,t){let{selectionSvc:s}=this.beans,i=s?.createDaemonNode?.(this),o=this.data;if(this.data=e,this.updateDataOnDetailNode(),this.setId(t),s)s.updateRowSelectable(this),s.syncInRowNode(this,i);let r=this.createDataChangedEvent(e,o,!1);this.__localEventService?.dispatchEvent(r)}setId(e){let t=cl(this.beans.gos);if(t)if(this.data){let s=this.parent?.getRoute()??[];if(this.id=t({data:this.data,parentKeys:s.length>0?s:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(cu))X(14,{groupPrefix:cu})}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");let t=e!==null;if(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,s){this.beans.expansionSvc?.setExpanded(this,e,t,s)}setDataValue(e,t,s){let{colModel:i,valueSvc:o,gos:r,editSvc:n}=this.beans;if(e==null)return!1;let a=i.getColOrColDefCol(e);if(!a)return!1;let l=a.colDef.pivotValueColumn;if(!this.group&&!this.rowPinned&&l)a=l;let c=o.getValueForDisplay({column:a,node:this,from:"data"}).value;if(r.get("readOnlyEdit")){let{beans:{eventSvc:u},data:h,rowIndex:g,rowPinned:p}=this;return u.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:g,rowPinned:p,column:a,colDef:a.colDef,data:h,node:this,oldValue:c,newValue:t,value:t,source:s}),!1}if(s!=="data"&&n&&!n.committing){let u=n.setDataValue({rowNode:this,column:a},t,s);if(u!=null)return u}let d=o.setValue(this,a,t,s);if(this.dispatchCellChangedEvent(a,t,c),d)this.pinnedSibling?.dispatchCellChangedEvent(a,t,c);return d}getDataValue(e,t){let s=this.beans,i=s.colModel.getColOrColDefCol(e);if(!i)return;let o;if(t==="data"||!t){if(o=s.valueSvc.getValue(i,this,"data",!1),o==null)return o}else{let r=t==="data-raw",n=r||t==="value"?"data":t;if(o=s.valueSvc.getValue(i,this,n,r),r||o==null)return o;if(typeof o==="object"&&i.aggFunc){if(typeof o.toNumber==="function")return o.toNumber();if("value"in o)return o.value}if(t!=="value")return o}if(i.colDef.allowFormula){let r=s.formula;if(r?.isFormula(o)&&i.isAllowFormula())o=r.resolveValue(i,this)}return o}updateHasChildren(){let e=this.group&&!this.footer||!!this.childrenAfterGroup?.length,{rowChildrenSvc:t}=this.beans;if(t)e=t.getHasChildrenValue(this);if(e!==this.__hasChildren)this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged")}hasChildren(){if(this.__hasChildren==null)this.updateHasChildren();return this.__hasChildren}dispatchCellChangedEvent(e,t,s){let i={type:"cellChanged",node:this,column:e,newValue:t,oldValue:s};this.__localEventService?.dispatchEvent(i)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();let e=this.rowPinned&&this.pinnedSibling;if(e)return e.isSelected();return this.__selected}depthFirstSearch(e){let t=this.childrenAfterGroup;if(t)for(let s=0,i=t.length;s<i;++s)t[s].depthFirstSearch(e);e(this)}getAggregatedChildren(e,t){let s=this.beans;return s.aggChildrenSvc?.getAggregatedChildren(this,s.colModel.getCol(e),t)??[]}dispatchRowEvent(e){this.__localEventService?.dispatchEvent({type:e,node:this})}setSelected(e,t=!1,s="api"){this.beans.selectionSvc?.setNodesSelected({nodes:[this],newValue:e,clearSelection:t,source:s})}isRowPinned(){return!!this.rowPinned}__addEventListener(e,t){(this.__localEventService??(this.__localEventService=new Dt)).addEventListener(e,t)}__removeEventListener(e,t){this.removeLocalListener(e,t)}addEventListener(e,t){this.beans.validation?.checkRowEvents(e);let s=this.__localEventService??(this.__localEventService=new Dt);this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,s);let i=this.frameworkEventListenerService?.wrap(e,t)??t;s.addEventListener(e,i)}removeEventListener(e,t){let s=this.frameworkEventListenerService?.unwrap(e,t)??t;this.removeLocalListener(e,s)}removeLocalListener(e,t){let s=this.__localEventService;if(s){if(s.removeEventListener(e,t),s.noRegisteredListenersExist())this.__localEventService=null}}isFullWidthCell(){if(F(61),this.detail)return!0;let e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.level===-1)return[];if(this.key==null)return;let e=[],t=this;while(t?.key!=null)e.push(t.key),t=t.parent;return e.reverse()}setRowIndex(e){if(this.rowIndex!==e)this.rowIndex=e,this.dispatchRowEvent("rowIndexChanged")}setAllChildrenCount(e){if(this.allChildrenCount!==e)this.allChildrenCount=e,this.dispatchRowEvent("allChildrenCountChanged")}setUiLevel(e){if(this.uiLevel!==e)this.uiLevel=e,this.dispatchRowEvent("uiLevelChanged")}getFirstChild(){let e=this.childStore;if(e)return e.getFirstNode();return this.childrenAfterSort?.[0]??null}_destroy(e){if(this.destroyed)return!1;this.destroyed=!0;let t=this.pinnedSibling;if(t?.rowPinned)this.beans.pinnedRowModel?.pinRow(t,null);if(e===!0)this.clearRowTopAndRowIndex();else if(e===!1)this.setRowTop(null),this.setRowIndex(null);else this.oldRowTop=null,this.rowTop=null,this.rowIndex=null,this.displayed=!1;if(!this.footer){let s=this.detailNode;if(s)s._destroy(e);let i=this.sibling;if(i)i._destroy(e)}return!0}};function pc(e,t,s){return I(t,{type:s,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned})}var Tb=new Set(["__autoHeights","__checkAutoHeightsDebounced","__localEventService","__objectId","_groupData","_leafs","childStore","destroyed","groupValue","oldRowTop","pinnedSibling","rowPinned","sticky","treeNodeFlags","treeParent"]),Lg=(e,t)=>{let s=new Vs(t);for(let i of Object.keys(e)){if(Tb.has(i))continue;s[i]=e[i]}return s.oldRowTop=null,s},Gg=(e,t,s)=>{if(!s)return;let i=s.rowIndex;if(i==null)return;i+=t;let o=e.getRowCount();while(i>=0&&i<o){let r=e.getRow(i);if(!r||!r.footer&&!r.detail)return r;i+=t}return};var Db=500,Ab=550,Mr,Ib=(e)=>{if(!Mr)Mr=new WeakSet;else if(Mr.has(e))return!1;return Mr.add(e),!0},Ke=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 s=this.eventSvc;if(!s){if(s===null)return;this.eventSvc=s=new Dt;let i=this.onTouchStart.bind(this);this.startListener=i,this.eElement.addEventListener("touchstart",i,{passive:!0})}s.addEventListener(e,t)}removeEventListener(e,t){this.eventSvc?.removeEventListener(e,t)}onTouchStart(e){if(this.touchStart||!Ib(e))return;let t=e.touches[0];this.touchStart=t;let s=this.handlers;if(!s.length){let i=this.eElement,o=i.ownerDocument,r=this.onTouchMove.bind(this),n=this.onTouchEnd.bind(this),a=this.onTouchCancel.bind(this),l={passive:!0},c={passive:!1};Vr(s,[i,"touchmove",r,l],[o,"touchcancel",a,l],[o,"touchend",n,c],[o,"contextmenu",Ti,c])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{if(this.longPressTimer=0,this.touchStart===t&&!this.moved)this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:t,touchEvent:e})},Ab)}onTouchMove(e){let{moved:t,touchStart:s}=this;if(!t&&s){let i=Li(s,e.touches);if(i&&!Oh(i,s,4))this.clearLongPress(),this.moved=!0}}onTouchEnd(e){let t=this.touchStart;if(!t||!Li(t,e.changedTouches))return;if(!this.moved)this.eventSvc?.dispatchEvent({type:"tap",touchStart:t}),this.checkDoubleTap(t);if(this.preventClick)Ti(e);this.cancel()}onTouchCancel(e){let t=this.touchStart;if(!t||!Li(t,e.changedTouches))return;this.lastTapTime=null,this.cancel()}checkDoubleTap(e){let t=Date.now(),s=this.lastTapTime;if(s){if(t-s>Db)this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:e}),t=null}this.lastTapTime=t}cancel(){this.clearLongPress(),Ul(this.handlers),this.touchStart=null}clearLongPress(){if(this.longPressTimer!==0)window.clearTimeout(this.longPressTimer),this.longPressTimer=0;this.moved=!1}destroy(){let e=this.startListener;if(e)this.startListener=null,this.eElement.removeEventListener("touchstart",e);this.cancel(),this.eElement=null,this.eventSvc=null}},cs=((e)=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(cs||{}),kb=1,Lb=class{constructor(e){if(this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=kb++,!e?.beanClasses)return;this.beanDestroyComparator=e.beanDestroyComparator,this.init(e)}init(e){this.id=e.id,this.beans.context=this,this.destroyCallback=e.destroyCallback;for(let t of Object.keys(e.providedBeanInstances))this.beans[t]=e.providedBeanInstances[t];for(let t of e.beanClasses){let s=new t;if(s.beanName)this.beans[s.beanName]=s;else console.error(`Bean ${t.name} is missing beanName`);this.createdBeans.push(s)}for(let t of e.derivedBeans??[]){let{beanName:s,bean:i}=t(this);this.beans[s]=i,this.createdBeans.push(i)}if(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){let s=this.beans;for(let i of e)i.preWireBeans?.(s),i.wireBeans?.(s);for(let i of e)i.preConstruct?.();if(t)e.forEach(t);for(let i of e)i.postConstruct?.()}getBeans(){return this.beans}getBean(e){return this.beans[e]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;let e=this.getBeanInstances();if(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 Gb(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionSvc").api}}var Ob=["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"],du=Object.fromEntries(Ob.map((e,t)=>[e,t]));function Bb(e,t){let s=(e.beanName?du[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,i=(t.beanName?du[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return s-i}function Vb(e,t){if(e?.beanName==="gridDestroySvc")return-1;if(t?.beanName==="gridDestroySvc")return 1;return 0}function Qt(e){let{rowIndex:t,rowPinned:s,column:i}=e;return`${t}.${s==null?"null":s}.${i.getId()}`}function to(e,t){let s=e.column===t.column,i=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return s&&i&&o}function Ce(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(M(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}function Q(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;return e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}function Ui(e){let t=0,s,{pinnedRowModel:i,rowModel:o,pageBounds:r}=e;if(i?.getPinnedTopRowCount())s="top";else if(o.getRowCount())s=null,t=r.getFirstRow();else if(i?.getPinnedBottomRowCount())s="bottom";return s===void 0?null:{rowIndex:t,rowPinned:s}}function As(e){let t,s=null,{pinnedRowModel:i,pageBounds:o}=e,r=i?.getPinnedBottomRowCount(),n=i?.getPinnedTopRowCount();if(r)s="bottom",t=r-1;else if(e.rowModel.getRowCount())t=o.getLastRow();else if(n)s="top",t=n-1;return t===void 0?null:{rowIndex:t,rowPinned:s}}function Ee(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 lt(e,t){let s=e.spannedRowRenderer?.getCellByPosition(t);if(s)return s;let i=e.rowRenderer.getRowByPosition(t);if(!i)return null;return i.getCellCtrl(t.column)}function Nb(e,t,s){let{rowModel:i,pinnedRowModel:o}=e,r;if(r??(r=i?.getRowNode(t)),s)r??(r=o?.getPinnedRowById(t,s));else r??(r=o?.getPinnedRowById(t,"top")),r??(r=o?.getPinnedRowById(t,"bottom"));return r}function Ye(e,t,s=!1){let{rowIndex:i,rowPinned:o}=t,{pageBounds:r,pinnedRowModel:n,rowModel:a}=e;if(i===0){if(o==="top")return null;if(o==="bottom"&&a.isRowsToRender())return{rowIndex:r.getLastRow(),rowPinned:null};return n?.isRowsToRender("top")?{rowIndex:n.getPinnedTopRowCount()-1,rowPinned:"top"}:null}if(s){let l=o?void 0:a.getRow(i);return Og(e,l,!0)??{rowIndex:i-1,rowPinned:o}}return{rowIndex:i-1,rowPinned:o}}function fc(e,t){let{pinnedRowModel:s,rowModel:i}=e,o=s?.getPinnedTopRowCount()??0,r=i.getRowCount(),{rowPinned:n,rowIndex:a}=t;if(n==="top")return a;if(n==="bottom")return o+r+a;return o+a}function ye(e,t,s=!1){let{rowIndex:i,rowPinned:o}=t,{pageBounds:r,pinnedRowModel:n,rowModel:a}=e;if(_b(e,t)){if(o==="bottom")return null;if(o==="top"&&a.isRowsToRender())return{rowIndex:r.getFirstRow(),rowPinned:null};return n?.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}if(s){let l=o?void 0:a.getRow(i);return Og(e,l)??{rowIndex:i+1,rowPinned:o}}return{rowIndex:i+1,rowPinned:o}}function Og(e,t,s=!1){let{gos:i,rowRenderer:o}=e;if(!t?.sticky||!Qi(i))return;let r=o.getStickyTopRowCtrls(),n=o.getStickyBottomRowCtrls(),a=!n.some((u)=>u.rowNode.rowIndex===t.rowIndex),l=a?r:n,c=(s?-1:1)*(a?-1:1),d;for(let u=0;u<l.length;u++)if(l[u].rowNode.rowIndex===t.rowIndex){d=l[u+c];break}return d?{rowIndex:d.rowNode.rowIndex,rowPinned:null}:void 0}function _b(e,t){let{rowPinned:s,rowIndex:i}=t,{pinnedRowModel:o,pageBounds:r}=e;if(s==="top")return(o?.getPinnedTopRowCount()??0)-1<=i;if(s==="bottom")return(o?.getPinnedBottomRowCount()??0)-1<=i;return r.getLastRow()<=i}function Ns(e,t,s){t.addManagedElementListeners(s,{keydown:(i)=>{if(!i.defaultPrevented&&!zb(i)&&i.key===b.TAB){let o=i.shiftKey;if(!Ie(e,s,!1,o)){if(pt(e,o))i.preventDefault()}}}})}function Ft(e){return e.gos.get("suppressHeaderFocus")||!!e.overlays?.exclusive}function an(e){return e.gos.get("suppressCellFocus")||!!e.overlays?.exclusive}function pt(e,t,s=!1){let i=e.ctrlsSvc.get("gridCtrl"),o=i.focusNextInnerContainer(t);if(o===!0)return!0;if(o===!1)return o;if(s||!t&&!i.isDetailGrid()&&i.isFocusInsideGridBody())i.forceFocusOutOfContainer(t);return!1}function mc(e,t){let s=e.focusSvc,i=s.getFocusedCell();if(i&&t&&to(i,t)){let{rowIndex:o,rowPinned:r,column:n}=t;if(ks(e))s.setFocusedCell({rowIndex:o,column:n,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!Ji()})}}function Hb(e,t){let s=e.getFocusableContainerName();if(s==="gridBody")return t();return Bg(e,()=>dt(e.getGui(),".ag-tab-guard").length>0)?s:null}function Bg(e,t){e.setAllowFocus?.(!0);try{return t()}finally{e.setAllowFocus?.(!1)}}var Vg="__ag_Grid_Skip_Focusable_Container";function Ng(e){e[Vg]=!0}function zb(e){return e[Vg]===!0}function _g(e){if(!e.cols)return-1;return e.cols.treeDepth+1}function rt(e){return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0}function Cc(e){let t=[],s=e.ctrlsSvc.getHeaderRowContainerCtrls();for(let i of s){if(!i)continue;let o=i.getGroupRowCount()||0;for(let r=0;r<o;r++){let n=i.getGroupRowCtrlAtIndex(r),a=t[r];if(n){let l=Wb(e,n);if(a==null||l>a)t[r]=l}}}return t}function Wb(e,t){let i=e.colModel.pivotMode?Kb(e):zg(e),o=t.getHeaderCellCtrls();for(let r of o){let{column:n}=r,a=n.getAutoHeaderHeight();if(a!=null&&a>i&&n.isAutoHeaderHeight())i=a}return i}function vc(e){let s=e.colModel.pivotMode?Ub(e):Ln(e);return e.colModel.forAllCols((i)=>{let o=i.getAutoHeaderHeight();if(o!=null&&o>s&&i.isAutoHeaderHeight())s=o}),s}function Ln(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function Hg(e){return e.gos.get("floatingFiltersHeight")??Ln(e)}function zg(e){return e.gos.get("groupHeaderHeight")??Ln(e)}function Ub(e){return e.gos.get("pivotHeaderHeight")??Ln(e)}function Kb(e){return e.gos.get("pivotGroupHeaderHeight")??zg(e)}function $b(e,t){return e.headerRowIndex===t.headerRowIndex&&e.column===t.column}function jb(e){return e?.headerRowIndex!=null}var qb=class extends y{setComp(e,t,s){this.comp=e,this.eGui=t;let{beans:i}=this,{headerNavigation:o,touchSvc:r,ctrlsSvc:n}=i;if(o)this.createManagedBean(new ls(s,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)}));this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,i),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,i)}),this.onPivotModeChanged(i),this.setupHeaderHeight();let a=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:a}),r?.mockHeaderContextMenu(this,a),n.register("gridHeaderCtrl",this)}setupHeaderHeight(){let e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({headerRowsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>et(this.beans,()=>e()),stylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){let{beans:e}=this,t=0,s=Cc(e).reduce((n,a)=>n+a,0),i=vc(e);if(e.filterManager?.hasFloatingFilters())t+=Hg(e);t+=s,t+=i;let o=e.environment.getHeaderRowBorderWidth(),r=t+o;if(this.headerHeightWithBorder!==r){this.headerHeightWithBorder=r;let n=`${r}px`;this.comp.setHeightAndMinHeight(n)}if(this.headerHeight!==t)this.headerHeight=t,this.eventSvc.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(e){let t=e.colModel.pivotMode;this.comp.toggleCss("ag-pivot-on",t),this.comp.toggleCss("ag-pivot-off",!t)}onDisplayedColumnsChanged(e){let s=e.visibleCols.allCols.some((i)=>i.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",s)}onTabKeyDown(e){let t=this.gos.get("enableRtl"),s=e.shiftKey,i=s!==t?"LEFT":"RIGHT",{beans:o}=this,{headerNavigation:r,focusSvc:n}=o;if(r.navigateHorizontally(i,!0,e)||!s&&n.focusOverlay(!1)||pt(o,s,!0))e.preventDefault()}handleKeyDown(e){let t=null,{headerNavigation:s}=this.beans;switch(e.key){case b.LEFT:t="LEFT";case b.RIGHT:{if(!M(t))t="RIGHT";if(s.navigateHorizontally(t,!1,e))e.preventDefault();break}case b.UP:t="UP";case b.DOWN:{if(!M(t))t="DOWN";if(s.navigateVertically(t,e))e.preventDefault();break}default:return}}onFocusOut(e){let{relatedTarget:t}=e,{eGui:s,beans:i}=this;if(!t&&s.contains(j(i)))return;if(!s.contains(t))i.focusSvc.focusedHeader=null}onHeaderContextMenu(e,t,s){let{menuSvc:i,ctrlsSvc:o}=this.beans;if(!e&&!s||!i?.isHeaderContextMenuEnabled())return;let{target:r}=e??t;if(r===this.eGui||r===o.getHeaderRowContainerCtrl()?.eViewport)i.showHeaderContextMenu(void 0,e,s)}},wc=class extends L{constructor(e,t){super(e);this.ctrl=t}getCtrl(){return this.ctrl}},Yb={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"}]},Xb=class extends wc{constructor(e){super(Yb,e);this.eResize=E,this.eHeaderCompWrapper=E,this.headerCompVersion=0}postConstruct(){let e=this.getGui(),t=()=>{let i=this.ctrl.getSelectAllGui();if(i)this.eResize.insertAdjacentElement("afterend",i),this.addDestroyFunc(()=>i.remove())},s={setWidth:(i)=>e.style.width=i,toggleCss:(i,o)=>this.toggleCss(i,o),setUserStyles:(i)=>$o(e,i),setAriaSort:(i)=>i?Pv(e,i):Mv(e),setUserCompDetails:(i)=>this.setUserCompDetails(i),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:t,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),t()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){if(this.headerComp)this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0}setUserCompDetails(e){this.headerCompVersion++;let t=this.headerCompVersion;e.newAgStackInstance().then((s)=>this.afterCompCreated(t,s))}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())}},Zb={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"}]},Qb=class extends wc{constructor(e){super(Zb,e);this.eResize=E,this.eHeaderCompWrapper=E}postConstruct(){let e=this.getGui(),t=(i,o)=>o!=null?e.setAttribute(i,o):e.removeAttribute(i),s={toggleCss:(i,o)=>this.toggleCss(i,o),setUserStyles:(i)=>$o(e,i),setHeaderWrapperHidden:(i)=>{if(i)this.eHeaderCompWrapper.style.setProperty("display","none");else this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:(i)=>{if(i!=null)this.eHeaderCompWrapper.style.setProperty("max-height",`${i}px`);else this.eHeaderCompWrapper.style.removeProperty("max-height");this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",i!=null)},setResizableDisplayed:(i)=>G(this.eResize,i),setWidth:(i)=>e.style.width=i,setAriaExpanded:(i)=>t("aria-expanded",i),setUserCompDetails:(i)=>this.setUserCompDetails(i),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(s,e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then((t)=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){let t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}let s=this.getGui(),i=e.getGui();this.eHeaderCompWrapper.appendChild(i),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(s)}},Jb={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"}}]}]},eS=class extends wc{constructor(e){super(Jb,e);this.eFloatingFilterBody=E,this.eButtonWrapper=E,this.eButtonShowMainFilter=E}postConstruct(){let e=this.getGui(),t={toggleCss:(s,i)=>this.toggleCss(s,i),setUserStyles:(s)=>$o(e,s),addOrRemoveBodyCssClass:(s,i)=>this.eFloatingFilterBody.classList.toggle(s,i),setButtonWrapperDisplayed:(s)=>G(this.eButtonWrapper,s),setCompDetails:(s)=>this.setCompDetails(s),getFloatingFilterComp:()=>this.compPromise,setWidth:(s)=>e.style.width=s,setMenuIcon:(s)=>this.eButtonShowMainFilter.appendChild(s)};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)return;if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached?.()}},tS=class extends L{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"))),qr(this.getGui(),this.ctrl.getAriaRowIndex());let t={setHeight:(s)=>this.getGui().style.height=s,setTop:(s)=>this.getGui().style.top=s,setHeaderCtrls:(s,i)=>this.setHeaderCtrls(s,i),setWidth:(s)=>this.getGui().style.width=s,setRowIndex:(s)=>qr(this.getGui(),s)};this.ctrl.setComp(t,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;let s=this.headerComps;this.headerComps={};for(let i of e){let o=i.instanceId,r=s[o];if(delete s[o],r==null)r=this.createHeaderComp(i),this.getGui().appendChild(r.getGui());this.headerComps[o]=r}if(Object.values(s).forEach((i)=>{i.getGui().remove(),this.destroyBean(i)}),t){let i=Object.values(this.headerComps);i.sort((r,n)=>{let a=r.getCtrl().column.getLeft(),l=n.getCtrl().column.getLeft();return a-l});let o=i.map((r)=>r.getGui());kh(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.type){case"group":t=new Qb(e);break;case"filter":t=new eS(e);break;default:t=new Xb(e);break}return this.createBean(t),t.setParentComponent(this),t}},bc=class extends y{constructor(e,t=!1){super();this.callback=e,this.addSpacer=t}postConstruct(){let e=this.setWidth.bind(this);if(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(){let e=Te(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:s}=this.beans,i=t.bodyWidth,o=t.getColsLeftWidth(),r=t.getDisplayedColumnsRightWidth(),n;if(e)n=i+o+r;else if(n=i,this.addSpacer){if((this.gos.get("enableRtl")?o:r)===0&&s.verticalScrollShowing)n+=s.getScrollbarWidth()}this.callback(n)}};function er(e,t,s){if(s)e.addDestroyFunc(()=>t.destroyBean(s));return s??e}var Sc=class extends y{constructor(e,t,s,i){super();this.columnOrGroup=e,this.eCell=t,this.colsSpanning=i,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=s}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){let{beans:e,colsSpanning:t}=this;if(e.gos.get("enableRtl")&&t)return k(t);return this.columnOrGroup}postConstruct(){let e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){let{gos:e,colAnimation:t}=this.beans,s=e.get("suppressColumnMoveAnimation"),i=M(this.columnOrGroup.getOldLeft());if(t?.isActive()&&i&&!s)this.animateInLeft();else this.onLeftChanged()}animateInLeft(){let e=this.getColumnOrGroup(),t=this.modifyLeftForPrintLayout(e,e.getOldLeft()),s=this.modifyLeftForPrintLayout(e,e.getLeft());this.setLeft(t),this.actualLeft=s,this.beans.colAnimation.executeNextVMTurn(()=>{if(this.actualLeft===s)this.setLeft(s)})}onLeftChanged(){let e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){let{gos:s,visibleCols:i}=this.beans;if(!Te(s,"print"))return t;if(e.getPinned()==="left")return t;let r=i.getColsLeftWidth();if(e.getPinned()==="right"){let n=i.bodyWidth;return r+n+t}return r+t}setLeft(e){if(M(e))this.eCell.style.left=`${e}px`;if(we(this.columnOrGroup)){let t=this.columnOrGroup.getLeafColumns();if(!t.length)return;if(t.length>1)Ev(this.ariaEl,t.length)}}},sS="ag-column-first",iS="ag-column-last";function Gn(e,t,s,i){if(q(e))return[];return Ug(e.headerClass,e,t,s,i)}function On(e,t,s,i){if(q(e))return[];return Ug(e.toolPanelClass,e,t,s,i)}function Wg(e,t,s){e.toggleCss(sS,s.isColAtEdge(t,"first")),e.toggleCss(iS,s.isColAtEdge(t,"last"))}function oS(e,t,s,i){return I(t,{colDef:e,column:s,columnGroup:i})}function Ug(e,t,s,i,o){if(q(e))return[];let r;if(typeof e==="function"){let n=oS(t,s,i,o);r=e(n)}else r=e;if(typeof r==="string")return[r];if(Array.isArray(r))return[...r];return[]}var rS=0,Kg="headerCtrl",yc=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()+"-"+rS++}postConstruct(){let e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}setComp(e,t,s,i,o){if(t.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(e,t,s,i,o),this.reAttemptToFocus)this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0)}shouldStopEventPropagation(e){let{headerRowIndex:t,column:s}=this.beans.focusSvc.focusedHeader,i=s.getDefinition(),o=i?.suppressHeaderKeyboardEvent;if(!M(o))return!1;let r=I(this.gos,{colDef:i,column:s,headerRowIndex:t,event:e});return!!o(r)}getWrapperHasFocus(){return j(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(){let e=this.column.getDefinition();if(!e)return;let{headerStyle:t}=e,s;if(typeof t==="function"){let i=this.getHeaderClassParams();s=t(i)}else s=t;if(s)this.comp.setUserStyles(s)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){let{wrapperElement:t,checkMeasuringCallback:s,compBean:i}=e,{beans:o}=this,r=(u)=>{if(!this.isAlive()||!i.isAlive())return;let{paddingTop:h,paddingBottom:g,borderBottomWidth:p,borderTopWidth:f}=Zi(this.eGui),m=h+g+p+f,v=t.offsetHeight+m;if(u<5){let S=!ce(o)?.contains(t),x=v==0;if(S||x){rl(()=>r(u+1),"raf",o);return}}this.setColHeaderHeight(this.column,v)},n=!1,a,l=()=>{let u=this.column.isAutoHeaderHeight();if(u&&!n)c();if(!u&&n)d()},c=()=>{n=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),r(0),a=It(this.beans,t,()=>r(0))},d=()=>{if(n=!1,a)a();this.comp.toggleCss("ag-header-cell-auto-height",!1),a=void 0};if(l(),i.addDestroyFunc(()=>d()),i.addManagedListeners(this.column,{widthChanged:()=>n&&r(0)}),i.addManagedEventListeners({sortChanged:()=>{if(n)window.setTimeout(()=>r(0))}}),s)s(l)}onDisplayedColumnsChanged(){let{comp:e,column:t,beans:s,eGui:i}=this;if(!e||!t||!i)return;Wg(e,t,s.visibleCols),Eh(i,s.visibleCols.getAriaColIndex(t))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){let e=Ft(this.beans);if(this.eGui)Mt(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){let t=j(this.beans),s=e.key===b.LEFT||e.key===b.RIGHT;if(this.isResizing)e.preventDefault(),e.stopImmediatePropagation();if(t!==this.eGui||!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey)return;if(this.isResizing||s)e.preventDefault(),e.stopImmediatePropagation();if((e.ctrlKey||e.metaKey)&&wg(e)===b.C)return this.beans.clipboardSvc?.copyToClipboard();if(!s)return;let r=e.key===b.LEFT!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;let n=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(n,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){let t=this.getResizeDiff(e),{pinnedCols:s}=this.beans;return s?s.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){let{gos:t,column:s}=this,i=e.key===b.LEFT!==t.get("enableRtl"),o=s.getPinned(),r=t.get("enableRtl");if(o){if(r!==(o==="right"))i=!i}return(i?-1:1)*this.resizeMultiplier}onGuiKeyUp(){if(!this.isResizing)return;if(this.resizeToggleTimeout)window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0;this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150)}handleKeyDown(e){let t=this.getWrapperHasFocus();switch(e.key){case b.PAGE_DOWN:case b.PAGE_UP:case b.PAGE_HOME:case b.PAGE_END:if(t)e.preventDefault()}}addDomData(e){let t=Kg,{eGui:s,gos:i}=this;ai(i,s,t,this),e.addDestroyFunc(()=>ai(i,s,t,null))}focus(e){if(!this.isAlive())return!1;let{eGui:t}=this;if(!t)this.reAttemptToFocus=!0;else this.lastFocusEvent=e||null,t.focus();return!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){if(this.dragSource)this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null}handleContextMenuMouseEvent(e,t,s){let i=e??t,{menuSvc:o,gos:r}=this.beans;if(r.get("preventDefaultOnContextMenu"))i.preventDefault();if(o?.isHeaderContextMenuEnabled(s))o.showHeaderContextMenu(s,e,t);this.dispatchColumnMouseEvent("columnHeaderContextMenu",s)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;let{eventSvc:s}=this;if(e.isColumn)s.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"});else s.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}},nS=class extends yc{constructor(){super(...arguments);this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map}wireComp(e,t,s,i,o){this.comp=e;let{rowCtrl:r,column:n,beans:a}=this,{colResize:l,context:c,colHover:d,rangeSvc:u}=a,h=er(this,c,o);if(this.setGui(t,h),this.updateState(),this.setupWidth(h),this.setupMovingCss(h),this.setupMenuClass(h),this.setupSortableClass(h),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:i,checkMeasuringCallback:(p)=>this.setRefreshFunction("measuring",p),compBean:h}),this.addColumnHoverListener(h),this.setupFilterClass(h),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(h),this.setupSelectAll(h),this.setupUserComp(),this.refreshAria(),l)this.resizeFeature=h.createManagedBean(l.createResizeFeature(r.pinned,n,s,e,this));else G(s,!1);d?.createHoverFeature(h,[n],t),u?.createRangeHighlightFeature(h,n,e),h.createManagedBean(new Sc(n,t,a)),h.createManagedBean(new ls(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(h),h.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),h.addManagedPropertyListener("cellSelection",()=>this.refreshAria()),h.addManagedListeners(n,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});let g=()=>this.checkDisplayName();h.addManagedEventListeners({columnValueChanged:g,columnRowGroupChanged:g,columnPivotChanged:g,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),h.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(){let{column:e,beans:t}=this,s=e.colDef;return I(t.gos,{colDef:s,column:e,floatingFilter:!1})}setupUserComp(){let e=this.lookupUserCompDetails();if(e)this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){let e=this.createParams(),t=this.column.getColDef();return ab(this.beans.userCompFactory,t,e)}createParams(){let{menuSvc:e,sortSvc:t,colFilter:s,gos:i}=this.beans;return I(i,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!e?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!s&&(!this.openFilterEnabled||be(this.gos)),showColumnMenu:(r,n)=>{e?.showColumnMenu({column:this.column,buttonElement:r,positionBy:"button",onClosedCallback:n})},showColumnMenuAfterMouseClick:(r,n)=>{e?.showColumnMenu({column:this.column,mouseEvent:r,positionBy:"mouse",onClosedCallback:n})},showFilter:(r)=>{e?.showFilterMenu({column:this.column,buttonElement:r,containerType:"columnFilter",positionBy:"button"})},progressSort:(r)=>{t?.progressSort(this.column,!!r,"uiColumnSorted")},setSort:(r,n)=>{t?.setSortForColumn(this.column,nt(r),!!n,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(r,n)=>{i.assertModuleRegistered("Tooltip",3),this.setupTooltip(r,n)}})}setupSelectAll(e){let{selectionSvc:t}=this.beans;if(!t)return;this.selectAllFeature=e.createOptionalManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),e.addManagedPropertyListener("rowSelection",()=>{let s=t.createSelectAllFeature(this.column);if(s&&!this.selectAllFeature)this.selectAllFeature=e.createManagedBean(s),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui();else if(this.selectAllFeature&&!s)this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature)})}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){if(super.handleKeyDown(e),e.key===b.SPACE)this.selectAllFeature?.onSpaceKeyDown(e);else if(e.key===b.ENTER)this.onEnterKeyDown(e);else if(e.key===b.DOWN&&e.altKey)this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){let{column:t,gos:s,sortable:i,beans:o}=this,r=!1;if(e.ctrlKey||e.metaKey)r=this.showMenuOnKeyPress(e,!0);if(!r){if(!e.altKey&&is(s))o.rangeSvc?.handleColumnSelection(t,e);else if(i)o.sortSvc?.progressSort(t,e.shiftKey,"uiColumnSorted")}}showMenuOnKeyPress(e,t){let s=this.comp.getUserCompInstance();if(!uu(s))return!1;if(s.onMenuKeyboardShortcut(t))return e.preventDefault(),!0;return!1}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget))this.focusThis(),this.announceAriaDescription();if(Ji())this.setActiveHeader(!0)}onFocusOut(e){if(this.eGui.contains(e.relatedTarget))return;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(){let e=()=>{let t=this.column.colDef,s=Gn(t,this.gos,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(s);for(let o of s)if(i.has(o))i.delete(o);else this.comp.toggleCss(o,!0);for(let o of i)this.comp.toggleCss(o,!1)};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null}updateState(){let{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(let e of Object.values(this.refreshFunctions))e()}refreshHeaderComp(){let e=this.lookupUserCompDetails();if(!e)return;if(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)this.setDragSource(this.dragSourceElement);else this.setCompDetails(e)}attemptHeaderCompRefresh(e){let t=this.comp.getUserCompInstance();if(!t)return!1;if(!t.refresh)return!1;return t.refresh(e)}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){if(this.displayName!==this.calculateDisplayName())this.refresh()}workOutDraggable(){let e=this.column.colDef;return!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){let t=()=>{let s=this.column.getActualWidth();this.comp.setWidth(`${s}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){let t=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){let t=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){let t=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){let t=()=>{let s=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",s),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){let e=()=>{let t=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",t)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){let e=this.column.getHighlighted(),t=e===0,s=e===1;this.comp.toggleCss("ag-header-highlight-before",t),this.comp.toggleCss("ag-header-highlight-after",s)}onDisplayedColumnsChanged(){if(super.onDisplayedColumnsChanged(),!this.isAlive())return;this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){let{eGui:e,column:t,comp:s,beans:i}=this,o=Cc(this.beans),r=o.reduce((h,g)=>h+g,0)===0;if(s.toggleCss("ag-header-parent-hidden",r),!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),s.toggleCss("ag-header-span-height",!1),s.toggleCss("ag-header-span-total",!1);return}let{numberOfParents:n,isSpanningTotal:a}=this.column.getColumnGroupPaddingInfo();s.toggleCss("ag-header-span-height",n>0);let l=vc(i);if(n===0){s.toggleCss("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${l}px`);return}s.toggleCss("ag-header-span-total",a);let c=(this.column.getFirstRealParent()?.getLevel()??-1)+1,d=o.length-c,u=0;for(let h=0;h<d;h++)u+=o[o.length-1-h];e.style.setProperty("top",`${-u}px`),e.style.setProperty("height",`${l+u}px`)}refreshAriaSort(){let e=null,{beans:t,column:s,comp:i,sortable:o,gos:r}=this;if(o){let n=this.getLocaleTextFunc(),a=t.sortSvc?.getDisplaySortForColumn(s)??null;i.setAriaSort(wv(a)),e=is(r)?n("ariaSortableColumnWithCellSelection","Press ALT ENTER to sort"):n("ariaSortableColumn","Press ENTER to sort")}else i.setAriaSort();this.setAriaDescriptionProperty("sort",e)}refreshAriaMenu(){let e=null;if(this.menuEnabled)e=this.getLocaleTextFunc()("ariaMenuColumn","Press ALT DOWN to open column menu");this.setAriaDescriptionProperty("menu",e)}refreshAriaFilterButton(){let e=null,{openFilterEnabled:t,gos:s}=this;if(t&&!be(s))e=this.getLocaleTextFunc()("ariaFilterColumn","Press CTRL ENTER to open filter");this.setAriaDescriptionProperty("filterButton",e)}refreshAriaFiltered(){let e=null;if(this.column.isFilterActive())e=this.getLocaleTextFunc()("ariaColumnFiltered","Column Filtered");this.setAriaDescriptionProperty("filter",e)}refreshAriaCellSelection(){let e=null,{gos:t,column:s}=this;if(is(t)&&!Oe(s))e=this.getLocaleTextFunc()("ariaColumnCellSelection","Press Enter to toggle selection for all visible cells in this column");this.setAriaDescriptionProperty("cellSelection",e)}setAriaDescriptionProperty(e,t){let s=this.ariaDescriptionProperties;if(t!=null)s.set(e,t);else s.delete(e)}announceAriaDescription(){let{beans:e,eGui:t,ariaDescriptionProperties:s}=this;if(!t.contains(j(e)))return;let i=Array.from(s.keys()).sort((o,r)=>o==="filter"?-1:r.charCodeAt(0)-o.charCodeAt(0)).map((o)=>s.get(o)).join(". ");e.ariaAnnounce?.announceValue(i,"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){let t=(o)=>this.handleMouseOverChange(o.type==="mouseenter"),s=()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},i=(o)=>this.handleContextMenuMouseEvent(o,void 0,this.column);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:s,contextmenu:i})}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){let t=this.comp.getUserCompInstance();if(uu(t))return t.getAnchorElementForMenu(e);return this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function uu(e){return typeof e?.getAnchorElementForMenu==="function"&&typeof e.onMenuKeyboardShortcut==="function"}var aS=0,La=class extends y{constructor(e,t,s){super();this.rowIndex=e,this.pinned=t,this.type=s,this.instanceId=aS++,this.comp=null,this.allCtrls=[];let i="ag-header-row-column";if(s==="group")i="ag-header-row-group";else if(s==="filter")i="ag-header-row-filter";this.headerRowClass=`ag-header-row ${i}`}setRowIndex(e){this.rowIndex=e,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=Te(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){if(!this.comp)return!1;return this.allCtrls.every((e)=>e.eGui!=null)}setComp(e,t,s=!0){if(this.comp=e,t=er(this,this.beans.context,t),s)this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged();this.setWidth(),this.addEventListeners(t)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){let t=this.onRowHeightChanged.bind(this),s=this.onDisplayedColumnsChanged.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:s,virtualColumnsChanged:(i)=>this.onVirtualColumnsChanged(i.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,stylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",s),e.addManagedPropertyListener("ensureDomOrder",(i)=>this.isEnsureDomOrder=i.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}onDisplayedColumnsChanged(){this.isPrintLayout=Te(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;let e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){let{visibleCols:e}=this.beans;if(this.isPrintLayout){if(this.pinned!=null)return 0;return e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null)}return e.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;let{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){let e=0,t=Cc(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]}let s=vc(this.beans);if(this.type==="column")return{topOffset:e,rowHeight:s};e+=s;let i=Hg(this.beans);return{topOffset:e,rowHeight:i}}onVirtualColumnsChanged(e=!1){if(!this.comp)return;let t=this.getUpdatedHeaderCtrls(),s=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,s,e)}getUpdatedHeaderCtrls(){let e=this.ctrlsById;this.ctrlsById=new Map;let t=this.getColumnsInViewport();for(let i of t)this.recycleAndCreateHeaderCtrls(i,this.ctrlsById,e);let s=(i)=>{let{focusSvc:o,visibleCols:r}=this.beans;if(!o.isHeaderWrapperFocused(i))return!1;return r.isVisible(i.column)};if(e)for(let[i,o]of e)if(s(o))this.ctrlsById.set(i,o);else this.destroyBean(o);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(e,t,s){if(e.isEmptyGroup())return;let i=e.getUniqueId(),o;if(s)o=s.get(i),s.delete(i);if(o&&o.column!=e)this.destroyBean(o),o=void 0;if(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 nS(e,this));break}t.set(i,o)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];let e=[];for(let t of["left",null,"right"])e.push(...this.getComponentsToRender(t));return e}getComponentsToRender(e=this.pinned){if(this.type==="group")return this.beans.colViewport.getHeadersToRender(e,this.rowIndex);return this.beans.colViewport.getColumnHeadersToRender(e)}focusHeader(e,t){let s=this.allCtrls.find((o)=>o.column==e);if(!s)return!1;return s.focus(t)}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},lS=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;let{pinnedCols:s,ctrlsSvc:i,colModel:o,colMoves:r}=this.beans;this.setupCenterWidth(),s?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(r,this.eViewport);let n=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:n,advancedFilterEnabledChanged:n});let a=`${typeof this.pinned==="string"?this.pinned:"center"}Header`;if(i.register(a,this),o.ready)this.refresh()}getAllCtrls(){let e=[...this.groupsRowCtrls];if(this.columnsRowCtrl)e.push(this.columnsRowCtrl);if(this.filtersRowCtrl)e.push(this.filtersRowCtrl);return e}refresh(e=!1){let{focusSvc:t,filterManager:s,visibleCols:i}=this.beans,o=0,r=t.getFocusHeaderToUseAfterRefresh(),n=()=>{let u=i.headerGroupRowCount;if(o=u,!e)this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);let h=this.groupsRowCtrls.length;if(h===u)return;if(h>u){for(let g=u;g<h;g++)this.destroyBean(this.groupsRowCtrls[g]);this.groupsRowCtrls.length=u;return}for(let g=h;g<u;g++){let p=this.createBean(new La(g,this.pinned,"group"));this.groupsRowCtrls.push(p)}},a=()=>{let u=o++;if(this.hidden){this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl);return}if(this.columnsRowCtrl==null||!e)this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new La(u,this.pinned,"column"));else if(this.columnsRowCtrl.rowIndex!==u)this.columnsRowCtrl.setRowIndex(u)},l=()=>{this.includeFloatingFilter=!!s?.hasFloatingFilters()&&!this.hidden;let u=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){u();return}if(!e)u();let h=o++;if(this.filtersRowCtrl){if(this.filtersRowCtrl.rowIndex!==h)this.filtersRowCtrl.setRowIndex(h)}else this.filtersRowCtrl=this.createBean(new La(h,this.pinned,"filter"))},c=this.getAllCtrls();n(),a(),l();let d=this.getAllCtrls();if(this.comp.setCtrls(d),this.restoreFocusOnHeader(t,r),c.length!==d.length)this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(e){let t=(s)=>s?.getHeaderCellCtrls().find((i)=>i.column===e);if(ht(e))return t(this.columnsRowCtrl);if(this.groupsRowCtrls.length===0)return;for(let s=0;s<this.groupsRowCtrls.length;s++){let i=t(this.groupsRowCtrls[s]);if(i)return i}}getHtmlElementForColumnHeader(e){return this.getHeaderCtrlForColumn(e)?.eGui??null}getRowType(e){return this.getAllCtrls()[e]?.type}focusHeader(e,t,s){let o=this.getAllCtrls()[e];if(!o)return!1;return o.focusHeader(t,s)}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){let s=e?.createBodyDropTarget(this.pinned,t);if(s)this.createManagedBean(s)}restoreFocusOnHeader(e,t){if(!t)return;let{column:s}=t;if(s.getPinned()!=this.pinned)return;e.focusHeaderPosition({headerPosition:t,scroll:!1})}setupCenterWidth(){if(this.pinned!=null)return;this.createManagedBean(new bc((e)=>this.comp.setCenterWidth(`${e}px`),!0))}},cS={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},dS={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},uS={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},Ga=class extends L{constructor(e){super();this.eCenterContainer=E,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();let e={setDisplayed:(s)=>this.setDisplayed(s),setCtrls:(s)=>this.setCtrls(s),setCenterWidth:(s)=>this.eCenterContainer.style.width=s,setViewportScrollLeft:(s)=>this.getGui().scrollLeft=s,setPinnedContainerWidth:(s)=>{let i=this.getGui();i.style.width=s,i.style.maxWidth=s,i.style.minWidth=s}};this.createManagedBean(new lS(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){let e=this.pinned=="left",t=this.pinned=="right",s=e?cS:t?dS:uS;this.setTemplate(s),this.eRowContainer=this.eCenterContainer!==E?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),e.getGui().remove()}setCtrls(e){let t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let s,i=(o)=>{let r=o.getGui();if(r.parentElement!=this.eRowContainer)this.eRowContainer.appendChild(r);if(s)Ih(this.eRowContainer,r,s);s=r};for(let o of e){let r=o.instanceId,n=t[r];delete t[r];let a=n?n:this.createBean(new tS(o));this.headerRowComps[r]=a,this.rowCompsList.push(a),i(a)}for(let o of Object.values(t))this.destroyRowComp(o)}},hS={tag:"div",cls:"ag-header",role:"presentation"},gS=class extends L{constructor(){super(hS)}postConstruct(){let e={toggleCss:(i,o)=>this.toggleCss(i,o),setHeightAndMinHeight:(i)=>{this.getGui().style.height=i,this.getGui().style.minHeight=i}};this.createManagedBean(new qb).setComp(e,this.getGui(),this.getFocusableElement());let s=(i)=>{this.createManagedBean(i),this.appendChild(i)};s(new Ga("left")),s(new Ga(null)),s(new Ga("right"))}},pS={selector:"AG-HEADER-ROOT",component:gS},Et={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},xc=class extends y{constructor(e){super();this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){let e=this.gos.get("domLayout"),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},s=t.autoHeight?Et.AUTO_HEIGHT:t.print?Et.PRINT:Et.NORMAL;this.view.updateLayoutClasses(s,t)}},$g=class extends L{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",Mg()||os())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){if(this.invisibleScrollbar!==void 0)return;if(this.invisibleScrollbar=Dg(),this.invisibleScrollbar)this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()}addActiveListenerToggles(){let e=this.getGui(),t=()=>this.toggleCss("ag-scrollbar-active",!0),s=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:s,touchend:s})}onScrollVisibilityChanged(){if(this.invisibleScrollbar===void 0)this.initialiseInvisibleScrollbar();et(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:(e)=>{if(e.direction===this.direction){if(this.hideTimeout)window.clearTimeout(this.hideTimeout),this.hideTimeout=0;this.toggleCss("ag-scrollbar-scrolling",!0)}},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.toggleCss("ag-scrollbar-scrolling",!1),this.hideTimeout=0},400)}})}attemptSettingScrollPosition(e){let t=this.eViewport;$l(this,()=>ve(t),()=>this.setScrollPosition(e),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},fS={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"}]},mS=class extends $g{constructor(){super(fS,"horizontal");this.eLeftSpacer=E,this.eRightSpacer=E,this.setScrollVisibleDebounce=0}wireBeans(e){this.visibleCols=e.visibleCols,this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){super.postConstruct();let 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 bc((t)=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){if(this.invisibleScrollbar!==void 0)return;if(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar)this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;let e=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){let e=this.scrollVisibleSvc.verticalScrollShowing,t=this.visibleCols.getDisplayedColumnsRightWidth(),s=!this.enableRtl&&e,i=this.scrollVisibleSvc.getScrollbarWidth();if(s)t+=i;Kt(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=i);let o=this.visibleCols.getColsLeftWidth();if(this.enableRtl&&e)o+=i;Kt(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=i)}setScrollVisible(){let e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,s=this.gos.get("suppressHorizontalScroll"),i=e?this.scrollVisibleSvc.getScrollbarWidth()||0:0,r=!s?i===0&&t?16:i:0,n=()=>{if(this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",t),xo(this.getGui(),r),xo(this.eViewport,r),xo(this.eContainer,r),!r)this.eContainer.style.setProperty("min-height","1px");this.setVisible(e,{skipAriaHidden:!0})};if(window.clearTimeout(this.setScrollVisibleDebounce),!e)n();else this.setScrollVisibleDebounce=window.setTimeout(n,100)}getScrollPosition(){return Xr(this.eViewport,this.enableRtl)}setScrollPosition(e){if(!ve(this.eViewport))this.attemptSettingScrollPosition(e);Zr(this.eViewport,e,this.enableRtl)}},CS={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:mS},jg=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){let t=e.uiContainerHeight,s=t!=null?`${t}px`:"";if(this.eContainer.style.height=s,this.eViewport)this.eViewport.style.height=s}},vS={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"}]}]},wS=class extends $g{constructor(){super(vS,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new jg(this.eContainer));let{ctrlsSvc:e}=this.beans;e.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,e)})}setScrollVisible(){let{scrollVisibleSvc:e}=this.beans,t=e.verticalScrollShowing,s=this.invisibleScrollbar,i=t?e.getScrollbarWidth()||0:0,o=i===0&&s?16:i;this.toggleCss("ag-scrollbar-invisible",s),Kt(this.getGui(),o),Kt(this.eViewport,o),Kt(this.eContainer,o),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(e){let s=e.getGridBodyCtrl().eBodyViewport,i=this.getScrollPosition(),o=s.scrollTop;if(i!=o)this.setScrollPosition(o,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){if(!t&&!ve(this.eViewport))this.attemptSettingScrollPosition(e);this.eViewport.scrollTop=e}},bS={selector:"AG-FAKE-VERTICAL-SCROLL",component:wS};var vs="Viewport",hu="fakeVScrollComp",Oa=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],gu=100,Ba=150,SS=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=$e(this,()=>this.lastScrollSource[1]=null,Ba),this.resetLastVScrollDebounced=$e(this,()=>this.lastScrollSource[0]=null,Ba)}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");let 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,(s)=>{this.centerRowsCtrl=s.center,this.fakeVScrollComp=s.fakeVScrollComp,this.fakeHScrollComp=s.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,vs)});for(let e of Oa){let t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){let e=this.gos.get("debounceVerticalScrollbar"),t=e?$e(this,this.onVScroll.bind(this,vs),gu):this.onVScroll.bind(this,vs),s=e?$e(this,this.onVScroll.bind(this,hu),gu):this.onVScroll.bind(this,hu);this.addManagedElementListeners(this.eBodyViewport,{scroll:t}),this.registerScrollPartner(this.fakeVScrollComp,s)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){if(this.enableRtl)this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(this.centerRowsCtrl==null)return;if(e===void 0)e=this.centerRowsCtrl.getCenterViewportScrollLeft();this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e))}setScrollLeftForAllContainersExceptCurrent(e){for(let t of[...Oa,vs]){if(this.lastScrollSource[1]===t)continue;let s=this.getViewportForSource(t);Zr(s,e,this.enableRtl)}}getViewportForSource(e){if(e===vs)return this.centerRowsCtrl.eViewport;return this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){if(this.lastScrollSource[t]==null){if(t===0)this.lastScrollSource[0]=e;else this.lastScrollSource[1]=e;return!0}return this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;let t=this.centerRowsCtrl.eViewport,{scrollLeft:s}=t;if(this.shouldBlockScrollUpdate(1,s,!0))return;let i=Xr(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(i),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;let t=e===vs?this.eBodyViewport.scrollTop:this.fakeVScrollComp.getScrollPosition(),s=t;if(this.shouldBlockScrollUpdate(0,s,!0))return;if(e===vs)this.fakeVScrollComp.setScrollPosition(s);else if(this.eBodyViewport.scrollTop=t,s=this.eBodyViewport.scrollTop,this.invalidateVerticalScroll(),s!==t)this.fakeVScrollComp.setScrollPosition(s,!0);let{animationFrameSvc:i}=this;if(i?.setScrollTop(s),this.nextScrollTop=s,i?.active)i.schedule();else this.scrollGridIfNeeded(!0);this.resetLastVScrollDebounced()}doHorizontalScroll(e){let t=this.fakeHScrollComp.getScrollPosition();if(this.scrollLeft===e&&e===t)return;this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0)}isScrolling(){return this.isScrollActive}fireScrollEvent(e){let 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"})},Ba)}shouldBlockScrollUpdate(e,t,s=!1){if(s&&!os())return!1;if(e===0)return this.shouldBlockVerticalScroll(t);return this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){let t=Ko(this.eBodyViewport),{scrollHeight:s}=this.eBodyViewport;return e<0||e+t>s}shouldBlockHorizontalScroll(e){let t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:s}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>s}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){let e=this.scrollLeft,t=!1;for(let s of Oa)if(this.getViewportForSource(s).scrollLeft!==e){t=!0;break}if(t)this.onHScroll(vs)}scrollGridIfNeeded(e=!1){let t=this.scrollTop!=this.nextScrollTop;if(t){if(this.scrollTop=this.nextScrollTop,e)this.invalidateVerticalScroll();this.redrawRowsAfterScroll()}return t}setHorizontalScrollPosition(e,t=!1){let i=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();if(!t&&this.shouldBlockScrollUpdate(1,e))if(this.enableRtl)e=e>0?0:i;else e=Math.min(Math.max(e,0),i);Zr(this.centerRowsCtrl.eViewport,Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=e}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){let{lastOffsetHeight:s,lastScrollTop:i}=this;return{top:i,bottom:i+s}}this.isVerticalPositionInvalidated=!1;let{scrollTop:e,offsetHeight:t}=this.eBodyViewport;return this.lastScrollTop=e,this.lastOffsetHeight=t,{top:e,bottom:e+t}}getApproximateVScollPosition(){if(this.lastScrollTop>=0&&this.lastOffsetHeight>=0)return{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight};return this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){if(this.isHorizontalPositionInvalidated)this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1;return this.lastIsHorizontalScrollShowing}scrollHorizontally(e){let t=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.eViewport.scrollLeft-t}scrollToTop(){this.setVerticalScrollPosition(0)}ensureNodeVisible(e,t=null){let{rowModel:s}=this.beans,i=s.getRowCount(),o=-1;for(let r=0;r<i;r++){let n=s.getRow(r);if(typeof e==="function"){if(n&&e(n)){o=r;break}}else if(e===n||e===n.data){o=r;break}}if(o>=0)this.ensureIndexVisible(o,t)}ensureIndexVisible(e,t,s=0){if(Te(this.gos,"print"))return;let{rowModel:i}=this.beans,o=i.getRowCount();if(typeof e!=="number"||e<0||e>=o){F(88,{index:e});return}this.clearRetryListeners();let{frameworkOverrides:r,pageBounds:n,rowContainerHeight:a,rowRenderer:l}=this.beans;r.wrapIncoming(()=>{let c=this.ctrlsSvc.getGridBodyCtrl(),d=i.getRow(e),u,h,g=0;this.invalidateVerticalScroll();do{let{stickyTopHeight:p,stickyBottomHeight:f}=c,{rowTop:m,rowHeight:C}=d,v=n.getPixelOffset(),w=d.rowTop-v,S=w+d.rowHeight,x=this.getVScrollPosition(),R=a.divStretchOffset,P=x.top+R,D=x.bottom+R,O=D-P,A=a.getScrollPositionForPixel(w),_=a.getScrollPositionForPixel(S-O),oe=Math.min((A+_)/2,w),Y=P+p>w,V=D-f<S,re=null;if(t==="top")re=A-p;else if(t==="bottom")re=_+f;else if(t==="middle")re=oe;else if(Y)re=A-p;else if(V)if(_-A>O)re=A-p;else re=_+f;if(re!==null)this.setVerticalScrollPosition(re),l.redraw({afterScroll:!0});u=m!==d.rowTop||C!==d.rowHeight,h=p!==c.stickyTopHeight||f!==c.stickyBottomHeight,g++}while((u||h)&&g<10);if(this.animationFrameSvc?.flushAllFrames(),s<10&&(d?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){let p=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{let f=this.getVScrollPosition().top;if(p===f)return;this.clearRetryListeners()},modelUpdated:()=>{if(this.clearRetryListeners(),e>=i.getRowCount())return;this.ensureIndexVisible(e,t,s+1)}})}})}clearRetryListeners(){for(let e of this.clearRetryListenerFncs)e();this.clearRetryListenerFncs=[]}ensureColumnVisible(e,t="auto"){let{colModel:s,frameworkOverrides:i}=this.beans,o=s.getCol(e);if(!o)return;if(o.isPinned())return;if(!this.visibleCols.isColDisplayed(o))return;let r=this.getPositionedHorizontalScroll(o,t);i.wrapIncoming(()=>{if(r!==null)this.centerRowsCtrl.setCenterViewportScrollLeft(r);this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(e,t){let{columnBeforeStart:s,columnAfterEnd:i}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),n=this.enableRtl,a=(n?s:i)||o,l=n?i:s;if(t!=="auto")a=t==="start",l=t==="end";let c=t==="middle";if(a||l||c){let{colLeft:d,colMiddle:u,colRight:h}=this.getColumnBounds(e);if(c)return u-r/2;if(a)return n?h:d;return n?d-r:h-r}return null}isColumnOutsideViewport(e){let{start:t,end:s}=this.getViewportBounds(),{colLeft:i,colRight:o}=this.getColumnBounds(e),r=this.enableRtl,n=r?t>o:s<o,a=r?s<i:t>i;return{columnBeforeStart:n,columnAfterEnd:a}}getColumnBounds(e){let t=this.enableRtl,s=this.visibleCols.bodyWidth,i=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,n=t?s-o:o,a=n+i*r,l=n+i/2*r;return{colLeft:n,colMiddle:l,colRight:a}}getViewportBounds(){let e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),s=t,i=e+t;return{start:s,end:i,width:e}}},pu={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 yS(e,t,s=cc()||0,i,o){return qg(e,t,"horizontal",s,i,o)}function xS(e,t,s=cc()||0,i,o){return qg(e,t,"vertical",s,i,o)}function qg(e,t,s,i,o,r){let n=pu[s],a=pu[n.opposite],l=o?ve(o):!0,c=r?ve(r):!0,d=n.overflow(e);if(d<=0)return!1;if(!t||i===0)return!0;let u=a.overflow(t);if(u<=0)return!0;if(d<=i){if(l&&c&&RS({candidateOverflow:u,candidateScrollSize:a.scrollSize(t),candidateClientSize:a.clientSize(t),scrollbarWidth:i}))return!1;let h=n.clientSize(e)+i;return n.scrollSize(e)<=h}return!0}function RS({candidateOverflow:e,candidateScrollSize:t,candidateClientSize:s,scrollbarWidth:i}){if(e<=0||e>i)return!1;let o=s+i;return t>s&&t<=o}var FS=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(){let{beans:e,centerContainerCtrl:t,gridBodyCtrl:s}=this,i=()=>{et(e,()=>{this.onCenterViewportResized()})};t.registerViewportResizeListener(i),s.registerBodyViewportResizeListener(i)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){let{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();let s=this.centerContainerCtrl.getCenterWidth();if(s!==this.centerWidth)this.centerWidth=s,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(){let e=this.gridBodyCtrl.eBodyViewport,t=Ko(e);if(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;let e={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(e)}onHorizontalViewportChanged(){let{centerContainerCtrl:e,beans:t}=this,s=e.getCenterWidth(),i=e.getViewportScrollLeft();t.colViewport.setScrollPosition(s,i)}};function Yg(e){if(e.altKey||e.ctrlKey||e.metaKey)return!1;return e.key?.length===1}function Wr(e,t,s,i){let o=t.getColDef().cellRendererParams?.suppressMouseEventHandling;return Xg(e,t,s,i,o)}function ES(e,t,s,i){let o=t?.suppressMouseEventHandling;return Xg(e,void 0,s,i,o)}function Xg(e,t,s,i,o){if(!o)return!1;return o(I(e,{column:t,node:s,event:i}))}function Zg(e,t,s){let i=t;while(i){let o=Jh(e,i,s);if(o)return o;i=i.parentElement}return null}var ln="cellCtrl";function tr(e,t){return Zg(e,t,ln)}var cn="renderedRow";function Rc(e,t){return Zg(e,t,cn)}function ml(e,t,s,i,o){let r=i?i.colDef.suppressKeyboardEvent:void 0;if(!r)return!1;let n=I(e,{event:t,editing:o,column:i,node:s,data:s.data,colDef:i.colDef});if(r){if(r(n))return!0}return!1}function PS(e){let{pinnedRowModel:t,rowModel:s,rangeSvc:i,visibleCols:o}=e;if(!i||o.allCols.length===0)return;let r=t?.isEmpty("top")??!0,n=t?.isEmpty("bottom")??!0,a=r?null:"top",l,c;if(n)l=null,c=s.getRowCount()-1;else l="bottom",c=t?.getPinnedBottomRowCount()??-1;i.setCellRange({rowStartIndex:0,rowStartPinned:a,rowEndIndex:c,rowEndPinned:l})}var MS=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(){let t=this.processKeyboardEvent.bind(this,"keydown");this.addManagedElementListeners(this.element,{["keydown"]:t})}addMouseListeners(){let e="mousedown";if(il("pointerdown"))e="pointerdown";else if(il("touchstart"))e="touchstart";let t=["dblclick","contextmenu","mouseover","mouseout","click",e];for(let s of t){let i=this.processMouseEvent.bind(this,s);this.addManagedElementListeners(this.element,{[s]:i})}}processMouseEvent(e,t){if(!Do(this.beans,t)||ut(t))return;let{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);if(e==="contextmenu"){if(s?.column)s.dispatchCellContextMenuEvent(t);this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,i,s)}else{if(s)s.onMouseEvent(e,t);if(i)i.onMouseEvent(e,t)}}getControlsForEventTarget(e){let{gos:t}=this;return{cellCtrl:tr(t,e),rowCtrl:Rc(t,e)}}processKeyboardEvent(e,t){let{cellCtrl:s,rowCtrl:i}=this.getControlsForEventTarget(t.target);if(t.defaultPrevented)return;if(s)this.processCellKeyboardEvent(s,e,t);else if(i?.isFullWidth())this.processFullWidthRowKeyboardEvent(i,e,t)}processCellKeyboardEvent(e,t,s){let i=this.editSvc?.isEditing(e,{withOpenEditor:!0})??!1;if(!ml(this.gos,s,e.rowNode,e.column,i)){if(t==="keydown"){if(!(!i&&this.beans.navigation?.handlePageScrollingKey(s)))e.onKeyDown(s);if(this.doGridOperations(s,i),Yg(s))e.processCharacter(s)}}if(t==="keydown")this.eventSvc.dispatchEvent(e.createEvent(s,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,s){let{rowNode:i}=e,{focusSvc:o,navigation:r,notesSvc:n}=this.beans,l=o.getFocusedCell()?.column;if(!ml(this.gos,s,i,l,!1)&&t==="keydown")this.processFullWidthRowKeyDown(e,s,l,r,n);if(t==="keydown")this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",s))}processFullWidthRowKeyDown(e,t,s,i=this.beans.navigation,o=this.beans.notesSvc){switch(t.key){case b.PAGE_HOME:case b.PAGE_END:case b.PAGE_UP:case b.PAGE_DOWN:i?.handlePageScrollingKey(t,!0);return;case b.LEFT:case b.RIGHT:if(!this.gos.get("embedFullWidthRows"))return;case b.UP:case b.DOWN:e.onKeyboardNavigate(t);return;case b.F2:this.processFullWidthRowNoteShortcut(e,t,s,o);return;case b.TAB:e.onTabKeyDown(t);return;default:}}processFullWidthRowNoteShortcut(e,t,s,i=this.beans.notesSvc){if(!t.shiftKey||!i?.hasDataSource())return;let o=e.rowNode,r=e.findFullWidthInfoForEvent(t),n;if(r){let{pinned:l}=r;n={rowNode:o,location:"fullWidthRow",pinned:l==="left"||l==="right"?l:void 0}}else if(s)n={rowNode:o,column:s};if(!n)return;let a=i.getNoteAccess(n);if(!a)return;if(!a.isSuppressed||a.canView)i.showNote(a.params,!0),t.preventDefault()}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!Do(this.beans,e))return;let s=wg(e),{clipboardSvc:i,undoRedo:o}=this.beans;if(s===b.A)return this.onCtrlAndA(e);if(s===b.C)return this.onCtrlAndC(i,e);if(s===b.D)return this.onCtrlAndD(i,e);if(s===b.V)return this.onCtrlAndV(i,e);if(s===b.X)return this.onCtrlAndX(i,e);if(s===b.Y)return this.onCtrlAndY(o);if(s===b.Z)return this.onCtrlAndZ(o,e)}onCtrlAndA(e){let{beans:{rowModel:t,rangeSvc:s,selectionSvc:i},gos:o}=this;if(s&&qe(o)&&!ww(o)&&t.isRowsToRender())PS(this.beans);else if(i)i.selectAllRowNodes({source:"keyboardSelectAll",selectAll:rg(o)});e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;let{cellCtrl:s}=this.getControlsForEventTarget(t.target);if(this.editSvc?.isEditing(s,{withOpenEditor:!0}))return;t.preventDefault(),e.copyToClipboard()}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;let{cellCtrl:s}=this.getControlsForEventTarget(t.target);if(this.editSvc?.isEditing(s,{withOpenEditor:!0}))return;t.preventDefault(),e.cutToClipboard(void 0,"ui")}onCtrlAndV(e,t){let{cellCtrl:s}=this.getControlsForEventTarget(t.target);if(this.editSvc?.isEditing(s,{withOpenEditor:!0}))return;if(e&&!this.gos.get("suppressClipboardPaste"))e.pasteFromClipboard()}onCtrlAndD(e,t){if(e&&!this.gos.get("suppressClipboardPaste"))e.copyRangeDown();t.preventDefault()}onCtrlAndZ(e,t){if(!this.gos.get("undoRedoCellEditing")||!e)return;if(t.preventDefault(),t.shiftKey)e.redo("ui");else e.undo("ui")}onCtrlAndY(e){e?.redo("ui")}},Tr=(e)=>e.topRowCtrls,Dr=(e)=>e.getStickyTopRowCtrls(),Ar=(e)=>e.getStickyBottomRowCtrls(),Ir=(e)=>e.bottomRowCtrls,kr=(e)=>e.allRowCtrls,Va=(e)=>e.getCtrls("top"),Na=(e)=>e.getCtrls("center"),_a=(e)=>e.getCtrls("bottom"),TS={center:{type:"center",name:"center-cols",getRowCtrls:kr,getSpannedRowCtrls:Na},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:kr,getSpannedRowCtrls:Na},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:kr,getSpannedRowCtrls:Na},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:kr},topCenter:{type:"center",name:"floating-top",getRowCtrls:Tr,getSpannedRowCtrls:Va},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Tr,getSpannedRowCtrls:Va},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Tr,getSpannedRowCtrls:Va},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:Tr},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:Dr},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Dr},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Dr},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:Dr},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:Ar},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Ar},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Ar},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:Ar},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:Ir,getSpannedRowCtrls:_a},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Ir,getSpannedRowCtrls:_a},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Ir,getSpannedRowCtrls:_a},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:Ir}};function Qg(e){return`ag-${sr(e).name}-viewport`}function Jg(e){let t=sr(e);return t.container??`ag-${t.name}-container`}function DS(e){return`ag-${sr(e).name}-spanned-cells-container`}function sr(e){return TS[e]}var AS=["topCenter","topLeft","topRight"],IS=["bottomCenter","bottomLeft","bottomRight"],kS=["center","left","right"],LS=["center","left","right","fullWidth"],GS=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],OS=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],BS=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],ep=["stickyTopCenter","stickyTopLeft","stickyTopRight"],tp=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],VS=[...ep,"stickyTopFullWidth",...tp,"stickyBottomFullWidth"],NS=[...AS,...IS,...kS,...ep,...tp],_S=class extends y{constructor(e){super();this.name=e,this.visible=!0,this.EMPTY_CTRLS=[],this.options=sr(e)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new FS(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){if(this.options.fullWidth)return;this.beans.ctrlsSvc.register(this.name,this)}forContainers(e,t){if(e.indexOf(this.name)>=0)t()}setComp(e,t,s,i){this.comp=e,this.eContainer=t,this.eSpannedContainer=s,this.eViewport=i,this.createManagedBean(new MS(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();let{pinnedCols:o,rangeSvc:r}=this.beans,n=()=>this.onPinnedWidthChanged();if(this.forContainers(OS,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(o?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:n})}),this.forContainers(BS,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(o?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:n})}),this.forContainers(LS,()=>this.createManagedBean(new jg(this.eContainer,this.name==="center"?i:void 0))),r)this.forContainers(NS,()=>this.createManagedBean(r.createDragListenerFeature(this.eContainer)));this.forContainers(GS,()=>this.createManagedBean(new bc((a)=>this.comp.setContainerWidth(`${a}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}addListeners(){let{spannedRowRenderer:e,gos:t}=this.beans,s=this.onDisplayedColumnsChanged.bind(this);if(this.addManagedEventListeners({displayedColumnsChanged:s,displayedColumnsWidthChanged:s,displayedRowsChanged:(i)=>this.onDisplayedRowsChanged(i.afterScroll)}),s(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan"))this.addManagedListeners(e,{spannedRowsUpdated:()=>{let i=this.options.getSpannedRowCtrls(e);if(!i)return;this.comp.setSpannedRowCtrls(i,!1)}})}listenOnDomOrder(){if(VS.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}let t=()=>{let s=this.gos.get("ensureDomOrder"),i=Te(this.gos,"print");this.comp.setDomOrder(s||i)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){let{dragSvc:e}=this.beans;if(!e)return;let t=(s)=>{if(e.dragging){if(s.cancelable)s.preventDefault()}};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(e=!1){let t=this.getCenterWidth(),s=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(t,s,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return ni(this.eViewport)}getCenterViewportScrollLeft(){return Xr(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){let t=It(this.beans,this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return Ah(this.eViewport)}getViewportScrollLeft(){return Xr(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){let{beans:e,gos:t,eViewport:s}=this,i=t.get("alwaysShowHorizontalScroll"),{ctrlsSvc:o}=e,r=o.getGridBodyCtrl()?.eBodyViewport,n=o.get("fakeHScrollComp")?.getGui(),a=o.get("fakeVScrollComp")?.getGui();return i||yS(s,r,void 0,n,a)}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){Zr(this.eViewport,e,this.enableRtl)}isContainerVisible(){return this.options.pinnedType==null||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){let e=this.isContainerVisible();if(this.visible!=e)this.visible=e,this.onDisplayedRowsChanged()}onDisplayedRowsChanged(e=!1){let t=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}let s=Te(this.gos,"print"),o=this.gos.get("embedFullWidthRows")||s,r=t.filter((n)=>{let a=n.isFullWidth();return this.options.fullWidth?!o&&a:o||!a});this.comp.setRowCtrls({rowCtrls:r,useFlushSync:e})}},sp="ag-force-vertical-scroll",HS="ag-selectable",zS="ag-column-moving",WS=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,s,i,o,r,n){this.comp=e,this.eGridBody=t,this.eBodyViewport=s,this.eTop=i,this.eBottom=o,this.eStickyTop=r,this.eStickyBottom=n,this.eCenterColsViewport=s.querySelector(`.${Qg("center")}`),this.eFullWidthContainer=s.querySelector(`.${Jg("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",(a)=>this.setCellTextSelection(a.currentValue)),this.createManagedBean(new xc(this.comp)),this.scrollFeature=this.createManagedBean(new SS(s)),this.beans.rowDragSvc?.setupRowDrag(s,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([i,s,o,r,n]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(i),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){let e=this.setFloatingHeights.bind(this),t=this.setGridRootRole.bind(this),s=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:s,rowResizeEnded:s}),this.addManagedPropertyListener("treeData",t)}toggleRowResizeStyles(e){let t=e.type==="rowResizeStarted";this.eBodyViewport.classList.toggle("ag-prevent-animation",t)}onGridColumnsChanged(){let e=this.beans.colModel.getCols();this.comp.setColumnCount(e.length)}onScrollVisibilityChanged(){let{scrollVisibleSvc:e}=this,t=e.verticalScrollShowing;this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();let s=t?e.getScrollbarWidth()||0:0,i=Dg()?16:0,o=`calc(100% + ${s+i}px)`;et(this.beans,()=>this.comp.setBodyViewportWidth(o)),this.updateScrollingClasses()}setGridRootRole(){let{rowGroupColsSvc:e,colModel:t,gos:s}=this,i=s.get("treeData");if(!i){let o=t.pivotMode;i=(!e?0:e.columns.length)>=(o?2:1)}this.comp.setGridRootRole(i?"treegrid":"grid")}addFocusListeners(e){for(let t of e)this.addManagedElementListeners(t,{focusin:(s)=>{let{target:i}=s,o=ti(i,"ag-root",t);t.classList.toggle("ag-has-focus",!o)},focusout:(s)=>{let{target:i,relatedTarget:o}=s,r=t.contains(o),n=ti(o,"ag-root",t);if(ti(i,"ag-root",t))return;if(!r||n)t.classList.remove("ag-has-focus")}})}setColumnMovingCss(e){this.comp.setColumnMovingCss(zS,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(HS,e)}updateScrollingClasses(){let{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(){let e=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:t}=this.beans,s=t.isLastRowIndexKnown()?t.getRowCount():-1,i=s===-1?-1:e+s;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){let t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){let{gos:e,comp:t,ctrlsSvc:s}=this,i=e.get("alwaysShowVerticalScroll"),o=i?sp:null,r=Te(e,"normal");t.setAlwaysVerticalScrollClass(o,i);let n=s.get("center")?.eViewport,a=s.get("fakeHScrollComp")?.getGui(),l=s.get("fakeVScrollComp")?.getGui();return i||r&&xS(this.eBodyViewport,n,void 0,l,a)}setupRowAnimationCssClass(){let{rowContainerHeight:e,environment:t}=this.beans,s=t.sizesMeasured,i=()=>{let o=s&&Bi(this.gos)&&!e.stretching,r=o?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(r,o)};i(),this.addManagedEventListeners({heightScaleChanged:i}),this.addManagedPropertyListener("animateRows",i),this.addManagedEventListeners({stylesChanged:()=>{if(!s&&t.sizesMeasured)s=!0,i()}})}addBodyViewportListener(){let{eBodyViewport:e,eStickyTop:t,eStickyBottom:s,eTop:i,eBottom:o,beans:{popupSvc:r,touchSvc:n}}=this,a=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(e,{contextmenu:a}),n?.mockBodyContextMenu(this,a),this.addManagedElementListeners(e,{wheel:this.onBodyViewportWheel.bind(this,r)});let l=this.onStickyWheel.bind(this);for(let d of[t,s,i,o])this.addManagedElementListeners(d,{wheel:l});let c=this.onHorizontalWheel.bind(this);for(let 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){let{deltaX:t,deltaY:s,shiftKey:i}=e;if((i||Math.abs(t)>Math.abs(s))&&Do(this.beans,e))this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){let{deltaY:t}=e;if(this.scrollVertically(t)>0)e.preventDefault()}onHorizontalWheel(e){let{deltaX:t,deltaY:s,shiftKey:i}=e;if(!(i||Math.abs(t)>Math.abs(s)))return;this.scrollGridBodyToMatchEvent(e)}scrollGridBodyToMatchEvent(e){let{deltaX:t,deltaY:s}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||s})}onBodyViewportContextMenu(e,t,s){if(!e&&!s)return;if(this.gos.get("preventDefaultOnContextMenu"))(e||s).preventDefault();let{target:i}=e||t;if(i===this.eBodyViewport||i===this.ctrlsSvc.get("center").eViewport)this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:s,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(e,t){if(!this.gos.get("suppressScrollWhenPopupsAreOpen"))return;if(e?.hasAnchoredPopup())t.preventDefault()}scrollVertically(e){let t=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}setFloatingHeights(){let{pinnedRowModel:e,beans:{environment:t}}=this,s=e?.getPinnedTopTotalHeight(),i=e?.getPinnedBottomTotalHeight(),o=t.getPinnedRowBorderWidth(),r=t.getRowBorderWidth(),n=o-r,a=!s?0:n+s,l=!i?0:n+i;this.comp.setTopHeight(a),this.comp.setBottomHeight(l),this.comp.setTopInvisible(a<=0),this.comp.setBottomInvisible(l<=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{let t=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}setStickyTopOffsetTop(){let t=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),s=this.pinnedRowModel?.getPinnedTopTotalHeight()??0,i=0;if(t>0)i+=t;if(s>0)i+=s;if(i>0)i+=1;this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){let{pinnedRowModel:e,scrollVisibleSvc:t,comp:s}=this,i=e?.getPinnedBottomTotalHeight()??0,r=t.horizontalScrollShowing?t.getScrollbarWidth()||0:0,n=i+r;s.setStickyBottomBottom(`${n}px`)}};function ee(e){return me(e)}var US=class extends L{constructor(e,t,s,i,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=i;let r=ee({tag:"div",role:t.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":t.column.colIdSanitised}});this.eCell=r;let n;if(t.isCellSpanning())n=ee({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),n.appendChild(r),this.setTemplateFromElement(n);else this.setTemplateFromElement(r);this.cellCssManager=new Pg(()=>r),this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);let a={toggleCss:(l,c)=>this.cellCssManager.toggleCss(l,c),setUserStyles:(l)=>$o(r,l),getFocusableElement:()=>r,setIncludeSelection:(l)=>this.includeSelection=l,setIncludeRowDrag:(l)=>this.includeRowDrag=l,setIncludeDndSource:(l)=>this.includeDndSource=l,setRowResizerElement:(l)=>this.setRowResizerElement(l),setRenderDetails:(l,c,d)=>this.setRenderDetails(l,c,d),setEditDetails:(l,c,d)=>this.setEditDetails(l,c,d),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(l,c)=>this.refreshEditStyles(l,c)};t.setComp(a,r,n,this.eCellWrapper,s,o,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRowResizerElement(e){if(this.rowResizerElement)Me(this.rowResizerElement);if(this.rowResizerElement=e,e)this.eCell.appendChild(e)}setRenderDetails(e,t,s){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;let o=this.refreshWrapper(!1);if(this.refreshEditStyles(!1),e){if(!(s||o?!1:this.refreshCellRenderer(e)))this.destroyRenderer(),this.createCellRendererInstance(e)}else this.destroyRenderer(),this.insertValueWithoutCellRenderer(t);if(this.rowDraggingComp?.refreshVisibility(),this.rowResizerElement&&!this.rowResizerElement.parentElement)this.eCell.appendChild(this.rowResizerElement)}setEditDetails(e,t,s){if(e)this.createCellEditorInstance(e,t,s);else this.destroyEditor()}removeControls(){let e=this.beans.context;this.checkboxSelectionComp=e.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=e.destroyBean(this.dndSourceComp),this.rowDraggingComp=e.destroyBean(this.rowDraggingComp)}refreshWrapper(e){let t=this.includeRowDrag||this.includeDndSource||this.includeSelection,s=t||this.forceWrapper,i=s&&this.eCellWrapper==null;if(i)this.eCellWrapper=ee({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper);let o=!s&&this.eCellWrapper!=null;if(o)Me(this.eCellWrapper),this.eCellWrapper=void 0;this.cellCssManager.toggleCss("ag-cell-value",!s);let r=!e&&s,n=r&&this.eCellValue==null;if(n){let c=this.cellCtrl.getCellValueClass();this.eCellValue=ee({tag:"span",cls:c,role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue)}let a=!r&&this.eCellValue!=null;if(a)Me(this.eCellValue),this.eCellValue=void 0;let l=i||o||n||a;if(l)this.removeControls();if(!e&&t)this.addControls();return l}addControls(){let{cellCtrl:e,eCellWrapper:t,eCellValue:s,includeRowDrag:i,includeDndSource:o,includeSelection:r}=this,n=(a)=>{if(a)t.insertBefore(a.getGui(),s)};if(i&&this.rowDraggingComp==null)this.rowDraggingComp=e.createRowDragComp(),n(this.rowDraggingComp);if(o&&this.dndSourceComp==null)this.dndSourceComp=e.createDndSource(),n(this.dndSourceComp);if(r&&this.checkboxSelectionComp==null)this.checkboxSelectionComp=e.createSelectionCheckbox(),n(this.checkboxSelectionComp)}createCellEditorInstance(e,t,s){let i=this.editorVersion,o=e.newAgStackInstance(),{params:r}=e;if(o.then((a)=>this.afterCellEditorCreated(i,a,r,t,s)),q(this.cellEditor)&&r.cellStartedEdit)this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){let t=this.getParentOfValue();te(t);let s=zo(e);if(s!=null)t.textContent=s}destroyRenderer(){let{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Me(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){let{context:e}=this.beans;if(this.cellEditorPopupWrapper?.getGui().contains(j(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),Me(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer?.refresh==null)return!1;if(this.cellRendererClass!==e.componentClass)return!1;let t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){let t=this.rendererVersion,s=(r)=>(n)=>{if(this.rendererVersion!==t||!this.isAlive())return;let l=r.newAgStackInstance(),c=this.afterCellRendererCreated.bind(this,t,r.componentClass);l?.then(c)},{animationFrameSvc:i}=this.beans,o;if(i?.active&&this.firstRender)o=(r,n=!1)=>{i.createTask(s(r),this.rowNode.rowIndex,"p2",r.componentFromFramework,n)};else o=(r)=>s(r)();if(e.params?.deferRender&&!this.cellCtrl.rowNode.group){let{loadingComp:r,onReady:n}=this.cellCtrl.getDeferLoadingCellRenderer();if(r)o(r),n.then(()=>o(e,!0))}else o(e)}afterCellRendererCreated(e,t,s){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(s);return}this.cellRenderer=s,this.cellRendererClass=t;let o=s.getGui();if(this.cellRendererGui=o,o!=null){let r=this.getParentOfValue();te(r),r.appendChild(o)}}afterCellEditorCreated(e,t,s,i,o){let r=e!==this.editorVersion,{context:n}=this.beans;if(r){n.destroyBean(t);return}if(t.isCancelBeforeStart?.()){n.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){F(97,{colId:this.column.getId()}),n.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();let l=i||t.isPopup?.();if(l)this.addPopupCellEditor(s,o);else this.addInCellEditor();this.refreshEditStyles(!0,l),t.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(t),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){let{cellCssManager:s}=this;s.toggleCss("ag-cell-inline-editing",e&&!t),s.toggleCss("ag-cell-popup-editing",e&&!!t),s.toggleCss("ag-cell-not-inline-editing",!e||!!t)}addInCellEditor(){let{eCell:e}=this;if(e.contains(j(this.beans)))e.focus();if(this.destroyRenderer(),this.refreshWrapper(!0),te(this.getParentOfValue()),this.cellEditorGui)this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){let{gos:s,context:i,popupSvc:o,editSvc:r}=this.beans;if(s.get("editType")==="fullRow")F(98);let n=this.cellEditorPopupWrapper=i.createBean(r.createPopupEditorWrapper(e)),{cellEditor:a,cellEditorGui:l,eCell:c,rowNode:d,column:u,cellCtrl:h}=this,g=n.getGui();if(l)g.appendChild(l);let p=s.get("stopEditingWhenCellsLoseFocus"),f=t!=null?t:a.getPopupPosition?.()??"over",m=s.get("enableRtl"),C={ePopup:g,additionalParams:{column:u,rowNode:d},type:"popupCellEditor",eventSource:c,position:f,alignSide:m?"right":"left",keepWithinBounds:!0},v=o.positionPopupByComponent.bind(o,C),w=o.addPopup({modal:p,eChild:g,closeOnEsc:!0,closedCallback:(S)=>{h.onPopupEditorClosed(S)},anchorToElement:c,positionCallback:v,ariaOwns:c});if(w)this.hideEditorPopup=w.hideFunc}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},KS=class extends L{constructor(e,t,s){super();this.cellComps=new Map,this.beans=t,this.rowCtrl=e;let i=ee({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(i,s),this.setTemplateFromElement(i);let o=i.style;this.domOrder=this.rowCtrl.getDomOrder();let r={setDomOrder:(n)=>this.domOrder=n,setCellCtrls:(n)=>this.setCellCtrls(n),showFullWidth:(n)=>this.showFullWidth(n),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(n,a)=>this.toggleCss(n,a),setUserStyles:(n)=>$o(i,n),setTop:(n)=>o.top=n,setTransform:(n)=>o.transform=n,setRowIndex:(n)=>i.setAttribute("row-index",n),setRowId:(n)=>i.setAttribute("row-id",n),setRowBusinessKey:(n)=>i.setAttribute("row-business-key",n),refreshFullWidth:(n)=>{let a=n();return this.fullWidthCellRendererParams=a,this.fullWidthCellRenderer?.refresh?.(a)??!1}};e.setComp(r,this.getGui(),s,void 0),this.addDestroyFunc(()=>{e.unsetComp(s)})}setInitialStyle(e,t){let s=this.rowCtrl.getInitialTransform(t);if(s)e.style.setProperty("transform",s);else{let i=this.rowCtrl.getInitialRowTop(t);if(i)e.style.setProperty("top",i)}}showFullWidth(e){let t=(i)=>{if(this.isAlive()){let o=i.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(i,e.params)}else this.beans.context.destroyBean(i)};e.newAgStackInstance().then(t)}setCellCtrls(e){let t=new Map(this.cellComps);for(let s of e){let i=s.instanceId;if(!this.cellComps.has(i))this.newCellComp(s);else t.delete(i)}this.destroyCells(t),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;let t=[];for(let s of e){let i=this.cellComps.get(s.instanceId);if(i)t.push(i.getGui())}kh(this.getGui(),t)}newCellComp(e){let t=this.beans.editSvc?.isEditing(e,{withOpenEditor:!0})??!1,s=new US(this.beans,e,this.rowCtrl.printLayout,this.getGui(),t);this.cellComps.set(e.instanceId,s),this.getGui().appendChild(s.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(let t of e.values()){if(!t)continue;let s=t.cellCtrl.instanceId;if(this.cellComps.get(s)!==t)continue;t.detach(),t.destroy(),this.cellComps.delete(s)}}};function $S(e,t,s){let i=!!s.gos.get("enableCellSpan")&&!!t.getSpannedRowCtrls,o={tag:"div",ref:"eContainer",cls:Jg(e),role:"rowgroup"};if(t.type==="center"||i){let r={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${DS(e)}`,role:"presentation"};return o.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${Qg(e)}`,role:"rowgroup",children:[o,i?r:null]}}return o}var jS=class extends L{constructor(e){super();this.eViewport=E,this.eContainer=E,this.eSpannedContainer=E,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=e?.name,this.options=sr(this.name)}postConstruct(){this.setTemplate($S(this.name,this.options,this.beans));let e={setHorizontalScroll:(s)=>this.eViewport.scrollLeft=s,setViewportHeight:(s)=>this.eViewport.style.height=s,setRowCtrls:({rowCtrls:s})=>this.setRowCtrls(s),setSpannedRowCtrls:(s)=>this.setRowCtrls(s,!0),setDomOrder:(s)=>{this.domOrder=s},setContainerWidth:(s)=>{if(this.eContainer.style.width=s,this.eSpannedContainer)this.eSpannedContainer.style.width=s},setOffsetTop:(s)=>{let i=`translateY(${s})`;if(this.eContainer.style.transform=i,this.eSpannedContainer)this.eSpannedContainer.style.transform=i}};this.createManagedBean(new _S(this.name)).setComp(e,this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(e,t){let{beans:s,options:i}=this,o=t?this.eSpannedContainer:this.eContainer,r=t?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},n={};if(t)this.rowCompsWithSpan=n;else this.rowCompsNoSpan=n;this.lastPlacedElement=null;let a=[];for(let l of e){let c=l.instanceId,d=r[c],u;if(d)u=d,delete r[c];else{if(!l.rowNode.displayed)continue;u=new KS(l,s,i.type)}n[c]=u,a.push([u,!d])}this.removeOldRows(Object.values(r)),this.addRowNodes(a,o)}addRowNodes(e,t){let{domOrder:s}=this;for(let[i,o]of e){let r=i.getGui();if(!s){if(o)t.appendChild(r)}else this.ensureDomOrder(r,t)}}removeOldRows(e){for(let t of e)t.getGui().remove(),t.destroy()}ensureDomOrder(e,t){Ih(t,e,this.lastPlacedElement),this.lastPlacedElement=e}},qS={selector:"AG-ROW-CONTAINER",component:jS};function Co(e,t){return t.map((s)=>{let i=`e${s[0].toUpperCase()+s.substring(1)}RowContainer`;return e[i]={name:s},{tag:"ag-row-container",ref:i,attrs:{name:s}}})}function YS(e){let t={},s={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:Co(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:Co(t,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:Co(t,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:Co(t,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:Co(t,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},e?{tag:"ag-overlay-wrapper"}:null]};return{paramsMap:t,elementParams:s}}var XS=class extends L{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(){let{overlays:e,rangeSvc:t}=this.beans,s=e?.getOverlayWrapperSelector(),{paramsMap:i,elementParams:o}=YS(!!s);this.setTemplate(o,[...s?[s]:[],CS,bS,pS,qS],i);let r=(a,l)=>{let c=`${a}px`;l.style.minHeight=c,l.style.height=c},n={setRowAnimationCssOnBodyViewport:(a,l)=>this.setRowAnimationCssOnBodyViewport(a,l),setColumnCount:(a)=>Fv(this.getGui(),a),setRowCount:(a)=>Rv(this.getGui(),a),setTopHeight:(a)=>r(a,this.eTop),setBottomHeight:(a)=>r(a,this.eBottom),setTopInvisible:(a)=>this.eTop.classList.toggle("ag-invisible",a),setBottomInvisible:(a)=>this.eBottom.classList.toggle("ag-invisible",a),setStickyTopHeight:(a)=>this.eStickyTop.style.height=a,setStickyTopTop:(a)=>this.eStickyTop.style.top=a,setStickyTopWidth:(a)=>this.eStickyTop.style.width=a,setStickyBottomHeight:(a)=>{this.eStickyBottom.style.height=a,this.eStickyBottom.classList.toggle("ag-invisible",a==="0px")},setStickyBottomBottom:(a)=>this.eStickyBottom.style.bottom=a,setStickyBottomWidth:(a)=>this.eStickyBottom.style.width=a,setColumnMovingCss:(a,l)=>this.toggleCss(a,l),updateLayoutClasses:(a,l)=>{let c=[this.eBodyViewport.classList,this.eBody.classList];for(let d of c)d.toggle(Et.AUTO_HEIGHT,l.autoHeight),d.toggle(Et.NORMAL,l.normal),d.toggle(Et.PRINT,l.print);this.toggleCss(Et.AUTO_HEIGHT,l.autoHeight),this.toggleCss(Et.NORMAL,l.normal),this.toggleCss(Et.PRINT,l.print)},setAlwaysVerticalScrollClass:(a,l)=>this.eBodyViewport.classList.toggle(sp,l),registerBodyViewportResizeListener:(a)=>{let l=It(this.beans,this.eBodyViewport,a);this.addDestroyFunc(()=>l())},setPinnedTopBottomOverflowY:(a)=>this.eTop.style.overflowY=this.eBottom.style.overflowY=a,setCellSelectableCss:(a,l)=>{for(let c of[this.eTop,this.eBodyViewport,this.eBottom])c.classList.toggle(a,l)},setBodyViewportWidth:(a)=>this.eBodyViewport.style.width=a,setGridRootRole:(a)=>ge(this.eGridRoot,a)};if(this.ctrl=this.createManagedBean(new WS),this.ctrl.setComp(n,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),t&&qe(this.gos)||Lo(this.gos))xv(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){let s=this.eBodyViewport.classList;s.toggle("ag-row-animation",t),s.toggle("ag-row-no-animation",!t)}getFocusableContainerName(){return"gridBody"}},ZS={selector:"AG-GRID-BODY",component:XS},Ro={TAB_GUARD:"ag-tab-guard",TAB_GUARD_TOP:"ag-tab-guard-top",TAB_GUARD_BOTTOM:"ag-tab-guard-bottom"},QS=class extends xe{constructor(e,t){super();this.stopPropagationCallbacks=t,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;let{comp:s,eTopGuard:i,eBottomGuard:o,focusTrapActive:r,forceFocusOutWhenTabGuardsAreEmpty:n,isFocusableContainer:a,focusInnerElement:l,onFocusIn:c,onFocusOut:d,shouldStopEventPropagation:u,onTabKeyDown:h,handleKeyDown:g,isEmpty:p,eFocusableElement:f}=e;this.comp=s,this.eTopGuard=i,this.eBottomGuard=o,this.providedFocusInnerElement=l,this.eFocusableElement=f,this.focusTrapActive=!!r,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.isFocusableContainer=!!a,this.providedFocusIn=c,this.providedFocusOut=d,this.providedShouldStopEventPropagation=u,this.providedOnTabKeyDown=h,this.providedHandleKeyDown=g,this.providedIsEmpty=p}postConstruct(){this.createManagedBean(new Ag(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(let e of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})}handleKeyDown(e){if(this.providedHandleKeyDown)this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){if(this.providedShouldStopEventPropagation)return this.providedShouldStopEventPropagation();return!1}activateTabGuards(){if(this.forcingFocusOut)return;let e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)){if(!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty){if(this.providedIsEmpty?this.providedIsEmpty():dt(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;let t=e.target===this.eBottomGuard;if(!(this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t))&&this.forceFocusOutWhenTabGuardsAreEmpty)this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}findNextElementOutsideAndFocus(e){let t=ce(this.beans),s=dt(t.body,null,!0),i=s.indexOf(e?this.eTopGuard:this.eBottomGuard);if(i===-1)return;let o,r;if(e)o=0,r=i;else o=i+1,r=s.length;let n=s.slice(o,r),a=this.gos.get("tabIndex");n.sort((l,c)=>{let d=Number.parseInt(l.getAttribute("tabindex")||"0"),u=Number.parseInt(c.getAttribute("tabindex")||"0");if(u===a)return 1;if(d===a)return-1;if(d===0)return 1;if(u===0)return-1;return d-u}),n[e?n.length-1:0]?.focus()}onFocusIn(e){if(this.focusTrapActive||this.forcingFocusOut)return;if(this.providedFocusIn)this.providedFocusIn(e);if(!this.isFocusableContainer)this.deactivateTabGuards()}onFocusOut(e){if(this.focusTrapActive)return;if(this.providedFocusOut)this.providedFocusOut(e);if(!this.eFocusableElement.contains(e.relatedTarget))this.activateTabGuards()}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive)return;if(e.defaultPrevented)return;let t=this.tabGuardsAreActive();if(t)this.deactivateTabGuards();let s=this.getNextFocusableElement(e.shiftKey);if(t)setTimeout(()=>this.activateTabGuards(),0);if(!s)return;s.focus(),e.preventDefault()}focusInnerElement(e=!1){let t=dt(this.eFocusableElement);if(this.tabGuardsAreActive())t.splice(0,1),t.splice(-1,1);if(!t.length)return!1;return t[e?t.length-1:0].focus({preventScroll:!0}),!0}getNextFocusableElement(e){return Ie(this.beans,this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;let 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}},Fc=class extends xe{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();let{eTopGuard:t,eBottomGuard:s,eFocusableElement:i,stopPropagationCallbacks:o}=this,r=[t,s],n={setTabIndex:(C)=>{for(let v of r)if(C==null)v.removeAttribute("tabindex");else v.setAttribute("tabindex",C)}};this.addTabGuards(t,s);let{focusTrapActive:a=!1,onFocusIn:l,onFocusOut:c,focusInnerElement:d,handleKeyDown:u,onTabKeyDown:h,shouldStopEventPropagation:g,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m}=e;this.tabGuardCtrl=this.createManagedBean(new QS({comp:n,focusTrapActive:a,eTopGuard:t,eBottomGuard:s,eFocusableElement:i,onFocusIn:l,onFocusOut:c,focusInnerElement:d,handleKeyDown:u,onTabKeyDown:h,shouldStopEventPropagation:g,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:f,isFocusableContainer:m},o))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){let t=ce(this.beans).createElement("div"),s=e==="top"?Ro.TAB_GUARD_TOP:Ro.TAB_GUARD_BOTTOM;return t.classList.add(Ro.TAB_GUARD,s),ge(t,"presentation"),t}addTabGuards(e,t){let s=this.eFocusableElement;s.prepend(e),s.append(t)}removeAllChildrenExceptTabGuards(){let e=[this.eTopGuard,this.eBottomGuard];te(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,s){if(!jo(t))t=t.getGui();let{eBottomGuard:i}=this;if(i)i.before(t);else e(t,s)}destroy(){let{eTopGuard:e,eBottomGuard:t}=this;Me(e),Me(t),super.destroy()}},ds=class extends Le{initialiseTabGuard(e,t){this.tabGuardFeature=this.createManagedBean(new Fc(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)}},Ec=class extends ds{initialiseTabGuard(e){super.initialiseTabGuard(e,Bs)}},fu=(e,t)=>Bg(e,()=>pe(e.getGui(),t,!1,!0)),mu=(e)=>e?.getFocusableContainerName()??"external",JS=(e)=>{if(e==null)return"external";return typeof e==="string"?e:"gridBody"},ey=class extends y{constructor(){super(...arguments);this.additionalFocusableContainers=new Set}setComp(e,t,s){this.view=e,this.eGridHostDiv=t,this.eGui=s,this.eGui.setAttribute("grid-id",this.beans.context.getId());let{dragAndDrop:i,ctrlsSvc:o}=this.beans;if(i?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new xc(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),this.gos.get("suppressContentVisibilityAuto"))this.eGui.style.setProperty("content-visibility","visible");let r=It(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>r()),o.register("gridCtrl",this)}isDetailGrid(){return kn(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){let 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"),toolbarSelector:e.registry?.getSelector("AG-TOOLBAR"),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){let{view:t}=this;if(e===!1)t.setCursor(null);else t.setCursor(e===1?"ew-resize":"ns-resize")}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){let t=this.getFocusableContainers(),{indexWithFocus:s,nextIndex:i}=this.getNextFocusableIndex(t,e),o=s===-1?e?t.length-1:0:i,{gos:r,beans:{focusSvc:n,navigation:a}}=this,l=r.getCallback("tabToNextGridContainer");if(l){let c=n.getDefaultTabToNextGridContainerTarget({backwards:e,focusableContainers:t,nextIndex:o}),d=mu(t[o]),u=c==null&&d==="gridBody"?"gridBody":JS(c),h=l({backwards:e,previousContainer:mu(t[s]),nextContainer:u,defaultTarget:c});if(h!==void 0){if(typeof h==="boolean")return h;if(typeof h==="string"){if(h==="gridBody")return this.focusGridBodyDefault(e)||void 0;let g=t.find((p)=>p.getFocusableContainerName()===h);if(!g){Nh(`tabToNextGridContainer - ${h} container not found`);return}return fu(g,e)?!0:void 0}if(jb(h))return n.focusHeaderPosition({headerPosition:h})||void 0;return a?.ensureCellVisible(h),n.setFocusedCell({...h,forceBrowserFocus:!0}),n.isCellFocused(h)||void 0}}return this.focusNextInnerContainerDefault({backwards:e,focusableContainers:t,indexWithFocus:s,nextIndex:o})||void 0}focusInnerElement(e){let{gos:t,beans:s,beans:{focusSvc:i,visibleCols:o}}=this;if(t.getCallback("focusGridInnerElement")?.({fromBottom:!!e}))return!0;let n=this.getFocusableContainers();if(e){if(this.focusNextInnerContainerDefault({backwards:!0,focusableContainers:n,indexWithFocus:n.length,nextIndex:n.length-1}))return!0;return i.focusGridView({column:k(o.allCols),backwards:!0})}let a=o.allCols;if(t.get("headerHeight")===0||Ft(s)){if(i.focusGridView({column:a[0],backwards:e}))return!0;for(let l=1;l<n.length;l++)if(pe(n[l].getGui(),e))return!0;return!1}return i.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}isFocusInsideGridBody(){let 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){let t=this.view.getFocusableContainers(),{indexWithFocus:s,nextIndex:i}=this.getNextFocusableIndex(t,e);if(!this.focusNextInnerContainerDefault({backwards:!!e,focusableContainers:t,indexWithFocus:s,nextIndex:i}))this.forceFocusOutOfContainer(e)}isFocusable(){let e=this.beans;return!an(e)||!Ft(e)||!!e.sideBar?.comp?.isDisplayed()}getNextFocusableIndex(e,t){let s=j(this.beans),i=e.findIndex((o)=>o.getGui().contains(s));return{indexWithFocus:i,nextIndex:i+(t?-1:1)}}focusGridBodyDefault(e){let{gos:t,beans:s,beans:{focusSvc:i,visibleCols:{allCols:o}}}=this;if(e)return i.focusGridView({column:k(o),backwards:!0});if(t.get("headerHeight")===0||Ft(s))return i.focusGridView({column:o[0]});return i.focusFirstHeader()}focusNextInnerContainerDefault(e){let{backwards:t,focusableContainers:s,indexWithFocus:i}=e,o=t?-1:1;for(let r=e.nextIndex;r>=0&&r<s.length;r+=o){let n=s[r];if(n.getFocusableContainerName()==="gridBody"){if(i===-1||(t?i>r:i<r)){if(this.focusGridBodyDefault(t))return!0;continue}}if(fu(n,t))return!0}return!1}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},ty=class extends Ec{constructor(e){super();this.gridBody=E,this.toolbar=E,this.gridHeaderDropZones=E,this.sideBar=E,this.statusBar=E,this.pagination=E,this.rootWrapperBody=E,this.eGridDiv=e}postConstruct(){let 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!=null?r:"",this.getGui().style.webkitUserSelect=r!=null?r:""},setCursor:(r)=>{this.getGui().style.cursor=r!=null?r:""}},t=this.createManagedBean(new ey),s=t.getOptionalSelectors(),i=this.createTemplate(s),o=[ZS,...Object.values(s).filter((r)=>!!r)];this.setTemplate(i,o),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{return},focusInnerElement:(r)=>t.focusInnerElement(r),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!t.isFocusable()})}insertGridIntoDom(){let e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{e.remove(),Ao(this.gos,"Grid removed from DOM")})}updateLayoutClasses(e,t){let s=this.rootWrapperBody.classList,{AUTO_HEIGHT:i,NORMAL:o,PRINT:r}=Et,{autoHeight:n,normal:a,print:l}=t;s.toggle(i,n),s.toggle(o,a),s.toggle(r,l),this.toggleCss(i,n),this.toggleCss(o,a),this.toggleCss(r,l)}createTemplate(e){let t=e.toolbarSelector?{tag:"ag-toolbar",ref:"toolbar"}:null,s=e.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones",ref:"gridHeaderDropZones"}:null,i=e.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,o=e.statusBarSelector?{tag:"ag-status-bar",ref:"statusBar"}:null,r=e.watermarkSelector?{tag:"ag-watermark"}:null,n=e.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[t,s,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},i]},o,n,r]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){if(!e&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){let e=[];if(this.toolbar)e.push(this.toolbar);e.push(...this.gridHeaderDropZones?.getFocusableContainers?.()??[],this.gridBody);for(let t of[this.sideBar,this.statusBar,this.pagination])if(t)e.push(t);return e.filter((t)=>ve(t.getGui()))}},H=(e,t)=>{for(let s of Object.keys(t))t[s]=e;return t},Cu={dispatchEvent:"CommunityCore",...H("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...H("GridState",{getState:0,setState:0}),...H("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...H("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...H("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...H("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...H("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...H("ValueCache",{expireValueCache:0}),...H("CellApi",{getCellValue:0}),...H("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...H("Sort",{onSortChanged:0}),...H("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...H("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...H("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...H("HighlightChanges",{flashCells:0}),...H("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...H("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}),...H("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...H("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...H("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...H("ColumnResize",{setColumnWidths:0}),...H("ColumnHover",{isColumnHovered:0}),...H("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...H("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...H("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...H("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...H("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...H("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...H("Notes",{getNote:0,setNote:0,refreshNotes:0}),...H("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...H("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...H("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0,resetRowGroupExpansion:0}),...H("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...H("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}),...H("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...H("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...H("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...H("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...H("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...H("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...H("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...H("Formula",{refreshFormulas:0}),...H("ContextMenu",{showContextMenu:0}),...H("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...H("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...H("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...H("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...H("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}),...H("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...H("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...H("Toolbar",{getToolbarItemInstance:0}),...H("StatusBar",{getStatusPanel:0}),...H("AiToolkit",{getStructuredSchema:0})};var Ha={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},sy=(e,t)=>e.eventSvc.dispatchEvent(t),ip=class{};Reflect.defineProperty(ip,"name",{value:"GridApi"});var iy=class extends y{constructor(){super();this.beanName="apiFunctionSvc",this.api=new ip,this.fns={...Ha,dispatchEvent:sy},this.preDestroyLink="";let{api:e}=this;for(let t of Object.keys(Cu))e[t]=this.makeApi(t)[t]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){let{fns:s,beans:i}=this;if(s!==Ha)s[e]=i?.validation?.validateApiFunction(e,t)??t}makeApi(e){return{[e]:(...t)=>{let{beans:s,fns:{[e]:i}}=this;return i?i(s,...t):this.apiNotFound(e)}}}apiNotFound(e){let{beans:t,gos:s,preDestroyLink:i}=this;if(!t)F(26,{fnName:e,preDestroyLink:i});else{let o=Cu[e];if(s.assertModuleRegistered(o,`api.${e}`))F(27,{fnName:e,module:o})}}destroy(){super.destroy(),this.fns=Ha,this.beans=null}};function oy(e){return e.context.getId()}function ry(e){e.gridDestroySvc.destroy()}function ny(e){return e.gridDestroySvc.destroyCalled}function ay(e,t){return e.gos.get(t)}function ly(e,t,s){op(e,{[t]:s})}function op(e,t){e.gos.updateGridOptions({options:t})}function cy(e,t){let s=t.replace(/Module$/,"");return e.gos.isModuleRegistered(s)}function _s(e,t,s){let i=N(e,t,s);if(i){let{className:r}=i;if(typeof r==="string"&&r.includes("ag-icon")||typeof r==="object"&&r["ag-icon"])return i}let o=ee({tag:"span"});return o.appendChild(i),o}function N(e,t,s){let i=null;if(e==="smallDown")F(262);else if(e==="smallLeft")F(263);else if(e==="smallRight")F(264);let o=s?.colDef.icons;if(o)i=o[e];if(t.gos&&!i){let r=t.gos.get("icons");if(r)i=r[e]}if(i){let r;if(typeof i==="function")r=i();else if(typeof i==="string")r=i;else{F(38,{iconName:e});return}if(typeof r==="string")return zl(r);if(jo(r))return r;F(133,{iconName:e});return}else{let r=t.registry.getIcon(e);if(!r)t.validation?.validateIcon(e);return ee({tag:"span",cls:`ag-icon ag-icon-${r??e}`,role:"presentation",attrs:{unselectable:"on"}})}}var dy=".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)}",uy={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"}]}]},hy=class extends L{constructor(){super();this.dragSource=null,this.eIcon=E,this.eLabel=E,this.eGhost=E,this.registerCSS(dy)}postConstruct(){let e=(t)=>_s(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(uy),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){let{eGhost:s,eIcon:i,dragSource:o,dropIconMap:r,gos:n}=this;if(te(i),!e)e=o?.getDefaultIconName?o.getDefaultIconName():"notAllowed";let a=r[e];if(s.classList.toggle("ag-dnd-ghost-not-allowed",e==="notAllowed"),i.classList.toggle("ag-shake-left-to-right",t),a===r.hide&&n.get("suppressDragLeaveHidesColumns"))return;if(a)i.appendChild(a)}setLabel(e){this.eLabel.textContent=e}};var rp=(e,t)=>{if(t!=null&&e?.setPointerCapture)try{return e.setPointerCapture(t),e.hasPointerCapture(t)}catch{}return!1},gy=(e,t)=>{if(typeof PointerEvent>"u"||!(t instanceof PointerEvent))return null;let s=t.pointerId;if(!rp(e,s))return null;let i={eElement:e,pointerId:s,onLost(o){fy(i,o)}};return e.addEventListener("lostpointercapture",i.onLost),i},py=(e)=>{if(!e)return;np(e);let{eElement:t,pointerId:s}=e;if(!t)return;try{t.releasePointerCapture(s)}catch{}e.eElement=null},np=(e)=>{let{eElement:t,onLost:s}=e;if(t&&s)t.removeEventListener("lostpointercapture",s),e.onLost=null},fy=(e,t)=>{np(e);let{eElement:s,pointerId:i}=e;if(s&&t.pointerId===i)rp(s,i)},Ei,Di,za={passive:!0},ws={passive:!1},Bt=(e)=>{if(!Di)Di=new WeakSet;else if(Di.has(e))return!1;return Di.add(e),!0},my=class extends xe{constructor(){super(...arguments);this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!Ei?.has(Ue(this.beans))}hasPointerCapture(){let e=this.drag?.pointerCapture;return!!(e&&this.beans.eRootDiv.hasPointerCapture?.(e.pointerId))}destroy(){if(this.drag)this.cancelDrag();let e=this.dragSources;for(let t of e)vu(t);e.length=0,super.destroy()}removeDragSource(e){let t=this.dragSources;for(let s=0,i=t.length;s<i;++s){let o=t[s];if(o.params===e){t.splice(s,1),vu(o);break}}}addDragSource(e){if(!this.isAlive())return;let{eElement:t,includeTouch:s}=e,i=[],o;if(s){let c=t.style;if(c)o=c.touchAction,c.touchAction="none"}let r={handlers:i,params:e,oldTouchAction:o};this.dragSources.push(r),Vr(i,[t,"pointerdown",(c)=>this.onPointerDown(e,c),ws],[t,"mousedown",(c)=>this.onMouseDown(e,c)]);let l=this.gos.get("suppressTouch");if(s&&!l)Vr(i,[t,"touchstart",(d)=>this.onTouchStart(e,d),ws])}cancelDrag(e){let t=this.drag;if(e??(e=t?.eElement),e)this.eventSvc.dispatchEvent({type:"dragCancelled",target:e});t?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(e){let t=e.type;return(t==="mousemove"||t==="pointermove")&&e.cancelable&&Do(this.beans,e)&&!yo(Ua(e))}initDrag(e,...t){this.drag=e;let s=this.beans,i=(a)=>this.onScroll(a),o=(a)=>this.onKeyDown(a),r=Ue(s),n=ce(s);Vr(e.handlers,[r,"contextmenu",Ti],[r,"keydown",o],[n,"scroll",i,{capture:!0}],[n.defaultView||window,"scroll",i],...t)}destroyDrag(){this.dragging=!1;let e=this.drag;if(e){let t=e.rootEl;if(Ei?.get(t)===e)Ei.delete(t);this.drag=null,py(e.pointerCapture),Ul(e.handlers)}}onPointerDown(e,t){if(this.isPointer())return;let s=this.beans;if(Di?.has(t))return;let i=t.pointerType;if(i==="touch"){if(s.gos.get("suppressTouch")||!e.includeTouch)return;if(e.stopPropagationForTouch)t.stopPropagation();if(yo(Ua(t)))return}if(!t.isPrimary)return;if(i==="mouse"&&t.button!==0)return;this.destroyDrag();let o=Ue(s),r=e.eElement,n=t.pointerId,a=new Wa(o,e,t,n);Ei??(Ei=new WeakMap),Ei.set(o,a);let l=(h)=>{if(h.pointerId===n)this.onMouseOrPointerMove(h)},c=(h)=>{if(h.pointerId===n)this.onMouseOrPointerUp(h)},d=(h)=>{if(h.pointerId===n&&Bt(h))this.cancelDrag()},u=(h)=>this.draggingPreventDefault(h);if(this.initDrag(a,[o,"pointerup",c],[o,"pointercancel",d],[o,"pointermove",l,ws],[o,"touchmove",u,ws],[r,"mousemove",u,ws]),e.dragStartPixels===0)this.onMouseOrPointerMove(t);else Bt(t)}onTouchStart(e,t){if(this.gos.get("suppressTouch")||!e.includeTouch)return;if(!Bt(t))return;if(yo(Ua(t)))return;if(e.stopPropagationForTouch)t.stopPropagation();if(this.isPointer()){if(this.dragging)Ti(t);return}this.destroyDrag();let i=this.beans,o=Ue(i),r=new Wa(o,e,t.touches[0]),n=(h)=>this.onTouchMove(h),a=(h)=>this.onTouchUp(h),l=(h)=>this.onTouchCancel(h),c=(h)=>this.draggingPreventDefault(h),d=Ue(i),u=t.target??e.eElement;if(this.initDrag(r,[u,"touchmove",n,za],[u,"touchend",a,za],[u,"touchcancel",l,za],[d,"touchmove",c,ws],[d,"touchend",a,ws],[d,"touchcancel",l,ws]),e.dragStartPixels===0)this.onMove(r.start)}draggingPreventDefault(e){if(this.dragging)Ti(e)}onMouseDown(e,t){if(t.button!==0)return;if(Di?.has(t))return;if(this.isPointer())return;let s=this.beans;this.destroyDrag();let i=new Wa(Ue(s),e,t),o=(a)=>this.onMouseOrPointerMove(a),r=(a)=>this.onMouseOrPointerUp(a),n=Ue(s);if(this.initDrag(i,[n,"mousemove",o],[n,"mouseup",r]),e.dragStartPixels===0)this.onMouseOrPointerMove(t);else Bt(t)}onScroll(e){if(!Bt(e))return;let t=this.drag,s=t?.lastDrag;if(s&&this.dragging)t.params?.onDragging?.(s)}onMouseOrPointerMove(e){if(!Bt(e))return;if(Os())ce(this.beans).getSelection()?.removeAllRanges();if(this.shouldPreventMouseEvent(e))Ti(e);this.onMove(e)}onTouchCancel(e){let t=this.drag;if(!t||!Bt(e))return;if(!Li(t.start,e.changedTouches))return;this.cancelDrag()}onTouchMove(e){let t=this.drag;if(!t||!Bt(e))return;let s=Li(t.start,e.touches);if(s)this.onMove(s),this.draggingPreventDefault(e)}onMove(e){let t=this.drag;if(!t)return;t.lastDrag=e;let s=t.params;if(!this.dragging){let i=t.start,r=s.dragStartPixels??4;if(Oh(e,i,r))return;if(this.dragging=!0,s.capturePointer)t.pointerCapture=gy(this.beans.eRootDiv,e);if(this.eventSvc.dispatchEvent({type:"dragStarted",target:s.eElement}),s.onDragStart?.(i),this.drag!==t)return;if(s.onDragging?.(i),this.drag!==t)return}s.onDragging?.(e)}onTouchUp(e){let t=this.drag;if(t&&Bt(e))this.onUp(Li(t.start,e.changedTouches))}onMouseOrPointerUp(e){if(Bt(e))this.onUp(e)}onUp(e){let t=this.drag;if(!t)return;if(!e)e=t.lastDrag;if(e&&this.dragging)this.dragging=!1,t.params.onDragStop?.(e),this.eventSvc.dispatchEvent({type:"dragStopped",target:t.params.eElement});this.destroyDrag()}onKeyDown(e){if(e.key===b.ESCAPE)this.cancelDrag()}},vu=(e)=>{Ul(e.handlers);let t=e.oldTouchAction;if(t!=null){let s=e.params.eElement.style;if(s)s.touchAction=t}},Wa=class{constructor(e,t,s,i=null){this.rootEl=e,this.params=t,this.start=s,this.pointerId=i,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=t.eElement}},Ua=(e)=>{let t=e.target;return t instanceof Element?t:null},Cy=class extends my{shouldPreventMouseEvent(e){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(e)}},vy=class extends y{constructor(){super(...arguments);this.beanName="horizontalResizeSvc"}addResizeBar(e){let 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:s}=this.beans;return s.addDragSource(t),()=>s.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();let s=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(s)}setResizeIcons(){let e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(1),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){let 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)}};var Bn=class{constructor(e){if(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;if(this.scrollVertically)this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition;if(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){let s=!this.scrollVertically||t||this.shouldSkipVerticalScroll(),i=!this.scrollHorizontally||this.shouldSkipHorizontalScroll();if(s&&i)return;let o=this.scrollContainer.getBoundingClientRect(),r=this.scrollByTick;if(this.tickLeft=!i&&e.clientX<o.left+r,this.tickRight=!i&&e.clientX>o.right-r,this.tickUp=!s&&e.clientY<o.top+r,this.tickDown=!s&&e.clientY>o.bottom-r,this.tickLeft||this.tickRight||this.tickUp||this.tickDown)this.ensureTickingStarted();else this.ensureCleared()}ensureTickingStarted(){if(this.tickingInterval===null)this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0}doTick(){this.tickCount++;let e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){let t=this.getVerticalPosition();if(this.tickUp)this.setVerticalPosition(t-e);if(this.tickDown)this.setVerticalPosition(t+e)}if(this.scrollHorizontally){let t=this.getHorizontalPosition();if(this.tickLeft)this.setHorizontalPosition(t-e);if(this.tickRight)this.setHorizontalPosition(t+e)}if(this.onScrollCallback)this.onScrollCallback()}ensureCleared(){if(this.tickingInterval)window.clearInterval(this.tickingInterval),this.tickingInterval=null}},Ni=class{constructor(){this.reordered=!1,this.removals=[],this.updates=new Set,this.adds=new Set}},fi=(e)=>{let t=e.childrenAfterGroup;while(t?.length){let s=t[0];if(s.sourceRowIndex>=0)return s;t=s.childrenAfterGroup}},ap=(e,t,s,i)=>{if(!t.size||!e)return!1;let o=!1,r=e.length??0,n=-1;if(s){if(n=s.sourceRowIndex,s=n<0?fi(s):null,s)n=s.sourceRowIndex}if(n<0||n>=r)n=r;else if(!i)++n;let a=n,l=Math.min(n,r-1);for(let u of t){let h=u.sourceRowIndex;if(h<a)a=h;if(h>l)l=h}let c=a;for(let u=a;u<n;++u){let h=e[u];if(t.has(h))continue;if(h.sourceRowIndex!==c)h.sourceRowIndex=c,e[c]=h,o=!0;++c}let d=l;for(let u=l;u>=n;--u){let h=e[u];if(t.has(h))continue;if(h.sourceRowIndex!==d)h.sourceRowIndex=d,e[d]=h,o=!0;--d}for(let u of t){if(u.sourceRowIndex!==c)u.sourceRowIndex=c,e[c]=u,o=!0;++c}return o};function Pc(e,t){return tr(e,t.target)?.getFocusedCellPosition()??null}function Mc(e,t){let s=Te(e.gos,"normal"),i=t,o,r;if(i.clientX!=null||i.clientY!=null)o=i.clientX,r=i.clientY;else o=i.x,r=i.y;let{pageFirstPixel:n}=e.pageBounds.getCurrentPagePixelRange();if(r+=n,s){let a=e.ctrlsSvc.getScrollFeature(),l=a.getVScrollPosition(),c=a.getHScrollPosition();o+=c.left,r+=l.top}return{x:o,y:r}}var Vn={moduleName:"Drag",version:z,beans:[Cy]};var ir={moduleName:"SharedDragAndDrop",version:z,beans:[Cb],dependsOn:[Vn],userComponents:{agDragAndDropImage:hy},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}};var Tc={moduleName:"HorizontalResize",version:z,beans:[vy],dependsOn:[Vn]},wy=":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}}",by=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;let{gos:e}=this;if(e.get("suppressColumnMoveAnimation"))return;if(e.get("enableRtl"))return;this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0}finish(){if(!this.active)return;this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(e){if(this.activeNext)this.executeNextFuncs.push(e);else e()}executeLaterVMTurn(e){if(this.active)this.executeLaterFuncs.push(e);else e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;let e=this.animationThreadCount,{gridBodyCtrl:t}=this;t.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{if(this.animationThreadCount===e)t.setColumnMovingCss(!1)})}flush(e,t){let{executeNextFuncs:s,executeLaterFuncs:i}=this;if(s.length===0&&i.length===0){e(),t();return}let o=(r)=>{while(r.length){let n=r.pop();if(n)n()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e(),o(s)},0),window.setTimeout(()=>{t(),o(i)},200)})}};function Sy(e,t,s){e.colMoves?.moveColumnByIndex(t,s,"api")}function yy(e,t,s){e.colMoves?.moveColumns(t,s,"api")}var xy=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;let t=e.dragItem.columns;if(!t)return;for(let s of t){if(!s.primary)continue;if(s.isAnyFunctionActive())continue;if(s.isAllowValue())this.columnsToAggregate.push(s);else if(s.isAllowRowGroup())this.columnsToGroup.push(s);else if(s.isAllowPivot())this.columnsToPivot.push(s)}}getIconName(){if(this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0)return this.pinned?"pinned":"move";return null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){let{valueColsSvc:t,rowGroupColsSvc:s,pivotColsSvc:i}=this.beans;if(this.columnsToAggregate.length>0)t?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop");if(this.columnsToGroup.length>0)s?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop");if(this.columnsToPivot.length>0)i?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function Ry(e,t){if(!t||t.length<=1)return;if(t.filter((i)=>e.indexOf(i)<0).length>0)return;t.sort((i,o)=>{let r=e.indexOf(i),n=e.indexOf(o);return r-n})}function Fy(e){let t=[...e];for(let s of e){let i=null,o=s.parent;while(o?.getDisplayedLeafColumns().length===1)i=o,o=o.parent;if(i!=null){let n=i.getColGroupDef()?.marryChildren?i.getProvidedColumnGroup().getLeafColumns():i.getLeafColumns();for(let a of n)if(!t.includes(a))t.push(a)}}return t}function Ey(e,t,s,i){let o=i.allCols,r=null,n=null;for(let a=0;a<e.length;a++){let l=e[a],c=s.getProposedColumnOrder(t,l);if(!s.doesOrderPassRules(c))continue;let d=c.filter((h)=>o.includes(h));if(n===null)n=d;else if(!se(d,n))break;let u=My(c);if(r===null||u<r.fragCount)r={move:l,fragCount:u}}return r}function lp(e){let{isFromHeader:t,fromLeft:s,xPosition:i,fromEnter:o,fakeEvent:r,pinned:n,gos:a,colModel:l,colMoves:c,visibleCols:d}=e,{allMovingColumns:u}=e;if(t)u=Fy(u);let h=u.slice();Ry(l.getCols(),h);let g=Dy({movingCols:h,draggingRight:s,xPosition:i,pinned:n,gos:a,colModel:l,visibleCols:d}),p=Py(h,l);if(g.length===0)return;let f=g[0];if(p!==null&&(t||!o)&&!r){if(!s&&f>=p)return;if(s&&f<=p)return}let C=Ey(g,h,c,d);if(!C)return;let v=C.move;if(v>l.getCols().length-h.length)return;return{columns:h,toIndex:v}}function cp(e){let{columns:t,toIndex:s}=lp(e)||{},{finished:i,colMoves:o}=e;if(!t||s==null)return null;return o.moveColumns(t,s,"uiColumnMoved",i),i?null:{columns:t,toIndex:s}}function Py(e,t){let s=t.getCols(),i=e.map((l)=>s.indexOf(l)).sort((l,c)=>l-c),o=i[0];return k(i)-o!==i.length-1?null:o}function My(e){function t(i){let o=[],r=i.getOriginalParent();while(r!=null)o.push(r),r=r.getOriginalParent();return o}let s=0;for(let i=0;i<e.length-1;i++){let o=t(e[i]),r=t(e[i+1]);[o,r]=o.length>r.length?[o,r]:[r,o];for(let n of o)if(r.indexOf(n)===-1)s++}return s}function Ty(e,t){switch(t){case"left":return e.leftCols;case"right":return e.rightCols;default:return e.centerCols}}function Dy(e){let{movingCols:t,draggingRight:s,xPosition:i,pinned:o,gos:r,colModel:n,visibleCols:a}=e;if(r.get("suppressMovableColumns")||t.some((w)=>w.colDef.suppressMovable))return[];let c=Ty(a,o),d=n.getCols(),u=c.filter((w)=>t.includes(w)),h=c.filter((w)=>!t.includes(w)),g=d.filter((w)=>!t.includes(w)),p=0,f=i;if(s){let w=0;for(let S of u)w+=S.getActualWidth();f-=w}if(f>0){for(let w=0;w<h.length;w++){let S=h[w];if(f-=S.getActualWidth(),f<0)break;p++}if(s)p++}let m;if(p>0){let w=h[p-1];m=g.indexOf(w)+1}else if(m=g.indexOf(h[0]),m===-1)m=0;let C=[m],v=(w,S)=>w-S;if(s){let w=m+1,S=d.length-1;while(w<=S)C.push(w),w++;C.sort(v)}else{let w=m,S=d.length-1,x=d[w];while(w<=S&&c.indexOf(x)<0)w++,C.push(w),x=d[w];w=m-1;let R=0;while(w>=R)C.push(w),w--;C.sort(v).reverse()}return C}function Cl(e){let{pinned:t,fromKeyboard:s,gos:i,ctrlsSvc:o,useHeaderRow:r,skipScrollPadding:n}=e,a=o.getHeaderRowContainerCtrl(t)?.eViewport,{x:l}=e;if(!a)return 0;if(s)l-=a.getBoundingClientRect().left;if(i.get("enableRtl")){if(r)a=a.querySelector(".ag-header-row");l=a.clientWidth-l}if(t==null&&!n)l+=o.get("center").getCenterViewportScrollLeft();return l}function Ka(e,t){for(let s of e)s.moving=t,s.dispatchColEvent("movingChanged","uiColumnMoved")}var wu=7,vl=100,Lr=vl/2,Ay=5,Iy=100,ky=class extends y{constructor(e){super();this.pinned=e,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!M(e)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e)=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){let{pinned:e,lastDraggingEvent:t}=this,{dragItem:s}=t||{},i=s?.columns??[];for(let o of i){let r=o.getPinned();if(o.getColDef().lockPinned){if(r==e)return"move";continue}let n=s?.containerType;if(n===e||!e)return"move";if(e&&(!r||n!==e))return"pinned"}return"notAllowed"}onDragEnter(e){let t=e.dragItem,s=t.columns;if(e.dragSource.type===0)this.setColumnsVisible(s,!0,"uiColumnDragged");else{let o=t.visibleState,r=(s||[]).filter((n)=>o[n.getId()]&&!n.isVisible());this.setColumnsVisible(r,!0,"uiColumnDragged")}if(!this.gos.get("suppressMoveWhenColumnDragging"))this.attemptToPinColumns(s,this.pinned);this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,s=!1,i=!1){let{gos:o,ctrlsSvc:r}=this.beans,n=o.get("suppressMoveWhenColumnDragging");if(i&&!n){this.finishColumnMoving();return}if(this.lastDraggingEvent=e,!e||!i&&q(e.hDirection))return;let a=Cl({x:e.x,pinned:this.pinned,gos:o,ctrlsSvc:r});if(!t)this.checkCenterForScrolling(a);if(n)this.handleColumnDragWhileSuppressingMovement(e,t,s,a,i);else this.handleColumnDragWhileAllowingMovement(e,t,s,a,i)}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,s){if(!e?.length)return;let i=e.filter((o)=>!o.getColDef().lockVisible);if(!i.length)return;this.beans.colModel.setColsVisible(i,t,s)}finishColumnMoving(){this.clearHighlighted();let e=this.lastMovedInfo;if(!e)return;let{columns:t,toIndex:s}=e;this.beans.colMoves.moveColumns(t,s,"uiColumnMoved",!0)}updateDragItemContainerType(){let{lastDraggingEvent:e}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!e)return;let t=e.dragItem;if(!t)return;t.containerType=this.pinned}handleColumnDragWhileSuppressingMovement(e,t,s,i,o){let r=this.getAllMovingColumns(e,!0);if(o){let n=this.isAttemptingToPin(r);if(n)this.attemptToPinColumns(r,void 0,!0);let{fromLeft:a,xPosition:l}=this.getNormalisedXPositionInfo(r,n)||{};if(a==null||l==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:r,xPosition:l,fromEnter:t,fakeEvent:s,fromLeft:a})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(r,i)}}handleColumnDragWhileAllowingMovement(e,t,s,i,o){let r=this.getAllMovingColumns(e),n=this.normaliseDirection(e.hDirection)==="right",a=e.dragSource.type===1,l=this.getMoveColumnParams({allMovingColumns:r,isFromHeader:a,xPosition:i,fromLeft:n,fromEnter:t,fakeEvent:s}),c=cp({...l,finished:o});if(c)this.lastMovedInfo=c}getAllMovingColumns(e,t=!1){let s=e.dragSource.getDragItem(),i;if(t){if(i=s.columnsInSplit,!i)i=s.columns}else i=s.columns;let o=(r)=>r.colDef.lockPinned?r.getPinned()==this.pinned:!0;if(!i)return[];return i.filter(o)}getMoveColumnParams(e){let{allMovingColumns:t,isFromHeader:s,xPosition:i,fromLeft:o,fromEnter:r,fakeEvent:n}=e,{gos:a,colModel:l,colMoves:c,visibleCols:d}=this.beans;return{allMovingColumns:t,isFromHeader:s,fromLeft:o,xPosition:i,pinned:this.pinned,fromEnter:r,fakeEvent:n,gos:a,colModel:l,colMoves:c,visibleCols:d}}highlightHoveredColumn(e,t){let{gos:s,colModel:i}=this.beans,o=s.get("enableRtl"),r=i.getCols().filter((d)=>d.isVisible()&&d.getPinned()===this.pinned),n=null,a=null,l=null;for(let d of r){if(a=d.getActualWidth(),n=this.getNormalisedColumnLeft(d,0,o),n!=null){let u=n+a;if(n<=t&&u>=t){l=d;break}}n=null,a=null}if(!l){for(let d=r.length-1;d>=0;d--){let u=r[d],h=r[d].parent;if(!h){l=u;break}let g=h?.getDisplayedLeafColumns();if(g.length){l=k(g);break}}if(!l)return;n=this.getNormalisedColumnLeft(l,0,o),a=l.getActualWidth()}else if(e.indexOf(l)!==-1)l=null;if(l==null||n==null||a==null){if(this.lastHighlightedColumn?.column!==l)this.clearHighlighted();return}let c;if(t-n<a/2){let d=r.indexOf(l);if(d===0)c=0;else c=1,l=r[d-1]}else c=1;if(this.lastHighlightedColumn?.column!==l||this.lastHighlightedColumn?.position!==c)this.clearHighlighted();bu(l,c),this.lastHighlightedColumn={column:l,position:c}}getNormalisedXPositionInfo(e,t){let{gos:s,visibleCols:i}=this.beans,o=s.get("enableRtl"),{firstMovingCol:r,column:n,position:a}=this.getColumnMoveAndTargetInfo(e,t,o);if(!r||!n||a==null)return;let l=i.allCols,c=l.indexOf(r),d=l.indexOf(n),u=a===0,h=c<d||c===d&&!u,g=0;if(u){if(h)g-=1}else if(!h)g+=1;if(d+g===c)return;let p=l[d+g];if(!p)return;let f=this.getNormalisedColumnLeft(p,20,o);return{fromLeft:h,xPosition:f}}getColumnMoveAndTargetInfo(e,t,s){let i=this.lastHighlightedColumn||{},{firstMovingCol:o,lastMovingCol:r}=Ly(e);if(!o||!r||i.column||!t)return{firstMovingCol:o,...i};let a=this.getPinDirection()==="left";return{firstMovingCol:o,position:a?1:0,column:a!==s?o:r}}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case"left":return"right";case"right":return"left"}return e}getNormalisedColumnLeft(e,t,s){let{gos:i,ctrlsSvc:o}=this.beans,r=e.getLeft();if(r==null)return null;let n=e.getActualWidth();return Cl({x:s?r+n-t:r+t,pinned:e.getPinned(),useHeaderRow:s,skipScrollPadding:!0,gos:i,ctrlsSvc:o})}isAttemptingToPin(e){let t=this.needToMoveLeft||this.needToMoveRight,s=this.failedMoveAttempts>wu;return t&&s||e.some((i)=>i.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){let{allMovingColumns:t,xPosition:s,fromEnter:i,fakeEvent:o,fromLeft:r}=e,n=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:s,fromLeft:r,fromEnter:i,fakeEvent:o}),{columns:a,toIndex:l}=lp(n)||{};if(a&&l!=null)this.lastMovedInfo={columns:a,toIndex:l};this.finishColumnMoving()}clearHighlighted(){let{lastHighlightedColumn:e}=this;if(!e)return;bu(e.column,null),this.lastHighlightedColumn=null}checkCenterForScrolling(e){if(!this.isCenterContainer)return;let t=this.beans.ctrlsSvc.get("center"),s=t.getCenterViewportScrollLeft(),i=s+t.getCenterWidth(),o,r;if(this.gos.get("enableRtl"))o=e<s+Lr,r=e>i-Lr;else r=e<s+Lr,o=e>i-Lr;if(this.needToMoveRight=o,this.needToMoveLeft=r,r||o)this.ensureIntervalStarted();else this.ensureIntervalCleared()}ensureIntervalStarted(){if(this.movingIntervalId)return;this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),Iy),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0)}ensureIntervalCleared(){if(!this.movingIntervalId)return;window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName())}moveInterval(){let e;if(this.intervalCount++,e=10+this.intervalCount*Ay,e>vl)e=vl;let t=null,s=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft)t=s.scrollHorizontally(-e);else if(this.needToMoveRight)t=s.scrollHorizontally(e);if(t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;let{pinnedCols:i,dragAndDrop:o,gos:r}=this.beans;if(this.failedMoveAttempts<=wu+1||!i)return;if(o.setDragImageCompIcon("pinned"),!r.get("suppressMoveWhenColumnDragging")){let n=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(n,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(e,t,s=!1){let i=(e||[]).filter((n)=>!n.colDef.lockPinned);if(!i.length)return 0;if(s)t=this.getPinDirection();let{pinnedCols:o,dragAndDrop:r}=this.beans;if(o?.setColsPinned(i,t,"uiColumnDragged"),s)r.nudge();return i.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function bu(e,t){if(e.highlighted===t)return;e.highlighted=t,e.dispatchColEvent("headerHighlightChanged","uiColumnMoved")}function Ly(e){let t=e.length,s,i;for(let o=0;o<t;o++){if(!s){let r=e[o];if(r.getLeft()!=null)s=r}if(!i){let r=e[t-1-o];if(r.getLeft()!=null)i=r}if(s&&i)break}return{firstMovingCol:s,lastMovingCol:i}}var Gy=class extends y{constructor(e,t){super();this.pinned=e,this.eContainer=t}postConstruct(){let{ctrlsSvc:e,dragAndDrop:t}=this.beans,s=this.pinned;e.whenReady(this,(i)=>{let o,r=i.gridBodyCtrl.eBodyViewport;switch(s){case"left":o=[[r,i.left.eContainer],[i.bottomLeft.eContainer],[i.topLeft.eContainer]];break;case"right":o=[[r,i.right.eContainer],[i.bottomRight.eContainer],[i.topRight.eContainer]];break;default:o=[[r,i.center.eViewport],[i.bottomCenter.eViewport],[i.topCenter.eViewport]];break}this.eSecondaryContainers=o}),this.moveColumnFeature=this.createManagedBean(new ky(s)),this.bodyDropPivotTarget=this.createManagedBean(new xy(s)),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.pivotMode&&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 dp(e,t){let s=[],i=[],o=[];if(e.forEach((n)=>{let a=n.colDef.lockPosition;if(a==="right")o.push(n);else if(a==="left"||a===!0)s.push(n);else i.push(n)}),t.get("enableRtl"))return[...o,...i,...s];return[...s,...i,...o]}function up(e,t){let s=!0;return $t(null,t,(i)=>{if(!ue(i))return;let o=i;if(!o.getColGroupDef()?.marryChildren)return;let a=[];for(let h of o.getLeafColumns()){let g=e.indexOf(h);a.push(g)}let l=Math.max.apply(Math,a),c=Math.min.apply(Math,a),d=l-c,u=o.getLeafColumns().length-1;if(d>u)s=!1}),s}var Oy=class extends y{constructor(){super(...arguments);this.beanName="colMoves"}moveColumnByIndex(e,t,s){let i=this.beans.colModel.getCols();if(!i)return;let o=i[e];this.moveColumns([o],t,s)}moveColumns(e,t,s,i=!0){let{colModel:o,colAnimation:r,visibleCols:n,eventSvc:a}=this.beans,l=o.getCols();if(!l)return;if(t>l.length-e.length){F(30,{toIndex:t});return}r?.start();let c=o.getColsForKeys(e);if(this.doesMovePassRules(c,t))Jd(o.getCols(),c,t),n.refresh(s),a.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,toIndex:t,finished:i,source:s});r?.finish()}doesMovePassRules(e,t){let s=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(s)}doesOrderPassRules(e){let{colModel:t,gos:s}=this.beans;if(!up(e,t.getColTree()))return!1;if(!((o)=>{let r=(c)=>{if(!c)return 0;return c==="left"||c===!0?-1:1},n=s.get("enableRtl"),a=n?1:-1,l=!0;for(let c of o){let d=r(c.colDef.lockPosition);if(n){if(d>a)l=!1}else if(d<a)l=!1;a=d}return l})(e))return!1;return!0}getProposedColumnOrder(e,t){let i=this.beans.colModel.getCols().slice();return Jd(i,e,t),i}createBodyDropTarget(e,t){return new Gy(e,t)}moveHeader(e,t,s,i,o){let{ctrlsSvc:r,gos:n,colModel:a,visibleCols:l,focusSvc:c}=this.beans,d=t.getBoundingClientRect(),u=d.left,h=we(s),g=h?d.width:s.getActualWidth(),p=e==="left"!==n.get("enableRtl"),f=Cl({x:p?u-20:u+g+20,pinned:i,fromKeyboard:!0,gos:n,ctrlsSvc:r}),m=c.focusedHeader;cp({allMovingColumns:h?s.getLeafColumns():[s],isFromHeader:!0,fromLeft:e==="right",xPosition:f,pinned:i,fromEnter:!1,fakeEvent:!1,gos:n,colModel:a,colMoves:this,visibleCols:l,finished:!0});let C;if(h){let v=s.getDisplayedLeafColumns();C=p?v[0]:k(v)}else C=s;if(r.getScrollFeature().ensureColumnVisible(C,"auto"),(!o.isAlive()||n.get("ensureDomOrder"))&&m){let v;if(h){let w=s.getGroupId(),S=s.getLeafColumns();if(!S.length)return;let x=S[0].parent;if(!x)return;v=By(x,w)}else v=s;if(v)c.focusHeaderPosition({headerPosition:{...m,column:v}})}}setDragSourceForHeader(e,t,s){let{gos:i,colModel:o,dragAndDrop:r,visibleCols:n}=this.beans,a=!i.get("suppressDragLeaveHidesColumns"),l=we(t),c=l?t.getProvidedColumnGroup().getLeafColumns():[t],u={type:1,eElement:e,getDefaultIconName:()=>a?"hide":"notAllowed",getDragItem:l?()=>Ny(t,n.allCols):()=>Vy(t),dragItemName:s,onDragStarted:()=>{a=!i.get("suppressDragLeaveHidesColumns"),Ka(c,!0)},onDragStopped:()=>Ka(c,!1),onDragCancelled:()=>Ka(c,!1),onGridEnter:(h)=>{if(a){let{columns:g=[],visibleState:p}=h??{},f=l?(C)=>!p||p[C.getColId()]:()=>!0,m=g.filter((C)=>!C.getColDef().lockVisible&&f(C));o.setColsVisible(m,!0,"uiColumnMoved")}},onGridExit:(h)=>{if(a){let g=h?.columns?.filter((p)=>!p.getColDef().lockVisible)||[];o.setColsVisible(g,!1,"uiColumnMoved")}}};return r.addDragSource(u,!0),u}};function By(e,t){while(e){if(e.getGroupId()===t)return e;e=e.parent}return}function Vy(e){let t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t,containerType:e.pinned}}function Ny(e,t){let s=e.getProvidedColumnGroup().getLeafColumns(),i={};for(let a of s)i[a.getId()]=a.isVisible();let o=[];for(let a of t)if(s.indexOf(a)>=0)o.push(a),ae(s,a);for(let a of s)o.push(a);let r=[],n=e.getLeafColumns();for(let a of o)if(n.indexOf(a)!==-1)r.push(a);return{columns:o,columnsInSplit:r,visibleState:i,containerType:r[0]?.pinned}}var or={moduleName:"ColumnMove",version:z,beans:[Oy,by],apiFunctions:{moveColumnByIndex:Sy,moveColumns:yy},dependsOn:[ir],css:[wy]},_y=class extends y{constructor(){super(...arguments);this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e)=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){let s=this.getHeaderCellForColumn(e);if(!s)return-1;let i=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e);if(!t)i.push(s);return this.getPreferredWidthForElements(i)}getPreferredWidthForColumnGroup(e){let t=this.getHeaderCellForColumn(e);if(!t)return-1;return this.getPreferredWidthForElements([t])}getPreferredWidthForElements(e,t){let s=document.createElement("form");s.style.position="fixed";let i=this.centerRowContainerCtrl.eContainer;for(let r of e)this.cloneItemIntoDummy(r,s);i.appendChild(s);let o=Math.ceil(s.getBoundingClientRect().width);return s.remove(),t=t??this.gos.get("autoSizePadding"),o+t}getHeaderCellForColumn(e){let t=null;for(let s of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){let i=s.getHtmlElementForColumnHeader(e);if(i!=null)t=i}return t}cloneItemIntoDummy(e,t){let s=e.cloneNode(!0);s.style.width="",s.style.position="static",s.style.left="";let i=document.createElement("div"),o=i.classList;if(["ag-header-cell","ag-header-group-cell"].some((a)=>s.classList.contains(a)))o.add("ag-header","ag-header-row"),i.style.position="static";else o.add("ag-row");let n=e.parentElement;while(n){if(["ag-header-row","ag-row"].some((l)=>n.classList.contains(l))){for(let l=0;l<n.classList.length;l++){let c=n.classList[l];if(c!="ag-row-position-absolute")o.add(c)}break}n=n.parentElement}i.appendChild(s),t.appendChild(i)}},hp={moduleName:"AutoWidth",version:z,beans:[_y]};function Hy(e,t,s=!0,i="api"){e.colResize?.setColumnWidths(t,!1,s,i)}function gp(e,t){if(!e||e.length==0)return;let s=t(e[0]);for(let i=1;i<e.length;i++)if(s!==t(e[i]))return;return s}function pp(e,t,s){if(!t.length)return;let i=t.length===1?t[0]:null,o=gp(t,(r)=>r.getPinned());e.dispatchEvent({type:"columnPinned",pinned:o!=null?o:null,columns:t,column:i,source:s})}function zy(e,t,s){if(!t.length)return;let i=t.length===1?t[0]:null,o=gp(t,(r)=>r.isVisible());e.dispatchEvent({type:"columnVisible",visible:o,columns:t,column:i,source:s})}function fp(e,t,s,i){e.dispatchEvent({type:t,columns:s,column:s?.length==1?s[0]:null,source:i})}function Ki(e,t,s,i,o=null){if(t?.length)e.dispatchEvent({type:"columnResized",columns:t,column:t.length===1?t[0]:null,flexColumns:o,finished:s,source:i})}var Wy=class extends y{constructor(e,t,s,i){super();this.comp=e,this.eResize=t,this.pinned=s,this.columnGroup=i}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}let{horizontalResizeSvc:e,gos:t,colAutosize:s}=this.beans,i=e.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(i),!t.get("suppressAutoSize")&&s)this.addDestroyFunc(s.addColumnGroupResize(this.eResize,this.columnGroup,()=>this.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(e){let{columnsToResize:t,resizeStartWidth:s,resizeRatios:i,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:n}=this.getInitialValues(e);this.resizeCols=t,this.resizeStartWidth=s,this.resizeRatios=i,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=n,this.toggleColumnResizing(!0)}onResizing(e,t,s="uiColumnResized"){let i=this.normaliseDragChange(t),o=this.resizeStartWidth+i;this.resizeColumnsFromLocalValues(o,s,e)}getInitialValues(e){let t=(l)=>l.reduce((c,d)=>c+d.getActualWidth(),0),s=(l,c)=>l.map((d)=>d.getActualWidth()/c),i=this.getColumnsToResize(),o=t(i),r=s(i,o),n={columnsToResize:i,resizeStartWidth:o,resizeRatios:r},a=null;if(e)a=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null;if(a){let l=a.getDisplayedLeafColumns(),c=n.groupAfterColumns=l.filter((u)=>u.isResizable()),d=n.groupAfterStartWidth=t(c);n.groupAfterRatios=s(c,d)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}resizeLeafColumnsToFit(e){let t=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),s=this.getInitialValues();if(t>s.resizeStartWidth)this.resizeColumns(s,t,e,!0)}resizeColumnsFromLocalValues(e,t,s=!0){if(!this.resizeCols||!this.resizeRatios)return;let i={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(i,e,t,s)}resizeColumns(e,t,s,i=!0){let{columnsToResize:o,resizeStartWidth:r,resizeRatios:n,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:c}=e,d=[];if(d.push({columns:o,ratios:n,width:t}),a){let u=t-r;d.push({columns:a,ratios:c,width:l-u})}if(this.beans.colResize?.resizeColumnSets({resizeSets:d,finished:i,source:s}),i)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;if(this.gos.get("enableRtl")){if(this.pinned!=="left")t*=-1}else if(this.pinned==="right")t*=-1;return t}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},Uy=class extends y{constructor(e,t,s,i,o){super();this.pinned=e,this.column=t,this.eResize=s,this.comp=i,this.ctrl=o}postConstruct(){let e=[],t,s,i=()=>{if(G(this.eResize,t),!t)return;let{horizontalResizeSvc:n,colAutosize:a}=this.beans,l=n.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(l),s&&a)e.push(a.addColumnAutosizeListeners(this.eResize,this.column))},o=()=>{for(let n of e)n();e.length=0},r=()=>{let n=this.column.isResizable(),a=!this.gos.get("suppressAutoSize")&&!this.column.colDef.suppressAutoSize;if(n!==t||a!==s)t=n,s=a,o(),i()};r(),this.addDestroyFunc(o),this.ctrl.setRefreshFunction("resize",r)}onResizing(e,t){let{column:s,lastResizeAmount:i,resizeStartWidth:o,beans:r}=this,n=this.normaliseResizeAmount(t),a=o+n,l=[{key:s,newWidth:a}],{pinnedCols:c,ctrlsSvc:d,colResize:u}=r;if(this.column.getPinned()){let h=c?.leftWidth??0,g=c?.rightWidth??0,p=ni(d.getGridBodyCtrl().eBodyViewport)-50;if(h+g+(n-i)>p)return}if(this.lastResizeAmount=n,u?.setColumnWidths(l,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,s=this.pinned!=="left",i=this.pinned==="right";if(this.gos.get("enableRtl")){if(s)t*=-1}else if(i)t*=-1;return t}},Ky=class extends y{constructor(){super(...arguments);this.beanName="colResize"}setColumnWidths(e,t,s,i){let o=[],{colModel:r,gos:n,visibleCols:a}=this.beans;for(let l of e){let c=r.getColDefColOrCol(l.key);if(!c)continue;if(o.push({width:l.newWidth,ratios:[1],columns:[c]}),n.get("colResizeDefault")==="shift")t=!t;if(t){let u=a.getColAfter(c);if(!u)continue;let h=c.getActualWidth()-l.newWidth,g=u.getActualWidth()+h;o.push({width:g,ratios:[1],columns:[u]})}}if(o.length===0)return;this.resizeColumnSets({resizeSets:o,finished:s,source:i})}resizeColumnSets(e){let{resizeSets:t,finished:s,source:i}=e;if(!(!t||t.every((d)=>$y(d)))){if(s){let d=t&&t.length>0?t[0].columns:null;Ki(this.eventSvc,d,s,i)}return}let r=[],n=[];for(let d of t){let{width:u,columns:h,ratios:g}=d,p={},f={};for(let v of h)n.push(v);let m=!0,C=0;while(m){if(C++,C>1000){X(31);break}m=!1;let v=[],w=0,S=u;h.forEach((R,P)=>{if(f[R.getId()])S-=p[R.getId()];else{v.push(R);let O=g[P];w+=O}});let x=1/w;v.forEach((R,P)=>{let D=P===v.length-1,O;if(D)O=S;else O=Math.round(g[P]*u*x),S-=O;let A=R.getMinWidth(),_=R.getMaxWidth();if(O<A)O=A,f[R.getId()]=!0,m=!0;else if(_>0&&O>_)O=_,f[R.getId()]=!0,m=!0;p[R.getId()]=O})}for(let v of h){let w=p[v.getId()];if(v.getActualWidth()!==w)v.setActualWidth(w,i),r.push(v)}}let a=r.length>0,l=[];if(a){let{colFlex:d,visibleCols:u,colViewport:h}=this.beans;l=d?.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0})??[],u.setLeftValues(i),u.updateBodyWidths(),h.checkViewportColumns()}let c=n.concat(l);if(a||s)Ki(this.eventSvc,c,s,i,l)}resizeHeader(e,t,s){if(!e.isResizable())return;let i=e.getActualWidth(),o=e.getMinWidth(),r=e.getMaxWidth(),n=Math.min(Math.max(i+t,o),r);this.setColumnWidths([{key:e,newWidth:n}],s,!0,"uiColumnResized")}createResizeFeature(e,t,s,i,o){return new Uy(e,t,s,i,o)}createGroupResizeFeature(e,t,s,i){return new Wy(e,t,s,i)}};function $y(e){let{columns:t,width:s}=e,i=0,o=0,r=!0;for(let l of t){let c=l.getMinWidth();i+=c||0;let d=l.getMaxWidth();if(d>0)o+=d;else r=!1}let n=s>=i,a=!r||s<=o;return n&&a}var jy={moduleName:"ColumnResize",version:z,beans:[Ky],apiFunctions:{setColumnWidths:Hy},dependsOn:[Tc,hp]},qy=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();let e=this.onWidthChanged.bind(this);for(let 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(let e of this.removeChildListenersFuncs)e();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){let e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.toggleCss("ag-hidden",e===0)}},Yy=class extends yc{constructor(){super(...arguments);this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource)this.setDragSource(this.eGui)}}wireComp(e,t,s,i,o){let{column:r,beans:n}=this,{context:a,colNames:l,colHover:c,rangeSvc:d,colResize:u}=n;this.comp=e,o=er(this,a,o),this.setGui(t,o),this.displayName=l.getDisplayNameForColumnGroup(r,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(o),this.setupExpandable(o),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:i,compBean:o}),this.setupUserComp(),this.addHeaderMouseListeners(o,i),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();let h=this.rowCtrl.pinned,g=r.getProvidedColumnGroup().getLeafColumns();if(c?.createHoverFeature(o,g,t),d?.createRangeHighlightFeature(o,r,e),o.createManagedBean(new Sc(r,t,n)),o.createManagedBean(new qy(e,r)),u)this.resizeFeature=o.createManagedBean(u.createGroupResizeFeature(e,s,h,r));else e.setResizableDisplayed(!1);o.createManagedBean(new ls(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{return},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(o,g),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),o.addManagedPropertyListener("cellSelection",()=>this.refreshAnnouncement()),o.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(o),o.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){let{column:e,beans:t}=this,s=e.getDefinition();return I(t.gos,{colDef:s,columnGroup:e,floatingFilter:!1})}refreshMaxHeaderHeight(){let{gos:e,comp:t}=this,s=e.get("groupHeaderHeight");if(s!=null)if(s===0)t.setHeaderWrapperHidden(!0);else t.setHeaderWrapperMaxHeight(s);else t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null)}addHighlightListeners(e,t){if(!this.beans.gos.get("suppressMoveWhenColumnDragging"))return;for(let s of t)e.addManagedListeners(s,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,s)})}onLeafColumnHighlightChanged(e){let t=this.column.getDisplayedLeafColumns(),s=t[0]===e,i=k(t)===e;if(!s&&!i)return;let o=e.getHighlighted(),r=!!this.rowCtrl.getHeaderCellCtrls().find((l)=>l.column.isMoving()),n=!1,a=!1;if(r){let l=this.beans.gos.get("enableRtl"),c=o===1,d=o===0;if(s)if(l)a=c;else n=d;if(i)if(l)n=d;else a=c}this.comp.toggleCss("ag-header-highlight-before",n),this.comp.toggleCss("ag-header-highlight-after",a)}resizeHeader(e,t){let{resizeFeature:s}=this;if(!s)return;let i=s.getInitialValues(t);s.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}resizeLeafColumnsToFit(e){this.resizeFeature?.resizeLeafColumnsToFit(e)}setupUserComp(){let{colGroupSvc:e,userCompFactory:t,gos:s,enterpriseMenuFactory:i}=this.beans,o=this.column,r=o.getProvidedColumnGroup(),n=I(s,{displayName:this.displayName,columnGroup:o,setExpanded:(l)=>{e.setColumnGroupOpened(r,l,"gridInitializing")},setTooltip:(l,c)=>{s.assertModuleRegistered("Tooltip",3),this.setupTooltip(l,c)},showColumnMenu:(l,c)=>i?.showMenuAfterButtonClick(r,l,"columnMenu",c),showColumnMenuAfterMouseClick:(l,c)=>i?.showMenuAfterMouseEvent(r,l,"columnMenu",c),eGridHeader:this.eGui}),a=cb(t,n);if(a)this.comp.setUserCompDetails(a)}addHeaderMouseListeners(e,t){let{column:s,comp:i,beans:{rangeSvc:o},gos:r}=this,n=(d)=>this.handleMouseOverChange(d.type==="mouseenter"),a=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",s.getProvidedColumnGroup()),l=(d)=>this.handleContextMenuMouseEvent(d,void 0,s.getProvidedColumnGroup());e.addManagedListeners(this.eGui,{mouseenter:n,mouseleave:n,click:a,contextmenu:l}),i.toggleCss("ag-header-group-cell-selectable",is(r));let c=o?.createHeaderGroupCellMouseListenerFeature(this.column,t);if(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){let t=this.column.getProvidedColumnGroup();this.refreshExpanded();let s=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:s,expandableChanged:s})}refreshExpanded(){let{column:e}=this;this.expandable=e.isExpandable();let t=e.isExpanded();if(this.expandable)this.comp.setAriaExpanded(t?"true":"false");else this.comp.setAriaExpanded(void 0);this.refreshHeaderStyles(),this.refreshAnnouncement()}addClasses(){let{column:e}=this,t=e.getColGroupDef(),s=Gn(t,this.gos,null,e);if(e.isPadding()){if(s.push("ag-header-group-cell-no-group"),e.getLeafColumns().every((o)=>o.isSpanHeaderHeight()))s.push("ag-header-span-height")}else if(s.push("ag-header-group-cell-with-group"),t?.wrapHeaderText)s.push("ag-header-cell-wrap-text");for(let i of s)this.comp.toggleCss(i,!0)}setupMovingCss(e){let{column:t}=this,i=t.getProvidedColumnGroup().getLeafColumns(),o=()=>this.comp.toggleCss("ag-header-cell-moving",t.isMoving());for(let r of i)e.addManagedListeners(r,{movingChanged:o});o()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget))this.focusThis(),this.announceAriaDescription()}handleKeyDown(e){if(super.handleKeyDown(e),!this.getWrapperHasFocus())return;let{column:s,expandable:i,gos:o,beans:r}=this,n=is(o);if(e.key!=b.ENTER)return;if(n&&!e.altKey)r.rangeSvc?.handleColumnSelection(s,e);else if(i){let a=!s.isExpanded();r.colGroupSvc.setColumnGroupOpened(s.getProvidedColumnGroup(),a,"uiColumnExpanded")}}refreshAnnouncement(){let e,{gos:t,expandable:s}=this,i=is(t),o=this.getLocaleTextFunc();if(i&&s)e=o("ariaColumnGroupCellSelectionAndExpansion","Press Enter to toggle selection for all visible cells in this column group. Press ALT ENTER to expand or collapse this column group");else if(i)e=o("ariaColumnGroupCellSelection","Press Enter to toggle selection for all visible cells in this column group");else if(s)e=o("ariaColumnGroupExpansion","Press ENTER to expand or collapse this column group");this.ariaAnnouncement=e}announceAriaDescription(){let{beans:e,eGui:t,ariaAnnouncement:s}=this;if(!s||!t.contains(j(e)))return;e.ariaAnnounce?.announceValue(s,"columnHeader")}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!e)return;this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some((e)=>e.colDef.suppressMovable||e.colDef.lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function Xy(e,t,s){e.colGroupSvc?.setColumnGroupOpened(t,s,"api")}function Zy(e,t,s){return e.colGroupSvc?.getColumnGroup(t,s)??null}function Qy(e,t){return e.colGroupSvc?.getProvidedColGroup(t)??null}function Jy(e,t,s){return e.colNames.getDisplayNameForColumnGroup(t,s)||""}function e0(e){return e.colGroupSvc?.getColumnGroupState()??[]}function t0(e,t){e.colGroupSvc?.setColumnGroupState(t,"api")}function s0(e){e.colGroupSvc?.resetColumnGroupState("api")}function i0(e){return e.visibleCols.treeLeft}function o0(e){return e.visibleCols.treeCenter}function r0(e){return e.visibleCols.treeRight}function n0(e){return e.visibleCols.getAllTrees()}var mp=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){let t=this.existingIds[e],s;if(typeof t!=="number")s=0;else s=t+1;return this.existingIds[e]=s,s}};function a0(e,t){for(let s=0;s<t.length;s++){let i=e.indexOf(t[s]);if(i>=0)e[i]=e[e.length-1],e.pop()}}var l0=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){let{colFlex:s,colModel:i,colGroupSvc:o,colViewport:r,selectionColSvc:n}=this.beans;if(!t)this.buildTrees(i,o);o?.updateOpenClosedVisibility(),this.leftCols=$a(this.treeLeft),this.centerCols=$a(this.treeCenter),this.rightCols=$a(this.treeRight),n?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(i),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(e),this.autoHeightCols=this.allCols.filter((a)=>a.isAutoHeight()),s?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(i,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(let t of this.allCols){let s=t.parent;while(s){if(!s.isPadding()){let i=s.getProvidedColumnGroup().getLevel()+1;if(i>e)e=i;break}s=s.parent}}return e}updateBodyWidths(){let e=ts(this.centerCols),t=ts(this.leftCols),s=ts(this.rightCols);if(this.isBodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==s)this.bodyWidth=e,this.leftWidth=t,this.rightWidth=s,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"})}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e,t,s,i){let o,r;if(this.gos.get("enableRtl"))o=t?t[0]:null,r=s?k(s):null;else o=t?k(t):null,r=s?s[0]:null;for(let n of e.getCols())n.setLastLeftPinned(n===o,i),n.setFirstRightPinned(n===r,i)}buildTrees(e,t){let s=e.getColsToShow(),i=s.filter((l)=>l.getPinned()=="left"),o=s.filter((l)=>l.getPinned()=="right"),r=s.filter((l)=>l.getPinned()!="left"&&l.getPinned()!="right"),n=new mp,a=(l)=>t?t.createColumnGroups(l):l.columns;this.treeLeft=a({columns:i,idCreator:n,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=a({columns:o,idCreator:n,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=a({columns:r,idCreator:n,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(e){let t=e.getCols(),s=[],i=[],o=[];for(let r of t){let n=r.getPinned();if(!n)i.push(r);else if(n===!0||n==="left")s.push(r);else o.push(r)}this.ariaOrderColumns=s.concat(i).concat(o)}getAriaColIndex(e){let t;if(we(e))t=e.getLeafColumns()[0];else t=e;return this.ariaOrderColumns.indexOf(t)+1}setLeftValuesOfGroups(){for(let e of[this.treeLeft,this.treeRight,this.treeCenter])for(let t of e)if(we(t))t.checkLeft()}setLeftValuesOfCols(e){let{colModel:t}=this.beans;if(!t.getColDefCols())return;let i=t.getCols().slice(0),o=this.gos.get("enableRtl");for(let r of[this.leftCols,this.rightCols,this.centerCols]){if(o){let n=ts(r);for(let a of r)n-=a.getActualWidth(),a.setLeft(n,e)}else{let n=0;for(let a of r)a.setLeft(n,e),n+=a.getActualWidth()}a0(i,r)}for(let r of i)r.setLeft(null,e)}joinCols(){if(this.gos.get("enableRtl"))this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols);else this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){if(this.treeLeft&&this.treeRight&&this.treeCenter)return this.treeLeft.concat(this.treeCenter).concat(this.treeRight);return null}isColDisplayed(e){return this.allCols.indexOf(e)>=0}getLeftColsForRow(e){let{leftCols:t,beans:{colModel:s}}=this;if(!s.colSpanActive)return t;return this.getColsForRow(e,t)}getRightColsForRow(e){let{rightCols:t,beans:{colModel:s}}=this;if(!s.colSpanActive)return t;return this.getColsForRow(e,t)}getColsForRow(e,t,s,i){let o=[],r=null;for(let n=0;n<t.length;n++){let a=t[n],l=t.length-n,c=Math.min(a.getColSpan(e),l),d=[a];if(c>1){let h=c-1;for(let g=1;g<=h;g++)d.push(t[n+g]);n+=h}let u;if(s){u=!1;for(let h of d)if(s(h))u=!0}else u=!0;if(u){if(o.length===0&&r){if(i?i(a):!1)o.push(r)}o.push(a)}r=a}return o}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(e){let t=this.allCols,s=t.indexOf(e);if(s>0)return t[s-1];return null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};let e=(t)=>{this.colsAndGroupsMap[t.getUniqueId()]=t};oi(this.treeCenter,!1,e),oi(this.treeLeft,!1,e),oi(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}getFirstColumn(){let e=this.gos.get("enableRtl"),t=["leftCols","centerCols","rightCols"];if(e)t.reverse();for(let s=0;s<t.length;s++){let i=this[t[s]];if(i.length)return e?k(i):i[0]}return null}getColAfter(e){let t=this.allCols,s=t.indexOf(e);if(s<t.length-1)return t[s+1];return null}getColsLeftWidth(){return ts(this.leftCols)}getDisplayedColumnsRightWidth(){return ts(this.rightCols)}isColAtEdge(e,t){let s=this.allCols;if(!s.length)return!1;let i=t==="first",o;if(we(e)){let r=e.getDisplayedLeafColumns();if(!r.length)return!1;o=i?r[0]:k(r)}else o=e;return(i?s[0]:k(s))===o}};function oi(e,t,s){if(!e)return;for(let i=0;i<e.length;i++){let o=e[i];if(we(o)){let r=t?o.getDisplayedChildren():o.getChildren();oi(r,t,s)}s(o)}}function $a(e){let t=[];return oi(e,!0,(s)=>{if(ht(s))t.push(s)}),t}var c0=class extends y{constructor(){super(...arguments);this.beanName="colGroupSvc"}getColumnGroupState(){let e=[],t=this.beans.colModel.getColTree();return $t(null,t,(s)=>{if(ue(s))e.push({groupId:s.getGroupId(),open:s.isExpanded()})}),e}resetColumnGroupState(e){let t=this.beans.colModel.getColDefColTree();if(!t)return;let s=[];$t(null,t,(i)=>{if(ue(i)){let o=i.getColGroupDef(),r={groupId:i.getGroupId(),open:!o?void 0:o.openByDefault};s.push(r)}}),this.setColumnGroupState(s,e)}setColumnGroupState(e,t){let{colModel:s,colAnimation:i,visibleCols:o,eventSvc:r}=this.beans;if(!s.getColTree().length)return;i?.start();let a=[];for(let l of e){let{groupId:c,open:d}=l,u=this.getProvidedColGroup(c);if(!u)continue;if(u.isExpanded()===d)continue;u.setExpanded(d),a.push(u)}if(o.refresh(t,!0),a.length)r.dispatchEvent({type:"columnGroupOpened",columnGroup:a.length===1?a[0]:void 0,columnGroups:a});i?.finish()}setColumnGroupOpened(e,t,s){let i;if(ue(e))i=e.getId();else i=e||"";this.setColumnGroupState([{groupId:i,open:t}],s)}getProvidedColGroup(e){let t=null;return $t(null,this.beans.colModel.getColTree(),(s)=>{if(ue(s)){if(s.getId()===e)t=s}}),t}getGroupAtDirection(e,t){let s=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),i=e.getDisplayedLeafColumns(),o=t==="After"?k(i):i[0],r=`getCol${t}`;while(!0){let n=this.beans.visibleCols[r](o);if(!n)return null;let a=this.getColGroupAtLevel(n,s);if(a!==e)return a}}getColGroupAtLevel(e,t){let s=e.parent,i,o;while(!0){if(i=s.getProvidedColumnGroup().getLevel(),o=s.getPaddingLevel(),i+o<=t)break;s=s.parent}return s}updateOpenClosedVisibility(){let e=this.beans.visibleCols.getAllTrees();oi(e,!1,(t)=>{if(we(t))t.calculateDisplayedColumns()})}getColumnGroup(e,t){if(!e)return null;if(we(e))return e;let s=this.beans.visibleCols.getAllTrees(),i=typeof t==="number",o=null;return oi(s,!1,(r)=>{if(we(r)){let n=r,a;if(i)a=e===n.getGroupId()&&t===n.getPartId();else a=e===n.getGroupId();if(a)o=n}}),o}createColumnGroups(e){let{columns:t,idCreator:s,pinned:i,oldDisplayedGroups:o,isStandaloneStructure:r}=e,n=this.mapOldGroupsById(o),a=[],l=t;while(l.length){let c=l;l=[];let d=0,u=(h)=>{let g=d;d=h;let p=c[g],m=(we(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(m==null){for(let v=g;v<h;v++)a.push(c[v]);return}let C=this.createColumnGroup(m,s,n,i,r);for(let v=g;v<h;v++)C.addChild(c[v]);l.push(C)};for(let h=1;h<c.length;h++){let g=c[h],f=(we(g)?g.getProvidedColumnGroup():g).getOriginalParent(),m=c[d],v=(we(m)?m.getProvidedColumnGroup():m).getOriginalParent();if(f!==v)u(h)}if(d<c.length)u(c.length)}if(!r)this.setupParentsIntoCols(a,null);return a}createProvidedColumnGroup(e,t,s,i,o,r,n){let a=o.getUniqueKey(t.groupId||null,null),l=ul(this.beans,t,a),c=new ii(l,a,!1,s);this.createBean(c);let d=this.findExistingGroup(t,r);if(d)r.splice(d.idx,1);let u=d?.group;if(u)c.setExpanded(u.isExpanded());let h=dg(this.beans,l.children,s+1,e,i,o,r,n);return c.setChildren(h),c}balanceColumnTree(e,t,s,i){let o=[];for(let r=0;r<e.length;r++){let n=e[r];if(ue(n)){let a=n,l=this.balanceColumnTree(a.getChildren(),t+1,s,i);a.setChildren(l),o.push(a)}else{let a,l;for(let c=t;c<s;c++){let d=i.getUniqueKey(null,null),u=ul(this.beans,null,d),h=new ii(u,d,!0,c);if(this.createBean(h),l)l.setChildren([h]);if(l=h,!a)a=l}if(a&&l)if(o.push(a),e.some((d)=>ue(d))){l.setChildren([n]);continue}else{l.setChildren(e);break}o.push(n)}}return o}findDepth(e){let t=0,s=e;while(s?.[0]&&ue(s[0]))t++,s=s[0].getChildren();return t}findMaxDepth(e,t){let s=t;for(let i=0;i<e.length;i++){let o=e[i];if(ue(o)){let r=o,n=this.findMaxDepth(r.getChildren(),t+1);if(s<n)s=n}}return s}balanceTreeForAutoCols(e,t){let s=[];for(let i of e){let o=i;for(let r=t-1;r>=0;r--){let n=new ii(null,`FAKE_PATH_${i.getId()}_${r}`,!0,r);this.createBean(n),n.setChildren([o]),o.originalParent=n,o=n}if(t===0)i.originalParent=null;s.push(o)}return s}findExistingGroup(e,t){if(e.groupId==null)return;for(let i=0;i<t.length;i++){let o=t[i];if(!o.getColGroupDef())continue;if(o.getId()===e.groupId)return{idx:i,group:o}}return}createColumnGroup(e,t,s,i,o){let r=e.getGroupId(),n=t.getInstanceIdForKey(r),a=vg(r,n),l=s[a];if(l&&l.getProvidedColumnGroup()!==e)l=null;if(M(l))l.reset();else if(l=new Oo(e,r,n,i),!o)this.createBean(l);return l}mapOldGroupsById(e){let t={},s=(i)=>{for(let o of i)if(we(o)){let r=o;t[o.getUniqueId()]=r,s(r.getChildren())}};if(e)s(e);return t}setupParentsIntoCols(e,t){for(let s of e??[]){if(s.parent!==t)this.beans.colViewport.colsWithinViewportHash="";if(s.parent=t,we(s)){let i=s;this.setupParentsIntoCols(i.getChildren(),i)}}}},Dc={moduleName:"ColumnGroup",version:z,dynamicBeans:{headerGroupCellCtrl:Yy},beans:[c0],apiFunctions:{getAllDisplayedColumnGroups:n0,getCenterDisplayedColumnGroups:o0,getColumnGroup:Zy,getColumnGroupState:e0,getDisplayNameForColumnGroup:Jy,getLeftDisplayedColumnGroups:i0,getProvidedColumnGroup:Qy,getRightDisplayedColumnGroups:r0,resetColumnGroupState:s0,setColumnGroupOpened:Xy,setColumnGroupState:t0}};function Je(e,t,s){let{colModel:i,rowGroupColsSvc:o,pivotColsSvc:r,autoColSvc:n,selectionColSvc:a,colAnimation:l,visibleCols:c,pivotResultCols:d,environment:u,valueColsSvc:h,eventSvc:g,gos:p}=e,f=i.getColDefCols()??[],m=a?.getColumns();if(!f.length&&!m?.length)return!1;if(t?.state&&!t.state.forEach)return F(32),!1;let C=(x,R,P,D,O)=>{if(!x)return;let A=Iw(R,t.defaultState),_=A("flex").value1,oe=A("sort").value1,Y=A("sortType").value1,V=Ps(oe)||ec(Y),re=At(Y),le=An(oe),U=V?{type:re,direction:le}:void 0;if(ug(e,x,A("hide").value1,U,A("sortIndex").value1,A("pinned").value1,_,s),_==null){let W=A("width").value1;if(W!=null){let Re=x.getColDef().minWidth??u.getDefaultColumnMinWidth();if(Re!=null&&W>=Re)x.setActualWidth(W,s)}}if(O||!x.primary)return;h?.syncColumnWithState(x,s,A),o?.syncColumnWithState(x,s,A,P),r?.syncColumnWithState(x,s,A,D)},v=(x,R,P)=>{let D=vp(e,s),O=R.slice(),A={},_={},oe=[],Y=[],V=[],re=0,le=o?.columns.slice()??[],U=r?.columns.slice()??[];for(let ne of x){let Ot=ne.colId;if(Ot.startsWith(hi)){oe.push(ne),V.push(ne);continue}if(Zt(Ot)){Y.push(ne),V.push(ne);continue}let fs=P(Ot);if(!fs)V.push(ne),re+=1;else C(fs,ne,A,_,!1),ae(O,fs)}let W=(ne)=>C(ne,null,A,_,!1);O.forEach(W),o?.sortColumns(yu.bind(o,A,le)),r?.sortColumns(yu.bind(r,_,U)),i.refreshCols(!1,s);let Re=(ne,Ot,Ys=[])=>{for(let fs of Ot){let Ud=ne(fs.colId);ae(Ys,Ud),C(Ud,fs,null,null,!0)}Ys.forEach(W)};return Re((ne)=>n?.getColumn(ne)??null,oe,n?.getColumns()?.slice()),Re((ne)=>a?.getColumn(ne)??null,Y,a?.getColumns()?.slice()),d0(t,i,p),c.refresh(s),g.dispatchEvent({type:"columnEverythingChanged",source:s}),D(),{unmatchedAndAutoStates:V,unmatchedCount:re}};l?.start();let{unmatchedAndAutoStates:w,unmatchedCount:S}=v(t.state||[],f,(x)=>i.getColDefCol(x));if(w.length>0||M(t.defaultState)){let x=d?.getPivotResultCols()?.list??[];S=v(w,x,(R)=>d?.getPivotResultCol(R)??null).unmatchedCount}return l?.finish(),S===0}function Cp(e,t){let{colModel:s,autoColSvc:i,selectionColSvc:o,eventSvc:r,gos:n}=e;if(!s.getColDefCols()?.length)return;let l=s.getColDefColTree(),c=In(l),d=[],u=1000,h=1000,g=(v)=>{let w=wp(v);if(q(w.rowGroupIndex)&&w.rowGroup)w.rowGroupIndex=u++;if(q(w.pivotIndex)&&w.pivot)w.pivotIndex=h++;d.push(w)};i?.getColumns()?.forEach(g),o?.getColumns()?.forEach(g),c?.forEach(g),Je(e,{state:d},t);let p=i?.getColumns()??[],C=[...o?.getColumns()??[],...p,...c].map((v)=>({colId:v.colId}));Je(e,{state:C,applyOrder:!0},t),r.dispatchEvent(I(n,{type:"columnsReset",source:t}))}function vp(e,t){let{rowGroupColsSvc:s,pivotColsSvc:i,valueColsSvc:o,colModel:r,sortSvc:n,eventSvc:a}=e,l={rowGroupColumns:s?.columns.slice()??[],pivotColumns:i?.columns.slice()??[],valueColumns:o?.columns.slice()??[]},c=Su(e),d={};for(let u of c)d[u.colId]=u;return()=>{let u=(R,P,D,O)=>{let A=P.map(O),_=D.map(O);if(se(A,_))return;let Y=new Set(P);for(let re of D)if(!Y.delete(re))Y.add(re);let V=[...Y];a.dispatchEvent({type:R,columns:V,column:V.length===1?V[0]:null,source:t})},h=(R)=>{let P=[];return r.forAllCols((D)=>{let O=d[D.colId];if(O&&R(O,D))P.push(D)}),P},g=(R)=>R.colId;u("columnRowGroupChanged",l.rowGroupColumns,s?.columns??[],g),u("columnPivotChanged",l.pivotColumns,i?.columns??[],g);let f=h((R,P)=>{let D=R.aggFunc!=null,O=D!=P.isValueActive(),A=D&&R.aggFunc!=P.getAggFunc();return O||A});if(f.length>0)fp(a,"columnValueChanged",f,t);Ki(a,h((R,P)=>R.width!=P.getActualWidth()),!0,t),pp(a,h((R,P)=>R.pinned!=P.getPinned()),t),zy(a,h((R,P)=>R.hide==P.isVisible()),t);let S=h((R,P)=>!zr(P.getSortDef(),{type:At(R.sortType),direction:An(R.sort)})||R.sortIndex!=P.getSortIndex());if(S.length>0)n?.dispatchSortChangedEvents(t,S);let x=Su(e);h0(c,x,t,r,a)}}function Su(e){let{colModel:t,rowGroupColsSvc:s,pivotColsSvc:i}=e,o=t.getColDefCols();if(q(o)||!t.isAlive())return[];let r=s?.columns,n=i?.columns,a=[],l=(d)=>{let u=d.isRowGroupActive()&&r?r.indexOf(d):null,h=d.isPivotActive()&&n?n.indexOf(d):null,g=d.isValueActive()?d.getAggFunc():null,p=d.getSortIndex()!=null?d.getSortIndex():null;a.push({colId:d.colId,width:d.getActualWidth(),hide:!d.isVisible(),pinned:d.getPinned(),sort:d.getSort(),sortType:d.getSortDef()?.type,sortIndex:p,aggFunc:g,rowGroup:d.isRowGroupActive(),rowGroupIndex:u,pivot:d.isPivotActive(),pivotIndex:h,flex:d.getFlex()??null})};t.forAllCols((d)=>l(d));let c=new Map(t.getCols().map((d,u)=>[d.colId,u]));return a.sort((d,u)=>{let h=c.has(d.colId)?c.get(d.colId):-1,g=c.has(u.colId)?c.get(u.colId):-1;return h-g}),a}function wp(e){let t=(m,C)=>m!=null?m:C!=null?C:null,s=e.colDef,i=nt(t(s.sort,s.initialSort)),{direction:o,type:r}=i,n=t(s.sortIndex,s.initialSortIndex),a=t(s.hide,s.initialHide),l=t(s.pinned,s.initialPinned),c=t(s.width,s.initialWidth),d=t(s.flex,s.initialFlex),u=t(s.rowGroupIndex,s.initialRowGroupIndex),h=t(s.rowGroup,s.initialRowGroup);if(u==null&&!h)u=null,h=null;let g=t(s.pivotIndex,s.initialPivotIndex),p=t(s.pivot,s.initialPivot);if(g==null&&!p)g=null,p=null;let f=t(s.aggFunc,s.initialAggFunc);return{colId:e.colId,sort:o,sortType:r,sortIndex:n,hide:a,pinned:l,width:c,flex:d,rowGroup:h,rowGroupIndex:u,pivot:p,pivotIndex:g,aggFunc:f}}function d0(e,t,s){if(!e.applyOrder||!e.state)return;let i=[];for(let o of e.state)if(o.colId!=null)i.push(o.colId);u0(t.cols,i,t,s)}function u0(e,t,s,i){if(e==null)return;let o=[],r={};for(let a of t){if(r[a])continue;let l=e.map[a];if(l)o.push(l),r[a]=!0}let n=0;for(let a of e.list){let l=a.colId;if(r[l]!=null)continue;if(l.startsWith(hi))o.splice(n++,0,a);else o.push(a)}if(o=dp(o,i),!up(o,s.getColTree())){F(39);return}e.list=o}function h0(e,t,s,i,o){let r={};for(let d of t)r[d.colId]=d;let n={};for(let d of e)if(r[d.colId])n[d.colId]=!0;let a=e.filter((d)=>n[d.colId]),l=t.filter((d)=>n[d.colId]),c=[];if(l.forEach((d,u)=>{let h=a?.[u];if(h&&h.colId!==d.colId){let g=i.getCol(h.colId);if(g)c.push(g)}}),!c.length)return;o.dispatchEvent({type:"columnMoved",columns:c,column:c.length===1?c[0]:null,finished:!0,source:s})}var yu=(e,t,s,i)=>{let o=e[s.getId()],r=e[i.getId()],n=o!=null,a=r!=null;if(n&&a)return o-r;if(n)return-1;if(a)return 1;let l=t.indexOf(s),c=t.indexOf(i),d=l>=0,u=c>=0;if(d&&u)return l-c;if(d)return-1;return 1},g0=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(Ms(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",(e)=>this.setPivotMode(this.gos.get("pivotMode"),Ms(e.source)))}createColsFromColDefs(e){let{beans:t}=this,{valueCache:s,colAutosize:i,rowGroupColsSvc:o,pivotColsSvc:r,valueColsSvc:n,visibleCols:a,eventSvc:l,groupHierarchyColSvc:c}=t,d=this.colDefs?vp(t,e):void 0;s?.expire();let u=this.colDefCols?.list,h=this.colDefCols?.tree,g=sc(t,this.colDefs,!0,h,e);gt(t,this.colDefCols?.tree,g.columnTree);let{columnTree:p,treeDepth:f}=g,m=In(p),C={};for(let v of m)C[v.getId()]=v;if(this.colDefCols={tree:p,treeDepth:f,list:m,map:C},this.createColumnsForService([c],this.colDefCols,e),o?.extractCols(e,u),r?.extractCols(e,u),n?.extractCols(e,u),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,e),this.changeEventsDispatching=!1,a.refresh(e),l.dispatchEvent({type:"columnEverythingChanged",source:e}),d)this.changeEventsDispatching=!0,d(),this.changeEventsDispatching=!1;if(l.dispatchEvent({type:"newColumnsLoaded",source:e}),e==="gridInitializing")i?.applyAutosizeStrategy()}refreshCols(e,t){if(!this.colDefCols)return;let s=this.cols?.tree;this.saveColOrder();let{autoColSvc:i,selectionColSvc:o,rowNumbersSvc:r,quickFilter:n,pivotResultCols:a,showRowGroupCols:l,rowAutoHeight:c,visibleCols:d,colViewport:u,eventSvc:h,formula:g}=this.beans,p=this.selectCols(a,this.colDefCols);g?.setFormulasActive(p),this.createColumnsForService([i,o,r],p,t);let f=uw(this.gos,this.showingPivotResult);if(!e||f)this.restoreColOrder(p);if(this.positionLockedCols(p),l?.refresh(),n?.refreshCols(),this.setColSpanActive(),c?.setAutoHeightActive(p),d.clear(),u.clear(),!se(s,this.cols.tree))h.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,s){for(let i of e){if(!i)continue;i.createColumns(t,(o)=>{this.lastOrder=o(this.lastOrder),this.lastPivotOrder=o(this.lastPivotOrder)},s),i.addColumns(t)}}selectCols(e,t){let s=e?.getPivotResultCols()??null;this.showingPivotResult=s!=null;let{map:i,list:o,tree:r,treeDepth:n}=s??t;if(this.cols={list:o.slice(),map:{...i},tree:r.slice(),treeDepth:n},s){if(!s.list.some((l)=>this.cols?.map[l.colId]!==void 0))this.lastPivotOrder=null}return this.cols}getColsToShow(){if(!this.cols)return[];let{beans:e,showingPivotResult:t,cols:s}=this,{valueColsSvc:i,selectionColSvc:o,gos:r}=e,n=this.pivotMode&&!t,a=o?.isSelectionColumnEnabled(),l=hw(e),c=i?.columns,d=Zl(r);return s.list.filter((h)=>{let g=gi(h);if(n)return c?.includes(h)||g&&(!d||h.isVisible())||a&&Zt(h)||l&&Oe(h);else return g&&!d||h.isVisible()})}refreshAll(e){if(!this.ready)return;this.refreshCols(!1,e),this.beans.visibleCols.refresh(e)}setColsVisible(e,t=!1,s){Je(this.beans,{state:e.map((i)=>({colId:typeof i==="string"?i:i.colId,hide:!t}))},s)}restoreColOrder(e){let t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;let s=t.filter((u)=>e.map[u.getId()]!=null);if(s.length===0)return;if(s.length===e.list.length){e.list=s;return}let i=(u)=>{let h=u.getOriginalParent();if(!h)return!1;if(h.getChildren().length>1)return!0;return i(h)};if(!s.some((u)=>i(u))){let u=new Set(s);for(let h of e.list)if(!u.has(h))s.push(h);e.list=s;return}let o=new Map;for(let u=0;u<s.length;u++){let h=s[u];o.set(h,u)}let r=e.list.filter((u)=>!o.has(u));if(r.length===0){e.list=s;return}let n=(u,h)=>{let g=h?h.getOriginalParent():u.getOriginalParent();if(!g)return null;let p=null,f=null;for(let m of g.getChildren()){if(m===h||m===u)continue;if(m instanceof Ct){let C=o.get(m);if(C==null)continue;if(p==null||p<C)p=C,f=m;continue}m.forEachLeafColumn((C)=>{let v=o.get(C);if(v==null)return;if(p==null||p<v)p=v,f=C})}if(f==null)return n(u,g);return f},a=[],l=new Map;for(let u of r){let h=n(u,null);if(h==null){a.push(u);continue}let g=l.get(h);if(g===void 0)l.set(h,u);else if(Array.isArray(g))g.push(u);else l.set(h,[g,u])}let c=Array(e.list.length),d=c.length-1;for(let u=a.length-1;u>=0;u--)c[d--]=a[u];for(let u=s.length-1;u>=0;u--){let h=s[u],g=l.get(h);if(g)if(Array.isArray(g))for(let p=g.length-1;p>=0;p--){let f=g[p];c[d--]=f}else c[d--]=g;c[d--]=h}e.list=c}positionLockedCols(e){e.list=dp(e.list,this.gos)}saveColOrder(){if(this.showingPivotResult)this.lastPivotOrder=this.cols?.list??null;else 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)return;if(this.pivotMode=e,!this.ready)return;this.refreshCols(!1,t);let{visibleCols:s,eventSvc:i}=this.beans;s.refresh(t),i.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){let e=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!e?.length}recreateColumnDefs(e){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(e);let t=Ms(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){gt(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){let{pivotResultCols:t,autoColSvc:s,selectionColSvc:i,groupHierarchyColSvc:o}=this.beans;if(mo(this.colDefCols?.list,e))return;if(mo(s?.columns?.list,e))return;if(mo(i?.columns?.list,e))return;if(mo(o?.columns?.list,e))return;if(mo(t?.getPivotResultCols()?.list,e))return}getColsForKeys(e){if(!e)return[];return e.map((t)=>this.getCol(t)).filter((t)=>t!=null)}getColDefCol(e){return this.getColFromCollection(e,this.colDefCols)??this.getColFromServiceCols(e)}getColDefColOrCol(e){if(e==null)return null;return this.getColFromCollection(e,this.colDefCols)??this.getColFromCollection(e,this.cols)??this.getColFromServiceCols(e)}getColOrColDefCol(e){if(e==null)return null;return this.getColFromCollection(e,this.cols)??this.getColFromCollection(e,this.colDefCols)??this.getColFromServiceCols(e)}getCol(e){if(e==null)return null;return this.getColFromCollection(e,this.cols)??this.getColFromServiceCols(e)}getColById(e){return this.cols?.map[e]??null}getColFromCollection(e,t){if(t==null)return null;let s=t.map;if(typeof e=="string"&&s[e])return s[e];let i=t.list;for(let o=0,r=i.length;o<r;++o)if(jt(i[o],e))return i[o];return null}getColFromServiceCols(e){let t=this.beans;return t.autoColSvc?.getColumn(e)??t.selectionColSvc?.getColumn(e)??t.groupHierarchyColSvc?.getColumn(e)??null}};var p0=".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)}",f0=class extends Le{constructor(e,t,s){super(t,s);this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(p0)}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");let{labelSeparator:e,label:t,labelWidth:s,labelAlignment:i,disabled:o,labelEllipsis:r}=this.config;if(o!=null)this.setDisabled(o);if(e!=null)this.setLabelSeparator(e);if(t!=null)this.setLabel(t);if(s!=null)this.setLabelWidth(s);if(r!=null)this.setLabelEllipsis(r);this.setLabelAlignment(i||this.labelAlignment),this.refreshLabel()}refreshLabel(){let{label:e,eLabel:t}=this;if(te(t),typeof e==="string")t.innerText=e+this.labelSeparator;else if(e)t.appendChild(e);if(e==="")G(t,!1),ge(t,"presentation");else G(t,!0),ge(t,null)}setLabelSeparator(e){if(this.labelSeparator===e)return this;if(this.labelSeparator=e,this.label!=null)this.refreshLabel();return this}getLabelId(){let e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){if(this.label===e)return this;return this.label=e,this.refreshLabel(),this}setLabelAlignment(e){let s=this.getGui().classList;return s.toggle("ag-label-align-left",e==="left"),s.toggle("ag-label-align-right",e==="right"),s.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){if(this.label==null)return this;return Qr(this.eLabel,e),this}setDisabled(e){e=!!e;let t=this.getGui();return To(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},bp=class extends f0{constructor(e,t,s,i){super(e,t,s);this.className=i}postConstruct(){super.postConstruct();let{width:e,value:t,onValueChange:s,ariaLabel:i}=this.config;if(e!=null)this.setWidth(e);if(t!=null)this.setValue(t);if(s!=null)this.onValueChange(s);if(i!=null)this.setAriaLabel(i);if(this.className)this.addCss(this.className);this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){let e=this.getAriaElement(),t=this.getLabelId(),s=this.getLabel();if(s==null||s==""||bv(e)!==null)ri(e,"");else ri(e,t??"")}setAriaLabel(e){return fe(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 Kt(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){if(this.value===e)return this;if(this.previousValue=this.value,this.value=e,!t)this.dispatchLocalEvent({type:"fieldValueChanged"});return this}};function m0(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 Ai=class extends bp{constructor(e,t,s="text",i="input"){super(e,e?.template??m0(i),[],t);this.inputType=s,this.displayFieldTag=i,this.eLabel=E,this.eWrapper=E,this.eInput=E}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);let{eLabel:e,eWrapper:t,eInput:s,className:i}=this;e.classList.add(`${i}-label`),t.classList.add(`${i}-input-wrapper`),s.classList.add(`${i}-input`),this.addCss("ag-input-field"),s.id=s.id||`ag-${this.getCompId()}-input`;let{inputName:o,inputWidth:r,inputPlaceholder:n,autoComplete:a,tabIndex:l}=this.config;if(o!=null)this.setInputName(o);if(r!=null)this.setInputWidth(r);if(n!=null)this.setInputPlaceholder(n);if(a!=null)this.setAutoComplete(a);this.addInputListeners(),this.activateTabIndex([s],l)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:(e)=>this.setValue(e.target.value)})}setInputType(e){if(this.displayFieldTag==="input")this.inputType=e,Mt(this.eInput,"type",e)}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(e){return Qr(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){let t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return Mt(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return fe(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return To(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)Mt(this.eInput,"autocomplete",null);else{let t=typeof e==="string"?e:"off";Mt(this.eInput,"autocomplete",t)}return this}},Nn=class extends Ai{constructor(e,t="ag-checkbox",s="checkbox"){super(e,t,s);this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();let{readOnly:e,passive:t,name:s}=this.config;if(typeof e==="boolean")this.setReadOnly(e);if(typeof t==="boolean")this.setPassive(t);if(s!=null)this.setName(s)}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;let e=this.isSelected(),t=this.getNextValue();if(this.passive)this.dispatchChange(t,e);else this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){let 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;let s=this.eInput;if(s.checked=e,s.indeterminate=e===void 0,!t)this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,s){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:s});let i=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:i.id,name:i.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;let t=this.isSelected(),s=this.selected=e.target.checked;this.refreshSelectedClass(s),this.dispatchChange(s,t,e)}refreshSelectedClass(e){let t=this.eWrapper.classList;t.toggle("ag-checked",e===!0),t.toggle("ag-indeterminate",e==null)}},wt={selector:"AG-CHECKBOX",component:Nn},C0=".ag-checkbox-cell{height:100%}",v0={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},w0=class extends L{constructor(){super(v0,[wt]);this.eCheckbox=E,this.registerCSS(C0)}init(e){this.refresh(e);let{eCheckbox:t,beans:s}=this,i=t.getInputElement();i.setAttribute("tabindex","-1"),xh(i,"polite"),this.addManagedListeners(i,{click:(o)=>{if(Qe(o),t.isDisabled())return;let r=t.getValue();this.onCheckboxChanged(r)},dblclick:(o)=>{Qe(o)}}),this.addManagedElementListeners(e.eGridCell,{keydown:(o)=>{if(o.key===b.SPACE&&!t.isDisabled()){if(e.eGridCell===j(s))t.toggle();let r=t.getValue();this.onCheckboxChanged(r),o.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,s=!0,{value:i,column:o,node:r}=e;if(r.group&&o)if(typeof i==="boolean")t=i;else{let u=o.getColId();if(u.startsWith(hi))t=i==null||i===""?void 0:i==="true";else if(r.aggData?.[u]!==void 0)t=i??void 0;else if(r.sourceRowIndex>=0)t=i??void 0;else s=!1}else t=i??void 0;let{eCheckbox:n}=this;if(!s){n.setDisplayed(!1);return}n.setValue(t);let a=e.disabled??!o?.isCellEditable(r);n.setDisabled(a);let l=this.getLocaleTextFunc(),c=_l(l,t),d=a?c:`${l("ariaToggleCellValue","Press SPACE to toggle cell value")} (${c})`;n.setInputAriaLabel(d)}onCheckboxChanged(e){let{params:t}=this,{column:s,node:i,value:o}=t,{editSvc:r}=this.beans;if(!s)return;let n={rowNode:i,column:s};r?.dispatchCellEvent(n,null,"cellEditingStarted",{value:o});let a=i.setDataValue(s,e,"ui");if(r?.dispatchCellEvent(n,null,"cellEditingStopped",{oldValue:o,newValue:e,valueChanged:a}),!a)this.updateCheckbox(t)}},b0={tag:"div",cls:"ag-skeleton-container"},S0=class extends L{constructor(){super(b0)}init(e){let t=`ag-cell-skeleton-renderer-${this.getCompId()}`;if(this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>ri(e.eParentOfValue)),ri(e.eParentOfValue,t),e.deferRender)this.setupLoading(e);else if(e.node.failedLoad)this.setupFailed();else this.setupLoading(e)}setupFailed(){let e=this.getLocaleTextFunc();this.getGui().textContent=e("loadingError","ERR");let t=e("ariaSkeletonCellLoadingFailed","Row failed to load");fe(this.getGui(),t)}setupLoading(e){let t=ee({tag:"div",cls:"ag-skeleton-effect"}),s=e.node.rowIndex;if(s!=null){let r=75+25*(s%2===0?Math.sin(s):Math.cos(s));t.style.width=`${r}%`}this.getGui().appendChild(t);let i=this.getLocaleTextFunc(),o=e.deferRender?i("ariaDeferSkeletonCellLoading","Cell is loading"):i("ariaSkeletonCellLoading","Row data is loading");fe(this.getGui(),o)}refresh(e){return!1}},y0={moduleName:"CheckboxCellRenderer",version:z,userComponents:{agCheckboxCellRenderer:w0}},x0={moduleName:"SkeletonCellRenderer",version:z,userComponents:{agSkeletonCellRenderer:S0}};var R0=class extends y{constructor(){super(...arguments);this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(e={}){let t=e.source??"flex";if(e.viewportWidth!=null)this.flexViewportWidth=e.viewportWidth;let s=this.flexViewportWidth,{visibleCols:i,colDelayRenderSvc:o}=this.beans,r=i.centerCols,n=-1;if(e.resizingCols){let f=new Set(e.resizingCols);for(let m=r.length-1;m>=0;m--)if(f.has(r[m])){n=m;break}}let a=!1,l=r.map((f,m)=>{let C=f.getFlex(),v=C!=null&&C>0&&m>n;return a||(a=v),{col:f,isFlex:v,flex:Math.max(0,C??0),initialSize:f.getActualWidth(),min:f.getMinWidth(),max:f.getMaxWidth(),targetSize:0}});if(a)o?.hideColumns("colFlex"),this.columnsHidden=!0;else if(this.columnsHidden)this.revealColumns(o);if(!s||!a)return[];let c=l.length,d=l.reduce((f,m)=>f+m.flex,0),u=s,h=(f,m)=>{f.frozenSize=m,f.col.setActualWidth(m,t),u-=m,d-=f.flex,c-=1},g=(f)=>f.frozenSize!=null;for(let f of l)if(!f.isFlex)h(f,f.initialSize);while(c>0){let f=Math.round(d<1?u*d:u),m,C=0,v=0;for(let x of l){if(g(x))continue;m=x,v+=f*(x.flex/d);let R=v-C,P=Math.round(R);x.targetSize=P,C+=P}if(m)m.targetSize+=f-C;let w=0;for(let x of l){if(g(x))continue;let R=x.targetSize,P=Math.min(Math.max(R,x.min),x.max);w+=P-R,x.violationType=P===R?void 0:P<R?"max":"min",x.targetSize=P}let S=w===0?"all":w>0?"min":"max";for(let x of l){if(g(x))continue;if(S==="all"||x.violationType===S)h(x,x.targetSize)}}if(!e.skipSetLeft)i.setLeftValues(t);if(e.updateBodyWidths)i.updateBodyWidths();let p=l.filter((f)=>f.isFlex&&!f.violationType).map((f)=>f.col);if(e.fireResizedEvent){let f=l.filter((C)=>C.initialSize!==C.frozenSize).map((C)=>C.col),m=l.filter((C)=>C.flex).map((C)=>C.col);Ki(this.eventSvc,f,!0,t,m)}return this.revealColumns(o),p}revealColumns(e){if(this.columnsHidden)e?.revealColumns("colFlex"),this.columnsHidden=!1}initCol(e){let{flex:t,initialFlex:s}=e.colDef;if(t!==void 0)e.flex=t;else if(s!==void 0)e.flex=s}setColFlex(e,t){e.flex=t??null,e.dispatchStateUpdatedEvent("flex")}},Is=(e)=>{if(typeof e==="bigint")return e;let t;if(typeof e==="number")t=e;else if(typeof e==="string"){if(t=e.trim(),t==="")return null;if(t.endsWith("n"))t=t.slice(0,-1);if(!/^[+-]?\d+$/.test(t))return null}if(t==null)return null;try{return BigInt(t)}catch{return null}},Ac="T",F0=new RegExp(`[${Ac} ]`),E0=new RegExp(`^\\d{4}-\\d{2}-\\d{2}(${Ac}\\d{2}:\\d{2}:\\d{2}\\D?)?`);function Wt(e,t){return e.toString().padStart(t,"0")}function rs(e,t=!0,s=Ac){if(!e)return null;let i=[e.getFullYear(),e.getMonth()+1,e.getDate()].map((o)=>Wt(o,2)).join("-");if(t)i+=s+[e.getHours(),e.getMinutes(),e.getSeconds()].map((o)=>Wt(o,2)).join(":");return i}function Rs(e,t=!0){if(!e)return null;if(t)return[String(e.getFullYear()),String(e.getMonth()+1),Wt(e.getDate(),2),Wt(e.getHours(),2),`:${Wt(e.getMinutes(),2)}`,`:${Wt(e.getSeconds(),2)}`];return[e.getFullYear(),e.getMonth()+1,Wt(e.getDate(),2)].map(String)}var ja=(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"},Vo=["January","February","March","April","May","June","July","August","September","October","November","December"],qa=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function P0(e,t){if(t==null)return rs(e,!1);let s=Wt(e.getFullYear(),4),i={YYYY:()=>s.slice(s.length-4,s.length),YY:()=>s.slice(s.length-2,s.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>Vo[e.getMonth()],MMM:()=>Vo[e.getMonth()].slice(0,3),MM:()=>Wt(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${ja(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${ja(e.getDate())}`,DD:()=>Wt(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>qa[e.getDay()],ddd:()=>qa[e.getDay()].slice(0,3),dd:()=>qa[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${ja(e.getDay())}`,d:()=>`${e.getDay()}`},o=new RegExp(Object.keys(i).join("|"),"g");return t.replace(o,(r)=>{if(r in i)return i[r]();return r})}function Ur(e,t=!1){return!!He(e,t)}function M0(e){return Ur(e,!0)}function He(e,t=!1,s){if(!e)return null;if(!s&&!E0.test(e))return null;let[i,o]=e.split(F0);if(!i)return null;let r=i.split("-").map((g)=>Number.parseInt(g,10));if(r.filter((g)=>!isNaN(g)).length!==3)return null;let[n,a,l]=r,c=new Date(n,a-1,l);if(c.getFullYear()!==n||c.getMonth()!==a-1||c.getDate()!==l)return null;if(!o&&t)return null;if(!o||o==="00:00:00")return c;let[d,u,h]=o.split(":").map((g)=>Number.parseInt(g,10));if(d>=0&&d<24)c.setHours(d);else if(t)return null;if(u>=0&&u<60)c.setMinutes(u);else if(t)return null;if(h>=0&&h<60)c.setSeconds(h);else if(t)return null;return c}function Fo(e,t){let s=t.split("."),i=e;for(let o=0;o<s.length;o++){if(i==null)return;i=i[s[o]]}return i}var T0=["dateTimeString","dateString","text","number","bigint","boolean","date"],D0=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}){if(e)return{cellEditor:"agTextCellEditor"};return{cellEditor:"agTextCellEditor",comparator:{default:L0,absolute:G0}}},boolean(){return{cellEditor:"agCheckboxCellEditor",cellRenderer:"agCheckboxCellRenderer",getFindText:()=>null,suppressKeyboardEvent:({node:e,event:t,column:s})=>t.key===b.SPACE&&s.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:s}){return{cellEditorParams:{useFormatter:!0},comparator:(i,o)=>{let r=t.getColDefCol(s),n=r?.colDef;if(!r||!n)return 0;let a=i==null?"":e({column:r,node:null,value:i}),l=o==null?"":e({column:r,node:null,value:o});if(a===l)return 0;return a>l?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(){let e=this.getDefaultDataTypes(),t={},s={},i=(d)=>(u)=>{let{column:h,node:g,value:p}=u,f=h.getColDef().valueFormatter;if(f===d.groupSafeValueFormatter)f=d.valueFormatter;return this.beans.valueSvc.formatValue(h,g,p,f)};for(let d of Object.keys(e)){let u=e[d],h={...u,groupSafeValueFormatter:Fu(u,this.gos)};t[d]=h,s[d]=i(h)}let o=this.gos.get("dataTypeDefinitions")??{},r={};for(let d of Object.keys(o)){let u=o[d],h=this.processDataTypeDefinition(u,o,[d],e);if(h){if(t[d]=h,u.dataTypeMatcher)r[d]=u.dataTypeMatcher;s[d]=i(h)}}let{valueParser:n,valueFormatter:a}=e.object,{valueParser:l,valueFormatter:c}=t.object;this.hasObjectValueParser=l!==n,this.hasObjectValueFormatter=c!==a,this.formatValueFuncs=s,this.dataTypeDefinitions=t,this.dataTypeMatchers=this.sortKeysInMatchers(r,e)}sortKeysInMatchers(e,t){let s={...e};for(let i of T0)delete s[i],s[i]=e[i]??t[i].dataTypeMatcher;return s}processDataTypeDefinition(e,t,s,i){let o,r=e.extendsDataType;if(e.columnTypes)this.isColumnTypeOverrideInDataTypeDefinitions=!0;if(e.extendsDataType===e.baseDataType){let n=i[r],a=t[r];if(n&&a)n=a;if(!Ru(e,n,r))return;o=xu(n,e)}else{if(s.includes(r)){F(44);return}let n=t[r];if(!Ru(e,n,r))return;let a=this.processDataTypeDefinition(n,t,[...s,r],i);if(!a)return;o=xu(a,e)}return{...o,groupSafeValueFormatter:Fu(o,this.gos)}}updateColDefAndGetColumnType(e,t,s){let{cellDataType:i}=t;if(i===void 0)i=e.cellDataType;let{field:o}=t;if(i==null||i===!0)i=this.canInferCellDataType(e,t)?this.inferCellDataType(o,s):!1;if(this.addFormulaCellEditorToColDef(e,t),!i){e.cellDataType=!1;return}let r=this.dataTypeDefinitions[i];if(!r){F(47,{cellDataType:i});return}if(e.cellDataType=i,r.groupSafeValueFormatter)e.valueFormatter=r.groupSafeValueFormatter;if(r.valueParser)e.valueParser=r.valueParser;if(!r.suppressDefaultProperties)this.setColDefPropertiesForBaseDataType(e,i,r,s);return r.columnTypes}addFormulaCellEditorToColDef(e,t){if(!(t.allowFormula??e.allowFormula)||t.cellEditor)return;e.cellEditor="agFormulaCellEditor"}addColumnListeners(e){if(!this.isPendingInference)return;let t=this.columnStateUpdatesPendingInference[e.colId];if(!t)return;let s=(i)=>{t.add(i.key)};e.__addEventListener("columnStateUpdated",s),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.__removeEventListener("columnStateUpdated",s))}canInferCellDataType(e,t){let{gos:s}=this;if(!J(s))return!1;let i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(Ya(t,i))return!1;let o=t.type===null?e.type:t.type;if(o){let r=s.get("columnTypes")??{};if(sn(o).some((a)=>{let l=r[a.trim()];return l&&Ya(l,i)}))return!1}return!Ya(e,i)}inferCellDataType(e,t){if(!e)return;let s,i=this.getInitialData();if(i)s=e.includes(".")&&!this.gos.get("suppressFieldDotNotation")?Fo(i,e):i[e];else this.initWaitForRowData(t);if(s==null)return;return Object.keys(this.dataTypeMatchers).find((r)=>this.dataTypeMatchers[r](s))??"object"}getInitialData(){let e=this.gos.get("rowData");if(e?.length)return e[0];else if(this.initialData)return this.initialData;else{let 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;let t=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:s,eventSvc:i}=this.beans;if(t&&s)s.shouldQueueResizeOperations=!0;let[o]=this.addManagedEventListeners({rowDataUpdateStarted:(r)=>{let{firstRowData:n}=r;if(!n)return;if(o?.(),this.isPendingInference=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t)s?.processResizeOperations();i.dispatchEvent({type:"dataTypesInferred"})}})}processColumnsPendingInference(e,t){this.initialData=e;let s=[];this.destroyColumnStateUpdateListeners();let i={},o={};for(let r of Object.keys(this.columnStateUpdatesPendingInference)){let n=this.columnStateUpdatesPendingInference[r],a=this.colModel.getCol(r);if(!a)continue;let l=a.colDef;if(!this.resetColDefIntoCol(a,"cellDataTypeInferred"))continue;let c=a.colDef;if(t&&c.type&&c.type!==l.type){let d=O0(a,n);if(d.rowGroup&&d.rowGroupIndex==null)i[r]=d;if(d.pivot&&d.pivotIndex==null)o[r]=d;s.push(d)}}if(t)s.push(...this.generateColumnStateForRowGroupAndPivotIndexes(i,o));if(s.length)Je(this.beans,{state:s},"cellDataTypeInferred");this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(e,t){let s={},{rowGroupColsSvc:i,pivotColsSvc:o}=this.beans;return i?.restoreColumnOrder(s,e),o?.restoreColumnOrder(s,t),Object.values(s)}resetColDefIntoCol(e,t){let s=e.getUserProvidedColDef();if(!s)return!1;let i=ns(this.beans,s,e.colId);return e.setColDef(i,s,t),!0}getDateStringTypeDefinition(e){let{dateString:t}=this.dataTypeDefinitions;if(!e)return t;return this.getDataTypeDefinition(e)??t}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDateIncludesTimeFlag(e){return e==="dateTime"||e==="dateTimeString"}getDataTypeDefinition(e){let t=e.colDef;if(!t.cellDataType)return;return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(t==null)return!0;let s=this.getDataTypeDefinition(e)?.dataTypeMatcher;if(!s)return!0;if(e.colDef.allowFormula&&this.beans.formula?.isFormula(t))return!0;return s(t)}validateColDef(e,t,s,i){if(e.cellDataType==="object"){let o=(l)=>l?.cellDataType==null||l?.cellDataType===!0,r=o(t)&&o(s),n=(l)=>F(48,{property:l,inferred:r,colId:i}),{object:a}=this.dataTypeDefinitions;if(e.valueFormatter===a.groupSafeValueFormatter&&!this.hasObjectValueFormatter)n("Formatter");if(e.editable&&e.valueParser===a.valueParser&&!this.hasObjectValueParser)n("Parser")}}postProcess(e){let t=e.cellDataType;if(!t||typeof t!=="string")return;let{dataTypeDefinitions:s,beans:i,formatValueFuncs:o}=this,r=s[t];if(!r)return;i.colFilter?.setColDefPropsForDataType(e,r,o[t])}getFormatValue(e){return this.formatValueFuncs[e]}isColPendingInference(e){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[e]}setColDefPropertiesForBaseDataType(e,t,s,i){let o=this.formatValueFuncs[t],r=this.columnDefinitionPropsPerDataType[s.baseDataType]({colDef:e,cellDataType:t,colModel:this.colModel,dataTypeDefinition:s,colId:i,formatValue:o,filterModuleBean:this.beans.filterManager});if(e.cellEditor==="agFormulaCellEditor"&&r.cellEditor!==e.cellEditor)r.cellEditor=e.cellEditor;Object.assign(e,r)}getDateObjectTypeDef(e){let t=this.getLocaleTextFunc(),s=this.getDateIncludesTimeFlag(e);return{baseDataType:e,valueParser:(i)=>He(i.newValue&&String(i.newValue)),valueFormatter:(i)=>{if(i.value==null)return"";if(!(i.value instanceof Date)||isNaN(i.value.getTime()))return t("invalidDate","Invalid Date");return rs(i.value,s)??""},dataTypeMatcher:(i)=>i instanceof Date}}getDateStringTypeDef(e){let t=this.getDateIncludesTimeFlag(e);return{baseDataType:e,dateParser:(s)=>He(s)??void 0,dateFormatter:(s)=>rs(s??null,t)??void 0,valueParser:(s)=>Ur(String(s.newValue))?s.newValue:null,valueFormatter:(s)=>Ur(String(s.value))?String(s.value):"",dataTypeMatcher:(s)=>typeof s==="string"&&Ur(s)}}getDefaultDataTypes(){let e=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:(t)=>t.newValue?.trim?.()===""?null:Number(t.newValue),valueFormatter:(t)=>{if(t.value==null)return"";if(typeof t.value!=="number"||isNaN(t.value))return e("invalidNumber","Invalid Number");return String(t.value)},dataTypeMatcher:(t)=>typeof t==="number"},bigint:{baseDataType:"bigint",valueParser:(t)=>{let{newValue:s}=t;if(s==null)return null;if(typeof s==="string"&&s.trim()==="")return null;return Is(s)},valueFormatter:(t)=>{if(t.value==null)return"";if(typeof t.value!=="bigint")return e("invalidBigInt","Invalid BigInt");return String(t.value)},dataTypeMatcher:(t)=>typeof t==="bigint"},text:{baseDataType:"text",valueParser:(t)=>t.newValue===""?null:je(t.newValue),dataTypeMatcher:(t)=>typeof t==="string"},boolean:{baseDataType:"boolean",valueParser:(t)=>{if(t.newValue==null)return t.newValue;return 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"&&M0(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:(t)=>je(t.value)??""}}}destroyColumnStateUpdateListeners(){for(let e of this.columnStateUpdateListenerDestroyFuncs)e();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}};function xu(e,t){let s={...e,...t};if(e.columnTypes&&t.columnTypes&&t.appendColumnTypes)s.columnTypes=[...sn(e.columnTypes),...sn(t.columnTypes)];return s}function Ru(e,t,s){if(!t)return F(45,{parentCellDataType:s}),!1;if(t.baseDataType!==e.baseDataType)return F(46),!1;return!0}var A0=(e)=>typeof e==="bigint"||typeof e==="number",I0=(e)=>e==="number"||e==="bigint";function Fu(e,t){if(!e.valueFormatter)return;return(s)=>{let{node:i,colDef:o,column:r,value:n}=s;if(i?.group){let a=(o.pivotValueColumn??r).getAggFunc();if(a){if(a==="first"||a==="last")return e.valueFormatter(s);let{baseDataType:l}=e;if(I0(l)&&a!=="count"){if(A0(n))return e.valueFormatter(s);if(n==null)return;if(typeof n==="object"){if(typeof n.toNumber==="function")return e.valueFormatter({...s,value:n.toNumber()});if("value"in n)return e.valueFormatter({...s,value:n.value})}}return}}else if(t.get("groupHideOpenParents")&&s.column.isRowGroupActive()){if(typeof s.value==="string"&&!e.dataTypeMatcher?.(s.value))return}return e.valueFormatter(s)}}function k0(e,t,s,i){if(!t[s])return!1;let o=e[s];if(o===null)return t[s]=!1,!1;else return i===void 0?!!o:o===i}function L0(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;let s=Is(e),i=Is(t);if(s!=null&&i!=null){if(s===i)return 0;return s>i?1:-1}return 0}function G0(e,t){if(e==null)return t==null?0:-1;if(t==null)return 1;let s=Eu(e),i=Eu(t);if(s!=null&&i!=null){if(s===i)return 0;return s>i?1:-1}return 0}function Eu(e){let t=Is(e);if(t==null)return null;return t<0n?-t:t}function Ya(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([s,i])=>k0(e,t,s,i))}function O0(e,t){let s=wp(e);for(let i of t)if(delete s[i],i==="rowGroup")delete s.rowGroupIndex;else if(i==="pivot")delete s.pivotIndex;return s}var B0={moduleName:"DataType",version:z,beans:[D0],dependsOn:[y0]},V0={moduleName:"ColumnFlex",version:z,beans:[R0]};var N0=class extends y{constructor(){super(...arguments);this.beanName="colNames"}getDisplayNameForColumn(e,t,s=!1){if(!e)return null;let i=this.getHeaderName(e.getColDef(),e,null,null,t),{aggColNameSvc:o}=this.beans;if(s&&o)return o.getHeaderName(e,i);return i}getDisplayNameForProvidedColumnGroup(e,t,s){let i=t?.getColGroupDef();if(i)return this.getHeaderName(i,null,e,t,s);return null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,s,i,o){let r=e.headerValueGetter;if(r){let n=I(this.gos,{colDef:e,column:t,columnGroup:s,providedColumnGroup:i,location:o});if(typeof r==="function")return r(n);else if(typeof r==="string")return this.beans.expressionSvc?.evaluate(r,n)??null;return""}else if(e.headerName!=null)return e.headerName;else if(e.field)return mv(e.field);return""}},_0=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,s=!1){let{visibleCols:i}=this,o=i.isBodyWidthDirty;if(e===this.scrollWidth&&t===this.scrollPosition&&!o)return;if(this.scrollWidth=e,this.scrollPosition=t,i.isBodyWidthDirty=!0,this.gos.get("enableRtl")){let n=i.bodyWidth;this.viewportLeft=n-t-e,this.viewportRight=n-t}else this.viewportLeft=t,this.viewportRight=e+t;if(this.colModel.ready)this.checkViewportColumns(s)}getColumnHeadersToRender(e){switch(e){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(e,t){let s;switch(e){case"left":s=this.rowsOfHeadersToRenderLeft[t];break;case"right":s=this.rowsOfHeadersToRenderRight[t];break;default:s=this.rowsOfHeadersToRenderCenter[t];break}return s??[]}extractViewportColumns(){let e=this.visibleCols.centerCols;if(this.isColumnVirtualisationSuppressed())this.colsWithinViewport=e,this.headerColsWithinViewport=e;else 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.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[],this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){if(e.isAutoHeaderHeight()||H0(e))return!0;return this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;let t=e.getLeft()||0,s=t+e.getActualWidth(),i=this.viewportLeft-200,o=this.viewportRight+200,r=t<i&&s<i,n=t>o&&s>o;return!r&&!n}getViewportColumns(){let{leftCols:e,rightCols:t}=this.visibleCols;return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.colModel.colSpanActive)return this.colsWithinViewport;let t=(r)=>{let n=r.getLeft();return M(n)&&n>this.viewportLeft},s=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:i}=this,o=i.centerCols;return i.getColsForRow(e,o,s,t)}checkViewportColumns(e=!1){if(this.extractViewport())this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}calculateHeaderRows(){let{leftCols:e,rightCols:t}=this.visibleCols;this.columnsToRenderLeft=e,this.columnsToRenderRight=t,this.columnsToRenderCenter=this.colsWithinViewport;let s=(i)=>{let o=new Set,r={};for(let n of i){let a=n.parent,l=n.isSpanHeaderHeight();while(a){if(o.has(a))break;if(l&&a.isPadding()){a=a.parent;continue}let d=a.getProvidedColumnGroup().getLevel();r[d]??(r[d]=[]),r[d].push(a),o.add(a),a=a.parent}}return r};this.rowsOfHeadersToRenderLeft=s(e),this.rowsOfHeadersToRenderRight=s(t),this.rowsOfHeadersToRenderCenter=s(this.headerColsWithinViewport)}extractViewport(){let e=(i)=>`${i.getId()}-${i.getPinned()||"normal"}`;this.extractViewportColumns();let t=this.getViewportColumns().map(e).join("#"),s=this.colsWithinViewportHash!==t;if(s)this.colsWithinViewportHash=t,this.calculateHeaderRows();return s}};function H0(e){while(e){if(e.isAutoHeaderHeight())return!0;e=e.parent}return!1}var z0=class extends y{constructor(){super(...arguments);this.beanName="agCompUtils"}adaptFunction(e,t){if(!e.cellRenderer)return null;class s{refresh(){return!1}getGui(){return this.eGui}init(i){let o=t(i),r=typeof o;if(r==="string"||r==="number"||r==="boolean"){this.eGui=zl("<span>"+o+"</span>");return}if(o==null){this.eGui=ee({tag:"span"});return}this.eGui=o}}return s}},W0={moduleName:"CellRendererFunction",version:z,beans:[z0]},U0=class extends xe{constructor(){super(...arguments);this.beanName="registry"}registerDynamicBeans(e){if(e){this.dynamicBeans??(this.dynamicBeans={});for(let t of Object.keys(e))this.dynamicBeans[t]=e[t]}}createDynamicBean(e,t,...s){if(!this.dynamicBeans)throw Error(this.getDynamicError(e,!0));let i=this.dynamicBeans[e];if(i==null){if(t)throw Error(this.getDynamicError(e,!1));return}return new i(...s)}};function K0(e){return typeof e==="object"&&!!e.getComp}var $0=class extends U0{constructor(){super(...arguments);this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){let e=this.gos.get("components");if(e!=null)for(let t of Object.keys(e))this.jsComps[t]=e[t]}registerModule(e){let{icons:t,userComponents:s,dynamicBeans:i,selectors:o}=e;if(s){let r=(n,a,l,c)=>{if(this.agGridDefaults[n]=a,l||c)this.agGridDefaultOverrides[n]={params:l,processParams:c}};for(let n of Object.keys(s)){let a=s[n];if(K0(a))a=a.getComp(this.beans);if(typeof a==="object"){let{classImp:l,params:c,processParams:d}=a;r(n,l,c,d)}else r(n,a)}}this.registerDynamicBeans(i);for(let r of o??[])this.selectors[r.selector]=r;if(t)for(let r of Object.keys(t))this.icons[r]=t[r]}getUserComponent(e,t){let s=(a,l,c,d)=>({componentFromFramework:l,component:a,params:c,processParams:d}),{frameworkOverrides:i}=this.beans,o=i.frameworkComponent(t,this.gos.get("components"));if(o!=null)return s(o,!0);let r=this.jsComps[t];if(r){let a=i.isFrameworkComponent(r);return s(r,a)}let n=this.agGridDefaults[t];if(n){let a=this.agGridDefaultOverrides[t];return s(n,!1,a?.params,a?.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){if(t)return ct(279,{name:e});return this.beans.validation?.missingDynamicBean(e)??ct(256)}},j0=23,q0=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(let e of this.readyCallbacks)e(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){let e=Object.values(this.params);this.ready=e.length===j0&&e.every((t)=>t?.isAlive()??!1)}whenReady(e,t){if(this.ready)t(this.params);else this.readyCallbacks.push(t);e.addDestroyFunc(()=>{let s=this.readyCallbacks.indexOf(t);if(s>=0)this.readyCallbacks.splice(s,1)})}register(e,t){if(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(){let{leftHeader:e,centerHeader:t,rightHeader:s}=this.params;return[e,s,t]}getHeaderRowContainerCtrl(e){let t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},Y0=':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-wrapper-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}',Ic=typeof window!=="object"||!window?.document?.fonts?.forEach,dn=!1,ci=(e,t,s,i,o,r,n=!1)=>{if(Ic||dn)return;let a=e;if(i)a=`@layer ${CSS.escape(i).replaceAll("\\.",".")} { ${e} }`;let l=Ut.map.get(t);if(!l)l=[],Ut.map.set(t,l);if(l.some((h)=>h.injectedCss===a))return;let c=document.createElement("style");if(r)c.setAttribute("nonce",r);c.dataset.agCss=s,c.dataset.agCssVersion=z,c.textContent=a;let d={rawCss:e,injectedCss:a,el:c,priority:o,isParams:n},u;for(let h of l){if(h.priority>o)break;u=h}if(u){u.el.after(c);let h=l.indexOf(u);l.splice(h+1,0,d)}else{if(t.nodeName==="STYLE")t.after(c);else t.insertBefore(c,t.querySelector(":not(title, meta)"));l.push(d)}},Sp=(e,t,s,i)=>{ci(Y0,e,"shared",t,0,s),i?.forEach((o,r)=>o.forEach((n)=>ci(n,e,r,t,0,s)))},X0=(e,t,s,i,o,r)=>{if(Ic||dn)return;let n=Ut.grids.get(e);if(!n)Ut.grids.set(e,{styleContainer:i,paramsCss:t});else n.paramsCss=t;if(wl(i),t&&s)ci(t,i,s,o,2,r,!0)},Z0=(e)=>{let t=Ut.grids.get(e)?.styleContainer;if(!t)return;if(Ut.grids.delete(e),Array.from(Ut.grids.values()).some((i)=>i.styleContainer===t))wl(t);else wl(t,!0),Ut.map.delete(t)},wl=(e,t=!1)=>{let s=new Set;for(let o of Ut.grids.values())if(o.styleContainer===e)s.add(o.paramsCss);let i=Ut.map.get(e)??[];for(let o=i.length-1;o>=0;o--)if(t||i[o].isParams&&!s.has(i[o].rawCss))i[o].el.remove(),i.splice(o,1)},yp=()=>{let e=globalThis.agStyleInjectionVersions??(globalThis.agStyleInjectionVersions=new Map),t=e.get(z);if(!t)t={map:new WeakMap,grids:new Map,paramsId:0},e.set(z,t);return t},Ut=yp(),ft=(e)=>new xp(e),ys="$default",Q0=0,xp=class{constructor({feature:e,params:t,modeParams:s={},css:i,cssImports:o}){this.feature=e,this.css=i,this.cssImports=o,this.modeParams={[ys]:{...s[ys]??{},...t??{}},...s}}use(e,t,s){let i=this._inject;if(i==null){let{css:o}=this;if(o){let r=`ag-theme-${this.feature??"part"}-${++Q0}`;if(typeof o==="function")o=o();o=`:where(.${r}) {
4
- ${o}
5
- }
6
- `;for(let n of this.cssImports??[])o=`@import url(${JSON.stringify(n)});
7
- ${o}`;i={css:o,class:r}}else i=!1;this._inject=i}if(i&&e)ci(i.css,e,i.class,t,1,s);return i?i.class:!1}},J0=(e)=>e.replace(/[A-Z]|\d+/g,(t)=>`-${t}`).toLowerCase(),kc=(e)=>`--ag-${J0(e)}`,Yt=(e)=>`var(${kc(e)})`,e1=(e,t,s)=>Math.max(t,Math.min(s,e)),t1=(e)=>{let t=new Map;return(s)=>{let i=s;if(!t.has(i))t.set(i,e(s));return t.get(i)}},Nt=(e)=>({ref:"accentColor",mix:e}),ot=(e)=>({ref:"foregroundColor",mix:e}),at=(e)=>({ref:"foregroundColor",mix:e,onto:"backgroundColor"}),s1=(e)=>({ref:"foregroundColor",mix:e,onto:"headerBackgroundColor"}),Ve={ref:"backgroundColor"},ei={ref:"foregroundColor"},_t={ref:"accentColor"},un={backgroundColor:"#fff",foregroundColor:"#181d1f",borderColor:ot(0.15),chromeBackgroundColor:at(0.02),browserColorScheme:"light"},Rp=()=>["-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue","sans-serif"],i1={...un,textColor:ei,accentColor:"#2196f3",invalidColor:"#e02525",fontFamily:Rp(),subtleTextColor:{ref:"textColor",mix:0.5},borderWidth:1,borderRadius:4,spacing:8,fontSize:14,fontWeight:"inherit",focusShadow:{spread:3,color:Nt(0.5)},focusErrorShadow:{spread:3,color:{ref:"invalidColor",onto:"backgroundColor",mix:0.5}},popupShadow:"0 0 16px #00000026",cardShadow:"0 1px 4px 1px #00000018",dropdownShadow:{ref:"cardShadow"},listItemHeight:{calc:"max(iconSize, dataFontSize) + widgetVerticalSpacing"},dragAndDropImageBackgroundColor:Ve,dragAndDropImageBorder:!0,dragAndDropImageNotAllowedBorder:{color:{ref:"invalidColor",onto:"dragAndDropImageBackgroundColor",mix:0.5}},dragAndDropImageShadow:{ref:"popupShadow"},iconSize:16,iconColor:"inherit",toggleButtonWidth:28,toggleButtonHeight:18,toggleButtonOnBackgroundColor:_t,toggleButtonOffBackgroundColor:at(0.3),toggleButtonSwitchBackgroundColor:Ve,toggleButtonSwitchInset:2,tooltipBackgroundColor:{ref:"chromeBackgroundColor"},tooltipErrorBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:0.1},tooltipTextColor:{ref:"textColor"},tooltipErrorTextColor:{ref:"invalidColor"},tooltipBorder:!0,tooltipErrorBorder:{color:{ref:"invalidColor",onto:"backgroundColor",mix:0.25}},panelBackgroundColor:Ve,panelTitleBarHeight:{ref:"headerHeight"},panelTitleBarBackgroundColor:{ref:"headerBackgroundColor"},panelTitleBarIconColor:{ref:"headerTextColor"},panelTitleBarTextColor:{ref:"headerTextColor"},panelTitleBarFontFamily:{ref:"headerFontFamily"},panelTitleBarFontSize:{ref:"headerFontSize"},panelTitleBarFontWeight:{ref:"headerFontWeight"},panelTitleBarBorder:!0,dialogShadow:{ref:"popupShadow"},dialogBorder:{color:ot(0.2)},widgetContainerHorizontalPadding:{calc:"spacing * 1.5"},widgetContainerVerticalPadding:{calc:"spacing * 1.5"},widgetHorizontalSpacing:{calc:"spacing * 1.5"},widgetVerticalSpacing:{ref:"spacing"},dataFontSize:{ref:"fontSize"},headerBackgroundColor:{ref:"chromeBackgroundColor"},headerFontFamily:{ref:"fontFamily"},headerFontSize:{ref:"fontSize"},headerFontWeight:500,headerTextColor:{ref:"textColor"},headerHeight:{calc:"max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale"},headerVerticalPaddingScale:1,menuBorder:{color:ot(0.2)},menuBackgroundColor:at(0.03),menuTextColor:at(0.95),menuShadow:{ref:"popupShadow"},menuSeparatorColor:{ref:"borderColor"}},o1=["colorScheme","color","length","scale","borderStyle","border","shadow","image","fontFamily","fontWeight","duration"],r1=t1((e)=>(e=e.toLowerCase(),o1.find((t)=>e.endsWith(t.toLowerCase()))??"length")),_n=(e)=>{if(typeof e==="object"&&e?.ref)return Yt(e.ref);if(typeof e==="string")return e;if(typeof e==="number")return String(e);return!1},Lc=(e)=>{if(typeof e==="string")return e;if(typeof e==="object"&&e&&"ref"in e){let t=Yt(e.ref);if(e.mix==null)return t;return`color-mix(in srgb, ${e.onto?Yt(e.onto):"transparent"}, ${t} ${e1(e.mix*100,0,100)}%)`}return!1},n1=_n,Ii=(e)=>{if(typeof e==="string")return e;if(typeof e==="number")return`${e}px`;if(typeof e==="object"&&e&&"calc"in e)return`calc(${e.calc.replace(/ ?[*/+] ?/g," $& ").replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi,(s)=>s[0]==="-"?s:" "+Yt(s)+" ")})`;if(typeof e==="object"&&e&&"ref"in e)return Yt(e.ref);return!1},a1=_n,bl=(e,t)=>{if(typeof e==="string")return e;if(e===!0)return bl({},t);if(e===!1)return t==="columnBorder"?bl({color:"transparent"},t):"none";if(typeof e==="object"&&e&&"ref"in e)return Yt(e.ref);return Fp(e.style??"solid")+" "+Ii(e.width??{ref:"borderWidth"})+" "+Lc(e.color??{ref:"borderColor"})},Pu=(e)=>[Ii(e.offsetX??0),Ii(e.offsetY??0),Ii(e.radius??0),Ii(e.spread??0),Lc(e.color??{ref:"foregroundColor"}),...e.inset?["inset"]:[]].join(" "),l1=(e)=>{if(typeof e==="string")return e;if(e===!1)return"none";if(typeof e==="object"&&e&&"ref"in e)return Yt(e.ref);if(Array.isArray(e))return e.map(Pu).join(", ");return Pu(e)},Fp=_n,Ep=(e)=>{if(typeof e==="string")return e.includes(",")?e:Mu(e);if(typeof e==="object"&&e&&"googleFont"in e)return Ep(e.googleFont);if(typeof e==="object"&&e&&"ref"in e)return Yt(e.ref);if(Array.isArray(e))return e.map((t)=>{if(typeof t==="object"&&"googleFont"in t)t=t.googleFont;return Mu(t)}).join(", ");return!1},Mu=(e)=>/^[\w-]+$|\w\(/.test(e)?e:JSON.stringify(e),c1=_n,Pp=(e)=>{if(typeof e==="string")return e;if(typeof e==="object"&&e&&"url"in e)return`url(${JSON.stringify(e.url)})`;if(typeof e==="object"&&e&&"svg"in e)return Pp({url:`data:image/svg+xml,${encodeURIComponent(e.svg)}`});if(typeof e==="object"&&e&&"ref"in e)return Yt(e.ref);return!1},d1=(e,t,s)=>{if(typeof e==="string")return e;if(typeof e==="number"){if(e>=10)s?.warn(104,{value:e,param:t});return`${e}s`}if(typeof e==="object"&&e&&"ref"in e)return Yt(e.ref);return!1},u1={color:Lc,colorScheme:n1,length:Ii,scale:a1,border:bl,borderStyle:Fp,shadow:l1,image:Pp,fontFamily:Ep,fontWeight:c1,duration:d1},h1=(e,t,s)=>{let i=r1(e);return u1[i](t,e,s)};var g1=(e,t)=>new Mp({themeLogger:e,overridePrefix:t}),Mp=class e{constructor(t,s=[]){this.params=t,this.parts=s}withPart(t){if(typeof t==="function")t=t();if(!(t instanceof xp))return this.params.themeLogger.preInitErr(259,"Invalid part",{part:t}),this;return new e(this.params,[...this.parts,t])}withoutPart(t){return this.withPart(ft({feature:t}))}withParams(t,s=ys){return this.withPart(ft({modeParams:{[s]:t}}))}_startUse({styleContainer:t,cssLayer:s,nonce:i,loadThemeGoogleFonts:o,moduleCss:r}){if(Ic)return;if(dn)return;f1(),Sp(t,s,i,r);let n=p1(this);if(n.length>0){for(let a of n)if(o)m1(a,i)}for(let a of this.parts)a.use(t,s,i)}_getCssClass(){if(dn)return"ag-theme-quartz";return this._cssClassCache??(this._cssClassCache=Tu(this.parts).map((t)=>t.use(void 0,void 0,void 0)).filter(Boolean).concat(this._getParamsClassName()).join(" "))}_getParamsClassName(){return this._paramsClassName??(this._paramsClassName=`ag-theme-params-${++yp().paramsId}`)}_getModeParams(){let t=this._paramsCache;if(!t){let s={[ys]:{...i1}};for(let i of Tu(this.parts))for(let o of Object.keys(i.modeParams)){let r=i.modeParams[o];if(r){let n=s[o]??(s[o]={}),a=new Set;for(let l of Object.keys(r)){let c=r[l];if(c!==void 0)n[l]=c,a.add(l)}if(o===ys)for(let l of Object.keys(s)){let c=s[l];if(l!==ys)for(let d of a)delete c[d]}}}this._paramsCache=t=s}return t}_getParamsCss(){if(!this._paramsCssCache){let t="",s="",i=this._getModeParams(),{overridePrefix:o,themeLogger:r}=this.params,n=o?`--ag-${o}-`:void 0;for(let c of Object.keys(i)){let d=i[c];if(c!==ys){let h=`:where([data-ag-theme-mode="${typeof CSS==="object"?CSS.escape(c):c}"]) & {
8
- `;t+=h,s+=h}for(let u of Object.keys(d).sort()){let h=d[u],g=h1(u,h,r);if(g===!1)r.error(107,{key:u,value:h});else{let p=kc(u),f=n?p.replace("--ag-",n):p,m=p.replace("--ag-","--ag-inherited-");t+=` ${p}: var(${m}, ${g});
9
- `,s+=` ${m}: var(${f});
10
- `}}if(c!==ys)t+=`}
11
- `,s+=`}
12
- `}let a=`:where(.${this._getParamsClassName()})`,l=`${a} {
13
- ${t}}
14
- `;l+=`:has(> ${a}):not(${a}) {
15
- ${s}}
16
- `,this._paramsCssCache=l}return this._paramsCssCache}},Tu=(e)=>{let t=new Map;for(let i of e)t.set(i.feature,i);let s=[];for(let i of e)if(!i.feature||t.get(i.feature)===i)s.push(i);return s},p1=(e)=>{let t=new Set,s=(r)=>{if(Array.isArray(r))r.forEach(s);else{let n=r?.googleFont;if(typeof n==="string")t.add(n)}};return Object.values(e._getModeParams()).flatMap((r)=>Object.values(r)).forEach(s),Array.from(t).sort()},Du=!1,f1=()=>{if(Du)return;Du=!0;for(let e of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]')))e.remove()},m1=async(e,t)=>{let s=`@import url('https://${C1}/css2?family=${encodeURIComponent(e)}:wght@100;200;300;400;500;600;700;800;900&display=swap');
17
- `;ci(s,document.head,`googleFont:${e}`,void 0,0,t)},C1="fonts.googleapis.com",Au={changeKey:"listItemHeight",type:"length",defaultValue:24},v1=class extends xe{constructor(){super(...arguments);this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.sizesMeasured=!1,this.globalCSS=[]}wireBeans(e){this.eRootDiv=e.eRootDiv}postConstruct(){let{gos:e,eRootDiv:t}=this;e.setInstanceDomData(t);let s=e.get("themeStyleContainer"),i=typeof ShadowRoot<"u",o=i&&t.getRootNode()instanceof ShadowRoot;if(this.eStyleContainer=(typeof s==="function"?s():s)??(o?t:document.head),!s&&!o&&i)w1(t,this.shadowRootError.bind(this),this.addDestroyFunc.bind(this));this.cssLayer=e.get("themeCssLayer"),this.styleNonce=e.get("styleNonce"),this.addManagedPropertyListener("theme",()=>this.handleThemeChange()),this.handleThemeChange(),this.getSizeEl(Au),this.initVariables(),this.addDestroyFunc(()=>Z0(this)),this.mutationObserver=new MutationObserver(()=>{this.fireStylesChangedEvent("theme")}),this.addDestroyFunc(()=>this.mutationObserver.disconnect())}applyThemeClasses(e,t=[]){let{theme:s}=this,i=s?s._getCssClass():this.applyLegacyThemeClasses();for(let o of Array.from(e.classList))if(o.startsWith("ag-theme-"))e.classList.remove(o);if(i){let o=e.className;e.className=`${o}${o?" ":""}${i}${t?.length?" "+t.join(" "):""}`}}applyLegacyThemeClasses(){let e="";this.mutationObserver.disconnect();let t=this.eRootDiv;while(t){let s=!1;for(let i of Array.from(t.classList))if(i.startsWith("ag-theme-"))s=!0,e=e?`${e} ${i}`:i;if(s)this.mutationObserver.observe(t,{attributes:!0,attributeFilter:["class"]});t=t.parentElement}return e}addGlobalCSS(e,t){if(this.theme)ci(e,this.eStyleContainer,t,this.cssLayer,0,this.styleNonce);else this.globalCSS.push([e,t])}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(Au)}getCSSVariablePixelValue(e){let t=this.lastKnownValues.get(e);if(t!=null)return t;let s=this.measureSizeEl(e);if(s==="detached"||s==="no-styles"){if(e.cacheDefault)this.lastKnownValues.set(e,e.defaultValue);return e.defaultValue}return this.lastKnownValues.set(e,s),s}measureSizeEl(e){let t=this.getSizeEl(e);if(t.offsetParent==null)return"detached";let s=t.offsetWidth;if(s===Xa)return"no-styles";return this.sizesMeasured=!0,s}getMeasurementContainer(){let e=this.eMeasurementContainer;if(!e)e=this.eMeasurementContainer=me({tag:"div",cls:"ag-measurement-container"}),this.eRootDiv.appendChild(e);return e}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;let s=this.getMeasurementContainer();t=me({tag:"div"});let i=this.setSizeElStyles(t,e);s.appendChild(t),this.sizeEls.set(e,t);let{type:o,noWarn:r}=e;if(o!=="length"&&o!=="border")return t;let n=this.measureSizeEl(e);if(n==="no-styles"&&!r)this.varError(i,e.defaultValue);let a=It(this.beans,t,()=>{let l=this.measureSizeEl(e);if(l==="detached"||l==="no-styles")return;if(this.lastKnownValues.set(e,l),l!==n)n=l,this.fireStylesChangedEvent(e.changeKey)});return this.addDestroyFunc(()=>a()),t}setSizeElStyles(e,t){let{changeKey:s,type:i}=t,o=kc(s);if(i==="border"){if(o.endsWith("-width"))o=o.slice(0,-6);e.className="ag-measurement-element-border",e.style.setProperty("--ag-internal-measurement-border",`var(${o}, solid ${Xa}px)`)}else e.style.width=`var(${o}, ${Xa}px)`;return o}handleThemeChange(){let{gos:e,theme:t}=this,s=e.get("theme"),i;if(s==="legacy")i=void 0;else{let o=s??this.getDefaultTheme();if(o instanceof Mp)i=o;else this.themeError(o)}if(i!==t)this.handleNewTheme(i);this.postProcessThemeChange(i,s)}handleNewTheme(e){let{gos:t,eRootDiv:s,globalCSS:i}=this,o=this.getAdditionalCss();if(e){Sp(this.eStyleContainer,this.cssLayer,this.styleNonce,o);for(let[r,n]of i)ci(r,this.eStyleContainer,n,this.cssLayer,0,this.styleNonce);i.length=0}this.theme=e,e?._startUse({loadThemeGoogleFonts:t.get("loadThemeGoogleFonts"),styleContainer:this.eStyleContainer,cssLayer:this.cssLayer,nonce:this.styleNonce,moduleCss:o}),X0(this,e?._getParamsCss()??null,e?._getParamsClassName()??null,this.eStyleContainer,this.cssLayer,this.styleNonce),this.applyThemeClasses(s),this.fireStylesChangedEvent("theme")}fireStylesChangedEvent(e){this.eventSvc.dispatchEvent({type:"stylesChanged",[`${e}Changed`]:!0})}},Xa=15538,w1=(e,t,s)=>{let i=60,o=setInterval(()=>{if(typeof ShadowRoot<"u"&&e.getRootNode()instanceof ShadowRoot)t(),clearInterval(o);if(e.isConnected||--i<0)clearInterval(o)},1000);s(()=>clearInterval(o))},b1=".ag-aria-description-container{border:0;clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;z-index:9999}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-spanning-container{position:absolute;top:0;z-index:1}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-body-viewport::-webkit-scrollbar,.ag-center-cols-viewport::-webkit-scrollbar,.ag-floating-bottom-viewport::-webkit-scrollbar,.ag-floating-top-viewport::-webkit-scrollbar,.ag-header-viewport::-webkit-scrollbar,.ag-sticky-bottom-viewport::-webkit-scrollbar,.ag-sticky-top-viewport::-webkit-scrollbar{display:none!important}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-floating-bottom-container,.ag-floating-top-container,.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-left-sticky-bottom,.ag-pinned-right-cols-container,.ag-pinned-right-sticky-bottom,.ag-sticky-bottom-container,.ag-sticky-top-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-active),&:where(.ag-scrollbar-scrolling){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{overflow-wrap:break-word;white-space:normal}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-top:not(.ag-invisible)){border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-bottom:not(.ag-invisible)){border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-data-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%;z-index:1}.ag-sticky-bottom{box-sizing:content-box!important;:where(.ag-pinned-left-sticky-bottom),:where(.ag-pinned-right-sticky-bottom),:where(.ag-sticky-bottom-container){border-top:var(--ag-row-border);box-sizing:border-box}}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;:where(.ag-column-group-closed-icon),:where(.ag-column-group-opened-icon){cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-cell-font-size);font-weight:var(--ag-cell-font-weight);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{background-color:var(--ag-data-background-color);border-bottom:var(--ag-row-border);height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}.ag-drag-handle-disabled{opacity:.35;pointer-events:none}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after,.ag-row-highlight-inside:after{background-color:var(--ag-row-drag-indicator-color);border-radius:calc(var(--ag-row-drag-indicator-width)/2);content:\"\";height:var(--ag-row-drag-indicator-width);pointer-events:none;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after,:where(.ag-ltr) .ag-row-highlight-inside:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after,:where(.ag-rtl) .ag-row-highlight-inside:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-highlight-indent:after{display:block;width:auto}:where(.ag-ltr) .ag-row-highlight-indent:after{left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size));right:1px}:where(.ag-rtl) .ag-row-highlight-indent:after{left:1px;right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside:after{background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);display:block;height:auto;inset:0;width:auto}.ag-body,.ag-floating-bottom,.ag-floating-top{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:\"\";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-viewport{min-height:150px}}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label,:where(.ag-header-group-cell-selectable) .ag-header-cell-comp-wrapper{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden)),:where(.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:\"<color>\";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:\"<color>\";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)):before,.ag-header-group-cell:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:\"\";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}.ag-header-cell:where(:not(.ag-floating-filter)):where(:hover):before,.ag-header-group-cell:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}.ag-header-cell:where(:not(.ag-floating-filter)):where(.ag-header-cell-moving):before,.ag-header-group-cell:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}:where(.ag-header-cell:not(.ag-floating-filter)>*,.ag-header-group-cell>*){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{overflow-wrap:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:\"\";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-column-drag-indicator-color);border-radius:calc(var(--ag-column-drag-indicator-width)/2);content:\"\";height:100%;position:absolute;top:0;width:var(--ag-column-drag-indicator-width)}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2}:where(.ag-ltr) .ag-header-cell-resize{right:-3px}:where(.ag-rtl) .ag-header-cell-resize{left:-3px}.ag-header-cell-resize:after{background-color:var(--ag-header-column-resize-handle-color);content:\"\";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}:where(.ag-ltr) .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-rtl) .ag-header-cell-resize:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{container-type:normal;display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{container-type:normal;display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{content-visibility:auto;height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color)}.ag-chart-menu-icon:hover,.ag-chart-settings-next:hover,.ag-chart-settings-prev:hover,.ag-column-group-icons:hover,.ag-column-select-header-icon:hover,.ag-filter-toolpanel-expand:hover,.ag-floating-filter-button-button:hover,.ag-group-title-bar-icon:hover,.ag-header-cell-filter-button:hover,.ag-header-cell-menu-button:hover,.ag-header-expand-icon:hover,.ag-panel-title-bar-button-icon:hover,.ag-panel-title-bar-button:hover,.ag-set-filter-group-icons:hover,:where(.ag-group-contracted) .ag-icon:hover,:where(.ag-group-expanded) .ag-icon:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}:where(.ag-filter-active),:where(.ag-filter-toolpanel-group-instance-header-icon),:where(.ag-filter-toolpanel-instance-header-icon){position:relative}:where(.ag-filter-active):after,:where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-filter-toolpanel-instance-header-icon):after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:\"\";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-ltr) :where(.ag-filter-active):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-instance-header-icon):after{right:-1px}:where(.ag-rtl) :where(.ag-filter-active):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-instance-header-icon):after{left:-1px}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);:where(.ag-icon-filter){clip-path:path(\"M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z\");color:var(--ag-icon-button-active-color)}}",S1={wrapperBorder:!0,rowBorder:!0,headerRowBorder:!0,footerRowBorder:{ref:"rowBorder"},columnBorder:{style:"solid",width:1,color:"transparent"},headerColumnBorder:!1,headerColumnBorderHeight:"100%",pinnedColumnBorder:!0,pinnedRowBorder:!0,sidePanelBorder:!0,sideBarPanelWidth:250,sideBarPanelAnimationDuration:0,sideBarBackgroundColor:{ref:"chromeBackgroundColor"},sideButtonBarBackgroundColor:{ref:"sideBarBackgroundColor"},sideButtonBarTopPadding:0,sideButtonSelectedUnderlineWidth:2,sideButtonSelectedUnderlineColor:"transparent",sideButtonSelectedUnderlineTransitionDuration:0,sideButtonBackgroundColor:"transparent",sideButtonTextColor:{ref:"textColor"},sideButtonHoverBackgroundColor:{ref:"sideButtonBackgroundColor"},sideButtonHoverTextColor:{ref:"sideButtonTextColor"},sideButtonSelectedBackgroundColor:Ve,sideButtonSelectedTextColor:{ref:"sideButtonTextColor"},sideButtonBorder:"solid 1px transparent",sideButtonSelectedBorder:!0,sideButtonLeftPadding:{ref:"spacing"},sideButtonRightPadding:{ref:"spacing"},sideButtonVerticalPadding:{calc:"spacing * 3"},cellFontFamily:{ref:"fontFamily"},cellFontSize:{ref:"dataFontSize"},cellFontWeight:{ref:"fontWeight"},headerCellHoverBackgroundColor:"transparent",headerCellMovingBackgroundColor:{ref:"headerCellHoverBackgroundColor"},headerCellBackgroundTransitionDuration:"0.2s",cellTextColor:{ref:"textColor"},rangeSelectionBorderStyle:"solid",rangeSelectionBorderColor:_t,rangeSelectionBackgroundColor:Nt(0.2),rangeSelectionChartBackgroundColor:"#0058FF1A",rangeSelectionChartCategoryBackgroundColor:"#00FF841A",rangeSelectionHighlightColor:Nt(0.5),rangeHeaderHighlightColor:s1(0.08),rowNumbersSelectedColor:Nt(0.5),rowHoverColor:Nt(0.08),columnHoverColor:Nt(0.05),selectedRowBackgroundColor:Nt(0.12),modalOverlayBackgroundColor:{ref:"backgroundColor",mix:0.66},dataBackgroundColor:Ve,oddRowBackgroundColor:{ref:"dataBackgroundColor"},wrapperBackgroundColor:Ve,wrapperBorderRadius:8,cellHorizontalPadding:{calc:"spacing * 2 * cellHorizontalPaddingScale"},cellWidgetSpacing:{calc:"spacing * 1.5"},cellHorizontalPaddingScale:1,rowGroupIndentSize:{calc:"cellWidgetSpacing + iconSize"},valueChangeDeltaUpColor:"#43a047",valueChangeDeltaDownColor:"#e53935",valueChangeValueHighlightBackgroundColor:"#16a08580",rowHeight:{calc:"max(iconSize, cellFontSize) + spacing * 3.25 * rowVerticalPaddingScale"},rowVerticalPaddingScale:1,paginationPanelHeight:{ref:"rowHeight",calc:"max(rowHeight, 22px)"},dragHandleColor:ot(0.7),headerColumnResizeHandleHeight:"30%",headerColumnResizeHandleWidth:2,headerColumnResizeHandleColor:{ref:"borderColor"},iconButtonColor:{ref:"iconColor"},iconButtonBackgroundColor:"transparent",iconButtonBackgroundSpread:4,iconButtonBorderRadius:1,iconButtonHoverColor:{ref:"iconButtonColor"},iconButtonHoverBackgroundColor:ot(0.1),iconButtonActiveColor:_t,iconButtonActiveBackgroundColor:Nt(0.28),iconButtonActiveIndicatorColor:_t,setFilterIndentSize:{ref:"iconSize"},chartMenuPanelWidth:260,chartMenuLabelColor:ot(0.8),cellEditingBorder:{color:_t},cellEditingShadow:{ref:"cardShadow"},fullRowEditInvalidBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:0.25},columnSelectIndentSize:{ref:"iconSize"},toolbarBackgroundColor:{ref:"headerBackgroundColor"},toolbarTextColor:{ref:"headerTextColor"},toolbarSeparatorBorder:!0,toolPanelSeparatorBorder:!0,columnDropCellBackgroundColor:ot(0.07),columnDropCellTextColor:{ref:"textColor"},columnDropCellDragHandleColor:{ref:"textColor"},columnDropCellBorder:{color:ot(0.13)},selectCellBackgroundColor:ot(0.07),selectCellBorder:{color:ot(0.13)},advancedFilterBuilderButtonBarBorder:!0,advancedFilterBuilderIndentSize:{calc:"spacing * 2 + iconSize"},advancedFilterBuilderJoinPillColor:"#f08e8d",advancedFilterBuilderColumnPillColor:"#a6e194",advancedFilterBuilderOptionPillColor:"#f3c08b",advancedFilterBuilderValuePillColor:"#85c0e4",filterPanelApplyButtonColor:Ve,filterPanelApplyButtonBackgroundColor:_t,columnPanelApplyButtonColor:Ve,columnPanelApplyButtonBackgroundColor:_t,filterPanelCardSubtleColor:{ref:"textColor",mix:0.7},filterPanelCardSubtleHoverColor:{ref:"textColor"},findMatchColor:ei,findMatchBackgroundColor:"#ffff00",findActiveMatchColor:ei,findActiveMatchBackgroundColor:"#ffa500",filterToolPanelGroupIndent:{ref:"spacing"},rowLoadingSkeletonEffectColor:ot(0.15),statusBarLabelColor:ei,statusBarLabelFontWeight:500,statusBarValueColor:ei,statusBarValueFontWeight:500,pinnedSourceRowTextColor:{ref:"textColor"},pinnedSourceRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedSourceRowFontWeight:600,pinnedRowFontWeight:600,pinnedRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedRowTextColor:{ref:"textColor"},rowDragIndicatorColor:{ref:"rangeSelectionBorderColor"},rowDragIndicatorWidth:2,columnDragIndicatorColor:{ref:"accentColor"},columnDragIndicatorWidth:2},y1=".ag-cell-batch-edit{background-color:var(--ag-cell-batch-edit-background-color);color:var(--ag-cell-batch-edit-text-color);display:inherit}.ag-row-batch-edit{background-color:var(--ag-row-batch-edit-background-color);color:var(--ag-row-batch-edit-text-color)}",Tp={cellBatchEditBackgroundColor:"rgba(220 181 139 / 16%)",cellBatchEditTextColor:"#422f00",rowBatchEditBackgroundColor:{ref:"cellBatchEditBackgroundColor"},rowBatchEditTextColor:{ref:"cellBatchEditTextColor"}},x1={...Tp,cellBatchEditTextColor:"#f3d0b3"},R1=()=>ft({feature:"batchEditStyle",params:Tp,css:y1}),F1=R1(),E1=":where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:disabled{cursor:default}&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);cursor:pointer;font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding);&:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}&:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}}.ag-standard-button:hover{background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}",P1={buttonTextColor:"inherit",buttonFontWeight:"normal",buttonBackgroundColor:"transparent",buttonBorder:!1,buttonBorderRadius:{ref:"borderRadius"},buttonHorizontalPadding:{calc:"spacing * 2"},buttonVerticalPadding:{ref:"spacing"},buttonHoverTextColor:{ref:"buttonTextColor"},buttonHoverBackgroundColor:{ref:"buttonBackgroundColor"},buttonHoverBorder:{ref:"buttonBorder"},buttonActiveTextColor:{ref:"buttonHoverTextColor"},buttonActiveBackgroundColor:{ref:"buttonHoverBackgroundColor"},buttonActiveBorder:{ref:"buttonHoverBorder"},buttonDisabledTextColor:{ref:"inputDisabledTextColor"},buttonDisabledBackgroundColor:{ref:"inputDisabledBackgroundColor"},buttonDisabledBorder:{ref:"inputDisabledBorder"}};var M1=()=>ft({feature:"buttonStyle",params:{...P1,buttonBackgroundColor:Ve,buttonBorder:!0,buttonHoverBackgroundColor:{ref:"rowHoverColor"},buttonActiveBorder:{color:_t}},css:E1}),T1=M1();var D1=".ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}";var A1=()=>ft({feature:"columnDropStyle",css:D1}),Dp=A1();var I1={formulaToken1Color:"#3269c6",formulaToken1BackgroundColor:{ref:"formulaToken1Color",mix:0.08},formulaToken1Border:{color:{ref:"formulaToken1Color"}},formulaToken2Color:"#c0343f",formulaToken2BackgroundColor:{ref:"formulaToken2Color",mix:0.06},formulaToken2Border:{color:{ref:"formulaToken2Color"}},formulaToken3Color:"#8156b8",formulaToken3BackgroundColor:{ref:"formulaToken3Color",mix:0.08},formulaToken3Border:{color:{ref:"formulaToken3Color"}},formulaToken4Color:"#007c1f",formulaToken4BackgroundColor:{ref:"formulaToken4Color",mix:0.06},formulaToken4Border:{color:{ref:"formulaToken4Color"}},formulaToken5Color:"#b03e85",formulaToken5BackgroundColor:{ref:"formulaToken5Color",mix:0.08},formulaToken5Border:{color:{ref:"formulaToken5Color"}},formulaToken6Color:"#b74900",formulaToken6BackgroundColor:{ref:"formulaToken6Color",mix:0.06},formulaToken6Border:{color:{ref:"formulaToken6Color"}},formulaToken7Color:"#247492",formulaToken7BackgroundColor:{ref:"formulaToken7Color",mix:0.08},formulaToken7Border:{color:{ref:"formulaToken7Color"}}},k1=()=>ft({feature:"formulaStyle",params:I1}),L1=k1(),G1={noteIndicatorColor:{ref:"accentColor"},noteIndicatorSize:"8px",notePopupBackgroundColor:{ref:"menuBackgroundColor"},notePopupTextColor:{ref:"menuTextColor",mix:0.75},notePopupInputTextColor:{ref:"inputTextColor"},notePopupInputBackgroundColor:{ref:"inputBackgroundColor"},notePopupBorder:{ref:"dialogBorder"},notePopupPadding:{calc:"spacing * 0.5"}},O1=()=>ft({feature:"noteStyle",params:G1}),B1=O1(),V1={warn:(...e)=>{F(e[0],e[1])},error:(...e)=>{X(e[0],e[1])},preInitErr:(...e)=>{bo(e[0],e[2],e[1])}},N1=()=>g1(V1).withParams(S1).withPart(T1).withPart(Dp).withPart(F1).withPart(L1).withPart(B1),_1='.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color)}&:where(.ag-checked):after{background-color:var(--ag-checkbox-checked-shape-color)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input,.ag-radio-button-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}.ag-checkbox-input-wrapper:after,.ag-radio-button-input-wrapper:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}.ag-checkbox-input-wrapper:where(:focus-within,:active),.ag-radio-button-input-wrapper:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color)}&:where(.ag-indeterminate):after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}',H1=()=>ft({feature:"checkboxStyle",params:{checkboxBorderWidth:1,checkboxBorderRadius:{ref:"borderRadius"},checkboxUncheckedBackgroundColor:Ve,checkboxUncheckedBorderColor:at(0.3),checkboxCheckedBackgroundColor:_t,checkboxCheckedBorderColor:{ref:"checkboxCheckedBackgroundColor"},checkboxCheckedShapeImage:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="10" height="7" fill="none"><path stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.75" d="M1 3.5 3.5 6l5-5"/></svg>'},checkboxCheckedShapeColor:Ve,checkboxIndeterminateBackgroundColor:at(0.3),checkboxIndeterminateBorderColor:{ref:"checkboxIndeterminateBackgroundColor"},checkboxIndeterminateShapeImage:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="10" height="2" fill="none"><rect width="10" height="2" fill="#000" rx="1"/></svg>'},checkboxIndeterminateShapeColor:Ve,radioCheckedShapeImage:{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6" fill="none"><circle cx="3" cy="3" r="3" fill="#000"/></svg>'}},css:_1}),z1=H1();var Ap=()=>({...un,...x1,backgroundColor:"hsl(217, 0%, 17%)",foregroundColor:"#FFF",chromeBackgroundColor:at(0.05),rowHoverColor:Nt(0.15),selectedRowBackgroundColor:Nt(0.2),menuBackgroundColor:at(0.1),browserColorScheme:"dark",popupShadow:"0 0px 20px #000A",cardShadow:"0 1px 4px 1px #000A",advancedFilterBuilderJoinPillColor:"#7a3a37",advancedFilterBuilderColumnPillColor:"#355f2d",advancedFilterBuilderOptionPillColor:"#5a3168",advancedFilterBuilderValuePillColor:"#374c86",filterPanelApplyButtonColor:ei,columnPanelApplyButtonColor:ei,findMatchColor:Ve,findActiveMatchColor:Ve,checkboxUncheckedBorderColor:at(0.4),toggleButtonOffBackgroundColor:at(0.4),rowBatchEditBackgroundColor:at(0.1),formulaToken1Color:"#4da3e5",formulaToken2Color:"#f55864",formulaToken3Color:"#b688f2",formulaToken4Color:"#24bb4a",formulaToken5Color:"#e772ba",formulaToken6Color:"#f69b5f",formulaToken7Color:"#a3e6ff"});var W1=()=>({...Ap(),backgroundColor:"#1f2836"});var U1=()=>ft({feature:"colorScheme",params:un,modeParams:{light:un,dark:Ap(),"dark-blue":W1()}}),K1=U1();var Ip={aggregation:'<path d="M18 7V4H6l6 8-6 8h12v-3"/>',arrows:'<polyline points="5 9 2 12 5 15"/><polyline points="9 5 12 2 15 5"/><polyline points="15 19 12 22 9 19"/><polyline points="19 9 22 12 19 15"/><line x1="2" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="22"/>',asc:'<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',cancel:'<path d="m18 6-12 12"/><path d="m6 6 12 12"/>',chart:'<line x1="18" x2="18" y1="20" y2="10"/><line x1="12" x2="12" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="14"/>',"color-picker":'<path d="m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"/><path d="m5 2 5 5"/><path d="M2 13h15"/><path d="M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"/>',columns:'<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"/>',contracted:'<path d="m9 18 6-6-6-6"/>',copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',cross:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',csv:'<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/>',cut:'<circle cx="6" cy="6" r="3"/><path d="M8.12 8.12 12 12"/><path d="M20 4 8.12 15.88"/><circle cx="6" cy="18" r="3"/><path d="M14.8 14.8 20 20"/>',desc:'<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',down:'<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',excel:'<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/>',expanded:'<path d="m15 18-6-6 6-6"/>',eye:'<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>',"eye-slash":'<path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"/><line x1="2" x2="22" y1="2" y2="22"/>',filter:'<path d="M3 6h18"/><path d="M7 12h10"/><path d="M10 18h4"/>',first:'<path d="m17 18-6-6 6-6"/><path d="M7 6v12"/>',grip:'<circle cx="5" cy="8" r="0.5"/><circle cx="12" cy="8" r="0.5"/><circle cx="19" cy="8" r="0.5"/><circle cx="5" cy="16" r="0.5"/><circle cx="12" cy="16" r="0.5"/><circle cx="19" cy="16" r="0.5"/><g stroke="none" fill="currentColor"><circle cx="5" cy="8" r="1"/><circle cx="12" cy="8" r="1"/><circle cx="19" cy="8" r="1"/><circle cx="5" cy="16" r="1"/><circle cx="12" cy="16" r="1"/><circle cx="19" cy="16" r="1"/></g>',group:'<path d="M16 12H3"/><path d="M16 18H3"/><path d="M10 6H3"/><path d="M21 18V8a2 2 0 0 0-2-2h-5"/><path d="m16 8-2-2 2-2"/>',last:'<path d="m7 18 6-6-6-6"/><path d="M17 6v12"/>',left:'<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>',linked:'<path d="M9 17H7A5 5 0 0 1 7 7h2"/><path d="M15 7h2a5 5 0 1 1 0 10h-2"/><line x1="8" x2="16" y1="12" y2="12"/>',loading:'<line x1="12" x2="12" y1="2" y2="6"/><line x1="12" x2="12" y1="18" y2="22"/><line x1="4.93" x2="7.76" y1="4.93" y2="7.76"/><line x1="16.24" x2="19.07" y1="16.24" y2="19.07"/><line x1="2" x2="6" y1="12" y2="12"/><line x1="18" x2="22" y1="12" y2="12"/><line x1="4.93" x2="7.76" y1="19.07" y2="16.24"/><line x1="16.24" x2="19.07" y1="7.76" y2="4.93"/>',maximize:'<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/>',menu:'<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>',"menu-alt":'<circle cx="12" cy="5" r="0.75" fill="#D9D9D9"/><circle cx="12" cy="12" r="0.75" fill="#D9D9D9"/><circle cx="12" cy="19" r="0.75" fill="#D9D9D9"/>',minimize:'<polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="14" x2="21" y1="10" y2="3"/><line x1="3" x2="10" y1="21" y2="14"/>',minus:'<circle cx="12" cy="12" r="10"/><path d="M8 12h8"/>',next:'<path d="m9 18 6-6-6-6"/>',none:'<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>',"not-allowed":'<circle cx="12" cy="12" r="10"/><path d="m4.9 4.9 14.2 14.2"/>',paste:'<path d="M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10"/><path d="m17 10 4 4-4 4"/>',pin:'<line x1="12" x2="12" y1="17" y2="22"/><path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"/>',pivot:'<path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/>',plus:'<circle cx="12" cy="12" r="10"/><path d="M8 12h8"/><path d="M12 8v8"/>',previous:'<path d="m15 18-6-6 6-6"/>',right:'<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',save:'<path d="M12 17V3"/><path d="m6 11 6 6 6-6"/><path d="M19 21H5"/>',search:'<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',settings:'<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>',"small-left":'<path d="m15 18-6-6 6-6"/>',"small-right":'<path d="m9 18 6-6-6-6"/>',tick:'<path d="M20 6 9 17l-5-5"/>',"tree-closed":'<path d="m9 18 6-6-6-6"/>',"tree-indeterminate":'<path d="M5 12h14"/>',"tree-open":'<path d="m6 9 6 6 6-6"/>',unlinked:'<path d="M9 17H7A5 5 0 0 1 7 7"/><path d="M15 7h2a5 5 0 0 1 4 8"/><line x1="8" x2="12" y1="12" y2="12"/><line x1="2" x2="22" y1="2" y2="22"/>',up:'<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>'},kp={aasc:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13.2012 8.07928C13.6346 8.0793 14.0128 8.15365 14.3359 8.30193C14.6609 8.45018 14.9141 8.65595 15.0947 8.9201C15.2754 9.18439 15.3683 9.49109 15.374 9.83904H14.1904C14.1676 9.60898 14.0695 9.4303 13.8965 9.30291C13.7235 9.1756 13.4889 9.1115 13.1924 9.1115C12.9909 9.1115 12.8204 9.1404 12.6816 9.19744C12.543 9.25255 12.4364 9.32917 12.3623 9.42791C12.2901 9.52678 12.2539 9.63933 12.2539 9.76482C12.2501 9.8692 12.272 9.9604 12.3193 10.0383C12.3688 10.1162 12.4369 10.1843 12.5225 10.2414C12.6079 10.2964 12.7064 10.3451 12.8184 10.3869C12.9304 10.4268 13.0505 10.4609 13.1777 10.4894L13.7031 10.6144C13.9578 10.6715 14.1914 10.7479 14.4043 10.8429C14.6173 10.938 14.8021 11.0547 14.958 11.1935C15.1138 11.3323 15.2348 11.4957 15.3203 11.6838C15.4077 11.8719 15.4522 12.088 15.4541 12.3312C15.4522 12.6885 15.3611 12.9986 15.1807 13.2609C15.0019 13.5214 14.7427 13.7248 14.4043 13.8693C14.0678 14.0118 13.6617 14.0832 13.1865 14.0832C12.7153 14.0832 12.3048 14.0107 11.9551 13.8664C11.6071 13.7219 11.3345 13.5071 11.1387 13.2238C10.9449 12.9387 10.8435 12.5862 10.834 12.1662H12.0283C12.0416 12.362 12.0984 12.5252 12.1973 12.6564C12.298 12.7857 12.4323 12.8838 12.5996 12.9504C12.7688 13.0149 12.96 13.047 13.1729 13.047C13.3817 13.047 13.563 13.0169 13.7168 12.9562C13.8727 12.8954 13.9935 12.8106 14.0791 12.7023C14.1647 12.5939 14.208 12.469 14.208 12.3283C14.2079 12.1974 14.1686 12.0875 14.0908 11.9982C14.0148 11.9089 13.9022 11.8324 13.7539 11.7697C13.6076 11.707 13.4276 11.6501 13.2148 11.5988L12.5791 11.4387C12.0869 11.3189 11.6982 11.1318 11.4131 10.8771C11.128 10.6224 10.9855 10.2793 10.9873 9.84783C10.9854 9.49418 11.0804 9.18439 11.2705 8.9201C11.4625 8.65603 11.7261 8.45015 12.0605 8.30193C12.3951 8.15369 12.7754 8.07928 13.2012 8.07928Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5.8125 14.0002H4.48926L4.05664 12.6681H1.94824L1.51465 14.0002H0.19043L2.20703 8.15935H3.79883L5.8125 14.0002ZM2.26172 11.7043H3.74316L3.02539 9.49334H2.98047L2.26172 11.7043Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8.45215 8.15935C8.88165 8.15935 9.24031 8.22251 9.52734 8.34978C9.81445 8.47717 10.0303 8.65477 10.1748 8.88103C10.3192 9.10536 10.3916 9.36368 10.3916 9.65642C10.3916 9.88452 10.3461 10.085 10.2549 10.258C10.1637 10.4289 10.0384 10.5696 9.87891 10.6799C9.72117 10.7882 9.54024 10.8657 9.33691 10.9113V10.9679C9.55917 10.9775 9.76716 11.0406 9.96094 11.1564C10.1568 11.2724 10.3158 11.4356 10.4375 11.6447C10.5591 11.8519 10.6201 12.099 10.6201 12.3859C10.6201 12.6958 10.5427 12.9727 10.3887 13.216C10.2366 13.4573 10.0113 13.6486 9.71289 13.7892C9.41443 13.9299 9.04655 14.0002 8.60938 14.0002H6.11426V8.15935H8.45215ZM7.34863 12.9904H8.35547C8.69943 12.9904 8.95057 12.9252 9.1084 12.7941C9.26621 12.661 9.34473 12.4834 9.34473 12.2629C9.34468 12.1014 9.30643 11.9587 9.22852 11.8351C9.15056 11.7116 9.03903 11.6145 8.89453 11.5441C8.75195 11.4738 8.58148 11.4387 8.38379 11.4387H7.34863V12.9904ZM7.34863 10.6037H8.26465C8.43369 10.6036 8.58376 10.5737 8.71484 10.5148C8.84793 10.454 8.95227 10.3683 9.02832 10.258C9.10628 10.1477 9.14551 10.0155 9.14551 9.8615C9.14546 9.65055 9.07008 9.48001 8.91992 9.35076C8.77165 9.22169 8.56064 9.15741 8.28711 9.1574H7.34863V10.6037Z" fill="black"/><path d="M7.16602 0.377127C7.44584 0.189493 7.82551 0.20905 8.08496 0.442557L11.418 3.44256C11.7257 3.71966 11.7507 4.19428 11.4736 4.50213C11.1966 4.80961 10.7228 4.83441 10.415 4.55779L7.60938 2.03338L5.11328 4.53045C4.82042 4.82326 4.34562 4.82322 4.05273 4.53045C3.75986 4.23757 3.75989 3.7628 4.05273 3.4699L7.05273 0.4699L7.16602 0.377127Z" fill="black"/></svg>',adesc:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.3867 11.4697C10.6796 11.1771 11.1544 11.1769 11.4473 11.4697C11.7399 11.7626 11.7399 12.2374 11.4473 12.5303L8.44727 15.5303L8.33398 15.623C8.05425 15.8106 7.67449 15.7909 7.41504 15.5576L4.08203 12.5576C3.77415 12.2805 3.74927 11.8059 4.02637 11.498C4.30342 11.1907 4.77722 11.1657 5.08496 11.4424L7.89062 13.9668L10.3867 11.4697Z" fill="black"/><path d="M13.2012 3.0791C13.6346 3.07912 14.0128 3.1535 14.3359 3.30176C14.6611 3.45006 14.9141 3.65661 15.0947 3.9209C15.2752 4.18513 15.3683 4.49104 15.374 4.83887H14.1904C14.1676 4.60882 14.0695 4.43012 13.8965 4.30273C13.7235 4.17546 13.4889 4.11133 13.1924 4.11133C12.9909 4.11133 12.8204 4.14023 12.6816 4.19727C12.5431 4.25236 12.4364 4.32902 12.3623 4.42773C12.2901 4.52659 12.2539 4.63919 12.2539 4.76465C12.2501 4.86901 12.272 4.96023 12.3193 5.03809C12.3688 5.11604 12.4369 5.18417 12.5225 5.24121C12.6079 5.29623 12.7064 5.34496 12.8184 5.38672C12.9304 5.42661 13.0505 5.46075 13.1777 5.48926L13.7031 5.61426C13.9578 5.67128 14.1914 5.74776 14.4043 5.84277C14.6172 5.93784 14.8021 6.05457 14.958 6.19336C15.1139 6.33216 15.2348 6.49633 15.3203 6.68457C15.4076 6.8727 15.4522 7.08885 15.4541 7.33203C15.4521 7.68929 15.3612 7.99944 15.1807 8.26172C15.0019 8.52216 14.7427 8.72465 14.4043 8.86914C14.0678 9.01165 13.6617 9.08301 13.1865 9.08301C12.7153 9.08299 12.3048 9.01057 11.9551 8.86621C11.6072 8.72173 11.3345 8.50786 11.1387 8.22461C10.9447 7.9394 10.8435 7.58622 10.834 7.16602H12.0283C12.0416 7.36176 12.0985 7.52509 12.1973 7.65625C12.298 7.78554 12.4323 7.88365 12.5996 7.9502C12.7688 8.01477 12.96 8.04785 13.1729 8.04785C13.3817 8.04781 13.5629 8.01678 13.7168 7.95605C13.8727 7.89522 13.9935 7.81051 14.0791 7.70215C14.1646 7.59387 14.2079 7.46965 14.208 7.3291C14.208 7.19796 14.1687 7.08739 14.0908 6.99805C14.0148 6.90868 13.9022 6.83228 13.7539 6.76953C13.6076 6.70685 13.4276 6.64993 13.2148 6.59863L12.5791 6.43848C12.0868 6.31871 11.6982 6.13163 11.4131 5.87695C11.1279 5.62221 10.9855 5.27916 10.9873 4.84766C10.9854 4.49404 11.0804 4.18517 11.2705 3.9209C11.4625 3.65661 11.7259 3.45006 12.0605 3.30176C12.3951 3.15353 12.7754 3.0791 13.2012 3.0791Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M5.8125 9H4.48926L4.05664 7.66797H1.94824L1.51465 9H0.19043L2.20703 3.15918H3.79883L5.8125 9ZM2.26172 6.7041H3.74316L3.02539 4.49414H2.98047L2.26172 6.7041Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8.45215 3.15918C8.88181 3.15918 9.24025 3.22322 9.52734 3.35059C9.81445 3.47798 10.0303 3.6546 10.1748 3.88086C10.3193 4.10518 10.3916 4.36351 10.3916 4.65625C10.3916 4.88432 10.3461 5.08484 10.2549 5.25781C10.1636 5.4289 10.0386 5.57039 9.87891 5.68066C9.72118 5.78898 9.54022 5.86549 9.33691 5.91113V5.96875C9.55913 5.9783 9.76719 6.04044 9.96094 6.15625C10.1568 6.27223 10.3158 6.43538 10.4375 6.64453C10.5591 6.85173 10.6201 7.09875 10.6201 7.38574C10.6201 7.69567 10.5427 7.97245 10.3887 8.21582C10.2366 8.45719 10.0113 8.64841 9.71289 8.78906C9.41442 8.9297 9.04658 8.99999 8.60938 9H6.11426V3.15918H8.45215ZM7.34863 7.99023H8.35547C8.69948 7.99023 8.95057 7.92504 9.1084 7.79395C9.26621 7.66085 9.34473 7.48325 9.34473 7.2627C9.34466 7.10125 9.3064 6.95844 9.22852 6.83496C9.15056 6.71143 9.03899 6.61427 8.89453 6.54395C8.75196 6.47365 8.58145 6.43848 8.38379 6.43848H7.34863V7.99023ZM7.34863 5.60352H8.26465C8.43369 5.60347 8.58376 5.57354 8.71484 5.51465C8.84791 5.45381 8.95228 5.36807 9.02832 5.25781C9.10623 5.14755 9.14551 5.01529 9.14551 4.86133C9.14542 4.65046 9.07002 4.48078 8.91992 4.35156C8.77163 4.22228 8.56087 4.15724 8.28711 4.15723H7.34863V5.60352Z" fill="black"/></svg>',"chevron-down":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 6L8 10L4 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',"chevron-left":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 12L6 8L10 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',"chevron-right":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L10 8L6 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',"chevron-up":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 10L8 6L12 10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',"column-arrow":'<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" viewBox="0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 26C0 28.2092 1.79086 30 4 30H14C16.2091 30 18 28.2092 18 26V15H25.8786L24.4394 16.4393C23.8536 17.0251 23.8536 17.9749 24.4394 18.5607C25.0252 19.1464 25.9748 19.1464 26.5606 18.5607L30.5606 14.5607C31.1464 13.9749 31.1464 13.0251 30.5606 12.4393L26.5606 8.43934C25.9748 7.85356 25.0252 7.85356 24.4394 8.43934C23.8536 9.02512 23.8536 9.97488 24.4394 10.5607L25.8786 12H18V6C18 3.79086 16.2091 2 14 2H4C1.79086 2 0 3.79086 0 6V26ZM14 5H10.5V12H15V6C15 5.44772 14.5523 5 14 5ZM4 5H7.5V12H3V6C3 5.44772 3.44772 5 4 5ZM10.5 15H15V26C15 26.5522 14.5523 27 14 27H10.5V15ZM4 27H7.5V15H3V26C3 26.5522 3.44772 27 4 27Z" fill="currentColor"/></svg>',edit:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 10.6262V12.5012H5.375L10.905 6.97122L9.03 5.09622L3.5 10.6262ZM12.355 5.52122C12.4014 5.47497 12.4381 5.42002 12.4632 5.35953C12.4883 5.29905 12.5012 5.23421 12.5012 5.16872C12.5012 5.10324 12.4883 5.0384 12.4632 4.97791C12.4381 4.91742 12.4014 4.86248 12.355 4.81622L11.185 3.64622C11.1387 3.59987 11.0838 3.5631 11.0233 3.53801C10.9628 3.51291 10.898 3.5 10.8325 3.5C10.767 3.5 10.7022 3.51291 10.6417 3.53801C10.5812 3.5631 10.5263 3.59987 10.48 3.64622L9.565 4.56122L11.44 6.43622L12.355 5.52122Z" fill="currentColor"/></svg>',"filter-add":'<svg width="16" height="16" viewBox="0 0 16 16" class="ag-icon" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.12126 7.75L10.8517 7.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M6.65934 11.748L9.32778 11.748" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M12.2943 1.04872V6.19184M14.9886 3.74341H9.68478" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><path d="M8.25488 3C8.04799 3.18323 7.91706 3.45099 7.91699 3.74902C7.91713 4.04868 8.04988 4.31681 8.25879 4.5H2C1.58579 4.5 1.25 4.16421 1.25 3.75C1.25 3.33579 1.58579 3 2 3H8.25488Z" fill="currentColor"/></svg>',"pinned-bottom":'<svg xmlns="http://www.w3.org/2000/svg" fill="none" class="ag-icon" viewBox="0 0 16 16"><path fill="currentColor" d="M3.47 12.28A.75.75 0 0 1 4 11h8a.75.75 0 0 1 0 1.5H4a.75.75 0 0 1-.53-.22ZM12.731 5.256a.75.75 0 0 1-.2.524l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06l2.72 2.72V2a.75.75 0 0 1 1.5 0v5.44l2.72-2.72a.75.75 0 0 1 1.26.536Z"/></svg>',"pinned-top":'<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" viewBox="0 0 16 16"><path fill="currentColor" d="M12.53 3.72A.75.75 0 0 1 12 5H4a.75.75 0 0 1 0-1.5h8a.75.75 0 0 1 .53.22ZM3.269 10.744a.75.75 0 0 1 .2-.524l4-4a.75.75 0 0 1 1.06 0l4 4a.75.75 0 1 1-1.06 1.06L8.75 8.56V14a.75.75 0 0 1-1.5 0V8.56l-2.72 2.72a.75.75 0 0 1-1.26-.536Z"/></svg>',"small-down":'<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="black" stroke="none" viewBox="0 0 32 32"><path d="M7.334 10.667 16 21.334l8.667-10.667H7.334Z"/></svg>',"small-up":'<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="black" stroke="none" viewBox="0 0 32 32"><path d="M7.334 21.333 16 10.666l8.667 10.667H7.334Z"/></svg>',"un-pin":'<svg xmlns="http://www.w3.org/2000/svg" fill="none" class="ag-icon" viewBox="0 0 16 16"><path fill="currentColor" d="M8 11a.75.75 0 0 0-.75.75v3.333a.75.75 0 1 0 1.5 0V11.75A.75.75 0 0 0 8 11Z"/><path fill="currentColor" d="M13.11 1.436a.75.75 0 0 0-1.22-.872l-10 14a.75.75 0 1 0 1.22.872L5.207 12.5h7.376a.75.75 0 0 0 .75-.75v-1.174a2.08 2.08 0 0 0-1.153-1.863l-1.185-.599-.005-.002a.58.58 0 0 1-.323-.522V5.165a2.083 2.083 0 0 0 1.854-2.904l.589-.825Zm-3.943 5.52v.634a2.08 2.08 0 0 0 1.153 1.863l1.185.6.005.002a.58.58 0 0 1 .323.522V11H6.28l2.887-4.044ZM9.277 1H5.25a2.084 2.084 0 0 0-.083 4.165v1.676l1.5-2.132v-.292a.75.75 0 0 0-.75-.75H5.25a.584.584 0 0 1 0-1.167h2.972L9.277 1Z"/></svg>'},$1=(e={})=>{let t="";for(let s of[...Object.keys(Ip),...Object.keys(kp)]){let i=j1(s,e.strokeWidth);t+=`.ag-icon-${s}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(i)}'); }
18
- `}return t},j1=(e,t=1.5)=>{let s=kp[e];if(s)return s;let i=Ip[e];if(!i)throw Error(`Missing icon data for ${e}`);return`<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="black" stroke-width="${t}" viewBox="0 0 24 24"><style>* { vector-effect: non-scaling-stroke; }</style>`+i+"</svg>"},q1=(e={})=>ft({feature:"iconSet",css:()=>$1(e)});var Y1=q1();var X1=":where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-right:var(--ag-input-padding-start)}&:where(.ag-ltr,.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding:0 var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper),:where(.ag-filter-add-select),:where(.ag-filter-filter),:where(.ag-filter-toolpanel-search),:where(.ag-floating-filter-search-icon),:where(.ag-mini-filter){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:\"\";display:block;height:12px;-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");mask-image:url(\"data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==\");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper),:where(.ag-ltr) :where(.ag-filter-add-select),:where(.ag-ltr) :where(.ag-filter-filter),:where(.ag-ltr) :where(.ag-filter-toolpanel-search),:where(.ag-ltr) :where(.ag-floating-filter-search-icon),:where(.ag-ltr) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper),:where(.ag-rtl) :where(.ag-filter-add-select),:where(.ag-rtl) :where(.ag-filter-filter),:where(.ag-rtl) :where(.ag-filter-toolpanel-search),:where(.ag-rtl) :where(.ag-floating-filter-search-icon),:where(.ag-rtl) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}",Z1=".ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}";var Q1={inputBackgroundColor:"transparent",inputBorder:!1,inputBorderRadius:0,inputTextColor:{ref:"textColor"},inputPlaceholderTextColor:{ref:"inputTextColor",mix:0.5},inputPaddingStart:0,inputHeight:{calc:"max(iconSize, fontSize) + spacing * 2"},inputFocusBackgroundColor:{ref:"inputBackgroundColor"},inputFocusBorder:{ref:"inputBorder"},inputFocusShadow:"none",inputFocusTextColor:{ref:"inputTextColor"},inputDisabledBackgroundColor:{ref:"inputBackgroundColor"},inputDisabledBorder:{ref:"inputBorder"},inputDisabledTextColor:{ref:"inputTextColor"},inputInvalidBackgroundColor:{ref:"inputBackgroundColor"},inputInvalidBorder:{ref:"inputBorder"},inputInvalidTextColor:{ref:"inputTextColor"},inputIconColor:{ref:"inputTextColor"},pickerButtonBorder:!1,pickerButtonFocusBorder:{ref:"inputFocusBorder"},pickerButtonBackgroundColor:{ref:"backgroundColor"},pickerButtonFocusBackgroundColor:{ref:"backgroundColor"},pickerListBorder:!1,pickerListBackgroundColor:{ref:"backgroundColor"},colorPickerThumbSize:18,colorPickerTrackSize:12,colorPickerThumbBorderWidth:3,colorPickerTrackBorderRadius:12,colorPickerColorBorderRadius:4};var J1=()=>ft({feature:"inputStyle",params:{...Q1,inputBackgroundColor:Ve,inputBorder:!0,inputBorderRadius:{ref:"borderRadius"},inputPaddingStart:{ref:"spacing"},inputFocusBorder:{color:_t},inputFocusShadow:{ref:"focusShadow"},inputDisabledBackgroundColor:at(0.06),inputDisabledTextColor:{ref:"textColor",mix:0.5},inputInvalidBorder:{color:{ref:"invalidColor"}},pickerButtonBorder:!0,pickerListBorder:!0},css:()=>X1+Z1}),ex=J1();var tx=".ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative}.ag-tab:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}.ag-tab.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}.ag-tab:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:\"\";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}.ag-tab.ag-tab-selected:after{opacity:1}";var sx={tabBarBackgroundColor:"transparent",tabBarHorizontalPadding:0,tabBarTopPadding:0,tabBackgroundColor:"transparent",tabTextColor:{ref:"textColor"},tabHorizontalPadding:{ref:"spacing"},tabTopPadding:{ref:"spacing"},tabBottomPadding:{ref:"spacing"},tabSpacing:"0",tabHoverBackgroundColor:{ref:"tabBackgroundColor"},tabHoverTextColor:{ref:"tabTextColor"},tabSelectedBackgroundColor:{ref:"tabBackgroundColor"},tabSelectedTextColor:{ref:"tabTextColor"},tabSelectedBorderWidth:{ref:"borderWidth"},tabSelectedBorderColor:"transparent",tabSelectedUnderlineColor:"transparent",tabSelectedUnderlineWidth:0,tabSelectedUnderlineTransitionDuration:0,tabBarBorder:!1};var ix=()=>ft({feature:"tabStyle",params:{...sx,tabBarBorder:!0,tabBarBackgroundColor:ot(0.05),tabTextColor:{ref:"textColor",mix:0.7},tabSelectedTextColor:{ref:"textColor"},tabHoverTextColor:{ref:"textColor"},tabSelectedBorderColor:{ref:"borderColor"},tabSelectedBackgroundColor:Ve},css:tx}),ox=ix();var rx=()=>({fontFamily:[{googleFont:"IBM Plex Sans"},...Rp()]}),nx=()=>N1().withPart(z1).withPart(K1).withPart(Y1).withPart(ox).withPart(ex).withPart(Dp).withParams(rx()),Hn=nx();var Hs=(e,t,s,i,o)=>({changeKey:e,type:t,defaultValue:s,noWarn:i,cacheDefault:o}),ax=Hs("cellHorizontalPadding","length",16),lx=Hs("indentationLevel","length",0,!0,!0),cx=Hs("rowGroupIndentSize","length",0),Iu=Hs("rowHeight","length",42),ku=Hs("headerHeight","length",48),Za=Hs("rowBorderWidth","border",1),Lu=Hs("pinnedRowBorderWidth","border",1),dx=Hs("headerRowBorderWidth","border",1);function ux(e,t){for(let s of t.sort((i,o)=>i.moduleName.localeCompare(o.moduleName))){let i=s.css;if(i)e.set(`module-${s.moduleName}`,i)}}var hx=class extends v1{initVariables(){this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.getSizeEl(Iu),this.getSizeEl(ku),this.getSizeEl(Za),this.getSizeEl(Lu),this.refreshRowBorderWidthVariable()}getPinnedRowBorderWidth(){return this.getCSSVariablePixelValue(Lu)}getRowBorderWidth(){return this.getCSSVariablePixelValue(Za)}getHeaderRowBorderWidth(){return this.getCSSVariablePixelValue(dx)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(Iu)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(ku)}getDefaultCellHorizontalPadding(){return this.getCSSVariablePixelValue(ax)}getCellPaddingLeft(){let e=this.getDefaultCellHorizontalPadding(),t=this.getCSSVariablePixelValue(lx),s=this.getCSSVariablePixelValue(cx);return e-1+s*t}getCellPadding(){let e=this.getDefaultCellHorizontalPadding()-1;return this.getCellPaddingLeft()+e}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}refreshRowHeightVariable(){let{eRootDiv:e}=this,t=e.style.getPropertyValue("--ag-line-height").trim(),s=this.gos.get("rowHeight");if(s==null||isNaN(s)||!isFinite(s)){if(t!==null)e.style.setProperty("--ag-line-height",null);return-1}let i=`${s}px`;if(t!=i)return e.style.setProperty("--ag-line-height",i),s;return t!=""?Number.parseFloat(t):-1}fireStylesChangedEvent(e){if(e==="rowBorderWidth")this.refreshRowBorderWidthVariable();super.fireStylesChangedEvent(e)}refreshRowBorderWidthVariable(){let e=this.getCSSVariablePixelValue(Za);this.eRootDiv.style.setProperty("--ag-internal-row-border-width",`${e}px`)}postProcessThemeChange(e,t){if(e&&getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded"))if(t)X(106);else X(239)}getAdditionalCss(){let e=new Map;return e.set("core",[b1]),ux(e,Array.from(sw())),e}getDefaultTheme(){return Hn}varError(e,t){F(9,{variable:{cssName:e,defaultValue:t}})}themeError(e){X(240,{theme:e})}shadowRootError(){X(293)}},gx=class extends xe{constructor(){super(...arguments);this.beanName="eventSvc",this.eventServiceType="global",this.globalSvc=new Dt}addListener(e,t,s){this.globalSvc.addEventListener(e,t,s)}removeListener(e,t,s){this.globalSvc.removeEventListener(e,t,s)}addGlobalListener(e,t=!1){this.globalSvc.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalSvc.removeGlobalListener(e,t)}dispatchEvent(e){this.globalSvc.dispatchEvent(this.gos.addCommon(e))}dispatchEventOnce(e){this.globalSvc.dispatchEventOnce(this.gos.addCommon(e))}},px=class extends gx{postConstruct(){let{globalListener:e,globalSyncListener:t}=this.beans;if(e)this.addGlobalListener(e,!0);if(t)this.addGlobalListener(t,!1)}};function Sl(e,t,s){let i=e.visibleCols.headerGroupRowCount;if(s>=i)return{column:t,headerRowIndex:s};let o=t.parent;while(o&&o.getProvidedColumnGroup().getLevel()>s)o=o.parent;let r=t.isSpanHeaderHeight();if(!o||r&&o.isPadding())return{column:t,headerRowIndex:i};return{column:o,headerRowIndex:o.getProvidedColumnGroup().getLevel()}}var fx=class extends y{constructor(){super(...arguments);this.beanName="headerNavigation",this.currentHeaderRowWithoutSpan=-1}postConstruct(){let e=this.beans;e.ctrlsSvc.whenReady(this,(s)=>{this.gridBodyCon=s.gridBodyCtrl});let t=ce(e);this.addManagedElementListeners(t,{mousedown:()=>{this.currentHeaderRowWithoutSpan=-1}})}getHeaderPositionForColumn(e,t){let s,{colModel:i,colGroupSvc:o,ctrlsSvc:r}=this.beans;if(typeof e==="string"){if(s=i.getCol(e),!s)s=o?.getColumnGroup(e)??null}else s=e;if(!s)return null;let a=r.getHeaderRowContainerCtrl()?.getAllCtrls(),l=k(a||[]).type==="filter",c=rt(this.beans)-1,d=-1,u=s;while(u)d++,u=u.parent;let h=d;if(t&&l&&h===c-1)h++;return h===-1?null:{headerRowIndex:h,column:s}}navigateVertically(e,t){let{focusSvc:s,visibleCols:i}=this.beans,{focusedHeader:o}=s;if(!o)return!1;let{headerRowIndex:r}=o,n=o.column,a=rt(this.beans),l=this.getHeaderRowType(r),c=i.headerGroupRowCount,{headerRowIndex:d,column:u,headerRowIndexWithoutSpan:h}=e==="UP"?mx(l,n,r):Cx(n,r,c),g=!1;if(d<0)d=0,u=n,g=!0;if(d>=a)d=-1,this.currentHeaderRowWithoutSpan=-1;else if(h!==void 0)this.currentHeaderRowWithoutSpan=h;if(!g&&!u)return!1;return s.focusHeaderPosition({headerPosition:{headerRowIndex:d,column:u},allowUserOverride:!0,event:t})}navigateHorizontally(e,t=!1,s){let{focusSvc:i,gos:o}=this.beans,r={...i.focusedHeader},n,a;if(this.currentHeaderRowWithoutSpan!==-1)r.headerRowIndex=this.currentHeaderRowWithoutSpan;else this.currentHeaderRowWithoutSpan=r.headerRowIndex;if(e==="LEFT"!==o.get("enableRtl"))a="Before",n=this.findHeader(r,a);else a="After",n=this.findHeader(r,a);let l=o.getCallback("tabToNextHeader");if(t&&l){let c=i.focusHeaderPositionFromUserFunc({userFunc:l,headerPosition:n,direction:a});if(c){let{headerRowIndex:d}=i.focusedHeader||{};if(d!=null&&d!=r.headerRowIndex)this.currentHeaderRowWithoutSpan=d}return c}if(n||!t)return i.focusHeaderPosition({headerPosition:n,direction:a,fromTab:t,allowUserOverride:!0,event:s});return this.focusNextHeaderRow(r,a,s)}focusNextHeaderRow(e,t,s){let i=this.beans,o=e.headerRowIndex,r,n,a=rt(i),l=this.beans.visibleCols.allCols;if(t==="Before"){if(o<=0)return!1;r=k(l),n=o-1,this.currentHeaderRowWithoutSpan-=1}else if(r=l[0],n=o+1,this.currentHeaderRowWithoutSpan<a)this.currentHeaderRowWithoutSpan+=1;else this.currentHeaderRowWithoutSpan=-1;let{column:c,headerRowIndex:d}=Sl(this.beans,r,n);if(d>=a)d=-1;return i.focusSvc.focusHeaderPosition({headerPosition:{column:c,headerRowIndex:d},direction:t,fromTab:!0,allowUserOverride:!0,event:s})}scrollToColumn(e,t="After"){if(e.getPinned())return;let s;if(we(e)){let i=e.getDisplayedLeafColumns();s=t==="Before"?k(i):i[0]}else s=e;this.gridBodyCon.scrollFeature.ensureColumnVisible(s)}findHeader(e,t){let{colGroupSvc:s,visibleCols:i}=this.beans,o=e.column;if(o instanceof Oo){let l=o.getDisplayedLeafColumns();o=t==="Before"?l[0]:l[l.length-1]}let r=t==="Before"?i.getColBefore(o):i.getColAfter(o);if(!r)return;let n=i.headerGroupRowCount;if(e.headerRowIndex>=n)return{headerRowIndex:e.headerRowIndex,column:r};let a=s?.getColGroupAtLevel(r,e.headerRowIndex);if(!a)return{headerRowIndex:r instanceof Ct&&r.isSpanHeaderHeight()?i.headerGroupRowCount:e.headerRowIndex,column:r};if(a.isPadding()&&r.isSpanHeaderHeight())return{headerRowIndex:i.headerGroupRowCount,column:r};return{headerRowIndex:e.headerRowIndex,column:a??r}}getHeaderRowType(e){let t=this.beans.ctrlsSvc.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}};function mx(e,t,s){let i=s-1;if(e!=="filter"){let o=t instanceof Ct&&t.isSpanHeaderHeight(),r=t.parent;while(r&&(r.getProvidedColumnGroup().getLevel()>i||o&&r.isPadding()))r=r.parent;if(r)if(o)return{column:r,headerRowIndex:r.getProvidedColumnGroup().getLevel(),headerRowIndexWithoutSpan:i};else return{column:r,headerRowIndex:i,headerRowIndexWithoutSpan:i}}return{column:t,headerRowIndex:i,headerRowIndexWithoutSpan:i}}function Cx(e,t,s){let i=t+1,o={column:e,headerRowIndex:i,headerRowIndexWithoutSpan:i};if(e instanceof Oo){if(i>=s)return{column:e.getDisplayedLeafColumns()[0],headerRowIndex:s,headerRowIndexWithoutSpan:i};let n=e.getDisplayedChildren()[0];if(n instanceof Oo&&n.isPadding()){let l=n.getDisplayedLeafColumns()[0];if(l.isSpanHeaderHeight())n=l}if(o.column=n,n instanceof Ct&&n.isSpanHeaderHeight())o.headerRowIndex=s,o.headerRowIndexWithoutSpan=i}return o}var vx=class extends y{constructor(){super(...arguments);this.beanName="focusSvc",this.focusFallbackTimeout=null,this.needsFocusRestored=!1}wireBeans(e){this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.rowRenderer=e.rowRenderer,this.navigation=e.navigation,this.filterManager=e.filterManager,this.overlays=e.overlays}postConstruct(){let e=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:e,columnRowGroupChanged:e}),this.addDestroyFunc(xb(this.beans))}attemptToRecoverFocus(){if(this.needsFocusRestored=!0,this.focusFallbackTimeout!=null)clearTimeout(this.focusFallbackTimeout);this.focusFallbackTimeout=window.setTimeout(this.setFocusRecovered.bind(this),100)}setFocusRecovered(){if(this.needsFocusRestored=!1,this.focusFallbackTimeout!=null)clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=null}shouldTakeFocus(){if(this.gos.get("suppressFocusAfterRefresh"))return this.setFocusRecovered(),!1;if(this.needsFocusRestored)return this.setFocusRecovered(),!0;return this.doesRowOrCellHaveBrowserFocus()}onColumnEverythingChanged(){if(!this.focusedCell)return;let e=this.focusedCell.column,t=this.colModel.getCol(e.getId());if(e!==t)this.clearFocusedCell()}getFocusCellToUseAfterRefresh(){let{gos:e,focusedCell:t}=this;if(e.get("suppressFocusAfterRefresh")||e.get("suppressCellFocus")||!t)return null;if(!this.doesRowOrCellHaveBrowserFocus())return null;return t}getFocusHeaderToUseAfterRefresh(){if(this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeader)return null;if(!this.isDomDataPresentInHierarchy(j(this.beans),Kg))return null;return this.focusedHeader}doesRowOrCellHaveBrowserFocus(){let e=j(this.beans);if(this.isDomDataPresentInHierarchy(e,ln,!0))return!0;return this.isDomDataPresentInHierarchy(e,cn,!0)}isDomDataPresentInHierarchy(e,t,s){let i=e;while(i){let o=Jh(this.gos,i,t);if(o){if(o.destroyed&&s)return this.attemptToRecoverFocus(),!1;return!0}i=i.parentNode}return!1}getFocusedCell(){return this.focusedCell}getFocusEventParams(e){let{rowIndex:t,rowPinned:s,column:i}=e,o={rowIndex:t,rowPinned:s,column:i,isFullWidthCell:!1},r=this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:s});if(r)o.isFullWidthCell=r.isFullWidth();return o}clearFocusedCell(){if(this.focusedCell==null)return;let e=this.getFocusEventParams(this.focusedCell);this.focusedCell=null,this.eventSvc.dispatchEvent({type:"cellFocusCleared",...e})}setFocusedCell(e){this.setFocusRecovered();let{column:t,rowIndex:s,rowPinned:i,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:r=!1,sourceEvent:n}=e,a=this.colModel.getCol(t);if(!a){this.focusedCell=null;return}this.focusedCell={rowIndex:s,rowPinned:de(i),column:a};let l=this.getFocusEventParams(this.focusedCell);this.eventSvc.dispatchEvent({type:"cellFocused",...l,...this.previousCellFocusParams&&{previousParams:this.previousCellFocusParams},forceBrowserFocus:o,preventScrollOnBrowserFocus:r,sourceEvent:n}),this.previousCellFocusParams=l}isCellFocused(e){if(this.focusedCell==null)return!1;return to(e,this.focusedCell)}isHeaderWrapperFocused(e){if(this.focusedHeader==null)return!1;let{column:t,rowCtrl:{rowIndex:s,pinned:i}}=e,{column:o,headerRowIndex:r}=this.focusedHeader;return t===o&&s===r&&i==o.getPinned()}focusHeaderPosition(e){if(this.setFocusRecovered(),Ft(this.beans))return!1;let{direction:t,fromTab:s,allowUserOverride:i,event:o,fromCell:r,rowWithoutSpanValue:n,scroll:a=!0}=e,{headerPosition:l}=e;if(r&&this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(l);if(i){let c=this.focusedHeader,d=rt(this.beans);if(s){let u=this.gos.getCallback("tabToNextHeader");if(u)l=this.getHeaderPositionFromUserFunc({userFunc:u,direction:t,currentPosition:c,headerPosition:l,headerRowCount:d})}else{let u=this.gos.getCallback("navigateToNextHeader");if(u&&o){let h={key:o.key,previousHeaderPosition:c,nextHeaderPosition:l,headerRowCount:d,event:o},g=u(h);l=g===null?c:g}}}if(!l)return!1;return this.focusProvidedHeaderPosition({headerPosition:l,direction:t,event:o,fromCell:r,rowWithoutSpanValue:n,scroll:a})}focusHeaderPositionFromUserFunc(e){if(Ft(this.beans))return!1;let{userFunc:t,headerPosition:s,direction:i,event:o}=e,r=this.focusedHeader,n=rt(this.beans),a=this.getHeaderPositionFromUserFunc({userFunc:t,direction:i,currentPosition:r,headerPosition:s,headerRowCount:n});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:i,event:o})}getHeaderPositionFromUserFunc(e){let{userFunc:t,direction:s,currentPosition:i,headerPosition:o,headerRowCount:r}=e,a=t({backwards:s==="Before",previousHeaderPosition:i,nextHeaderPosition:o,headerRowCount:r});if(a===!0)return i;if(a===!1)return null;return a}focusProvidedHeaderPosition(e){let{headerPosition:t,direction:s,fromCell:i,rowWithoutSpanValue:o,event:r,scroll:n=!0}=e,{column:a,headerRowIndex:l}=t,{filterManager:c,ctrlsSvc:d,headerNavigation:u}=this.beans;if(this.focusedHeader&&$b(e.headerPosition,this.focusedHeader))return!1;if(l===-1){if(c?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(t);return this.focusGridView({column:a,event:r})}if(n)u?.scrollToColumn(a,s);let g=d.getHeaderRowContainerCtrl(a.getPinned())?.focusHeader(t.headerRowIndex,a,r)||!1;if(u&&g&&(o!=null||i))u.currentHeaderRowWithoutSpan=o??-1;return g}focusFirstHeader(){if(this.overlays?.exclusive&&this.focusOverlay())return!0;let e=this.visibleCols.allCols[0];if(!e)return!1;let t=Sl(this.beans,e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){if(this.overlays?.exclusive&&this.focusOverlay(!0))return!0;let t=rt(this.beans)-1,s=k(this.visibleCols.allCols);return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:s},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){if(this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(null);return this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCell}isRowFocused(e,t){if(this.focusedCell==null)return!1;return this.focusedCell.rowIndex===e&&this.focusedCell.rowPinned===de(t)}focusOverlay(e){let t=this.overlays?.isVisible()&&this.overlays.eWrapper?.getGui();return!!t&&pe(t,e)}getDefaultTabToNextGridContainerTarget(e){let{backwards:t,focusableContainers:s}=e,i=t?-1:1,o,r=()=>{if(o===void 0)o=this.getGridBodyTabTarget(t);return o};for(let n=e.nextIndex;n>=0&&n<s.length;n+=i){let a=Hb(s[n],r);if(a)return a}return null}getGridBodyTabTarget(e){if(e)return this.getGridViewTabTarget({column:k(this.visibleCols.allCols),backwards:!0});let t=this.visibleCols.allCols[0];if(this.gos.get("headerHeight")===0||Ft(this.beans))return this.getGridViewTabTarget({column:t});if(!t)return null;return Sl(this.beans,t,0)}getGridViewTabTarget(e){let{backwards:t=!1}=e,s=e.column??this.focusedHeader?.column;if(!s)return null;if(this.overlays?.exclusive)return null;if(an(this.beans))return t&&!Ft(this.beans)?{headerRowIndex:rt(this.beans)-1,column:s}:null;let i=t?As(this.beans):Ui(this.beans);if(i?.rowIndex==null){if(this.overlays?.isVisible())return null;if(t&&!Ft(this.beans)){let r=k(this.visibleCols.allCols);if(r)return{headerRowIndex:rt(this.beans)-1,column:r}}return null}let o=Ee(this.beans,i);if(!o||s.isSuppressNavigable(o))return null;if(t){if(this.rowRenderer.getRowByPosition(i)?.isFullWidth())return null}return{rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:s}}focusGridView(e){let{backwards:t=!1,canFocusOverlay:s=!0,event:i}=e;if(this.overlays?.exclusive)return s&&this.focusOverlay(t);if(an(this.beans)){if(t){if(!Ft(this.beans))return this.focusLastHeader()}if(s&&this.focusOverlay(t))return!0;if(t)return!1;return pt(this.beans,t)}let o=t?As(this.beans):Ui(this.beans);if(o){let r=e.column??this.focusedHeader?.column,{rowIndex:n,rowPinned:a}=o,l=Ee(this.beans,o);if(!r||!l||n==null)return!1;if(r.isSuppressNavigable(l)){let c=this.gos.get("enableRtl"),d;if(!i||i.key===b.TAB)d=c?b.LEFT:b.RIGHT;else d=i.key;return this.beans.navigation?.navigateToNextCell(null,d,{rowIndex:n,column:r,rowPinned:a||null},!0),!0}if(this.navigation?.ensureCellVisible({rowIndex:n,column:r,rowPinned:a}),t){if(this.rowRenderer.getRowByPosition(o)?.isFullWidth()&&this.navigation?.tryToFocusFullWidthRow(o,t))return!0}if(this.setFocusedCell({rowIndex:n,column:r,rowPinned:de(a),forceBrowserFocus:!0}),!Oe(r))this.beans.rangeSvc?.setRangeToCell({rowIndex:n,rowPinned:a,column:r});return!0}if(s&&this.focusOverlay(t))return!0;if(t&&this.focusLastHeader())return!0;return!1}focusAdvancedFilter(e){return this.advFilterFocusColumn=e?.column,this.beans.advancedFilter?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(e,t){let s=(t?void 0:this.advFilterFocusColumn)??this.visibleCols.allCols?.[0];if(e)return this.focusHeaderPosition({headerPosition:{column:s,headerRowIndex:rt(this.beans)-1}});return this.focusGridView({column:s})}clearAdvancedFilterColumn(){this.advFilterFocusColumn=void 0}},wx=class extends y{constructor(){super(...arguments);this.beanName="scrollVisibleSvc"}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colAnimation=e.colAnimation}postConstruct(){let{gos:e}=this;this.horizontalScrollShowing=e.get("alwaysShowHorizontalScroll")===!0,this.verticalScrollShowing=e.get("alwaysShowVerticalScroll")===!0,this.getScrollbarWidth();let t=this.updateScrollVisible.bind(this);this.addManagedEventListeners({displayedColumnsChanged:t,displayedColumnsWidthChanged:t,newColumnsLoaded:t})}updateScrollVisible(){let{colAnimation:e}=this;if(e?.isActive())e.executeLaterVMTurn(()=>{e.executeLaterVMTurn(()=>this.updateScrollVisibleImpl())});else this.updateScrollVisibleImpl()}updateScrollVisibleImpl(){let e=this.ctrlsSvc.get("center");if(!e||this.colAnimation?.isActive())return;let t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.verticalScrollShowing};this.setScrollsVisible(t),this.updateScrollGap()}updateScrollGap(){let e=this.ctrlsSvc.get("center"),t=e.hasHorizontalScrollGap(),s=e.hasVerticalScrollGap();if(this.horizontalScrollGap!==t||this.verticalScrollGap!==s)this.horizontalScrollGap=t,this.verticalScrollGap=s,this.eventSvc.dispatchEvent({type:"scrollGapChanged"})}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing)this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing,this.eventSvc.dispatchEvent({type:"scrollVisibilityChanged"})}getScrollbarWidth(){if(this.scrollbarWidth==null){let e=this.gos.get("scrollbarWidth"),s=typeof e==="number"&&e>=0?e:cc();if(s!=null)this.scrollbarWidth=s,this.eventSvc.dispatchEvent({type:"scrollbarWidthChanged"})}return this.scrollbarWidth}},bx=class extends y{constructor(){super(...arguments);this.beanName="gridDestroySvc",this.destroyCalled=!1}destroy(){if(this.destroyCalled)return;let{stateSvc:e,ctrlsSvc:t,context:s}=this.beans;this.eventSvc.dispatchEvent({type:"gridPreDestroyed",state:e?.getState()??{}}),this.destroyCalled=!0,t.get("gridCtrl")?.destroyGridUi(),s.destroy(),super.destroy()}},Sx=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","pinnedRowsChanged","rangeSelectionChanged","cellSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","cellSelectionDeleteStart","cellSelectionDeleteEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterUiChanged","filterOpened","floatingFilterUiChanged","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","dragCancelled","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd","rowDragCancel","findChanged","rowResizeStarted","rowResizeEnded","columnsReset","bulkEditingStarted","bulkEditingStopped","batchEditingStarted","batchEditingStopped"];var Kr=new Set(["gridPreDestroyed","fillStart","pasteStart"]),Gc=Sx.reduce((e,t)=>(e[t]=Sw(t),e),{}),yx=["__ob__","__v_skip","__metadata__"];function Lp(e,t,s){return new Set([...yx,...s??[],...Object.keys(t),...e])}var _i={agSetColumnFilter:"SetFilter",agSetColumnFloatingFilter:"SetFilter",agMultiColumnFilter:"MultiFilter",agMultiColumnFloatingFilter:"MultiFilter",agGroupColumnFilter:"GroupFilter",agGroupColumnFloatingFilter:"GroupFilter",agGroupCellRenderer:"GroupCellRenderer",agGroupRowRenderer:"GroupCellRenderer",agRichSelect:"RichSelect",agRichSelectCellEditor:"RichSelect",agDetailCellRenderer:"SharedMasterDetail",agSparklineCellRenderer:"Sparklines",agDragAndDropImage:"SharedDragAndDrop",agColumnHeader:"ColumnHeaderComp",agColumnGroupHeader:"ColumnGroupHeaderComp",agSortIndicator:"Sort",agAnimateShowChangeCellRenderer:"HighlightChanges",agAnimateSlideCellRenderer:"HighlightChanges",agLoadingCellRenderer:"LoadingCellRenderer",agSkeletonCellRenderer:"SkeletonCellRenderer",agCheckboxCellRenderer:"CheckboxCellRenderer",agLoadingOverlay:"Overlay",agExportingOverlay:"Overlay",agNoRowsOverlay:"Overlay",agNoMatchingRowsOverlay:"Overlay",agTooltipComponent:"Tooltip",agReadOnlyFloatingFilter:"CustomFilter",agTextColumnFilter:"TextFilter",agNumberColumnFilter:"NumberFilter",agBigIntColumnFilter:"BigIntFilter",agDateColumnFilter:"DateFilter",agDateInput:"DateFilter",agTextColumnFloatingFilter:"TextFilter",agNumberColumnFloatingFilter:"NumberFilter",agBigIntColumnFloatingFilter:"BigIntFilter",agDateColumnFloatingFilter:"DateFilter",agFormulaCellEditor:"Formula",agCellEditor:"TextEditor",agSelectCellEditor:"SelectEditor",agTextCellEditor:"TextEditor",agNumberCellEditor:"NumberEditor",agDateCellEditor:"DateEditor",agDateStringCellEditor:"DateEditor",agCheckboxCellEditor:"CheckboxEditor",agLargeTextCellEditor:"LargeTextEditor",agMenuItem:"MenuItem",agColumnsToolPanel:"ColumnsToolPanel",agFiltersToolPanel:"FiltersToolPanel",agNewFiltersToolPanel:"NewFiltersToolPanel",agAggregationComponent:"StatusBar",agSelectedRowCountComponent:"StatusBar",agTotalRowCountComponent:"StatusBar",agFilteredRowCountComponent:"StatusBar",agTotalAndFilteredRowCountComponent:"StatusBar",agFindCellRenderer:"Find",agButtonToolbarItem:"Toolbar",agFindToolbarItem:"Toolbar",agMenuToolbarItem:"Toolbar",agPivotPanelToolbarItem:"Toolbar",agQuickFilterToolbarItem:"Toolbar",agRowGroupPanelToolbarItem:"Toolbar"};function Gu(e){return`"${e}"`}var xx=()=>({checkboxSelection:{version:"32.2",message:"Use `rowSelection.checkboxes` in `GridOptions` instead."},headerCheckboxSelection:{version:"32.2",message:"Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."},headerCheckboxSelectionFilteredOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'},headerCheckboxSelectionCurrentPageOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'},showDisabledCheckboxes:{version:"32.2",message:"Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."},rowGroupingHierarchy:{version:"34.3",message:"Use `colDef.groupHierarchy` instead."}}),Rx={allowFormula:"Formula",aggFunc:"SharedAggregation",autoHeight:"RowAutoHeight",cellClass:"CellStyle",cellClassRules:"CellStyle",cellEditor:({cellEditor:e,editable:t,groupRowEditable:s})=>{if(!(!!t||!!s))return null;if(typeof e==="string")return _i[e]??"CustomEditor";return"CustomEditor"},cellRenderer:({cellRenderer:e})=>{if(typeof e!=="string")return null;return _i[e]},cellStyle:"CellStyle",columnChooserParams:"ColumnMenu",contextMenuItems:"ContextMenu",dndSource:"DragAndDrop",dndSourceOnRowDrag:"DragAndDrop",editable:({editable:e,cellEditor:t})=>{if(e&&!t)return"TextEditor";return null},groupRowEditable:({groupRowEditable:e,cellEditor:t})=>{if(!e)return null;return t?"RowGroupingEdit":["RowGroupingEdit","TextEditor"]},groupRowValueSetter:({groupRowValueSetter:e})=>e?"RowGroupingEdit":null,enableCellChangeFlash:"HighlightChanges",enablePivot:"SharedPivot",enableRowGroup:"SharedRowGrouping",enableValue:"SharedAggregation",filter:({filter:e})=>{if(e&&typeof e!=="string"&&typeof e!=="boolean")return"CustomFilter";if(typeof e==="string")return _i[e]??"ColumnFilter";return"ColumnFilter"},floatingFilter:"ColumnFilter",getQuickFilterText:"QuickFilter",headerTooltip:"Tooltip",headerTooltipValueGetter:"Tooltip",mainMenuItems:"ColumnMenu",menuTabs:(e)=>{let t=["columnsMenuTab","generalMenuTab"];if(e.menuTabs?.some((s)=>t.includes(s)))return"ColumnMenu";return null},pivot:"SharedPivot",pivotIndex:"SharedPivot",rowDrag:"RowDrag",rowGroup:"SharedRowGrouping",rowGroupIndex:"SharedRowGrouping",tooltipField:"Tooltip",tooltipValueGetter:"Tooltip",tooltipComponentSelector:"Tooltip",spanRows:"CellSpan",groupHierarchy:"SharedRowGrouping"},Fx=()=>({autoHeight:{supportedRowModels:["clientSide","serverSide"],validate:(t,{paginationAutoPageSize:s})=>{if(s)return"colDef.autoHeight is not supported with paginationAutoPageSize.";return null}},allowFormula:{supportedRowModels:["clientSide"]},cellRendererParams:{validate:(t)=>{if((t.rowGroup!=null||t.rowGroupIndex!=null||t.cellRenderer==="agGroupCellRenderer")&&"checkbox"in t.cellRendererParams)return'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.';return null}},flex:{validate:(t,s)=>{if(s.autoSizeStrategy)return"colDef.flex is not supported with gridOptions.autoSizeStrategy";return null}},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(t,{rowSelection:s})=>s==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(t,{rowSelection:s})=>s==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(t,{rowSelection:s})=>s==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerValueGetter:{validate:(t)=>{let s=t.headerValueGetter;if(typeof s==="function"||typeof s==="string")return null;return"headerValueGetter must be a function or a valid string expression"}},icons:{validate:({icons:t})=>{if(t){if(t.smallDown)return ct(262);if(t.smallLeft)return ct(263);if(t.smallRight)return ct(264)}return null}},sort:{validate:(t)=>{if(Vi(t.sort)||Ps(t.sort))return null;return`sort must be of type (SortDirection | SortDef), currently it is ${typeof t.sort==="object"?JSON.stringify(t.sort):_r(t.sort)}`}},initialSort:{validate:(t)=>{if(Vi(t.initialSort)||Ps(t.initialSort))return null;return`initialSort must be of non-null type (SortDirection | SortDef), currently it is ${typeof t.initialSort==="object"?JSON.stringify(t.initialSort):_r(t.initialSort)}`}},sortingOrder:{validate:(t)=>{let s=t.sortingOrder;if(Array.isArray(s)&&s.length>0){let i=s.filter((o)=>!(Vi(o)||Ps(o)));if(i.length>0)return`sortingOrder must be an array of type non-null (SortDirection | SortDef)[], incorrect items are: [${i.map((o)=>typeof o==="string"||o==null?_r(o):JSON.stringify(o)).join(", ")}]`}else if(!Array.isArray(s)||!s.length)return`sortingOrder must be an array with at least one element, currently it is [${s}]`;return null}},type:{validate:(t)=>{let s=t.type;if(s instanceof Array){if(s.some((o)=>typeof o!=="string"))return"if colDef.type is supplied an array it should be of type 'string[]'";return null}if(typeof s==="string")return null;return"colDef.type should be of type 'string' | 'string[]'"}},rowSpan:{validate:(t,{suppressRowTransform:s})=>{if(!s)return"colDef.rowSpan requires suppressRowTransform to be enabled.";return null}},spanRows:{dependencies:{editable:{required:[!1,void 0]},groupRowEditable:{required:[!1,void 0]},rowDrag:{required:[!1,void 0]},colSpan:{required:[void 0]},rowSpan:{required:[void 0]}},validate:(t,{rowSelection:s,cellSelection:i,suppressRowTransform:o,enableCellSpan:r,rowDragEntireRow:n,enableCellTextSelection:a})=>{if(typeof s==="object"){if(s?.mode==="singleRow"&&s?.enableClickSelection)return"colDef.spanRows is not supported with rowSelection.clickSelection"}if(i)return"colDef.spanRows is not supported with cellSelection.";if(o)return"colDef.spanRows is not supported with suppressRowTransform.";if(!r)return"colDef.spanRows requires enableCellSpan to be enabled.";if(n)return"colDef.spanRows is not supported with rowDragEntireRow.";if(a)return"colDef.spanRows is not supported with enableCellTextSelection.";return null}},groupHierarchy:{validate(t,{groupHierarchyConfig:s={}},i){let o=new Set(["year","quarter","month","formattedMonth","day","hour","minute","second"]),r=[];for(let n of t.groupHierarchy??[]){if(typeof n==="object"){i.validation?.validateColDef(n);continue}if(!o.has(n)&&!(n in s))r.push(Gu(n))}if(r.length>0){let n=`The following parts of colDef.groupHierarchy are not recognised: ${r.join(", ")}.`,a=`Choose one of ${[...o].map(Gu).join(", ")}, or define your own parts in gridOptions.groupHierarchyConfig.`;return`${n}
19
- ${a}`}return null}}}),Ex={headerName:void 0,columnGroupShow:void 0,headerStyle:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,headerTooltipValueGetter:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,groupRowEditable:void 0,groupRowValueSetter:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,spanRows:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,tooltipComponentSelector:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0,dateComponent:void 0,dateComponentParams:void 0,getFindText:void 0,rowGroupingHierarchy:void 0,groupHierarchy:void 0,allowFormula:void 0,suppressNoteActions:void 0},Px=()=>Object.keys(Ex),Ou,Mx=()=>Ou??(Ou=(()=>{let e=Px(),t=xx();return{objectName:"colDef",allProperties:e,allValidNames:Lp(e,t),docsUrl:"column-properties/",deprecations:t,validations:Fx()}})()),Tx=["overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","treeDataChildrenField","treeDataParentIdField","colResizeDefault","tooltipTrigger","noteTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","invalidEditValueMode","grandTotalRow","themeCssLayer","findSearchValue","styleNonce","renderingMode"],Dx=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","activeOverlayParams","popupParent","themeStyleContainer","toolbar","statusBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterParent","advancedFilterBuilderParams","advancedFilterParams","formulaDataSource","formulaFuncs","notesDataSource","initialState","autoSizeStrategy","selectionColumnDef","findOptions","filterHandlers","groupHierarchyConfig"],Ax=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector","paginationPanels","suppressOverlays"],Gp=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipSwitchShowDelay","tooltipHideDelay","noteShowDelay","noteHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns","rowDragInsertDelay"],Ix=["theme","rowSelection"],kx=["cellSelection","sideBar","rowNumbers","suppressGroupChangesColumnVisibility","groupAggFiltering","suppressStickyTotalRow","groupHideParentOfSingleChild","enableRowPinning"],Op=["loadThemeGoogleFonts","suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","allowContextMenuWithControlKey","suppressContextMenu","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","enableCellSpan","suppressClickEdit","rowDragEntireRow","rowDragManaged","refreshAfterGroupEdit","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupHideColumnsUntilExpanded","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressContentVisibilityAuto","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault","enableFilterHandlers","suppressStartEditOnTab","hidePaddedHeaderRows","ssrmExpandAllAffectsAllRows","animateColumnResizing"],Lx=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","overlayComponent","loadingOverlayComponent","noRowsOverlayComponent","overlayComponentSelector","activeOverlay","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getFullRowEditValidationErrors","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","tabToNextGridContainer","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","loadingCellRendererSelector","getRowId","chartMenuItems","groupTotalRow","alwaysPassFilter","isRowPinnable","isRowPinned","isRowValidDropPosition"],Gx=()=>[...Ax,...Dx,...Tx,...Gp,...Lx,...Op,...kx,...Ix];var Ox=()=>({suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."},enableFillHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeSelection:{version:"32.2",message:"Use `cellSelection = true` instead."},suppressMultiRangeSelection:{version:"32.2",message:"Use `cellSelection.suppressMultiRanges` instead."},suppressClearOnFillReduction:{version:"32.2",message:"Use `cellSelection.handle.suppressClearOnFillReduction` instead."},fillHandleDirection:{version:"32.2",message:"Use `cellSelection.handle.direction` instead."},fillOperation:{version:"32.2",message:"Use `cellSelection.handle.setFillValue` instead."},suppressRowClickSelection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},suppressRowDeselection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},rowMultiSelectWithClick:{version:"32.2",message:"Use `rowSelection.enableSelectionWithoutKeys` instead."},groupSelectsChildren:{version:"32.2",message:'Use `rowSelection.groupSelects = "descendants"` instead.'},groupSelectsFiltered:{version:"32.2",message:'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'},isRowSelectable:{version:"32.2",message:"Use `selectionOptions.isRowSelectable` instead."},suppressCopySingleCellRanges:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},suppressCopyRowsToClipboard:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},onRangeSelectionChanged:{version:"32.2",message:"Use `onCellSelectionChanged` instead."},onRangeDeleteStart:{version:"32.2",message:"Use `onCellSelectionDeleteStart` instead."},onRangeDeleteEnd:{version:"32.2",message:"Use `onCellSelectionDeleteEnd` instead."},suppressBrowserResizeObserver:{version:"32.2",message:"The grid always uses the browser's ResizeObserver, this grid option has no effect."},onColumnEverythingChanged:{version:"32.2",message:"Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."},groupRemoveSingleChildren:{version:"33",message:"Use `groupHideParentOfSingleChild` instead."},groupRemoveLowestSingleChildren:{version:"33",message:'Use `groupHideParentOfSingleChild: "leafGroupsOnly"` instead.'},suppressRowGroupHidesColumns:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressHideOnGroup"` instead.'},suppressMakeColumnVisibleAfterUnGroup:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressShowOnUngroup"` instead.'},unSortIcon:{version:"33",message:"Use `defaultColDef.unSortIcon` instead."},sortingOrder:{version:"33",message:"Use `defaultColDef.sortingOrder` instead."},suppressPropertyNamesCheck:{version:"33",message:"`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant."},suppressAdvancedFilterEval:{version:"34",message:"Advanced filter no longer uses function evaluation, so this option has no effect."}});function Vt(e,t,s){if(typeof t==="number"||t==null){if(t==null)return null;return t>=s?null:`${e}: value should be greater than or equal to ${s}`}return`${e}: value should be a number`}var Bx={alignedGrids:"AlignedGrids",allowContextMenuWithControlKey:"ContextMenu",autoSizeStrategy:"ColumnAutoSize",cellSelection:"CellSelection",columnHoverHighlight:"ColumnHover",datasource:"InfiniteRowModel",doesExternalFilterPass:"ExternalFilter",editType:"EditCore",invalidEditValueMode:"EditCore",enableAdvancedFilter:"AdvancedFilter",enableCellSpan:"CellSpan",enableCharts:"IntegratedCharts",enableRangeSelection:"CellSelection",enableRowPinning:"PinnedRow",findSearchValue:"Find",getFullRowEditValidationErrors:"EditCore",getContextMenuItems:"ContextMenu",getLocaleText:"Locale",getMainMenuItems:"ColumnMenu",getRowClass:"RowStyle",getRowStyle:"RowStyle",groupTotalRow:(e,t)=>t.rowModelType==="serverSide"?"ServerSideRowModel":"RowGrouping",grandTotalRow:["CsrmHierarchy","ServerSideRowModel"],initialState:"GridState",isExternalFilterPresent:"ExternalFilter",isRowPinnable:"PinnedRow",isRowPinned:"PinnedRow",localeText:"Locale",masterDetail:(e,t)=>t.rowModelType==="serverSide"?"ServerSideRowModel":"MasterDetail",notesDataSource:"Notes",pagination:"Pagination",pinnedBottomRowData:"PinnedRow",pinnedTopRowData:"PinnedRow",pivotMode:(e,t)=>t.rowModelType==="serverSide"?"ServerSideRowModel":"Pivot",pivotPanelShow:"RowGroupingPanel",quickFilterText:"QuickFilter",rowClass:"RowStyle",rowClassRules:"RowStyle",rowData:"ClientSideRowModel",rowDragManaged:"RowDrag",refreshAfterGroupEdit:["RowGrouping","TreeData"],rowGroupPanelShow:"RowGroupingPanel",rowNumbers:"RowNumbers",rowSelection:(e,t)=>t.rowModelType==="serverSide"?"ServerSideRowModel":"RowSelection",rowStyle:"RowStyle",serverSideDatasource:"ServerSideRowModel",sideBar:"SideBar",statusBar:"StatusBar",treeData:(e,t)=>t.rowModelType==="serverSide"?"ServerSideRowModel":"TreeData",toolbar:"Toolbar",undoRedoCellEditing:"UndoRedoEdit",valueCache:"ValueCache",viewportDatasource:"ViewportRowModel"},Vx=()=>{let e={autoSizePadding:{validate({autoSizePadding:s}){return Vt("autoSizePadding",s,0)}},cacheBlockSize:{supportedRowModels:["serverSide","infinite"],validate({cacheBlockSize:s}){return Vt("cacheBlockSize",s,1)}},cacheOverflowSize:{validate({cacheOverflowSize:s}){return Vt("cacheOverflowSize",s,1)}},datasource:{supportedRowModels:["infinite"]},domLayout:{validate:(s)=>{let i=s.domLayout,o=["autoHeight","normal","print"];if(i&&!o.includes(i))return`domLayout must be one of [${o.join()}], currently it's ${i}`;return null}},enableFillHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableRangeHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableCellSpan:{supportedRowModels:["clientSide","serverSide"]},enableRangeSelection:{dependencies:{rowDragEntireRow:{required:[!1,void 0]}}},enableRowPinning:{supportedRowModels:["clientSide"],validate({enableRowPinning:s,pinnedTopRowData:i,pinnedBottomRowData:o}){if(s&&(i||o))return"Manual row pinning cannot be used together with pinned row data. Either set `enableRowPinning` to `false`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";return null}},isRowPinnable:{supportedRowModels:["clientSide"],validate({enableRowPinning:s,isRowPinnable:i,pinnedTopRowData:o,pinnedBottomRowData:r}){if(i&&(o||r))return"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";if(!s&&i)return"`isRowPinnable` requires `enableRowPinning` to be set.";return null}},isRowPinned:{supportedRowModels:["clientSide"],validate({enableRowPinning:s,isRowPinned:i,pinnedTopRowData:o,pinnedBottomRowData:r}){if(i&&(o||r))return"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.";if(!s&&i)return"`isRowPinned` requires `enableRowPinning` to be set.";return null}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupHideColumnsUntilExpanded:{supportedRowModels:["clientSide"],validate({groupHideColumnsUntilExpanded:s,groupHideOpenParents:i,groupDisplayType:o}){if(s&&!i&&o!=="multipleColumns")return"`groupHideColumnsUntilExpanded = true` requires either `groupDisplayType = 'multipleColumns'` or `groupHideOpenParents = true`";return null}},groupHideOpenParents:{supportedRowModels:["clientSide","serverSide"],dependencies:{groupTotalRow:{required:[void 0,"bottom"]},groupDisplayType:{required:[void 0,"multipleColumns"]},treeData:{required:[void 0,!1],reason:"Tree Data has values at the group level so it doesn't make sense to hide them."}}},groupHideParentOfSingleChild:{dependencies:{groupHideOpenParents:{required:[void 0,!1]}}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveSingleChildren:{required:[void 0,!1]}}},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveLowestSingleChildren:{required:[void 0,!1]}}},groupSelectsChildren:{dependencies:{rowSelection:{required:["multiple"]}}},groupHierarchyConfig:{validate({groupHierarchyConfig:s={}},i,o){for(let r of Object.keys(s))o.validation?.validateColDef(s[r]);return null}},icons:{validate:({icons:s})=>{if(s){if(s.smallDown)return ct(262);if(s.smallLeft)return ct(263);if(s.smallRight)return ct(264)}return null}},infiniteInitialRowCount:{validate({infiniteInitialRowCount:s}){return Vt("infiniteInitialRowCount",s,1)}},initialGroupOrderComparator:{supportedRowModels:["clientSide"]},ssrmExpandAllAffectsAllRows:{validate:(s)=>{if(typeof s.ssrmExpandAllAffectsAllRows==="boolean"){if(s.rowModelType!=="serverSide")return"'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model.";if(s.ssrmExpandAllAffectsAllRows&&typeof s.getRowId!=="function")return"'getRowId' callback must be provided for Server Side Row Model grouping to work correctly."}return null}},keepDetailRowsCount:{validate({keepDetailRowsCount:s}){return Vt("keepDetailRowsCount",s,1)}},paginationPageSize:{validate({paginationPageSize:s}){return Vt("paginationPageSize",s,1)}},paginationPageSizeSelector:{validate:(s)=>{let i=s.paginationPageSizeSelector;if(typeof i==="boolean"||i==null)return null;if(!i.length)return`'paginationPageSizeSelector' cannot be an empty array.
20
- If you want to hide the page size selector, set paginationPageSizeSelector to false.`;return null}},paginationPanels:{validate:({paginationPanels:s})=>{let i=new Set(["pageSize","rowSummary","pageSummary"]);if(s!=null&&(!Array.isArray(s)||s.some((o)=>!i.has(o))))return"'paginationPanels' expects an array of panel names: ['pageSize', 'rowSummary', 'pageSummary']";return null}},pivotMode:{dependencies:{treeData:{required:[!1,void 0],reason:"Pivot Mode is not supported with Tree Data."}}},quickFilterText:{supportedRowModels:["clientSide"]},rowBuffer:{validate({rowBuffer:s}){return Vt("rowBuffer",s,0)}},rowClass:{validate:(s)=>{if(typeof s.rowClass==="function")return"rowClass should not be a function, please use getRowClass instead";return null}},rowData:{supportedRowModels:["clientSide"]},rowDragManaged:{supportedRowModels:["clientSide"],dependencies:{pagination:{required:[!1,void 0]}}},rowSelection:{validate({rowSelection:s}){if(s&&typeof s==="string")return'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.';if(s&&typeof s!=="object")return"Expected `RowSelectionOptions` object for the `rowSelection` property.";if(s&&s.mode!=="multiRow"&&s.mode!=="singleRow")return`Selection mode "${s.mode}" is invalid. Use one of 'singleRow' or 'multiRow'.`;return null}},rowStyle:{validate:(s)=>{let i=s.rowStyle;if(i&&typeof i==="function")return"rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead";return null}},notesDataSource:{validate:({getRowId:s})=>{if(!s)return"'getRowId' callback must be provided for Notes to work correctly.";return null}},noteHideDelay:{validate:(s)=>{if(s.noteHideDelay!=null&&s.noteHideDelay<0)return"noteHideDelay should not be lower than 0";return null}},noteShowDelay:{validate:(s)=>{if(s.noteShowDelay!=null&&s.noteShowDelay<0)return"noteShowDelay should not be lower than 0";return null}},serverSideDatasource:{supportedRowModels:["serverSide"]},serverSideInitialRowCount:{supportedRowModels:["serverSide"],validate({serverSideInitialRowCount:s}){return Vt("serverSideInitialRowCount",s,1)}},serverSideOnlyRefreshFilteredGroups:{supportedRowModels:["serverSide"]},serverSideSortAllLevels:{supportedRowModels:["serverSide"]},sortingOrder:{validate:(s)=>{let i=s.sortingOrder;if(Array.isArray(i)&&i.length>0){let o=i.filter((r)=>!nt(r));if(o.length>0)return`sortingOrder must be an array of type (SortDirection | SortDef)[], incorrect items are: ${o.map((r)=>typeof r==="string"||r==null?_r(r):JSON.stringify(r))}]`}else if(!Array.isArray(i)||!i.length)return`sortingOrder must be an array with at least one element, currently it's ${i}`;return null}},tooltipHideDelay:{validate:(s)=>{if(s.tooltipHideDelay&&s.tooltipHideDelay<0)return"tooltipHideDelay should not be lower than 0";return null}},tooltipShowDelay:{validate:(s)=>{if(s.tooltipShowDelay&&s.tooltipShowDelay<0)return"tooltipShowDelay should not be lower than 0";return null}},tooltipSwitchShowDelay:{validate:(s)=>{if(s.tooltipSwitchShowDelay&&s.tooltipSwitchShowDelay<0)return"tooltipSwitchShowDelay should not be lower than 0";return null}},treeData:{supportedRowModels:["clientSide","serverSide"],validate:(s)=>{let i=s.rowModelType??"clientSide";switch(i){case"clientSide":{let{treeDataChildrenField:o,treeDataParentIdField:r,getDataPath:n,getRowId:a}=s;if(!o&&!r&&!n)return"treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model.";if(o){if(n)return"Cannot use both 'treeDataChildrenField' and 'getDataPath' at the same time.";if(r)return"Cannot use both 'treeDataChildrenField' and 'treeDataParentIdField' at the same time."}if(r){if(!a)return"getRowId callback not provided, tree data with parent id cannot be built.";if(n)return"Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time."}return null}case"serverSide":{let o=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${i} row model.`;return s.isServerSideGroup&&s.getServerSideGroupKey?null:o}}return null}},viewportDatasource:{supportedRowModels:["viewport"]},viewportRowModelBufferSize:{validate({viewportRowModelBufferSize:s}){return Vt("viewportRowModelBufferSize",s,0)}},viewportRowModelPageSize:{validate({viewportRowModelPageSize:s}){return Vt("viewportRowModelPageSize",s,1)}},rowDragEntireRow:{dependencies:{cellSelection:{required:[void 0]}}},autoGroupColumnDef:{validate({autoGroupColumnDef:s,showOpenedGroup:i}){if(s?.field&&i)return"autoGroupColumnDef.field and showOpenedGroup are not supported when used together.";if(s?.valueGetter&&i)return"autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together.";return null}},renderingMode:{validate:(s)=>{let i=s.renderingMode,o=["default","legacy"];if(i&&!o.includes(i))return`renderingMode must be one of [${o.join()}], currently it's ${i}`;return null}},autoSizeStrategy:{validate:({autoSizeStrategy:s})=>{if(!s)return null;let i=["fitCellContents","fitGridWidth","fitProvidedWidth"],o=s.type;if(o!=="fitCellContents"&&o!=="fitGridWidth"&&o!=="fitProvidedWidth")return`Invalid Auto-size strategy. \`autoSizeStrategy\` must be one of ${i.map((r)=>'"'+r+'"').join(", ")}, currently it's ${o}`;if(o==="fitProvidedWidth"&&typeof s.width!="number")return`When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \`width\`. You provided ${s.width}`;return null}}},t={};for(let s of Op)t[s]={expectedType:"boolean"};for(let s of Gp)t[s]={expectedType:"number"};return Se(t,e),t},Bu,Nx=()=>Bu??(Bu=(()=>{let e=[...Gx(),...Object.values(Gc)],t=Ox(),s=["api"];return{objectName:"gridOptions",allProperties:e,allValidNames:Lp(e,t,s),propertyExceptions:s,docsUrl:"grid-options/",deprecations:t,validations:Vx()}})()),_x=0,Hx=0,Vu="__ag_grid_instance",zx=class extends y{constructor(){super(...arguments);this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.instanceId=Hx++,this.gridReadyFired=!1,this.queueEvents=[],this.propEventSvc=new Dt,this.globalEventHandlerFactory=(e)=>(t,s)=>{if(!this.isAlive())return;let i=Kr.has(t);if(i&&!e||!i&&e)return;if(!Wx(t))return;let o=(r,n)=>{let a=Gc[r],l=this.gridOptions[a];if(typeof l==="function")this.beans.frameworkOverrides.wrapOutgoing(()=>l(n))};if(this.gridReadyFired)o(t,s);else if(t==="gridReady"){o(t,s),this.gridReadyFired=!0;for(let r of this.queueEvents)o(r.eventName,r.event);this.queueEvents=[]}else this.queueEvents.push({eventName:t,event:s})}}wireBeans(e){this.gridOptions=e.gridOptions,this.validation=e.validation,this.api=e.gridApi,this.gridId=e.context.getId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){this.validateGridOptions(this.gridOptions),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this),!0),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:e})=>{this.updateGridOptions({options:e,force:!0,source:"optionsUpdated"})}})}destroy(){super.destroy(),this.queueEvents=[]}get(e){return this.gridOptions[e]??Yv[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return M(this.gridOptions[e])}mergeGridCommonParams(e){if(e)return(s)=>e(this.addCommon(s));return e}updateGridOptions({options:e,force:t,source:s="api"}){let i={id:_x++,properties:[]},o=[],{gridOptions:r,validation:n}=this;for(let a of Object.keys(e)){let l=ql.applyGlobalGridOption(a,e[a]);n?.warnOnInitialPropertyUpdate(s,a);let c=t||typeof l==="object"&&s==="api",d=r[a];if(c||d!==l){r[a]=l;let u={type:a,currentValue:l,previousValue:d,changeSet:i,source:s};o.push(u)}}this.validateGridOptions(this.gridOptions),i.properties=o.map((a)=>a.type);for(let a of o)Ao(this,`Updated property ${a.type} from`,a.previousValue," to ",a.currentValue),this.propEventSvc.dispatchEvent(a)}addPropertyEventListener(e,t){this.propEventSvc.addEventListener(e,t)}removePropertyEventListener(e,t){this.propEventSvc.removeEventListener(e,t)}getDomDataKey(){return this.domDataKey}addCommon(e){return e.api=this.api,e.context=this.gridOptionsContext,e}validateOptions(e,t){for(let s of Object.keys(e)){let i=e[s];if(i==null||i===!1)continue;let o=t[s];if(typeof o==="function")o=o(e,this.gridOptions,this.beans);if(o)this.assertModuleRegistered(o,s)}}validateGridOptions(e){this.validateOptions(e,Bx),this.validation?.processGridOptions(e)}validateColDef(e,t,s){if(s||!this.beans.dataTypeSvc?.isColPendingInference(t))this.validateOptions(e,Rx),this.validation?.validateColDef(e)}assertModuleRegistered(e,t){let s=Array.isArray(e)?e.some((i)=>this.isModuleRegistered(i)):this.isModuleRegistered(e);if(!s)X(200,{...this.getModuleErrorParams(),moduleName:e,reasonOrId:t});return s}getModuleErrorParams(){return{gridId:this.gridId,gridScoped:Yl(),rowModelType:this.get("rowModelType"),isUmd:Xl(),usesAgGridProvider:this.beans.frameworkOverrides.usesAgGridProvider??!1}}isModuleRegistered(e){return nl(e,this.gridId,this.get("rowModelType"))}setInstanceDomData(e){e[Vu]=this.instanceId}isElementInThisInstance(e){let t=e;while(t){let s=t[Vu];if(M(s))return s===this.instanceId;t=t.parentElement}return!1}};function Wx(e){return!!Gc[e]}var Ux=class extends y{constructor(e,t){super();this.column=e,this.eGui=t,this.lastMovingChanged=0}postConstruct(){this.addManagedElementListeners(this.eGui,{click:(e)=>e&&this.onClick(e)}),this.addManagedListeners(this.column,{movingChanged:()=>{this.lastMovingChanged=Date.now()}})}onClick(e){let{sortSvc:t,rangeSvc:s,gos:i}=this.beans;if(!(is(i)?e.altKey:!0))s?.handleColumnSelection(this.column,e);else if(this.column.isSortable()){let r=this.column.isMoving(),a=Date.now()-this.lastMovingChanged<50;if(!(r||a))t?.progressSortFromEvent(this.column,e)}}};function Kx(e,t){let s={"aria-hidden":"true"};return{tag:"div",cls:"ag-cell-label-container",role:"presentation",children:[{tag:"span",ref:"eMenu",cls:"ag-header-icon ag-header-cell-menu-button",attrs:s},{tag:"span",ref:"eFilterButton",cls:"ag-header-icon ag-header-cell-filter-button",attrs:s},{tag:"div",ref:"eLabel",cls:"ag-header-cell-label",role:"presentation",children:[e?{tag:"span",ref:"eColRef",cls:"ag-header-col-ref"}:null,{tag:"span",ref:"eText",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilter",cls:"ag-header-icon ag-header-label-icon ag-filter-icon",attrs:s},t?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:null]}]}}var $x=class extends L{constructor(){super(...arguments);this.eFilter=E,this.eFilterButton=E,this.eSortIndicator=E,this.eMenu=E,this.eLabel=E,this.eText=E,this.eColRef=E,this.eSortOrder=E,this.eSortAsc=E,this.eSortDesc=E,this.eSortMixed=E,this.eSortNone=E,this.eSortAbsoluteAsc=E,this.eSortAbsoluteDesc=E,this.isLoadingInnerComponent=!1}refresh(e){let t=this.params;if(this.params=e,this.workOutTemplate(e,!!this.beans?.sortSvc)!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||e.enableSorting!=this.currentSort||e.column.formulaRef!=this.currentRef||this.currentSuppressMenuHide!=null&&this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon)return!1;if(this.innerHeaderComponent){let s={...e};Se(s,e.innerHeaderComponentParams),this.innerHeaderComponent.refresh?.(s)}else this.setDisplayName(e);return!0}workOutTemplate(e,t){let{formula:s}=this.beans,i=e.template;if(i)return i?.trim?i.trim():i;return Kx(!!s?.active,t)}init(e){this.params=e;let{sortSvc:t,touchSvc:s,rowNumbersSvc:i,userCompFactory:o}=this.beans,r=t?.getSortIndicatorSelector();if(this.currentTemplate=this.workOutTemplate(e,!!r),this.setTemplate(this.currentTemplate,r?[r]:void 0),this.eLabel)this.mouseListener??(this.mouseListener=this.createManagedBean(new Ux(e.column,this.eLabel)));s?.setupForHeader(this),this.setMenu(),this.setupSort(),this.setupColumnRefIndicator(),i?.setupForHeader(this),this.setupFilterIcon(),this.setupFilterButton(),this.workOutInnerHeaderComponent(o,e),this.setDisplayName(e)}workOutInnerHeaderComponent(e,t){let s=lb(e,t,t);if(!s)return;this.isLoadingInnerComponent=!0,s.newAgStackInstance().then((i)=>{if(this.isLoadingInnerComponent=!1,!i)return;if(this.isAlive()){if(this.innerHeaderComponent=i,this.eText)this.eText.appendChild(i.getGui())}else this.destroyBean(i)})}setDisplayName(e){let{displayName:t}=e,s=this.currentDisplayName;if(this.currentDisplayName=t,!this.eText||s===t||this.innerHeaderComponent||this.isLoadingInnerComponent)return;this.eText.textContent=zo(t)}addInIcon(e,t,s){let i=N(e,this.beans,s);if(i)t.appendChild(i)}workOutShowMenu(){return this.params.enableMenu&&!!this.beans.menuSvc?.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return!!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){Me(this.eMenu),this.eMenu=void 0;return}let{gos:e,eMenu:t,params:s}=this,i=be(e);this.addInIcon(i?"menu":"menuAlt",t,s.column),t.classList.toggle("ag-header-menu-icon",!i);let o=this.shouldSuppressMenuHide();this.currentSuppressMenuHide=o,this.addManagedElementListeners(t,{click:()=>this.showColumnMenu(this.eMenu)}),this.toggleMenuAlwaysShow(o)}toggleMenuAlwaysShow(e){this.eMenu?.classList.toggle("ag-header-menu-always-show",e)}showColumnMenu(e){let{currentSuppressMenuHide:t,params:s}=this;if(!t)this.toggleMenuAlwaysShow(!0);s.showColumnMenu(e,()=>{if(!t)this.toggleMenuAlwaysShow(!1)})}onMenuKeyboardShortcut(e){let{params:t,gos:s,beans:i,eMenu:o,eFilterButton:r}=this,n=t.column,a=be(s);if(e&&!a){if(i.menuSvc?.isFilterMenuInHeaderEnabled(n))return t.showFilter(r??o??this.getGui()),!0}else if(t.enableMenu)return this.showColumnMenu(o??r??this.getGui()),!0;return!1}setupSort(){let{sortSvc:e}=this.beans;if(!e)return;let{enableSorting:t,column:s}=this.params;if(this.currentSort=t,!this.eSortIndicator){this.eSortIndicator=this.createBean(e.createSortIndicator(!0));let{eSortIndicator:i,eSortOrder:o,eSortAsc:r,eSortDesc:n,eSortMixed:a,eSortNone:l,eSortAbsoluteAsc:c,eSortAbsoluteDesc:d}=this;i.attachCustomElements(o,r,n,a,l,c,d)}if(this.eSortIndicator.setupSort(s),!this.currentSort)return;e.setupHeader(this,s)}setupColumnRefIndicator(){let{eColRef:e,beans:{editModelSvc:t},params:s}=this;if(!e)return;this.currentRef=s.column.formulaRef,e.textContent=this.currentRef,G(e,!1),this.addManagedEventListeners({cellEditingStarted:()=>{let i=t?.getEditPositions(),o=!!this.currentRef&&!!i?.some((r)=>r.column.isAllowFormula());G(e,o)},cellEditingStopped:()=>{G(e,!1)}})}setupFilterIcon(){let{eFilter:e,params:t}=this;if(!e)return;let s=()=>{let i=t.column.isFilterActive();G(e,i,{skipAriaHidden:!0})};this.configureFilter(t.enableFilterIcon,e,s,"filterActive")}setupFilterButton(){let{eFilterButton:e,params:t}=this;if(!e)return;if(this.configureFilter(t.enableFilterButton,e,this.onFilterChangedButton.bind(this),"filter"))this.addManagedElementListeners(e,{click:()=>t.showFilter(e)});else this.eFilterButton=void 0}configureFilter(e,t,s,i){if(!e)return Me(t),!1;let o=this.params.column;return this.addInIcon(i,t,o),this.addManagedListeners(o,{filterChanged:s}),s(),!0}onFilterChangedButton(){let e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){let{eFilterButton:t,eMenu:s}=this;if(e)return t??s??this.getGui();return s??t??this.getGui()}destroy(){super.destroy(),this.innerHeaderComponent=this.destroyBean(this.innerHeaderComponent),this.mouseListener=this.destroyBean(this.mouseListener)}},jx=class extends y{constructor(e,t){super();this.eLabel=e,this.columnGroup=t,this.isSticky=!1,this.left=null,this.right=null}postConstruct(){let{columnGroup:e,beans:t}=this,{ctrlsSvc:s}=t;s.whenReady(this,()=>{let i=this.refreshPosition.bind(this);if(e.getPinned()==null)this.addManagedEventListeners({bodyScroll:(o)=>{if(o.direction==="horizontal")this.updateSticky(o.left)}});this.addManagedListeners(e,{leftChanged:i,displayedChildrenChanged:i}),this.addManagedEventListeners({columnResized:i}),this.refreshPosition()})}refreshPosition(){let{columnGroup:e,beans:t}=this,s=e.getLeft(),i=e.getActualWidth();if(s==null||i===0){this.left=null,this.right=null,this.setSticky(!1);return}this.left=s,this.right=s+i;let o=t.colViewport.getScrollPosition();if(o!=null)this.updateSticky(o)}updateSticky(e){let{beans:t,left:s,right:i}=this;if(s==null||i==null){this.setSticky(!1);return}let{gos:o,visibleCols:r}=t,a=o.get("enableRtl")?r.bodyWidth-e:e;this.setSticky(s<a&&i>a)}setSticky(e){let{isSticky:t,eLabel:s}=this;if(t===e)return;this.isSticky=e,s.classList.toggle("ag-sticky-label",e)}},qx={tag:"div",cls:"ag-header-group-cell-label",role:"presentation",children:[{tag:"span",ref:"agLabel",cls:"ag-header-group-text",role:"presentation"},{tag:"span",ref:"agOpened",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"},{tag:"span",ref:"agClosed",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"}]},Yx=class extends L{constructor(){super(qx);this.agOpened=E,this.agClosed=E,this.agLabel=E,this.isLoadingInnerComponent=!1}init(e){let{userCompFactory:t,touchSvc:s}=this.beans;this.params=e,this.checkWarnings(),this.workOutInnerHeaderGroupComponent(t,e),this.setupLabel(e),this.addGroupExpandIcon(e),this.setupExpandIcons(),s?.setupForHeaderGroup(this)}checkWarnings(){if(this.params.template)F(89)}workOutInnerHeaderGroupComponent(e,t){let s=db(e,t,t);if(!s)return;this.isLoadingInnerComponent=!0,s.newAgStackInstance().then((i)=>{if(this.isLoadingInnerComponent=!1,!i)return;if(this.isAlive())this.innerHeaderGroupComponent=i,this.agLabel.appendChild(i.getGui());else this.destroyBean(i)})}setupExpandIcons(){let{agOpened:e,agClosed:t,params:{columnGroup:s},beans:{colGroupSvc:i}}=this;this.addInIcon("columnGroupOpened",e),this.addInIcon("columnGroupClosed",t);let o=(l)=>{if(ut(l))return;let c=!s.isExpanded();i.setColumnGroupOpened(s.getProvidedColumnGroup(),c,"uiColumnExpanded")};this.addTouchAndClickListeners(t,o),this.addTouchAndClickListeners(e,o);let r=(l)=>{Qe(l)};this.addManagedElementListeners(t,{dblclick:r}),this.addManagedElementListeners(e,{dblclick:r}),this.addManagedElementListeners(this.getGui(),{dblclick:o}),this.updateIconVisibility();let n=s.getProvidedColumnGroup(),a=this.updateIconVisibility.bind(this);this.addManagedListeners(n,{expandedChanged:a,expandableChanged:a})}addTouchAndClickListeners(e,t){this.beans.touchSvc?.setupForHeaderGroupElement(this,e,t),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){let{agOpened:e,agClosed:t,params:{columnGroup:s}}=this;if(s.isExpandable()){let i=s.isExpanded();G(e,i),G(t,!i)}else G(e,!1),G(t,!1)}addInIcon(e,t){let s=N(e,this.beans,null);if(s)t.appendChild(s)}addGroupExpandIcon(e){if(!e.columnGroup.isExpandable()){let{agOpened:t,agClosed:s}=this;G(t,!1),G(s,!1)}}setupLabel(e){let{displayName:t,columnGroup:s}=e,{innerHeaderGroupComponent:i,isLoadingInnerComponent:o}=this,r=i||o;if(M(t)&&!r)this.agLabel.textContent=zo(t);if(!s.getColGroupDef()?.suppressStickyLabel)this.createManagedBean(new jx(this.getGui(),s))}destroy(){if(super.destroy(),this.innerHeaderGroupComponent)this.destroyBean(this.innerHeaderGroupComponent),this.innerHeaderGroupComponent=void 0}},Xx={moduleName:"ColumnHeaderComp",version:z,userComponents:{agColumnHeader:$x},icons:{menu:"menu",menuAlt:"menu-alt"}},Zx={moduleName:"ColumnGroupHeaderComp",version:z,userComponents:{agColumnGroupHeader:Yx},icons:{columnGroupOpened:"expanded",columnGroupClosed:"contracted"}},Qx=class extends y{constructor(){super(...arguments);this.beanName="animationFrameSvc",this.p1={list:[],sorted:!1},this.p2={list:[],sorted:!1},this.f1={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastScrollTop=0,this.taskCount=0}setScrollTop(e){if(this.scrollGoingDown=e>=this.lastScrollTop,e===0)this.scrollGoingDown=!0;this.lastScrollTop=e}postConstruct(){this.active=!this.gos.get("suppressAnimationFrame"),this.batchFrameworkComps=this.beans.frameworkOverrides.batchFrameworkComps}verify(){if(this.active===!1)F(92)}createTask(e,t,s,i,o=!1){this.verify();let r=s;if(i&&this.batchFrameworkComps)r="f1";let n={task:e,index:t,createOrder:++this.taskCount,deferred:o};this.addTaskToList(this[r],n),this.schedule()}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;let t=this.scrollGoingDown?1:-1;e.list.sort((s,i)=>{if(s.deferred!==i.deferred)return s.deferred?-1:1;if(s.index!==i.index)return t*(i.index-s.index);return i.createOrder-s.createOrder}),e.sorted=!0}addDestroyTask(e){this.verify(),this.destroyTasks.push(e),this.schedule()}executeFrame(e){let{p1:t,p2:s,f1:i,destroyTasks:o,beans:r}=this,{ctrlsSvc:n,frameworkOverrides:a}=r,l=t.list,c=s.list,d=i.list,u=Date.now(),h=0,g=e<=0,p=n.getScrollFeature();while(g||h<e){if(!p.scrollGridIfNeeded()){let m;if(l.length)this.sortTaskList(t),m=l.pop().task;else if(c.length)this.sortTaskList(s),m=c.pop().task;else if(d.length)a.wrapOutgoing(()=>{while(g||h<e){if(!p.scrollGridIfNeeded())if(d.length)this.sortTaskList(i),m=d.pop().task,m();else break;else break;h=Date.now()-u}}),m=()=>{};else if(o.length)m=o.pop();else break;m()}h=Date.now()-u}if(l.length||c.length||d.length||o.length)this.requestFrame();else this.ticking=!1}flushAllFrames(){if(!this.active)return;this.executeFrame(-1)}schedule(){if(!this.active)return;if(!this.ticking)this.ticking=!0,this.requestFrame()}requestFrame(){let e=this.executeFrame.bind(this,60);et(this.beans,e)}isQueueEmpty(){return!this.ticking}},Jx={moduleName:"AnimationFrame",version:z,beans:[Qx]},eR=class extends y{constructor(){super(...arguments);this.beanName="iconSvc"}createIconNoSpan(e,t){return N(e,this.beans,t?.column)}},tR=(e,t,s)=>t||e&&s,sR=class extends y{constructor(){super(...arguments);this.beanName="touchSvc"}mockBodyContextMenu(e,t){this.mockContextMenu(e,e.eBodyViewport,t)}mockHeaderContextMenu(e,t){this.mockContextMenu(e,e.eGui,t)}mockRowContextMenu(e){if(!os())return;let t=(s,i,o)=>{let{rowCtrl:r,cellCtrl:n}=e.getControlsForEventTarget(o?.target??null);if(n?.column)n.dispatchCellContextMenuEvent(o??null);this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0,o,r,n)};this.mockContextMenu(e,e.element,t)}handleCellDoubleClick(e,t){if((()=>{if(!os()||il("dblclick"))return!1;let i=Date.now(),o=i-e.lastIPadMouseClickEvent<200;return e.lastIPadMouseClickEvent=i,o})())return e.onCellDoubleClicked(t),t.preventDefault(),!0;return!1}setupForHeader(e){let{gos:t,sortSvc:s,menuSvc:i}=this.beans;if(t.get("suppressTouch"))return;let{params:o,eMenu:r,eFilterButton:n}=e,a=new Ke(e.getGui(),!0);e.addDestroyFunc(()=>a.destroy());let l=e.shouldSuppressMenuHide(),c=l&&M(r)&&o.enableMenu,d=!!i?.isHeaderContextMenuEnabled(o.column),u=tR(o.enableMenu,d,be(t)),h=a;if(c)h=new Ke(r,!0),e.addDestroyFunc(()=>h.destroy());let g=(p)=>o.showColumnMenuAfterMouseClick(p.touchStart);if(c&&o.enableMenu)e.addManagedListeners(h,{tap:g});if(u)e.addManagedListeners(a,{longTap:g});if(o.enableSorting){let p=(f)=>{let m=f.touchStart.target;if(l&&(r?.contains(m)||n?.contains(m)))return;s?.progressSort(o.column,!1,"uiColumnSorted")};e.addManagedListeners(a,{tap:p})}if(o.enableFilterButton&&n){let p=new Ke(n,!0);e.addManagedListeners(p,{tap:()=>o.showFilter(n)}),e.addDestroyFunc(()=>p.destroy())}}setupForHeaderGroup(e){let t=e.params;if(this.beans.menuSvc?.isHeaderContextMenuEnabled(t.columnGroup.getProvidedColumnGroup())){let s=new Ke(t.eGridHeader,!0),i=(o)=>t.showColumnMenuAfterMouseClick(o.touchStart);e.addManagedListeners(s,{longTap:i}),e.addDestroyFunc(()=>s.destroy())}}setupForHeaderGroupElement(e,t,s){let i=new Ke(t,!0);e.addManagedListeners(i,{tap:s}),e.addDestroyFunc(()=>i.destroy())}mockContextMenu(e,t,s){if(!os())return;let i=new Ke(t),o=(r)=>{if(!Do(this.beans,r.touchEvent))return;s(void 0,r.touchStart,r.touchEvent)};e.addManagedListeners(i,{longTap:o}),e.addDestroyFunc(()=>i.destroy())}},iR={moduleName:"Touch",version:z,beans:[sR]},oR=class extends y{constructor(){super(...arguments);this.beanName="cellNavigation"}getNextCellToFocus(e,t,s=!1){if(s)return this.getNextCellToFocusWithCtrlPressed(e,t);return this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){let s=e===b.UP,i=e===b.DOWN,o=e===b.LEFT,r,n,{pageBounds:a,gos:l,visibleCols:c,pinnedRowModel:d}=this.beans,{rowPinned:u}=t;if(s||i){if(u&&d)if(s)n=0;else n=u==="top"?d.getPinnedTopRowCount()-1:d.getPinnedBottomRowCount()-1;else n=s?a.getFirstRow():a.getLastRow();r=t.column}else{let h=l.get("enableRtl");n=t.rowIndex,r=(o!==h?c.allCols:[...c.allCols].reverse()).find((p)=>!Oe(p)&&this.isCellGoodToFocusOn({rowIndex:n,rowPinned:null,column:p}))}return r?{rowIndex:n,rowPinned:u,column:r}:null}getNextCellToFocusWithoutCtrlPressed(e,t){let s=t,i=!1;while(!i){switch(e){case b.UP:s=this.getCellAbove(s);break;case b.DOWN:s=this.getCellBelow(s);break;case b.RIGHT:s=this.gos.get("enableRtl")?this.getCellToLeft(s):this.getCellToRight(s);break;case b.LEFT:s=this.gos.get("enableRtl")?this.getCellToRight(s):this.getCellToLeft(s);break;default:s=null,F(8,{key:e});break}if(s)i=this.isCellGoodToFocusOn(s);else i=!0}return s}isCellGoodToFocusOn(e){let t=e.column,s,{pinnedRowModel:i,rowModel:o}=this.beans;switch(e.rowPinned){case"top":s=i?.getPinnedTopRow(e.rowIndex);break;case"bottom":s=i?.getPinnedBottomRow(e.rowIndex);break;default:s=o.getRow(e.rowIndex);break}if(!s)return!1;return!this.isSuppressNavigable(t,s)}getCellToLeft(e){if(!e)return null;let t=this.beans.visibleCols.getColBefore(e.column);if(!t)return null;return{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}}getCellToRight(e){if(!e)return null;let t=this.beans.visibleCols.getColAfter(e.column);if(!t)return null;return{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}}getCellBelow(e){if(!e)return null;let{beans:t}=this,s=t.rowSpanSvc?.getCellEnd(e)??e,i=ye(t,s,!0);if(i)return{rowIndex:i.rowIndex,column:e.column,rowPinned:i.rowPinned};return null}getCellAbove(e){if(!e)return null;let{beans:t}=this,s=t.rowSpanSvc?.getCellStart(e)??e,i=Ye(t,{rowIndex:s.rowIndex,rowPinned:s.rowPinned},!0);if(i)return{rowIndex:i.rowIndex,column:e.column,rowPinned:i.rowPinned};return null}getNextTabbedCell(e,t){if(t)return this.getNextTabbedCellBackwards(e);return this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){let{visibleCols:t,pagination:s}=this.beans,i=t.allCols,{rowIndex:o,rowPinned:r}=e,n=t.getColAfter(e.column);if(!n){n=i[0];let a=ye(this.beans,e,!0);if(q(a))return null;if(!a.rowPinned&&!(s?.isRowInPage(a.rowIndex)??!0))return null;o=a?a.rowIndex:null,r=a?a.rowPinned:null}return{rowIndex:o,column:n,rowPinned:r}}getNextTabbedCellBackwards(e){let{beans:t}=this,{visibleCols:s,pagination:i}=t,o=s.allCols,{rowIndex:r,rowPinned:n}=e,a=s.getColBefore(e.column);if(!a){a=k(o);let l=Ye(t,{rowIndex:e.rowIndex,rowPinned:e.rowPinned},!0);if(q(l))return null;if(!l.rowPinned&&!(i?.isRowInPage(l.rowIndex)??!0))return null;r=l?l.rowIndex:null,n=l?l.rowPinned:null}return{rowIndex:r,column:a,rowPinned:n}}isSuppressNavigable(e,t){let{suppressNavigable:s}=e.colDef;if(typeof s==="boolean")return s;if(typeof s==="function"){let i=e.createColumnFunctionCallbackParams(t);return s(i)}return!1}};function rR(e){return e.focusSvc.getFocusedCell()}function nR(e){return e.focusSvc.clearFocusedCell()}function aR(e,t,s,i){e.focusSvc.setFocusedCell({rowIndex:t,column:s,rowPinned:i,forceBrowserFocus:!0})}function lR(e,t){return e.navigation?.tabToNextCell(!1,t)??!1}function cR(e,t){return e.navigation?.tabToNextCell(!0,t)??!1}function dR(e,t,s=!1){let i=e.headerNavigation?.getHeaderPositionForColumn(t,s);if(!i)return;e.focusSvc.focusHeaderPosition({headerPosition:i})}function as(e){let t=e;return t?.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}var uR=class extends y{constructor(){super(...arguments);this.beanName="editModelSvc",this.edits=new Map,this.cellValidations=new Bp,this.rowValidations=new Vp,this.suspendEdits=!1}suspend(e){this.suspendEdits=e}removeEdits({rowNode:e,column:t}){if(!this.hasEdits({rowNode:e})||!e)return;let s=this.getEditRow(e);if(t)s.delete(t);else s.clear();if(s.size===0)this.edits.delete(e)}getEditRow(e,t={}){if(this.suspendEdits)return;if(this.edits.size===0)return;let s=e&&this.edits.get(e);if(s)return s;if(t.checkSiblings){let i=e.pinnedSibling;if(i)return this.getEditRow(i)}return}getEditRowDataValue(e,{checkSiblings:t}={}){if(!e||this.edits.size===0)return;let s=this.getEditRow(e),i=e.pinnedSibling,o=t&&i&&this.getEditRow(i);if(!s&&!o)return;let r={...e.data},n=(a,l)=>a.forEach(({editorValue:c,pendingValue:d},u)=>{let h=c===void 0?d:c;if(h!==ke)l[u.getColId()]=h});if(s)n(s,r);if(o)n(o,r);return r}getEdit(e={},t){let{rowNode:s,column:i}=e,o=this.edits;if(this.suspendEdits||o.size===0||!s||!i)return;let r=o.get(s)?.get(i);if(r)return r;if(t?.checkSiblings){let n=s.pinnedSibling;if(n)return o.get(n)?.get(i)}return}getEditMap(e=!0){if(this.suspendEdits||this.edits.size===0)return new Map;if(!e)return this.edits;let t=new Map;return this.edits.forEach((s,i)=>{let o=new Map;s.forEach(({editorState:r,...n},a)=>o.set(a,{...n})),t.set(i,o)}),t}setEditMap(e){this.edits.clear(),e.forEach((t,s)=>{let i=new Map;t.forEach((o,r)=>i.set(r,{...o})),this.edits.set(s,i)})}setEdit(e,t){let s=this.edits;if(s.size===0||!s.has(e.rowNode))s.set(e.rowNode,new Map);let i=this.getEdit(e),o={editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0},...i,...t};return this.getEditRow(e.rowNode).set(e.column,o),o}clearEditValue(e){let{rowNode:t,column:s}=e;if(!t)return;let i=(r)=>{r.editorValue=void 0,r.pendingValue=r.sourceValue,r.state="changed"};if(!s){this.getEditRow(t)?.forEach(i);return}let o=this.getEdit(e);if(o)i(o)}getState(e){if(this.suspendEdits)return;return this.getEdit(e)?.state}getEditPositions(e){if(this.suspendEdits||(e??this.edits).size===0)return[];let t=[];return(e??this.edits).forEach((s,i)=>{for(let o of s.keys()){let{editorState:r,...n}=s.get(o);t.push({rowNode:i,column:o,...n})}}),t}hasRowEdits(e,t){if(this.suspendEdits)return!1;if(this.edits.size===0)return!1;return!!this.getEditRow(e,t)}hasEdits(e={},t={}){if(this.suspendEdits)return!1;if(this.edits.size===0)return!1;let{rowNode:s,column:i}=e,{withOpenEditor:o}=t;if(s){let r=this.getEditRow(s,t);if(!r)return!1;if(i){if(o)return this.getEdit(e)?.state==="editing";return r.has(i)}if(r.size!==0){if(o)return Array.from(r.values()).some(({state:n})=>n==="editing");return!0}return!1}if(o)return this.getEditPositions().some(({state:r})=>r==="editing");return this.edits.size>0}start(e){let t=this.getEditRow(e.rowNode)??new Map,{rowNode:s,column:i}=e;if(i&&!t.has(i))t.set(i,{editorValue:void 0,pendingValue:ke,sourceValue:this.beans.valueSvc.getValue(i,s,"data"),state:"editing",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}});this.edits.set(s,t)}stop(e,t,s){if(!this.hasEdits(e))return;if(t){let i=this.getEditRow(e.rowNode)?.get(e.column);if(i&&(i.pendingValue===ke||i.pendingValue===i.sourceValue))this.removeEdits(e);else if(i&&s)i.editorValue=void 0}else this.removeEdits(e)}clear(){for(let e of this.edits.values())e.clear();this.edits.clear()}getCellValidationModel(){return this.cellValidations}getRowValidationModel(){return this.rowValidations}setCellValidationModel(e){this.cellValidations=e}setRowValidationModel(e){this.rowValidations=e}destroy(){super.destroy(),this.clear()}},Bp=class{constructor(){this.cellValidations=new Map}getCellValidation(e){let{rowNode:t,column:s}=e||{};return this.cellValidations?.get(t)?.get(s)}hasCellValidation(e){if(!e?.rowNode||!e.column)return this.cellValidations.size>0;return!!this.getCellValidation(e)}setCellValidation(e,t){let{rowNode:s,column:i}=e;if(!this.cellValidations.has(s))this.cellValidations.set(s,new Map);this.cellValidations.get(s).set(i,t)}clearCellValidation(e){let{rowNode:t,column:s}=e;this.cellValidations.get(t)?.delete(s)}setCellValidationMap(e){this.cellValidations=e}getCellValidationMap(){return this.cellValidations}clearCellValidationMap(){this.cellValidations.clear()}},Vp=class{constructor(){this.rowValidations=new Map}getRowValidation(e){let{rowNode:t}=e||{};return this.rowValidations.get(t)}hasRowValidation(e){if(!e?.rowNode)return this.rowValidations.size>0;return!!this.getRowValidation(e)}setRowValidation({rowNode:e},t){this.rowValidations.set(e,t)}clearRowValidation({rowNode:e}){this.rowValidations.delete(e)}setRowValidationMap(e){this.rowValidations=e}getRowValidationMap(){return this.rowValidations}clearRowValidationMap(){this.rowValidations.clear()}};function hn(e,t={}){let{rowIndex:s,rowId:i,rowCtrl:o,rowPinned:r}=t;if(o)return o;let{rowModel:n,rowRenderer:a}=e,{rowNode:l}=t;if(!l){if(i)l=Nb(e,i,r);else if(s!=null)l=n.getRow(s)}return l?a.getRowCtrlByNode(l):void 0}function Z(e,t={}){let{cellCtrl:s,colId:i,columnId:o,column:r}=t;if(s)return s;let n=e.colModel.getCol(i??o??yl(r)),a=t.rowCtrl??hn(e,t),l=a?.getCellCtrl(n)??void 0;if(l)return l;let c=t.rowNode??a?.rowNode;if(c)return e.rowRenderer.getCellCtrls([c],[n])?.[0];return}function Nu(e){let{editSvc:t}=e;if(t?.isBatchEditing())Fs(e,{persist:!0}),xs(e);else t?.stopEditing(void 0,{source:"api"})}function hR(e,t,s){let{gos:i,popupSvc:o}=t;if(!i.get("stopEditingWhenCellsLoseFocus"))return;let r=(n)=>{let a=n.relatedTarget;if(pl(a)===null){Nu(t);return}let l=s.some((c)=>c.contains(a))&&i.isElementInThisInstance(a);if(!l)l=!!o&&(o.getActivePopups().some((c)=>c.contains(a))||o.isElementWithinCustomPopup(a));if(!l)Nu(t)};for(let n of s)e.addManagedElementListeners(n,{focusout:r})}function yl(e){if(!e)return;if(typeof e==="string")return e;return e.getColId()}var ke=Symbol("unedited"),gR=(e,t={})=>{let s=e.rowRenderer.getCellCtrls(t.rowNodes,t.columns),i=Array(s.length),o=0;for(let r=0,n=s.length;r<n;++r){let l=s[r].comp?.getCellEditor();if(l)i[o++]=as(l)}return i.length=o,i};function pR(e,t,s,i,o,r){if(t.length===0&&s?.rowNode&&s?.column)di(e,s,{key:i,event:o,cellStartedEdit:r});let{valueSvc:n,editSvc:a,editModelSvc:l}=e,{rowNode:c,column:d}=s??{};for(let u of t){let{rowNode:h,column:g}=u,p=Z(e,u);if(!p){if(h&&g){let m=n.getValue(g,h,"data"),w=(s?.rowNode===h&&s?.column===g&&i||void 0)??a?.getCellDataValue(u)??n.getValueForDisplay({column:g,node:h,from:"edit"})?.value??m??ke;l?.setEdit(u,{pendingValue:$i(e,w,!1,g),sourceValue:m,state:"editing"})}continue}let f=r&&c===p.rowNode&&p.column===d;di(e,{rowNode:c,column:p.column},{key:f?i:null,event:f?o:null,cellStartedEdit:f&&r})}}function Tt({pendingValue:e,sourceValue:t}){if(e===ke)e=t;return e!==t}function fR(e){let t=new Map;for(let[s,i]of e){let o=new Map;for(let[r,n]of i)if(Tt(n))o.set(r,n);if(o.size>0)t.set(s,o)}return t}function di(e,t,s){let{key:i,event:o,cellStartedEdit:r,silent:n}=s??{},{editModelSvc:a,gos:l,userCompFactory:c}=e,d=Z(e,t),u=d?.comp?.getCellEditor(),h=_p(e,t,i,r&&!n),g=a?.getEdit(t),p=h.value??g?.sourceValue;if(u){a?.setEdit(t,{editorValue:$i(e,p,!0,t.column),state:"editing"}),u.refresh?.(h);return}let f=t.column.getColDef(),m=xg(c,f,h);if(!m)return;let{popupFromSelector:C,popupPositionFromSelector:v}=m,w=C??!!f.cellEditorPopup,S=v??f.cellEditorPopupPosition;if(Hp(m.params,o),!d)return;let{rangeFeature:x,rowCtrl:R,comp:P,onEditorAttachedFuncs:D}=d;a?.setEdit(t,{editorValue:$i(e,p,!0,t.column),state:"editing",editorState:{cellStartedEditing:void 0,cellStoppedEditing:void 0}}),d.editCompDetails=m,D.push(()=>x?.unsetComp()),P?.setEditDetails(m,w,S,l.get("reactiveCustomComponents")),R?.refreshRow({suppressFlash:!0}),d.refreshNoteState(),mR(e,t,o,p,n)}function mR(e,t,s,i,o){let{editSvc:r,editModelSvc:n}=e,a=n?.getEdit(t);if(!o&&a?.state==="editing"&&!a?.editorState?.cellStartedEditing)r?.dispatchCellEvent(t,s,"cellEditingStarted",{value:i}),n?.setEdit(t,{editorState:{cellStartedEditing:!0}})}function Np(e,t,s){let i={editorValueExists:!1};if(Oc(e)){if((t.getValidationErrors?.()?.length??0)>0)return i}if(s?.isCancelling)return i;if(s?.isStopping){let r=t?.isCancelAfterEnd?.();if(r)return{...i,isCancelAfterEnd:r}}return{editorValue:t.getValue(),editorValueExists:!0}}function _p(e,t,s,i){let{valueSvc:o,gos:r,editSvc:n}=e,a=e.gos.get("enableGroupEdit"),l=Z(e,t),c=t.rowNode?.rowIndex??void 0,d=n?.isBatchEditing(),u=e.colModel.getCol(t.column.getId()),{rowNode:h,column:g}=t,p=l.comp?.getCellEditor(),f=n?.getCellDataValue(t),m=f===void 0?p?Np(e,p)?.editorValue:void 0:f,C=m===ke?o.getValueForDisplay({column:u,node:h,from:"edit"})?.value:m,v=a?m:C;if(g.isAllowFormula()&&e.formula?.isFormula(v))v=e.formula?.normaliseFormula(v,!0)??v;return I(r,{value:v,eventKey:s??null,column:g,colDef:g.getColDef(),rowIndex:c,node:h,data:h.data,cellStartedEdit:!!i,onKeyDown:l?.onKeyDown.bind(l),stopEditing:(w)=>{n.stopEditing(t,{source:d?"ui":"api",suppressNavigateAfterEdit:w}),No(e,t,{})},eGridCell:l?.eGui,parseValue:(w)=>o.parseValue(u,h,w,l?.value),formatValue:l?.formatValue.bind(l),validate:()=>{n?.validateEdit()}})}function So(e,t){let{editModelSvc:s}=e;s?.getEditMap().forEach((i,o)=>{i.forEach((r,n)=>{if(!t&&(r.state==="editing"||r.pendingValue===ke))return;if(!Tt(r)&&(r.state!=="editing"||t))s?.removeEdits({rowNode:o,column:n})})})}function CR(e,t){let s=t.comp?.getCellEditor();if(!s?.refresh)return;let{eventKey:i,cellStartedEdit:o}=t.editCompDetails.params,{column:r}=t,n=_p(e,t,i,o),a=r.getColDef(),l=xg(e.userCompFactory,a,n);s.refresh(Hp(l.params,i))}function Hp(e,t){if(t instanceof KeyboardEvent&&e.column.getColDef().cellEditor==="agNumberCellEditor")e.suppressPreventDefault=["-","+",".","e"].includes(t?.key??"")||e.suppressPreventDefault;else t?.preventDefault?.();return e}function Fs(e,t){for(let s of e.editModelSvc?.getEditPositions()??[]){let i=Z(e,s);if(!i)continue;let o=i.comp?.getCellEditor();if(!o)continue;let{editorValue:r,editorValueExists:n,isCancelAfterEnd:a}=Np(e,o,t);if(a){let{cellStartedEditing:l,cellStoppedEditing:c}=e.editModelSvc?.getEdit(s)?.editorState||{};e.editModelSvc?.setEdit(s,{editorState:{isCancelAfterEnd:a,cellStartedEditing:l,cellStoppedEditing:c}})}Mi(e,s,r,void 0,!n,t)}}function Mi(e,t,s,i,o,r){let{editModelSvc:n,valueSvc:a}=e;if(!n)return;let{rowNode:l,column:c}=t;if(!(l&&c))return;let d=n.getEdit(t);if(d?.sourceValue===void 0){let u=d?$i(e,d.editorValue,!1,c):ke,h={sourceValue:a.getValue(c,l,"data"),pendingValue:u};if(r?.persist)h.state="changed";d=n.setEdit(t,h)}if(n.setEdit(t,{editorValue:o?$i(e,d.sourceValue,!0,c):s}),r?.persist)vR(e,t)}function $i(e,t,s,i){let{formula:o}=e;if(i.isAllowFormula()&&o?.isFormula(t))return o?.normaliseFormula(t,s)??t;return t}function vR(e,t){let{editModelSvc:s}=e,i=s?.getEdit(t),r={pendingValue:$i(e,i?.editorValue,!1,t.column)};if(!i?.editorState?.cellStoppedEditing&&i?.state!=="editing")r.state="changed";s?.setEdit(t,r)}function xs(e,t,s={}){if(!t)t=e.editModelSvc?.getEditPositions();if(t)for(let i of t)No(e,i,s)}function No(e,t,s,i=Z(e,t)){let o=e.editModelSvc,r=o?.getEdit(t),n;if(r&&r.state!=="editing"&&r.editorState?.cellStoppedEditing)n=r.state;else n="changed";if(!i){if(r)o?.setEdit(t,{state:n});return}let a=i.comp,l=a?.getCellEditor();if(a&&!l){if(i?.refreshCell(),r){o?.setEdit(t,{state:n});let d=e.gos.get("enableGroupEdit")?_u(r,s?.cancel):{valueChanged:!1,newValue:void 0,oldValue:r.sourceValue};Hu(e,t,d,s)}return}if(Oc(e)){let d=r&&l?.getValidationErrors?.(),u=o?.getCellValidationModel();if(d?.length)u?.setCellValidation(t,{errorMessages:d});else u?.clearCellValidation(t)}if(r)o?.setEdit(t,{state:n});a?.setEditDetails(),a?.refreshEditStyles(!1,!1),i?.refreshCell({force:!0,suppressFlash:!0});let c=o?.getEdit(t);if(c&&c.state!=="editing"){let d=s?.cancel,u=e.gos.get("enableGroupEdit")?_u(c,d):wR(c,r,d);Hu(e,t,u,s)}}function _u(e,t){let{sourceValue:s,pendingValue:i}=e,o;if(!t&&i!==ke)o=i;return{valueChanged:!t&&Tt(e),newValue:o,oldValue:s,value:s}}function wR(e,t,s){if(s||e.editorState.isCancelAfterEnd)return{valueChanged:!1,newValue:void 0,oldValue:e.sourceValue};let i=e.editorValue;if(i==null||i===ke)i=t?.pendingValue;if(i===ke)i=void 0;return{valueChanged:Tt(e),newValue:i,oldValue:e.sourceValue}}function Hu(e,t,s,{silent:i,event:o}={}){let{editSvc:r,editModelSvc:n}=e,a=n?.getEdit(t),{editorState:l}=a||{},{isCancelBeforeStart:c,cellStartedEditing:d,cellStoppedEditing:u}=l||{};if(!i&&!c&&d&&!u)r?.dispatchCellEvent(t,o,"cellEditingStopped",s),n?.setEdit(t,{editorState:{cellStoppedEditing:!0}})}function bR(e){if(!e)return!1;for(let t=0,s=e.length;t<s;++t){let i=e[t],o=i.cellEditorParams;if(!o||!i.editable&&!i.groupRowEditable)continue;if(o.minLength!==void 0||o.maxLength!==void 0||o.getValidationErrors!==void 0||o.min!==void 0||o.max!==void 0)return!0}return!1}function SR(e){let t=e.rowRenderer.getCellCtrls();for(let s=0,i=t.length;s<i;++s){let r=t[s].comp?.getCellEditor();if(r){let n=as(r);if(n.getValidationElement||n.getValidationErrors)return!0}}return!1}function Oc(e){return!!e.gos.get("getFullRowEditValidationErrors")||bR(e.colModel.getColumnDefs())||SR(e)}function Ts(e,t){if(!(t||Oc(e)))return;let s=new Bp,{ariaAnnounce:i,localeSvc:o,editModelSvc:r,gos:n}=e,a=n.get("editType")==="fullRow",c=Bh(o)("ariaValidationErrorPrefix","Cell Editor Validation"),d=new Set;for(let u of e.rowRenderer.getCellCtrls()){let h=u.comp?.getCellEditor();if(!h)continue;let g=as(h),{rowNode:p,column:f}=u,m=g.getValidationErrors?.()??[],C=g.getValidationElement?.(!1)||!g.isPopup?.()&&u.eGui;if(C){let v=m!=null&&m.length>0,w=v?m.join(". "):"";if(Vl(C,v),v)i.announceValue(`${c} ${m}`,"editorValidation");if(C instanceof HTMLInputElement)C.setCustomValidity(w);else C.classList.toggle("invalid",v)}if(m?.length>0)s.setCellValidation({rowNode:p,column:f},{errorMessages:m});d.add(u.rowCtrl)}if(Fs(e,{persist:!1}),r?.setCellValidationModel(s),a){let u=yR(e);r?.setRowValidationModel(u)}for(let u of d.values()){u.rowEditStyleFeature?.applyRowStyles();for(let h of u.getAllCellCtrls())h.tooltipFeature?.refreshTooltip(!0),h.editorTooltipFeature?.refreshTooltip(!0),h.editStyleFeature?.applyCellStyles?.()}}var yR=(e)=>{let t=new Vp,s=e.gos.get("getFullRowEditValidationErrors"),i=e.editModelSvc?.getEditMap();if(!i)return t;for(let o of i.keys()){let r=i.get(o);if(!r)continue;let n=[],{rowIndex:a,rowPinned:l}=o;for(let d of r.keys()){let u=r.get(d);if(!u)continue;let{editorValue:h,pendingValue:g,sourceValue:p}=u,f=h??(g===ke?void 0:g)??p;n.push({column:d,colId:d.getColId(),rowIndex:a,rowPinned:l,oldValue:p,newValue:f})}let c=s?.({editorsState:n})??[];if(c.length>0)t.setRowValidation({rowNode:o},{errorMessages:c})}return t};function xR(e){Ts(e,!0);let t=e.editModelSvc?.getCellValidationModel().getCellValidationMap();if(!t)return null;let s=[];return t.forEach((i,o)=>{i.forEach(({errorMessages:r},n)=>{s.push({column:n,rowIndex:o.rowIndex,rowPinned:o.rowPinned,messages:r??null})})}),s}function zn(e){return!!(e.rowPinned&&e.pinnedSibling)}function it(e,t,s,i){let o=t==="top";if(!s)return it(e,t,o?e.getPinnedTopRow(0):e.getPinnedBottomRow(0),i);if(!i){let l=o?e.getPinnedTopRowCount():e.getPinnedBottomRowCount();return it(e,t,s,o?e.getPinnedTopRow(l-1):e.getPinnedBottomRow(l-1))}let r=!1,n=!1,a=[];return e.forEachPinnedRow(t,(l)=>{if(l===s&&!r){r=!0,a.push(l);return}if(r&&l===i){n=!0,a.push(l);return}if(r&&!n)a.push(l)}),a}function RR(e,t,s,{rowNode:i,column:o},r){return I(e.gos,{type:s,node:i,data:i.data,value:r,column:o,colDef:o.getColDef(),rowPinned:i.rowPinned,event:t,rowIndex:i.rowIndex})}function FR(e,t=!1){if(e===b.DELETE)return!0;if(!t&&e===b.BACKSPACE)return Mg();return!1}var ER=class extends y{constructor(e,t,s,i){super();this.cellCtrl=e,this.rowNode=s,this.rowCtrl=i,this.beans=t}init(){this.eGui=this.cellCtrl.eGui}onKeyDown(e){let t=e.key;if(t===b.ENTER&&Oe(this.cellCtrl.column)&&this.beans.rowNumbersSvc?.handleKeyDownOnCell(this.cellCtrl.cellPosition,e))return;switch(t){case b.ENTER:this.onEnterKeyDown(e);break;case b.F2:this.onF2KeyDown(e);break;case b.ESCAPE:this.onEscapeKeyDown(e);break;case b.TAB:this.onTabKeyDown(e);break;case b.BACKSPACE:case b.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case b.DOWN:case b.UP:case b.RIGHT:case b.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){let{cellCtrl:s,beans:i}=this;if(i.editSvc?.isEditing(s,{withOpenEditor:!0}))return;if(e.shiftKey&&s.isRangeSelectionEnabled())this.onShiftRangeSelect(e);else{let o=s.getFocusedCellPosition();i.navigation?.navigateToNextCell(e,t,o,!0)}e.preventDefault()}onShiftRangeSelect(e){let{rangeSvc:t,navigation:s}=this.beans;if(!t)return;let i=t.extendLatestRangeInDirection(e);if(!i)return;if(e.key===b.LEFT||e.key===b.RIGHT)s?.ensureColumnVisible(i.column);else s?.ensureRowVisible(i.rowIndex)}onTabKeyDown(e){this.beans.navigation?.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){let{cellCtrl:s,beans:i,rowNode:o}=this,{gos:r,rangeSvc:n,eventSvc:a,editSvc:l}=i;if(a.dispatchEvent({type:"keyShortcutChangedCellStart"}),FR(e,r.get("enableCellEditingOnBackspace"))&&!l?.isEditing(s,{withOpenEditor:!0})){if(n&&qe(r))n.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(s.isCellEditable()){let c=i.valueSvc.getDeleteValue(s.column,o);o.setDataValue(s.column,c,"cellClear")}}else if(!l?.isEditing(s,{withOpenEditor:!0}))i.editSvc?.startEditing(s,{startedEdit:!0,event:t});a.dispatchEvent({type:"keyShortcutChangedCellEnd"})}onEnterKeyDown(e){let{cellCtrl:t,beans:s}=this,{editSvc:i,navigation:o}=s,r=i?.isEditing(t,{withOpenEditor:!0}),n=t.rowNode,a=i?.isRowEditing(n,{withOpenEditor:!0}),l=(c)=>{if(i?.startEditing(c,{startedEdit:!0,event:e,source:"edit"}))e.preventDefault()};if(r||a){if(this.isCtrlEnter(e)){i?.applyBulkEdit(t,s?.rangeSvc?.getCellRanges()||[]);return}if(Ts(s),i?.checkNavWithValidation(void 0,e)==="block-stop")return;if(i?.isEditing(t,{withOpenEditor:!0}))i?.stopEditing(t,{event:e,source:"edit"});else if(a&&!t.isCellEditable())i?.stopEditing({rowNode:n},{event:e,source:"edit"});else l(t)}else if(s.gos.get("enterNavigatesVertically")){let c=e.shiftKey?b.UP:b.DOWN;o?.navigateToNextCell(null,c,t.cellPosition,!1)}else{if(i?.hasValidationErrors())return;if(i?.hasValidationErrors(t))i.revertSingleCellEdit(t,!0);l(t)}}isCtrlEnter(e){return(e.ctrlKey||e.metaKey)&&e.key===b.ENTER}onF2KeyDown(e){let{cellCtrl:t,beans:{editSvc:s,notesSvc:i}}=this,o=s?.isEditing();if(e.shiftKey&&i?.hasDataSource()&&!o){let r=i.getNoteAccess({rowNode:this.rowNode,column:t.column});if(r){if(!r.isSuppressed||r.canView){i.showNote(r.params,!0),e.preventDefault();return}}}if(o){if(Ts(this.beans),s?.checkNavWithValidation(void 0,e)==="block-stop")return}s?.startEditing(t,{startedEdit:!0,event:e})}onEscapeKeyDown(e){let{cellCtrl:t,beans:{editSvc:s}}=this;if(s?.checkNavWithValidation(t,e)==="block-stop")s.revertSingleCellEdit(t);setTimeout(()=>{s?.stopEditing(t,{event:e,cancel:!0})})}processCharacter(e){let s=e.target!==this.eGui,{beans:{editSvc:i},cellCtrl:o}=this;if(s)return;if(i?.isEditing(o,{withOpenEditor:!0}))return;if(e.key===b.SPACE)this.onSpaceKeyDown(e);else if(i?.isCellEditable(o,"ui")){if(i?.hasValidationErrors()&&!i?.hasValidationErrors(o))return;if(i?.startEditing(o,{startedEdit:!0,event:e,source:"api",editable:!0}),!o.editCompDetails?.params?.suppressPreventDefault)e.preventDefault()}}onSpaceKeyDown(e){let{gos:t,editSvc:s}=this.beans,{rowNode:i}=this.cellCtrl;if(!s?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&ss(t))this.beans.selectionSvc?.handleSelectionEvent(e,i,"spaceKey");e.preventDefault()}},PR=class extends y{constructor(e,t,s){super();this.cellCtrl=e,this.column=s,this.beans=t}onMouseEvent(e,t){if(ut(t))return;switch(e){case"click":this.onCellClicked(t);break;case"pointerdown":case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t);break}}onCellClicked(e){if(this.beans.touchSvc?.handleCellDoubleClick(this,e))return;let{eventSvc:t,rangeSvc:s,editSvc:i,editModelSvc:o,frameworkOverrides:r,gos:n}=this.beans,a=e.ctrlKey||e.metaKey,{cellCtrl:l}=this,{column:c,cellPosition:d,rowNode:u}=l,h=Wr(n,c,u,e);if(s&&a&&!h){if(s.getCellRangeCount(d)>1)s.intersectLastRange(!0)}let g=l.createEvent(e,"cellClicked");g.isEventHandlingSuppressed=h,t.dispatchEvent(g);let p=c.colDef;if(p.onCellClicked)window.setTimeout(()=>{r.wrapOutgoing(()=>{p.onCellClicked(g)})},0);if(h)return;if(o?.getState(l)!=="editing"){let f=i?.isEditing(),m=i?.isRangeSelectionEnabledWhileEditing(),C=o?.getCellValidationModel().getCellValidationMap().size??0,v=o?.getRowValidationModel().getRowValidationMap().size??0;if(f&&(m||C>0||v>0))return;if(i?.shouldStartEditing(l,e))i?.startEditing(l,{event:e});else if(i?.shouldStopEditing(l,e))if(this.beans.gos.get("editType")==="fullRow")i?.stopEditing(l,{event:e,source:"edit"});else i?.stopEditing(void 0,{event:e,source:"edit"})}}onCellDoubleClicked(e){let{column:t,beans:s,cellCtrl:i}=this,{eventSvc:o,frameworkOverrides:r,editSvc:n,editModelSvc:a,gos:l}=s,c=Wr(l,i.column,i.rowNode,e),d=t.colDef,u=i.createEvent(e,"cellDoubleClicked");if(u.isEventHandlingSuppressed=c,o.dispatchEvent(u),typeof d.onCellDoubleClicked==="function")window.setTimeout(()=>{r.wrapOutgoing(()=>{d.onCellDoubleClicked(u)})},0);if(c)return;if(n?.shouldStartEditing(i,e)&&a?.getState(i)!=="editing"){let h=n?.isEditing(),g=n?.isRangeSelectionEnabledWhileEditing(),p=a?.getCellValidationModel().getCellValidationMap().size??0,f=a?.getRowValidationModel().getRowValidationMap().size??0;if(h&&(g||p>0||f>0))return;n?.startEditing(i,{event:e})}}onMouseDown(e){let{shiftKey:t}=e,s=e.target,{cellCtrl:i,beans:o}=this,{eventSvc:r,rangeSvc:n,rowNumbersSvc:a,focusSvc:l,gos:c,editSvc:d}=o,{column:u,rowNode:h,cellPosition:g}=i,p=Wr(c,u,h,e),f=()=>{let w=i.createEvent(e,"cellMouseDown");w.isEventHandlingSuppressed=p,r.dispatchEvent(w)};if(p){f();return}if(this.isRightClickInExistingRange(e))return;let m=n&&!n.isEmpty(),C=this.containsWidget(s),v=Oe(u);if(a&&v&&!a.handleMouseDownOnCell(g,e))return;if(!t||!m){let w=d?.isEditing(i),x=c.get("enableCellTextSelection")&&e.defaultPrevented,R=(Os()||x)&&!w&&!yo(s)&&!C;i.focusCell(R,e)}if(t&&m&&!l.isCellFocused(g)){e.preventDefault();let w=l.getFocusedCell();if(w){let{column:S,rowIndex:x,rowPinned:R}=w,P=!!d?.isRangeSelectionEnabledWhileEditing?.();if(d?.isEditing(w)&&!P)d?.stopEditing(w);if(!P)l.setFocusedCell({column:S,rowIndex:x,rowPinned:R,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,sourceEvent:e})}}if(C)return;n?.handleCellMouseDown(e,g),f()}isRightClickInExistingRange(e){let{rangeSvc:t}=this.beans;if(t){let s=t.isCellInAnyRange(this.cellCtrl.cellPosition),i=Jl(this.beans,e);if(s&&i)return!0}return!1}containsWidget(e){return ti(e,"ag-selection-checkbox",3)||ti(e,"ag-drag-handle",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;let{eventSvc:t,colHover:s}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOut")),s?.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;let{eventSvc:t,colHover:s}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOver")),s?.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;let t=this.cellCtrl.eGui,s=t.contains(e.target),i=t.contains(e.relatedTarget);return s&&i}},MR=class extends y{constructor(e,t){super();this.cellCtrl=e,this.beans=t,this.column=e.column,this.rowNode=e.rowNode;let s=e.getCellSpan();if(s){let i=this.refreshSpanHeight.bind(this,s);this.addManagedListeners(this.beans.eventSvc,{paginationChanged:i,recalculateRowBounds:i,pinnedHeightChanged:i})}else this.setupColSpan(),this.setupRowSpan()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventSvc,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}init(){this.onLeftChanged(),this.onWidthChanged();let e=this.cellCtrl.getCellSpan();if(e)this.refreshSpanHeight(e);else this._legacyApplyRowSpan()}refreshSpanHeight(e){let t=e.getCellHeight(),s=this.cellCtrl.eGui;if(t!=null&&s)s.style.height=`${t}px`}onNewColumnsLoaded(){let e=this.column.getRowSpan(this.rowNode);if(this.rowSpan===e)return;this.rowSpan=e,this._legacyApplyRowSpan(!0)}onDisplayColumnsChanged(){let e=this.getColSpanningList();if(!se(this.colsSpanning,e))this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged()}setupColSpan(){if(this.column.colDef.colSpan==null)return;this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)})}onWidthChanged(){let e=this.cellCtrl.eGui;if(!e)return;e.style.width=`${this.getCellWidth()}px`}getCellWidth(){if(!this.colsSpanning)return this.column.getActualWidth();return this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0)}getColSpanningList(){let{column:e,rowNode:t}=this,s=e.getColSpan(t),i=[];if(s===1)i.push(e);else{let o=e,r=e.getPinned();for(let n=0;o&&n<s;n++){if(i.push(o),o=this.beans.visibleCols.getColAfter(o),!o||q(o))break;if(r!==o.getPinned())break}}return i}onLeftChanged(){let e=this.cellCtrl.getRootElement();if(!e)return;e.style.left=this.modifyLeftForPrintLayout(this.getCellLeft())+"px"}getCellLeft(){let e;if(this.beans.gos.get("enableRtl")&&this.colsSpanning)e=k(this.colsSpanning);else e=this.column;return e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.printLayout||this.column.getPinned()==="left")return e;let{visibleCols:t}=this.beans,s=t.getColsLeftWidth();if(this.column.getPinned()==="right"){let i=t.bodyWidth;return s+i+(e||0)}return s+(e||0)}_legacyApplyRowSpan(e){if(this.rowSpan===1&&!e)return;let t=this.cellCtrl.eGui;if(!t)return;let s=Qh(this.beans);t.style.height=`${s*this.rowSpan}px`,t.style.zIndex="1"}destroy(){super.destroy()}},TR="ag-cell",DR="ag-cell-auto-height",AR="ag-cell-normal-height",IR="ag-cell-focus",kR="ag-cell-first-right-pinned",LR="ag-cell-last-left-pinned",GR="ag-cell-not-inline-editing",OR="ag-cell-wrap-text",BR=0,Eo=class extends y{constructor(e,t,s,i){super();this.column=e,this.rowNode=t,this.rowCtrl=i,this.rangeFeature=void 0,this.rowResizeFeature=void 0,this.notesFeature=void 0,this.positionFeature=void 0,this.customStyleFeature=void 0,this.editStyleFeature=void 0,this.mouseListener=void 0,this.keyboardListener=void 0,this.suppressRefreshCell=!1,this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[],this.focusEventWhileNotReady=null,this.hasBeenFocused=!1,this.hasEdit=!1,this.tooltipFeature=void 0,this.editorTooltipFeature=void 0,this.beans=s,this.gos=s.gos,this.editSvc=s.editSvc,this.hasEdit=!!s.editSvc;let{colId:o}=e;this.instanceId=o+"-"+BR++,this.createCellPosition(),this.updateAndFormatValue(!1),this.positionFeature=new MR(this,s)}addFeatures(){let{beans:e}=this;this.customStyleFeature=e.cellStyles?.createCellCustomStyleFeature(this),this.editStyleFeature=e.editSvc?.createCellStyleFeature(this),this.mouseListener=new PR(this,e,this.column),this.keyboardListener=new ER(this,e,this.rowNode,this.rowCtrl),this.enableTooltipFeature();let{rangeSvc:t}=e;if(t&&qe(e.gos))this.rangeFeature=t.createCellRangeFeature(this);if(Oe(this.column))this.rowResizeFeature=this.beans.rowNumbersSvc.createRowNumbersRowResizerFeature(this);this.notesFeature=this.beans.notesSvc?.createNotesFeature(this)}isCellSpanning(){return!1}getCellSpan(){return}removeFeatures(){let e=this.beans.context;this.editorTooltipFeature=e.destroyBean(this.editorTooltipFeature),this.customStyleFeature=e.destroyBean(this.customStyleFeature),this.editStyleFeature=e.destroyBean(this.editStyleFeature),this.mouseListener=e.destroyBean(this.mouseListener),this.keyboardListener=e.destroyBean(this.keyboardListener),this.rangeFeature=e.destroyBean(this.rangeFeature),this.rowResizeFeature=e.destroyBean(this.rowResizeFeature),this.notesFeature=e.destroyBean(this.notesFeature),this.disableTooltipFeature()}enableTooltipFeature(e,t){this.tooltipFeature=this.beans.tooltipSvc?.enableCellTooltipFeature(this,e,t)}disableTooltipFeature(){this.tooltipFeature=this.beans.context.destroyBean(this.tooltipFeature)}enableEditorTooltipFeature(e){if(this.editorTooltipFeature)this.disableEditorTooltipFeature();this.editorTooltipFeature=this.beans.tooltipSvc?.setupCellEditorTooltip(this,e),Ts(this.beans)}disableEditorTooltipFeature(){this.editorTooltipFeature=this.beans.context.destroyBean(this.editorTooltipFeature)}setComp(e,t,s,i,o,r,n){this.comp=e,this.eGui=t,this.printLayout=o,n??(n=this),this.addDomData(n),this.addFeatures(),n.addDestroyFunc(()=>this.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.setupFocus(),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i,n),this.refreshFirstAndLastStyles(),this.checkFormulaError(),this.refreshAriaRowIndex(),this.refreshAriaColIndex(),this.positionFeature?.init(),this.customStyleFeature?.setComp(e),this.editStyleFeature?.setComp(e),this.tooltipFeature?.refreshTooltip(),this.keyboardListener?.init(),this.rangeFeature?.setComp(e),this.rowResizeFeature?.refreshRowResizer();let a=r?this.isCellEditable():void 0,l=!a&&this.hasEdit&&this.editSvc?.isEditing(this,{withOpenEditor:!0});if(a||l)this.editSvc?.startEditing(this,{startedEdit:!1,source:"api",silent:!0,continueEditing:!0,editable:a});else this.showValue(!1,!0);if(this.onCompAttachedFuncs.length){for(let c of this.onCompAttachedFuncs)c();this.onCompAttachedFuncs=[]}}checkFormulaError(){if(!this.beans.formula)return;this.eGui.classList.toggle("formula-error",this.hasFormulaError())}hasFormulaError(){let{formula:e}=this.beans;if(!e)return!1;return!!e.getFormulaError(this.column,this.rowNode)}hasCellValidationError(){let{editModelSvc:e}=this.beans;if(!e)return!1;return e.getCellValidationModel().hasCellValidation(this)}setupAutoHeight(e,t){this.isAutoHeight=this.beans.rowAutoHeight?.setupCellAutoHeight(this,e,t)??!1}getCellAriaRole(){return this.column.colDef.cellAriaRole??"gridcell"}isCellRenderer(){let e=this.column.colDef;return e.cellRenderer!=null||e.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}getDeferLoadingCellRenderer(){let{beans:e,column:t}=this,{userCompFactory:s,ctrlsSvc:i,eventSvc:o}=e,r=t.colDef,n=this.createCellRendererParams();n.deferRender=!0;let a=au(s,r,n);if(i.getGridBodyCtrl()?.scrollFeature?.isScrolling()){let l,c=new B((u)=>{l=u}),[d]=this.addManagedListeners(o,{bodyScrollEnd:()=>{l(),d()}});return{loadingComp:a,onReady:c}}return{loadingComp:a,onReady:B.resolve()}}showValue(e,t){let{beans:s,column:i,rowNode:o,rangeFeature:r}=this,{userCompFactory:n}=s,a=this.getValueToDisplay(),l,c=o.stub&&o.groupData?.[i.getId()]==null,d=i.colDef;if(c||this.isCellRenderer()){let u=this.createCellRendererParams();if(!c||Oe(i))l=Ds(n,d,u);else l=au(n,d,u)}if(!l&&!c&&s.findSvc?.isMatch(o,i)){let u=this.createCellRendererParams();l=Ds(n,{...i.colDef,cellRenderer:"agFindCellRenderer"},u)}if(this.hasEdit&&this.editSvc.isBatchEditing()&&this.editSvc.isRowEditing(o,{checkSiblings:!0})){let u=this.editSvc.prepDetailsDuringBatch(this,{compDetails:l,valueToDisplay:a});if(u){if(u.compDetails)l=u.compDetails;else if(u.valueToDisplay)a=u.valueToDisplay}}if(this.comp.setRenderDetails(l,a,e),this.customRowDragComp?.refreshVisibility(),!t&&r)r.scheduleRefreshRangeStyleAndHandle();this.rowResizeFeature?.refreshRowResizer()}setupControlComps(){let e=this.column.colDef;this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(e),!0),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.comp.setIncludeSelection(this.includeSelection),this.comp.setIncludeDndSource(this.includeDndSource),this.comp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}getCellValueClass(){let t=this.column.colDef.cellRenderer==="agCheckboxCellRenderer",s="";if(t)s=" ag-allow-overflow";return`ag-cell-value${s}`}isIncludeControl(e,t=!1){return(this.rowNode.rowPinned==null||t&&zn(this.rowNode))&&!!e}isCheckboxSelection(e){let{rowSelection:t,groupDisplayType:s}=this.beans.gridOptions,i=zi(t),o=Zt(this.column);if(s==="custom"&&i!=="selectionColumn"&&o)return!1;return e.checkboxSelection||o&&typeof t==="object"&&Es(t)}refreshShouldDestroy(){let e=this.column.colDef,t=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(e),!0),s=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),i=this.includeDndSource!=this.isIncludeControl(e.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return t||s||i||o}onPopupEditorClosed(e){let{editSvc:t}=this.beans;if(!t?.isEditing(this,{withOpenEditor:!0}))return;let s=e instanceof KeyboardEvent,i=e instanceof MouseEvent,o=s&&e.key===b.ESCAPE;if(t.stopEditing(this,{source:t.isBatchEditing()?"ui":"api",cancel:o,event:s||i?e:void 0}),o)this.focusCell(!0,e)}stopEditing(e=!1){let{editSvc:t}=this.beans;return t?.stopEditing(this,{cancel:e,source:t?.isBatchEditing()?"ui":"api"})??!1}createCellRendererParams(){let{value:e,valueFormatted:t,column:s,rowNode:i,comp:o,eGui:r,beans:{valueSvc:n,gos:a,editSvc:l}}=this;return I(a,{value:e,valueFormatted:t,getValue:()=>n.getValueForDisplay({column:s,node:i,from:"edit"}).value,setValue:(d)=>l?.setDataValue({rowNode:i,column:s},d)||i.setDataValue(s,d),formatValue:this.formatValue.bind(this),data:i.data,node:i,pinned:s.getPinned(),colDef:s.colDef,column:s,refreshCell:this.refreshCell.bind(this),eGridCell:r,eParentOfValue:o.getParentOfValue(),registerRowDragger:(d,u,h,g)=>this.registerRowDragger(d,u,g),setTooltip:(d,u)=>{if(a.assertModuleRegistered("Tooltip",3),this.tooltipFeature)this.disableTooltipFeature();this.enableTooltipFeature(d,u),this.tooltipFeature?.refreshTooltip()}})}onCellChanged(e){if(e.column===this.column)this.refreshCell()}refreshOrDestroyCell(e){if(this.refreshShouldDestroy())this.rowCtrl?.recreateCell(this);else this.refreshCell(e);if(this.hasEdit&&this.editCompDetails){let{editSvc:t,comp:s}=this;if(!s?.getCellEditor()&&t.isEditing(this,{withOpenEditor:!0}))t.startEditing(this,{startedEdit:!1,source:"api",silent:!0})}}refreshCell(e){let{editStyleFeature:t,customStyleFeature:s,rowCtrl:{rowEditStyleFeature:i},beans:{cellFlashSvc:o,filterManager:r},column:n,comp:a,suppressRefreshCell:l,tooltipFeature:c}=this;if(l)return;let{field:d,valueGetter:u,showRowGroup:h,enableCellChangeFlash:g}=n.colDef,p=d==null&&u==null&&h==null,f=e?.newData??!1,m=p||e&&(e.force||f),C=!!a,v=this.updateAndFormatValue(C),w=m||v;if(!C)return;if(w){this.showValue(!!f,!1);let S=r?.isSuppressFlashingCellsBecauseFiltering();if(!e?.suppressFlash&&!S&&g)o?.flashCell(this);t?.applyCellStyles?.(),s?.applyUserStyles(),s?.applyClassesFromColDef(),i?.applyRowStyles(),this.checkFormulaError()}c?.refreshTooltip(),this.refreshNoteState(),s?.applyCellClassRules()}showNote(e=!1){this.notesFeature?.show({focusEditor:e})}refreshNoteState(){this.notesFeature?.refresh()}isNoteHoverSuppressed(){return!!this.editSvc?.isEditing(this)||this.hasFormulaError()||this.hasCellValidationError()}isCellEditable(){return this.column.isCellEditable(this.rowNode)}formatValue(e){return this.callValueFormatter(e)??e}callValueFormatter(e){return this.beans.valueSvc.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){let t=this.value,s=this.valueFormatted,{value:i,valueFormatted:o}=this.beans.valueSvc.getValueForDisplay({column:this.column,node:this.rowNode,includeValueFormatted:!0,from:"edit"});if(this.value=i,this.valueFormatted=o,e)return!this.valuesAreEqual(t,this.value)||this.valueFormatted!=s;return!0}valuesAreEqual(e,t){let s=this.column.colDef;return s.equals?s.equals(e,t):e===t}addDomData(e){let t=this.eGui;ai(this.beans.gos,t,ln,this),e.addDestroyFunc(()=>ai(this.beans.gos,t,ln,null))}createEvent(e,t){let{rowNode:s,column:i,value:o,beans:r}=this;return RR(r,e,t,{rowNode:s,column:i},o)}processCharacter(e){this.keyboardListener?.processCharacter(e)}onKeyDown(e){this.keyboardListener?.onKeyDown(e)}onMouseEvent(e,t){this.mouseListener?.onMouseEvent(e,t)}getColSpanningList(){return this.positionFeature?.getColSpanningList()??[]}onLeftChanged(){if(!this.comp)return;this.positionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){if(!this.eGui)return;this.refreshAriaColIndex(),this.refreshFirstAndLastStyles()}refreshFirstAndLastStyles(){let{comp:e,column:t,beans:s}=this;Wg(e,t,s.visibleCols)}refreshAriaColIndex(){let e=this.beans.visibleCols.getAriaColIndex(this.column);Eh(this.eGui,e)}onWidthChanged(){return this.positionFeature?.onWidthChanged()}getRowPosition(){let{rowIndex:e,rowPinned:t}=this.cellPosition;return{rowIndex:e,rowPinned:t}}updateRangeBordersIfRangeCount(){if(!this.comp)return;this.rangeFeature?.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){if(!this.comp)return;this.rangeFeature?.onCellSelectionChanged()}isRangeSelectionEnabled(){return this.rangeFeature!=null}focusCell(e=!1,t){let s=this.editSvc?.allowedFocusTargetOnValidation(this);if(s&&s!==this)return;this.beans.focusSvc.setFocusedCell({...this.getFocusedCellPosition(),forceBrowserFocus:e,sourceEvent:t})}restoreFocus(e=!1){let{beans:{editSvc:t,focusSvc:s},comp:i}=this;if(!i||t?.isEditing(this)||!this.isCellFocused()||!s.shouldTakeFocus())return;let o=()=>{if(!this.isAlive())return;let r=i.getFocusableElement();if(this.isCellFocused())r.focus({preventScroll:!0})};if(e){setTimeout(o,0);return}o()}onRowIndexChanged(){this.createCellPosition(),this.refreshAriaRowIndex(),this.onCellFocused(),this.restoreFocus(),this.rangeFeature?.onCellSelectionChanged(),this.rowResizeFeature?.refreshRowResizer()}onSuppressCellFocusChanged(e){let t=this.eGui;if(!t)return;Mt(t,"tabindex",e?void 0:-1)}onFirstRightPinnedChanged(){if(!this.comp)return;let e=this.column.isFirstRightPinned();this.comp.toggleCss(kR,e)}onLastLeftPinnedChanged(){if(!this.comp)return;let e=this.column.isLastLeftPinned();this.comp.toggleCss(LR,e)}checkCellFocused(){return this.beans.focusSvc.isCellFocused(this.cellPosition)}isCellFocused(){let e=this.checkCellFocused();return this.hasBeenFocused||(this.hasBeenFocused=e),e}setupFocus(){this.restoreFocus(!0),this.onCellFocused(this.focusEventWhileNotReady??void 0)}onCellFocused(e){let{beans:t}=this;if(an(t))return;if(!this.comp){if(e)this.focusEventWhileNotReady=e;return}let s=this.isCellFocused(),i=t.editSvc?.isEditing(this)??!1;if(this.comp.toggleCss(IR,s),s&&(e?.forceBrowserFocus||!this.hasBrowserFocus()&&this.beans.focusSvc.shouldTakeFocus())){let o=this.comp.getFocusableElement();if(i){let n=dt(o,null,!0);if(n.length)o=n[0]}let r=e?e.preventScrollOnBrowserFocus:!0;o.focus({preventScroll:r}),Lv(t,o)}if(s&&this.focusEventWhileNotReady)this.focusEventWhileNotReady=null;if(s&&e)this.rowCtrl.announceDescription(this)}createCellPosition(){let{rowIndex:e,rowPinned:t}=this.rowNode;this.cellPosition={rowIndex:e,rowPinned:de(t),column:this.column}}applyStaticCssClasses(){let{comp:e}=this;e.toggleCss(TR,!0),e.toggleCss(GR,!0);let t=this.column.isAutoHeight()==!0;e.toggleCss(DR,t),e.toggleCss(AR,!t)}onColumnHover(){this.beans.colHover?.onCellColumnHover(this.column,this.comp)}onColDefChanged(){if(!this.comp)return;if(this.column.isTooltipEnabled())this.disableTooltipFeature(),this.enableTooltipFeature();else this.disableTooltipFeature();if(this.setWrapText(),this.editSvc?.isEditing(this))this.editSvc?.handleColDefChanged(this);else this.refreshOrDestroyCell({force:!0,suppressFlash:!0})}setWrapText(){let e=this.column.colDef.wrapText==!0;this.comp.toggleCss(OR,e)}dispatchCellContextMenuEvent(e){let t=this.column.colDef,s=this.createEvent(e,"cellContextMenu"),{beans:i}=this;if(i.eventSvc.dispatchEvent(s),t.onCellContextMenu)window.setTimeout(()=>{i.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(s)})},0)}getCellRenderer(){return this.comp?.getCellRenderer()??null}destroy(){this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[];let{focusSvc:e,context:t}=this.beans;if(this.isCellFocused()&&this.hasBrowserFocus())e.attemptToRecoverFocus();super.destroy(),this.positionFeature=t.destroyBean(this.positionFeature)}hasBrowserFocus(){return this.eGui?.contains(j(this.beans))??!1}createSelectionCheckbox(){let e=this.beans.selectionSvc?.createCheckboxSelectionComponent();if(!e)return;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){let e=this.beans.registry.createDynamicBean("dndSourceComp",!1,this.rowNode,this.column,this.eGui);if(e)this.beans.context.createBean(e);return e}registerRowDragger(e,t,s){if(this.customRowDragComp){this.customRowDragComp.setDragElement(e,t);return}let i=this.createRowDragComp(e,t,s);if(i)this.customRowDragComp=i,this.addDestroyFunc(()=>{this.beans.context.destroyBean(i),this.customRowDragComp=null}),i.refreshVisibility()}createRowDragComp(e,t,s){let i=this.beans.rowDragSvc?.createRowDragCompForCell(this.rowNode,this.column,()=>this.value,e,t,s);if(!i)return;return this.beans.context.createBean(i),i}cellEditorAttached(){for(let e of this.onEditorAttachedFuncs)e();this.onEditorAttachedFuncs=[]}setFocusedCellPosition(e){}getFocusedCellPosition(){return this.cellPosition}refreshAriaRowIndex(){if(!Oe(this.column)||!this.eGui)return;let{ariaRowIndex:e}=this.rowCtrl;if(e!=null)qr(this.eGui,e)}getRootElement(){return this.eGui}};function zp(e,t,s,i,o,r){if(s==null&&t==null)return;let n={},a={},l=(c,d)=>{for(let u of c.split(" ")){if(u.trim()=="")continue;d(u)}};if(s){let c=Object.keys(s);for(let d=0;d<c.length;d++){let u=c[d],h=s[u],g;if(typeof h==="string")g=e?e.evaluate(h,i):!0;else if(typeof h==="function")g=h(i);l(u,(p)=>{if(g)n[p]=!0;else a[p]=!0})}}if(t&&r)for(let c of Object.keys(t))l(c,(d)=>{if(!n[d])a[d]=!0});if(r)Object.keys(a).forEach(r);Object.keys(n).forEach(o)}function zu(e){if(e.group)return e.level;let t=e.parent;return t?t.level+1:0}var VR=0,xl=class extends y{constructor(e,t,s,i,o){super();if(this.rowNode=e,this.useAnimationFrameForCreate=i,this.printLayout=o,this.guiListenerOwners=new WeakMap,this.focusEventWhileNotReady=null,this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.ariaRowIndex=null,this.businessKey=null,this.beans=t,this.gos=t.gos,this.paginationPage=t.pagination?.getCurrentPage()??0,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+VR++,this.rowId=he(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusSvc.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=zu(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.rowEditStyleFeature=t.editSvc?.createRowStyleFeature(this),this.fullWidthNotesFeature=this.isFullWidth()?t.notesSvc?.createFullWidthNotesFeature(this):void 0,this.addListeners(),!i&&!this.isFullWidth())this.createAllCellCtrls()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!=="function")return;let e=this.businessKeyForNodeFunc(this.rowNode);this.businessKey=he(e)}updateGui(e,t){if(e==="left")this.leftGui=t;else if(e==="right")this.rightGui=t;else if(e==="fullWidth")this.fullWidthGui=t;else this.centerGui=t}setComp(e,t,s,i){let{context:o,rowRenderer:r}=this.beans;i=er(this,o,i);let n={rowComp:e,element:t,containerType:s,compBean:i};this.allRowGuis.push(n),this.updateGui(s,n),this.initialiseRowComp(n),this.fullWidthNotesFeature?.refresh();let a=this.rowNode,l=this.rowType==="FullWidthLoading"||a.stub,c=!a.data&&this.beans.rowModel.getType()==="infinite";if(!l&&!c&&!a.rowPinned)r.dispatchFirstDataRenderedEvent();this.setupFocus()}unsetComp(e){this.allRowGuis=this.allRowGuis.filter((t)=>t.containerType!==e),this.updateGui(e,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(e){let t=e?"none":"";for(let s of this.allRowGuis)s.element.style.display=t}initialiseRowComp(e){let t=this.gos;if(this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(e),this.onRowHeightChanged(e),this.updateRowIndexes(e),this.setFocusedClasses(e),this.setStylesFromGridOptions(!1,e),ss(t)&&this.rowNode.selectable)this.onRowSelected(e);this.updateColumnLists(!this.useAnimationFrameForCreate);let s=e.rowComp,i=this.getInitialRowClasses(e.containerType);for(let o of i)s.toggleCss(o,!0);if(this.executeSlideAndFadeAnimations(e),this.rowNode.group)De(e.element,!!this.rowNode.expanded);if(this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),ai(t,e.element,cn,this),e.compBean.addDestroyFunc(()=>ai(t,e.element,cn,null)),this.useAnimationFrameForCreate)this.beans.animationFrameSvc.createTask(this.addHoverFunctionality.bind(this,e),this.rowNode.rowIndex,"p2",!1);else this.addHoverFunctionality(e);if(this.isFullWidth())this.setupFullWidth(e);if(t.get("rowDragEntireRow"))this.addRowDraggerToRow(e);if(this.useAnimationFrameForCreate)this.beans.animationFrameSvc.addDestroyTask(()=>{if(!this.isAlive())return;e.rowComp.toggleCss("ag-after-created",!0)});this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){if(this.businessKey==null)return;e.setRowBusinessKey(this.businessKey)}setRowCompRowId(e){let t=he(this.rowNode.id);if(this.rowId=t,t==null)return;e.setRowId(t)}executeSlideAndFadeAnimations(e){let{containerType:t}=e;if(this.slideInAnimation[t])rl(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1;if(this.fadeInAnimation[t])rl(()=>{e.rowComp.toggleCss("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1}addRowDraggerToRow(e){let t=this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode,e.element);if(!t)return;let s=this.createBean(t,this.beans.context);this.rowDragComps.push(s),e.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter((i)=>i!==s),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,this.beans.context),this.destroyBean(s,this.beans.context)})}setupFullWidth(e){let t=this.getPinnedForContainer(e.containerType),s=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(s)}getFullWidthCellRenderers(){if(this.gos.get("embedFullWidthRows"))return this.allRowGuis.map((e)=>e?.rowComp?.getFullWidthCellRenderer());return[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}executeProcessRowPostCreateFunc(){let e=this.gos.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;let t={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};e(t)}areAllContainersReady(){let{leftGui:e,centerGui:t,rightGui:s,beans:{visibleCols:i}}=this,o=!!e||!i.isPinningLeft(),r=!!t,n=!!s||!i.isPinningRight();return o&&r&&n}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;let e=this.beans.gos.getCallback("isFullWidthRow");return e?e({rowNode:this.rowNode}):!1}setRowType(){let{rowNode:e,gos:t,beans:{colModel:s}}=this,i=t.get("suppressServerSideFullWidthLoadingRow"),o=t.get("groupHideOpenParents"),r=e.stub&&!i&&!o,n=this.isNodeFullWidthCell(),a=t.get("masterDetail")&&e.detail,l=s.pivotMode,c=tg(t,e,l),d=i&&e.stub&&c&&!o;if(r)this.rowType="FullWidthLoading";else if(a)this.rowType="FullWidthDetail";else if(n)this.rowType="FullWidth";else if(c&&!d)this.rowType="FullWidthGroup";else this.rowType="Normal"}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;let{animationFrameSvc:s}=this.beans;if(!s?.active||e||this.printLayout){this.updateColumnListsImpl(t);return}if(this.updateColumnListsPending)return;s.createTask(()=>{if(!this.active)return;this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"p1",!1),this.updateColumnListsPending=!0}getNewCellCtrl(e){if(this.beans.rowSpanSvc?.isCellSpanning(e,this.rowNode))return;return new Eo(e,this.rowNode,this.beans,this)}isCorrectCtrlForSpan(e){return!this.beans.rowSpanSvc?.isCellSpanning(e.column,this.rowNode)}createCellCtrls(e,t,s=null){let i={list:[],map:{}},o=(c,d,u)=>{if(u!=null)i.list.splice(u,0,d);else i.list.push(d);i.map[c]=d},r=[];for(let c of t){let d=c.getInstanceId(),u=e.map[d];if(u&&!this.isCorrectCtrlForSpan(u))u.destroy(),u=void 0;if(!u)u=this.getNewCellCtrl(c);if(!u)continue;o(d,u)}for(let c of e.list){let d=c.column.getInstanceId();if(i.map[d]!=null)continue;if(!this.isCellEligibleToBeRemoved(c,s))r.push([d,c]);else c.destroy()}if(r.length)for(let[c,d]of r){let u=i.list.findIndex((g)=>g.column.getLeft()>d.column.getLeft()),h=u===-1?void 0:Math.max(u-1,0);o(c,d,h)}let{focusSvc:n,visibleCols:a}=this.beans,l=n.getFocusedCell();if(l&&l.column.getPinned()==s){let c=l.column.getInstanceId();if(!i.map[c]&&a.allCols.includes(l.column)){let u=this.createFocusedCellCtrl();if(u){let h=i.list.findIndex((p)=>p.column.getLeft()>u.column.getLeft()),g=h===-1?void 0:Math.max(h-1,0);o(c,u,g)}}}return i}createFocusedCellCtrl(){let{focusSvc:e,rowSpanSvc:t}=this.beans,s=e.getFocusedCell();if(!s)return;let i=t?.getCellSpan(s.column,this.rowNode);if(i){if(i.firstNode!==this.rowNode||!i.doesSpanContain(s))return}else if(!e.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))return;return this.getNewCellCtrl(s.column)}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){for(let t of this.allRowGuis){let s=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(s,e)}}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){let e=this.beans.colViewport,t=this.beans.visibleCols;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t.allCols),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{let s=e.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s);let i=t.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");let o=t.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}}getInitialCellCtrls(e){if(this.useAnimationFrameForCreate||this.isFullWidth())return null;return this.getCellCtrlsForContainer(e)}isCellEligibleToBeRemoved(e,t){let{column:o}=e;if(o.getPinned()!=t)return!0;if(!this.isCorrectCtrlForSpan(e))return!0;let{visibleCols:r,editSvc:n}=this.beans,a=n?.isEditing(e),l=e.isCellFocused();if(a||l)return r.allCols.indexOf(o)>=0?!1:!0;return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||Te(this.gos,"print")}listenOnDomOrder(e){let t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};e.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],t)}setAnimateFlags(e){if(this.rowNode.sticky||!e)return;let t=M(this.rowNode.oldRowTop),{visibleCols:s}=this.beans,i=s.isPinningLeft(),o=s.isPinningRight();if(t){let{slideInAnimation:r}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){r.fullWidth=!0;return}r.center=!0,r.left=i,r.right=o}else{let{fadeInAnimation:r}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){r.fullWidth=!0;return}r.center=!0,r.left=i,r.right=o}}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){let e=(n,a)=>{if(!n)return!0;return n.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(n.element,a).params)},t=e(this.fullWidthGui,null),s=e(this.centerGui,null),i=e(this.leftGui,"left"),o=e(this.rightGui,"right"),r=t&&s&&i&&o;return this.fullWidthNotesFeature?.refresh(),r}getNotesFeature(){return this.fullWidthNotesFeature}addListeners(){let{beans:e,gos:t,rowNode:s}=this,{expansionSvc:i,eventSvc:o,context:r,rowSpanSvc:n}=e;if(this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),...i?.getRowExpandedListeners(this)??{}}),s.detail)this.addManagedListeners(s.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)});if(this.addManagedListeners(s,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this),rowPinned:this.onRowPinned.bind(this)}),this.addManagedListeners(o,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),n?.active)this.addManagedListeners(n,{spannedCellsUpdated:({pinned:a})=>{if(a&&!s.rowPinned)return;this.updateColumnLists()}});this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,r),this.tooltipFeature=this.destroyBean(this.tooltipFeature,r),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,r),this.fullWidthNotesFeature?.destroy()}),this.addManagedPropertyListeners(["rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules"],this.postProcessCss.bind(this)),this.addManagedPropertyListener("rowDragEntireRow",()=>{if(t.get("rowDragEntireRow")){for(let l of this.allRowGuis)this.addRowDraggerToRow(l);return}this.rowDragComps=this.destroyBeans(this.rowDragComps,r)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{for(let e of this.getAllCellCtrls())e.onRowIndexChanged()},cellChanged:(e)=>{for(let t of this.getAllCellCtrls())t.onCellChanged(e)}})}onRowPinned(){for(let e of this.allRowGuis)e.rowComp.toggleCss("ag-row-pinned-source",!!this.rowNode.pinnedSibling)}onRowNodeDataChanged(e){this.refreshRow({suppressFlash:!e.update,newData:!e.update})}refreshRow(e){if(this.isFullWidth()!==!!this.isNodeFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){if(!this.refreshFullWidth())this.beans.rowRenderer.redrawRow(this.rowNode);return}for(let s of this.getAllCellCtrls())s.refreshCell(e);for(let s of this.allRowGuis)this.setRowCompRowId(s.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(s.rowComp);this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.rowEditStyleFeature?.applyRowStyles(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){let e=this.beans.rowDropHighlightSvc,t=e?.row===this.rowNode?e.position:"none",s=t==="above",i=t==="inside",o=t==="below",r=t!=="none",n=s||o,a=this.rowNode.uiLevel,l=n&&a>0,c=l?a.toString():"0";for(let d of this.allRowGuis){let u=d.rowComp;if(u.toggleCss("ag-row-highlight-above",s),u.toggleCss("ag-row-highlight-inside",i),u.toggleCss("ag-row-highlight-below",o),u.toggleCss("ag-row-highlight-indent",l),r)d.element.style.setProperty("--ag-row-highlight-level",c);else d.element.style.removeProperty("--ag-row-highlight-level")}}postProcessRowDragging(){let e=this.rowNode.dragging;for(let t of this.allRowGuis)t.rowComp.toggleCss("ag-row-dragging",e)}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.rowAutoHeight?.requestCheckAutoHeight()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:de(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){let t=this.findFullWidthInfoForEvent(e);if(!t)return;let{rowGui:s,column:i}=t;if(s.element!==e.target)return;let n=this.rowNode,{focusSvc:a,navigation:l}=this.beans,c=a.getFocusedCell(),d={rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:c?.column??i};l?.navigateToNextCell(e,e.key,d,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||ut(e))return;let t=this.allRowGuis.find((a)=>a.element.contains(e.target)),s=t?t.element:null,i=s===e.target,o=j(this.beans),r=!1;if(s&&o)r=s.contains(o)&&o.classList.contains("ag-cell");let n=null;if(!i&&!r)n=Ie(this.beans,s,!1,e.shiftKey);if(this.isFullWidth()&&i||!n)this.beans.navigation?.onTabKeyDown(this,e)}getFullWidthElement(){if(this.fullWidthGui)return this.fullWidthGui.element;return null}getRowYPosition(){let e=this.allRowGuis.find((t)=>ve(t.element))?.element;if(e)return e.getBoundingClientRect().top;return 0}onSuppressCellFocusChanged(e){let t=this.isFullWidth()&&e?void 0:this.gos.get("tabIndex");for(let s of this.allRowGuis)Mt(s.element,"tabindex",t)}setupFocus(){if(!this.isFullWidth())return;this.restoreFullWidthFocus(!0),this.onFullWidthRowFocused(this.focusEventWhileNotReady??void 0)}restoreFullWidthFocus(e=!1){let{focusSvc:t,editSvc:s}=this.beans;if(s?.isEditing(this))return;if(!t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)||!t.shouldTakeFocus())return;let i=this.getFullWidthRowGuiForFocus();if(!i)return;let o=()=>{if(!this.isAlive())return;if(t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))i.element.focus({preventScroll:!0})};if(e){setTimeout(o,0);return}o()}getFullWidthRowGuiForFocus(e){if(this.fullWidthGui)return this.fullWidthGui;let t=this.beans.focusSvc.getFocusedCell(),s=this.beans.colModel.getCol(e?.column??t?.column);if(!s)return;let i=s?.pinned;if(i==="right")return this.rightGui;if(i==="left")return this.leftGui;return this.centerGui}setFullWidthRowFocusedClass(e,t){this.forEachGui(void 0,(s)=>{s.element.classList.toggle("ag-full-width-focus",t&&s===e)})}onFullWidthRowFocused(e){let{focusSvc:t}=this.beans;if(!(this.isFullWidth()&&t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))){this.setFullWidthRowFocusedClass(void 0,!1);return}let i=this.getFullWidthRowGuiForFocus(e);if(!i){if(e)this.focusEventWhileNotReady=e;this.setFullWidthRowFocusedClass(void 0,!1);return}if(this.setFullWidthRowFocusedClass(i,!0),this.focusEventWhileNotReady=null,e?.forceBrowserFocus)i.element.focus({preventScroll:!0})}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){let s={list:[],map:{}};for(let i of e.list){if(i===t)continue;s.list.push(i),s.map[i.column.getInstanceId()]=i}return s}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"pointerdown":case"touchstart":case"mousedown":this.onRowMouseDown(t);break}}createRowEvent(e,t){let{rowNode:s}=this;return I(this.gos,{type:e,node:s,data:s.data,rowIndex:s.rowIndex,rowPinned:s.rowPinned,event:t})}createRowEventWithSource(e,t){let s=this.createRowEvent(e,t);return s.source=this,s}onRowDblClick(e){if(ut(e))return;let t=this.createRowEventWithSource("rowDoubleClicked",e);t.isEventHandlingSuppressed=this.isSuppressMouseEvent(e),this.beans.eventSvc.dispatchEvent(t)}findFullWidthInfoForEvent(e){if(!e)return;let t=this.findFullWidthRowGui(e.target),s=this.getColumnForFullWidth(t),i=this.getPinnedForFullWidth(t);if(!t||!s)return;return{rowGui:t,column:s,pinned:i}}findFullWidthRowGui(e){return this.allRowGuis.find((t)=>t.element.contains(e))}getColumnForFullWidth(e){let{visibleCols:t}=this.beans;switch(e?.containerType){case"center":return t.centerCols[0];case"left":return t.leftCols[0];case"right":return t.rightCols[0];default:return t.allCols[0]}}getPinnedForFullWidth(e){let t=e?.containerType;return t==="left"||t==="right"?t:void 0}addManagedGuiElementListeners(e,t){let{compBean:s,element:i}=e;if(this.guiListenerOwners.get(i)===s)return;this.guiListenerOwners.set(i,s),s.addManagedElementListeners(i,t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=ti(e.target,"ag-row-drag",3),!this.isFullWidth()||this.isSuppressMouseEvent(e))return;let{rangeSvc:t,focusSvc:s}=this.beans;t?.removeAllCellRanges();let i=this.findFullWidthInfoForEvent(e);if(!i)return;let{rowGui:o,column:r}=i,n=o.element,a=e.target,l=this.rowNode,c=e.defaultPrevented||Os();if(n&&n.contains(a)&&yo(a))c=!1;s.setFocusedCell({rowIndex:l.rowIndex,column:r,rowPinned:l.rowPinned,forceBrowserFocus:c})}isSuppressMouseEvent(e){let{gos:t,rowNode:s}=this;if(this.isFullWidth()){let o=this.findFullWidthRowGui(e.target);return ES(t,o?.rowComp.getFullWidthCellRendererParams(),s,e)}let i=tr(t,e.target);return i!=null&&Wr(t,i.column,s,e)}onRowClick(e){if(ut(e)||this.lastMouseDownOnDragger)return;let s=this.isSuppressMouseEvent(e),{eventSvc:i,selectionSvc:o}=this.beans,r=this.createRowEventWithSource("rowClicked",e);if(r.isEventHandlingSuppressed=s,i.dispatchEvent(r),s)return;o?.handleSelectionEvent(e,this.rowNode,"rowClicked")}setupDetailRowAutoHeight(e){if(this.rowType!=="FullWidthDetail")return;this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this,e)}createFullWidthCompDetails(e,t){let{gos:s,rowNode:i}=this,o=I(s,{fullWidth:!0,data:i.data,node:i,value:i.key,valueFormatted:i.key,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(n,a,l,c)=>this.addFullWidthRowDragging(n,a,l,c),setTooltip:(n,a)=>{s.assertModuleRegistered("Tooltip",3),this.setupFullWidthRowTooltip(n,a)}}),r=this.beans.userCompFactory;switch(this.rowType){case"FullWidthDetail":return pb(r,o);case"FullWidthGroup":{let{value:n,valueFormatted:a}=this.beans.valueSvc.getValueForDisplay({node:this.rowNode,includeValueFormatted:!0,from:"edit"});return o.value=n,o.valueFormatted=a,gb(r,o)}case"FullWidthLoading":return hb(r,o);default:return ub(r,o)}}setupFullWidthRowTooltip(e,t){if(!this.fullWidthGui)return;this.tooltipFeature=this.beans.tooltipSvc?.setupFullWidthRowTooltip(this.tooltipFeature,this,e,t)}addFullWidthRowDragging(e,t,s="",i){let{rowDragSvc:o,context:r}=this.beans;if(!o||!this.isFullWidth())return;let n=o.createRowDragComp(()=>s,this.rowNode,void 0,e,t,i);this.createBean(n,r),this.addDestroyFunc(()=>{this.destroyBean(n,r)})}onUiLevelChanged(){let e=zu(this.rowNode);if(this.rowLevel!=e){let t="ag-row-level-"+e,s="ag-row-level-"+this.rowLevel;for(let i of this.allRowGuis)i.rowComp.toggleCss(t,!0),i.rowComp.toggleCss(s,!1)}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getLastRow()}refreshFirstAndLastRowStyles(){let e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();if(this.firstRowOnPage!==e){this.firstRowOnPage=e;for(let s of this.allRowGuis)s.rowComp.toggleCss("ag-row-first",e)}if(this.lastRowOnPage!==t){this.lastRowOnPage=t;for(let s of this.allRowGuis)s.rowComp.toggleCss("ag-row-last",t)}}getAllCellCtrls(){if(this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0)return this.centerCellCtrls.list;return[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){let e=[];if(this.beans.rowStyleSvc?.processClassesFromGridOptions(e,this.rowNode),!e.length)return;for(let t of e)for(let s of this.allRowGuis)s.rowComp.toggleCss(t,!0)}postProcessRowClassRules(){this.beans.rowStyleSvc?.processRowClassRules(this.rowNode,(e)=>{for(let t of this.allRowGuis)t.rowComp.toggleCss(e,!0)},(e)=>{for(let t of this.allRowGuis)t.rowComp.toggleCss(e,!1)})}setStylesFromGridOptions(e,t){if(e)this.rowStyles=this.processStylesFromGridOptions();this.forEachGui(t,(s)=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){if(e==="left"||e==="right")return e;return null}getInitialRowClasses(e){let t=this.getPinnedForContainer(e),s=this.isFullWidth(),{rowNode:i,beans:o}=this,r=[];if(r.push("ag-row"),r.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus"),this.fadeInAnimation[e])r.push("ag-opacity-zero");if(r.push(i.rowIndex%2===0?"ag-row-even":"ag-row-odd"),i.isRowPinned()){if(r.push("ag-row-pinned"),o.pinnedRowModel?.isManual())r.push("ag-row-pinned-manual")}if(!i.isRowPinned()&&i.pinnedSibling)r.push("ag-row-pinned-source");if(i.isSelected())r.push("ag-row-selected");if(i.footer)r.push("ag-row-footer");if(r.push("ag-row-level-"+this.rowLevel),i.stub)r.push("ag-row-loading");if(s)r.push("ag-full-width-row");if(o.expansionSvc?.addExpandedCss(r,i),i.dragging)r.push("ag-row-dragging");let{rowStyleSvc:n}=o;if(n)n.processClassesFromGridOptions(r,i),n.preProcessRowClassRules(r,i);if(r.push(this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),this.isFirstRowOnPage())r.push("ag-row-first");if(this.isLastRowOnPage())r.push("ag-row-last");if(s){if(t==="left")r.push("ag-cell-last-left-pinned");if(t==="right")r.push("ag-cell-first-right-pinned")}return r}processStylesFromGridOptions(){return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode)??this.emptyStyle}onRowSelected(e){this.beans.selectionSvc?.onRowCtrlSelected(this,(t)=>{if(t===this.centerGui||t===this.fullWidthGui)this.announceDescription()},e)}announceDescription(e){this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode),this.announceNoteDescription(e)}announceNoteDescription(e){let{notesSvc:t,ariaAnnounce:s}=this.beans;if(!t||!s||!e&&!this.isFullWidth())return;let i={rowNode:this.rowNode},o=e?{column:e.column}:{location:"fullWidthRow"},r={...i,...o};if(t.getNoteAccess(r)?.canView){let a=this.getLocaleTextFunc();s.announceValue(a("ariaHasNote","This cell has a note."),"note")}}addHoverFunctionality(e){if(!this.active)return;let{element:t,compBean:s}=e,{rowNode:i,beans:o,gos:r}=this;s.addManagedListeners(t,{pointerenter:(n)=>{if(n.pointerType==="mouse")i.dispatchRowEvent("mouseEnter")},pointerleave:(n)=>{if(n.pointerType==="mouse")i.dispatchRowEvent("mouseLeave")}}),s.addManagedListeners(i,{mouseEnter:()=>{if(!o.dragSvc?.dragging&&!r.get("suppressRowHoverHighlight"))t.classList.add("ag-row-hover"),i.setHovered(!0)},mouseLeave:()=>{this.resetHoveredStatus(t)}})}resetHoveredStatus(e){let t=e?[e]:this.allRowGuis.map((s)=>s.element);for(let s of t)s.classList.remove("ag-row-hover");this.rowNode.setHovered(!1)}roundRowTopToBounds(e){let t=this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(t.top,!0)-100,i=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(s,e),i)}forEachGui(e,t){if(e)t(e);else for(let s of this.allRowGuis)t(s)}isRowRendered(){return this.allRowGuis.length>0}onRowHeightChanged(e){if(this.rowNode.rowHeight==null)return;let t=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),o=Zh(this.gos)?ko(this.beans,this.rowNode).height:void 0,r=o?`${Math.min(s,o)-2}px`:void 0;this.forEachGui(e,(n)=>{if(n.element.style.height=`${t}px`,r)n.element.style.setProperty("--ag-line-height",r)})}destroyFirstPass(e=!1){this.active=!1;let{rowNode:t}=this;if(!e&&Bi(this.gos)&&!t.sticky)if(t.rowTop!=null){let o=this.roundRowTopToBounds(t.rowTop);this.setRowTop(o)}else for(let o of this.allRowGuis)o.rowComp.toggleCss("ag-opacity-zero",!0);if(this.fullWidthGui?.element.contains(j(this.beans)))this.beans.focusSvc.attemptToRecoverFocus();t.setHovered(!1);let s=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(s),this.beans.eventSvc.dispatchEvent(s),super.destroy()}destroySecondPass(){this.allRowGuis.length=0;let e=(t)=>{for(let s of t.list)s.destroy();return{list:[],map:{}}};this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,(t)=>{t.rowComp.toggleCss("ag-row-focus",this.rowFocused),t.rowComp.toggleCss("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){let{focusSvc:e}=this.beans,t=e.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);if(t!==this.rowFocused)this.rowFocused=t,this.setFocusedClasses()}onPaginationChanged(){let e=this.beans.pagination?.getCurrentPage()??0;if(this.paginationPage!==e)this.paginationPage=e,this.onTopChanged();this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;let s=this.beans.pageBounds.getPixelOffset();return e+s*(t?1:-1)}setRowTop(e){if(this.printLayout)return;if(M(e)){let t=this.applyPaginationOffset(e),o=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeight.getRealPixelPosition(t)}px`;this.setRowTopStyle(o)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";let t=this.rowNode,s;if(t.sticky)s=t.stickyRowTop;else{let i=this.slideInAnimation[e]?this.roundRowTopToBounds(t.oldRowTop):t.rowTop,o=this.applyPaginationOffset(i);s=t.isRowPinned()?o:this.beans.rowContainerHeight.getRealPixelPosition(o)}return s+"px"}setRowTopStyle(e){for(let t of this.allRowGuis)if(this.suppressRowTransform)t.rowComp.setTop(e);else t.rowComp.setTransform(`translateY(${e})`)}getCellCtrl(e,t=!1){let s=null;for(let i of this.getAllCellCtrls())if(i.column==e)s=i;if(s!=null||t)return s;for(let i of this.getAllCellCtrls())if(i?.getColSpanningList().indexOf(e)>=0)s=i;return s}onRowIndexChanged(){if(this.rowNode.rowIndex!=null)this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss()}updateRowIndexes(e){let t=this.rowNode.getRowIndexString();if(t===null)return;let s=(this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.beans.filterManager?.getHeaderRowCount()??0),i=this.rowNode.rowIndex%2===0,o=this.ariaRowIndex=s+this.rowNode.rowIndex+1;this.forEachGui(e,(r)=>{r.rowComp.setRowIndex(t),r.rowComp.toggleCss("ag-row-even",i),r.rowComp.toggleCss("ag-row-odd",!i),qr(r.element,o)})}},NR=class extends y{constructor(){super();this.beanName="navigation",this.onPageDown=su(this.onPageDown,100),this.onPageUp=su(this.onPageUp,100)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(e)=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){let{key:s,altKey:i}=e,o=e.ctrlKey||e.metaKey,r=!!this.beans.rangeSvc&&e.shiftKey,n=Pc(this.gos,e),a=!1;switch(s){case b.PAGE_HOME:case b.PAGE_END:if(!o&&!i)this.onHomeOrEndKey(s),a=!0;break;case b.LEFT:case b.RIGHT:case b.UP:case b.DOWN:if(!n)return!1;if(o&&!i&&!r)this.onCtrlUpDownLeftRight(s,n),a=!0;break;case b.PAGE_DOWN:case b.PAGE_UP:if(!o&&!i)a=this.handlePageUpDown(s,n,t);break}if(a)e.preventDefault();return a}handlePageUpDown(e,t,s){if(s)t=this.beans.focusSvc.getFocusedCell();if(!t)return!1;if(e===b.PAGE_UP)this.onPageUp(t);else this.onPageDown(t);return!0}navigateTo({scrollIndex:e,scrollType:t,scrollColumn:s,focusIndex:i,focusColumn:o,isAsync:r,rowPinned:n}){let{scrollFeature:a}=this.gridBodyCon;if(M(s)&&!s.isPinned())a.ensureColumnVisible(s);if(M(e))a.ensureIndexVisible(e,t);if(!r)a.ensureIndexVisible(i);let{focusSvc:l}=this.beans;l.setFocusedCell({rowIndex:i,column:o,rowPinned:n,forceBrowserFocus:!0}),this.setRangeToCellIfSupported({rowIndex:i,rowPinned:n,column:o})}onPageDown(e){let t=this.beans,s=Qa(t),i=this.getViewportHeight(),{pageBounds:o,rowModel:r,rowAutoHeight:n}=t,a=o.getPixelOffset(),l=s.top+i,c=r.getRowIndexAtPixel(l+a);if(n?.active)this.navigateToNextPageWithAutoHeight(e,c);else this.navigateToNextPage(e,c)}onPageUp(e){let t=this.beans,s=Qa(t),{pageBounds:i,rowModel:o,rowAutoHeight:r}=t,n=i.getPixelOffset(),a=s.top,l=o.getRowIndexAtPixel(a+n);if(r?.active)this.navigateToNextPageWithAutoHeight(e,l,!0);else this.navigateToNextPage(e,l,!0)}navigateToNextPage(e,t,s=!1){let{pageBounds:i,rowModel:o}=this.beans,r=this.getViewportHeight(),n=i.getFirstRow(),a=i.getLastRow(),l=i.getPixelOffset(),c=o.getRow(e.rowIndex),d=s?c?.rowHeight-r-l:r-l,u=c?.rowTop+d,h=o.getRowIndexAtPixel(u+l);if(h===e.rowIndex){let v=s?-1:1;t=h=e.rowIndex+v}let g;if(s){if(g="bottom",h<n)h=n;if(t<n)t=n}else{if(g="top",h>a)h=a;if(t>a)t=a}if(this.isRowTallerThanView(o.getRow(h)))t=h,g="top";let p={rowIndex:h,column:e.column,rowPinned:null},f=this.getNormalisedPosition(p),{rowIndex:m,column:C}=f??p;this.navigateTo({scrollIndex:t,scrollType:g,scrollColumn:null,focusIndex:m,focusColumn:C})}navigateToNextPageWithAutoHeight(e,t,s=!1){this.navigateTo({scrollIndex:t,scrollType:s?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{let i=this.getNextFocusIndexForAutoHeight(e,s);this.navigateTo({scrollIndex:t,scrollType:s?"bottom":"top",scrollColumn:null,focusIndex:i,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){let s=t?-1:1,i=this.getViewportHeight(),{pageBounds:o,rowModel:r}=this.beans,n=o.getLastRow(),a=0,l=e.rowIndex;while(l>=0&&l<=n){let c=r.getRow(l);if(c){let d=c.rowHeight??0;if(a+d>i)break;a+=d}l+=s}return Math.max(0,Math.min(l,n))}getViewportHeight(){let e=this.beans,t=Qa(e),s=this.beans.scrollVisibleSvc.getScrollbarWidth(),i=t.bottom-t.top;if(e.ctrlsSvc.get("center").isHorizontalScrollShowing())i-=s;return i}isRowTallerThanView(e){if(!e)return!1;let t=e.rowHeight;if(typeof t!=="number")return!1;return t>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){let s=this.beans.cellNavigation.getNextCellToFocus(e,t,!0);if(!s)return;let i=this.getNormalisedPosition(s),{rowIndex:o,rowPinned:r,column:n}=i??s,a=n;this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:a,focusIndex:o,focusColumn:a,rowPinned:r})}onHomeOrEndKey(e){let t=e===b.PAGE_HOME,{visibleCols:s,pageBounds:i,rowModel:o}=this.beans,r=s.allCols,n=t?i.getFirstRow():i.getLastRow(),a=o.getRow(n);if(!a)return;let l=(t?r:[...r].reverse()).find((c)=>!c.isSuppressNavigable(a)&&!Oe(c));if(!l)return;this.navigateTo({scrollIndex:n,scrollType:null,scrollColumn:l,focusIndex:n,focusColumn:l})}onTabKeyDown(e,t){let s=t.shiftKey,i=this.tabToNextCellCommon(e,s,t),o=this.beans,{ctrlsSvc:r,pageBounds:n,focusSvc:a,gos:l}=o;if(i!==!1){if(i)t.preventDefault();else if(i===null)r.get("gridCtrl").allowFocusForNextCoreContainer(s);return}if(s){let{rowIndex:c,rowPinned:d}=e.getRowPosition();if(d?c===0:c===n.getFirstRow())if(l.get("headerHeight")===0||Ft(o))pt(o,!0,!0);else t.preventDefault(),a.focusPreviousFromFirstCell(t)}else{if(e instanceof Eo)e.focusCell(!0);if(a.focusOverlay(!1)||pt(o,s))t.preventDefault()}}tabToNextCell(e,t){let s=this.beans,{focusSvc:i,rowRenderer:o}=s,r=i.getFocusedCell();if(!r)return!1;let n=lt(s,r);if(!n){if(n=o.getRowByPosition(r),!n?.isFullWidth())return!1}return!!this.tabToNextCellCommon(n,e,t,"api")}tabToNextCellCommon(e,t,s,i="ui"){let{editSvc:o,focusSvc:r}=this.beans,n,a=e instanceof Eo?e:e.getAllCellCtrls()?.[0];if(o?.isEditing())n=o?.moveToNextCell(a,t,s,i);else n=this.moveToNextCellNotEditing(e,t,s);if(n===null)return n;return n||!!r.focusedHeader}moveToNextCellNotEditing(e,t,s){let i=this.beans.visibleCols.allCols,o;if(e instanceof xl){if(o={...e.getRowPosition(),column:t?i[0]:k(i)},this.gos.get("embedFullWidthRows")&&s){let n=e.findFullWidthInfoForEvent(s);if(n)o.column=n.column}}else o=e.getFocusedCellPosition();let r=this.findNextCellToFocusOn(o,{backwards:t,startEditing:!1});if(r===!1)return null;if(r instanceof Eo)r.focusCell(!0);else if(r)return this.tryToFocusFullWidthRow(r,t);return M(r)}findNextCellToFocusOn(e,{backwards:t,startEditing:s,skipToNextEditableCell:i}){let o=e,r=this.beans,{cellNavigation:n,gos:a,focusSvc:l,rowRenderer:c}=r;while(!0){if(e!==o)e=o;if(!t)o=this.getLastCellOfColSpan(o);o=n.getNextTabbedCell(o,t);let d=a.getCallback("tabToNextCell");if(M(d)){let p=d({backwards:t,editing:s,previousCellPosition:e,nextCellPosition:o?o:null});if(p===!0)o=e;else if(p===!1)return!1;else o={rowIndex:p.rowIndex,column:p.column,rowPinned:p.rowPinned}}if(!o)return null;if(o.rowIndex<0){let g=rt(r);return l.focusHeaderPosition({headerPosition:{headerRowIndex:g+o.rowIndex,column:o.column},fromCell:!0}),null}let u=a.get("editType")==="fullRow";if(s&&(!u||i)){if(!this.isCellEditable(o))continue}this.ensureCellVisible(o);let h=lt(r,o);if(!h){let g=c.getRowByPosition(o);if(!g||!g.isFullWidth()||s)continue;return{...g.getRowPosition(),column:o?.column}}if(n.isSuppressNavigable(h.column,h.rowNode))continue;return h.setFocusedCellPosition(o),this.setRangeToCellIfSupported(o),h}}isCellEditable(e){let t=this.lookupRowNodeForCell(e);if(t)return e.column.isCellEditable(t);return!1}lookupRowNodeForCell({rowIndex:e,rowPinned:t}){let{pinnedRowModel:s,rowModel:i}=this.beans;if(t==="top")return s?.getPinnedTopRow(e);if(t==="bottom")return s?.getPinnedBottomRow(e);return i.getRow(e)}navigateToNextCell(e,t,s,i){let o=s,r=!1,n=this.beans,{cellNavigation:a,focusSvc:l,gos:c}=n;while(o&&(o===s||!this.isValidNavigateCell(o))){if(c.get("enableRtl")){if(t===b.LEFT)o=this.getLastCellOfColSpan(o)}else if(t===b.RIGHT)o=this.getLastCellOfColSpan(o);o=a.getNextCellToFocus(t,o),r=q(o)}if(r&&e?.key===b.UP)o={rowIndex:-1,rowPinned:null,column:s.column};if(i){let u=c.getCallback("navigateToNextCell");if(M(u)){let g=u({key:t,previousCellPosition:s,nextCellPosition:o?o:null,event:e});if(M(g))o={rowPinned:g.rowPinned,rowIndex:g.rowIndex,column:g.column};else o=null}}if(!o)return;if(o.rowIndex<0){let u=rt(n);l.focusHeaderPosition({headerPosition:{headerRowIndex:u+o.rowIndex,column:o.column??s.column},event:e||void 0,fromCell:!0});return}let d=this.getNormalisedPosition(o);if(d)this.focusPosition(d);else this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){if(!!this.beans.spannedRowRenderer?.getCellByPosition(e))return e;this.ensureCellVisible(e);let s=lt(this.beans,e);if(!s)return null;return e=s.getFocusedCellPosition(),this.ensureCellVisible(e),e}tryToFocusFullWidthRow(e,t){let{visibleCols:s,rowRenderer:i,focusSvc:o,eventSvc:r}=this.beans,n=s.allCols;if(!i.getRowByPosition(e)?.isFullWidth())return!1;let l=o.getFocusedCell(),c={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?k(n):n[0])};this.focusPosition(c);let d=t==null?l!=null&&Ce(c,l):t;return r.dispatchEvent({type:"fullWidthRowFocused",rowIndex:c.rowIndex,rowPinned:c.rowPinned,column:c.column,isFullWidthCell:!0,fromBelow:d}),!0}focusPosition(e){let{focusSvc:t}=this.beans;t.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.setRangeToCellIfSupported(e)}setRangeToCellIfSupported(e){if(Oe(e.column))return;this.beans.rangeSvc?.setRangeToCell(e)}isValidNavigateCell(e){return!!Ee(this.beans,e)}getLastCellOfColSpan(e){let t=lt(this.beans,e);if(!t)return e;let s=t.getColSpanningList();if(s.length===1)return e;return{rowIndex:e.rowIndex,column:k(s),rowPinned:e.rowPinned}}ensureCellVisible(e){let t=Qi(this.gos),s=this.beans.rowModel.getRow(e.rowIndex),i=t&&s?.sticky,{scrollFeature:o}=this.gridBodyCon;if(!i&&q(e.rowPinned))o.ensureIndexVisible(e.rowIndex);if(!e.column.isPinned())o.ensureColumnVisible(e.column)}ensureColumnVisible(e){let t=this.gridBodyCon.scrollFeature;if(!e.isPinned())t.ensureColumnVisible(e)}ensureRowVisible(e){this.gridBodyCon.scrollFeature.ensureIndexVisible(e)}};function Qa(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}var mi={moduleName:"KeyboardNavigation",version:z,beans:[NR,oR,fx],apiFunctions:{getFocusedCell:rR,clearFocusedCell:nR,setFocusedCell:aR,setFocusedHeader:dR,tabToNextCell:lR,tabToPreviousCell:cR}},_R=class extends y{constructor(){super(...arguments);this.beanName="pageBoundsListener"}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages(),this.eventSvc.dispatchEvent({type:"paginationChanged",animate:e?.animate??!1,newData:e?.newData??!1,newPage:e?.newPage??!1,newPageSize:e?.newPageSize??!1,keepRenderedRows:e?.keepRenderedRows??!1})}calculatePages(){let{pageBounds:e,pagination:t,rowModel:s}=this.beans;if(t)t.calculatePages();else e.calculateBounds(0,s.getRowCount()-1)}},HR=class extends y{constructor(){super(...arguments);this.beanName="pageBounds",this.pixelOffset=0}getFirstRow(){return this.topRowBounds?.rowIndex??-1}getLastRow(){return this.bottomRowBounds?.rowIndex??-1}getCurrentPageHeight(){let{topRowBounds:e,bottomRowBounds:t}=this;if(!e||!t)return 0;return Math.max(t.rowTop+t.rowHeight-e.rowTop,0)}getCurrentPagePixelRange(){let{topRowBounds:e,bottomRowBounds:t}=this,s=e?.rowTop??0,i=t?t.rowTop+t.rowHeight:0;return{pageFirstPixel:s,pageLastPixel:i}}calculateBounds(e,t){let{rowModel:s}=this.beans,i=s.getRowBounds(e);if(i)i.rowIndex=e;this.topRowBounds=i;let o=s.getRowBounds(t);if(o)o.rowIndex=t;this.bottomRowBounds=o,this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){let e=this.topRowBounds?.rowTop??0;if(this.pixelOffset===e)return;this.pixelOffset=e,this.eventSvc.dispatchEvent({type:"paginationPixelOffsetChanged"})}},zR=".ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}",WR=class extends y{constructor(e,t){super();this.isLeft=e,this.elements=t,this.getWidth=e?()=>this.beans.pinnedCols.leftWidth:()=>this.beans.pinnedCols.rightWidth}postConstruct(){this.addManagedEventListeners({[`${this.isLeft?"left":"right"}PinnedWidthChanged`]:this.onPinnedWidthChanged.bind(this)})}onPinnedWidthChanged(){let e=this.getWidth(),t=e>0;for(let s of this.elements)if(s)G(s,t),Kt(s,e)}},$r=50,UR=class extends y{constructor(){super(...arguments);this.beanName="pinnedCols"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,(t)=>{this.gridBodyCtrl=t.gridBodyCtrl});let e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){let{gos:e,visibleCols:t,eventSvc:s}=this.beans,i=Te(e,"print"),o=i?0:t.getColsLeftWidth(),r=i?0:t.getDisplayedColumnsRightWidth();if(o!=this.leftWidth)this.leftWidth=o,s.dispatchEvent({type:"leftPinnedWidthChanged"});if(r!=this.rightWidth)this.rightWidth=r,s.dispatchEvent({type:"rightPinnedWidthChanged"})}keepPinnedColumnsNarrowerThanViewport(){let e=this.gridBodyCtrl.eBodyViewport,t=ni(e);if(t<=$r)return;let s=this.getPinnedColumnsOverflowingViewport(t-$r),i=this.gos.getCallback("processUnpinnedColumns"),{columns:o,hasLockedPinned:r}=s,n=o;if(!n.length&&!r)return;if(i)n=i({columns:n,viewportWidth:t});if(!n?.length)return;n=n.filter((a)=>!Oe(a)),this.setColsPinned(n,null,"viewportSizeFeature")}createPinnedWidthFeature(e,...t){return new WR(e,t)}setColsPinned(e,t,s){let{colModel:i,colAnimation:o,visibleCols:r,gos:n}=this.beans;if(!i.cols)return;if(!e?.length)return;if(Te(n,"print")){F(37);return}o?.start();let a;if(t===!0||t==="left")a="left";else if(t==="right")a="right";else a=null;let l=[];for(let c of e){if(!c)continue;let d=i.getCol(c);if(!d)continue;if(d.getPinned()!==a)this.setColPinned(d,a),l.push(d)}if(l.length)r.refresh(s),pp(this.eventSvc,l,s);o?.finish()}initCol(e){let{pinned:t,initialPinned:s}=e.colDef;if(t!==void 0)this.setColPinned(e,t);else this.setColPinned(e,s)}setColPinned(e,t){if(t===!0||t==="left")e.pinned="left";else if(t==="right")e.pinned="right";else e.pinned=null;e.dispatchStateUpdatedEvent("pinned")}setupHeaderPinnedWidth(e){let{scrollVisibleSvc:t}=this.beans;if(e.pinned==null)return;let s=e.pinned==="left",i=e.pinned==="right";e.hidden=!0;let o=()=>{let r=s?this.leftWidth:this.rightWidth;if(r==null)return;let n=r==0,a=e.hidden!==n,l=this.gos.get("enableRtl"),c=t.getScrollbarWidth(),u=t.verticalScrollShowing&&(l&&s||!l&&i)?r+c:r;if(e.comp.setPinnedContainerWidth(`${u}px`),e.comp.setDisplayed(!n),a)e.hidden=n,e.refresh()};e.addManagedEventListeners({leftPinnedWidthChanged:o,rightPinnedWidthChanged:o,scrollVisibilityChanged:o,scrollbarWidthChanged:o})}getHeaderResizeDiff(e,t){if(t.getPinned()){let{leftWidth:i,rightWidth:o}=this,r=ni(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport)-$r;if(i+o+e>r)if(r>i+o)e=r-i-o;else return 0}return e}getPinnedColumnsOverflowingViewport(e){let t=this.rightWidth??0,s=this.leftWidth??0,i=t+s,o=!1;if(i<e)return{columns:[],hasLockedPinned:o};let{visibleCols:r}=this.beans,n=[...r.leftCols],a=[...r.rightCols],l=0,c=0,d=0,u=[],h=i-d-e;while((c<n.length||l<a.length)&&h>0){if(l<a.length){let g=a[l++];if(g.colDef.lockPinned){o=!0;continue}h-=g.getActualWidth(),u.push(g)}if(c<n.length&&h>0){let g=n[c++];if(g.colDef.lockPinned){o=!0;continue}h-=g.getActualWidth(),u.push(g)}}return{columns:u,hasLockedPinned:o}}},KR={moduleName:"PinnedColumn",version:z,beans:[UR],css:[zR]},$R=class extends xe{constructor(){super();this.beanName="ariaAnnounce",this.descriptionContainer=null,this.pendingAnnouncements=new Map,this.lastAnnouncement="",this.updateAnnouncement=$e(this,this.updateAnnouncement.bind(this),200)}postConstruct(){let e=this.beans,t=ce(e),s=this.descriptionContainer=t.createElement("div");s.classList.add("ag-aria-description-container"),xh(s,"polite"),yv(s,"additions text"),Sv(s,!0),e.eRootDiv.appendChild(s)}announceValue(e,t){this.pendingAnnouncements.set(t,e),this.updateAnnouncement()}updateAnnouncement(){if(!this.descriptionContainer)return;let e=Array.from(this.pendingAnnouncements.values()).join(". ");this.pendingAnnouncements.clear(),this.descriptionContainer.textContent="",setTimeout(()=>{this.handleAnnouncementUpdate(e)},50)}handleAnnouncementUpdate(e){if(!this.isAlive()||!this.descriptionContainer)return;let t=e;if(t==null||t.replace(/[ .]/g,"")==""){this.lastAnnouncement="";return}if(this.lastAnnouncement===t)t=`${t}​`;this.lastAnnouncement=t,this.descriptionContainer.textContent=t}destroy(){super.destroy();let{descriptionContainer:e}=this;if(e)te(e),e.remove();this.descriptionContainer=null,this.pendingAnnouncements.clear()}},jR=class extends $R{},qR={moduleName:"Aria",version:z,beans:[jR]},YR=":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}",Wu="ag-delay-render",XR=class extends y{constructor(){super(...arguments);this.beanName="colDelayRenderSvc",this.hideRequested=!1,this.alreadyRevealed=!1,this.timesRetried=0,this.requesters=new Set}hideColumns(e){if(this.alreadyRevealed||this.requesters.has(e))return;if(this.requesters.add(e),!this.hideRequested)this.beans.ctrlsSvc.whenReady(this,(t)=>{t.gridBodyCtrl.eGridBody.classList.add(Wu)}),this.hideRequested=!0}revealColumns(e){if(this.alreadyRevealed||!this.isAlive())return;if(this.requesters.delete(e),this.requesters.size>0)return;let{renderStatus:t,ctrlsSvc:s}=this.beans;if(t){if(!t.areHeaderCellsRendered()&&this.timesRetried<5){this.timesRetried++,setTimeout(()=>this.revealColumns(e));return}this.timesRetried=0}s.getGridBodyCtrl().eGridBody.classList.remove(Wu),this.alreadyRevealed=!0}},ZR={moduleName:"ColumnDelayRender",version:z,beans:[XR],css:[YR]},Wn=class extends L{constructor(){super()}},QR={tag:"div",cls:"ag-overlay-exporting-center",children:[{tag:"span",ref:"eExportingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eExportingText",cls:"ag-exporting-text"}]},JR=class extends Wn{constructor(){super(...arguments);this.eExportingIcon=E,this.eExportingText=E}init(e){let{beans:t}=this;this.setTemplate(QR);let s=N("overlayExporting",t,null);if(s)this.eExportingIcon.appendChild(s);let i=e.exporting?.overlayText??this.getLocaleTextFunc()("exportingOoo","Exporting...");this.eExportingText.textContent=i,t.ariaAnnounce.announceValue(i,"overlay")}},eF={tag:"div",cls:"ag-overlay-loading-center",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},tF=class extends Wn{constructor(){super(...arguments);this.eLoadingIcon=E,this.eLoadingText=E}init(e){let{beans:t,gos:s}=this,i=de(s.get("overlayLoadingTemplate")?.trim());if(this.setTemplate(i??eF),!i){let o=N("overlayLoading",t,null);if(o)this.eLoadingIcon.appendChild(o);let r=e.loading?.overlayText??this.getLocaleTextFunc()("loadingOoo","Loading...");this.eLoadingText.textContent=r,t.ariaAnnounce.announceValue(r,"overlay")}}},sF={tag:"span",cls:"ag-overlay-no-matching-rows-center"},iF=class extends Wn{init(e){let{beans:t}=this;this.setTemplate(sF);let s=e.noMatchingRows?.overlayText??this.getLocaleTextFunc()("noMatchingRows","No Matching Rows");this.getGui().textContent=s,t.ariaAnnounce.announceValue(s,"overlay")}},oF={tag:"span",cls:"ag-overlay-no-rows-center"},rF=class extends Wn{init(e){let{beans:t,gos:s}=this,i=de(s.get("overlayNoRowsTemplate")?.trim());if(this.setTemplate(i??oF),!i){let o=e.noRows?.overlayText??this.getLocaleTextFunc()("noRowsToShow","No Rows To Show");this.getGui().textContent=o,t.ariaAnnounce.announceValue(o,"overlay")}}};function nF(e){e.overlays?.showLoadingOverlay()}function aF(e){e.overlays?.showNoRowsOverlay()}function lF(e){e.overlays?.hideOverlay()}var cF=".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{pointer-events:all}.ag-overlay-exporting-center,.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);display:flex;padding:var(--ag-spacing)}",dF={tag:"div",cls:"ag-overlay",role:"presentation",children:[{tag:"div",cls:"ag-overlay-panel",role:"presentation",children:[{tag:"div",ref:"eOverlayWrapper",cls:"ag-overlay-wrapper",role:"presentation"}]}]},Wp=class extends L{constructor(){super(dF);this.eOverlayWrapper=E,this.activeOverlay=null,this.activePromise=null,this.activeCssClass=null,this.elToFocusAfter=null,this.overlayExclusive=!1,this.oldWrapperPadding=null,this.registerCSS(cF)}handleKeyDown(e){if(e.key!==b.TAB||e.defaultPrevented||ut(e))return;let{beans:t,eOverlayWrapper:s}=this;if(s&&Ie(t,s,!1,e.shiftKey))return;let o;if(e.shiftKey)o=t.focusSvc.focusGridView({column:k(t.visibleCols.allCols),backwards:!0,canFocusOverlay:!1});else o=pt(t,!1);if(o)e.preventDefault()}updateLayoutClasses(e,t){let s=this.eOverlayWrapper;if(!s)return;let i=s.classList,{AUTO_HEIGHT:o,NORMAL:r,PRINT:n}=Et;i.toggle(o,t.autoHeight),i.toggle(r,t.normal),i.toggle(n,t.print)}postConstruct(){this.createManagedBean(new xc(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.beans.overlays.setWrapperComp(this,!1),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)}),this.addManagedEventListeners({gridSizeChanged:this.refreshWrapperPadding.bind(this)})}setWrapperTypeClass(e){let t=this.eOverlayWrapper?.classList;if(!t){this.activeCssClass=null;return}if(this.activeCssClass)t.toggle(this.activeCssClass,!1);this.activeCssClass=e,t.toggle(e,!0)}showOverlay(e,t,s){if(this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=e,this.overlayExclusive=s,!e)return this.refreshWrapperPadding(),B.resolve();if(this.setWrapperTypeClass(t),this.setDisplayed(!0,{skipAriaHidden:!0}),this.refreshWrapperPadding(),s&&this.isGridFocused()){let i=j(this.beans);if(i&&!ks(this.beans))this.elToFocusAfter=i}return e.then((i)=>{let o=this.eOverlayWrapper;if(!o){this.destroyBean(i);return}if(this.activePromise!==e){if(this.activeOverlay!==i)this.destroyBean(i);return}if(this.activePromise=null,!i)return;if(this.activeOverlay!==i)o.appendChild(i.getGui()),this.activeOverlay=i;if(s&&this.isGridFocused())pe(o)}),e}refreshWrapperPadding(){if(!this.eOverlayWrapper){this.oldWrapperPadding=null;return}let e=!!this.activeOverlay||!!this.activePromise,t=0;if(e&&!this.overlayExclusive)t=this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight||0;if(t!==this.oldWrapperPadding)this.oldWrapperPadding=t,this.eOverlayWrapper.style.setProperty("padding-top",`${t}px`)}destroyActiveOverlay(){this.activePromise=null;let e=this.activeOverlay;if(!e){this.overlayExclusive=!1,this.elToFocusAfter=null,this.refreshWrapperPadding();return}let t=this.elToFocusAfter;if(this.elToFocusAfter=null,this.activeOverlay=null,this.overlayExclusive=!1,t&&!this.isGridFocused())t=null;this.destroyBean(e);let s=this.eOverlayWrapper;if(s)te(s);t?.focus?.({preventScroll:!0}),this.refreshWrapperPadding()}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}isGridFocused(){let e=j(this.beans);return!!e&&this.beans.eGridDiv.contains(e)}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.beans.overlays.setWrapperComp(this,!0),super.destroy(),this.eOverlayWrapper=null}},uF={selector:"AG-OVERLAY-WRAPPER",component:Wp},hF=["refresh"],rr=(e)=>({name:e,optionalMethods:hF}),Js={id:"agLoadingOverlay",overlayType:"loading",comp:rr("loadingOverlayComponent"),wrapperCls:"ag-overlay-loading-wrapper",exclusive:!0,compKey:"loadingOverlayComponent",paramsKey:"loadingOverlayComponentParams",isSuppressed:(e)=>{let t=e.get("loading");return t===!1||e.get("suppressLoadingOverlay")===!0&&t!==!0}},ki={id:"agNoRowsOverlay",overlayType:"noRows",comp:rr("noRowsOverlayComponent"),wrapperCls:"ag-overlay-no-rows-wrapper",compKey:"noRowsOverlayComponent",paramsKey:"noRowsOverlayComponentParams",isSuppressed:(e)=>e.get("suppressNoRowsOverlay")},Bc={id:"agNoMatchingRowsOverlay",overlayType:"noMatchingRows",comp:rr("noMatchingRowsOverlayComponent"),wrapperCls:"ag-overlay-no-matching-rows-wrapper"},gn={id:"agExportingOverlay",overlayType:"exporting",comp:rr("exportingOverlayComponent"),wrapperCls:"ag-overlay-exporting-wrapper",exclusive:!0},jr={id:"activeOverlay",comp:rr("activeOverlay"),wrapperCls:"ag-overlay-modal-wrapper",exclusive:!0},gF=(e)=>{if(!e)return null;return{agLoadingOverlay:Js,agNoRowsOverlay:ki,agNoMatchingRowsOverlay:Bc,agExportingOverlay:gn}[e]??jr},pF=(e)=>{if(!e)return null;return{loading:Js,noRows:ki,noMatchingRows:Bc,exporting:gn}[e]},fF=class extends y{constructor(){super(...arguments);this.beanName="overlays",this.eWrapper=void 0,this.exclusive=!1,this.oldExclusive=!1,this.currentDef=null,this.showInitialOverlay=!0,this.userForcedNoRows=!1,this.exportsInProgress=0,this.newColumnsLoadedCleanup=null}postConstruct(){let e=this.gos;this.showInitialOverlay=J(e);let t=()=>{if(this.userForcedNoRows)return;this.updateOverlay(!1)},[s,i,o,r]=this.addManagedEventListeners({newColumnsLoaded:t,rowCountReady:()=>{this.disableInitialOverlay(),t(),i()},rowDataUpdated:t,modelUpdated:t});this.newColumnsLoadedCleanup=s,this.addManagedPropertyListeners(["loading","activeOverlay","activeOverlayParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams"],(n)=>this.onPropChange(new Set(n.changeSet?.properties)))}destroy(){this.doHideOverlay(),super.destroy(),this.eWrapper=void 0}setWrapperComp(e,t){if(!this.isAlive())return;if(!t)this.eWrapper=e;else if(this.eWrapper===e)this.eWrapper=void 0;this.updateOverlay(!1)}isVisible(){return!!this.currentDef}showLoadingOverlay(){this.showInitialOverlay=!1;let e=this.gos;if(!this.eWrapper||e.get("activeOverlay"))return;if(this.isDisabled(Js))return;let t=e.get("loading");if(!t&&t!==void 0)return;this.doShowOverlay(Js)}showNoRowsOverlay(){this.showInitialOverlay=!1;let e=this.gos;if(!this.eWrapper||e.get("activeOverlay")||e.get("loading")||this.isDisabled(ki))return;this.userForcedNoRows=!0,this.doShowOverlay(ki)}async showExportOverlay(e){let{gos:t,beans:s}=this;if(!this.eWrapper||t.get("activeOverlay")||t.get("loading")||this.isDisabled(gn)||this.userForcedNoRows&&this.currentDef===ki){e();return}let i=this.getDesiredDefWithOverride(gn);if(!i){e();return}this.exportsInProgress++,this.focusedCell=s.focusSvc.getFocusedCell(),await this.doShowOverlay(i),await new Promise((r)=>setTimeout(()=>r()));let o=Date.now();try{e()}finally{let r=Date.now()-o,n=Math.max(0,300-r),a=()=>{if(this.exportsInProgress--,this.exportsInProgress===0)this.updateOverlay(!1),mc(s,this.focusedCell),this.focusedCell=null};if(n>0)setTimeout(()=>a(),n);else a()}}hideOverlay(){let e=this.gos;this.showInitialOverlay=!1;let t=this.userForcedNoRows;if(this.userForcedNoRows=!1,e.get("loading")){F(99);return}if(e.get("activeOverlay")){F(296);return}if(this.currentDef===Bc){F(297);return}if(this.doHideOverlay(),t){if(this.getOverlayDef()!==ki)this.updateOverlay(!1)}}getOverlayWrapperSelector(){return uF}getOverlayWrapperCompClass(){return Wp}onPropChange(e){let t=e.has("activeOverlay");if(t||e.has("loading")){if(this.updateOverlay(t))return}let s=this.currentDef,i=this.eWrapper?.activeOverlay;if(i&&s){let o=e.has("activeOverlayParams");if(s===jr){if(o)i.refresh?.(this.makeCompParams(!0))}else{let r=s.paramsKey;if(e.has("overlayComponentParams")||r&&e.has(r))i.refresh?.(this.makeCompParams(!1,r,s.overlayType))}}}updateOverlay(e){let t=this.eWrapper;if(!t)return this.currentDef=null,!1;let s=this.getDesiredDefWithOverride(),i=this.currentDef,o=s===jr&&e;if(s!==i){if(!s)return this.disableInitialOverlay(),this.doHideOverlay();return this.doShowOverlay(s),!0}if(o&&s)return t.hideOverlay(),this.doShowOverlay(s),!0;if(!s)this.disableInitialOverlay();return!1}getDesiredDefWithOverride(e){let{gos:t}=this,s=gF(t.get("activeOverlay"));if(!s){if(s=e??this.getOverlayDef(),s&&this.isDisabled(s))s=null}return s}getOverlayDef(){let{gos:e,beans:t}=this,{rowModel:s}=t,i=e.get("loading");if(i!==void 0){if(this.disableInitialOverlay(),i)return Js}else if(this.showInitialOverlay){if(!this.isDisabled(Js)&&(!e.get("columnDefs")||!e.get("rowData")))return Js;this.disableInitialOverlay()}else this.disableInitialOverlay();let r=s.getOverlayType();return pF(r)}disableInitialOverlay(){this.showInitialOverlay=!1,this.newColumnsLoadedCleanup?.(),this.newColumnsLoadedCleanup=null}doShowOverlay(e){let{gos:t,beans:s}=this,{userCompFactory:i}=s;this.currentDef=e;let o=e!==jr,r=!!e.exclusive;this.exclusive=r;let n;if(e.paramsKey&&t.get(e.paramsKey)||e.compKey&&t.get(e.compKey))n=e.paramsKey;let a=void 0;if(o){if(t.get("overlayComponent")||t.get("overlayComponentSelector"))a=i.getCompDetailsFromGridOptions({name:"overlayComponent",optionalMethods:["refresh"]},void 0,this.makeCompParams(!1,e.paramsKey,e.overlayType))}a??(a=i.getCompDetailsFromGridOptions(e.comp,o?e.id:void 0,this.makeCompParams(!o,n,e.overlayType),!1));let l=a?.newAgStackInstance()??null,c=this.eWrapper?this.eWrapper.showOverlay(l,e.wrapperCls,r):B.resolve();return this.eWrapper?.refreshWrapperPadding(),this.setExclusive(r),c}makeCompParams(e,t,s){let{gos:i}=this,o=e?i.get("activeOverlayParams"):{...i.get("overlayComponentParams"),...t&&i.get(t)||null,overlayType:s};return I(i,o??{})}doHideOverlay(){let e=!1;if(this.currentDef)this.currentDef=null,e=!0;this.exclusive=!1;let t=this.eWrapper;if(t)t.hideOverlay(),t.refreshWrapperPadding(),this.setExclusive(!1);return e}setExclusive(e){if(this.oldExclusive!==e)this.oldExclusive=e,this.eventSvc.dispatchEvent({type:"overlayExclusiveChanged"})}isDisabled(e){let{gos:t}=this;return e.overlayType&&t.get("suppressOverlays")?.includes(e.overlayType)||e.isSuppressed?.(t)===!0}},mF={moduleName:"Overlay",version:z,userComponents:{agLoadingOverlay:tF,agNoRowsOverlay:rF,agNoMatchingRowsOverlay:iF,agExportingOverlay:JR},apiFunctions:{showLoadingOverlay:nF,showNoRowsOverlay:aF,hideOverlay:lF},icons:{overlayLoading:"loading",overlayExporting:"loading"},beans:[fF]},CF=class extends y{constructor(){super(...arguments);this.beanName="rowContainerHeight",this.scrollY=0,this.uiBodyHeight=0}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=bb(),Ao(this.gos,"RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}updateOffset(){if(!this.stretching)return;let e=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();if(e!==this.scrollY||t!==this.uiBodyHeight)this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset()}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;let e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;Ao(this.gos,`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){if(e!==this.uiContainerHeight)this.uiContainerHeight=e,this.eventSvc.dispatchEvent({type:"rowContainerHeightChanged"})}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){let t=typeof e==="number"?Math.floor(e):null;if(this.divStretchOffset===t)return;this.divStretchOffset=t,this.eventSvc.dispatchEvent({type:"heightScaleChanged"})}setModelHeight(e){if(this.modelHeight=e,this.stretching=e!=null&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching)this.calculateOffset();else this.clearOffset()}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){let e=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;let t=this.modelHeight-this.getUiBodyHeight(),s=e/t;return this.maxScrollY*s}},vF=400,wF=class extends y{constructor(){super(...arguments);this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{let e=()=>{for(let r of this.getAllCellCtrls())r.onCellSelectionChanged()},t=()=>{for(let r of this.getAllCellCtrls())r.updateRangeBordersIfRangeCount()},s=()=>{this.eventSvc.addListener("cellSelectionChanged",e),this.eventSvc.addListener("columnMoved",t),this.eventSvc.addListener("columnPinned",t),this.eventSvc.addListener("columnVisible",t)},i=()=>{this.eventSvc.removeListener("cellSelectionChanged",e),this.eventSvc.removeListener("columnMoved",t),this.eventSvc.removeListener("columnPinned",t),this.eventSvc.removeListener("columnVisible",t)};if(this.addDestroyFunc(()=>i()),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{if(qe(this.gos))s();else i()}),qe(this.gos))s()}}wireBeans(e){this.pageBounds=e.pageBounds,this.colModel=e.colModel,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusSvc=e.focusSvc,this.rowContainerHeight=e.rowContainerHeight,this.ctrlsSvc=e.ctrlsSvc,this.editSvc=e.editSvc}postConstruct(){this.ctrlsSvc.whenReady(this,(e)=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),pinnedRowsChanged:this.onPinnedRowsChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this,{})}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListener("suppressCellFocus",(i)=>this.onSuppressCellFocusChanged(i.currentValue)),this.addManagedPropertyListeners(["groupSuppressBlankHeader","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.addManagedPropertyListener("cellSelection",({currentValue:i,previousValue:o})=>{if(!o&&i||o&&!i)this.redrawRows()});let{stickyRowSvc:e,gos:t,showRowGroupCols:s}=this.beans;if(s)this.addManagedPropertyListener("showOpenedGroup",()=>{let i=s.columns;if(i.length)this.refreshCells({columns:i,force:!0})});if(e)this.stickyRowFeature=e.createStickyRowFeature(this,this.createRowCon.bind(this),this.destroyRowCtrls.bind(this));else{let i=this.gridBodyCtrl;i.setStickyTopHeight(0),i.setStickyBottomHeight(0)}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=Te(t,"print"),this.embedFullWidthRows=this.printLayout||t.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){let e=this.getKeepDetailRowsCount(),t=e!=null?e:3;this.cachedRowCtrls=new bF(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?.stickyTopRowCtrls??[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?.stickyBottomRowCtrls??[]}updateAllRowCtrls(){let e=Object.values(this.rowCtrlsByRowIndex),t=Object.values(this.zombieRowCtrls),s=this.cachedRowCtrls?.getEntries()??[];if(t.length>0||s.length>0)this.allRowCtrls=[...e,...t,...s];else this.allRowCtrls=e}isCellBeingRendered(e,t){let s=this.rowCtrlsByRowIndex[e];if(!t||!s)return!!s;if(s.isFullWidth())return!0;return!!this.beans.spannedRowRenderer?.getCellByPosition({rowIndex:e,column:t,rowPinned:null})||!!s.getCellCtrl(t)||!s.isRowRendered()}updateCellFocus(e){for(let t of this.getAllCellCtrls())t.onCellFocused(e);for(let t of this.getFullWidthRowCtrls())t.onFullWidthRowFocused(e)}onCellFocusChanged(e){if(e?.rowIndex!=null&&!e.rowPinned){let t=this.beans.colModel.getCol(e.column)??void 0;if(!this.isCellBeingRendered(e.rowIndex,t))this.redraw()}this.updateCellFocus(e)}onSuppressCellFocusChanged(e){for(let t of this.getAllCellCtrls())t.onSuppressCellFocusChanged(e);for(let t of this.getFullWidthRowCtrls())t.onSuppressCellFocusChanged(e)}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:(e)=>this.onCellFocusChanged(e),cellFocusCleared:()=>this.updateCellFocus(),flashCells:(e)=>{let{cellFlashSvc:t}=this.beans;if(t)for(let s of this.getAllCellCtrls())t.onFlashCells(s,e)},columnHoverChanged:()=>{for(let e of this.getAllCellCtrls())e.onColumnHover()},displayedColumnsChanged:()=>{for(let e of this.getAllCellCtrls())e.onDisplayedColumnsChanged()},displayedColumnsWidthChanged:()=>{if(this.printLayout)for(let e of this.getAllCellCtrls())e.onLeftChanged()}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){for(let e of this.destroyFuncsForColumnListeners)e();this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();let e=this.colModel.getCols();for(let t of e){let s=(l)=>{for(let c of this.getAllCellCtrls())if(c.column===t)l(c)},i=()=>{s((l)=>l.onLeftChanged())},o=()=>{s((l)=>l.onWidthChanged())},r=()=>{s((l)=>l.onFirstRightPinnedChanged())},n=()=>{s((l)=>l.onLastLeftPinnedChanged())},a=()=>{s((l)=>l.onColDefChanged())};t.__addEventListener("leftChanged",i),t.__addEventListener("widthChanged",o),t.__addEventListener("firstRightPinnedChanged",r),t.__addEventListener("lastLeftPinnedChanged",n),t.__addEventListener("colDefChanged",a),this.destroyFuncsForColumnListeners.push(()=>{t.__removeEventListener("leftChanged",i),t.__removeEventListener("widthChanged",o),t.__removeEventListener("firstRightPinnedChanged",r),t.__removeEventListener("lastLeftPinnedChanged",n),t.__removeEventListener("colDefChanged",a)})}}onDomLayoutChanged(){let e=Te(this.gos,"print"),t=e||this.gos.get("embedFullWidthRows"),s=t!==this.embedFullWidthRows||this.printLayout!==e;if(this.printLayout=e,this.embedFullWidthRows=t,s)this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;let e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){let t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsNotSpanningForColumn(e){let t=[];for(let s of this.getAllRowCtrls()){let i=s.getCellCtrl(e,!0)?.eGui;if(i)t.push(i)}return t}refreshFloatingRowComps(e=!0){this.refreshFloatingRows(this.topRowCtrls,"top",e),this.refreshFloatingRows(this.bottomRowCtrls,"bottom",e)}refreshFloatingRows(e,t,s){let{pinnedRowModel:i,beans:o,printLayout:r}=this,n=Object.fromEntries(e.map((l)=>[l.rowNode.id,l]));i?.forEachPinnedRow(t,(l,c)=>{let d=e[c];if(d&&i.getPinnedRowById(d.rowNode.id,t)===void 0)d.destroyFirstPass(),d.destroySecondPass();if(l.id in n&&s)e[c]=n[l.id],delete n[l.id];else e[c]=new xl(l,o,!1,!1,r)});let a=(t==="top"?i?.getPinnedTopRowCount():i?.getPinnedBottomRowCount())??0;e.length=a}onPinnedRowDataChanged(){let e={recycleRows:!0};this.redrawAfterModelUpdate(e)}onPinnedRowsChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature?.refreshStickyNode(e);else if(this.cachedRowCtrls?.has(e)){this.cachedRowCtrls.removeRow(e);return}else{let s=(i)=>{let o=i[e.rowIndex];if(!o)return;if(o.rowNode!==e)return;o.destroyFirstPass(),o.destroySecondPass(),i[e.rowIndex]=this.createRowCon(e,!1,!1)};switch(e.rowPinned){case"top":s(this.topRowCtrls);break;case"bottom":s(this.bottomRowCtrls);break;default:s(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}if(!t)this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){let{editSvc:t}=this.beans;if(t?.isEditing())if(t.isBatchEditing())t.cleanupEditors();else t.stopEditing(void 0,{source:"api"});if(e!=null){for(let i of e??[])this.redrawRow(i,!0);this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();let t=this.beans.focusSvc?.getFocusCellToUseAfterRefresh();this.updateContainerHeights(),this.scrollToTopIfNewData(e);let s=!e.domLayoutChanged&&!!e.recycleRows,i=e.animate&&Bi(this.gos),o=s?this.getRowsToRecycle():null;if(!s)this.removeAllRowComps(!i);this.workOutFirstAndLastRowsToRender();let{stickyRowFeature:r,gos:n}=this;if(r){r.checkStickyRows();let a=r.extraTopHeight+r.extraBottomHeight;if(a)this.updateContainerHeights(a)}if(this.recycleRows(o,i),this.gridBodyCtrl.updateRowCount(),!e.onlyBody)this.refreshFloatingRowComps(n.get("enableRowPinning")?s:void 0);if(this.dispatchDisplayedRowsChanged(),t!=null)this.restoreFocusedCell(t);this.releaseLockOnRefresh()}scrollToTopIfNewData(e){let t=e.newData||e.newPage,s=this.gos.get("suppressScrollOnNewData");if(t&&!s)this.gridBodyCtrl.scrollFeature.scrollToTop(),this.stickyRowFeature?.resetOffsets()}updateContainerHeights(e=0){let{rowContainerHeight:t}=this;if(this.printLayout){t.setModelHeight(null);return}let s=this.pageBounds.getCurrentPageHeight();if(s===0)s=1;t.setModelHeight(s+e)}getLockOnRefresh(){if(this.refreshInProgress)throw Error(ct(252));this.refreshInProgress=!0,this.beans.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.beans.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){if(!e)return;let t=this.beans.focusSvc,s=this.findPositionToFocus(e);if(!s){t.focusHeaderPosition({headerPosition:{headerRowIndex:rt(this.beans)-1,column:e.column}});return}if(e.rowIndex!==s.rowIndex||e.rowPinned!=s.rowPinned){t.setFocusedCell({...s,preventScrollOnBrowserFocus:!0,forceBrowserFocus:!0});return}if(!t.doesRowOrCellHaveBrowserFocus())this.updateCellFocus(I(this.gos,{...s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))}findPositionToFocus(e){let{pagination:t,pageBounds:s}=this.beans,i=e;if(i.rowPinned==null&&t&&s&&!t.isRowInPage(i.rowIndex))i={rowPinned:null,rowIndex:s.getFirstRow()};while(i){if(i.rowPinned==null&&s){if(i.rowIndex<s.getFirstRow()){if(i=Ye(this.beans,{rowPinned:null,rowIndex:0}),!i)return null}else if(i.rowIndex>s.getLastRow())i={rowPinned:null,rowIndex:s.getLastRow()}}let o=this.getRowByPosition(i);if(o?.isAlive())return{...o.getRowPosition(),column:e.column};i=Ye(this.beans,i)}return null}getAllCellCtrls(){let e=[],t=this.getAllRowCtrls(),s=t.length;for(let i=0;i<s;i++){let o=t[i].getAllCellCtrls(),r=o.length;for(let n=0;n<r;n++)e.push(o[n])}return e}getAllRowCtrls(){let{spannedRowRenderer:e}=this.beans,t=this.getStickyTopRowCtrls(),s=this.getStickyBottomRowCtrls();return[...this.topRowCtrls,...this.bottomRowCtrls,...t,...s,...e?.getCtrls("top")??[],...e?.getCtrls("bottom")??[],...e?.getCtrls("center")??[],...Object.values(this.rowCtrlsByRowIndex)]}addRenderedRowListener(e,t,s){let i=this.rowCtrlsByRowIndex[t];if(i)i.addEventListener(e,s)}refreshCells({rowNodes:e,columns:t,force:s,suppressFlash:i}={}){let o={force:s,newData:!1,suppressFlash:i};for(let r of this.getCellCtrls(e,t))r.refreshOrDestroyCell(o);this.refreshFullWidth(e)}refreshRows(e={}){for(let t of this.getRowCtrls(e.rowNodes))t.refreshRow(e);this.refreshFullWidth(e.rowNodes)}getRowCtrlByNode(e){let t=e.rowIndex;if(t==null)return;let s=e.rowPinned;if(s==="top"){let o=this.topRowCtrls[t];return o?.rowNode===e?o:void 0}if(s==="bottom"){let o=this.bottomRowCtrls[t];return o?.rowNode===e?o:void 0}let i=this.rowCtrlsByRowIndex[t];if(i?.rowNode===e)return i;return this.getStickyRowCtrlByNode(e)}getStickyRowCtrlByNode(e){let t=this.stickyRowFeature;if(!t)return;for(let s of t.stickyTopRowCtrls)if(s.rowNode===e)return s;for(let s of t.stickyBottomRowCtrls)if(s.rowNode===e)return s;return}refreshRowByNode(e){if(e)this.getRowCtrlByNode(e)?.refreshRow()}refreshFullWidth(e){if(!e)return;let t=!1;for(let s of this.getRowCtrls(e)){if(!s.isFullWidth())continue;if(!s.refreshFullWidth())t=!0,this.redrawRow(s.rowNode,!0)}if(t)this.dispatchDisplayedRowsChanged(!1)}getRowCtrls(e){let t=Uu(e),s=this.getAllRowCtrls();if(!e||!t)return s;return s.filter((i)=>{let o=i.rowNode;return Ku(o,t)})}getCellCtrls(e,t){let s;if(M(t))s={},t.forEach((o)=>{let r=this.colModel.getCol(o);if(M(r))s[r.getId()]=!0});let i=[];for(let o of this.getRowCtrls(e))for(let r of o.getAllCellCtrls()){let n=r.column.getId();if(s&&!s[n])continue;i.push(r)}return i}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(e){let t=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(t,e),this.stickyRowFeature?.destroyStickyCtrls()}getRowsToRecycle(){let e=[];for(let s of Object.keys(this.rowCtrlsByRowIndex))if(this.rowCtrlsByRowIndex[s].rowNode.id==null)e.push(s);this.removeRowCtrls(e);let t={};for(let s of Object.values(this.rowCtrlsByRowIndex)){let i=s.rowNode;t[i.id]=s}return this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){for(let s of e){let i=this.rowCtrlsByRowIndex[s];if(i)i.destroyFirstPass(t),i.destroySecondPass();delete this.rowCtrlsByRowIndex[s]}}onBodyScroll(e){if(e.direction!=="vertical")return;this.redraw({afterScroll:!0})}redraw(e={}){let{focusSvc:t,animationFrameSvc:s}=this.beans,{afterScroll:i}=e,o,r=this.stickyRowFeature;if(r)o=t?.getFocusCellToUseAfterRefresh()||void 0;let n=this.firstRenderedRow,a=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let l=!1;if(r){l=r.checkStickyRows();let d=r.extraTopHeight+r.extraBottomHeight;if(d)this.updateContainerHeights(d)}let c=this.firstRenderedRow!==n||this.lastRenderedRow!==a;if(i&&!l&&!c)return;if(this.getLockOnRefresh(),this.recycleRows(null,!1,i),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(i&&!l),o!=null){let d=t?.getFocusCellToUseAfterRefresh();if(o!=null&&d==null)s?.flushAllFrames(),this.restoreFocusedCell(o)}}removeRowCompsNotToDraw(e,t){let s={};for(let r of e)s[r]=!0;let o=Object.keys(this.rowCtrlsByRowIndex).filter((r)=>!s[r]);this.removeRowCtrls(o,t)}calculateIndexesToDraw(e){let t=[];for(let n=this.firstRenderedRow;n<=this.lastRenderedRow;n++)t.push(n);let s=this.beans.pagination,i=this.beans.focusSvc?.getFocusedCell()?.rowIndex;if(i!=null&&(i<this.firstRenderedRow||i>this.lastRenderedRow)&&(!s||s.isRowInPage(i))&&i<this.rowModel.getRowCount())t.push(i);let o=(n)=>{let a=n.rowNode.rowIndex;if(a==null||a===i)return;if(a<this.firstRenderedRow||a>this.lastRenderedRow){if(this.doNotUnVirtualiseRow(n))t.push(a)}};for(let n of Object.values(this.rowCtrlsByRowIndex))o(n);if(e)for(let n of Object.values(e))o(n);t.sort((n,a)=>n-a);let r=[];for(let n=0;n<t.length;n++){let a=t[n],l=this.rowModel.getRow(a);if(l&&!l.sticky)r.push(a)}return r}recycleRows(e,t=!1,s=!1){let i=this.calculateIndexesToDraw(e);if(this.printLayout||s)t=!1;this.removeRowCompsNotToDraw(i,!t);for(let o of i)this.createOrUpdateRowCtrl(o,e,t,s);if(e){let{animationFrameSvc:o}=this.beans;if(o?.active&&s&&!this.printLayout)o.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()});else this.destroyRowCtrls(e,t)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){this.eventSvc.dispatchEvent({type:"displayedRowsChanged",afterScroll:e})}onDisplayedColumnsChanged(){let{visibleCols:e}=this.beans,t=e.isPinningLeft(),s=e.isPinningRight();if(this.pinningLeft!==t||s!==this.pinningRight){if(this.pinningLeft=t,this.pinningRight=s,this.embedFullWidthRows)this.redrawFullWidthEmbeddedRows()}}redrawFullWidthEmbeddedRows(){let e=[];for(let t of this.getFullWidthRowCtrls()){let s=t.rowNode.rowIndex;e.push(s.toString())}this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){let t=Uu(e);return this.getAllRowCtrls().filter((s)=>{if(!s.isFullWidth())return!1;let i=s.rowNode;if(t!=null&&!Ku(i,t))return!1;return!0})}createOrUpdateRowCtrl(e,t,s,i){let o,r=this.rowCtrlsByRowIndex[e];if(!r){if(o=this.rowModel.getRow(e),M(o)&&M(t)&&t[o.id]&&o.alreadyRendered)r=t[o.id],t[o.id]=null}if(!r){if(!o)o=this.rowModel.getRow(e);if(M(o))r=this.createRowCon(o,s,i);else return}if(o)o.alreadyRendered=!0;this.rowCtrlsByRowIndex[e]=r}destroyRowCtrls(e,t){let s=[];if(e)for(let i of Object.values(e)){if(!i)continue;if(this.cachedRowCtrls&&i.isCacheable()){this.cachedRowCtrls.addRow(i);continue}if(i.destroyFirstPass(!t),t){let o=i.instanceId;this.zombieRowCtrls[o]=i,s.push(()=>{i.destroySecondPass(),delete this.zombieRowCtrls[o]})}else i.destroySecondPass()}if(t)s.push(()=>{if(this.isAlive())this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),window.setTimeout(()=>{for(let i of s)i()},vF)}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){let e=this.getRowBuffer(),t=Qh(this.beans);return e*t}workOutFirstAndLastRowsToRender(){let{rowContainerHeight:e,pageBounds:t,rowModel:s}=this;e.updateOffset();let i,o;if(!s.isRowsToRender())i=0,o=-1;else if(this.printLayout)this.beans.environment.refreshRowHeightVariable(),i=t.getFirstRow(),o=t.getLastRow();else{let d=this.getRowBufferInPixels(),u=this.ctrlsSvc.getScrollFeature(),h=this.gos.get("suppressRowVirtualisation"),g,p,f;do{let S=t.getPixelOffset(),{pageFirstPixel:x,pageLastPixel:R}=t.getCurrentPagePixelRange(),P=e.divStretchOffset,D=u.getVScrollPosition(),{top:O,bottom:A}=D;if(h)p=x+P,f=R+P;else p=Math.max(O+S-d,x)+P,f=Math.min(A+S+d,R)+P;this.firstVisibleVPixel=Math.max(O+S,x)+P,this.lastVisibleVPixel=Math.min(A+S,R)+P,g=this.ensureAllRowsInRangeHaveHeightsCalculated(p,f)}while(g);let m=s.getRowIndexAtPixel(p),C=s.getRowIndexAtPixel(f),v=t.getFirstRow(),w=t.getLastRow();if(m<v)m=v;if(C>w)C=w;i=m,o=C}let r=Te(this.gos,"normal"),n=this.gos.get("suppressMaxRenderedRowRestriction"),a=Math.max(this.getRowBuffer(),500);if(r&&!n){if(o-i>a)o=i+a}let l=i!==this.firstRenderedRow,c=o!==this.lastRenderedRow;if(l||c)this.firstRenderedRow=i,this.lastRenderedRow=o,this.eventSvc.dispatchEvent({type:"viewportChanged",firstRow:i,lastRow:o})}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0,et(this.beans,()=>{this.beans.eventSvc.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){let s=this.pinnedRowModel?.ensureRowHeightsValid(),i=this.stickyRowFeature?.ensureRowHeightsValid(),{pageBounds:o,rowModel:r}=this,n=r.ensureRowHeightsValid(e,t,o.getFirstRow(),o.getLastRow());if(n||i)this.eventSvc.dispatchEvent({type:"recalculateRowBounds"});if(i||n||s)return this.updateContainerHeights(),!0;return!1}doNotUnVirtualiseRow(e){let i=e.rowNode,o=this.focusSvc.isRowFocused(i.rowIndex,i.rowPinned),r=this.editSvc?.isEditing(e),n=i.detail;if(!(o||r||n))return!1;return this.isRowPresent(i)?!0:!1}isRowPresent(e){if(!this.rowModel.isRowPresent(e))return!1;return this.beans.pagination?.isRowInPage(e.rowIndex)??!0}createRowCon(e,t,s){let i=this.cachedRowCtrls?.getRow(e)??null;if(i)return i;let o=s&&!this.printLayout&&!!this.beans.animationFrameSvc?.active;return new xl(e,this.beans,t,o,this.printLayout)}getRenderedNodes(){let e=Object.values(this.rowCtrlsByRowIndex).map((i)=>i.rowNode),t=this.getStickyTopRowCtrls().map((i)=>i.rowNode),s=this.getStickyBottomRowCtrls().map((i)=>i.rowNode);return[...t,...e,...s]}getRowByPosition(e){let t,{rowIndex:s}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[s];break;case"bottom":t=this.bottomRowCtrls[s];break;default:if(t=this.rowCtrlsByRowIndex[s],!t){if(t=this.getStickyTopRowCtrls().find((i)=>i.rowNode.rowIndex===s)||null,!t)t=this.getStickyBottomRowCtrls().find((i)=>i.rowNode.rowIndex===s)||null}break}return t}isRangeInRenderedViewport(e,t){if(e==null||t==null)return!1;let i=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!i}};var bF=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.rowNode.id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){let t=this.entriesList[0];t.destroyFirstPass(),t.destroySecondPass(),this.removeFromCache(t)}}getRow(e){if(e?.id==null)return null;let t=this.entriesMap[e.id];if(!t)return null;return this.removeFromCache(t),t.setCached(!1),t.rowNode!=e?null:t}has(e){return this.entriesMap[e.id]!=null}removeRow(e){let t=e.id,s=this.entriesMap[t];delete this.entriesMap[t],ae(this.entriesList,s)}removeFromCache(e){let t=e.rowNode.id;delete this.entriesMap[t],ae(this.entriesList,e)}getEntries(){return this.entriesList}};function Uu(e){if(!e)return;let t={top:{},bottom:{},normal:{}};for(let s of e){let i=s.id;switch(s.rowPinned){case"top":t.top[i]=s;break;case"bottom":t.bottom[i]=s;break;default:t.normal[i]=s;break}}return t}function Ku(e,t){let s=e.id;switch(e.rowPinned){case"top":return t.top[s]!=null;case"bottom":return t.bottom[s]!=null;default:return t.normal[s]!=null}}var SF=class extends y{constructor(){super(...arguments);this.beanName="rowNodeSorter",this.accentedSort=!1,this.primaryColumnsSortGroups=!1,this.pivotActive=!1}postConstruct(){this.firstLeaf=J(this.gos)?fi:yF,this.addManagedPropertyListeners(["accentedSort","autoGroupColumnDef","treeData"],this.updateOptions.bind(this));let e=this.updatePivotModeState.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,columnPivotChanged:e}),this.updateOptions(),e()}updateOptions(){this.accentedSort=!!this.gos.get("accentedSort"),this.primaryColumnsSortGroups=zt(this.gos)}updatePivotModeState(){this.pivotActive=this.beans.colModel.isPivotActive()}doFullSortInPlace(e,t){return e.sort((s,i)=>this.compareRowNodes(t,s,i))}compareRowNodes(e,t,s){if(t===s)return 0;let i=this.accentedSort;for(let o=0,r=e.length;o<r;++o){let n=e[o],a=n.sort==="desc",l=n.column,c=this.getValue(t,l),d=this.getValue(s,l),u,h=this.getComparator(n,t);if(h)u=h(c,d,t,s,a);else{if(n.type==="absolute")c=$u(c),d=$u(d);u=Yi(c,d,i)}if(u)return n.sort==="asc"?u:-u}return 0}getComparator(e,t){let s=e.column.colDef,i=this.getComparatorFromColDef(s,e);if(i)return i;if(!s.showRowGroup)return;let o=!t.group&&s.field;if(!o)return;let r=this.beans.colModel.getColDefCol(o);if(!r)return;return this.getComparatorFromColDef(r.colDef,e)}getComparatorFromColDef(e,t){let s=e.comparator;if(s==null)return;if(typeof s==="object")return s[At(t.type)];return s}getValue(e,t){let s=this.beans;if(this.primaryColumnsSortGroups){if(e.rowGroupColumn===t)return this.getGroupDataValue(e,t);if(e.group&&t.colDef.showRowGroup)return}let i=s.valueSvc.getValue(t,e,"data");if(t.colDef.allowFormula){let o=s.formula;if(o?.isFormula(i))return o.resolveValue(t,e)}return i}getGroupDataValue(e,t){if(Mn(this.gos,this.pivotActive)){let i=this.firstLeaf(e);return i&&this.beans.valueSvc.getValue(t,i,"data")}let s=this.beans.showRowGroupCols?.getShowRowGroupCol(t.getId());return s?e.groupData?.[s.getId()]:void 0}},yF=(e)=>{if(e.data)return e;let t=e.childrenAfterGroup;while(t?.length){let s=t[0];if(s.data)return s;t=s.childrenAfterGroup}},$u=(e)=>{if(!e)return e;if(typeof e==="bigint")return e<0n?-e:e;let t=Number(e);return isNaN(t)?e:Math.abs(t)};function xF(e){e.sortSvc?.onSortChanged("api")}var Zs=(e,t)=>({tag:"span",ref:`eSort${e}`,cls:`ag-sort-indicator-icon ag-sort-${t} ag-hidden`,attrs:{"aria-hidden":"true"}}),RF={tag:"span",cls:"ag-sort-indicator-container",children:[Zs("Order","order"),Zs("Asc","ascending-icon"),Zs("Desc","descending-icon"),Zs("Mixed","mixed-icon"),Zs("AbsoluteAsc","absolute-ascending-icon"),Zs("AbsoluteDesc","absolute-descending-icon"),Zs("None","none-icon")]},Vc=class extends L{constructor(e){super();if(this.eSortOrder=E,this.eSortAsc=E,this.eSortDesc=E,this.eSortMixed=E,this.eSortNone=E,this.eSortAbsoluteAsc=E,this.eSortAbsoluteDesc=E,!e)this.setTemplate(RF)}attachCustomElements(e,t,s,i,o,r,n){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=s,this.eSortMixed=i,this.eSortNone=o,this.eSortAbsoluteAsc=r,this.eSortAbsoluteDesc=n}setupSort(e,t=!1,s){if(this.column=e,this.suppressOrder=t,this.getSortDefOverride=s,this.setupMultiSortIndicator(),!e.isSortable()&&!e.colDef.showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addInIcon("sortAbsoluteAscending",this.eSortAbsoluteAsc,e),this.addInIcon("sortAbsoluteDescending",this.eSortAbsoluteDesc,e);let i=this.updateIcons.bind(this),o=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",i),this.addManagedEventListeners({newColumnsLoaded:i,sortChanged:o,columnRowGroupChanged:o}),this.onSortChanged()}addInIcon(e,t,s){if(t==null)return;let i=N(e,this.beans,s);if(i)t.appendChild(i)}onSortChanged(){if(this.updateIcons(),!this.suppressOrder)this.updateSortOrder()}updateIcons(){let{eSortAsc:e,eSortDesc:t,eSortAbsoluteAsc:s,eSortAbsoluteDesc:i,eSortNone:o,column:r,gos:n,beans:a}=this,l=tc(r,a,this.getSortDefOverride),{isDefaultSortAllowed:c,isAbsoluteSortAllowed:d}=l,{isAbsoluteSort:u,isDefaultSort:h,isAscending:g,isDescending:p,direction:f}=l;if(e)G(e,g&&h&&c,{skipAriaHidden:!0});if(t)G(t,p&&h&&c,{skipAriaHidden:!0});if(o){let m=!r.colDef.unSortIcon&&!n.get("unSortIcon");G(o,!m&&!f,{skipAriaHidden:!0})}if(s)G(s,g&&u&&d,{skipAriaHidden:!0});if(i)G(i,p&&u&&d,{skipAriaHidden:!0})}setupMultiSortIndicator(){let{eSortMixed:e,column:t,gos:s}=this;this.addInIcon("sortUnSort",e,t);let i=t.colDef.showRowGroup;if(zt(s)&&i)this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator()}updateMultiSortIndicator(){let{eSortMixed:e,beans:t,column:s}=this;if(e){let i=t.sortSvc.getDisplaySortForColumn(s)?.direction==="mixed";G(e,i,{skipAriaHidden:!0})}}updateSortOrder(){let{eSortOrder:e,column:t,beans:{sortSvc:s}}=this;if(!e)return;let i=s.getColumnsWithSortingOrdered(),o=s.getDisplaySortIndexForColumn(t)??-1,r=i.some((a)=>s.getDisplaySortIndexForColumn(a)??!1),n=o>=0&&r;if(G(e,n,{skipAriaHidden:!0}),o>=0)e.textContent=(o+1).toString();else te(e)}refresh(){this.onSortChanged()}},FF={selector:"AG-SORT-INDICATOR",component:Vc},EF=class extends y{constructor(){super(...arguments);this.beanName="sortSvc"}progressSort(e,t,s){let i=this.getNextSortDirection(e);this.setSortForColumn(e,i,t,s)}progressSortFromEvent(e,t){let i=this.gos.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey;this.progressSort(e,i,"uiColumnSorted")}setSortForColumn(e,t,s,i){let{gos:o,showRowGroupCols:r}=this.beans,n=zt(o),a=[e];if(n){if(e.colDef.showRowGroup){let u=r?.getSourceColumnsForGroupColumn?.(e)?.filter((h)=>h.isSortable());if(u)a=[e,...u]}}for(let d of a)this.setColSort(d,t,i);let l=(s||o.get("alwaysMultiSort"))&&!o.get("suppressMultiSort"),c=[];if(!l){let d=this.clearSortBarTheseColumns(a,i);c.push(...d)}this.updateSortIndex(e),c.push(...a),this.dispatchSortChangedEvents(i,c)}updateSortIndex(e){let{gos:t,colModel:s,showRowGroupCols:i}=this.beans,o=zt(t),r=i?.getShowRowGroupCol(e.getId()),n=o?r||e:e,a=this.getColumnsWithSortingOrdered();s.forAllCols((d)=>this.setColSortIndex(d,null));let l=a.filter((d)=>{if(o&&d.colDef.showRowGroup)return!1;return d!==n});(n.getSortDef()?[...l,n]:l).forEach((d,u)=>this.setColSortIndex(d,u))}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){let e=!1;return this.beans.colModel.forAllCols((t)=>{if(t.getSortDef())return e=!0,!0}),e}dispatchSortChangedEvents(e,t){let s={type:"sortChanged",source:e};if(t)s.columns=t;this.eventSvc.dispatchEvent(s)}clearSortBarTheseColumns(e,t){let s=[];return this.beans.colModel.forAllCols((i)=>{if(!e.includes(i)){if(i.getSortDef())s.push(i);let o=nt();this.setColSort(i,o,t)}}),s}getNextSortDirection(e,t){let s=e.getSortingOrder(),i=t===void 0?e.getSortDef():nt(t),r=s.findIndex((n)=>zr(n,i))+1;if(r>=s.length)r=0;return nt(s[r])}getIndexedSortMap(){let{gos:e,colModel:t,showRowGroupCols:s,rowGroupColsSvc:i}=this.beans,o=[];if(t.forAllCols((c)=>{if(c.getSortDef())o.push(c)}),t.pivotMode){let c=zt(e);o=o.filter((d)=>{let u=!!d.aggFunc,h=!d.primary,g=c?s?.getShowRowGroupCol(d.getId()):d.colDef.showRowGroup;return u||h||g})}let r=i?.columns.filter((c)=>!!c.getSortDef())??[],n={};o.forEach((c,d)=>n[c.getId()]=d),o.sort((c,d)=>{let u=c.getSortIndex(),h=d.getSortIndex();if(u!=null&&h!=null)return u-h;else if(u==null&&h==null){let g=n[c.getId()],p=n[d.getId()];return g>p?1:-1}else if(h==null)return-1;else return 1});let a=zt(e)&&!!r.length;if(a)o=[...new Set(o.map((c)=>s?.getShowRowGroupCol(c.getId())??c))];let l=new Map;if(o.forEach((c,d)=>l.set(c,d)),a)for(let c of r){let d=s.getShowRowGroupCol(c.getId());l.set(c,l.get(d))}return l}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([,e],[,t])=>e-t).map(([e])=>e)}collectSortItems(e=!1){let t=[],s=this.getColumnsWithSortingOrdered();for(let i of s){let o=i.getSortDef()?.direction;if(!o)continue;let r=At(i.getSortDef()?.type),n={sort:o,type:r};if(e)n.colId=i.getId();else n.column=i;t.push(n)}return t}getSortModel(){return this.collectSortItems(!0)}getSortOptions(){return this.collectSortItems()}canColumnDisplayMixedSort(e){let t=zt(this.gos),s=!!e.colDef.showRowGroup;return t&&s}getDisplaySortForColumn(e){let t=this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSortDef();let i=e.colDef.field!=null||!!e.colDef.valueGetter?[e,...t]:t,o=i[0].getSortDef();if(!i.every((n)=>zr(n.getSortDef(),o)))return{type:At(e.getSortDef()?.type),direction:"mixed"};return o}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}setupHeader(e,t){let s=()=>{let{type:i,direction:o}=nt(t.getSortDef());if(e.toggleCss("ag-header-cell-sorted-asc",o==="asc"),e.toggleCss("ag-header-cell-sorted-desc",o==="desc"),e.toggleCss("ag-header-cell-sorted-abs-asc",i==="absolute"&&o==="asc"),e.toggleCss("ag-header-cell-sorted-abs-desc",i==="absolute"&&o==="desc"),e.toggleCss("ag-header-cell-sorted-none",!o),t.colDef.showRowGroup){let a=!this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(t)?.every((l)=>o==l.getSortDef()?.direction);e.toggleCss("ag-header-cell-sorted-mixed",a)}};e.addManagedEventListeners({sortChanged:s,columnPinned:s,columnRowGroupChanged:s,displayedColumnsChanged:s})}initCol(e){let{sortIndex:t,initialSortIndex:s}=e.colDef,i=Cg(e.colDef);if(i)e.setSortDef(i);if(t!==void 0){if(t!==null)e.sortIndex=t}else if(s!==null)e.sortIndex=s}updateColSort(e,t,s){if(t===void 0)return;this.setColSort(e,nt(t),s)}setColSort(e,t,s){if(!zr(e.getSortDef(),t))e.setSortDef(t),e.dispatchColEvent("sortChanged",s);e.dispatchStateUpdatedEvent("sort")}setColSortIndex(e,t){e.sortIndex=t,e.dispatchStateUpdatedEvent("sortIndex")}createSortIndicator(e){return new Vc(e)}getSortIndicatorSelector(){return FF}},Up={moduleName:"Sort",version:z,beans:[EF,SF],apiFunctions:{onSortChanged:xF},userComponents:{agSortIndicator:Vc},icons:{sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc"}},PF=class extends y{constructor(){super(...arguments);this.beanName="syncSvc",this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",(e)=>this.setColumnDefs(e))}start(){this.beans.ctrlsSvc.whenReady(this,()=>{let e=this.gos.get("columnDefs");if(e)this.setColumnsAndData(e);else this.waitingForColumns=!0;this.gridReady()})}setColumnsAndData(e){let{colModel:t,rowModel:s}=this.beans;t.setColumnDefs(e??[],"gridInitializing"),s.start()}gridReady(){let{eventSvc:e,gos:t}=this;e.dispatchEvent({type:"gridReady"}),Ao(t,`initialised successfully, enterprise = ${t.isModuleRegistered("EnterpriseCore")}`)}setColumnDefs(e){let t=this.gos.get("columnDefs");if(!t)return;if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(t);return}this.beans.colModel.setColumnDefs(t,Ms(e.source))}};var MF="paste",TF=class extends y{constructor(){super(...arguments);this.beanName="changeDetectionSvc",this.deferredDepth=0,this.batchedPath=null,this.batchedNodes=null}destroy(){super.destroy(),this.batchedPath=null,this.batchedNodes=null}postConstruct(){this.csrm=gc(this.beans),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}beginDeferred(){this.deferredDepth++}endDeferred(){if(this.deferredDepth===0)return;if(--this.deferredDepth>0)return;let e=this.batchedPath,t=this.batchedNodes;if(this.batchedPath=null,this.batchedNodes=null,e)this.csrm?.doAggregate(e);let{rowRenderer:s}=this.beans;if(t)for(let i of t)ju(s,i);if(e){let i=e.getSortedRows();for(let o=0,r=i.length;o<r;++o)ju(s,i[o])}if(this.batchedPath||this.batchedNodes)this.deferredDepth=1,this.endDeferred()}onCellValueChanged(e){let{gos:t,rowModel:s,changedPathFactory:i}=this.beans;if(e.source===MF||t.get("suppressChangeDetection"))return;if(!s.rootNode)return;let o=e.node.primaryRow;if(this.csrm){let r=this.batchedPath;if(!r)r=i?.newPath(t.get("aggregateOnlyChangedColumns"))??null,this.batchedPath=r;let n=o;if(!o.group)(this.batchedNodes??(this.batchedNodes=new Set)).add(o),n=o.parent;r?.addCell(n,e.column.getColId())}else(this.batchedNodes??(this.batchedNodes=new Set)).add(o);if(this.deferredDepth===0)this.deferredDepth=1,this.endDeferred()}},ju=(e,t)=>{let{sibling:s,pinnedSibling:i}=t;e.refreshRowByNode(t),e.refreshRowByNode(s),e.refreshRowByNode(i),e.refreshRowByNode(s?.pinnedSibling),e.refreshRowByNode(i?.sibling)},DF=class extends y{constructor(){super(...arguments);this.beanName="expressionSvc",this.cache={}}evaluate(e,t){if(typeof e==="string")return this.evaluateExpression(e,t);else X(15,{expression:e})}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(s){return X(16,{expression:e,params:t,e:s}),null}}createExpressionFunction(e){let t=this.cache;if(t[e])return t[e];let s=this.createFunctionBody(e),i=Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",s);return t[e]=i,i}createFunctionBody(e){if(e.includes("return"))return e;else return"return "+e+";"}};var AF={moduleName:"Expression",version:z,beans:[DF]},IF={moduleName:"ChangeDetection",version:z,beans:[TF]};var kF=class extends y{constructor(){super(...arguments);this.beanName="valueSvc",this.executeValueGetter=this.executeValueGetterWithoutValueCache,this.isTreeData=!1,this.isSsrm=!1,this.cellExpressions=!1,this.groupSuppressBlankHeader=!1,this.editSvc=void 0,this.valueCache=void 0,this.rowGroupColsSvc=void 0,this.expressionSvc=void 0,this.dataTypeSvc=void 0,this.formulaDataSvc=void 0}wireBeans(e){this.expressionSvc=e.expressionSvc,this.colModel=e.colModel,this.valueCache=e.valueCache,this.dataTypeSvc=e.dataTypeSvc,this.editSvc=e.editSvc,this.formulaDataSvc=e.formulaDataSvc,this.rowGroupColsSvc=e.rowGroupColsSvc,this.init()}init(){let e=this.gos;this.isSsrm=Gs(e),this.cellExpressions=e.get("enableCellExpressions"),this.isTreeData=e.get("treeData"),this.groupSuppressBlankHeader=e.get("groupSuppressBlankHeader"),this.executeValueGetter=this.valueCache&&e.get("valueCache")?this.executeValueGetterWithValueCache:this.executeValueGetterWithoutValueCache}postConstruct(){this.init();let e=(t)=>this.callColumnCellValueChangedHandler(t);this.eventSvc.addListener("cellValueChanged",e,!0),this.addDestroyFunc(()=>this.eventSvc.removeListener("cellValueChanged",e,!0)),this.addManagedPropertyListener("treeData",(t)=>this.isTreeData=t.currentValue),this.addManagedPropertyListener("groupSuppressBlankHeader",(t)=>this.groupSuppressBlankHeader=t.currentValue)}getValueForDisplay(e){let t=this.beans,{column:s,node:i}=e,o=t.showRowGroupColValueSvc,r=!s&&i.group,n=!this.isTreeData||i.footer;if(o&&n&&(r||s?.colDef.showRowGroup)){let h=o.getGroupValue(i,s,this.displayIgnoresAggData(i));if(h==null)return{value:null,valueFormatted:null};return{value:h.value,valueFormatted:e.includeValueFormatted?o.formatAndPrefixGroupColValue(h,s,e.exporting):null}}if(!s)return{value:i.key,valueFormatted:null};let a=this.getValue(s,i,e.from,this.displayIgnoresAggData(i)),l=a,c=t.formula,d=s.colDef;if(d.allowFormula&&c?.isFormula(a))if(e.useRawFormula)a=c.normaliseFormula(a,!0),l=c.resolveValue(s,i);else a=c.resolveValue(s,i),l=a;let u=e.includeValueFormatted&&!(e.exporting&&d.useValueFormatterForExport===!1);return{value:a,valueFormatted:u?this.formatValue(s,i,l):null}}getValue(e,t,s,i=!1){if(!t)return;let o=e.colDef,r=t.group;if(!r&&!t.rowPinned){let l=o.pivotValueColumn;if(l)e=l}let n=this.editSvc;if(n&&s!=="data"){let l=n.getPendingEditValue(t,e,s);if(l!==void 0)return l}let a=this.resolveValue(e,t,i,r);if(a===void 0){if(r){let l=o.showRowGroup;if(typeof l==="string"){let c=this.rowGroupColsSvc?.getColumnIndex(l);if(c!=null&&c>t.level)return null}}return}if(this.cellExpressions&&Gl(a)){let l=a.substring(1);a=this.executeValueGetter(l,t.data,e,t)}return a}displayIgnoresAggData(e){if(!e.group||e.footer||e.level===-1)return!1;if(!e.sibling||this.groupSuppressBlankHeader)return!1;if(e.leafGroup&&this.colModel.pivotMode)return!1;return!!e.expanded}resolveValue(e,t,s,i){let{colDef:o,colId:r}=e;if(!i&&o.allowFormula){let C=this.beans.formula?.getDataSourceFormula(t,e);if(C!==void 0)return C}let n=i&&!s?t.aggData:void 0,a=this.isTreeData;if(a&&n?.[r]!==void 0)return n[r];let l=t.data,{field:c,valueGetter:d}=o;if(a){if(d)return this.executeValueGetter(d,l,e,t);if(c&&l)return e.fieldContainsDots?Fo(l,c):l[c]}let u=t.groupData;if(u&&r in u)return u[r];if(n?.[r]!==void 0)return n[r];let h=o.showRowGroup,g=typeof h!=="string"||!i,p=this.isSsrm,f=p&&s&&!!o.aggFunc;if(d&&!f)return g?this.executeValueGetter(d,l,e,t):void 0;if(p&&t.footer&&t.field&&(h===!0||h===t.field)){if(!l)return;let C=t.field;return e.fieldContainsDots?Fo(l,C):l[C]}if(c&&l&&!f){if(!g)return;return e.fieldContainsDots?Fo(l,c):l[c]}return}parseValue(e,t,s,i){let o=e.colDef;if(o.allowFormula&&this.beans.formula?.isFormula(s))return s;let r=o.valueParser;if(M(r)){let n=I(this.gos,{node:t,data:t?.data,oldValue:i,newValue:s,colDef:o,column:e});if(typeof r==="function")return r(n);return this.expressionSvc?.evaluate(r,n)}return s}getDeleteValue(e,t){if(M(e.colDef.valueParser))return this.parseValue(e,t,"",this.getValueForDisplay({column:e,node:t,from:"edit"}).value)??null;return null}formatValue(e,t,s,i,o=!0){let{expressionSvc:r}=this.beans,n=null,a,l=e.colDef;if(i)a=i;else if(o)a=l.valueFormatter;if(a){let c=t?t.data:null,d=I(this.gos,{value:s,node:t,data:c,colDef:l,column:e});if(typeof a==="function")n=a(d);else n=r?r.evaluate(a,d):null}else if(l.refData)return l.refData[s]||"";if(n==null&&Array.isArray(s))n=s.join(", ");return n}setValue(e,t,s,i){let o=t.colDef;if(!e.data&&this.canCreateRowNodeData(e,o))e.data={};if(!this.isSetValueSupported(t,e,s,o))return!1;let r=this.getValue(t,e,"data"),n=I(this.gos,{node:e,data:e.data,oldValue:r,newValue:s,colDef:o,column:t}),a=!1;if(e.data){let c=this.handleExternalFormulaChange({column:t,eventSource:i,newValue:s,setterParams:n,rowNode:e});if(c!==null)return c;a=this.computeValueChange({column:t,rowNode:e,newValue:s,params:n,rowData:e.data,valueSetter:o.valueSetter,field:o.field})??!0}let l=this.beans.changeDetectionSvc;l?.beginDeferred();try{if(e.group){let c=this.beans.rowGroupingEditValueSvc?.setGroupDataValue(e,t,s,r,i,a||s!==r);if(c!==void 0){if(!a&&!c)return!1;return this.finishValueChange(e,t,n,i,s)}}if(!a)return!1;return this.finishValueChange(e,t,n,i)}finally{l?.endDeferred()}}canCreateRowNodeData(e,t){if(!e.group)return!0;if(t.groupRowValueSetter!=null||t.groupRowEditable!=null)return!1;if(t.pivotValueColumn)return!1;return!0}finishValueChange(e,t,s,i,o){e.resetQuickFilterAggregateText(),this.valueCache?.onDataChanged();let r=o===void 0?this.getValue(t,e,"data"):o;if(this.dispatchCellValueChangedEvent(e,s,r,i),e.pinnedSibling)this.dispatchCellValueChangedEvent(e.pinnedSibling,s,r,i);return!0}isSetValueSupported(e,t,s,i){let{field:o,valueSetter:r}=i,n=this.beans.formula,a=e.colDef.allowFormula&&n?.isFormula(s),l=!!this.formulaDataSvc?.hasDataSource();if(q(o)&&q(r)&&!(l&&a)){if(t.group&&(i.groupRowValueSetter||i.groupRowEditable))return!0;return F(17),!1}if(this.dataTypeSvc&&!this.dataTypeSvc.checkType(e,s))return F(135),!1;return!0}handleExternalFormulaChange(e){let{column:t,rowNode:s,newValue:i,eventSource:o,setterParams:r}=e,n=this.beans.formula,a=this.formulaDataSvc;if(!t.colDef.allowFormula||!a?.hasDataSource())return null;let l=n?.isFormula(i),c=a.getFormula({column:t,rowNode:s});if(l){if(c===i)return!1;a.setFormula({column:t,rowNode:s,formula:i});let u=n?.resolveValue(t,s),h=t.colDef;if(M(h.valueSetter)||!q(h.field)){let g={...r,newValue:u};this.computeValueChange({column:t,rowNode:s,newValue:u,params:g,rowData:s.data,valueSetter:h.valueSetter,field:h.field})}return this.finishValueChange(s,t,r,o)}if(c!==void 0)a.setFormula({column:t,rowNode:s,formula:void 0});return null}computeValueChange(e){let{valueSetter:t,params:s,rowData:i,field:o,column:r,newValue:n}=e;if(M(t)){if(typeof t==="function")return t(s);return this.expressionSvc?.evaluate(t,s)}return!!i&&this.setValueUsingField(i,o,n,r.fieldContainsDots)}dispatchCellValueChangedEvent(e,t,s,i){this.eventSvc.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:t.column,colDef:t.colDef,data:e.data,node:e,oldValue:t.oldValue,newValue:s,newRawValue:t.newValue,value:s,source:i})}callColumnCellValueChangedHandler(e){let t=e.colDef.onCellValueChanged;if(typeof t==="function")this.beans.frameworkOverrides.wrapOutgoing(()=>{t(e)})}setValueUsingField(e,t,s,i){if(!t)return!1;let o=!1;if(!i){if(o=e[t]===s,!o)e[t]=s}else{let r=t.split("."),n=e;while(r.length>0&&n){let a=r.shift();if(r.length===0){if(o=n[a]===s,!o)n[a]=s}else n=n[a]}}return!o}executeValueGetterWithValueCache(e,t,s,i){let o=s.colId,r=this.valueCache.getValue(i,o);if(r!==void 0)return r;let n=this.executeValueGetterWithoutValueCache(e,t,s,i);return this.valueCache.setValue(i,o,n),n}executeValueGetterWithoutValueCache(e,t,s,i){let o=I(this.gos,{data:t,node:i,column:s,colDef:s.colDef,getValue:(n)=>this.getValueCallback(i,n)}),r;if(typeof e==="function")r=e(o);else r=this.expressionSvc?.evaluate(e,o);return r}getValueCallback(e,t){let s=this.colModel.getColDefColOrCol(t);return s?this.getValue(s,e,"data"):null}getKeyForNode(e,t){let s=this.getValue(e,t,"data"),i=e.colDef.keyCreator,o=s;if(i){let r=I(this.gos,{value:s,colDef:e.colDef,column:e,node:t,data:t.data});o=i(r)}if(typeof o==="string"||o==null)return o;if(o=String(o),o==="[object Object]")F(121);return o}},LF={moduleName:"CommunityCore",version:z,beans:[bx,iy,$0,Ww,CF,l0,px,zx,g0,HR,_R,wF,kF,vx,hx,wx,q0,PF,N0,_0,eR],icons:{selectOpen:"small-down",smallDown:"small-down",colorPicker:"color-picker",smallUp:"small-up",checkboxChecked:"small-up",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off",smallLeft:"small-left",smallRight:"small-right"},apiFunctions:{getGridId:oy,destroy:ry,isDestroyed:ny,getGridOption:ay,setGridOption:ly,updateGridOptions:op,isModuleRegistered:cy},dependsOn:[B0,or,jy,Up,Xx,Dc,Zx,mF,IF,Jx,mi,KR,qR,iR,W0,V0,AF,x0,ZR]};function Rl(e){let{inputValue:t,allSuggestions:s,hideIrrelevant:i,maxSuggestions:o}=e,r=(s??[]).map((l,c)=>({value:l,relevance:GF(t,l),idx:c}));if(r.sort((l,c)=>l.relevance-c.relevance),i)r=r.filter((l)=>l.relevance<Math.max(l.value.length,t.length));if(o!=null&&o>0)r=r.slice(0,o);let n=[],a=[];for(let l of r)n.push(l.value),a.push(l.idx);return{values:n,indices:a}}function GF(e,t){let s=e.length,i=t.length;if(i===0)return s?s:0;let o=e.toLocaleLowerCase(),r=t.toLocaleLowerCase(),n;if(s>0){let u=r.indexOf(o);if(u>=0)return u*0.01}if(e.length<t.length)n=r,r=o,o=n,n=t,t=e,e=n;let a=new Uint16Array(i+1),l=new Uint16Array(i+1);for(let u=0;u<=i;u++)a[u]=u;let c=0,d=s/2-10;for(let u=1;u<=s;u++){let h=e[u-1],g=o[u-1];l[0]=u;for(let p=1;p<=i;p++){let f=t[p-1],m=r[p-1];if(g!==m){let C=l[p-1],v=a[p],w=a[p-1],S=C<v?C:v;if(w<S)S=w;l[p]=S+1|0;continue}if(c++,h===f)c++;if(u>1&&p>1){let C=e[u-2],v=o[u-2],w=t[p-2],S=r[p-2];if(v===S){if(c++,C===w)c++}}if(u<d)c++;l[p]=a[p-1]}n=a,a=l,l=n}return a[i]/(c+1)}var Kp={AdvancedFilter:1,AiToolkit:1,AllEnterprise:1,BatchEdit:1,CellSelection:1,Clipboard:1,ColumnMenu:1,ColumnsToolPanel:1,ContextMenu:1,ExcelExport:1,FiltersToolPanel:1,Find:1,GridCharts:1,IntegratedCharts:1,GroupFilter:1,MasterDetail:1,Menu:1,MultiFilter:1,NewFiltersToolPanel:1,Pivot:1,RangeSelection:1,RichSelect:1,RowNumbers:1,RowGrouping:1,RowGroupingEdit:1,RowGroupingPanel:1,ServerSideRowModelApi:1,ServerSideRowModel:1,SetFilter:1,SideBar:1,Sparklines:1,StatusBar:1,Toolbar:1,TreeData:1,ViewportRowModel:1,Formula:1,Notes:1},Ja=["TextFilter","NumberFilter","BigIntFilter","DateFilter","SetFilter","MultiFilter","GroupFilter","CustomFilter"],OF={EditCore:["TextEditor","NumberEditor","DateEditor","CheckboxEditor","LargeTextEditor","SelectEditor","RichSelect","CustomEditor"],CheckboxCellRenderer:["AllCommunity"],CsrmHierarchy:["RowGrouping","Pivot","TreeData"],CsrmGroupStages:["RowGrouping","Pivot","TreeData"],ColumnFilter:Ja,ColumnGroupHeaderComp:["AllCommunity"],ColumnGroup:["AllCommunity"],ColumnHeaderComp:["AllCommunity"],ColumnMove:["AllCommunity"],ColumnResize:["AllCommunity"],CommunityCore:["AllCommunity"],CsrmSsrmSharedApi:["ClientSideRowModelApi","ServerSideRowModelApi"],RowModelSharedApi:["ClientSideRowModelApi","ServerSideRowModelApi"],EnterpriseCore:["AllEnterprise"],FilterCore:[...Ja,"QuickFilter","ExternalFilter","AdvancedFilter"],GroupCellRenderer:["RowGrouping","Pivot","TreeData","MasterDetail","ServerSideRowModel"],KeyboardNavigation:["AllCommunity"],LoadingCellRenderer:["ServerSideRowModel"],MenuCore:["ColumnMenu","ContextMenu"],MenuItem:["ColumnMenu","ContextMenu","MultiFilter","IntegratedCharts","ColumnsToolPanel"],Overlay:["AllCommunity"],PinnedColumn:["AllCommunity"],SharedAggregation:["RowGrouping","Pivot","TreeData","ServerSideRowModel"],SharedDragAndDrop:["AllCommunity"],SharedMasterDetail:["MasterDetail","ServerSideRowModel"],SharedMenu:[...Ja,"ColumnMenu","ContextMenu"],SharedPivot:["Pivot","ServerSideRowModel"],SharedRowGrouping:["RowGrouping","ServerSideRowModel"],SharedRowSelection:["RowSelection","ServerSideRowModel"],SkeletonCellRenderer:["ServerSideRowModel"],Sort:["AllCommunity"],SsrmInfiniteSharedApi:["InfiniteRowModel","ServerSideRowModelApi"],SharedTreeData:["TreeData","ServerSideRowModel"]},BF={InfiniteRowModel:"infinite",ClientSideRowModelApi:"clientSide",ClientSideRowModel:"clientSide",ServerSideRowModelApi:"serverSide",ServerSideRowModel:"serverSide",ViewportRowModel:"viewport"};function VF(e,t){let s=[];for(let i of Array.isArray(e)?e:[e]){let o=OF[i];if(o)for(let r of o){let n=BF[r];if(!n||n===t)s.push(r)}else s.push(i)}return s}var $p=(e,t,s)=>{if(s)return`${["import { AgGridProvider, AgGridReact } from 'ag-grid-react';",...e].join(`
21
- `)}
22
-
23
- const modules = [ ${t} ];
24
-
25
- function App() {
26
- return (
27
- <AgGridProvider modules={modules}>
28
- <AgGridReact /* ... props */ />
29
- </AgGridProvider>
30
- );
31
- }`;return`${e.join(`
32
- `)}
33
-
34
- ModuleRegistry.registerModules([ ${t} ]);`},jp=(e)=>{let t=e!==void 0;return`No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule:
35
-
36
- ${$p([`import { ${t?"":"ModuleRegistry, "}AllCommunityModule } from 'ag-grid-community';`],"AllCommunityModule",t)}
37
- `},NF=(e,t)=>{let s=e.map((r)=>`import { ${Po(r)} } from '${Kp[r]?"ag-grid-enterprise":"ag-grid-community"}';`);if(e.some((r)=>r==="IntegratedCharts"||r==="Sparklines"))s.push("import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';");let o=e.map((r)=>Po(r,!0)).join(", ");if(!t)s.unshift("import { ModuleRegistry } from 'ag-grid-community';");return`${$p(s,o,t)}
38
-
39
- For more info see: ${Oi}/modules/`};function Po(e,t=!1){if(t&&(e==="IntegratedCharts"||e==="Sparklines"))return`${e}Module.with(AgChartsEnterpriseModule)`;return`${e}Module`}function _F(e,t){let s=t.filter((r)=>r==="IntegratedCharts"||r==="Sparklines"),i="";if(!globalThis?.agCharts&&s.length>0)i=`Unable to use ${e} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise.
40
- `;else if(t.some((r)=>Kp[r]))i=i+`Unable to use ${e} as that requires the ag-grid-enterprise script to be included.
41
- `;return i}function qp({moduleName:e,rowModelType:t}){return`To use the ${e}Module you must set the gridOption "rowModelType='${t}'"`}var el=({reasonOrId:e,moduleName:t,gridScoped:s,gridId:i,rowModelType:o,additionalText:r,isUmd:n,usesAgGridProvider:a})=>{let l=VF(t,o),c=typeof e==="string"?e:UF[e];if(n)return _F(c,l);let d=l.filter((g)=>g==="IntegratedCharts"||g==="Sparklines"),u=d.length>0?`${d.map((g)=>Po(g)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.`:"";return`${`Unable to use ${c} as ${l.length>1?"one of "+l.map((g)=>Po(g)).join(", "):Po(l[0])} is not registered${s?" for gridId: "+i:""}. ${u} Check if you have registered the module:
42
- `}
43
- ${NF(l,a)}`+(r?`
44
-
45
- ${r}`:"")},qu=(e)=>`${e} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.
46
-
47
- import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';
48
- import { ModuleRegistry } from 'ag-grid-community';
49
- import { ${e} } from 'ag-grid-enterprise';
50
-
51
- ModuleRegistry.registerModules([${e}.with(AgChartsEnterpriseModule)]);
52
- `,HF=(e)=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${e}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`,zF={1:()=>"`rowData` must be an array",2:({nodeId:e})=>`Duplicate node id '${e}' detected from getRowId callback, this could cause issues in your grid.`,3:()=>"Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.",4:({id:e})=>`Could not find row id=${e}, data item was not found for this id`,5:({data:e})=>["Could not find data item as object was not found.",e," Consider using getRowId to help the Grid find matching row data"],6:()=>"'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'",7:()=>"Pivoting is not supported with aligned grids as it may produce different columns in each grid.",8:({key:e})=>`Unknown key for navigation ${e}`,9:({variable:e})=>`No value for ${e?.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e?.defaultValue} will be used and updated when styles load.`,10:({eventType:e})=>`As of v33, the '${e}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`,11:()=>"No gridOptions provided to createGrid",12:({colKey:e})=>["column ",e," not found"],13:()=>"Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.",14:({groupPrefix:e})=>`Row IDs cannot start with ${e}, this is a reserved prefix for AG Grid's row grouping feature.`,15:({expression:e})=>["value should be either a string or a function",e],16:({expression:e,params:t,e:s})=>["Processing of the expression failed","Expression = ",e,"Params = ",t,"Exception = ",s],17:()=>"you need either field or valueSetter set on colDef for editing to work",18:()=>"alignedGrids contains an undefined option.",19:()=>"alignedGrids - No api found on the linked grid.",20:()=>`You may want to configure via a callback to avoid setup race conditions:
53
- "alignedGrids: () => [linkedGrid]"`,21:()=>"pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.",22:({key:e})=>`${e} is an initial property and cannot be updated.`,23:()=>"The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.",24:()=>"row height must be a number if not using standard row model",25:({id:e})=>["The getRowId callback must return a string. The ID ",e," is being cast to a string."],26:({fnName:e,preDestroyLink:t})=>`Grid API function ${e}() cannot be called as the grid has been destroyed.
54
- Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.
55
- To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${t}`,27:({fnName:e,module:t})=>`API function '${e}' not registered to module '${t}'`,28:()=>"setRowCount cannot be used while using row grouping.",29:()=>"tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?",30:({toIndex:e})=>["tried to insert columns in invalid location, toIndex = ",e,"remember that you should not count the moving columns when calculating the new index"],31:()=>"infinite loop in resizeColumnSets",32:()=>"applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.",33:()=>"stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON.",34:({key:e})=>`the column type '${e}' is a default column type and cannot be overridden.`,35:()=>"Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type.",36:({t:e})=>"colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes",37:()=>"Changing the column pinning status is not allowed with domLayout='print'",38:({iconName:e})=>`provided icon '${e}' needs to be a string or a function`,39:()=>"Applying column order broke a group where columns should be married together. Applying new order has been discarded.",40:({e,method:t})=>`${e}
56
- ${HF(t)}`,41:()=>"Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.",42:()=>"Browser does not support document.execCommand('copy') for clipboard operations",43:({iconName:e})=>`As of v33, icon '${e}' is deprecated. Use the icon CSS name instead.`,44:()=>'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.',45:({parentCellDataType:e})=>`The data type definition ${e} does not exist.`,46:()=>'The "baseDataType" property of a data type definition must match that of its parent.',47:({cellDataType:e})=>`Missing data type definition - "${e}"`,48:({property:e,inferred:t,colId:s})=>{let i=t?" (inferred)":"",o=s?` for column "${s}"`:"";return`Cell data type is "object"${i} but no Value ${e} has been provided${o}. Please either provide an object data type definition with a Value ${e}, or set:
57
- - "colDef.value${e}"${t&&e==="Parser"?`
58
- - "colDef.cellDataType = 'object'"`:""}`},49:({methodName:e})=>`Framework component is missing the method ${e}()`,50:({compName:e})=>`Could not find component ${e}, did you forget to configure this component?`,51:()=>"Export cancelled. Export is not allowed as per your configuration.",52:()=>"There is no `window` associated with the current `document`",53:()=>"unknown value type during csv conversion",54:()=>"Could not find document body, it is needed for drag and drop and context menu.",55:()=>"addRowDropZone - A container target needs to be provided",56:()=>"addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.",57:()=>"unable to show popup filter, filter instantiation failed",58:()=>"no values found for select cellEditor",59:()=>"cannot select pinned rows",60:()=>"cannot select node until it has finished loading",61:()=>"since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.",62:({colId:e})=>`setFilterModel() - no column found for colId: ${e}`,63:({colId:e})=>`setFilterModel() - unable to fully apply model, filtering disabled for colId: ${e}`,64:({colId:e})=>`setFilterModel() - unable to fully apply model, unable to create filter for colId: ${e}`,65:()=>"filter missing setModel method, which is needed for setFilterModel",66:()=>"filter API missing getModel method, which is needed for getFilterModel",67:()=>"Filter is missing isFilterActive() method",68:()=>"Column Filter API methods have been disabled as Advanced Filters are enabled.",69:({guiFromFilter:e})=>`getGui method from filter returned ${e}; it should be a DOM element.`,70:({newFilter:e})=>`Grid option quickFilterText only supports string inputs, received: ${typeof e}`,71:()=>"debounceMs is ignored when apply button is present",72:({keys:e})=>["ignoring FilterOptionDef as it doesn't contain one of ",e],73:()=>"invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'",74:()=>"no filter options for filter",75:()=>"Unknown button type specified",76:({filterModelType:e})=>['Unexpected type of filter "',e,'", it looks like the filter was configured with incorrect Filter Options'],77:()=>"Filter model is missing 'conditions'",78:()=>'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.',79:()=>'"filterParams.maxNumConditions" must be greater than or equal to zero.',80:()=>'"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.',81:()=>'"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".',82:({param:e})=>`DateFilter ${e} is not a number`,83:()=>"DateFilter minValidYear should be <= maxValidYear",84:()=>"DateFilter minValidDate should be <= maxValidDate",85:()=>"DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.",86:()=>"DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.",87:()=>"DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.",88:({index:e})=>`Invalid row index for ensureIndexVisible: ${e}`,89:()=>"A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)",90:()=>"datasource is missing getRows method",91:()=>"Filter is missing method doesFilterPass",92:()=>"AnimationFrameService called but animation frames are off",93:()=>"cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`",94:({paginationPageSizeOption:e,pageSizeSet:t,pageSizesSet:s,pageSizeOptions:i})=>`'paginationPageSize=${e}'${t?"":" (default value)"}, but ${e} is not included in${s?"":" the default"} paginationPageSizeSelector=[${i?.join(", ")}].`,95:({paginationPageSizeOption:e,paginationPageSizeSelector:t})=>`Either set '${t}' to an array that includes ${e} or to 'false' to disable the page size selector.`,96:({id:e,data:t})=>["Duplicate ID",e,"found for pinned row with data",t,"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter."],97:({colId:e})=>`cellEditor for column ${e} is missing getGui() method`,98:()=>"popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.",99:()=>"Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.",101:({propertyName:e,componentName:t,agGridDefaults:s,jsComps:i})=>{let o=[],r=[...Object.keys(s??[]).filter((a)=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(a)),...Object.keys(i??[]).filter((a)=>!!i[a])],n=Rl({inputValue:t,allSuggestions:r,hideIrrelevant:!0,maxSuggestions:4}).values;if(o.push(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.
59
- `),n.length>0)o.push(` Did you mean: [${n.slice(0,3)}]?
60
- `);return o.push("If using a custom component check it has been registered correctly."),o},102:()=>"selectAll: 'filtered' only works when gridOptions.rowModelType='clientSide'",103:()=>"Invalid selection state. When using client-side row model, the state must conform to `string[]`.",104:({value:e,param:t})=>`Numeric value ${e} passed to ${t} param will be interpreted as ${e} seconds. If this is intentional use "${e}s" to silence this warning.`,105:({e})=>["chart rendering failed",e],106:()=>`Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${Oi}/theming-migration/`,107:({key:e,value:t})=>`Invalid value for theme param ${e} - ${t}`,108:({e})=>["chart update failed",e],109:({inputValue:e,allSuggestions:t})=>{let s=Rl({inputValue:e,allSuggestions:t,hideIrrelevant:!0,maxSuggestions:4}).values;return[`Could not find '${e}' aggregate function. It was configured as "aggFunc: '${e}'" but it wasn't found in the list of registered aggregations.`,s.length>0?` Did you mean: [${s.slice(0,3)}]?`:"","If using a custom aggregation function check it has been registered correctly."].join(`
61
- `)},110:()=>"groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup",111:()=>"Invalid selection state. When `groupSelects` is enabled, the state must conform to `IServerSideGroupSelectionState`.",113:()=>"Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values",114:({component:e})=>`Could not find component with name of ${e}. Is it in Vue.components?`,116:()=>"Invalid selection state. The state must conform to `IServerSideSelectionState`.",117:()=>"selectAll must be of boolean type.",118:()=>"Infinite scrolling must be enabled in order to set the row count.",119:()=>"Unable to instantiate filter",120:()=>"MultiFloatingFilterComp expects MultiFilter as its parent",121:()=>"a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key",122:()=>"could not find the document, document is empty",123:()=>"Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.",124:()=>"No active charts to update.",125:({chartId:e})=>`Unable to update chart. No active chart found with ID: ${e}.`,126:()=>"unable to restore chart as no chart model is provided",127:({allRange:e})=>`unable to create chart as ${e?"there are no columns in the grid":"no range is selected"}.`,128:({feature:e})=>`${e} is only available if using 'multiRow' selection mode.`,129:({feature:e,rowModel:t})=>`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`,130:()=>'cannot multi select unless selection mode is "multiRow"',132:()=>"Row selection features are not available unless `rowSelection` is enabled.",133:({iconName:e})=>`icon '${e}' function should return back a string or a dom object`,134:({iconName:e})=>`Did not find icon '${e}'`,135:()=>"Data type of the new value does not match the cell data type of the column",136:()=>"Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.",137:({type:e,currentChartType:t})=>`Unable to update chart as a '${e}' update type is not permitted on a ${t}.`,138:({chartType:e})=>`invalid chart type supplied: ${e}`,139:({customThemeName:e})=>`a custom chart theme with the name ${e} has been supplied but not added to the 'chartThemes' list`,140:({name:e})=>`no stock theme exists with the name '${e}' and no custom chart theme with that name was supplied to 'customChartThemes'`,141:()=>"cross filtering with row grouping is not supported.",142:()=>"cross filtering is only supported in the client side row model.",143:({panel:e})=>`'${e}' is not a valid Chart Tool Panel name`,144:({type:e})=>`Invalid charts data panel group name supplied: '${e}'`,145:({group:e})=>`As of v32, only one charts customize panel group can be expanded at a time. '${e}' will not be expanded.`,146:({comp:e})=>`Unable to instantiate component '${e}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`,147:({group:e})=>`Invalid charts customize panel group name supplied: '${e}'`,148:({group:e})=>`invalid chartGroupsDef config '${e}'`,149:({group:e,chartType:t})=>`invalid chartGroupsDef config '${e}.${t}'`,150:()=>"'seriesChartTypes' are required when the 'customCombo' chart type is specified.",151:({chartType:e})=>`invalid chartType '${e}' supplied in 'seriesChartTypes', converting to 'line' instead.`,152:({colId:e})=>`no 'seriesChartType' found for colId = '${e}', defaulting to 'line'.`,153:({chartDataType:e})=>`unexpected chartDataType value '${e}' supplied, instead use 'category', 'series' or 'excluded'`,154:({colId:e})=>`cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${e}`,155:({option:e})=>`'${e}' is not a valid Chart Toolbar Option`,156:({panel:e})=>`Invalid panel in chartToolPanelsDef.panels: '${e}'`,157:({unrecognisedGroupIds:e})=>["unable to find group(s) for supplied groupIds:",e],158:()=>"can not expand a column item that does not represent a column group header",159:()=>"Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.",160:()=>"Export cancelled. Export is not allowed as per your configuration.",161:()=>"The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'",162:({id:e,dataType:t})=>`Unrecognized data type for excel export [${e}.dataType=${t}]`,163:({featureName:e})=>`Excel table export does not work with ${e}. The exported Excel file will not contain any Excel tables.
62
- Please turn off ${e} to enable Excel table exports.`,164:()=>"Unable to add data table to Excel sheet: A table already exists.",165:()=>"Unable to add data table to Excel sheet: Missing required parameters.",166:({unrecognisedGroupIds:e})=>["unable to find groups for these supplied groupIds:",e],167:({unrecognisedColIds:e})=>["unable to find columns for these supplied colIds:",e],168:()=>"detailCellRendererParams.template should be function or string",169:()=>'Reference to eDetailGrid was missing from the details template. Please add data-ref="eDetailGrid" to the template.',170:({providedStrategy:e})=>`invalid cellRendererParams.refreshStrategy = ${e} supplied, defaulting to refreshStrategy = 'rows'.`,171:()=>"could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions",172:()=>"could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData",173:({group:e})=>`invalid chartGroupsDef config '${e}'`,174:({group:e,chartType:t})=>`invalid chartGroupsDef config '${e}.${t}'`,175:({menuTabName:e,itemsToConsider:t})=>[`Trying to render an invalid menu item '${e}'. Check that your 'menuTabs' contains one of `,t],176:({key:e})=>`unknown menu item type ${e}`,177:()=>"valid values for cellSelection.handle.direction are 'x', 'y' and 'xy'. Default to 'xy'.",178:({colId:e})=>`column ${e} is not visible`,179:()=>"totalValueGetter should be either a function or a string (expression)",180:()=>"agRichSelectCellEditor requires cellEditorParams.values to be set",181:()=>"agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.",182:()=>'you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data',183:()=>"Group Column Filter only works on group columns. Please use a different filter.",184:({parentGroupData:e,childNodeData:t})=>["duplicate group keys for row data, keys should be unique",[e,t]],185:({data:e})=>["getDataPath() should not return an empty path",[e]],186:({rowId:e,rowData:t,duplicateRowsData:s})=>["duplicate group keys for row data, keys should be unique",e,t,...s??[]],187:({rowId:e,firstData:t,secondData:s})=>[`Duplicate node id ${e}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`,"first instance",t,"second instance",s],188:(e)=>`getRowId callback must be provided for Server Side Row Model ${e?.feature||"selection"} to work correctly.`,189:({startRow:e})=>`invalid value ${e} for startRow, the value should be >= 0`,190:({rowGroupId:e,data:t})=>["null and undefined values are not allowed for server side row model keys",e?`column = ${e}`:"","data is ",t],194:({method:e})=>`calling gridApi.${e}() is only possible when using rowModelType=\`clientSide\`.`,195:({justCurrentPage:e})=>`selecting just ${e?"current page":"filtered"} only works when gridOptions.rowModelType='clientSide'`,196:({key:e})=>`Provided ids must be of string type. Invalid id provided: ${e}`,197:()=>"`toggledNodes` must be an array of string ids.",199:()=>"getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use `api.getServerSideSelectionState()` instead.",200:el,201:({rowModelType:e})=>`Could not find row model for rowModelType = ${e}`,202:()=>"`getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model. Use `api.getServerSideSelectionState()` instead.",203:()=>"Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.",204:()=>"Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.",205:({duplicateIdText:e})=>`Unable to display rows as duplicate row ids (${e}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`,206:()=>"getRowId callback must be implemented for transactions to work. Transaction was ignored.",207:()=>'The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.',208:()=>"Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.",209:()=>`Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${Oi}/filter-set-filter-list/#filter-value-types`,210:()=>"Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects?",211:()=>"property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.",212:()=>"please review all your toolPanel components, it seems like at least one of them doesn't have an id",213:()=>"Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.",214:({key:e})=>`unable to lookup Tool Panel as invalid key supplied: ${e}`,215:({key:e,defaultByKey:t})=>`the key ${e} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(t??{}).join(",")}`,216:({name:e})=>`Missing component for '${e}'`,217:({invalidColIds:e})=>["unable to find grid columns for the supplied colDef(s):",e],218:({property:e,defaultOffset:t})=>`${e} must be a number, the value you provided is not a valid number. Using the default of ${t}px.`,219:({property:e})=>`Property ${e} does not exist on the target object.`,220:({lineDash:e})=>`'${e}' is not a valid 'lineDash' option.`,221:()=>"agAggregationComponent should only be used with the client and server side row model.",222:()=>"agFilteredRowCountComponent should only be used with the client side row model.",223:()=>"agSelectedRowCountComponent should only be used with the client and server side row model.",224:()=>"agTotalAndFilteredRowCountComponent should only be used with the client side row model.",225:()=>"agTotalRowCountComponent should only be used with the client side row model.",226:()=>"viewport is missing init method.",227:()=>"menu item icon must be DOM node or string",228:({menuItemOrString:e})=>`unrecognised menu item ${e}`,230:()=>"detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://www.ag-grid.com/react-data-grid/master-detail-custom-detail/",231:()=>"As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.",232:()=>"Using both rowData and v-model. rowData will be ignored.",233:({methodName:e})=>`Framework component is missing the method ${e}()`,234:()=>'Group Column Filter does not work with the colDef property "field". This property will be ignored.',235:()=>'Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.',236:()=>'Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.',237:()=>"Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.",238:()=>"setRowCount can only accept a positive row count.",239:()=>'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string "legacy" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.',240:({theme:e})=>`theme grid option must be a Theming API theme object or the string "legacy", received: ${e}`,243:()=>"Failed to deserialize state - each provided state object must be an object.",244:()=>"Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.",245:()=>"Failed to deserialize state - `toggledNodes` must be an array.",246:()=>"Failed to deserialize state - Every `toggledNode` requires an associated string id.",247:()=>`Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule.
63
- Please rebuild the selection state and reapply it.`,248:()=>"SetFloatingFilter expects SetFilter as its parent",249:()=>"Must supply a Value Formatter in Set Filter params when using a Key Creator",250:()=>"Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.",251:({chartType:e})=>`AG Grid: Unable to create chart as an invalid chartType = '${e}' was supplied.`,252:()=>`cannot get grid to draw rows when it is in the middle of drawing rows.
64
- Your code probably called a grid API method while the grid was in the render stage.
65
- To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0).
66
- To see what part of your code that caused the refresh check this stacktrace.`,253:({version:e})=>["Illegal version string: ",e],254:()=>"Cannot create chart: no chart themes available.",255:({point:e})=>`Lone surrogate U+${e?.toString(16).toUpperCase()} is not a scalar value`,256:()=>"Unable to initialise. See validation error, or load ValidationModule if missing.",257:()=>qu("IntegratedChartsModule"),258:()=>qu("SparklinesModule"),259:({part:e})=>`the argument to theme.withPart must be a Theming API part object, received: ${e}`,260:({propName:e,compName:t,gridScoped:s,gridId:i,rowModelType:o,usesAgGridProvider:r})=>el({reasonOrId:`AG Grid '${e}' component: ${t}`,moduleName:_i[t],gridId:i,gridScoped:s,rowModelType:o,usesAgGridProvider:r}),261:()=>"As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.",262:()=>'As of v33, icon key "smallDown" is deprecated. Use "advancedFilterBuilderSelect" for Advanced Filter Builder dropdown, "selectOpen" for Select cell editor and dropdowns (e.g. Integrated Charts menu), "richSelectOpen" for Rich Select cell editor.',263:()=>'As of v33, icon key "smallLeft" is deprecated. Use "panelDelimiterRtl" for Row Group Panel / Pivot Panel, "subMenuOpenRtl" for sub-menus.',264:()=>'As of v33, icon key "smallRight" is deprecated. Use "panelDelimiter" for Row Group Panel / Pivot Panel, "subMenuOpen" for sub-menus.',265:({colId:e})=>`Unable to infer chart data type for column '${e}' if first data entry is null. Please specify "chartDataType", or a "cellDataType" in the column definition. For more information, see ${Oi}/integrated-charts-range-chart#coldefchartdatatype .`,266:()=>'As of v33.1, using "keyCreator" with the Rich Select Editor has been deprecated. It now requires the "formatValue" callback to convert complex data to strings.',267:()=>"Detail grids can not use a different theme to the master grid, the `theme` detail grid option will be ignored.",268:()=>"Transactions aren't supported with tree data when using treeDataChildrenField",269:()=>"When `masterSelects: 'detail'`, detail grids must be configured with multi-row selection",270:({id:e,parentId:t})=>`Cycle detected for row with id='${e}' and parent id='${t}'. Resetting the parent for row with id='${e}' and showing it as a root-level node.`,271:({id:e,parentId:t})=>`Parent row not found for row with id='${e}' and parent id='${t}'. Showing row with id='${e}' as a root-level node.`,272:()=>jp(),273:({providedId:e,usedId:t})=>`Provided column id '${e}' was already in use, ensure all column and group ids are unique. Using '${t}' instead.`,274:({prop:e})=>{let t=`Since v33, ${e} has been deprecated.`;switch(e){case"maxComponentCreationTimeMs":t+=" This property is no longer required and so will be removed in a future version.";break;case"setGridApi":t+=" This method is not called by AG Grid. To access the GridApi see: https://ag-grid.com/react-data-grid/grid-interface/#grid-api ";break;case"children":t+=" For multiple versions AgGridReact does not support children.";break}return t},275:qp,276:()=>"Row Numbers Row Resizer cannot be used when Grid Columns have `autoHeight` enabled.",277:({colId:e})=>`'enableFilterHandlers' is set to true, but column '${e}' does not have 'filter.doesFilterPass' or 'filter.handler' set.`,278:({colId:e})=>`Unable to create filter handler for column '${e}'`,279:(e)=>{},280:({colId:e})=>`'name' must be provided for custom filter components for column '${e}`,281:({colId:e})=>`Filter for column '${e}' does not have 'filterParams.buttons', but the new Filters Tool Panel has buttons configured. Either configure buttons for the filter, or disable buttons on the Filters Tool Panel.`,282:()=>"New filter tool panel requires `enableFilterHandlers: true`.",283:()=>"As of v34, use the same method on the filter handler (`api.getColumnFilterHandler(colKey)`) instead.",284:()=>"As of v34, filters are active when they have a model. Use `api.getColumnFilterModel()` instead.",285:()=>"As of v34, use (`api.getColumnFilterModel()`) instead.",286:()=>"As of v34, use (`api.setColumnFilterModel()`) instead.",287:()=>"`api.doFilterAction()` requires `enableFilterHandlers = true",288:()=>"`api.getColumnFilterModel(key, true)` requires `enableFilterHandlers = true",289:({rowModelType:e})=>`Row Model '${e}' is not supported with Batch Editing`,290:({rowIndex:e,rowPinned:t})=>`Row with index '${e}' and pinned state '${t}' not found`,291:()=>"License Key being set multiple times with different values. This can result in an incorrect license key being used,",292:({colId:e})=>`The Multi Filter for column '${e}' has buttons configured against the child filters. When 'enableFilterHandlers=true', buttons must instead be provided against the parent Multi Filter params. The child filter buttons will be ignored.`,293:()=>"The grid was initialised detached from the DOM and was then inserted into a Shadow Root. Theme styles are probably broken. Pass the themeStyleContainer grid option to let the grid know where in the document to insert theme CSS.",294:()=>"When using the `agRichSelectCellEditor` setting `filterListAsync = true` requires `allowTyping = true` and the `values()` callback must return a Promise of filtered values.",295:({blockedService:e})=>`colDef.allowFormula is not supported with ${e}. Formulas has been turned off.`,296:()=>"Since v35, `api.hideOverlay()` does not hide the overlay when `activeOverlay` is set. Set `activeOverlay=null` instead.",297:()=>'`api.hideOverlay()` does not hide the no matching rows overlay as it is only controlled by grid state. Set `suppressOverlays=["noMatchingRows"] to not show it.',298:()=>"Columns Tool Panel 'buttons' requires 'apply' to enable Deferred Updates.",301:({key:e})=>`Toolbar item '${e}' is missing the 'toolbarItem' property and will not be rendered.`,302:({itemName:e,moduleName:t,gridScoped:s,gridId:i,rowModelType:o})=>el({reasonOrId:`Toolbar item '${e}'`,moduleName:t,gridId:i,gridScoped:s,rowModelType:o,additionalText:"The item will not be rendered."}),303:({key:e})=>`Multiple toolbar items share the explicit key '${e}'. Only the first item is rendered.`};function WF(e,t){let s=zF[e];if(!s)return[`Missing error text for error id ${e}!`];let i=s(t),r=`
67
- See ${qh(e,t)}`;return Array.isArray(i)?i.concat(r):[i,r]}var UF={1:"Charting Aggregation",2:"pivotResultFields",3:"setTooltip"},KF=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.batchFrameworkComps=!1,this.usesAgGridProvider=void 0,this.wrapIncoming=(t)=>t(),this.wrapOutgoing=(t)=>t(),this.baseDocLink=`${Vh}/${this.frameworkName}-data-grid`,rw(this.baseDocLink)}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return this.baseDocLink+(e?"/"+e:"")}},Yu=new WeakMap,Xu=new WeakMap;function Un(e,t,s){if(!t)return X(11),{};let i=s,o;if(!i?.setThemeOnGridDiv){let n=ee({tag:"div"});n.style.height="100%",e.appendChild(n),e=n,o=()=>e.remove()}return new jF().create(e,t,(n)=>{let a=new ty(e);n.createBean(a)},void 0,s,o)}var $F=1,jF=class{create(e,t,s,i,o,r){let n=ql.applyGlobalGridOptions(t),a=n.gridId??String($F++),l=this.getRegisteredModules(o,a,n.rowModelType),c=this.createBeansList(n.rowModelType,l,a,o?.frameworkOverrides?.usesAgGridProvider),d=this.createProvidedBeans(e,n,o);if(!c)return;let g=new Lb({providedBeanInstances:d,beanClasses:c,id:a,beanInitComparator:Bb,beanDestroyComparator:Vb,derivedBeans:[Gb],destroyCallback:()=>{Xu.delete(p),Yu.delete(e),ew(a),r?.()}});this.registerModuleFeatures(g,l),s(g),g.getBean("syncSvc").start(),i?.(g);let p=g.getBean("gridApi");return Yu.set(e,p),Xu.set(p,e),p}getRegisteredModules(e,t,s){return Io(LF,void 0,!0),e?.modules?.forEach((i)=>Io(i,t)),tw(t,Zu(s))}registerModuleFeatures(e,t){let s=e.getBean("registry"),i=e.getBean("apiFunctionSvc");for(let o of t){s.registerModule(o);let r=o.apiFunctions;if(r){let n=Object.keys(r);for(let a of n)i?.addFunction(a,r[a])}}}createProvidedBeans(e,t,s){let i=s?s.frameworkOverrides:null;if(q(i))i=new KF;let o={gridOptions:t,eGridDiv:e,eRootDiv:e,globalListener:s?s.globalListener:null,globalSyncListener:s?s.globalSyncListener:null,frameworkOverrides:i,withinStudio:s?.withinStudio};if(s?.providedBeanInstances)Object.assign(o,s.providedBeanInstances);return o}createBeansList(e,t,s,i){let o={clientSide:"ClientSideRowModel",infinite:"InfiniteRowModel",serverSide:"ServerSideRowModel",viewport:"ViewportRowModel"},r=Zu(e),n=o[r];if(!n){bo(201,{rowModelType:r},`Unknown rowModelType ${r}.`);return}if(!iw()){bo(272,void 0,jp(i));return}if(!e){let l=Object.entries(o).filter(([c,d])=>nl(d,s,c));if(l.length==1){let[c,d]=l[0];if(c!==r){let u={moduleName:d,rowModelType:c};bo(275,u,qp(u));return}}}if(!nl(n,s,r)){let l=Xl(),c=`rowModelType = '${r}'`,d=l?`Unable to use ${c} as that requires the ag-grid-enterprise script to be included.
68
- `:`Missing module ${n}Module for rowModelType ${r}.`;bo(200,{reasonOrId:c,moduleName:n,gridScoped:Yl(),gridId:s,rowModelType:r,isUmd:l},d);return}let a=new Set;for(let l of t)for(let c of l.beans??[])a.add(c);return Array.from(a)}};function Zu(e){return e??"clientSide"}function qF(e,t,s="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,s),"ensureVisible")}function YF(e,t,s){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,s),"ensureVisible")}var XF=class extends y{constructor(e){super();this.rootNode=e,this.nextId=0,this.allNodesMap={},Qu(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){this.dispatchRowDataUpdateStarted(e),this.destroyAllNodes();let t=Qu(this.rootNode),s=Array(e.length);t._leafs=s;let i=0,o=this.beans.groupStage?.getNestedDataGetter(),r=o?new Set:null,n=(a,l)=>{let c=a.level+1;for(let d=0,u=l.length;d<u;++d){let h=l[d];if(!h)continue;let g=this.createRowNode(h,c,i);if(s[i++]=g,r&&!r.has(h)){r.add(h),g.treeParent=a;let p=o(h);if(p)n(g,p)}}};n(t,e),s.length=i}destroyAllNodes(){let{selectionSvc:e,pinnedRowModel:t,groupStage:s}=this.beans;if(e?.reset("rowDataChanged"),t?.isManual())t.reset();s?.clearNonLeafs();let i=this.rootNode._leafs;if(i)for(let o=0,r=i.length;o<r;++o)i[o]._destroy(null);this.allNodesMap=Object.create(null),this.nextId=0}setImmutableRowData(e,t){let{rootNode:s,gos:i}=this;this.dispatchRowDataUpdateStarted(t);let o=cl(i),r=e.changedRowNodes,{adds:n,updates:a}=r,l=new Set,c=[],d=this.beans.groupStage?.getNestedDataGetter(),u=i.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,g=!1,p=(C,v)=>{if(!u&&u!==void 0){let w=C.sourceRowIndex;u=w<=h,h=w}if(C.data!==v){if(C.updateData(v),!n.has(C))a.add(C);if(!C.selectable&&C.isSelected())c.push(C)}},f=(C,v,w)=>{for(let S=0,x=v.length;S<x;++S){let R=v[S];if(!R)continue;let P=this.getRowNode(o({data:R,level:w}));if(P)p(P,R),g||(g=!!d&&P.treeParent!==C);else P=this.createRowNode(R,w),n.add(P);if(!d||l.has(P)){l.add(P);continue}l.add(P),P.treeParent=C;let D=d(R);if(D)f(P,D,w+1)}};f(s,t,0);let m=this.deleteUnusedNodes(l,r,c,!!e.animate)||u||n.size>0;if(m){let C=s._leafs??(s._leafs=[]);if(u===void 0)tE(C,l,r);else if(eE(C,l))r.reordered=!0}if(m||g||a.size)e.rowDataUpdated=!0,this.deselect(c)}deleteUnusedNodes(e,{removals:t},s,i){let o=this.rootNode._leafs;for(let r=0,n=o.length;r<n;r++){let a=o[r];if(!e.has(a)){if(this.destroyNode(a,i)){if(t.push(a),a.isSelected())s.push(a)}}}return t.length>0}updateRowData(e,t,s){if(this.dispatchRowDataUpdateStarted(e.add),this.beans.groupStage?.getNestedDataGetter())return F(268),{remove:[],update:[],add:[]};let i=[],o=cl(this.gos),r=this.executeRemove(o,e,t,i,s),n=this.executeUpdate(o,e,t,i),a=this.executeAdd(e,t);return this.deselect(i),{remove:r,update:n,add:a}}executeRemove(e,{remove:t},{adds:s,updates:i,removals:o},r,n){let a=this.rootNode._leafs,l=a?.length,c=t?.length;if(!c||!l)return[];let d=0,u=l,h=0,g=Array(c);for(let p=0;p<c;++p){let f=this.lookupNode(e,t[p]);if(!f)continue;let m=f.sourceRowIndex;if(m<u)u=m;if(m>h)h=m;if(g[d++]=f,!this.destroyNode(f,n))continue;if(f.isSelected())r.push(f);if(!s.delete(f))i.delete(f),o.push(f)}if(g.length=d,d)JF(a,u,h);return g}executeUpdate(e,{update:t},{adds:s,updates:i},o){let r=t?.length;if(!r)return[];let n=Array(r),a=0;for(let l=0;l<r;l++){let c=t[l],d=this.lookupNode(e,c);if(d){if(d.updateData(c),!d.selectable&&d.isSelected())o.push(d);if(n[a++]=d,!s.has(d))i.add(d)}}return n.length=a,n}executeAdd(e,t){var s;let i=(s=this.rootNode)._leafs??(s._leafs=[]),o=i.length,r=e.add,n=r?.length;if(!n)return[];let a=o+n,l=this.sanitizeAddIndex(i,e.addIndex);if(l<o){for(let u=o-1,h=a-1;u>=l;--u){let g=i[u];g.sourceRowIndex=h,i[h--]=g}t.reordered=!0}i.length=a;let c=Array(n),d=t.adds;for(let u=0;u<n;u++){let h=this.createRowNode(r[u],0,l);d.add(h),i[l]=h,c[u]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null})}deselect(e){let s=this.beans.selectionSvc;if(e.length)s?.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:"rowDataChanged"});if(s?.updateGroupsFromChildrenSelections?.("rowDataChanged"),e.length)this.eventSvc.dispatchEvent({type:"selectionChanged",source:"rowDataChanged",selectedNodes:s?.getSelectedNodes()??null,serverSideState:null})}createRowNode(e,t,s){let i=new Vs(this.beans);if(i.parent=this.rootNode,i.level=t,i.group=!1,s!=null)i.sourceRowIndex=s;i.setDataAndId(e,String(this.nextId++));let o=i.id,r=this.allNodesMap;if(r[o])F(2,{nodeId:o});return r[o]=i,i}destroyNode(e,t){if(!e._destroy(t))return!1;let s=e.id,i=this.allNodesMap;if(i[s]===e)delete i[s];return!0}lookupNode(e,t){if(!e)return QF(this.rootNode._leafs,t);let s=e({data:t,level:0}),i=this.allNodesMap[s];if(!i)return X(4,{id:s}),null;return i}sanitizeAddIndex(e,t){let s=e.length;if(typeof t!=="number")return s;if(t<0||t>=s||Number.isNaN(t))return s;t=Math.ceil(t);let i=this.gos;if(t>0&&i.get("treeData")&&i.get("getDataPath"))t=ZF(e,t);return t}},ZF=(e,t)=>{for(let s=0,i=e.length;s<i;s++)if(e[s]?.rowIndex==t-1)return s+1;return t},Qu=(e)=>{if(e.group=!0,e.level=-1,e._expanded=!0,e.id=oc,e._leafs?.length!==0)e._leafs=[];let t=[],s=[],i=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=s,e.childrenAfterAggFilter=i,e.childrenAfterFilter=o;let r=e.sibling;if(r)r.childrenAfterGroup=t,r.childrenAfterSort=s,r.childrenAfterAggFilter=i,r.childrenAfterFilter=o,r.childrenMapped=e.childrenMapped;return e.updateHasChildren(),e},QF=(e,t)=>{if(e)for(let s=0,i=e.length;s<i;s++){let o=e[s];if(o.data===t)return o}return X(5,{data:t}),null},JF=(e,t,s)=>{t=Math.max(0,t);for(let i=t,o=e.length;i<o;++i){let r=e[i];if(i<=s&&r.destroyed)continue;r.sourceRowIndex=t,e[t++]=r}e.length=t},eE=(e,t)=>{let s=t.size;e.length=s;let i=0,o=!1,r=!1;for(let n of t){let a=n.sourceRowIndex;if(a===i)r||(r=o);else{if(a>=0)r=!0;else o=!0;n.sourceRowIndex=i,e[i]=n}++i}return r},tE=(e,t,{adds:s})=>{let i=e.length,o=t.size;if(o>i)e.length=o;let r=0;for(let n=0;n<i;++n){let a=e[n];if(!a.destroyed){if(r!==n)a.sourceRowIndex=r,e[r]=a;++r}}for(let n of s)if(n.sourceRowIndex<0)n.sourceRowIndex=r,e[r++]=n;e.length=r},sE=class extends y{constructor(){super(...arguments);this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.hierarchical=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.formulaRows=[],this.stages=null,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingData=!1,this.rowDataUpdatedPending=!1,this.refreshingModel=!1,this.pendingNewData=!1,this.noKeepRenderedRows=!1,this.noKeepUndoRedoStack=!1,this.noAnimate=!1,this.rowNodesCountReady=!1,this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=$e(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){let e=this.beans,t=new Vs(e);this.rootNode=t,this.nodeManager=this.createBean(new XF(t));let s=()=>{this.beans.groupStage?.invalidateGroupCols(),this.refreshModel({step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")})};this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:s,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:()=>this.refreshModel({step:"pivot"}),columnPivotModeChanged:()=>this.refreshModel({step:"group"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),stylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){let{beans:e,stagesRefreshProps:t}=this,s=[e.groupStage,e.filterStage,e.groupFilterStage,e.pivotStage,e.aggStage,e.sortStage,e.groupSortStage,e.filterAggStage,e.flattenStage].filter((i)=>!!i);this.stages=s;for(let i=s.length-1;i>=0;--i){let o=s[i].refreshProps;if(o)for(let r of o)t.set(r,i)}this.addManagedPropertyListeners([...t.keys(),"rowData"],(i)=>{let o=i.changeSet?.properties;if(o)this.onPropChange(o)}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){if(this.started=!0,this.rowNodesCountReady)this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0});else this.setInitialData()}setInitialData(){if(this.gos.get("rowData"))this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,s,i){let o,r=!1;do{o=!1;let n=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(n,s),c=Math.min(a,i);for(let d=l;d<=c;d++){let u=this.getRow(d);if(u.rowHeightEstimated){let h=ko(this.beans,u);u.setRowHeight(h.height),o=!0,r=!0}}if(o)this.setRowTopAndRowIndex()}while(o);return r}onPropChange(e){let{nodeManager:t,gos:s,beans:i}=this,o=i.groupStage;if(!t)return;let r=new Set(e),n=o?.onPropChange(r),a;if(r.has("rowData"))a=s.get("rowData");else if(n)a=o?.extractData();if(a&&!Array.isArray(a))a=null,F(1);let l={step:"nothing",changedProps:r};if(a){let d=!n&&!this.isEmpty()&&a.length>0&&s.exists("getRowId")&&!s.get("resetRowDataOnUpdate");if(this.refreshingData=!0,d)l.keepRenderedRows=!0,l.animate=!s.get("suppressAnimationFrame"),l.changedRowNodes=new Ni,t.setImmutableRowData(l,a);else l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0}let c=l.rowDataUpdated?"group":this.getRefreshedStage(e);if(c)l.step=c,this.refreshModel(l)}getRefreshedStage(e){let{stages:t,stagesRefreshProps:s}=this;if(!t)return null;let i=t.length,o=i;for(let r=0,n=e.length;r<n&&o;++r)o=Math.min(o,s.get(e[r])??o);return o<i?t[o].step:null}setRowTopAndRowIndex(e){let{beans:t,rowsToDisplay:s}=this,i=t.environment.getDefaultRowHeight(),o=0,r=Te(this.gos,"normal");for(let n=0,a=s.length;n<a;++n){let l=s[n],c=l.id;if(c!=null)e?.add(c);if(l.rowHeight==null){let d=ko(t,l,r,i);l.setRowHeight(d.height,d.estimated)}l.setRowTop(o),l.setRowIndex(n),o+=l.rowHeight}if(this.beans.formula?.active){let n=this.formulaRows;for(let a=0,l=n.length;a<l;++a){let c=n[a];c.formulaRowIndex=a}}}clearRowTopAndRowIndex(e,t){let s=(r)=>{if(r?.id!=null&&!t.has(r.id))r.clearRowTopAndRowIndex()},i=(r)=>{s(r),s(r.detailNode),s(r.sibling);let n=r.childrenAfterGroup;if(!r.hasChildren()||!n)return;if(e&&r.level!==-1&&!r.expanded)return;for(let a=0,l=n.length;a<l;++a)i(n[a])},o=this.rootNode;if(o)i(o)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){let{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;let i=e.sibling?.displayed?1:0;return(e.childrenAfterSort?.length??0)+i}getTopLevelRowDisplayedIndex(e){let{beans:t,rootNode:s,rowsToDisplay:i}=this;if(!s||!i.length||i[0]===s)return e;let r=s.childrenAfterSort,n=(l)=>{let c=r[l];if(this.gos.get("groupHideOpenParents"))while(c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;if(a)return a?.getTopDisplayIndex(i,e,r,n);return n(e)}getTopLevelIndexFromDisplayedIndex(e){let{rootNode:t,rowsToDisplay:s}=this;if(!t||!s.length||s[0]===t)return e;let o=this.getRow(e);if(o.footer)o=o.sibling;let r=o.parent;while(r&&r!==t)o=r,r=o.parent;let n=t.childrenAfterSort?.indexOf(o)??-1;return n>=0?n:e}getRowBounds(e){let t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:Bi(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){let i=t.length===0||t.some((o)=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:i,keepRenderedRows:!0,animate:Bi(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:Bi(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;let{changedRowNodes:t,newData:s,rowDataUpdated:i}=e;if(!t||s||!i)return!1;if(t.removals.length||t.adds.size)return!1;return!0}reMapRows(){if(this.refreshingModel||this.refreshingData){this.noKeepRenderedRows=!0,this.noKeepUndoRedoStack=!0,this.noAnimate=!0;return}this.refreshModel({step:"map",keepRenderedRows:!1,keepUndoRedoStack:!1,animate:!1})}refreshModel(e){let{nodeManager:t,eventSvc:s,started:i}=this;if(!t)return;let o=!!e.rowDataUpdated;if(i&&o)s.dispatchEvent({type:"rowDataUpdated"});if(this.deferRefresh(e)){this.setPendingRefreshFlags(e),this.rowDataUpdatedPending||(this.rowDataUpdatedPending=o);return}if(this.rowDataUpdatedPending)this.rowDataUpdatedPending=!1,e.step="group";this.updateRefreshParams(e);let r=!1;this.refreshingModel=!0;try{this.executeRefresh(e,o),r=!0}finally{if(this.refreshingData=!1,this.refreshingModel=!1,!r)this.setPendingRefreshFlags(e)}this.clearPendingRefreshFlags(),this.beans.formula?.onRowsChanged(e.changedRowNodes,e.newData),s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}executeRefresh(e,t){let{beans:s,rootNode:i}=this;if(s.masterDetailSvc?.refreshModel(e),t&&e.step!=="group")s.colFilter?.refreshModel();let o=e.changedPath;if(o?.addRow(i),e.step==="group")this.doGrouping(i,e),o??(o=e.changedPath);switch(o??(o=s.changedPathFactory?.ensureRowsPath(e,i)),e.step){case"group":case"filter":this.doFilter(o);case"pivot":if(this.doPivot(o,e.changedProps))o=void 0,e.changedPath=void 0;case"aggregate":this.doAggregate(o);case"filter_aggregates":this.doFilterAggregates(o);case"sort":this.doSort(o,e.changedRowNodes);case"map":this.doRowsToDisplay()}let r=new Set;this.setRowTopAndRowIndex(r),this.clearRowTopAndRowIndex(o,r),this.updateRefreshParams(e)}deferRefresh(e){if(this.refreshingModel)return!0;if(this.beans.colModel.changeEventsDispatching)return!0;if(this.isSuppressModelUpdateAfterUpdateTransaction(e)){if(this.started)this.refreshingData=!1;return!0}if(!this.started)return!0;return!1}setPendingRefreshFlags(e){this.pendingNewData||(this.pendingNewData=!!e.newData),this.noKeepRenderedRows||(this.noKeepRenderedRows=!e.keepRenderedRows),this.noKeepUndoRedoStack||(this.noKeepUndoRedoStack=!e.keepUndoRedoStack),this.noAnimate||(this.noAnimate=!e.animate)}clearPendingRefreshFlags(){this.pendingNewData=!1,this.noKeepRenderedRows=!1,this.noKeepUndoRedoStack=!1,this.noAnimate=!1}updateRefreshParams(e){e.newData=this.pendingNewData||!!e.newData,e.keepRenderedRows=!this.noKeepRenderedRows&&!!e.keepRenderedRows,e.keepUndoRedoStack=!this.noKeepUndoRedoStack&&!!e.keepUndoRedoStack,e.animate=!this.noAnimate&&!!e.animate}isEmpty(){return!this.rootNode?._leafs?.length||!this.beans.colModel?.ready}isRowsToRender(){return this.rowsToDisplay.length>0}getOverlayType(){let{beans:e,gos:t}=this;if(this.rootNode?._leafs?.length){if(e.filterManager?.isAnyFilterPresent()&&this.getRowCount()===0)return"noMatchingRows"}else if(this.rowCountReady||(t.get("rowData")?.length??0)==0)return"noRows";return null}getNodesInRangeForSelection(e,t){let s=!1,i=!1,o=[],r=Go(this.gos);return this.forEachNodeAfterFilterAndSort((n)=>{if(i)return;if(s){if(n===t||n===e){if(i=!0,r&&n.group){Yp(o,n);return}}}if(!s){if(n!==t&&n!==e)return;if(s=!0,t===e)i=!0}if(!n.group||!r)o.push(n)}),o}getTopLevelNodes(){return this.rootNode?.childrenAfterGroup??null}getRow(e){return this.rowsToDisplay[e]}getFormulaRow(e){return this.formulaRows[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){let t=this.rowsToDisplay,s=t.length;if(this.isEmpty()||s===0)return-1;let i=0,o=s-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let n=-1,a=-1;while(!0){let l=Math.floor((i+o)/2),c=t[l];if(this.isRowInPixel(c,e))return l;if(c.rowTop<e)i=l+1;else if(c.rowTop>e)o=l-1;if(n===i&&a===o)return l;n=i,a=o}}isRowInPixel(e,t){let s=e.rowTop,i=s+e.rowHeight;return s<=t&&i>t}forEachLeafNode(e){let t=this.rootNode?._leafs;if(t)for(let s=0,i=t.length;s<i;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){let t=this.rowsToDisplay;for(let s=0,i=t.length;s<i;++s)e(t[s],s)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,(s)=>s.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,(s)=>s.childrenAfterSort)}forEachPivotNode(e,t,s){let{colModel:i,rowGroupColsSvc:o}=this.beans;if(!i.pivotMode)return;if(!o?.columns.length){e(this.rootNode,0);return}let r=s?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,(n)=>!n.leafGroup?n[r]:null)}depthFirstSearchRowNodes(e,t=!1,s=(r)=>r.childrenAfterGroup,i=this.rootNode,o=0){let r=o;if(!i)return r;let n=i===this.rootNode;if(!n)e(i,r++);if(i.hasChildren()&&!i.footer){let a=n||this.hierarchical?s(i):null;if(a){let l=this.beans.footerSvc;r=l?.addTotalRows(r,i,e,t,n,"top")??r;for(let c of a)r=this.depthFirstSearchRowNodes(e,t,s,c,r);return l?.addTotalRows(r,i,e,t,n,"bottom")??r}}return r}doAggregate(e){if(this.rootNode)this.beans.aggStage?.execute(e)}doFilterAggregates(e){if(this.hierarchical){let i=this.beans.filterAggStage;if(i){i.execute(e);return}}let t=this.rootNode;t.childrenAfterAggFilter=t.childrenAfterFilter;let s=t.sibling;if(s)s.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){let s=this.beans;(this.hierarchical&&s.groupSortStage||s.sortStage).execute(e,t)}doGrouping(e,t){let i=this.beans.groupStage?.execute(t);if(i===void 0){let o=e._leafs;e.childrenAfterGroup=o,e.updateHasChildren();let r=e.sibling;if(r)r.childrenAfterGroup=o}if(i||t.rowDataUpdated)this.beans.colFilter?.refreshModel();if(!this.rowCountReady&&this.rowNodesCountReady)this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"})}doFilter(e){let t=this.beans;(this.hierarchical&&t.groupFilterStage||t.filterStage).execute(e);let s=this.rootNode,i=s.sibling;if(i)i.childrenAfterFilter=s.childrenAfterFilter}doPivot(e,t){return this.beans.pivotStage?.execute(e,t)??!1}getRowNode(e){if(typeof e!=="string")e=String(e);let t=this.nodeManager?.getRowNode(e);if(typeof t==="object")return t;let s=this.beans.groupStage?.getNonLeaf(e);if(s)return s;return this.getSpecialRowNode(e)}getSpecialRowNode(e){if(e===oc)return this.rootNode??void 0;if(e===kw){let t=this.rootNode?.sibling;return t?.footer?t:void 0}if(e.startsWith(Bo)){let t=e.slice(Bo.length),s=this.getRowNode(t);return s?.sibling?.footer?s.sibling:void 0}if(e.startsWith(on)){let t=e.slice(on.length),s=this.nodeManager?.getRowNode(t);if(typeof s==="object"&&s.detailNode?.id===e)return s.detailNode}}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];let s=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),s)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){let e=this.asyncTransactionsTimer;if(e)clearTimeout(e),this.executeBatchUpdateRowData()}executeBatchUpdateRowData(){let{nodeManager:e,beans:t,eventSvc:s,asyncTransactions:i}=this;if(!e)return;t.valueCache?.onDataChanged();let o=[],r=[],n=new Ni,a=!this.gos.get("suppressAnimationFrame");for(let{rowDataTransaction:l,callback:c}of i??[]){this.rowNodesCountReady=!0,this.refreshingData=!0;let d=e.updateRowData(l,n,a);if(o.push(d),c)r.push(c.bind(null,d))}if(this.commitTransactions(n,a),r.length>0)setTimeout(()=>{for(let l=0,c=r.length;l<c;l++)r[l]()},0);if(o.length>0)s.dispatchEvent({type:"asyncTransactionsFlushed",results:o});this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){let t=this.nodeManager;if(!t)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;let s=new Ni,i=!this.gos.get("suppressAnimationFrame");this.refreshingData=!0;let o=t.updateRowData(e,s,i);return this.commitTransactions(s,i),o}commitTransactions(e,t){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:t,changedRowNodes:e})}doRowsToDisplay(){let{rootNode:e,beans:t}=this;if(t.formula?.active){let o=e?.childrenAfterSort??[];this.formulaRows=o,this.rowsToDisplay=o.filter((r)=>!r.softFiltered);for(let r of this.rowsToDisplay)r.setUiLevel(0);return}let s=t.flattenStage;if(s){this.rowsToDisplay=s.execute();return}let i=this.rootNode.childrenAfterSort??[];for(let o of i)o.setUiLevel(0);this.rowsToDisplay=i}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){let e=this.rootNode;if(!e)return;let t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);let s=e.sibling;if(s?.setRowHeight(s.rowHeight,!0),t)this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode((t)=>{t.setRowHeight(t.rowHeight,!0);let s=t.detailNode;s?.setRowHeight(s.rowHeight,!0);let i=t.sibling;i?.setRowHeight(i.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){if(e.rowHeightChanged&&!this.beans.rowAutoHeight?.active)this.resetRowHeights()}onGridReady(){if(!this.started)this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,this.stages=null,this.stagesRefreshProps.clear(),clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},Yp=(e,t)=>{let s=t.childrenAfterGroup;if(s)for(let i=0,o=s.length;i<o;++i){let r=s[i];if(r.data)e.push(r);if(r.group)Yp(e,r)}};var iE=class extends y{constructor(){super(...arguments);this.beanName="filterStage",this.step="filter",this.refreshProps=null}wireBeans(e){this.filterManager=e.filterManager}execute(){let e=this.beans,t=e.rowModel.rootNode,s=t.childrenAfterGroup,i=s.length,o=this.filterManager,r=!!o?.isChildFilterPresent();if(e.formula?.active)if(t.childrenAfterFilter=s,r)for(let n=0;n<i;++n){let a=s[n];a.softFiltered=!o.doesRowPassFilter(a)}else for(let n=0;n<i;++n)s[n].softFiltered=!1;else if(r)t.childrenAfterFilter=oE(s,i,t.childrenAfterFilter??s,o);else t.childrenAfterFilter=s}},oE=(e,t,s,i)=>{let o=s.length,r=0;for(let n=0;n<t;++n){let a=e[n];if(i.doesRowPassFilter(a)){if(r>=o||s[r]!==a)return Ju(e,t,n,r,s,i);++r}else if(r<o)return Ju(e,t,n,r,s,i)}return r===o?s:e},Ju=(e,t,s,i,o,r)=>{let n=i>0?o.slice(0,i):[];while(s<t){let a=e[s++];if(r.doesRowPassFilter(a))n.push(a)}return n},rE=4,Nc=(e,t,s,i,o)=>{let{childrenAfterSort:r,childrenAfterAggFilter:n}=t;if(!n)return r&&r.length>0?r:[];let a=n.length;if(a<=1){if(r?.length===a&&(a===0||r[0]===n[0]))return r;return n.slice()}if(!r||a<=rE)return e.doFullSortInPlace(n.slice(),o);let l=new Map,{updates:c,adds:d}=s,u=[];for(let g=0;g<a;++g){let p=n[g];if(c.has(p)||d.has(p)||i?.hasRow(p))l.set(p,~g),u.push(p);else l.set(p,g)}let h=u.length;if(h===0)return a===r.length?r:aE(r,l,u);if(u.sort((g,p)=>e.compareRowNodes(o,g,p)||~l.get(g)-~l.get(p)),h===a)return u;return nE(e,o,u,r,l,a)},nE=(e,t,s,i,o,r)=>{let n=Array(r),a=0,l=s[a],c,d=-1,u=0,h=0,g=s.length,p=i.length;while(!0){if(d<0){if(u>=p)break;if(c=i[u++],d=o.get(c)??-1,d<0)continue}if((e.compareRowNodes(t,l,c)||~o.get(l)-d)<0){if(n[h++]=l,++a>=g)break;l=s[a]}else n[h++]=c,d=-1}while(a<g)n[h++]=s[a++];if(d<0)return n;n[h++]=c;while(u<p){let f=i[u++];if(o.get(f)>=0)n[h++]=f}return n},aE=(e,t,s)=>{let i=0;s.length=t.size;for(let o=0,r=e.length;o<r;++o){let n=e[o];if(t.has(n))s[i++]=n}return s.length=i,s},_c=(e)=>{let{childrenAfterSort:t,sibling:s}=e;if(s)s.childrenAfterSort=t;if(!t)return;for(let i=0,o=t.length-1;i<=o;i++){let r=t[i],n=i===0,a=i===o;if(r.firstChild!==n)r.firstChild=n,r.dispatchRowEvent("firstChildChanged");if(r.lastChild!==a)r.lastChild=a,r.dispatchRowEvent("lastChildChanged");if(r.childIndex!==i)r.childIndex=i,r.dispatchRowEvent("childIndexChanged")}},lE=class extends y{constructor(){super(...arguments);this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","accentedSort"]}execute(e,t){let{rowModel:s,sortSvc:i,rowNodeSorter:o}=this.beans,r=s.rootNode,n=i.getSortOptions(),a=n.length>0,l=this.gos.getCallback("postSortRows"),c=a&&!l&&this.gos.get("deltaSort")&&t,{childrenAfterSort:d,childrenAfterAggFilter:u}=r,h;if(a)if(c)h=Nc(o,r,c,e,n);else h=o.doFullSortInPlace(u?.slice()??[],n);else h=Ll(d,u);r.childrenAfterSort=h,_c(r),l?.({nodes:h})}},Xp={moduleName:"ClientSideRowModel",version:z,rowModels:["clientSide"],beans:[sE,iE,lE],dependsOn:[Up]};var cE=":where(.ag-ltr) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,left .2s ease-in-out}}:where(.ag-rtl) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,right .2s ease-in-out}}";function dE(e,t){if(typeof t==="number")e.colAutosize?.sizeColumnsToFit(t,"api");else e.colAutosize?.sizeColumnsToFitGridBody(t)}function Zp({colAutosize:e,visibleCols:t},s,i){if(Array.isArray(s))e?.autoSizeCols({colKeys:s,skipHeader:i,source:"api"});else e?.autoSizeCols({...s,colKeys:s.colIds??t.allCols,source:"api"})}function uE(e,t){if(t&&typeof t==="object")Zp(e,t);else e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}var hE=class extends y{constructor(){super(...arguments);this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){let{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1,i=t.type;if(i==="fitGridWidth"||i==="fitProvidedWidth")s=!0;else if(i==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});let o=e.get("rowData");s=o!=null&&o.length>0&&J(e)}if(s)this.beans.colDelayRenderSvc?.hideColumns(i)}}autoSizeCols(e){let{eventSvc:t,visibleCols:s,colModel:i}=this.beans;vo(this.beans,!0),this.innerAutoSizeCols(e).then((o)=>{let r=(d)=>Ki(t,Array.from(d),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return vo(this.beans,!1),r(o);let n=eh(this.beans),a=(d)=>s.leftCols.some((u)=>jt(u,d)),l=(d)=>s.rightCols.some((u)=>jt(u,d)),c=e.colKeys.filter((d)=>!i.getCol(d)?.colDef.suppressAutoSize&&!Oe(d)&&!a(d)&&!l(d));this.sizeColumnsToFit(n,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map((d)=>({...d,key:d.colId})),colKeys:c,onlyScaleUp:!0,animate:!1}),vo(this.beans,!1),r(o)})}innerAutoSizeCols(e){return new Promise((t,s)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,s));let{colKeys:i,skipHeader:o,skipHeaderGroups:r,stopAtGroup:n,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:d="api"}=e,{animationFrameSvc:u,renderStatus:h,colModel:g,autoWidthCalc:p,visibleCols:f}=this.beans;if(u?.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{if(this.isAlive())this.innerAutoSizeCols(e).then(t,s)});return}this.timesDelayed=0;let m=new Set,C=-1,v=Object.fromEntries(c.map(({colId:x,...R})=>[x,R])),w=o??this.gos.get("skipHeaderOnAutoSize"),S=r??w;while(C!==0){C=0;let x=[];for(let R of i){if(!R||Yo(R))continue;let P=g.getCol(R);if(!P||m.has(P)||P.colDef.suppressAutoSize)continue;let D=p.getPreferredWidthForColumn(P,w);if(D>0){let O=v[P.colId]??{};O.minWidth??(O.minWidth=l),O.maxWidth??(O.maxWidth=a);let A=gE(P,D,O);P.setActualWidth(A,d),m.add(P),C++}x.push(P)}if(x.length)f.refresh(d)}if(!S)this.autoSizeColumnGroupsByColumns(i,d,n);t(m)})}autoSizeColumn(e,t,s){this.autoSizeCols({colKeys:[e],skipHeader:s,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,s){let{colModel:i,ctrlsSvc:o}=this.beans,r=new Set,n=i.getColsForKeys(e);for(let l of n){let c=l.parent;while(c&&c!=s){if(!c.isPadding())r.add(c);c=c.parent}}let a;for(let l of r){for(let c of o.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a?.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){let s=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.autoSizeColumn(t,"uiColumnResized",s)};e.addEventListener("dblclick",i);let o=new Ke(e);return o.addEventListener("doubleTap",i),()=>{e.removeEventListener("dblclick",i),o.destroy()}}addColumnGroupResize(e,t,s){let i=this.gos.get("skipHeaderOnAutoSize"),o=()=>{let r=[],n=t.getDisplayedLeafColumns();for(let a of n)if(!a.colDef.suppressAutoSize)r.push(a.colId);if(r.length>0)this.autoSizeCols({colKeys:r,skipHeader:i,stopAtGroup:t,source:"uiColumnResized"});s()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;let s=eh(this.beans);if(s>0&&this.beans.visibleCols.centerCols.length===0)s=Math.max(s-$r,0);if(s>0){this.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e);return}if(t===void 0)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0);else if(t===100)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100);else if(t===500)window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500);else F(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",s,i){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,s,i));return}let{beans:o}=this,r=i?.animate??!0;if(r)vo(o,!0);let n={};for(let{key:C,...v}of i?.columnLimits??[])n[typeof C==="string"?C:C.getColId()]=v;let a=o.visibleCols.allCols;if(e<=0||!a.length)return;let l=ts(a);if(i?.onlyScaleUp&&l>e)return;if(e===l){if(a.every((v)=>{if(v.colDef.suppressSizeToFit)return!0;let w=n?.[v.getId()],S=w?.minWidth??i?.defaultMinWidth,x=w?.maxWidth??i?.defaultMaxWidth,R=v.getActualWidth();return(S==null||R>=S)&&(x==null||R<=x)}))return}let d=[],u=[];for(let C of a){let v=i?.colKeys?.some((w)=>jt(C,w))??!0;if(C.colDef.suppressSizeToFit||!v)u.push(C);else d.push(C)}let h=d.slice(0),g=!1,p=(C)=>{ae(d,C),u.push(C)},f={};for(let C of d){if(i?.onlyScaleUp)f[C.colId]=C.getActualWidth();C.resetActualWidth(t);let v=n?.[C.getId()],w=v?.minWidth??i?.defaultMinWidth??-1/0,S=v?.maxWidth??i?.defaultMaxWidth??1/0,x=C.getActualWidth(),R=Math.max(Math.min(x,S),w);if(R!=x)C.setActualWidth(R,t,!0)}while(!g){g=!0;let C=e-ts(u);if(C<=0)for(let v of d){let w=n?.[v.getId()]?.minWidth??i?.defaultMinWidth??v.minWidth;v.setActualWidth(w,t,!0)}else{let v=C/ts(d),w=C;for(let S=d.length-1;S>=0;S--){let x=d[S],R=x.colId,P=f[R],D=n?.[R],O=D?.minWidth??i?.defaultMinWidth??P,A=D?.maxWidth??i?.defaultMaxWidth,_=Math.max(O??-1/0,x.getMinWidth()),oe=Math.min(A??1/0,x.getMaxWidth()),Y=Math.round(x.getActualWidth()*v);if(Y<_)Y=_,p(x),g=!1;else if(Y>oe)Y=oe,p(x),g=!1;else if(S===0)Y=w;x.setActualWidth(Y,t,!0),w-=Y}}}for(let C of h)C.fireColumnWidthChangedEvent(t);let m=o.visibleCols;if(m.setLeftValues(t),m.updateBodyWidths(),s)return;if(Ki(this.eventSvc,h,!0,t),r)vo(o,!1)}applyAutosizeStrategy(){let{gos:e,colDelayRenderSvc:t}=this.beans,s=e.get("autoSizeStrategy");if(s?.type!=="fitGridWidth"&&s?.type!=="fitProvidedWidth")return;setTimeout(()=>{if(!this.isAlive())return;let i=s.type;if(i==="fitGridWidth"){let{columnLimits:o,defaultMinWidth:r,defaultMaxWidth:n}=s,a=o?.map(({colId:l,minWidth:c,maxWidth:d})=>({key:l,minWidth:c,maxWidth:d}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:n,columnLimits:a})}else if(i==="fitProvidedWidth")this.sizeColumnsToFit(s.width,"sizeColumnsToFit");t?.revealColumns(i)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{if(!this.isAlive())return;let s="autosizeColumns";if(e)this.autoSizeCols({...t,source:s,colKeys:e});else this.autoSizeAllColumns({...t,source:s});this.beans.colDelayRenderSvc?.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(let e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function gE(e,t,s={}){let i=s.minWidth??e.getMinWidth();if(t<i)t=i;let o=s.maxWidth??e.getMaxWidth();if(t>o)t=o;return t}function eh({ctrlsSvc:e,scrollVisibleSvc:t}){let s=e.getGridBodyCtrl(),o=s.isVerticalScrollShowing()?t.getScrollbarWidth():0;return ni(s.eGridBody)-o}var th="ag-animate-autosize";function vo({ctrlsSvc:e,gos:t},s){if(!t.get("animateColumnResizing")||t.get("enableRtl")||!e.isAlive())return;let i=e.getGridBodyCtrl().eGridBody.classList;if(s)i.add(th);else i.remove(th)}var Qp={moduleName:"ColumnAutoSize",version:z,beans:[hE],apiFunctions:{sizeColumnsToFit:dE,autoSizeColumns:Zp,autoSizeAllColumns:uE},dependsOn:[hp],css:[cE]};var pE=class extends y{constructor(){super(...arguments);this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){let{allColumns:s,columnKeys:i,skipRowGroups:o,exportRowNumbers:r}=t,n=this.getColumnsToExport({allColumns:s,skipRowGroups:o,columnKeys:i,exportRowNumbers:r});return[this.prepareSession(n),this.prependContent(t),this.exportColumnGroups(t,n),this.exportHeaders(t,n),this.processPinnedTopRows(t,n),this.processRows(t,n),this.processPinnedBottomRows(t,n),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,s,i){let o=t.shouldRowBeSkipped||(()=>!1),n=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!n,l=this.colModel.pivotMode?i.leafGroup:!i.group,c=!!i.footer,d=i.allChildrenCount===1&&i.childrenAfterGroup?.length===1&&pw(this.gos,i);if(!l&&!c&&(t.skipRowGroups||d||a)||t.onlySelected&&!i.isSelected()||t.skipPinnedTop&&i.rowPinned==="top"||t.skipPinnedBottom&&i.rowPinned==="bottom"||i.stub)return;if(i.level===-1&&!l&&!c)return;if(o(I(this.gos,{node:i})))return;let g=e.onNewBodyRow(i);if(s.forEach((p,f)=>{g.onColumn(p,f,i)}),t.getCustomContentBelowRow){let p=t.getCustomContentBelowRow(I(this.gos,{node:i}));if(p)e.addCustomContent(p)}}appendContent(e){return(t)=>{let s=e.appendContent;if(s)t.addCustomContent(s);return t}}prependContent(e){return(t)=>{let s=e.prependContent;if(s)t.addCustomContent(s);return t}}prepareSession(e){return(t)=>(t.prepare(e),t)}exportColumnGroups(e,t){return(s)=>{if(!e.skipColumnGroupHeaders){let i=new mp,{colGroupSvc:o}=this.beans,r=o?o.createColumnGroups({columns:t,idCreator:i,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(r,s,e.processGroupHeaderCallback)}return s}}exportHeaders(e,t){return(s)=>{if(!e.skipColumnHeaders){let i=s.onNewHeaderRow();t.forEach((o,r)=>{i.onColumn(o,r,void 0)})}return s}}processPinnedTopRows(e,t){return(s)=>{let i=this.processRow.bind(this,s,e,t);if(e.rowPositions)e.rowPositions.filter((o)=>o.rowPinned==="top").sort((o,r)=>o.rowIndex-r.rowIndex).map((o)=>this.pinnedRowModel?.getPinnedTopRow(o.rowIndex)).forEach(i);else if(!this.pinnedRowModel?.isManual())this.pinnedRowModel?.forEachPinnedRow("top",i);return s}}processRows(e,t){return(s)=>{let i=this.rowModel,o=J(this.gos,i),r=Gs(this.gos,i),n=!o&&e.onlySelected,a=this.processRow.bind(this,s,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter((c)=>c.rowPinned==null).sort((c,d)=>c.rowIndex-d.rowIndex).map((c)=>i.getRow(c.rowIndex)).forEach(a);else if(this.colModel.pivotMode)if(o)i.forEachPivotNode(a,!0,l==="filteredAndSorted");else if(r)i.forEachNodeAfterFilterAndSort(a,!0);else i.forEachNode(a);else if(e.onlySelectedAllPages||n){let c=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(c),c.forEach(a)}else if(l==="all")i.forEachNode(a);else if(o||r)i.forEachNodeAfterFilterAndSort(a,!0);else i.forEachNode(a);return s}}replicateSortedOrder(e){let{sortSvc:t,rowNodeSorter:s}=this.beans;if(!t||!s)return;let i=t.getSortOptions(),o=(r,n)=>{if(r.rowIndex!=null&&n.rowIndex!=null)return r.rowIndex-n.rowIndex;if(r.level===n.level){if(r.parent?.id===n.parent?.id)return s.compareRowNodes(i,r,n)||(r.rowIndex??-1)-(n.rowIndex??-1);return o(r.parent,n.parent)}if(r.level>n.level)return o(r.parent,n);return o(r,n.parent)};e.sort(o)}processPinnedBottomRows(e,t){return(s)=>{let i=this.processRow.bind(this,s,e,t);if(e.rowPositions)e.rowPositions.filter((o)=>o.rowPinned==="bottom").sort((o,r)=>o.rowIndex-r.rowIndex).map((o)=>this.pinnedRowModel?.getPinnedBottomRow(o.rowIndex)).forEach(i);else if(!this.pinnedRowModel?.isManual())this.pinnedRowModel?.forEachPinnedRow("bottom",i);return s}}getColumnsToExport(e){let{allColumns:t=!1,skipRowGroups:s=!1,exportRowNumbers:i=!1,columnKeys:o}=e,{colModel:r,gos:n,visibleCols:a}=this,l=r.pivotMode,c=(h)=>{if(Zt(h))return!1;return!Oe(h)||i};if(o?.length)return r.getColsForKeys(o).filter(c);let d=n.get("treeData"),u;if(t&&!l)u=r.getCols();else u=a.allCols;return u=u.filter((h)=>c(h)&&(s&&!d?!gi(h):!0)),u}recursivelyAddHeaderGroups(e,t,s){let i=[];for(let o of e){let r=o;if(!r.getChildren)continue;for(let n of r.getChildren()??[])i.push(n)}if(e.length>0&&we(e[0]))this.doAddHeaderHeader(t,e,s);if(i&&i.length>0)this.recursivelyAddHeaderGroups(i,t,s)}doAddHeaderHeader(e,t,s){let i=e.onNewHeaderGroupingRow(),o=0;for(let r of t){let n=r,a;if(s)a=s(I(this.gos,{columnGroup:n}));else a=this.beans.colNames.getDisplayNameForColumnGroup(n,"header");let c=(n.isExpandable()?n.getLeafColumns():[]).reduce((d,u,h,g)=>{let p=k(d);if(u.getColumnGroupShow()!=="open"){if(p&&p[1]==null)p[1]=h-1}else if(!p||p[1]!=null)p=[h],d.push(p);if(h===g.length-1&&p&&p[1]==null)p[1]=h;return d},[]);i.onColumn(n,a||"",o++,n.getLeafColumns().length-1,c)}}},Hc={moduleName:"SharedExport",version:z,beans:[pE]};function Kn(e,t){let s=document.defaultView??window;if(!s)return;let i=document.createElement("a"),o=s.URL.createObjectURL(t);i.setAttribute("href",o),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:s})),i.remove(),s.setTimeout(()=>{s.URL.revokeObjectURL(o)},0)}var zc=class extends y{getFileName(e){let t=this.getDefaultFileExtension();if(!e?.length)e=this.getDefaultFileName();return e.includes(".")?e:`${e}.${t}`}getData(e){return this.beans.gridSerializer.serialize(this.createSerializingSession(e),e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},Wc=class{constructor(e){this.valueFrom="data";let{colModel:t,rowGroupColsSvc:s,colNames:i,valueSvc:o,gos:r,processCellCallback:n,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,valueFrom:d}=e;if(this.colModel=t,this.rowGroupColsSvc=s,this.colNames=i,this.valueSvc=o,this.gos=r,this.processCellCallback=n,this.processHeaderCallback=a,this.processGroupHeaderCallback=l,this.processRowGroupCallback=c,d)this.valueFrom=d}prepare(e){}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e){let{column:t,node:s,currentColumnIndex:i,accumulatedRowIndex:o,type:r,useRawFormula:n}=e,a=i===0&&tg(this.gos,s,this.colModel.pivotMode);if(this.processRowGroupCallback&&(this.gos.get("treeData")||s.group)&&(t.isRowGroupDisplayed(s.rowGroupColumn?.colId??"")||a))return{value:this.processRowGroupCallback(I(this.gos,{column:t,node:s}))??""};if(this.processCellCallback)return{value:this.processCellCallback(I(this.gos,{accumulatedRowIndex:o,column:t,node:s,value:this.valueSvc.getValueForDisplay({column:t,node:s,from:this.valueFrom}).value,type:r,parseValue:(p)=>this.valueSvc.parseValue(t,s,p,this.valueSvc.getValue(t,s,this.valueFrom)),formatValue:(p)=>this.valueSvc.formatValue(t,s,p)??p}))??""};let l=this.gos.get("treeData"),c=this.valueSvc,d=s.level===-1&&s.footer,u=t.colDef.showRowGroup===!0&&(s.group||l);if(!d&&(a||u)){let p="",f=s;while(f&&f.level!==-1){let{value:m,valueFormatted:C}=c.getValueForDisplay({column:a?void 0:t,node:f,includeValueFormatted:!0,exporting:!0,from:this.valueFrom});p=` -> ${C??m??""}${p}`,f=f.parent}return{value:p,valueFormatted:p}}let{value:h,valueFormatted:g}=c.getValueForDisplay({column:t,node:s,includeValueFormatted:!0,exporting:!0,useRawFormula:n,from:this.valueFrom});return{value:h??"",valueFormatted:g}}getHeaderName(e,t){if(e)return e(I(this.gos,{column:t}));return this.colNames.getDisplayNameForColumn(t,"csv",!0)}},sh=`\r
69
- `,fE=class extends Wc{constructor(e){super(e);this.config=e,this.isFirstLine=!0,this.result="";let{suppressQuotes:t,columnSeparator:s}=e;this.suppressQuotes=t,this.columnSeparator=s}addCustomContent(e){if(!e)return;if(typeof e==="string"){if(!/^\s*\n/.test(e))this.beginNewLine();e=e.replace(/\r?\n/g,sh),this.result+=e}else e.forEach((t)=>{this.beginNewLine(),t.forEach((s,i)=>{if(i!==0)this.result+=this.columnSeparator;if(this.result+=this.putInQuotes(s.data.value||""),s.mergeAcross)this.appendEmptyCells(s.mergeAcross)})})}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,s,i){if(s!=0)this.result+=this.columnSeparator;this.result+=this.putInQuotes(t),this.appendEmptyCells(i)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){if(t!=0)this.result+=this.columnSeparator;this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,s){if(t!=0)this.result+=this.columnSeparator;let i=this.extractRowCellValue({column:e,node:s,currentColumnIndex:t,accumulatedRowIndex:t,type:"csv",useRawFormula:!1});this.result+=this.putInQuotes(i.valueFormatted??i.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e===null||e===void 0)return'""';let t;if(typeof e==="string")t=e;else if(typeof e.toString==="function")t=e.toString();else F(53),t="";return'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){if(!this.isFirstLine)this.result+=sh;this.isFirstLine=!1}},mE=class extends zc{constructor(){super(...arguments);this.beanName="csvCreator"}getMergedParams(e){let t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){F(51);return}let t=()=>{let i=this.getMergedParams(e),o=this.getData(i),r=new Blob(["\uFEFF",o],{type:"text/plain"}),n=i.fileName,a=typeof n==="function"?n(I(this.gos,{})):n;Kn(this.getFileName(a),r)},{overlays:s}=this.beans;if(s)s.showExportOverlay(t);else t()}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){let s=t?Object.assign({},e):this.getMergedParams(e);return this.getData(s)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){let{colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:o,gos:r}=this.beans,{processCellCallback:n,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:d,columnSeparator:u,valueFrom:h}=e;return new fE({colModel:t,colNames:s,valueSvc:o,gos:r,processCellCallback:n||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:d||!1,columnSeparator:u||",",rowGroupColsSvc:i,valueFrom:h})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function CE(e,t){return e.csvCreator?.getDataAsCsv(t)}function vE(e,t){e.csvCreator?.exportDataAsCsv(t)}var Jp={moduleName:"CsvExport",version:z,beans:[mE],apiFunctions:{getDataAsCsv:CE,exportDataAsCsv:vE},dependsOn:[Hc]},ef=class extends xe{constructor(e,t){super();if(this.ctrl=e,t)this.beans=t}postConstruct(){this.refreshTooltip()}setBrowserTooltip(e,t){let i=this.ctrl.getGui();if(!i)return;if(e!=null&&(e!=""||t))i.setAttribute("title",e);else i.removeAttribute("title")}updateTooltipText(){let{getTooltipValue:e}=this.ctrl;if(e)this.tooltip=e()}createTooltipFeatureIfNeeded(){if(this.tooltipManager==null){let e=this.beans.registry.createDynamicBean("tooltipStateManager",!0,this.ctrl,()=>this.tooltip);if(e)this.tooltipManager=this.createBean(e,this.beans.context)}}attemptToShowTooltip(){this.tooltipManager?.prepareToShowTooltip()}attemptToHideTooltip(){this.tooltipManager?.hideTooltip()}setTooltipAndRefresh(e){this.tooltip=e,this.refreshTooltip()}refreshTooltip(e){if(this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips)this.setBrowserTooltip(this.tooltip),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context);else this.setBrowserTooltip(e?"":null,e),this.createTooltipFeatureIfNeeded()}destroy(){this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context),super.destroy()}},wE=1000,bE=1000,ih=100,oh,Gr=!1,SE=class extends xe{constructor(e,t){super();this.tooltipCtrl=e,this.getTooltipValue=t,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){if(this.gos.get("tooltipInteraction"))this.interactionEnabled=!0;this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");let e=this.tooltipCtrl.getGui();if(this.tooltipTrigger===0)this.addManagedListeners(e,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)});if(this.tooltipTrigger===1)this.addManagedListeners(e,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)});if(this.addManagedListeners(e,{mousemove:this.onMouseMove.bind(this)}),!this.interactionEnabled)this.addManagedListeners(e,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(e){let t=this.gos.get(e);return Math.max(200,t)}getTooltipDelay(e){return this.tooltipCtrl[`getTooltip${e}DelayOverride`]?.()??this.getGridOptionsTooltipDelay(`tooltip${e}Delay`)}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){let e=this.gos.get("tooltipTrigger");if(!e||e==="hover")return 0;return 1}onMouseEnter(e){if(this.interactionEnabled&&this.interactiveTooltipTimeoutId)this.unlockService(),this.startHideTimeout();if(os())return;if(Gr)this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},ih);else this.prepareToShowTooltip(e)}onMouseMove(e){if(this.lastMouseEvent)this.lastMouseEvent=e;if(this.tooltipMouseTrack&&this.state===2&&this.tooltipComp)this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){if(this.interactionEnabled)this.lockService();else this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){let t=e.relatedTarget,s=this.tooltipCtrl.getGui(),i=this.tooltipComp?.getGui();if(this.isInteractingWithTooltip||s.contains(t)||this.interactionEnabled&&i?.contains(t))return;this.setToDoNothing()}onKeyDown(){if(this.isInteractingWithTooltip)this.isInteractingWithTooltip=!1;this.setToDoNothing()}prepareToShowTooltip(e){if(this.state!=0||Gr)return;let t=0;if(e)t=this.isLastTooltipHiddenRecently()?this.getTooltipDelay("SwitchShow"):this.getTooltipDelay("Show");this.lastMouseEvent=e||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),t),this.state=1}isLastTooltipHiddenRecently(){return Date.now()-oh<wE}setToDoNothing(e){if(!e&&this.state===2)this.hideTooltip();if(this.onBodyScrollEventCallback)this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0;if(this.clearEventHandlers(),this.onDocumentKeyDownCallback)this.onDocumentKeyDownCallback(),this.onDocumentKeyDownCallback=void 0;this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){let e=this.getTooltipValue(),t=this.tooltipCtrl;if(!M(e)||t.shouldDisplayTooltip&&!t.shouldDisplayTooltip()){this.setToDoNothing();return}let s=this.gos.addCommon({location:t.getLocation?.()??"UNKNOWN",value:e,hideTooltipCallback:()=>this.hideTooltip(!0),...t.getAdditionalParams?.()});this.state=2,this.tooltipInstanceCount++;let i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.createTooltipComp(s,i)}hideTooltip(e){if(!e&&this.isInteractingWithTooltip)return;if(this.tooltipComp)this.destroyTooltipComp(),oh=Date.now();if(this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()}),e)this.isInteractingWithTooltip=!1;this.setToDoNothing(!0)}newTooltipComponentCallback(e,t){if(this.state!==2||this.tooltipInstanceCount!==e){this.destroyBean(t);return}let i=t.getGui();if(this.tooltipComp=t,!i.classList.contains("ag-tooltip"))i.classList.add("ag-tooltip-custom");if(this.tooltipTrigger===0)i.classList.add("ag-tooltip-animate");if(this.interactionEnabled)i.classList.add("ag-tooltip-interactive");let o=this.getLocaleTextFunc(),r=this.popupSvc?.addPopup({eChild:i,ariaLabel:o("ariaLabelTooltip","Tooltip")});if(r)this.tooltipPopupDestroyFunc=r.hideFunc;if(this.positionTooltip(),this.tooltipTrigger===1){let n=()=>this.setToDoNothing();[this.onBodyScrollEventCallback]=this.addManagedEventListeners({bodyScroll:n}),this.setEventHandlers(n)}if(this.interactionEnabled){if([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(i,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(ce(this.beans),{keydown:(n)=>{if(!i.contains(n?.target))this.onKeyDown()}}),this.tooltipTrigger===1)[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(i,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)})}this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:i,parentGui:this.tooltipCtrl.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){if(this.isTooltipFocused())return;this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){let e=this.tooltipComp?.getGui(),t=j(this.beans);return!!e&&e.contains(t)}onTooltipFocusOut(e){let t=this.tooltipCtrl.getGui();if(this.isTooltipFocused())return;if(this.isInteractingWithTooltip=!1,t.contains(e.relatedTarget))this.startHideTimeout();else this.hideTooltip()}positionTooltip(){let e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};if(this.lastMouseEvent)this.popupSvc?.positionPopupUnderMouseEvent({...e,mouseEvent:this.lastMouseEvent});else this.popupSvc?.positionPopupByComponent({...e,eventSource:this.tooltipCtrl.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");let e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,s=this.tooltipTrigger===0?bE:0;window.setTimeout(()=>{e(),this.destroyBean(t)},s),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){for(let e of[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener])if(e)e();this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){Gr=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},ih)}unlockService(){Gr=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("Hide"))}clearShowTimeout(){if(!this.showTooltipTimeoutId)return;window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0}clearHideTimeout(){if(!this.hideTooltipTimeoutId)return;window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0}clearInteractiveTimeout(){if(!this.interactiveTooltipTimeoutId)return;window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}},yE=class extends ef{constructor(e,t,s){super(e,s);this.highlightTracker=t,this.onHighlight=this.onHighlight.bind(this)}postConstruct(){super.postConstruct(),this.wireHighlightListeners()}wireHighlightListeners(){this.addManagedPropertyListener("tooltipTrigger",({currentValue:e})=>{this.setTooltipMode(e)}),this.setTooltipMode(this.gos.get("tooltipTrigger")),this.highlightTracker.addEventListener("itemHighlighted",this.onHighlight)}onHighlight(e){if(this.tooltipMode!==1)return;if(e.highlighted)this.attemptToShowTooltip();else this.attemptToHideTooltip()}setTooltipMode(e="focus"){this.tooltipMode=e==="focus"?1:0}destroy(){this.highlightTracker.removeEventListener("itemHighlighted",this.onHighlight),super.destroy()}},xE=class extends hc{constructor(){super({tag:"div",cls:"ag-tooltip"})}init(e){let{value:t}=e,s=this.getGui();s.textContent=zo(t);let i=e.location.replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase();s.classList.add(`ag-${i}-tooltip`)}},RE=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip),&:where(.ag-cell-formula-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}";function rh(e,t){return{top:e.top-t.top,left:e.left-t.left,right:e.right-t.left,bottom:e.bottom-t.top}}function wo(e,t,s,i=0){let[o,r]=s.split("-"),n=tf(e,r),a=FE(t,o),l=EE(o,r);return{x:n.x-a.x+l.dx*i,y:n.y-a.y+l.dy*i}}function tf(e,t){let s=(e.left+e.right)/2,i=(e.top+e.bottom)/2;switch(t){case"tl":return{x:e.left,y:e.top};case"tc":return{x:s,y:e.top};case"tr":return{x:e.right,y:e.top};case"l":return{x:e.left,y:i};case"c":return{x:s,y:i};case"r":return{x:e.right,y:i};case"bl":return{x:e.left,y:e.bottom};case"bc":return{x:s,y:e.bottom};case"br":return{x:e.right,y:e.bottom}}}function FE(e,t){return tf({top:0,left:0,right:e.width,bottom:e.height},t)}function EE(e,t){let s=nh(e),i=nh(t),o=ah(e),r=ah(t);return{dx:Math.sign(i-s),dy:Math.sign(r-o)}}function nh(e){let t=e.length===2?e[1]:e;if(t==="l")return-1;if(t==="r")return 1;return 0}function ah(e){if(e.length===1)return 0;if(e.startsWith("t"))return-1;if(e.startsWith("b"))return 1;return 0}var Or=0,PE=200,ME=class extends xe{constructor(){super(...arguments);this.beanName="popupSvc",this.popupList=[]}postConstruct(){this.addManagedEventListeners({stylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){let e=this.gos.get("popupParent");if(e)return e;return this.getDefaultPopupParent()}positionPopupUnderMouseEvent(e){let{ePopup:t,nudgeX:s,nudgeY:i,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:s,nudgeY:i,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,e.type,e.ePopup,null,e.mouseEvent)})}calculatePointerAlign(e){let t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){let{ePopup:t,nudgeX:s,nudgeY:i,keepWithinBounds:o,eventSource:r,alignSide:n="left",position:a="over",type:l}=e,c=r.getBoundingClientRect(),d=this.getParentRect();this.setAlignedTo(r,t);let u=()=>{let h=rh(c,d),g={width:t.offsetWidth,height:t.offsetHeight},p=n==="right";if(a==="over")return this.setAlignedStyles(t,"over"),wo(h,g,p?"tr-tr":"tl-tl");if(this.setAlignedStyles(t,"under"),this.shouldRenderUnderOrAbove(t,c,d,e.nudgeY||0)==="under")return wo(h,g,p?"tr-br":"tl-bl");let m=wo(h,g,p?"br-tr":"bl-tl");return m.y-=(i||0)*2,m};this.positionPopup({ePopup:t,nudgeX:s,nudgeY:i,keepWithinBounds:o,updatePosition:u,postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,l,t,r,null)})}positionPopupForMenu(e){let{eventSource:t,ePopup:s,event:i}=e,o=t.getBoundingClientRect(),r=this.getParentRect();this.setAlignedTo(t,s);let n=!1,a=()=>{let l=rh(o,r),c=this.keepXYWithinBounds(s,l.top,0),d=s.clientWidth>0?s.clientWidth:200;if(!n)s.style.minWidth=`${d}px`,n=!0;let h=r.right-r.left-d,g={width:d,height:s.offsetHeight},p=wo(l,g,"tl-tr").x-2,f=wo(l,g,"tr-tl").x,m;if(this.gos.get("enableRtl")){if(m=f,m<0)m=p,this.setAlignedStyles(s,"left");if(m>h)m=0,this.setAlignedStyles(s,"right")}else{if(m=p,m>h)m=f,this.setAlignedStyles(s,"right");if(m<0)m=0,this.setAlignedStyles(s,"left")}return{x:m,y:c}};this.positionPopup({ePopup:s,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,"subMenu",s,t,i instanceof MouseEvent?i:void 0)})}shouldRenderUnderOrAbove(e,t,s,i){let o=s.bottom-t.bottom,r=t.top-s.top,n=e.offsetHeight+i;if(o>n)return"under";if(r>n||r>o)return"above";return"under"}setAlignedStyles(e,t){let s=this.getPopupIndex(e);if(s===-1)return;let i=this.popupList[s],{alignedToElement:o}=i;if(!o)return;let r=["right","left","over","above","under"];for(let n of r)o.classList.remove(`ag-has-popup-positioned-${n}`),e.classList.remove(`ag-popup-positioned-${n}`);if(!t)return;o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`)}setAlignedTo(e,t){let s=this.getPopupIndex(t);if(s!==-1){let i=this.popupList[s];i.alignedToElement=e}}positionPopup(e){let{ePopup:t,keepWithinBounds:s,nudgeX:i,nudgeY:o,skipObserver:r,updatePosition:n}=e,a={width:0,height:0},l=(c=!1)=>{let{x:d,y:u}=n();if(c&&t.clientWidth===a.width&&t.clientHeight===a.height)return;if(a.width=t.clientWidth,a.height=t.clientHeight,i)d+=i;if(o)u+=o;if(s)d=this.keepXYWithinBounds(t,d,1),u=this.keepXYWithinBounds(t,u,0);if(t.style.left=`${d}px`,t.style.top=`${u}px`,e.postProcessCallback)e.postProcessCallback()};if(l(),!r){let c=It(this.beans,t,()=>l(!0));setTimeout(()=>c(),PE)}}getParentRect(){let e=ce(this.beans),t=this.getPopupParent();if(t===e.body)t=e.documentElement;else if(getComputedStyle(t).position==="static")t=t.offsetParent;return Dh(t)}keepXYWithinBounds(e,t,s){let i=s===0,o=i?"clientHeight":"clientWidth",r=i?"top":"left",n=i?"height":"width",a=i?"scrollTop":"scrollLeft",l=ce(this.beans),c=l.documentElement,d=this.getPopupParent(),u=e.getBoundingClientRect(),h=d.getBoundingClientRect(),g=l.documentElement.getBoundingClientRect(),p=d===l.body,f=Math.ceil(u[n]),C=p?(i?Th:Yr)(c)+c[a]:d[o];if(p)C-=Math.abs(g[r]-h[r]);let v=C-f;return Math.min(Math.max(t,0),Math.max(v,0))}addPopup(e){let{eChild:t,ariaLabel:s,ariaOwns:i,alwaysOnTop:o,positionCallback:r,anchorToElement:n}=e,a=this.getPopupIndex(t);if(a!==-1)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(t);let l=this.createPopupWrapper(t,!!o,s,i),c=this.addEventListenersToPopup({...e,wrapperEl:l});if(r)r();return this.addPopupToPopupList(t,l,c,n),{hideFunc:c}}initialisePopupPosition(e){let s=this.getPopupParent().getBoundingClientRect();if(!M(e.style.top))e.style.top=`${s.top*-1}px`;if(!M(e.style.left))e.style.left=`${s.left*-1}px`}createPopupWrapper(e,t,s,i){let o=this.getPopupParent(),{environment:r,gos:n}=this.beans,a=me({tag:"div"});if(r.applyThemeClasses(a),a.classList.add("ag-popup"),e.classList.add(n.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),!e.hasAttribute("role"))ge(e,"dialog");if(s)fe(e,s);else if(i)e.id||(e.id=`popup-component-${Or}`),eu(i,e.id);if(a.appendChild(e),o.appendChild(a),t)this.setAlwaysOnTop(e,!0);else this.bringPopupToFront(e);return a}addEventListenersToPopup(e){let t=this.beans,s=ce(t),{wrapperEl:i,eChild:o,closedCallback:r,afterGuiAttached:n,closeOnEsc:a,modal:l,ariaOwns:c}=e,d=!1,u=(f)=>{if(!i.contains(j(t)))return;if(f.key===b.ESCAPE&&!this.isStopPropagation(f))p({keyboardEvent:f})},h=(f)=>p({mouseEvent:f}),g=(f)=>p({touchEvent:f}),p=(f={})=>{let{mouseEvent:m,touchEvent:C,keyboardEvent:v,forceHide:w}=f;if(!w&&(this.isEventFromCurrentPopup({mouseEvent:m,touchEvent:C},o)||d))return;if(d=!0,i.remove(),s.removeEventListener("keydown",u),s.removeEventListener("mousedown",h),s.removeEventListener("touchstart",g),s.removeEventListener("contextmenu",h),this.eventSvc.removeListener("dragStarted",h),r)r(m||C||v);this.removePopupFromPopupList(o,c)};if(n)n({hidePopup:p});return window.setTimeout(()=>{if(a)s.addEventListener("keydown",u);if(l)s.addEventListener("mousedown",h),this.eventSvc.addListener("dragStarted",h),s.addEventListener("touchstart",g),s.addEventListener("contextmenu",h)},0),p}addPopupToPopupList(e,t,s,i){if(this.popupList.push({element:e,wrapper:t,hideFunc:s,instanceId:Or,isAnchored:!!i}),i)this.setPopupPositionRelatedToElement(e,i);Or=Or+1}getPopupIndex(e){return this.popupList.findIndex((t)=>t.element===e)}setPopupPositionRelatedToElement(e,t){let s=this.getPopupIndex(e);if(s===-1)return;let i=this.popupList[s];if(i.stopAnchoringPromise)i.stopAnchoringPromise.then((r)=>r?.());if(i.stopAnchoringPromise=void 0,i.isAnchored=!1,!t)return;let o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:i.hideFunc});return i.stopAnchoringPromise=o,i.isAnchored=!0,o}removePopupFromPopupList(e,t){if(this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),t)eu(t,null);this.popupList=this.popupList.filter((s)=>s.element!==e)}keepPopupPositionedRelativeTo(e){let t=this.getPopupParent(),s=t.getBoundingClientRect(),{element:i,ePopup:o}=e,r=i.getBoundingClientRect(),n=(u)=>Number.parseInt(u.substring(0,u.length-1),10),a=(u,h)=>{let g=s[u]-r[u],p=n(o.style[u]);return{initialDiff:g,lastDiff:g,initial:p,last:p,direction:h}},l=a("top",0),c=a("left",1),d=this.beans.frameworkOverrides;return new B((u)=>{d.wrapIncoming(()=>{_w(()=>{let h=t.getBoundingClientRect(),g=i.getBoundingClientRect();if(g.top==0&&g.left==0&&g.height==0&&g.width==0){e.hidePopup();return}let f=(m,C)=>{let v=n(o.style[C]);if(m.last!==v)m.initial=v,m.last=v;let w=h[C]-g[C];if(w!=m.lastDiff){let S=this.keepXYWithinBounds(o,m.initial+m.initialDiff-w,m.direction);o.style[C]=`${S}px`,m.last=S}m.lastDiff=w};f(l,"top"),f(c,"left")},200).then((h)=>{u(()=>{if(h!=null)window.clearInterval(h)})})},"popupPositioning")})}isEventFromCurrentPopup(e,t){let{mouseEvent:s,touchEvent:i}=e,o=s?s:i;if(!o)return!1;let r=this.getPopupIndex(t);if(r===-1)return!1;for(let n=r;n<this.popupList.length;n++){let a=this.popupList[n];if(xn(a.element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){let t=ce(this.beans);while(e&&e!==t.body){if(e.classList.contains("ag-custom-component-popup")||e.parentElement===null)return!0;e=e.parentElement}return!1}getWrapper(e){while(!e.classList.contains("ag-popup")&&e.parentElement)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){let s=this.getWrapper(e);if(!s)return;if(s.classList.toggle("ag-always-on-top",!!t),t)this.bringPopupToFront(s)}bringPopupToFront(e){let t=this.getPopupParent(),s=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),i=s.length,o=this.getWrapper(e);if(!o||i<=1||!t.contains(e))return;let r=[],n=[];for(let h of s){if(h===o)continue;if(h.classList.contains("ag-always-on-top"))n.push(h);else r.push(h)}let a=[],l=n.length,u=o.classList.contains("ag-always-on-top")||!l?[...r,...n,o]:[...r,o,...n];for(let h=0;h<=i;h++){let g=u[h];if(s[h]===u[h]||g===o)continue;let p=g.querySelectorAll("div");for(let f of p)if(f.scrollTop!==0)a.push([f,f.scrollTop]);if(h===0)t.prepend(g);else u[h-1].after(g)}while(a.length){let h=a.pop();h[0].scrollTop=h[1]}}handleThemeChange(e){if(e.themeChanged){let t=this.beans.environment;for(let s of this.popupList)t.applyThemeClasses(s.wrapper)}}},TE=class extends ME{getDefaultPopupParent(){return this.beans.ctrlsSvc.get("gridCtrl").getGui()}callPostProcessPopup(e,t,s,i,o){let r=this.gos.getCallback("postProcessPopup");if(r){let{column:n,rowNode:a}=e??{};r({column:n,rowNode:a,ePopup:s,type:t,eventSource:i,mouseEvent:o})}}getActivePopups(){return this.popupList.map((e)=>e.element)}hasAnchoredPopup(){return this.popupList.some((e)=>e.isAnchored)}isStopPropagation(e){return ut(e)}},Ci={moduleName:"Popup",version:z,beans:[TE]};function ji(e){return e.get("tooltipShowMode")==="whenTruncated"}function so(e,t){return ji(e)?Hi(t):void 0}var DE=(e,t)=>{let s=e;if(typeof s.getTranslatedMessage==="function")return s.getTranslatedMessage(t);return e.message},Fl=(e,t,s)=>{let{editModelSvc:i}=e,o=i?.getCellValidationModel()?.getCellValidation(t)?.errorMessages,r=i?.getRowValidationModel().getRowValidation(t)?.errorMessages,n=o||r;return n?.length?n.join(s("tooltipValidationErrorSeparator",". ")):void 0},AE=(e,t)=>{if(!ji(e.gos))return;if(t.isCellRenderer()){let i=t.column.colDef;if(!(!!i.showRowGroup||i.cellRenderer==="agGroupCellRenderer"))return;return Hi(()=>{let r=t.eGui;return r.querySelector(".ag-group-value")||r.querySelector(".ag-cell-value")||r})}return Hi(()=>{let i=t.eGui;return i.children.length===0?i:i.querySelector(".ag-cell-value")})},IE=(e,t,s)=>{let{editSvc:i}=e,{column:o}=t,r=AE(e,t),n=()=>{if(i?.isEditing(t))return!1;if(!r)return!0;if(!o.isTooltipEnabled())return!1;return r()};return{shouldDisplayDefault:n,shouldDisplayColumnTooltip:n,shouldDisplayCustomTooltip:s??n}},kE=({beans:e,ctrl:t,value:s,displayFunctions:i,translate:o})=>{let{editSvc:r,formula:n,gos:a}=e,{column:l,rowNode:c}=t,d=l.colDef;if(d.allowFormula&&n?.active){let m=n.getFormulaError(l,c);if(m)return{value:DE(m,o),location:"cellFormula",shouldDisplay:()=>!!n?.getFormulaError(l,c)}}if(!r?.isEditing(t)){let m=Fl(e,t,o);if(m)return{value:m,location:"cellEditor",shouldDisplay:()=>!r?.isEditing(t)&&!!Fl(e,t,o)}}let{shouldDisplayCustomTooltip:h,shouldDisplayColumnTooltip:g}=i;if(s!=null)return{value:s,location:"cell",shouldDisplay:h};let p=c.data;if(d.tooltipField&&M(p)){let m=d.tooltipField;return{value:l.isTooltipFieldContainsDots()?Fo(p,m):p[m],location:"cell",shouldDisplay:g}}let f=d.tooltipValueGetter;if(f)return{value:f(I(a,{location:"cell",colDef:l.colDef,column:l,rowIndex:t.cellPosition.rowIndex,node:c,data:c.data,value:t.value,valueFormatted:t.valueFormatted})),location:"cell",shouldDisplay:g};return null},LE=class extends y{constructor(){super(...arguments);this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,s,i){if(e)t.destroyBean(e);if(!t.isAlive())return;let o=this.gos,r=ji(o),{column:n,eGui:a}=t,l=n.colDef;if(!i&&r&&!l.headerComponent)i=Hi(()=>a.querySelector(".ag-header-cell-text"));let c="header",d="header",u=this.beans.colNames.getDisplayNameForColumn(n,d,!0),h=s??u,g={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>s??l?.headerTooltipValueGetter?.(I(o,{location:c,colDef:l,column:n,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:i,getAdditionalParams:()=>({column:n,colDef:n.colDef})},p=this.createTooltipFeature(g);if(p)p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip());return p}setupHeaderGroupTooltip(e,t,s,i){if(e)t.destroyBean(e);if(!t.isAlive())return;let o=this.gos,r=ji(o),{column:n,eGui:a}=t,l=n.getColGroupDef();if(!i&&r&&!l?.headerGroupComponent)i=Hi(()=>a.querySelector(".ag-header-group-text"));let c="headerGroup",d="header",u=this.beans.colNames.getDisplayNameForColumnGroup(n,d),h=s??u,g={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>s??l?.headerTooltipValueGetter?.(I(o,{location:c,colDef:l,column:n,value:h,valueFormatted:u}))??l?.headerTooltip,shouldDisplayTooltip:i,getAdditionalParams:()=>{let f={column:n};if(l)f.colDef=l;return f}},p=this.createTooltipFeature(g);return p?t.createBean(p):p}enableCellTooltipFeature(e,t,s){let{beans:i}=this,{column:o,rowNode:r}=e,n=IE(i,e,s),a=this.getLocaleTextFunc(),l=null,c=()=>(l=kE({beans:i,ctrl:e,value:t,displayFunctions:n,translate:a}),l),u={getGui:()=>e.eGui,getLocation:()=>l?.location??"cell",getTooltipValue:()=>c()?.value,shouldDisplayTooltip:()=>{let h=l??c();if(!h)return!1;return h.shouldDisplay?h.shouldDisplay():!0},getAdditionalParams:()=>({column:o,colDef:o.colDef,rowIndex:e.cellPosition.rowIndex,node:r,data:r.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(u,i)}setupFullWidthRowTooltip(e,t,s,i){let o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>s,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i},r=this.beans,n=r.context;if(e)t.destroyBean(e,n);let a=this.createTooltipFeature(o,r);if(!a)return;return t.createBean(a,n)}setupCellEditorTooltip(e,t){let{beans:s}=this,{context:i}=s,o=t.getValidationElement?.(!0)||!t.isPopup?.()&&e.eGui;if(!o)return;let r={getGui:()=>o,getTooltipValue:()=>Fl(s,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{let{editModelSvc:a}=s,l=a?.getRowValidationModel()?.getRowValidationMap(),c=a?.getCellValidationModel()?.getCellValidationMap(),d=!!l&&l.size>0,u=!!c&&c.size>0;return d||u}},n=this.createTooltipFeature(r,s);if(!n)return;return e.createBean(n,i)}initCol(e){let{colDef:t}=e;e.tooltipEnabled=M(t.tooltipField)||M(t.tooltipValueGetter)||M(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},GE=class extends SE{createTooltipComp(e,t){mb(this.beans.userCompFactory,e)?.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}},OE={moduleName:"Tooltip",version:z,beans:[LE],dynamicBeans:{tooltipFeature:ef,highlightTooltipFeature:yE,tooltipStateManager:GE},userComponents:{agTooltipComponent:xE},dependsOn:[Ci],css:[RE]};var BE=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) .ag-text-area-input{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}";var io=class extends Ai{constructor(e,t="ag-text-field",s="text"){super(e,t,s)}postConstruct(){if(super.postConstruct(),this.config.allowedCharPattern)this.preventDisallowedCharacters()}setValue(e,t){let s=this.eInput;if(s.value!==e)s.value=M(e)?e:"";return super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}setCustomValidity(e){let t=this.eInput,s=e.length>0;if(t.setCustomValidity(e),s)t.reportValidity();Vl(t,s)}preventDisallowedCharacters(){let e=new RegExp(`[${this.config.allowedCharPattern}]`),t=(s)=>{if(!Yg(s))return;if(s.key&&!e.test(s.key))s.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:(s)=>{if(s.clipboardData?.getData("text")?.split("").some((o)=>!e.test(o)))s.preventDefault()}})}},us={selector:"AG-INPUT-TEXT-FIELD",component:io};var VE=class extends Fb{constructor(e){super();this.cellEditorInput=e,this.eEditor=E}initialiseEditor(e){let{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());let{eEditor:s}=this,{cellStartedEdit:i,eventKey:o,suppressPreventDefault:r}=e;s.getInputElement().setAttribute("title",""),t.init(s,e);let n,a=!0;if(i){if(this.focusAfterAttached=!0,o===b.BACKSPACE||o===b.DELETE)n="";else if(o?.length===1)if(r)a=!1;else n=o;else if(n=t.getStartValue(),o!==b.F2)this.highlightAllOnFocus=!0}else this.focusAfterAttached=!1,n=t.getStartValue();if(a&&n!=null)s.setStartValue(n);this.addGuiEventListener("keydown",(l)=>{let{key:c}=l;if(c===b.PAGE_UP||c===b.PAGE_DOWN)l.preventDefault()})}afterGuiAttached(){let e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;if(!Os())t.getFocusableElement().focus();let s=t.getInputElement();if(this.highlightAllOnFocus)s.select();else this.cellEditorInput.setCaret?.()}focusIn(){let{eEditor:e}=this,t=e.getFocusableElement(),s=e.getInputElement();t.focus(),s.select()}getValue(){return this.cellEditorInput.getValue()}agSetEditValue(e){this.params.value=e;let t=this.cellEditorInput.getStartValue();this.eEditor.setStartValue(t??null)}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}};var sf=class extends io{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct();let e=this.eInput;this.addManagedListeners(e,{blur:()=>{let r=Number.parseFloat(e.value),n=isNaN(r)?"":this.normalizeValue(r.toString());if(this.value!==n)this.setValue(n)},wheel:this.onWheel.bind(this)}),e.step="any";let{precision:t,min:s,max:i,step:o}=this.config;if(typeof t==="number")this.setPrecision(t);if(typeof s==="number")this.setMin(s);if(typeof i==="number")this.setMax(i);if(typeof o==="number")this.setStep(o)}onWheel(e){if(j(this.beans)===this.eInput)e.preventDefault()}normalizeValue(e){if(e==="")return"";if(this.precision!=null)e=this.adjustPrecision(e);return e}adjustPrecision(e,t){let s=this.precision;if(s==null)return e;if(t){let o=Number.parseFloat(e).toFixed(s);return Number.parseFloat(o).toString()}let i=String(e).split(".");if(i.length>1){if(i[1].length<=s)return e;else if(s>0)return`${i[0]}.${i[1].slice(0,s)}`}return i[0]}setMin(e){if(this.min===e)return this;return this.min=e,Mt(this.eInput,"min",e),this}setMax(e){if(this.max===e)return this;return this.max=e,Mt(this.eInput,"max",e),this}setPrecision(e){return this.precision=e,this}setStep(e){if(this.step===e)return this;return this.step=e,Mt(this.eInput,"step",e),this}setValue(e,t){return this.setValueOrInputValue((s)=>super.setValue(s,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue((t)=>super.setValue(t,!0),(t)=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,s){if(M(s)){let i=this.isScientificNotation(s);if(i&&this.eInput.validity.valid)return e(s);if(!i){s=this.adjustPrecision(s);let o=this.normalizeValue(s);i=s!=o}if(i)return t(s)}return e(s)}getValue(e=!1){let t=this.eInput;if(!t.validity.valid&&!e)return;let s=t.value;if(this.isScientificNotation(s))return this.adjustPrecision(s,!0);return super.getValue()}isScientificNotation(e){return typeof e==="string"&&e.includes("e")}};var NE=".ag-list-item{align-items:center;display:flex;height:var(--ag-list-item-height);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}",_E="ag-active-item",HE=(e,t)=>({tag:"div",cls:`ag-list-item ag-${e}-list-item`,attrs:{role:"option"},children:[{tag:"span",cls:`ag-list-item-text ag-${e}-list-item-text`,ref:"eText",children:t}]}),zE=class extends Le{constructor(e,t,s){super(HE(e,t));this.label=t,this.value=s,this.eText=E}postConstruct(){this.createTooltip(),this.addEventListeners()}setHighlighted(e){let t=this.getGui();t.classList.toggle(_E,e),Sn(t,e),this.dispatchLocalEvent({type:"itemHighlighted",highlighted:e})}getHeight(){return this.getGui().clientHeight}setIndex(e,t){let s=this.getGui();Uo(s,e),Wo(s,t)}createTooltip(){let e={getTooltipValue:()=>this.label,getGui:()=>this.getGui(),getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>Lh(this.eText)},t=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("highlightTooltipFeature",!1,e,this));if(t)this.tooltipFeature=t}addEventListeners(){let e=this.getParentComponent();if(!e)return;this.addGuiEventListener("mouseover",()=>{e.highlightItem(this)}),this.addGuiEventListener("mousedown",(t)=>{t.preventDefault(),t.stopPropagation(),e.setValue(this.value)})}},WE=class extends Le{constructor(e="default"){super({tag:"div",cls:`ag-list ag-${e}-list`});this.cssIdentifier=e,this.options=[],this.listItems=[],this.highlightedItem=null,this.registerCSS(NE)}postConstruct(){let e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()})}handleKeyDown(e){let t=e.key;switch(t){case b.ENTER:if(!this.highlightedItem)this.setValue(this.getValue());else{let s=this.listItems.indexOf(this.highlightedItem);this.setValueByIndex(s)}break;case b.DOWN:case b.UP:e.preventDefault(),this.navigate(t);break;case b.PAGE_DOWN:case b.PAGE_UP:case b.PAGE_HOME:case b.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}addOptions(e){for(let t of e)this.addOption(t);return this}addOption(e){let{value:t,text:s}=e,i=s??t;return this.options.push({value:t,text:i}),this.renderOption(t,i),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0);for(let e of this.listItems)e.destroy();te(this.getGui()),this.listItems=[],this.refreshAriaRole()}updateOptions(e){let t=this.options!==e;if(t)this.clearOptions(),this.addOptions(e);return t}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;let s=this.options.findIndex((i)=>i.value===e);if(s!==-1){let i=this.options[s];if(this.value=i.value,this.displayValue=i.text,this.highlightItem(this.listItems[s]),!t)this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();let e=this.options.findIndex((t)=>t.value===this.value);if(e!==-1)this.highlightItem(this.listItems[e])}highlightItem(e){let t=e.getGui();if(!ve(t))return;this.clearHighlighted(),e.setHighlighted(!0),this.highlightedItem=e;let s=this.getGui(),{scrollTop:i,clientHeight:o}=s,{offsetTop:r,offsetHeight:n}=t;if(r+n>i+o||r<i)t.scrollIntoView({block:"nearest"})}hideItemTooltip(){this.highlightedItem?.tooltipFeature?.attemptToHideTooltip()}destroy(){this.hideItemTooltip(),super.destroy()}reset(e){if(this.value=null,this.displayValue=null,this.clearHighlighted(),!e)this.fireChangeEvent()}clearHighlighted(){this.highlightedItem?.setHighlighted(!1),this.highlightedItem=null}renderOption(e,t){let s=new zE(this.cssIdentifier,t,e);s.setParentComponent(this);let i=this.createManagedBean(s);this.listItems.push(i),this.getGui().appendChild(i.getGui())}navigate(e){let t=e===b.DOWN,s,{listItems:i,highlightedItem:o}=this;if(!o)s=t?i[0]:k(i);else{let n=i.indexOf(o)+(t?1:-1);n=Math.min(Math.max(n,0),i.length-1),s=i[n]}this.highlightItem(s)}navigateToPage(e){let{listItems:t,highlightedItem:s}=this;if(!s||t.length===0)return;let i=t.indexOf(s),o=this.options.length-1,r=t[0].getHeight(),n=Math.floor(this.getGui().clientHeight/r),a=-1;if(e===b.PAGE_HOME)a=0;else if(e===b.PAGE_END)a=o;else if(e===b.PAGE_DOWN)a=Math.min(i+n,o);else if(e===b.PAGE_UP)a=Math.max(i-n,0);if(a===-1)return;this.highlightItem(t[a])}refreshAriaRole(){ge(this.getGui(),this.options.length===0?"presentation":"listbox")}updateIndices(){this.refreshAriaRole();let e=this.listItems,t=e.length;e.forEach((s,i)=>{s.setIndex(i+1,t)})}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},UE=".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-picker-button-background-color);border:var(--ag-picker-button-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}}.ag-picker-field-wrapper:where(.ag-picker-has-focus),.ag-picker-field-wrapper:where(:focus-within){background-color:var(--ag-picker-button-focus-background-color);border:var(--ag-picker-button-focus-border);box-shadow:var(--ag-focus-shadow);&:where(.invalid){box-shadow:var(--ag-focus-error-shadow)}}.ag-picker-field-wrapper:disabled{opacity:.5}",KE={tag:"div",cls:"ag-picker-field",role:"presentation",children:[{tag:"div",ref:"eLabel"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-picker-field-wrapper ag-picker-collapsed",children:[{tag:"div",ref:"eDisplayField",cls:"ag-picker-field-display"},{tag:"div",ref:"eIcon",cls:"ag-picker-field-icon",attrs:{"aria-hidden":"true"}}]}]},$E=class extends bp{constructor(e){super(e,e?.template||KE,e?.agComponents||[],e?.className);if(this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=E,this.eWrapper=E,this.eDisplayField=E,this.eIcon=E,this.registerCSS(UE),this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;let{pickerGap:t,maxPickerHeight:s,variableWidth:i,minPickerWidth:o,maxPickerWidth:r}=e;if(t!=null)this.pickerGap=t;if(this.variableWidth=!!i,s!=null)this.setPickerMaxHeight(s);if(o!=null)this.setPickerMinWidth(o);if(r!=null)this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();let e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);let t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});let{pickerIcon:s,inputWidth:i}=this.config;if(s){let o=this.beans.iconSvc.createIconNoSpan(s);if(o)this.eIcon.appendChild(o)}if(i!=null)this.setInputWidth(i)}setupAria(){let e=this.getAriaElement();if(e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),De(e,!1),this.ariaRole)ge(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){let t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}if(this.isDisabled())return;if(this.isPickerDisplayed)this.hidePicker();else this.showPicker()}onKeyDown(e){switch(e.key){case b.UP:case b.DOWN:case b.ENTER:case b.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case b.ESCAPE:if(this.isPickerDisplayed){if(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker)this.hideCurrentPicker()}break}}showPicker(){if(this.isPickerDisplayed=!0,!this.pickerComponent)this.pickerComponent=this.createPickerComponent();let e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){let e=this.pickerComponent.getGui();if(!this.gos.get("suppressScrollWhenPopupsAreOpen"))[this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}});let t=this.getLocaleTextFunc(),{config:{pickerAriaLabelKey:s,pickerAriaLabelValue:i,modalPicker:o=!0},maxPickerHeight:r,minPickerWidth:n,maxPickerWidth:a,variableWidth:l,beans:c,eWrapper:d}=this,u={modal:o,eChild:e,closeOnEsc:!0,closedCallback:()=>{let f=ks(c);if(this.beforeHidePicker(),f&&this.isAlive())this.getFocusableElement().focus()},ariaLabel:t(s,i),anchorToElement:d};e.style.position="absolute";let h=c.popupSvc,g=h.addPopup(u);if(l){if(n)e.style.minWidth=n;if(e.style.width=Wl(Yr(d)),a)e.style.maxWidth=a}else Qr(e,a??Yr(d));let p=r??`${Ko(h.getPopupParent())}px`;return e.style.setProperty("max-height",p),this.alignPickerToComponent(),g.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;let{pickerGap:e,config:{pickerType:t},beans:{popupSvc:s,gos:i},eWrapper:o,pickerComponent:r}=this,n=i.get("enableRtl")?"right":"left";s.positionPopupByComponent({type:t,eventSource:o,ePopup:r.getGui(),position:"under",alignSide:n,keepWithinBounds:!0,nudgeY:e})}beforeHidePicker(){if(this.destroyMouseWheelFunc)this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0;this.toggleExpandedStyles(!1);let e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;let t=this.getAriaElement();De(t,e);let s=this.eWrapper.classList;s.toggle("ag-picker-expanded",e),s.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){if(!this.pickerComponent?.getGui().contains(e.relatedTarget))this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){if(!this.pickerComponent)return;this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){if(this.hideCurrentPicker)this.hideCurrentPicker(),this.dispatchLocalEvent({type:"pickerHidden"})}setInputWidth(e){return Qr(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){if(typeof e==="number")e=`${e}px`;return this.minPickerWidth=e==null?void 0:e,this}setPickerMaxWidth(e){if(typeof e==="number")e=`${e}px`;return this.maxPickerWidth=e==null?void 0:e,this}setPickerMaxHeight(e){if(typeof e==="number")e=`${e}px`;return this.maxPickerHeight=e==null?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}},jE=".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}.ag-select:where(:not(.ag-cell-editor,.ag-label-align-top)){min-height:var(--ag-list-item-height)}:where(.ag-select){.ag-picker-field-wrapper{cursor:default;padding-left:var(--ag-spacing);padding-right:var(--ag-spacing)}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}.ag-select-list{background-color:var(--ag-picker-list-background-color);border:var(--ag-picker-list-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}:where(.ag-ltr) .ag-select-list-item{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-select-list-item{padding-right:var(--ag-spacing)}.ag-select-list-item-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",qE=class extends $E{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"selectOpen",ariaRole:"combobox",...e});this.registerCSS(jE)}postConstruct(){this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{shouldDisplayTooltip:Hi(()=>this.eDisplayField),getGui:()=>this.getGui()})),super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");let{options:e,value:t,placeholder:s}=this.config;if(e!=null)this.addOptions(e);if(t!=null)this.setValue(t,!0);if(s&&t==null)this.eDisplayField.textContent=s;this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){if(!this.eWrapper.contains(e.relatedTarget))this.hidePicker()}createListComponent(){let e=this.createBean(new WE("select"));this.listComponent=e,e.setParentComponent(this);let t=e.getAriaElement(),s=`ag-select-list-${e.getCompId()}`;t.setAttribute("id",s),Nl(this.getAriaElement(),t),e.addManagedElementListeners(e.getGui(),{mousedown:(i)=>{i?.preventDefault()}}),e.addManagedListeners(e,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})},fieldValueChanged:()=>{if(!this.listComponent)return;this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker()}})}createPickerComponent(){return this.listComponent}beforeHidePicker(){this.listComponent?.hideItemTooltip(),super.beforeHidePicker()}onKeyDown(e){let{key:t}=e;if(t===b.TAB)this.hidePicker();switch(t){case b.ENTER:case b.UP:case b.DOWN:case b.PAGE_UP:case b.PAGE_DOWN:case b.PAGE_HOME:case b.PAGE_END:if(e.preventDefault(),this.isPickerDisplayed)this.listComponent?.handleKeyDown(e);else super.onKeyDown(e);break;case b.ESCAPE:super.onKeyDown(e);break;case b.SPACE:if(this.isPickerDisplayed)e.preventDefault();else super.onKeyDown(e);break}}showPicker(){let e=this.listComponent;if(!e)return;super.showPicker(),e.refreshHighlighted()}addOptions(e){for(let t of e)this.addOption(t);return this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this.setValue(void 0,!0),this}updateOptions(e){if(this.listComponent?.updateOptions(e))this.setValue(void 0,!0);return this}setValue(e,t,s){let{listComponent:i,config:{placeholder:o},eDisplayField:r,tooltipFeature:n}=this;if(this.value===e||!i)return this;if(!s)i.setValue(e,!0);if(i.getValue()===this.getValue())return this;let l=i.getDisplayValue();if(l==null&&o)l=o;return r.textContent=l,n?.setTooltipAndRefresh(l??null),super.setValue(e,t)}destroy(){this.listComponent=this.destroyBean(this.listComponent),super.destroy()}};var YE={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},XE=class{constructor(e){this.getLocaleTextFunc=e,this.cachedRaw=this}getTemplate(){return YE}getAgComponents(){return[us]}init(e,t){this.eEditor=e,this.params=t;let s=t.maxLength;if(s!=null)e.setMaxLength(s)}getValidationErrors(){let{params:e}=this,{maxLength:t,getValidationErrors:s}=e,i=this.getValue(),o=this.getLocaleTextFunc(),r=[];if(t!=null&&typeof i==="string"&&i.length>t)r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)]));if(!r.length)r=null;if(s)return s({value:i,cellEditorParams:e,internalErrors:r});return r}getValue(){let{eEditor:e,params:t}=this,s=e.getValue();if(!M(s)&&!M(t.value))return t.value;if(Object.is(this.cachedRaw,s))return this.cachedParsed;let i=t.parseValue(s);return this.cachedRaw=s,this.cachedParsed=i,i}getStartValue(){let e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){if(Os())this.eEditor.getInputElement().focus({preventScroll:!0});let e=this.eEditor,t=e.getValue(),s=M(t)&&t.length||0;if(s)e.getInputElement().setSelectionRange(s,s)}},lh=class extends VE{constructor(){super(new XE(()=>this.getLocaleTextFunc()))}};function ZE(e,t){return e.editModelSvc?.getEditRowDataValue(t,{checkSiblings:!0})}function QE(e){let t=e.editModelSvc?.getEditMap(),s=[];return t?.forEach((i,o)=>{let{rowIndex:r,rowPinned:n}=o;i.forEach((a,l)=>{let{editorValue:c,pendingValue:d,sourceValue:u,state:h}=a,g=Tt(a),p=c??d;if(p===ke)p=void 0;let f={newValue:p,oldValue:u,state:h,column:l,colId:l.getColId(),colKey:l.getColId(),rowIndex:r,rowPinned:n},m=h==="editing";if(m||!m&&g)s.push(f)})}),s}function JE(e,t=!1){let{editSvc:s}=e;if(s?.isBatchEditing()){if(t){for(let i of e.editModelSvc?.getEditPositions()??[])if(i.state==="editing")s.revertSingleCellEdit(i)}else Fs(e,{persist:!0});xs(e,void 0,{cancel:t})}else s?.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function eP(e,t){let s=Z(e,t);return!!e.editSvc?.isEditing(s)}function tP(e,t){let{key:s,colKey:i,rowIndex:o,rowPinned:r}=t,{editSvc:n,colModel:a}=e,l=a.getCol(i);if(!l){F(12,{colKey:i});return}let d=Ee(e,{rowIndex:o,rowPinned:r||null,column:l});if(!d){F(290,{rowIndex:o,rowPinned:r});return}if(!n?.isCellEditable({rowNode:d,column:l},"api"))return;if(r==null)YF(e,o);qF(e,i),n?.startEditing({rowNode:d,column:l},{event:s?new KeyboardEvent("keydown",{key:s}):void 0,source:"api",editable:!0})}function sP(e){return e.editSvc?.validateEdit()||null}var iP={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},oP=class extends hc{constructor(e){super(iP);this.params=e}postConstruct(){ai(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){let e=this.getGui(),t=this.params,s=(i)=>{if(!ml(this.gos,i,t.node,t.column,!0))t.onKeyDown(i)};this.addManagedElementListeners(e,{keydown:s})}};function rP(e,{column:t},s,i,o="ui"){if(s instanceof KeyboardEvent&&(s.key===b.TAB||s.key===b.ENTER||s.key===b.F2||s.key===b.BACKSPACE&&i))return!0;if(s?.shiftKey&&e.rangeSvc?.getCellRanges().length!=0)return!1;let n=t?.getColDef(),a=nP(e.gos,n),l=s?.type;if(l==="click"&&s?.detail===1&&a===1)return!0;if(l==="dblclick"&&s?.detail===2&&a===2)return!0;if(o==="api")return!!i;return!1}function nP(e,t){if(e.get("suppressClickEdit")===!0)return 0;if(e.get("singleClickEdit")===!0)return 1;if(t?.singleClickEdit)return 1;return 2}function tl(e,t){return e.editModelSvc?.hasEdits(t,{withOpenEditor:!0})??!1}function El(e,t){let{column:s,rowNode:i}=t,o=s.getColDef();if(!i)return tl(e,t);let r=o.editable;if(i.group&&o.groupRowEditable!=null){if(e.rowGroupingEditValueSvc?.isGroupCellEditable(i,s))return!0;return tl(e,t)}if(s.isColumnFunc(i,r))return!0;return tl(e,t)}function aP(e,t,s="ui"){let i=El(e,t);if(i||s==="ui")return i;let{rowNode:o,column:r}=t;for(let n of e.colModel.getCols())if(n!==r&&El(e,{rowNode:o,column:n}))return!0;return!1}var pn=(e,t=!1)=>{if(e!==void 0)return Tt(e)||t&&e.state==="editing"};function of(e,t,s=!1){return pn(e.editModelSvc?.getEdit(t),s)}var rf=(e,t,s)=>{if(!e)return;for(let i=0,o=e.length;i<o;++i){let r=e[i];if(r.data){if(pn(t?.getEdit({rowNode:r,column:s}))||pn(t?.getEdit({rowNode:r.pinnedSibling,column:s})))return!0}if(rf(r.childrenAfterGroup,t,s))return!0}};function nf(e,t){let{column:s,rowNode:i}=t;if(e.gos.get("groupTotalRow")&&!i?.footer)return!1;return rf(i?.childrenAfterGroup,e.editModelSvc,s)}function af(e,{rowNode:t,column:s}){if(t=t.pinnedSibling,!t)return;return pn(e.editModelSvc?.getEdit({rowNode:t,column:s}))}var lP=class extends y{constructor(e,t){super();this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){let{cellCtrl:e,editSvc:t,beans:s}=this;if(t?.isBatchEditing()&&t.isEditing()){let o=of(s,e)||nf(s,e)||af(s,e);this.applyBatchingStyle(o)}else this.applyBatchingStyle(!1);let i=!!this.editModelSvc?.getCellValidationModel().hasCellValidation(this.cellCtrl);this.cellComp.toggleCss("ag-cell-editing-error",i)}applyBatchingStyle(e){this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&this.editSvc?.isBatchEditing())??!1)}},cP=class extends y{constructor(e,t){super();this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){let{rowCtrl:e,editModelSvc:t,beans:s}=this,i=e.rowNode,o=t?.getEditRow(i),r=this.editModelSvc?.getRowValidationModel().hasRowValidation({rowNode:i});if(!o&&i.pinnedSibling)i=i.pinnedSibling,o=t?.getEditRow(i);if(o){let n=Array.from(o.keys()).some((a)=>{let l={rowNode:i,column:a};return of(s,l,!0)||nf(s,l)||af(s,l)});this.applyStyle(r,n);return}this.applyStyle(r)}applyStyle(e=!1,t=!1){let s=!!this.editSvc?.isBatchEditing(),i=this.gos.get("editType")==="fullRow";this.rowCtrl?.forEachGui(void 0,({rowComp:o})=>{o.toggleCss("ag-row-editing",i&&t),o.toggleCss("ag-row-batch-edit",i&&t&&s),o.toggleCss("ag-row-inline-editing",t),o.toggleCss("ag-row-not-inline-editing",!t),o.toggleCss("ag-row-editing-invalid",i&&t&&e)})}},dP=({rowModel:e,pinnedRowModel:t,editModelSvc:s},i)=>{let o=new Set;e.forEachNode((r)=>i.has(r)&&o.add(r)),t?.forEachPinnedRow("top",(r)=>i.has(r)&&o.add(r)),t?.forEachPinnedRow("bottom",(r)=>i.has(r)&&o.add(r));for(let r of i)if(!o.has(r))s.removeEdits({rowNode:r});return o},uP=({editModelSvc:e},t,s)=>{for(let i of t)e?.getEditRow(i)?.forEach((o,r)=>!s.has(r)&&e.removeEdits({rowNode:i,column:r}))},hP=(e)=>()=>{let t=new Set(e.colModel.getCols()),s=e.editModelSvc.getEditMap(!0),i=new Set(s.keys());uP(e,dP(e,i),t)},gP=new Set(["undo","redo","paste","bulk","rangeSvc"]),pP=new Set(["ui","api"]),lf={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},fP=new Set(Object.keys(lf)),mP=new Set(["paste","rangeSvc","cellClear","redo","undo"]),sl={cancel:!0,source:"api"},CP={cancel:!1,source:"api"},Qs={checkSiblings:!0},bs={force:!0,suppressFlash:!0},vP={force:!0},wP=class extends y{constructor(){super(...arguments);this.beanName="editSvc",this.committing=!1,this.batch=!1,this.batchStartDispatched=!1,this.stopping=!1,this.rangeSelectionWhileEditing=0}postConstruct(){let{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:i})=>{this.stopEditing(void 0,sl),this.createStrategy(i)});let t=hP(e),s=()=>{let i=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;if(i||o)this.stopEditing(void 0,sl);else if(this.isEditing())if(this.batch)xs(e,this.model.getEditPositions());else this.stopEditing(void 0,CP);return!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:s,filterChanged:s,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}startBatchEditing(){if(this.batch)return;this.batch=!0,this.batchStartDispatched=!1,this.stopEditing(void 0,sl)}stopBatchEditing(e){if(!this.batch)return;if(e)this.stopEditing(void 0,e);if(this.batchStartDispatched)this.dispatchBatchStopped(new Map,!1);this.batch=!1,this.batchStartDispatched=!1}ensureBatchStarted(){if(!this.batch||this.batchStartDispatched)return;this.batchStartDispatched=!0,this.dispatchBatchEvent("batchEditingStarted",new Map)}createStrategy(e){let{beans:t,gos:s,strategy:i}=this,o=ch(s,e);if(i){if(i.beanName===o)return i;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){if(!this.strategy)return;this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy)}shouldStartEditing(e,t,s,i="ui"){let o=rP(this.beans,e,t,s,i);if(o)this.strategy??(this.strategy=this.createStrategy());return o}shouldStopEditing(e,t,s="ui"){return this.strategy?.shouldStop(e,t,s)??null}shouldCancelEditing(e,t,s="ui"){return this.strategy?.shouldCancel(e,t,s)??null}validateEdit(){return xR(this.beans)}isEditing(e,t){return this.model.hasEdits(e??void 0,t??Qs)}isRowEditing(e,t){return!!e&&this.model.hasRowEdits(e,t)}enableRangeSelectionWhileEditing(){if(this.beans.rangeSvc&&this.gos.get("cellSelection"))this.rangeSelectionWhileEditing++}disableRangeSelectionWhileEditing(){this.rangeSelectionWhileEditing=Math.max(0,this.rangeSelectionWhileEditing-1)}isRangeSelectionEnabledWhileEditing(){return this.rangeSelectionWhileEditing>0}startEditing(e,t){let{startedEdit:s=!0,event:i=null,source:o="ui",ignoreEventKey:r=!1,silent:n}=t;if(this.strategy??(this.strategy=this.createStrategy()),!(t.editable??this.isCellEditable(e,"api")))return;let l=Z(this.beans,e);if(l&&!l.comp){t.editable=void 0,l.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}let c=this.shouldStartEditing(e,i,s,o);if(c===!1&&o!=="api"){if(this.isEditing(e))this.stopEditing();return}if(!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing)this.stopEditing(void 0,{source:o});if(c)this.ensureBatchStarted();this.strategy.start({position:e,event:i,source:o,ignoreEventKey:r,startedEdit:s,silent:n})}stopEditing(e,t){let s=this.prepareStopContext(e,t);if(!s)return!1;this.stopping=!0;let i=!1;try{let o=this.processStopRequest(s);return i||(i=o.res),this.finishStopEditing({...s,edits:o.edits,params:t,position:e,res:i}),i}finally{this.rangeSelectionWhileEditing=0,this.stopping=!1}}prepareStopContext(e,t){let{event:s=null,cancel:i=!1,source:o="ui",forceCancel:r=!1,forceStop:n=!1,commit:a=!1}=t||{};if(fP.has(o)&&this.batch){if(e?.rowNode&&e?.column)this.bulkRefreshCell(e);return null}let l=this.committing?lf[o]:o;if(!(this.committing||this.isEditing(e)||this.batch&&this.model.hasEdits(e,Qs))||!this.strategy||this.stopping)return null;let d=Z(this.beans,e);if(d)d.onEditorAttachedFuncs=[];let u=!i&&(!!this.shouldStopEditing(e,s,l)||(this.committing||o==="paste")&&!this.batch)||n,h=i&&!!this.shouldCancelEditing(e,s,l)||r;return{cancel:i,cellCtrl:d,edits:this.model.getEditMap(!0),event:s??null,forceCancel:r,forceStop:n,commit:a,position:e,source:o,treatAsSource:l,willCancel:h,willStop:u}}processStopRequest(e){let{event:t,position:s,willCancel:i,willStop:o}=e;if(o||i)return this.handleStopOrCancel(e);if(this.shouldHandleMidBatchKey(t,s))return{res:!1,edits:this.handleMidBatchKey(t,s,e)};if(Fs(this.beans,{persist:!0}),this.batch)this.strategy?.cleanupEditors(s);return{res:!1,edits:this.model.getEditMap()}}handleStopOrCancel(e){let{beans:t,model:s}=this,{cancel:i,commit:o,edits:r,event:n,source:a,willCancel:l,willStop:c}=e,d=!this.batch||!l;Fs(t,{persist:d,isCancelling:l||i,isStopping:c});let u=s.getEditMap(),g=!l&&(!this.batch||o)?this.processEdits(u,a):[];if(i)this.strategy?.stopCancelled(e.forceCancel);else this.strategy?.stopCommitted(n,o);this.clearValidationIfNoOpenEditors();for(let p of g)s.clearEditValue(p);this.bulkRefreshMap(r);for(let p of s.getEditPositions(u)){let f=Z(t,p),m=Tt(p);f?.refreshCell({force:!0,suppressFlash:!m})}return{res:c,edits:u}}shouldHandleMidBatchKey(e,t){return e instanceof KeyboardEvent&&this.batch&&!!this.strategy?.midBatchInputsAllowed(t)&&this.isEditing(t,{withOpenEditor:!0})}handleMidBatchKey(e,t,s){let{beans:i,model:o}=this,{cellCtrl:r,edits:n}=s,{key:a}=e,l=a===b.ENTER,c=a===b.ESCAPE,d=a===b.TAB;if(l||d||c){if(l||d)Fs(i,{persist:!0});else if(c&&r){let{rowNode:u,column:h}=r;if(this.batch&&u&&h){let g={rowNode:u,column:h};xs(i,[g],{silent:!0}),this.model.stop(g,!0,!0),Z(i,g)?.refreshCell(bs)}else this.revertSingleCellEdit(r)}if(this.batch)this.strategy?.cleanupEditors();else xs(i,o.getEditPositions(),{event:e,cancel:c});return e.preventDefault(),this.bulkRefreshMap(n,{suppressFlash:!0}),o.getEditMap()}return n}finishStopEditing({cellCtrl:e,edits:t,params:s,position:i,res:o,commit:r,forceCancel:n,willCancel:a,willStop:l}){let c=this.beans;if(o&&i){if(!this.batch||r)this.model.removeEdits(i)}this.navigateAfterEdit(s,e?.cellPosition),So(c),this.clearValidationIfNoOpenEditors();let{rowRenderer:d,formula:u}=c;if(a)d.refreshRows({rowNodes:Array.from(t.keys())});if(this.batch){if(u)u.refreshFormulas(!0);else d.refreshRows({suppressFlash:!0,force:!0});let h=l&&r;if(h||a&&n)this.dispatchBatchStopped(t,h)}}dispatchBatchStopped(e,t){let s;if(t){if(s=fR(e),s.size>0)this.ensureBatchStarted()}if(this.batchStartDispatched)this.batchStartDispatched=!1,this.dispatchBatchEvent("batchEditingStopped",s??new Map)}clearValidationIfNoOpenEditors(){if(!this.model.hasEdits(void 0,{withOpenEditor:!0}))this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()}navigateAfterEdit(e,t){if(!e||!t)return;let{event:s,suppressNavigateAfterEdit:i}=e;if(!(s instanceof KeyboardEvent)||i)return;let{key:r,shiftKey:n}=s,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(r!==b.ENTER||!a)return;let l=n?b.UP:b.DOWN;this.beans.navigation?.navigateToNextCell(null,l,t,!1)}processEdits(e,t){let s=Array.from(e.keys()),i=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,o=[],{changeDetectionSvc:r}=this.beans;r?.beginDeferred();try{for(let n of s){let a=e.get(n);for(let l of a.keys()){let c=a.get(l),d={rowNode:n,column:l};if(Tt(c)&&!i){let u=Z(this.beans,d);if(!this.setNodeDataValue(n,l,c.pendingValue,u,t))o.push(d)}}}}finally{r?.endDeferred()}return o}setNodeDataValue(e,t,s,i,o="edit"){let r=pP.has(o)?"edit":o;if(i)i.suppressRefreshCell=!0;this.committing=!0;try{return e.setDataValue(t,s,r)}finally{if(this.committing=!1,i)i.suppressRefreshCell=!1}}syncEditAfterCommit(e,t){let s=this.model.getEdit(e);if(s&&s.state!=="editing")if(t)this.beans.editModelSvc?.setEdit(e,{sourceValue:s.pendingValue});else this.model.clearEditValue(e)}setEditMap(e,t){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(e,t),this.bulkRefreshMap(e);let s=bs;if(t?.forceRefreshOfEditCellsOnly)s={...bP(e),...bs};this.beans.rowRenderer.refreshCells(s)}dispatchEditValuesChanged({rowNode:e,column:t},s={}){if(!e||!t||!s)return;let{pendingValue:i,sourceValue:o}=s,{rowIndex:r,rowPinned:n,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:r,rowPinned:n,column:t,source:"api",data:a,newValue:i,oldValue:o,value:i,colDef:t.getColDef()})}bulkRefreshCell(e,t){if(J(this.gos,this.beans.rowModel))this.refCell(e,this.model.getEdit(e),t)}bulkRefreshMap(e,t){if(J(this.gos,this.beans.rowModel))e.forEach((s,i)=>{for(let o of s.keys())this.refCell({rowNode:i,column:o},s.get(o),t)})}refCell({rowNode:e,column:t},s,i={}){let{beans:o,gos:r}=this,n=new Set([e]),a=new Set,l=e.pinnedSibling;if(l)n.add(l);let c=e.sibling;if(c)a.add(c);let d=e.parent;while(d){if(d.sibling?.footer&&r.get("groupTotalRow"))a.add(d.sibling);else if(!d.parent&&d.sibling&&r.get("grandTotalRow"))a.add(d.sibling);else a.add(d);d=d.parent}for(let u of n)this.dispatchEditValuesChanged({rowNode:u,column:t},s);for(let u of n)Z(o,{rowNode:u,column:t})?.refreshCell(i);for(let u of a){let h=Z(o,{rowNode:u,column:t});if(h){if(h.refreshCell(i),!i.force&&this.batch)h.editStyleFeature?.applyCellStyles?.()}}}stopAllEditing(e=!1,t="ui"){if(this.isEditing())this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){let{gos:s,beans:i}=this,o=e.rowNode;if(o.group&&e.column.getColDef().groupRowEditable==null){if(s.get("treeData")){if(!o.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}let r=ch(s)==="fullRow"?aP(i,e,t):El(i,e);if(r)this.strategy??(this.strategy=this.createStrategy());return r}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,s=!0){if(this.hasValidationErrors(e)){let i=Z(this.beans,e);if(this.cellEditingInvalidCommitBlocks()){if(t?.preventDefault?.(),s){if(i&&!i.hasBrowserFocus())i.focusCell();i?.comp?.getCellEditor()?.focusIn?.()}return"block-stop"}if(i)this.revertSingleCellEdit(i);return"revert-continue"}return"continue"}revertSingleCellEdit(e,t=!1){let s=Z(this.beans,e);if(!s?.comp?.getCellEditor())return;if(xs(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),di(this.beans,e,{silent:!0}),Ts(this.beans),s?.refreshCell(bs),!t)return;s?.focusCell(),s?.comp?.getCellEditor()?.focusIn?.()}hasValidationErrors(e){Ts(this.beans);let t=Z(this.beans,e);if(t)t.refreshCell(bs),t.rowCtrl.rowEditStyleFeature?.applyRowStyles();let s=!1;if(e?.rowNode){if(s||(s=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column)s||(s=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column}))}else s||(s=this.model.getCellValidationModel().getCellValidationMap().size>0),s||(s=this.model.getRowValidationModel().getRowValidationMap().size>0);return s}moveToNextCell(e,t,s,i="ui"){let o,r=this.isEditing(),n=r&&this.checkNavWithValidation(void 0,s)==="block-stop";if(e instanceof Eo&&r)o=this.strategy?.moveToNextEditingCell(e,t,s,i,n);if(o===null)return o;if(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!n)this.stopEditing();return o}getPendingEditValue(e,t,s){if(s==="batch"&&!this.batch)return;let i=this.model.getEdit({rowNode:e,column:t},Qs);if(!i)return;if(this.stopping&&!this.batch&&!i.editorState?.cellStartedEditing)return;if(s==="edit"){let r=i.editorValue;if(r!=null&&r!==ke)return r}let o=i.pendingValue;if(o!==ke)return o;return}getCellDataValue(e){let t=this.model.getEdit(e,Qs);if(t){let s=t.pendingValue;if(s!==ke)return s;let i=t.sourceValue;if(i!=null)return i}return this.valueSvc.getValue(e.column,e.rowNode,"data")}addStopEditingWhenGridLosesFocus(e){hR(this,this.beans,e)}createPopupEditorWrapper(e){return new oP(e)}batchResetToSourceValue(e){if(!this.batch)return!1;let t=this.model.getEdit(e);if(!t)return!1;let{pendingValue:s,sourceValue:i,state:o}=t;if(s===i)return!1;if(o==="editing")return!1;return this.dispatchEditValuesChanged(e,{...t,pendingValue:i}),this.beans.editModelSvc?.removeEdits(e),Z(this.beans,e)?.refreshCell(bs),!0}setDataValue(e,t,s){try{let i=this.batch,o=this.isEditing(i?void 0:e);if((!o||this.committing)&&!i&&!mP.has(s))return;if(!o&&!i&&s==="paste")return;if(s==="batch"&&!i)return;if(s==="edit"){if(o&&this.applyEditorValue(e,t))return!0;if(!i)return}if(this.strategy??(this.strategy=this.createStrategy()),s==="batch"||s==="edit")return this.applyDirectValue(e,t,s);let r=this.beans,n;if(i)n="ui";else if(this.committing)n=s??"api";else n="api";if(!s||gP.has(s))return this.applyDirectValue(e,t,s);let a=this.applyExistingEdit(e,t,s,n);if(a!==void 0)return a;return Mi(r,e,t,s,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:n,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}applyExistingEdit(e,t,s,i){let o=this.model.getEdit(e);if(!o)return;if(o.pendingValue===t)return!1;if(o.sourceValue!==t)return Mi(this.beans,e,t,s,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;return this.beans.editModelSvc?.removeEdits(e),this.ensureBatchStarted(),this.dispatchEditValuesChanged(e,{...o,pendingValue:t}),!0}applyEditorValue(e,t){let s=this.beans,i=Z(s,e),o=i?.comp?.getCellEditor();if(!i||!o)return!1;if(Mi(s,e,t,"edit",void 0,{persist:!0}),i.editStyleFeature?.applyCellStyles?.(),"agSetEditValue"in o)return o.agSetEditValue(t),!0;if(o.refresh&&i.editCompDetails)return o.refresh({...i.editCompDetails.params,value:t}),!0;if(i.hasBrowserFocus())i.onEditorAttachedFuncs.push(()=>{let n=Z(this.beans,e);n?.focusCell(!0),n?.comp?.getCellEditor()?.focusIn?.()});return xs(s,[e],{silent:!0,cancel:!0}),di(s,e,{silent:!0}),Ts(s),Z(s,e)?.refreshCell(bs),!0}applyDirectValue(e,t,s){let i=this.beans;if(this.batch){if(s==="batch"&&Z(i,e)?.comp?.getCellEditor()){let{editModelSvc:n,valueSvc:a}=i,{rowNode:l,column:c}=e;if(n?.getEdit(e)?.sourceValue===void 0)n?.setEdit(e,{sourceValue:a.getValue(c,l,"data")});n?.setEdit(e,{pendingValue:t})}else if(Mi(i,e,t,s,void 0,{persist:!0}),s!=="batch")this.cleanupEditors();return So(i),this.ensureBatchStarted(),this.bulkRefreshCell(e),!0}Mi(i,e,t,s,void 0,{persist:!0});let o=Z(i,e),r=this.setNodeDataValue(e.rowNode,e.column,t,o,s);return this.syncEditAfterCommit(e,r),So(i),Z(i,e)?.refreshCell(r?vP:bs),r}handleColDefChanged(e){CR(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){let{model:s}=this;if(!this.batch)return;if(!s.hasRowEdits(e.rowNode,Qs))return;let{rowNode:o}=e,{compDetails:r,valueToDisplay:n}=t;if(r){let{params:a}=r;return a.data=s.getEditRowDataValue(o,Qs),{compDetails:r}}return{valueToDisplay:n}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(e,t,s,i){this.strategy?.dispatchCellEvent(e,t,s,i)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return I(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map((t)=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},s){if(!s||s.length===0)return;let{beans:i,rangeSvc:o,valueSvc:r}=this,{formula:n}=i;Fs(i,{persist:!0});let a=this.model.getEditMap(!0),l=a.get(e)?.get(t)?.pendingValue,c=!1;if(!this.batch)this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),c=!0;let d=n?.isFormula(l)??!1;s.forEach((h)=>{let g=h.columns.some((p)=>p?.isAllowFormula());if(o?.forEachRowInRange(h,(p)=>{let f=Ee(i,p);if(f===void 0)return;let m=a.get(f)??new Map,C=l;for(let v of h.columns){if(!v)continue;let w=!!d&&v.isAllowFormula();if(this.isCellEditable({rowNode:f,column:v},"api")){let S=r.getValue(v,f,"data",!0),x=r.parseValue(v,f??null,C,S);if(Number.isNaN(x))x=null;m.set(v,{editorValue:void 0,pendingValue:x,sourceValue:S,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}if(w)C=n?.updateFormulaByOffset({value:C,columnDelta:1})}if(m.size>0)a.set(f,m);if(d&&g)l=n?.updateFormulaByOffset({value:l,rowDelta:1})}),this.setEditMap(a),this.batch){this.cleanupEditors(),So(i),this.ensureBatchStarted();return}this.committing=!0;try{this.stopEditing(void 0,{source:"bulk"})}finally{if(this.committing=!1,c)this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(a)})}});let u=Z(i,{rowNode:e,column:t});if(u)u.focusCell(!0)}createCellStyleFeature(e){return new lP(e,this.beans)}createRowStyleFeature(e){return new cP(e,this.beans)}setEditingCells(e,t){let{beans:s}=this,{colModel:i,valueSvc:o}=s,r=new Map;for(let{colId:n,column:a,colKey:l,rowIndex:c,rowPinned:d,newValue:u,state:h}of e){let g=n?i.getCol(n):l?i.getCol(l):a;if(!g)continue;let p=Ee(s,{rowIndex:c,rowPinned:d});if(!p)continue;let f=o.getValue(g,p,"data",!0);if(!t?.forceRefreshOfEditCellsOnly&&!Tt({pendingValue:u,sourceValue:f})&&h!=="editing")continue;let m=r.get(p);if(!m)m=new Map,r.set(p,m);if(u===void 0)u=ke;m.set(g,{editorValue:void 0,pendingValue:u,sourceValue:f,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(r,t)}onCellFocused(e){let t=Z(this.beans,e);if(!t||!this.isEditing(t,Qs))return;let s=this.model.getEdit(t);if(!s||!Tt(s))return;let o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Z(this.beans,e)}};function bP(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap((t)=>Array.from(t.keys())))]:void 0}}function ch(e,t){return t??e.get("editType")??"singleCell"}var cf=class extends y{postConstruct(){this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:this.onCellFocusChanged?.bind(this),cellFocusCleared:this.onCellFocusChanged?.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t,s=e.previousParams,{editSvc:i,beans:o}=this,r=e.type==="cellFocused"?e.sourceEvent:null;if(s)t=Z(o,s);let{gos:n,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(i.isEditing(void 0,{withOpenEditor:!0})){let{column:c,rowIndex:d,rowPinned:u}=e,h={column:c,rowNode:Ee(o,{rowIndex:d,rowPinned:u})},g=n.get("invalidEditValueMode")==="block";if(g)return;let p=!g,f=!!a?.getCellValidationModel().hasCellValidation(h),m=p&&f;if(!(s||l?i.stopEditing(void 0,{cancel:m,source:l&&p?"api":void 0,event:r}):!0))if(i.isBatchEditing())i.cleanupEditors();else i.stopEditing(void 0,{source:"api"})}t?.refreshCell({suppressFlash:!0,force:!0})}stopCancelled(e){let t=this.editSvc.isBatchEditing()&&!e;for(let s of this.model.getEditPositions())No(this.beans,s,{cancel:!0},Z(this.beans,s)),this.model.stop(s,t,!0);return!0}stopCommitted(e,t){let s=this.model.getEditPositions(),i={all:[],pass:[],fail:[]};for(let n of s)if(i.all.push(n),(this.model.getCellValidationModel().getCellValidation(n)?.errorMessages?.length??0)>0)i.fail.push(n);else i.pass.push(n);let o=this.processValidationResults(i),r=this.editSvc.isBatchEditing()&&!t;for(let n of o.destroy)No(this.beans,n,{event:e},Z(this.beans,n)),this.model.stop(n,r,!1);for(let n of o.keep){let a=Z(this.beans,n);if(!this.editSvc.cellEditingInvalidCommitBlocks()&&a)this.editSvc.revertSingleCellEdit(a)}return!0}cleanupEditors({rowNode:e}={},t){Fs(this.beans,{persist:!1});let s=this.model.getEditPositions(),i=[];if(e){for(let o of s)if(o.rowNode!==e)i.push(o)}else for(let o of s)i.push(o);xs(this.beans,i),So(this.beans,t)}setFocusOutOnEditor(e){e.comp?.getCellEditor()?.focusOut?.()}setFocusInOnEditor(e){let t=e.comp,s=t?.getCellEditor();if(s?.focusIn)s.focusIn();else{let i=this.beans.gos.get("editType")==="fullRow";e.focusCell(i),e.onEditorAttachedFuncs.push(()=>t?.getCellEditor()?.focusIn?.())}}setupEditors(e){let{event:t,ignoreEventKey:s=!1,startedEdit:i,position:o,cells:r=this.model.getEditPositions()}=e,n=t instanceof KeyboardEvent&&!s&&t.key||void 0;pR(this.beans,r,o,n,t,i)}dispatchCellEvent(e,t,s,i){let o=Z(this.beans,e);if(o)this.eventSvc.dispatchEvent({...o.createEvent(t??null,s),...i})}dispatchRowEvent(e,t,s){if(s)return;let i=hn(this.beans,e);if(i)this.eventSvc.dispatchEvent(i.createRowEvent(t))}shouldStop(e,t,s="ui"){let i=this.editSvc.isBatchEditing();if(i&&s==="api")return!0;if(i&&(s==="ui"||s==="edit"))return!1;if(s==="api")return!0;if(t instanceof KeyboardEvent&&!i)return t.key===b.ENTER;return null}shouldCancel(e,t,s="ui"){let i=this.editSvc.isBatchEditing();if(t instanceof KeyboardEvent&&!i){if(t.key===b.ESCAPE)return!0}if(i&&s==="api")return!0;if(s==="api")return!0;return!1}setEditMap(e,t){if(!t?.update)this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});let s=[];if(e.forEach((i,o)=>{i.forEach((r,n)=>{if(r.state==="editing")s.push({...r,rowNode:o,column:n})})}),t?.update)e=new Map([...this.model.getEditMap(),...e]);if(this.model?.setEditMap(e),s.length>0){let i=s.at(-1),o=i.pendingValue===ke?void 0:i.pendingValue;this.start({position:i,event:new KeyboardEvent("keydown",{key:o}),source:"api"});let r=Z(this.beans,i);if(r)this.setFocusInOnEditor(r)}}destroy(){this.cleanupEditors(),super.destroy()}},SP=class extends cf{constructor(){super(...arguments);this.beanName="fullRow",this.startedRows=new Set}shouldStop(e,t,s="ui"){let{rowNode:i,beans:o}=this,{rowNode:r}=e||{};if(!hn(o,{rowNode:i}))return!0;let a=super.shouldStop({rowNode:i},t,s);if(a!==null)return a;if(!i)return!1;return r!==i}midBatchInputsAllowed({rowNode:e}){if(!e)return!1;return this.model.hasEdits({rowNode:e})}clearEdits(e){this.model.clearEditValue(e)}start(e){let{position:t,silent:s,startedEdit:i,event:o,ignoreEventKey:r}=e,{rowNode:n}=t,{beans:a,model:l,startedRows:c}=this;if(this.rowNode!==n)super.cleanupEditors(t);let d=a.visibleCols.allCols,u=[],h=[];for(let g of d)if(g.isCellEditable(n))h.push(g);if(h.length==0)return;if(!c.has(n))this.dispatchRowEvent({rowNode:n},"rowEditingStarted",s),c.add(n);for(let g of h){let p={rowNode:n,column:g};u.push(p),l.start(p)}this.rowNode=n,this.setupEditors({cells:u,position:t,startedEdit:i,event:o,ignoreEventKey:r})}processValidationResults(e){if(e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks())return{destroy:[],keep:e.all};return{destroy:e.all,keep:[]}}stopCancelled(e){let{rowNode:t,model:s}=this;if(t&&!s.hasEdits())return!1;return super.stopCancelled(e),this.cleanupEditors({rowNode:t},!0),this.rowNode=void 0,!0}stopCommitted(e,t){let{rowNode:s,beans:i,model:o,editSvc:r}=this;if(s&&!o.hasEdits())return!1;let n=[];if(o.getEditMap().forEach((a,l)=>{if(!a||a.size===0)return;for(let c of a.values())if(Tt(c)){n.push(l);break}}),Ts(i),r.checkNavWithValidation({rowNode:s})==="block-stop")return!1;if(super.stopCommitted(e,t),t||!r.isBatchEditing())for(let a of n)this.dispatchRowEvent({rowNode:a},"rowValueChanged");return this.cleanupEditors({rowNode:s},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){let{rowIndex:t}=e,s=e.previousParams;if(s?.rowIndex===t||e.sourceEvent instanceof KeyboardEvent)return;let{beans:i,gos:o,model:r}=this;if(i.editSvc?.isRangeSelectionEnabledWhileEditing())return;let n=Z(i,s);if(o.get("invalidEditValueMode")==="block"&&n&&(r.getCellValidationModel().getCellValidation(n)||r.getRowValidationModel().getRowValidation(n)))return;super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);let{startedRows:s}=this;for(let i of s)this.dispatchRowEvent({rowNode:i},"rowEditingStopped"),this.destroyEditorsForRow(i);s.clear()}destroyEditorsForRow(e){let t=hn(this.beans,{rowNode:e});if(!t)return;let s={};for(let i of t.getAllCellCtrls())if(i.comp?.getCellEditor())No(this.beans,i,s,i)}moveToNextEditingCell(e,t,s,i="ui",o=!1){let{beans:r,model:n,gos:a,editSvc:l}=this,c=e.cellPosition,d;n.suspend(!0);try{d=r.navigation?.findNextCellToFocusOn(c,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{n.suspend(!1)}if(d===!1)return null;if(d==null)return!1;let u=d.cellPosition,h=e.isCellEditable(),g=d.isCellEditable(),p=c.rowIndex===u?.rowIndex&&c.rowPinned===u.rowPinned;if(h)this.setFocusOutOnEditor(e);this.restoreEditors();let f=a.get("suppressStartEditOnTab");if(g&&!o)if(f)d.focusCell(!0,s);else{if(!d.comp?.getCellEditor())di(r,d,{event:s,cellStartedEdit:!0});this.setFocusInOnEditor(d),d.focusCell(!1,s)}else{if(g&&o)this.setFocusInOnEditor(d);d.focusCell(!0,s)}if(!p&&!o){if(l?.stopEditing({rowNode:e.rowNode},{event:s,forceStop:!0}),l?.isRowEditing(e.rowNode,{withOpenEditor:!0}))this.cleanupEditors(d,!0);if(f)d.focusCell(!0,s);else l.startEditing(d,{startedEdit:!0,event:s,source:i,ignoreEventKey:!0,editable:g||void 0})}return e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){let{beans:e,model:t}=this;t.getEditMap().forEach((s,i)=>s.forEach(({state:o},r)=>{if(o!=="editing")return;let n=Z(e,{rowNode:i,column:r});if(n&&!n.comp?.getCellEditor())di(e,n,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.clear()}},yP=class extends cf{constructor(){super(...arguments);this.beanName="singleCell"}shouldStop(e,t,s="ui"){let i=super.shouldStop(e,t,s);if(i!==null)return i;let o=e?.rowNode,r=e?.column,n=this.rowNode,a=this.column;if((!n||!a)&&o&&r)return null;if(n!==o||a!==r)return!0;if(!n&&!a)return this.model.hasEdits(void 0,{withOpenEditor:!0});return!1}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){let{position:t,startedEdit:s,event:i,ignoreEventKey:o}=e;if(this.rowNode!==t.rowNode||this.column!==t.column)super.cleanupEditors();this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:s,event:i,ignoreEventKey:o})}dispatchRowEvent(e,t,s){}processValidationResults(e){if(e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks())return{destroy:[],keep:e.all};return{destroy:e.all,keep:[]}}stopCancelled(e){return super.stopCancelled(e),this.clearPosition()}stopCommitted(e,t){return super.stopCommitted(e,t),this.clearPosition()}clearPosition(){return this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){let{colModel:t,editSvc:s}=this.beans,{rowIndex:i,column:o,rowPinned:r}=e,n=Ee(this.beans,{rowIndex:i,rowPinned:r}),a=yl(o),l=t.getCol(a),c=e.previousParams;if(c){let d=yl(c.column);if(c?.rowIndex===i&&d===a&&c?.rowPinned===r)return}if(e.type=="cellFocused"&&(s?.isRangeSelectionEnabledWhileEditing()||s?.isEditing({rowNode:n,column:l},{withOpenEditor:!0})))return;super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,s,i="ui",o=!1){let r=this.beans.focusSvc.getFocusedCell();if(r)e=lt(this.beans,r)??e;let n=e.cellPosition,a,l=this.beans.gos.get("editType")==="fullRow";if(l)this.model.suspend(!0);if(!o)e.eGui.focus(),this.editSvc?.stopEditing(e,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:s});try{a=this.beans.navigation?.findNextCellToFocusOn(n,{backwards:t,startEditing:!0})}finally{if(l)this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;let c=a.cellPosition,d=e.isCellEditable(),u=a.isCellEditable(),h=n.rowIndex===c?.rowIndex&&n.rowPinned===c.rowPinned;if(d&&!o)this.setFocusOutOnEditor(e);let g=this.gos.get("suppressStartEditOnTab"),p=!1;if(!h&&!o)if(super.cleanupEditors(a,!0),g)a.focusCell(!0,s);else p=!0,this.editSvc.startEditing(a,{startedEdit:!0,event:s,source:i,ignoreEventKey:!0,editable:u});if(u&&!o){if(a.focusCell(!1,s),g)a.focusCell(!0,s);else if(!a.comp?.getCellEditor()){if(!p){let f=this.editSvc?.isEditing(a,{withOpenEditor:!0});di(this.beans,a,{event:s,cellStartedEdit:!0,silent:f})}this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else{if(u&&o)this.setFocusInOnEditor(a);a.focusCell(!0,s)}return e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},xP={moduleName:"EditCore",version:z,beans:[uR,wP],apiFunctions:{getEditingCells:QE,getEditRowValues:ZE,getCellEditorInstances:gR,startEditingCell:tP,stopEditing:JE,isEditing:eP,validateEdit:sP},dynamicBeans:{singleCell:yP,fullRow:SP},dependsOn:[Ci,OE],css:[BE]};var df={moduleName:"TextEditor",version:z,userComponents:{agCellEditor:lh,agTextCellEditor:lh},dependsOn:[xP]};var uf={agSetColumnFilter:"agSetColumnFilterHandler",agMultiColumnFilter:"agMultiColumnFilterHandler",agGroupColumnFilter:"agGroupColumnFilterHandler",agNumberColumnFilter:"agNumberColumnFilterHandler",agBigIntColumnFilter:"agBigIntColumnFilterHandler",agDateColumnFilter:"agDateColumnFilterHandler",agTextColumnFilter:"agTextColumnFilterHandler"},RP=new Set(Object.values(uf));function Ss(e,t){let s=e.filterUi;if(!s)return null;if(s.created)return s.promise;if(t)return null;let i=s.create(s.refreshed),o=s;return o.created=!0,o.promise=i,i}function $n(e,t,s,i,o,r,n){return t.refresh?.({...s,model:i,source:r,additionalEventAttributes:n}),e().then((a)=>{if(a){let{filter:l,filterParams:c}=a;oo(l,c,i,o,r,n)}})}function oo(e,t,s,i,o,r){e?.refresh?.({...t,model:s,state:i,source:o,additionalEventAttributes:r})}function hf(e,t,s,i){let o=e();if(o?.created)o.promise.then((r)=>{let n=t();oo(r,o.filterParams,n,s()??{model:n},"ui",i)})}function fn(e){let t,s=!1,i,{action:o,filterParams:r,getFilterUi:n,getModel:a,getState:l,updateState:c,updateModel:d,processModelToApply:u}=e;switch(o){case"apply":{let h=l();if(i=h?.model??null,u)i=u(i);t={state:h?.state,model:i},s=!0;break}case"clear":{if(t={model:null},!r?.buttons?.includes("apply"))s=!0,i=null;break}case"reset":{t={model:null},s=!0,i=null;break}case"cancel":{t={model:a()};break}}if(c(t),s)d(i);else hf(n,a,l,{fromAction:o})}function Fe(e,t){return e[t]??null}var FP=class extends yc{constructor(){super(...arguments);this.iconCreated=!1}wireComp(e,t,s,i,o){this.comp=e;let r=er(this,this.beans.context,o);this.eButtonShowMainFilter=s,this.eFloatingFilterBody=i,this.setGui(t,r),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(r),this.setupLeft(r),this.setupHover(r),this.setupFocus(r),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(r),this.setupUi(),r.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(r);let n=()=>this.onColDefChanged(r);r.addManagedListeners(this.column,{colDefChanged:n}),r.addManagedEventListeners({filterSwitched:({column:a})=>{if(a===this.column)n()}}),r.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){let{column:e,beans:t}=this,s=e.colDef;return I(t.gos,{colDef:s,column:e,floatingFilter:!0})}setupActive(){let e=this.column.colDef,t=!!e.filter,s=!!e.floatingFilter;this.active=t&&s}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;let e=N("filter",this.beans,this.column);if(e)this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e)}setupFocus(e){e.createManagedBean(new ls(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){let e=this.getLocaleTextFunc();fe(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){let{beans:t}=this;if(j(t)===this.eGui)return;let o=Ie(t,this.eGui,null,e.shiftKey);if(o){t.headerNavigation?.scrollToColumn(this.column),e.preventDefault(),o.focus();return}let r=this.findNextColumnWithFloatingFilter(e.shiftKey);if(!r)return;if(t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:r},event:e}))e.preventDefault()}findNextColumnWithFloatingFilter(e){let t=this.beans.visibleCols,s=this.column;do if(s=e?t.getColBefore(s):t.getColAfter(s),!s)break;while(!s.colDef.filter||!s.colDef.floatingFilter);return s}handleKeyDown(e){super.handleKeyDown(e);let t=this.getWrapperHasFocus();switch(e.key){case b.UP:case b.DOWN:case b.LEFT:case b.RIGHT:if(t)return;Qe(e);case b.ENTER:if(t){if(pe(this.eGui))e.preventDefault()}break;case b.ESCAPE:if(!t)this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;let s=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&ti(e.relatedTarget,"ag-floating-filter");if(s&&i&&e.target===this.eGui){let o=this.lastFocusEvent,r=o?.key===b.TAB;if(o&&r){let n=o.shiftKey;pe(this.eGui,n)}}this.focusThis()}setupHover(e){this.beans.colHover?.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){let t=new Sc(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!be(this.gos)}setupUserComp(){if(!this.active)return;let e=this.beans.colFilter?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());if(e)this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){let e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.beans.menuSvc?.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;let{beans:{colFilter:t},column:s,gos:i}=this,o=(r)=>{if(r?.source==="filterDestroyed"&&(!this.isAlive()||!t?.isAlive()))return;let n=this.comp.getFloatingFilterComp();if(!n)return;n.then((a)=>{if(a){if(i.get("enableFilterHandlers")){let d=r,u="filter";if(d?.afterFloatingFilter)u="ui";else if(d?.afterDataChange)u="dataChanged";else if(r?.source==="api")u="api";this.updateFloatingFilterParams(this.userCompDetails,u);return}let l=t?.getCurrentFloatingFilterParentModel(s),c=r?{...r,columns:r.columns??[],source:r.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};if([this.destroySyncListener]=e.addManagedListeners(s,{filterChanged:o}),t?.isFilterActive(s))o(null)}setupWidth(e){let t=()=>{let s=`${this.column.getActualWidth()}px`;this.comp.setWidth(s)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){if(this.active)[this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton()}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){let e=!!this.beans.filterManager?.isFilterAllowed(this.column);if(this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e)this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){let t=this.active;this.setupActive();let s=!t&&this.active;if(t&&!this.active)this.destroySyncListener(),this.destroyFilterChangedListener();let i=this.beans.colFilter,o=this.active?i?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();if(!r||!o)this.updateCompDetails(e,o,s);else r.then((n)=>{if(!n||i?.areFilterCompsDifferent(this.userCompDetails??null,o))this.updateCompDetails(e,o,s);else this.updateFloatingFilterParams(o,"colDef")})}updateCompDetails(e,t,s){if(!this.isAlive())return;if(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),s)this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)}updateFloatingFilterParams(e,t){if(!e)return;let s=e.params;this.comp.getFloatingFilterComp()?.then((i)=>{if(typeof i?.refresh==="function"){if(this.gos.get("enableFilterHandlers"))s={...s,model:Fe(this.beans.colFilter?.model??{},this.column.colId),source:t};i.refresh(s)}})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function EP(e,t){let s=e.colModel.getCol(t);if(!s){X(12,{colKey:t});return}e.menuSvc?.showColumnMenu({column:s,positionBy:"auto"})}function PP(e){e.menuSvc?.hidePopupMenu()}var MP=class extends y{constructor(){super(...arguments);this.beanName="menuSvc"}postConstruct(){let{enterpriseMenuFactory:e,filterMenuFactory:t}=this.beans;this.activeMenuFactory=e??t}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){this.showColumnMenuCommon(dh(this.beans),e,e.containerType,!0)}showHeaderContextMenu(e,t,s){this.activeMenuFactory?.showMenuAfterContextMenuEvent(e,t,s)}hidePopupMenu(){this.beans.contextMenuSvc?.hideActiveMenu(),this.activeMenuFactory?.hideActiveMenu()}hideFilterMenu(){dh(this.beans)?.hideActiveMenu()}isColumnMenuInHeaderEnabled(e){let{suppressHeaderMenuButton:t}=e.colDef;return!t&&!!this.activeMenuFactory?.isMenuEnabled(e)&&(be(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.colDef.suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(e&&ht(e)?e.colDef:e?.getColGroupDef())?.suppressHeaderContextMenu&&this.gos.get("columnMenu")==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){let e=!this.isSuppressMenuHide();return!(os()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!be(this.gos)&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!!this.beans.filterManager?.isFilterAllowed(e)&&!be(this.gos)&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isFloatingFilterButtonEnabled(e){return!e.getColDef().suppressFloatingFilterButton}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){let e=this.gos,t=e.get("suppressMenuHide");if(be(e))return e.exists("suppressMenuHide")?t:!1;return t}showColumnMenuCommon(e,t,s,i){let{positionBy:o,onClosedCallback:r}=t,n=t.column;if(o==="button"){let{buttonElement:a}=t;e?.showMenuAfterButtonClick(n,a,s,r,i)}else if(o==="mouse"){let{mouseEvent:a}=t;e?.showMenuAfterMouseEvent(n,a,s,r,i)}else if(n){let a=this.beans,l=a.ctrlsSvc;l.getScrollFeature().ensureColumnVisible(n,"auto"),et(a,()=>{let c=l.getHeaderRowContainerCtrl(n.getPinned())?.getHeaderCtrlForColumn(n);if(c)e?.showMenuAfterButtonClick(n,c.getAnchorElementForMenu(i),s,r,i)})}}};function _o(e,t,s){if(e.menuVisible!==t)e.menuVisible=t,e.dispatchColEvent("menuVisibleChanged",s)}function dh(e){let{enterpriseMenuFactory:t,filterMenuFactory:s,gos:i}=e;return t&&be(i)?t:s}var Uc={moduleName:"SharedMenu",version:z,beans:[MP],apiFunctions:{showColumnMenu:EP,hidePopupMenu:PP}},TP=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper{min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(.ag-input-field-input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:max(200px,100%)}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:var(--ag-widget-container-vertical-padding);:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function DP(e){let t=e.filterManager;return!!t?.isColumnFilterPresent()||!!t?.isAggregateFilterPresent()}function AP(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)}function IP(e,t){let s=e.colModel.getColDefColOrCol(t);if(s)return e.colFilter?.destroyFilter(s,"api")}function kP(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))}function LP(e){return e.filterManager?.getFilterModel()??{}}function GP(e,t,s){let{gos:i,colModel:o,colFilter:r}=e;if(s&&!i.get("enableFilterHandlers"))F(288),s=!1;let n=o.getColDefColOrCol(t);return n?r?.getModelForColumn(n,s)??null:null}function OP(e,t,s){return e.filterManager?.setColumnFilterModel(t,s)??Promise.resolve()}function BP(e,t){let s=e.colModel.getColDefColOrCol(t);if(!s){X(12,{colKey:t});return}e.menuSvc?.showFilterMenu({column:s,containerType:"columnFilter",positionBy:"auto"})}function VP(e){e.menuSvc?.hideFilterMenu()}function NP(e,t){let s=e.colModel.getColDefColOrCol(t);if(!s){X(12,{colKey:t});return}return e.colFilter?.getHandler(s,!0)}function _P(e,t){let{colModel:s,colFilter:i,gos:o}=e;if(!o.get("enableFilterHandlers")){F(287);return}let{colId:r,action:n}=t;if(r){let a=s.getColById(r);if(a)i?.updateModel(a,n)}else i?.updateAllModels(n)}var uh={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},hh=["january","february","march","april","may","june","july","august","september","october","november","december"];function HP(e,t){if(e==null)return-1;if(t==null)return 1;return Number.parseFloat(e)-Number.parseFloat(t)}function zP(e,t){if(e==null)return-1;if(t==null)return 1;let s=Is(e),i=Is(t);if(s!=null&&i!=null){if(s===i)return 0;return s>i?1:-1}return String(e).localeCompare(String(t))}function gh(e){return e instanceof Date&&!isNaN(e.getTime())}var Pl={number:()=>{return},bigint:()=>{return},boolean:()=>({maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>t===!1,numberOfInputs:0}]}),date:()=>({isValidDate:gh}),dateString:({dataTypeDefinition:e})=>({comparator:(t,s)=>{let i=e.dateParser(s);if(s==null||i<t)return-1;if(i>t)return 1;return 0},isValidDate:(t)=>typeof t==="string"&&gh(e.dateParser(t))}),dateTime:(e)=>Pl.date(e),dateTimeString:(e)=>Pl.dateString(e),object:()=>{return},text:()=>{return}},Ml={number:()=>({comparator:HP}),bigint:()=>({comparator:zP}),boolean:({t:e})=>({valueFormatter:(t)=>M(t.value)?e(String(t.value),t.value?"True":"False"):e("blanks","(Blanks)")}),date:({formatValue:e,t})=>({valueFormatter:(s)=>{let i=e(s);return M(i)?i:t("blanks","(Blanks)")},treeList:!0,treeListFormatter:(s,i)=>{if(s==="NaN")return t("invalidDate","Invalid Date");if(i===1&&s!=null){let o=hh[Number(s)-1];return t(o,uh[o])}return s??t("blanks","(Blanks)")},treeListPathGetter:(s)=>Rs(s,!1)}),dateString:({formatValue:e,dataTypeDefinition:t,t:s})=>({valueFormatter:(i)=>{let o=e(i);return M(o)?o:s("blanks","(Blanks)")},treeList:!0,treeListPathGetter:(i)=>Rs(t.dateParser(i??void 0),!1),treeListFormatter:(i,o)=>{if(o===1&&i!=null){let r=hh[Number(i)-1];return s(r,uh[r])}return i??s("blanks","(Blanks)")}}),dateTime:(e)=>{let t=Ml.date(e);return t.treeListPathGetter=Rs,t},dateTimeString(e){let t=e.dataTypeDefinition.dateParser,s=Ml.dateString(e);return s.treeListPathGetter=(i)=>Rs(t(i??void 0)),s},object:({formatValue:e,t})=>({valueFormatter:(s)=>{let i=e(s);return M(i)?i:t("blanks","(Blanks)")}}),text:()=>{return}};function Kc(e,t,s,i,o,r,n){let a=s,l=e==="agSetColumnFilter";if(!a&&i.baseDataType==="object"&&!l)a=({column:g,node:p})=>o({column:g,node:p,value:r.valueSvc.getValue(g,p,"data")});let d=(l?Ml:Pl)[i.baseDataType],u=d({dataTypeDefinition:i,formatValue:o,t:n});return{filterParams:typeof t==="object"?{...u,...t}:u,filterValueGetter:a}}var WP={boolean:"agTextColumnFilter",date:"agDateColumnFilter",dateString:"agDateColumnFilter",dateTime:"agDateColumnFilter",dateTimeString:"agDateColumnFilter",bigint:"agBigIntColumnFilter",number:"agNumberColumnFilter",object:"agTextColumnFilter",text:"agTextColumnFilter"},UP={boolean:"agTextColumnFloatingFilter",date:"agDateColumnFloatingFilter",dateString:"agDateColumnFloatingFilter",dateTime:"agDateColumnFloatingFilter",dateTimeString:"agDateColumnFloatingFilter",bigint:"agBigIntColumnFloatingFilter",number:"agNumberColumnFloatingFilter",object:"agTextColumnFloatingFilter",text:"agTextColumnFloatingFilter"};function $c(e,t=!1){return(t?UP:WP)[e??"text"]}function jc(e,t,s){if(t==null)return null;let i=null,{compName:o,jsComp:r,fwComp:n}=Rg(e,t);if(o)i={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agBigIntColumnFilter:"agBigIntColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[o];else if(r==null&&n==null&&t.filter===!0)i=s();return i}var KP={filterHandler:()=>({doesFilterPass:()=>!0})};function ph(e,t,s,i){if(!e.isPrimary())return!0;let r=!s;if(!e.isValueActive()||!r)return!1;if(t)return!0;return i}var $P=class extends y{constructor(){super(...arguments);this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...uf},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.addManagedPropertyListener("pivotMode",this.onPivotModeChanged.bind(this));let e=this.gos,t={...e.get("initialState")?.filter?.filterModel??{}};if(this.initialModel=t,this.model={...t},!e.get("enableFilterHandlers"))delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",s){let{colModel:i,dataTypeSvc:o,filterManager:r}=this.beans;if(o?.isPendingInference){this.modelUpdates.push({model:e,source:t});return}let n=[],a=this.getModel(!0);if(e){let l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,d)=>{let u=e[d];n.push(this.setModelOnFilterWrapper(c,u)),l.delete(d)}),l.forEach((c)=>{let d=i.getColDefColOrCol(c);if(!d){F(62,{colId:c});return}if(!d.isFilterAllowed()){F(63,{colId:c});return}let u=this.getOrCreateFilterWrapper(d,!0);if(!u){F(64,{colId:c});return}n.push(this.setModelOnFilterWrapper(u,e[c],!0))})}else this.model={},this.allColumnFilters.forEach((l)=>{n.push(this.setModelOnFilterWrapper(l,null))});B.all(n).then(()=>{let l=this.getModel(!0),c=[];if(this.allColumnFilters.forEach((d,u)=>{let h=a?a[u]:null,g=l?l[u]:null;if(!vn(h,g))c.push(d.column)}),c.length>0)r?.onFilterChanged({columns:c,source:t});else if(s)this.updateActive("filterChanged")})}getModel(e){let t={},{allColumnFilters:s,initialModel:i,beans:{colModel:o}}=this;if(s.forEach((r,n)=>{let a=this.getModelFromFilterWrapper(r);if(M(a))t[n]=a}),!e)for(let r of Object.keys(i)){let n=i[r];if(M(n)&&!s.has(r)&&o.getCol(r)?.isFilterAllowed())t[r]=n}return t}setState(e,t,s="api"){if(this.state.clear(),t)for(let i of Object.keys(t)){let o=t[i];this.state.set(i,{model:Fe(this.model,i),state:o})}this.setModel(e,s,!0)}getState(){let e=this.state;if(!e.size)return;let t={},s=!1;return e.forEach((i,o)=>{let r=i.state;if(r!=null)s=!0,t[o]=r}),s?t:void 0}getModelFromFilterWrapper(e){let s=e.column.getColId();if(e.isHandler)return Fe(this.model,s);let i=e.filter;if(i){if(typeof i.getModel!=="function")return F(66),null;return i.getModel()}return Fe(this.initialModel,s)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};let{allColumnFilters:e}=this;if(e.size)return e.forEach((t)=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0;return!1}updateActiveFilters(){let e=(l)=>{if(!l)return!1;if(!l.isFilterActive)return F(67),!1;return l.isFilterActive()},{colModel:t,gos:s}=this.beans,i=!!qt(s),o=[],r=[],n=(l,c,d)=>{if(c)if(ph(l,t.isPivotMode(),t.isPivotActive(),i))o.push(d);else r.push(d)},a=[];return this.allColumnFilters.forEach((l)=>{let c=l.column,d=c.getColId();if(l.isHandler)a.push(B.resolve().then(()=>{n(c,this.isHandlerActive(c),{colId:d,isHandler:!0,handler:l.handler,handlerParams:l.handlerParams})}));else{let u=Ss(l);if(u)a.push(u.then((h)=>{n(c,e(h),{colId:d,isHandler:!1,comp:h})}))}}),B.all(a).then(()=>{this.activeAggregateFilters=o,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){let s=[];return this.allColumnFilters.forEach((i)=>{let o=i.column;if(i.isHandler)s.push(B.resolve().then(()=>{this.setColFilterActive(o,this.isHandlerActive(o),e,t)}));else{let r=Ss(i);if(r)s.push(r.then((n)=>{this.setColFilterActive(o,n.isFilterActive(),e,t)}))}}),this.beans.groupFilter?.updateFilterFlags(e,t),B.all(s)}doFiltersPass(e,t,s){let{data:i,aggData:o}=e,r=s?this.activeAggregateFilters:this.activeColumnFilters,n=s?o:i,a=this.model;for(let l=0;l<r.length;l++){let c=r[l],{colId:d,isHandler:u}=c;if(d===t)continue;if(u){let{handler:h,handlerParams:g}=c;if(!h.doesFilterPass({node:e,data:n,model:Fe(a,d),handlerParams:g}))return!1}else{let h=c.comp;if(typeof h.doesFilterPass!=="function"){X(91);continue}if(!h.doesFilterPass({node:e,data:n}))return!1}}return!0}getHandlerParams(e){let t=this.allColumnFilters.get(e.getColId());return t?.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){let{rowRenderer:t,filterManager:s}=this.beans,i=()=>{if(this.isAlive())s?.onFilterChanged(e)};if(t.isRefreshInProgress())setTimeout(i,0);else i()}updateBeforeFilterChanged(e={}){let{column:t,additionalEventAttributes:s}=e,i=t?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",s).then(()=>{this.allColumnFilters.forEach((o)=>{let{column:r,isHandler:n}=o;if(i===r.getColId())return;if(n)o.handler.onAnyFilterChanged?.();Ss(o,n)?.then((a)=>{if(typeof a?.onAnyFilterChanged==="function")a.onAnyFilterChanged()})}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){let t=[];this.allColumnFilters.forEach((s)=>{let i=s.isHandler;if(i)s.handler.onNewRowsLoaded?.();let o=Ss(s,i);if(o)t.push(o.then((r)=>{r.onNewRowsLoaded?.()}))}),B.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){let{filterValueSvc:s,colModel:i}=this.beans;return(o,r)=>{let n=r?i.getColDefColOrCol(r):e;return n?s.getValue(n,o,t):void 0}}isFilterActive(e){let t=this.cachedFilter(e);if(t?.isHandler)return this.isHandlerActive(e);let s=t?.filter;if(s)return s.isFilterActive();return Fe(this.initialModel,e.getColId())!=null}isHandlerActive(e){let t=M(Fe(this.model,e.getColId()));if(t)return t;let s=this.beans.groupFilter;return s?.isGroupFilter(e)?s.isFilterActive(e):!1}getOrCreateFilterUi(e){let t=this.getOrCreateFilterWrapper(e,!0);return t?Ss(t):null}getFilterUiForDisplay(e){let t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;let s=Ss(t);if(!s)return null;return s.then((i)=>({comp:i,params:t.filterUi.filterParams,isHandler:t.isHandler}))}getHandler(e,t){let s=this.getOrCreateFilterWrapper(e,t);return s?.isHandler?s.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let s=this.cachedFilter(e);if(!s&&t)s=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,s);return s}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>this.beans.dataTypeSvc?.getBaseDataType(e),t)}getDefaultFilterFromDataType(e,t=!1){if(bw(this.gos))return t?"agSetColumnFloatingFilter":"agSetColumnFilter";return $c(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,s,i,o,r){let n=()=>{let c=this.createFilterCompParams(e,o,r),d=i(c,o);return nc(this.beans.userCompFactory,t,d,s)},a=n();if(!a)return null;return{compDetails:a,createFilterUi:(c)=>(c?n():a).newAgStackInstance()}}createFilterInstance(e,t,s,i){let o=this.beans.selectableFilter;if(o?.isSelectable(t))t=o.getFilterDef(e,t);let{handler:r,handlerParams:n,handlerGenerator:a}=this.createHandler(e,t,s)??{},l=this.createFilterComp(e,t,s,i,!!r,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:r,handlerGenerator:a,handlerParams:n};let{compDetails:c,createFilterUi:d}=l;if(this.isGlobalButtons){if(!c.params?.buttons?.length)F(281,{colId:e.getColId()})}return{compDetails:c,handler:r,handlerGenerator:a,handlerParams:n,createFilterUi:d}}createBaseFilterParams(e,t){let{filterManager:s,rowModel:i}=this.beans;return I(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:(o)=>s?.doesRowPassFilter(o,e.getColId())??!0,rowModel:i})}createFilterCompParams(e,t,s,i){let o=this.filterChangedCallbackFactory(e),r=this.createBaseFilterParams(e,i);if(r.filterChangedCallback=o,r.filterModifiedCallback=i?()=>{}:(n)=>this.filterModified(e,n),t){let n=r,a=e.getColId(),l=Fe(this.model,a);n.model=l,n.state=this.state.get(a)??{model:l},n.onModelChange=(c,d)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,d).then(()=>{o({...d,source:"columnFilter"})})},n.onStateChange=(c)=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},n.onAction=(c,d,u)=>{this.updateModel(e,c,d),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:u})},n.getHandler=()=>this.getHandler(e,!0),n.onUiChange=(c)=>this.filterUiChanged(e,c),n.source=s}return r}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,s){let i=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:i};return i.then(s),o}createFilterWrapper(e){let{compDetails:t,handler:s,handlerGenerator:i,handlerParams:o,createFilterUi:r}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),(a)=>a),n=e.getColId();if(s)return delete this.initialModel[n],s.init?.({...o,source:"init",model:Fe(this.model,n)}),{column:e,isHandler:!0,handler:s,handlerGenerator:i,handlerParams:o,filterUi:this.createFilterUiForHandler(t,r)};if(r){let a={column:e,filterUi:null,isHandler:!1};return a.filterUi=this.createFilterUiLegacy(t,r,(l)=>{a.filter=l??void 0}),a}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,s){let{gos:i,frameworkOverrides:o,registry:r}=this.beans,n,a=(g)=>{let p=g.filter;if(Sg(p)){let f=p.handler;if(f)return f;if(n=p.doesFilterPass,n)return()=>({doesFilterPass:n});return}return typeof p==="string"?p:void 0},l=i.get("enableFilterHandlers"),c=l?a(t):void 0,d=(g)=>()=>this.createBean(r.createDynamicBean(g,!0)),u,h;if(typeof c==="string"){let g=i.get("filterHandlers")?.[c];if(g!=null)u=g;else if(RP.has(c))u=d(c),h=c}else u=c;if(!u){let g,{compName:p,jsComp:f,fwComp:m}=Rg(o,t);if(p)g=p;else if(f==null&&m==null&&t.filter===!0)g=s;if(h=this.handlerMap[g],h)u=d(h)}if(!u){if(!l)return;if(J(i))F(277,{colId:e.getColId()});return KP}return{filterHandler:u,handlerNameOrCallback:n??h}}createHandler(e,t,s){let i=this.createHandlerFunc(e,t,s);if(!i)return;let o=Ma(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:r,filterHandler:n}=i,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,n,o);return{handler:a,handlerParams:l,handlerGenerator:r??n}}createHandlerFromFunc(e,t,s){let i=e.getColDef(),o=t(I(this.gos,{column:e,colDef:i})),r=this.createHandlerParams(e,s);return{handler:o,handlerParams:r}}createHandlerParams(e,t){let s=e.getColDef(),i=e.getColId(),o=this.filterChangedCallbackFactory(e);return I(this.gos,{colDef:s,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:(r)=>this.beans.filterManager?.doesRowPassFilter(r,i)??!0,onModelChange:(r,n)=>{this.updateStoredModel(i,r),this.refreshHandlerAndUi(e,r,"handler",!1,n).then(()=>{o({...n,source:"columnFilter"})})},onModelAsStringChange:()=>{e.dispatchColEvent("filterChanged","filterChanged"),this.dispatchLocalEvent({type:"filterModelAsStringChanged",column:e})},filterParams:t})}onColumnsChanged(){let e=[],{colModel:t,filterManager:s,groupFilter:i}=this.beans;this.allColumnFilters.forEach((r,n)=>{let a;if(r.column.isPrimary())a=t.getColDefCol(n);else a=t.getCol(n);if(a&&a===r.column)return;e.push(r.column),this.disposeFilterWrapper(r,"columnChanged"),this.disposeColumnListener(n)});let o=i&&e.every((r)=>i.isGroupFilter(r));if(e.length>0&&!o)s?.onFilterChanged({columns:e,source:"api"})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;let s=this.beans.groupFilter;if(s?.isGroupFilter(e))return s.isFilterAllowed(e);return!0}getFloatingFilterCompDetails(e,t){let{userCompFactory:s,frameworkOverrides:i,selectableFilter:o,gos:r}=this.beans,n=(g)=>{this.getOrCreateFilterUi(e)?.then((f)=>{g(as(f))})},a=e.getColDef(),l=o?.isSelectable(a)?o.getFilterDef(e,a):a,c=jc(i,l,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",d=r.get("enableFilterHandlers"),u=Ma(s,l,this.createFilterCompParams(e,d,"init",!0)),h=I(r,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:n,showParentFilter:t});if(d){let g=h,p=e.getColId(),f=this.filterChangedCallbackFactory(e);g.onUiChange=(m)=>this.floatingFilterUiChanged(e,m),g.model=Fe(this.model,p),g.onModelChange=(m,C)=>{this.updateStoredModel(p,m),this.refreshHandlerAndUi(e,m,"floating",!0,C).then(()=>{f({...C,source:"columnFilter"})})},g.getHandler=()=>this.getHandler(e,!0),g.source="init"}return ac(s,a,h,c)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,s,i){if(e.isHandler){let r=t.getColId();delete this.initialModel[r],this.state.delete(r);let n=e.filterUi,a=this.createFilterUiForHandler(s,i);e.filterUi=a;let l=this.eventSvc;if(n?.created)n.promise.then((c)=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:"paramsUpdated",column:t})});else l.dispatchEvent({type:"filterHandlerDestroyed",source:"paramsUpdated",column:t})}else this.destroyFilter(t,"paramsUpdated")}destroyFilter(e,t="api"){let s=e.getColId(),i=this.allColumnFilters.get(s);if(this.disposeColumnListener(s),delete this.initialModel[s],i)this.disposeFilterWrapper(i,t).then((o)=>{if(o&&this.isAlive())this.beans.filterManager?.onFilterChanged({columns:[e],source:"api"})})}disposeColumnListener(e){let t=this.allColumnListeners.get(e);if(t)this.allColumnListeners.delete(e),t()}disposeFilterWrapper(e,t){let s=!1,{column:i,isHandler:o,filterUi:r}=e,n=i.getColId();if(o)s=this.isHandlerActive(i),this.destroyBean(e.handler),delete this.model[n],this.state.delete(n);let a=()=>{this.setColFilterActive(i,!1,"filterDestroyed"),this.allColumnFilters.delete(n),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:i})};if(r)if(r.created)return r.promise.then((l)=>(s=o?s:!!l?.isFilterActive(),this.destroyBean(l),a(),s));else a();return B.resolve(s)}filterChangedCallbackFactory(e){return(t)=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:t?.source??"columnFilter"})}}filterParamsChanged(e,t="api"){let s=this.allColumnFilters.get(e);if(!s)return;let i=this.beans,o=s.column,r=o.getColDef(),n=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=i.selectableFilter,c=l?.isSelectable(r)?l.getFilterDef(o,r):r,d=n?this.createHandlerFunc(o,c,this.getDefaultFilter(o)):void 0,u=!!d,h=s.isHandler;if(h!=u){this.destroyFilter(o,"paramsUpdated");return}let{compDetails:g,createFilterUi:p}=(n?this.createFilterComp(o,c,a,(m)=>m,u,"colDef"):null)??{compDetails:null,createFilterUi:null},f=g?.params??Ma(i.userCompFactory,c,this.createFilterCompParams(o,u,"colDef"));if(h){let m=d?.handlerNameOrCallback??d?.filterHandler,C=Fe(this.model,e);if(s.handlerGenerator!=m){let v=s.handler,{handler:w,handlerParams:S}=this.createHandlerFromFunc(o,d.filterHandler,f);if(s.handler=w,s.handlerParams=S,s.handlerGenerator=m,delete this.model[e],w.init?.({...S,source:"init",model:null}),this.destroyBean(v),C!=null)this.beans.filterManager?.onFilterChanged({columns:[o],source:t})}else{let v=this.createHandlerParams(o,g?.params);s.handlerParams=v,s.handler.refresh?.({...v,source:"colDef",model:C})}}if(this.areFilterCompsDifferent(s.filterUi?.compDetails??null,g)||!s.filterUi||!g){this.destroyFilterUi(s,o,g,p);return}s.filterUi.filterParams=f,Ss(s,h)?.then((m)=>{if((m?.refresh?m.refresh(f):!0)===!1)this.destroyFilterUi(s,o,g,p);else this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:f})})}refreshHandlerAndUi(e,t,s,i,o){let r=this.cachedFilter(e);if(!r){if(i)this.getOrCreateFilterWrapper(e,!0);return B.resolve()}if(!r.isHandler)return B.resolve();let{filterUi:n,handler:a,handlerParams:l}=r;return $n(()=>{if(n){let{created:c,filterParams:d}=n;if(c)return n.promise.then((u)=>u?{filter:u,filterParams:d}:void 0);else n.refreshed=!0}return B.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},s,o)}setColumnFilterWrapper(e,t){let s=e.getColId();this.allColumnFilters.set(s,t),this.allColumnListeners.set(s,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(s)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;let{componentClass:s}=e,{componentClass:i}=t;return!(s===i||s?.render&&i?.render&&s.render===i.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some((t)=>t.getColDef().floatingFilter)}getFilterInstance(e){let t=this.beans.colModel.getColDefColOrCol(e);if(!t)return Promise.resolve(void 0);let s=this.getOrCreateFilterUi(t);if(!s)return Promise.resolve(null);return new Promise((i)=>{s.then((o)=>{i(as(o))})})}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:s})=>{this.setModelForColumn(e,t).then(()=>s())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){let{state:i,model:o}=this,r=e.getColId(),n=i.get(r);if(n)return n.model??null;return Fe(o,r)}let s=this.cachedFilter(e);return s?this.getModelFromFilterWrapper(s):null}setModelForColumn(e,t){if(this.beans.dataTypeSvc?.isPendingInference){let s=()=>{},i=new Promise((o)=>{s=o});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),i}return new Promise((s)=>{this.setModelForColumnLegacy(e,t).then((i)=>s(i))})}getStateForColumn(e){return this.state.get(e)??{model:Fe(this.model,e)}}setModelForColumnLegacy(e,t){let s=this.beans.colModel.getColDefCol(e),i=s?this.getOrCreateFilterWrapper(s,!0):null;return i?this.setModelOnFilterWrapper(i,t):B.resolve()}setColDefPropsForDataType(e,t,s){let i=e.filter,o=i===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):i;if(typeof o!=="string")return;let r,n,a=this.beans,{filterParams:l,filterValueGetter:c}=e;if(o==="agMultiColumnFilter")({filterParams:r,filterValueGetter:n}=a.multiFilter?.getParamsForDataType(l,c,t,s)??{});else({filterParams:r,filterValueGetter:n}=Kc(o,l,c,t,s,a,this.getLocaleTextFunc()));if(e.filterParams=r,n)e.filterValueGetter=n}setColFilterActive(e,t,s,i){if(e.filterActive!==t)e.filterActive=t,e.dispatchColEvent("filterActiveChanged",s);e.dispatchColEvent("filterChanged",s,i)}setModelOnFilterWrapper(e,t,s){return new B((i)=>{if(e.isHandler){let r=e.column,n=r.getColId(),a=this.model[n];if(this.updateStoredModel(n,t),s&&t===a){i();return}this.refreshHandlerAndUi(r,t,"api").then(()=>i());return}let o=Ss(e);if(o){o.then((r)=>{if(typeof r?.setModel!=="function"){F(65),i();return}(r.setModel(t)||B.resolve()).then(()=>i())});return}i()})}updateStoredModel(e,t){if(M(t))this.model[e]=t;else delete this.model[e];let s=this.state.get(e),i={model:t,state:s?.state};this.state.set(e,i)}filterModified(e,t){this.getOrCreateFilterUi(e)?.then((s)=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...t})})}filterUiChanged(e,t){if(this.gos.get("enableFilterHandlers"))this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){if(this.gos.get("enableFilterHandlers"))this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,s){let i=e.getColId(),o=this.cachedFilter(e),r=()=>o?.filterUi;fn({action:t,filterParams:o?.filterUi?.filterParams,getFilterUi:r,getModel:()=>Fe(this.model,i),getState:()=>this.state.get(i),updateState:(n)=>this.updateState(e,n),updateModel:(n)=>r()?.filterParams?.onModelChange(n,{...s,fromAction:t}),processModelToApply:o?.isHandler?o.handler.processModelToApply?.bind(o.handler):void 0})}updateAllModels(e,t){let s=[];if(this.allColumnFilters.forEach((i,o)=>{let r=this.beans.colModel.getColDefCol(o);if(r)fn({action:e,filterParams:i.filterUi?.filterParams,getFilterUi:()=>i.filterUi,getModel:()=>Fe(this.model,o),getState:()=>this.state.get(o),updateState:(n)=>this.updateState(r,n),updateModel:(n)=>{this.updateStoredModel(o,n),this.dispatchLocalEvent({type:"filterAction",column:r,action:e}),s.push(this.refreshHandlerAndUi(r,n,"ui"))},processModelToApply:i?.isHandler?i.handler.processModelToApply?.bind(i.handler):void 0})}),s.length)B.all(s).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){let t=e.getColId();hf(()=>this.cachedFilter(e)?.filterUi,()=>Fe(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){let{state:e,model:t,activeFilterComps:s}=this;for(let o of s)if(o.source==="COLUMN_MENU")return!1;let i=!1;for(let o of e.keys()){let r=e.get(o);if(r.valid===!1)return!1;if((r.model??null)!==Fe(t,o))i=!0}return i}hasUnappliedModel(e){let{model:t,state:s}=this;return(s.get(e)?.model??null)!==Fe(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;let s=this.beans.filterPanelSvc;if(s?.isActive)return!!s.getState(e.getColId());return!1}onPivotModeChanged(e){let{colModel:t,pivotColsSvc:s}=this.beans,i=!!qt(this.gos),o=e.currentValue,r=o?this.activeColumnFilters:this.activeAggregateFilters,n=o?this.activeAggregateFilters:this.activeColumnFilters,a=[];for(let l of r){let c=t.getColById(l.colId),d=o&&!!s?.columns.length;if(c&&o===ph(c,o,d,i))n.push(l),a.push(l)}Ho(r,a)}destroy(){super.destroy(),this.allColumnFilters.forEach((e)=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function jP(e){return!!e.filterManager?.isAnyFilterPresent()}function qP(e,t="api"){e.filterManager?.onFilterChanged({source:t})}var YP=class extends y{constructor(){super(...arguments);this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){let e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);if(this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:i})=>this.onAdvFilterEnabledChanged(i),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter)this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});let{gos:s}=this;this.alwaysPassFilter=s.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=s.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){let e=this.gos.getCallback("isExternalFilterPresent");return typeof e==="function"&&e({})}doesExternalFilterPass(e){let t=this.gos.get("doesExternalFilterPass");return typeof t==="function"&&t(e)}setFilterState(e,t,s="api"){if(this.isAdvFilterEnabled())return;this.colFilter?.setState(e,t,s)}setFilterModel(e,t="api",s){if(this.isAdvFilterEnabled()){if(!s)this.warnAdvFilters();return}this.colFilter?.setModel(e,t)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.isAggFilterPresent()}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){if(e){if(this.colFilter?.disableFilters())this.onFilterChanged({source:"advancedFilter"})}else if(this.advancedFilter?.isFilterPresent())this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"})}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){if(qt(this.gos)&&this.isAnyFilterPresent())this.onFilterChanged()}onFilterChanged(e={}){let{source:t,additionalEventAttributes:s,columns:i=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):B.resolve()).then(()=>{let o={source:t,type:"filterChanged",columns:i};if(s)Se(o,s);this.eventSvc.dispatchEvent(o),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!qt(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.pivotMode)&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassAggregateFilters(e){let{rowNode:t}=e;if(this.alwaysPassFilter?.(t))return!0;if(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t))return!1;if(this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))return!1;return!0}doesRowPassFilter(e,t){if(this.alwaysPassFilter?.(e))return!0;if(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(e))return!1;if(this.externalFilterPresent&&!this.doesExternalFilterPass(e))return!1;if(this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(e,t))return!1;if(this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(e))return!1;return!0}isFilterAllowed(e){if(this.isAdvFilterEnabled())return!1;return!!this.colFilter?.isFilterAllowed(e)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){if(!this.isAdvFilterEnabled())return;if(this.beans.dataTypeSvc?.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}toggleAdvFilterBuilder(e,t){if(!this.isAdvFilterEnabled())return;this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){if(!this.isAdvFilterEnabled())return;if(this.advancedFilter.updateValidity())this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){if(this.isAdvFilterEnabled())return!1;return!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(e){if(this.isAdvFilterEnabled())return this.warnAdvFilters(),Promise.resolve(void 0);return this.colFilter?.getFilterInstance(e)??Promise.resolve(void 0)}warnAdvFilters(){F(68)}setupAdvFilterHeaderComp(e){this.advancedFilter?.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(let e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){if(this.isAdvFilterEnabled())return this.warnAdvFilters(),Promise.resolve();return this.colFilter?.setModelForColumn(e,t)??Promise.resolve()}};function XP(e){return{tag:"div",cls:e}}var qc=class extends L{constructor(e){let{className:t="ag-filter-apply-panel"}=e??{};super(XP(t));this.listeners=[],this.validationMessage=null,this.className=t}updateButtons(e,t){let s=this.buttons;if(this.buttons=e,s===e)return;let i=this.getGui();te(i);let o;this.destroyListeners();let r=document.createDocumentFragment(),n=this.className,a=({type:c,label:d})=>{let u=(C)=>{this.dispatchLocalEvent({type:c,event:C})};if(!["apply","clear","reset","cancel"].includes(c))F(75);let h=c==="apply",p=ee({tag:"button",attrs:{type:h&&t?"submit":"button"},ref:`${c}FilterButton`,cls:`ag-button ag-standard-button ${n}-button${h?" "+n+"-apply-button":""}`,children:d});if(this.activateTabIndex([p]),h)o=p;let f=(C)=>{if(C.key===b.ENTER)C.preventDefault(),u(C)},m=this.listeners;p.addEventListener("click",u),m.push(()=>p.removeEventListener("click",u)),p.addEventListener("keydown",f),m.push(()=>p.removeEventListener("keydown",f)),r.append(p)};for(let c of e)a(c);this.eApply=o;let l=this.validationTooltipFeature;if(o&&!l)this.validationTooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eApply,getLocation:()=>"advancedFilter",getTooltipShowDelayOverride:()=>1000}));else if(!o&&l)this.validationTooltipFeature=this.destroyBean(l);i.append(r)}getApplyButton(){return this.eApply}updateValidity(e,t=null){let s=this.eApply;if(!s)return;To(s,!e),this.validationMessage=t,this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage)}destroyListeners(){for(let e of this.listeners)e();this.listeners=[]}destroy(){this.destroyListeners(),super.destroy()}};var Yc=class extends L{constructor(e,t,s,i,o,r){super();this.column=e,this.wrapper=t,this.eventParent=s,this.updateModel=i,this.isGlobalButtons=o,this.enableGlobalButtonCheck=r,this.hidePopup=null,this.applyActive=!1}postConstruct(){let{comp:e,params:t}=this.wrapper,s=t,i=s.useForm,o=i?"form":"div";if(this.setTemplate({tag:o,cls:"ag-filter-wrapper"}),i)this.addManagedElementListeners(this.getGui(),{submit:(r)=>{r?.preventDefault()},keydown:this.handleKeyDown.bind(this)});this.appendChild(e.getGui()),this.params=s,this.resetButtonsPanel(s),this.addManagedListeners(this.eventParent,{filterParamsChanged:({column:r,params:n})=>{if(r===this.column)this.resetButtonsPanel(n,this.params)},filterStateChanged:({column:r,state:n})=>{if(r===this.column)this.eButtons?.updateValidity(n.valid!==!1)},filterAction:({column:r,action:n,event:a})=>{if(r===this.column)this.afterAction(n,a)},...this.enableGlobalButtonCheck?{filterGlobalButtons:({isGlobal:r})=>{if(r!==this.isGlobalButtons){this.isGlobalButtons=r;let n=this.params;this.resetButtonsPanel(n,n,!0)}}}:void 0})}afterGuiAttached(e){if(e)this.hidePopup=e.hidePopup}resetButtonsPanel(e,t,s){let{buttons:i,readOnly:o}=t??{},{buttons:r,readOnly:n,useForm:a}=e;if(!s&&o===n&&vn(i,r))return;let l=r&&r.length>0&&!e.readOnly&&!this.isGlobalButtons,c=this.eButtons;if(l){let d=r.map((u)=>{let h=`${u}Filter`;return{type:u,label:Pt(this,h)}});if(this.applyActive=eo(this.params),!c){c=this.createBean(new qc),this.appendChild(c.getGui());let u=this.column,h=(g)=>({event:p})=>{this.updateModel(u,g,{fromButtons:!0}),this.afterAction(g,p)};c?.addManagedListeners(c,{apply:h("apply"),clear:h("clear"),reset:h("reset"),cancel:h("cancel")}),this.eButtons=c}c.updateButtons(d,a)}else if(this.applyActive=!1,c)Me(c.getGui()),this.eButtons=this.destroyBean(c)}close(e){let t=this.hidePopup;if(!t)return;let s=e,i=s?.key,o;if(i===b.ENTER||i===b.SPACE)o={keyboardEvent:s};t(o),this.hidePopup=null}afterAction(e,t){let{params:s,applyActive:i}=this,o=s?.closeOnApply;switch(e){case"apply":{if(t?.preventDefault(),o&&i)this.close(t);break}case"reset":{if(o&&i)this.close();break}case"cancel":{if(o)this.close(t);break}}}handleKeyDown(e){if(!e.defaultPrevented&&e.key===b.ENTER&&this.applyActive)this.updateModel(this.column,"apply",{fromButtons:!0}),this.afterAction("apply",e)}destroy(){this.hidePopup=null,this.eButtons=this.destroyBean(this.eButtons)}},ZP=":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}",QP={tag:"div",cls:"ag-filter"},Xc=class extends L{constructor(e,t,s){super(QP);this.column=e,this.source=t,this.enableGlobalButtonCheck=s,this.wrapper=null}postConstruct(){this.beans.colFilter?.activeFilterComps.add(this),this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return this.wrapper!=null}getFilter(){return this.wrapper?.then((e)=>e.comp)??null}afterInit(){return this.wrapper?.then(()=>{})??B.resolve()}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.wrapper?.then((t)=>{this.comp?.afterGuiAttached(e),t?.comp?.afterGuiAttached?.(e)})}afterGuiDetached(){this.wrapper?.then((e)=>{e?.comp?.afterGuiDetached?.()})}createFilter(e){let{column:t,source:s,beans:{colFilter:i}}=this,o=i.getFilterUiForDisplay(t)??null;this.wrapper=o,o?.then((r)=>{if(!r)return;let{isHandler:n,comp:a}=r,l;if(n){let c=!!this.enableGlobalButtonCheck,d=this.createBean(new Yc(t,r,i,i.updateModel.bind(i),c&&i.isGlobalButtons,c));this.comp=d,l=d.getGui()}else if(this.registerCSS(ZP),l=a.getGui(),!M(l))F(69,{guiFromFilter:l});if(this.appendChild(l),e)this.eventSvc.dispatchEvent({type:"filterOpened",column:t,source:s,eGui:this.getGui()});else a.afterGuiAttached?.(this.afterGuiAttachedParams)})}onFilterDestroyed(e){let{source:t,column:s}=e;if((t==="api"||t==="paramsUpdated")&&s.getId()===this.column.getId()&&this.beans.colModel.getColDefCol(this.column))te(this.getGui()),this.comp=this.destroyBean(this.comp),this.createFilter()}destroy(){this.beans.colFilter?.activeFilterComps.delete(this),this.eventSvc.dispatchEvent({type:"filterClosed",column:this.column}),this.wrapper=null,this.comp=this.destroyBean(this.comp),this.afterGuiAttachedParams=void 0,super.destroy()}},JP=class extends y{constructor(){super(...arguments);this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(e,t,s,i){if(e&&!e.isColumn)return;this.showPopup(e,(o)=>{this.popupSvc?.positionPopupUnderMouseEvent({additionalParams:{column:e},type:s,mouseEvent:t,ePopup:o})},s,t.target,be(this.gos),i)}showMenuAfterButtonClick(e,t,s,i){if(e&&!e.isColumn)return;let o=-1,r="left",n=be(this.gos);if(!n&&this.gos.get("enableRtl"))o=1,r="right";let a=n?void 0:4*o,l=n?void 0:4;this.showPopup(e,(c)=>{this.popupSvc?.positionPopupByComponent({type:s,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:r,keepWithinBounds:!0,position:"under",additionalParams:{column:e}})},s,t,n,i)}showPopup(e,t,s,i,o,r){let n=e?this.createBean(new Xc(e,"COLUMN_MENU")):void 0;if(this.activeMenu=n,!n?.hasFilter()||!e){X(57);return}let a=ee({tag:"div",cls:`ag-menu${!o?" ag-filter-menu":""}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:(f)=>this.trapFocusWithin(f,a)}),a.appendChild(n?.getGui());let l,c=()=>n?.afterGuiDetached(),d=Ql(this.gos)?i??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,u=(f)=>{_o(e,!1,"contextMenu");let m=f instanceof KeyboardEvent;if(this.tabListener)this.tabListener=this.tabListener();if(m&&i&&ve(i))kn(i)?.focus({preventScroll:!0});c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,s,e),r?.()},h=this.getLocaleTextFunc(),g=o&&s!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=this.popupSvc?.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:u,positionCallback:()=>t(a),anchorToElement:d,ariaLabel:g});if(p)this.hidePopup=l=p.hideFunc;n.afterInit().then(()=>{t(a),n.afterGuiAttached({container:s,hidePopup:l})}),_o(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,s,e)}trapFocusWithin(e,t){if(e.key!==b.TAB||e.defaultPrevented||Ie(this.beans,t,!1,e.shiftKey))return;e.preventDefault(),pe(t,e.shiftKey)}dispatchVisibleChangedEvent(e,t,s){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:s??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.colDef.menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},eM=class extends y{constructor(){super(...arguments);this.beanName="filterValueSvc"}getValue(e,t,s){let i=e.colDef,o=this.beans,r=s??o.selectableFilter?.getFilterValueGetter(e.colId)??i.filterValueGetter,n=o.valueSvc;if(r){let l=typeof r==="function",c=o.expressionSvc;if(!l&&!c)return;let d=o.colModel,u={api:o.gridApi,context:o.gridOptions.context,data:t.data,node:t,column:e,colDef:i,getValue:(h)=>{let g=d.getColDefColOrCol(h);return g?n.getValue(g,t,"data"):null}};return l?r(u):c.evaluate(r,u)}let a=n.getValue(e,t,"data");if(e.colDef.allowFormula){let l=o.formula;if(l?.isFormula(a))return l.resolveValue(e,t)}return a}};var tM=class extends Nn{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){if(this.eInput.disabled)return;if(!this.isSelected())this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){let t=this.eInput;if(e.selected&&e.name&&t.name&&t.name===e.name&&e.id&&t.id!==e.id)this.setValue(!1,!0)}};var Zc=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){let s=e.filterOptions??t;if(this.filterOptions!==s)this.filterOptions=s,this.customFilterOptions={},this.mapCustomOptions();this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){let{filterOptions:e}=this;if(!e)return;for(let t of e){if(typeof t==="string")continue;let s=[["displayKey"],["displayName"],["predicate","test"]],i=(o)=>{if(!o.some((r)=>t[r]!=null))return F(72,{keys:o}),!1;return!0};if(!s.every(i)){this.filterOptions=e.filter((o)=>o===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){let{filterOptions:t}=this;if(e)return e;else if(t.length>=1){let s=t[0];if(typeof s==="string")return s;else if(s.displayKey)return s.displayKey;else F(73)}else F(74);return}getCustomOption(e){return this.customFilterOptions[e]}};function Mo(e,t,s){return s==null?e.splice(t):e.splice(t,s)}function mn(e){return e==null||typeof e==="string"&&e.trim().length===0}function sM(e){return e==="AND"||e==="OR"?e:"AND"}function iM(e,t,s){if(e==null)return;let{predicate:i}=e;if(i!=null&&!t.some((o)=>o==null))return i(t,s)}function oM(e,t){let s=e.length;if(s>t)e.splice(t),F(78),s=t;return s}var rM=new Set(["empty","notBlank","blank","today","yesterday","tomorrow","thisWeek","lastWeek","nextWeek","thisMonth","lastMonth","nextMonth","thisQuarter","lastQuarter","nextQuarter","thisYear","lastYear","nextYear","yearToDate","last7Days","last30Days","last90Days","last6Months","last12Months","last24Months"]);function ui(e,t){let s=t.getCustomOption(e);if(s){let{numberOfInputs:i}=s;return i!=null?i:1}if(e&&rM.has(e))return 0;else if(e==="inRange")return 2;return 1}var Qc=class extends pi{constructor(e,t,s){super(e,"simple-filter");this.mapValuesFromModel=t,this.defaultOptions=s,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);let t=new Zc;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=sM(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions(),Mt(this.getGui(),"tabindex",this.isReadOnly()?"-1":null)}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,s)=>{let i=s===0?e:this.optionsFactory.defaultOption;t.setValue(i,!0)})}getModelFromUi(){let e=this.getUiCompleteConditions();if(e.length===0)return null;if(this.maxNumConditions>1&&e.length>1)return{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e};return e[0]}getConditionTypes(){return this.eTypes.map((e)=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){let{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){let s=!e.operator,i=!t.operator;if(!s&&i||s&&!i)return!1;let r;if(s){let n=e,a=t;r=this.areSimpleModelsEqual(n,a)}else{let n=e,a=t;r=n.operator===a.operator&&se(n.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return r}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),B.resolve();if(e.operator){let i=e,o=i.conditions;if(o==null)o=[],F(77);let r=oM(o,this.maxNumConditions),n=this.getNumConditions();if(r<n)this.removeConditionsAndOperators(r);else if(r>n)for(let l=n;l<r;l++)this.createJoinOperatorPanel(),this.createOption();let a=i.operator==="OR";this.eJoinAnds.forEach((l)=>l.setValue(!a,!0)),this.eJoinOrs.forEach((l)=>l.setValue(a,!0)),o.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{let i=e;if(this.getNumConditions()>1)this.removeConditionsAndOperators(1);this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}if(this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),!t)this.params.onUiChange(this.getUiChangeEventParams());return B.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;if(t<1)F(79),t=1;this.maxNumConditions=t;let s=e.numAlwaysVisibleConditions??1;if(s<1)F(80),s=1;if(s>t)F(81),s=t;this.numAlwaysVisibleConditions=s}createOption(){let e=this.getGui(),t=this.createManagedBean(new qE);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());let s=this.createEValue();this.eConditionBodies.push(s),e.appendChild(s),this.putOptionsIntoDropdown(t),this.resetType(t);let i=this.getNumConditions()-1;this.forEachPositionInput(i,(o)=>this.resetInput(o)),this.addChangedListeners(t,i)}createJoinOperatorPanel(){let e=ee({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);let t=this.createJoinOperator(this.eJoinAnds,e,"and"),s=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);let i=this.eJoinPanels.length-1,o=this.joinOperatorId++;if(this.resetJoinOperatorAnd(t,i,o),this.resetJoinOperatorOr(s,i,o),!this.isReadOnly())t.onValueChange(this.listener),s.onValueChange(this.listener)}createJoinOperator(e,t,s){let i=this.createManagedBean(new tM);e.push(i);let o="ag-filter-condition-operator";return i.addCss(o),i.addCss(`${o}-${s}`),t.appendChild(i.getGui()),i}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map((e)=>typeof e==="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){let{filterListOptions:t}=this;for(let s of t)e.addOption(s);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){let{displayKey:t}=e,s=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:s?this.getLocaleTextFunc()(s.displayKey,s.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){let e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let s=0;s<this.getNumConditions();s++)if(this.isConditionUiComplete(s))e=s;else t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{let s=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<s){this.removeConditionsAndOperators(s+1);let i=e+1,o=s-i;if(o>0)this.removeConditionsAndOperators(i,o);this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((i,o)=>{let r=this.isConditionDisabled(o,e);if(i.setDisabled(r||this.filterListOptions.length<=1),o===1)To(this.eJoinPanels[0],r),this.eJoinAnds[0].setDisabled(r),this.eJoinOrs[0].setDisabled(r)}),this.eConditionBodies.forEach((i,o)=>{G(i,this.isConditionBodyVisible(o))});let s=(t??this.getJoinOperator())==="OR";for(let i of this.eJoinAnds)i.setValue(!s,!0);for(let i of this.eJoinOrs)i.setValue(s,!0);this.forEachInput((i,o,r,n)=>{this.setElementDisplayed(i,o<n),this.setElementDisabled(i,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;let{eTypes:s,eConditionBodies:i,eJoinPanels:o,eJoinAnds:r,eJoinOrs:n}=this;this.removeComponents(s,e,t),this.removeElements(i,e,t),this.removeEValues(e,t);let a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(r,a,t),this.removeComponents(n,a,t)}removeElements(e,t,s){let i=Mo(e,t,s);for(let o of i)Me(o)}removeComponents(e,t,s){let i=Mo(e,t,s);for(let o of i)Me(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus){let t;if(!this.isReadOnly()){let s=this.getInputs(0)[0];if(s instanceof Ai&&this.isConditionBodyVisible(0))t=s.getInputElement();else t=this.eTypes[0]?.getFocusableElement()}(t??this.getGui()).focus({preventScroll:!0})}}shouldKeepInvalidInputState(){return!1}afterGuiDetached(){super.afterGuiDetached();let e=this.params;if(this.beans.colFilter?.shouldKeepStateOnDetach(e.column)||this.shouldKeepInvalidInputState())return;e.onStateChange({model:e.model});let t=-1,s=-1,i=!1,o=this.getJoinOperator();for(let n=this.getNumConditions()-1;n>=0;n--)if(this.isConditionUiComplete(n)){if(t===-1)t=n,s=n}else{let a=n>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(n-1),l=n<t;if(a||l){if(this.removeConditionsAndOperators(n,1),i=!0,l)s--}}let r=!1;if(this.getNumConditions()<this.numAlwaysVisibleConditions)this.createMissingConditionsAndOperators(),r=!0;if(this.shouldAddNewConditionAtEnd(s===this.getNumConditions()-1))this.createJoinOperatorPanel(),this.createOption(),r=!0;if(r)this.updateConditionStatusesAndValues(s,o);if(i)this.updateJoinOperatorsDisabled();this.lastUiCompletePosition=s}getModelAsString(e){return this.params.getHandler()?.getModelAsString?.(e)??""}resetPlaceholder(){let e=this.getLocaleTextFunc(),{filterPlaceholder:t,eTypes:s}=this;this.forEachInput((i,o,r,n)=>{if(!(i instanceof Ai))return;let a=o===0&&n>1?"inRangeStart":o===0?"filterOoo":"inRangeEnd",l=o===0&&n>1?e("ariaFilterFromValue","Filter from value"):o===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value"),c=s[r].getValue(),d=kg(this,t,a,c);i.setInputPlaceholder(d),i.setInputAriaLabel(l)})}setElementValue(e,t,s){if(e instanceof Ai)e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){if(Wi(e))G(e.getGui(),t)}setElementDisabled(e,t){if(Wi(e))To(e.getGui(),t)}attachElementOnChange(e,t){if(e instanceof Ai)e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,s)=>{this.forEachPositionTypeInput(s,t,e)})}forEachPositionInput(e,t){let s=this.getConditionType(e);this.forEachPositionTypeInput(e,s,t)}forEachPositionTypeInput(e,t,s){let i=ui(t,this.optionsFactory),o=this.getInputs(e);for(let r=0;r<o.length;r++){let n=o[r];if(n!=null)s(n,r,e,i)}}isConditionDisabled(e,t){if(this.isReadOnly())return!0;if(e===0)return!1;return e>t+1}isConditionBodyVisible(e){let t=this.getConditionType(e);return ui(t,this.optionsFactory)>0}isConditionUiComplete(e){if(e>=this.getNumConditions())return!1;if(this.getConditionType(e)==="empty")return!1;if(this.getValues(e).some((s)=>s==null))return!1;if(this.positionHasInvalidInputs(e))return!1;return!0}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){let e=[];for(let t=0;t<this.getNumConditions();t++)if(this.isConditionUiComplete(t))e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(this.isReadOnly())return;for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){if(this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach((t)=>this.resetType(t)),this.eJoinAnds.forEach((t,s)=>this.resetJoinOperatorAnd(t,s,this.joinOperatorId+s)),this.eJoinOrs.forEach((t,s)=>this.resetJoinOperatorOr(t,s,this.joinOperatorId+s)),this.joinOperatorId++,this.forEachInput((t)=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),!e)this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){let s=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(s).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,s){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),s)}resetJoinOperatorOr(e,t,s){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),s)}resetJoinOperator(e,t,s,i,o){this.updateJoinOperatorDisabled(e.setValue(s,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(i),t)}updateJoinOperatorsDisabled(){let e=(t,s)=>this.updateJoinOperatorDisabled(t,s);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){let s=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((i,o,r)=>{if(r!==t)return;this.setElementValue(i,s[o]!=null?s[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,s,i)=>{this.setElementValue(t,s===0&&i===0?e:null,!0)})}addChangedListeners(e,t){if(this.isReadOnly())return;e.onValueChange(this.listener),this.forEachPositionInput(t,(s)=>{this.attachElementOnChange(s,this.listener)})}hasInvalidInputs(){return!1}positionHasInvalidInputs(e){return!1}isReadOnly(){return!!this.params.readOnly}};var gf=class extends y{constructor(e,t){super();this.mapValuesFromModel=e,this.defaultOptions=t}init(e){let t=e.filterParams,s=new Zc;this.optionsFactory=s,s.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(s,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){let t=e.filterParams,s=this.optionsFactory;s.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:s,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){let t=e.model;if(t==null)return!0;let{operator:s}=t,i=[];if(s){let n=t;i.push(...n.conditions??[])}else i.push(t);let o=s&&s==="OR"?"some":"every",r=this.params.getValue(e.node);return i[o]((n)=>this.individualConditionPasses(e,n,r))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){let{model:t,filterParams:{filterOptions:s,maxNumConditions:i}}=e;if(t==null)return;let r=Fg(t)?t.conditions:[t],n=s?.map((d)=>typeof d==="string"?d:d.displayKey)??this.defaultOptions;if(!(!r||r.every((d)=>n.find((u)=>u===d.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1,c=this.filterType;if(r&&!r.every((d)=>d.filterType===c)||t.filterType!==c)r=r.map((d)=>({...d,filterType:c})),l=!0;if(typeof i==="number"&&r&&r.length>i)r=r.slice(0,i),l=!0;if(l){let d=r.length>1?{...t,filterType:c,conditions:r}:{...r[0],filterType:c};this.params={...e,model:d},e.onModelChange(d)}}individualConditionPasses(e,t,s){let i=this.optionsFactory,o=this.mapValuesFromModel(t,i),r=i.getCustomOption(t.type),n=iM(r,o,s);if(n!=null)return n;if(s==null)return this.evaluateNullValue(t.type);return this.evaluateNonNullValue(o,s,t,e)}},pf=class extends gf{evaluateNullValue(e){let{includeBlanksInEquals:t,includeBlanksInNotEqual:s,includeBlanksInGreaterThan:i,includeBlanksInLessThan:o,includeBlanksInRange:r}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(s)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(i)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(r)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,s){let i=s.type;if(!this.isValid(t))return i==="notEqual"||i==="notBlank";let o=this.comparator(),r=e[0]!=null?o(e[0],t):0;switch(i){case"equals":return r===0;case"notEqual":return r!==0;case"greaterThan":return r>0;case"greaterThanOrEqual":return r>=0;case"lessThan":return r<0;case"lessThanOrEqual":return r<=0;case"inRange":{let n=o(e[1],t);return this.params.filterParams.inRangeInclusive?r>=0&&n<=0:r>0&&n<0}case"blank":return mn(t);case"notBlank":return!mn(t);default:return F(76,{filterModelType:i}),!0}}},ff={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},nM={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},Jc=class extends y{constructor(e,t,s){super();this.optionsFactory=e,this.filterParams=t,this.valueFormatter=s}getModelAsString(e,t){let s=this.getLocaleTextFunc(),i=t==="filterToolPanel";if(!e)return i?Pt(this,"filterSummaryInactive"):null;if(e.operator!=null){let r=e,a=(r.conditions??[]).map((c)=>this.getModelAsString(c,t)),l=r.operator==="AND"?"andCondition":"orCondition";return a.join(` ${Pt(this,l)} `)}else if(e.type==="blank"||e.type==="notBlank")return i?Pt(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):s(e.type,e.type);else{let r=e,n=this.optionsFactory.getCustomOption(r.type),{displayKey:a,displayName:l,numberOfInputs:c}=n||{};if(a&&l&&c===0)return s(a,l);return this.conditionToString(r,i,r.type==="inRange"||c===2,a,l)}}updateParams(e){let{optionsFactory:t,filterParams:s}=e;this.optionsFactory=t,this.filterParams=s}conditionForToolPanel(e,t,s,i,o,r){let n,a=this.getTypeKey(e);if(a)n=Pt(this,a);if(o&&r)n=this.getLocaleTextFunc()(o,r);if(n!=null)if(t)return`${n} ${Pt(this,"filterSummaryInRangeValues",[s(),i()])}`;else return`${n} ${s()}`;return null}getTypeKey(e){let t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){let t=this.valueFormatter;return t?t(e??null)??"":String(e)}};var mf=class extends y{constructor(e){super();this.params=e,this.eInput=E,this.onValueChanged=()=>{}}setupGui(e){this.eInput=this.createManagedBean(new io(this.params?.config));let t=this.eInput.getGui();e.appendChild(t);let s=(i)=>this.onValueChanged(i);this.addManagedListeners(t,{input:s,keydown:s})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t,placeholder:s}){let{eInput:i}=this;if(i.setInputAriaLabel(e),t!==void 0)i.setAutoComplete(t);i.toggleCss("ag-floating-filter-search-icon",!!s),i.setInputPlaceholder(s)}};function Tl(e){let t=e?.trim();return t===""?e:t}function Cf(e,t){let{filter:s,filterTo:i,type:o}=e||{};return[s||null,i||null].slice(0,ui(o,t))}var vf=class extends L{constructor(){super(...arguments);this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}let t=e.operator,s;if(t)s=e.conditions[0];else s=e;this.lastType=s.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;let s=e;return this.isTypeEditable(s.type)}init(e){this.params=e;let t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){let s=e;this.onModelUpdated(s.model)}}setParams(e){let t=new Zc;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){let s=this.optionsFactory.defaultOption;if(!t)this.lastType=s;this.readOnly=!!e.filterParams.readOnly;let i=this.isTypeEditable(s);this.setEditable(i)}refresh(e){this.params=e;let t=e,s=this.reactive;if(!s||t.source==="colDef")this.updateParams(e);if(s){let{source:i,model:o}=t;if(i==="dataChanged"||i==="ui")return;this.onModelUpdated(o)}}updateParams(e){let t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){if(t?.afterFloatingFilter||t?.afterDataChange)return;this.onModelUpdated(e)}isTypeEditable(e){return!!e&&!this.readOnly&&ui(e,this.optionsFactory)===1}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},aM={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},wf=class extends vf{constructor(){super(...arguments);this.eFloatingFilterInputContainer=E,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(aM)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){let{inputSvc:t,defaultDebounceMs:s,readOnly:i}=this,{filterPlaceholder:o,column:r,browserAutoComplete:n,filterParams:a}=e,l=this.lastType??this.optionsFactory.defaultOption,c=e.filterParams.filterPlaceholder,d=o===!0?kg(this,c,"filterOoo",l):o||void 0;if(t.setParams({ariaLabel:this.getAriaLabel(r),autoComplete:n??!1,placeholder:d}),this.applyActive=eo(a),!i){let u=uc(a,s);t.setValueChangedListener($e(this,this.syncUpWithParentFilter.bind(this),u))}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){let{inputSvc:t}=this,s=t.getValue();te(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(s,!0)}syncUpWithParentFilter(e){let t=e.key===b.ENTER,s=this.reactive;if(s)this.params.onUiChange();if(this.applyActive&&!t)return;let{inputSvc:i,params:o,lastType:r}=this,n=i.getValue();if(o.filterParams.trimInput)n=Tl(n),i.setValue(n,!0);if(s){let a=o,l=a.model,c=this.convertValue(n),d=c==null?null:{...l??{filterType:this.filterType,type:r??this.optionsFactory.defaultOption},filter:c};a.onModelChange(d,{afterFloatingFilter:!0})}else o.parentFilterInstance((a)=>{a?.onFloatingFilterChanged(r||null,n||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}};var fh=".ag-input-field-input",bf=class{constructor(e,t,s,i,o,r){this.context=e,this.eParent=o,this.alive=!0,this.debouncedReport=$e({isAlive:()=>this.alive},mh,500),this.timeoutHandle=null,fb(t,s,i)?.newAgStackInstance().then((a)=>{if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),a?.afterGuiAttached?.();let{tempValue:l,disabled:c}=this;if(l)a.setDate(l);if(c!=null)a.setDisabled?.(c);r?.(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){let t=this.dateComp;if(t)t.setDate(e);else this.tempValue=e}setDisabled(e){let t=this.dateComp;if(t)t.setDisabled?.(e);else this.disabled=e}setDisplayed(e){G(this.eParent,e)}setInputPlaceholder(e){this.dateComp?.setInputPlaceholder?.(e)}setInputAriaLabel(e){this.dateComp?.setInputAriaLabel?.(e)}afterGuiAttached(e){this.dateComp?.afterGuiAttached?.(e)}updateParams(e){this.dateComp?.refresh?.(e)}setCustomValidity(e,t=!1){let s=this.dateComp?.getGui().querySelector(fh);if(s&&"setCustomValidity"in s){let i=e.length>0;if(s.setCustomValidity(e),i)if(t)this.timeoutHandle=this.debouncedReport(s);else mh(s);else if(this.timeoutHandle)window.clearTimeout(this.timeoutHandle);Vl(s,i)}}getValidity(){return this.dateComp?.getGui().querySelector(fh)?.validity}};function mh(e){e.reportValidity()}var ed=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function Sf(e,t){let{dateFrom:s,dateTo:i,type:o}=e||{};return[s&&He(s,void 0,!0)||null,i&&He(i,void 0,!0)||null].slice(0,ui(o,t))}var Ch=1000,vh=1/0,lM=class extends Qc{constructor(){super("dateFilter",Sf,ed);this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=Ch,this.maxValidYear=vh,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e),this.refreshInputValidation()}shouldKeepInvalidInputState(){return!li()&&this.hasInvalidInputs()&&this.getConditionTypes().includes("inRange")}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);let t=(l,c)=>{let d=e[l];if(d!=null)if(!isNaN(d))return d==null?c:Number(d);else F(82,{param:l});return c},s=t("minValidYear",Ch),i=t("maxValidYear",vh);if(this.minValidYear=s,this.maxValidYear=i,s>i)F(83);let{minValidDate:o,maxValidDate:r}=e,n=o instanceof Date?o:He(o);this.minValidDate=n;let a=r instanceof Date?r:He(r);if(this.maxValidDate=a,n&&a&&n>a)F(84)}refreshInputValidation(){for(let e=0;e<this.dateConditionFromComps.length;e++)this.refreshInputPairValidation(e,!1,!0)}refreshInputPairValidation(e,t=!1,s=!1){let{dateConditionFromComps:i,dateConditionToComps:o,beans:r}=this,n=i[e],a=o[e],l=ui(this.getConditionType(e),this.optionsFactory),c=n.getDate(),d=a.getDate(),u=l>=2?cM(c,d,t):null,h=u?this.translate(u,[String(t?d:c)]):"",g=!li()&&!s;if((t?n:a).setCustomValidity(h,g),(t?a:n).setCustomValidity("",g),h.length>0)r.ariaAnnounce.announceValue(h,"dateFilter")}createDateCompWrapper(e,t,s){let{beans:{userCompFactory:i,context:o,gos:r},params:n}=this,a=s==="from",l=new bf(o,i,n.colDef,I(r,{onDateChanged:()=>{this.refreshInputPairValidation(t,a),this.onUiChanged()},onFocusIn:()=>this.refreshInputPairValidation(t,a),filterParams:n,location:"filter"}),e);return this.addDestroyFunc(()=>l.destroy()),l}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}setElementValue(e,t){if(e.setDate(t),!t)e.setCustomValidity("")}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){let e=ee({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,s,i){let o=ee({tag:"div",cls:`ag-filter-${i} ag-filter-date-${i}`});t.push(o),e.appendChild(o),s.push(this.createDateCompWrapper(o,t.length-1,i))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),Mo(this.eConditionPanelsFrom,e,t),Mo(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,s){let i=Mo(e,t,s);for(let o of i)o.destroy()}isValidDateValue(e){if(e===null)return!1;let{minValidDate:t,maxValidDate:s,minValidYear:i,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<i)return!1;if(s){if(e>s)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}hasInvalidInputs(){let e=!1;return this.forEachInput((t)=>e||(e=t.getDate()!=null&&!(t.getValidity()?.valid??!0))),e}positionHasInvalidInputs(e){let t=!1;return this.forEachPositionInput(e,(s)=>t||(t=!(s.getValidity()?.valid??!0))),t}canApply(e){return!this.hasInvalidInputs()}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachPositionInput(e,(s,i,o,r)=>{if(!t||i>=r)return;t&&(t=this.isValidDateValue(s.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){let t=this.getConditionType(e),s={},{params:i,filterType:o}=this,r=this.getValues(e),n=i.useIsoSeparator?"T":" ";if(r.length>0)s.dateFrom=rs(r[0],!0,n);if(r.length>1)s.dateTo=rs(r[1],!0,n);return{dateFrom:null,dateTo:null,filterType:o,type:t,...s}}removeConditionsAndOperators(e,t){if(this.hasInvalidInputs())return;return super.removeConditionsAndOperators(e,t)}resetPlaceholder(){let e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),s=e("ariaFilterValue","Filter Value");this.forEachInput((i)=>{i.setInputPlaceholder(t),i.setInputAriaLabel(s)})}getInputs(e){let{dateConditionFromComps:t,dateConditionToComps:s}=this;if(e>=t.length)return[null,null];return[t[e],s[e]]}getValues(e){let t=[];return this.forEachPositionInput(e,(s,i,o,r)=>{if(i<r)t.push(s.getDate())}),t}translate(e,t){let s=e;if(e==="lessThan")s="before";else if(e==="greaterThan")s="after";return super.translate(s,t)}};function cM(e,t,s){if(!(e!=null&&t!=null&&e>=t))return null;return`${s?"max":"min"}DateValidation`}var yf=class extends Jc{constructor(e,t){super(e,t,(s)=>{let{dataTypeSvc:i,valueSvc:o}=this.beans,r=t.column,n=i?.getDateFormatterFunction(r),a=n?n(s??void 0):s;return o.formatValue(r,null,a)});this.filterTypeKeys=ff}conditionToString(e,t,s,i,o){let{type:r}=e,n=He(e.dateFrom),a=He(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):(h)=>P0(h,l),d=()=>n!==null?c(n):"null",u=()=>a!==null?c(a):"null";if(n==null&&a==null)return Pt(this,r);if(t){let h=this.conditionForToolPanel(r,s,d,u,i,o);if(h!=null)return h}if(s)return`${d()}-${u()}`;if(n!=null)return c(n);return`${r}`}};function dM(e,t){let s=t;if(s<e)return-1;if(s>e)return 1;return 0}var uM=class extends pf{constructor(){super(Sf,ed);this.filterType="date",this.FilterModelFormatterClass=yf,this.filterTypeToRangeCache=new Map}getOrRefreshRangeCacheItem(e,t){let{filterTypeToRangeCache:s}=this,i=Date.now(),o=s.get(e);if(o&&o.expires<i)o=void 0;if(!o){let[r,n]=t(new Date(i),new Date(i));o={from:r,to:n,expires:bt(new Date(i)).getTime()-i},s.set(e,o)}return o}comparator(){return this.params.filterParams.comparator??dM}isValid(e){let t=this.params.filterParams.isValidDate;return!t||t(e)}evaluateNonNullValue(e,t,s){let i=s.type,o=this.comparator();if(!this.isValid(t))return i==="notEqual"||i==="notBlank";let r=i,n=AM[r];if(n){let{from:a,to:l}=this.getOrRefreshRangeCacheItem(r,n);return o(a,t)>=0&&o(l,t)<0}return super.evaluateNonNullValue(e,t,s)}},hM=1,Br=null,gM=()=>{if(Br!=null)return Br;let e,t=typeof navigator>"u"?void 0:navigator.languages?.[0]??navigator.language;if(t&&typeof Intl<"u"&&typeof Intl.Locale==="function")try{e=new Intl.Locale(t).getWeekInfo?.()?.firstDay}catch{e=void 0}return Br=e==null?hM:e%7,Br},tt=(e)=>(e.setHours(0,0,0,0),e),jn=(e)=>{let t=e.getDay(),s=gM(),i=(t-s+7)%7;return e.setDate(e.getDate()-i),tt(e)},qn=(e,t=1)=>(e.setDate(e.getDate()-t),e),bt=(e)=>(e.setDate(e.getDate()+1),tt(e)),xf=(e)=>(jn(e),e.setDate(e.getDate()+6),bt(e)),Yn=(e)=>(e.setDate(1),tt(e)),td=(e)=>(e.setDate(1),e.setMonth(e.getMonth()+1),tt(e)),sd=(e)=>{let t=Math.floor(e.getMonth()/3);return e.setMonth(t*3),Yn(e)},Rf=(e)=>{let t=Math.floor(e.getMonth()/3);return e.setMonth(t*3+2),td(e)},id=(e)=>(e.setMonth(0,1),tt(e)),Ff=(e)=>(e.setMonth(12,0),bt(e)),qi=(e)=>qn(e),Dl=(e)=>qi(jn(e)),Al=(e)=>qi(Yn(e)),Il=(e)=>qi(sd(e)),od=(e,t)=>[tt(e),bt(t)],pM=(e,t)=>od(qi(e),qi(t)),rd=(e,t)=>[jn(e),xf(t)],fM=(e,t)=>rd(Dl(e),Dl(t)),nd=(e,t)=>[Yn(e),td(t)],mM=(e,t)=>nd(Al(e),Al(t)),ad=(e,t)=>[sd(e),Rf(t)],CM=(e,t)=>ad(Il(e),Il(t)),ld=(e,t)=>[id(e),Ff(t)],vM=(e,t)=>[id(e),bt(t)],wM=(e,t)=>[tt(qn(e,7)),bt(t)],bM=(e,t)=>[tt(qn(e,30)),bt(t)],SM=(e,t)=>[tt(qn(e,90)),bt(t)],yM=(e,t)=>(e.setFullYear(e.getFullYear()-1),e.setMonth(e.getMonth()+6),[tt(e),bt(t)]),xM=(e,t)=>(e.setFullYear(e.getFullYear()-1),[tt(e),bt(t)]),RM=(e,t)=>(e.setFullYear(e.getFullYear()-2),[tt(e),bt(t)]),FM=(e,t)=>(e.setFullYear(e.getFullYear()-1),t.setFullYear(t.getFullYear()-1),ld(e,t)),EM=(e,t)=>(e.setFullYear(e.getFullYear()+1),t.setFullYear(t.getFullYear()+1),ld(e,t)),PM=(e,t)=>(e.setMonth(e.getMonth()+3),t.setMonth(t.getMonth()+3),ad(e,t)),MM=(e,t)=>(e.setMonth(e.getMonth()+1),t.setMonth(t.getMonth()+1),nd(e,t)),TM=(e,t)=>(e.setDate(e.getDate()+7),t.setDate(t.getDate()+7),rd(e,t)),DM=(e,t)=>(e.setDate(e.getDate()+1),t.setDate(t.getDate()+1),od(e,t)),AM={today:od,yesterday:pM,tomorrow:DM,thisWeek:rd,lastWeek:fM,nextWeek:TM,thisMonth:nd,lastMonth:mM,nextMonth:MM,thisQuarter:ad,lastQuarter:CM,nextQuarter:PM,thisYear:ld,lastYear:FM,nextYear:EM,yearToDate:vM,last7Days:wM,last30Days:bM,last90Days:SM,last6Months:yM,last12Months:xM,last24Months:RM,setStartOfDay:tt,setStartOfWeek:jn,setStartOfNextDay:bt,setStartOfNextWeek:xf,setStartOfMonth:Yn,setStartOfNextMonth:td,setStartOfQuarter:sd,setStartOfNextQuarter:Rf,setStartOfYear:id,setStartOfNextYear:Ff,setPreviousDay:qi,setPreviousWeek:Dl,setPreviousMonth:Al,setPreviousQuarter:Il},IM={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},kM=class extends vf{constructor(){super(IM,[us]);this.eReadOnlyText=E,this.eDateWrapper=E,this.FilterModelFormatterClass=yf,this.filterType="date",this.defaultOptions=ed}setParams(e){super.setParams(e),this.createDateComponent();let t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){let t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){let s=e?He(e.dateFrom):null;this.dateComp.setDate(s),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){G(this.eDateWrapper,e),G(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){let e=this.dateComp.getDate();if(this.reactive){let t=this.params;t.onUiChange();let s=t.model,i=rs(e),o=i==null?null:{...s??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:i};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance((t)=>{t?.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){let{filterParams:e}=this.params,t=uc(e,this.defaultDebounceMs);return I(this.gos,{onDateChanged:$e(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){let{beans:{context:e,userCompFactory:t},eDateWrapper:s,params:{column:i}}=this;this.dateComp=new bf(e,t,i.getColDef(),this.getDateComponentParams(),s,(o)=>{o.setInputAriaLabel(this.getAriaLabel(i))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},LM={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},GM=class extends L{constructor(){super(LM,[us]);this.eDateInput=E,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);let t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{if(this.eDateInput.isDisabled()||this.usingSafariDatePicker)return;t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this),focusin:this.handleFocusIn.bind(this)})}handleInput(e){if(this.eDateInput.isDisabled())return;if(this.isApply){if(this.applyOnFocusOut=!e,e)this.params.onDateChanged();return}if(!e)this.params.onDateChanged()}handleFocusOut(){if(this.applyOnFocusOut)this.applyOnFocusOut=!1,this.params.onDateChanged()}handleFocusIn(){this.params.onFocusIn?.()}setParams(e){let t=this.eDateInput.getInputElement(),s=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=s&&Os();let{minValidYear:i,maxValidYear:o,minValidDate:r,maxValidDate:n,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},d=this.beans.dataTypeSvc,u=l??d?.getDateIncludesTimeFlag?.(c.cellDataType)??!1;if(s)if(u)t.type="datetime-local",t.step="1";else t.type="date";else t.type="text";let h=wh(r,i,!0),g=wh(n,o,!1);if(h&&g&&h.getTime()>g.getTime())F(87);if(h)t.min=rs(h,u);if(g)t.max=rs(g,u);this.isApply=e.location==="floatingFilter"&&!!a?.includes("apply")}refresh(e){this.params=e,this.setParams(e)}getDate(){return He(this.eDateInput.getValue())}setDate(e){let t=this.params.filterParams.colDef.cellDataType,s=this.beans.dataTypeSvc?.getDateIncludesTimeFlag(t)??!1;this.eDateInput.setValue(rs(e,s))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){if(!e?.suppressFocus)this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){return e?.filterParams?.browserDatePicker??!0}};function wh(e,t,s){if(e&&t)F(s?85:86);if(e instanceof Date)return e;if(e)return He(e);else if(t)return He(`${t}-${s?"01-01":"12-31"}`);return null}var cd=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function kl(e){return e?.allowedCharPattern??null}function Cn(e){if(e==null)return null;return isNaN(e)?null:e}function Ef(e,t){let{filter:s,filterTo:i,type:o}=e||{};return[Cn(s),Cn(i)].slice(0,ui(o,t))}var OM=class extends Qc{constructor(){super("numberFilter",Ef,cd);this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}afterGuiAttached(e){super.afterGuiAttached(e),this.refreshInputValidation()}shouldKeepInvalidInputState(){return!li()&&this.hasInvalidInputs()&&this.getConditionTypes().includes("inRange")}refreshInputValidation(){for(let e=0;e<this.eValuesFrom.length;e++){let t=this.eValuesFrom[e],s=this.eValuesTo[e];this.refreshInputPairValidation(t,s)}}refreshInputPairValidation(e,t,s=!1){let i=this.params.numberParser,o=bh(i,e),r=bh(i,t),n=BM(o,r,s),a=n?this.translate(n,[String(s?r:o)]):"";if((s?e:t).setCustomValidity(a),(s?t:e).setCustomValidity(""),a.length>0)this.beans.ariaAnnounce.announceValue(a,"dateFilter")}getState(){return{isInvalid:this.hasInvalidInputs()}}areStatesEqual(e,t){return(e?.isInvalid??!1)===(t?.isInvalid??!1)}refresh(e){let t=super.refresh(e),{state:s,additionalEventAttributes:i}=e,o=this.state,r=i?.fromAction;if(r&&r!="apply"||s.model!==o.model||!this.areStatesEqual(s.state,o.state))this.refreshInputValidation();return t}setElementValue(e,t,s){let{numberFormatter:i}=this.params,o=!s&&i?i(t??null):t;if(super.setElementValue(e,o),o===null)e.setCustomValidity("")}createEValue(){let{params:e,eValuesFrom:t,eValuesTo:s}=this,i=kl(e),o=ee({tag:"div",cls:"ag-filter-body",role:"presentation"}),r=this.createFromToElement(o,t,"from",i),n=this.createFromToElement(o,s,"to",i),a=(d,u,h)=>()=>this.refreshInputPairValidation(d,u,h),l=a(r,n,!0);r.onValueChange(l),r.addGuiEventListener("focusin",l);let c=a(r,n,!1);return n.onValueChange(c),n.addGuiEventListener("focusin",c),o}createFromToElement(e,t,s,i){let o=this.createManagedBean(i?new io({allowedCharPattern:i}):new sf);return o.addCss(`ag-filter-${s}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui()),o}removeEValues(e,t){let s=(i)=>this.removeComponents(i,e,t);s(this.eValuesFrom),s(this.eValuesTo)}getValues(e){let t=[];return this.forEachPositionInput(e,(s,i,o,r)=>{if(i<r)t.push(Cn(Pf(this.params.numberParser,s.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}createCondition(e){let t=this.getConditionType(e),s={filterType:this.filterType,type:t},i=this.getValues(e);if(i.length>0)s.filter=i[0];if(i.length>1)s.filterTo=i[1];return s}removeConditionsAndOperators(e,t){if(this.hasInvalidInputs())return;return super.removeConditionsAndOperators(e,t)}getInputs(e){let{eValuesFrom:t,eValuesTo:s}=this;if(e>=t.length)return[null,null];return[t[e],s[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput((t)=>e||(e=!t.getInputElement().validity.valid)),e}positionHasInvalidInputs(e){let t=!1;return this.forEachPositionInput(e,(s)=>t||(t=!s.getInputElement().validity.valid)),t}canApply(e){return!this.hasInvalidInputs()}};function Pf(e,t){if(typeof t==="number")return t;let s=de(t);if(s?.trim()==="")s=null;if(e)return e(s);return s==null||s.trim()==="-"?null:Number.parseFloat(s)}function bh(e,t){return Cn(Pf(e,t.getValue(!0)))}function BM(e,t,s){if(!(e!=null&&t!=null&&e>=t))return null;return`strict${s?"Max":"Min"}ValueValidation`}var Mf=class extends Jc{constructor(e,t){super(e,t,t.numberFormatter);this.filterTypeKeys=ff}conditionToString(e,t,s,i,o){let{filter:r,filterTo:n,type:a}=e,l=this.formatValue.bind(this);if(t){let c=this.conditionForToolPanel(a,s,()=>l(r),()=>l(n),i,o);if(c!=null)return c}if(s)return`${l(r)}-${l(n)}`;if(r!=null)return l(r);return`${a}`}},VM=class extends pf{constructor(){super(Ef,cd);this.filterType="number",this.FilterModelFormatterClass=Mf}comparator(){return(e,t)=>{if(e===t)return 0;return e<t?1:-1}}isValid(e){return!isNaN(e)}},NM=class extends y{constructor(){super(...arguments);this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new sf),this.eTextInput=this.createManagedBean(new io),this.eTextInput.setDisabled(!0);let t=this.eNumberInput.getGui(),s=this.eTextInput.getGui();e.appendChild(t),e.appendChild(s),this.setupListeners(t,(i)=>this.onValueChanged(i)),this.setupListeners(s,(i)=>this.onValueChanged(i))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams({ariaLabel:e,autoComplete:t,placeholder:s}){if(this.setAriaLabel(e),t!==void 0)this.setAutoComplete(t);this.setPlaceholder(this.eNumberInput,s),this.setPlaceholder(this.eTextInput,s)}setPlaceholder(e,t){e.toggleCss("ag-floating-filter-search-icon",!!t),e.setInputPlaceholder(t)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},_M=class extends wf{constructor(){super(...arguments);this.FilterModelFormatterClass=Mf,this.filterType="number",this.defaultOptions=cd}updateParams(e){if(kl(e.filterParams)!==this.allowedCharPattern)this.recreateFloatingFilterInputService(e);super.updateParams(e)}createFloatingFilterInputService(e){if(this.allowedCharPattern=kl(e.filterParams),this.allowedCharPattern)return this.createManagedBean(new mf({config:{allowedCharPattern:this.allowedCharPattern}}));return this.createManagedBean(new NM)}convertValue(e){return e?Number(e):null}},dd=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],HM=class extends Qc{constructor(){super("textFilter",Cf,dd);this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){let t=this.getConditionType(e),s={filterType:this.filterType,type:t},i=this.getValues(e);if(i.length>0)s.filter=i[0];if(i.length>1)s.filterTo=i[1];return s}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){let{eValuesFrom:t,eValuesTo:s}=this;if(e>=t.length)return[null,null];return[t[e],s[e]]}getValues(e){let t=[];return this.forEachPositionInput(e,(s,i,o,r)=>{if(i<r)t.push(de(s.getValue()))}),t}createEValue(){let e=ee({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:s}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,s,"to"),e}createFromToElement(e,t,s){let i=this.createManagedBean(new io);i.addCss(`ag-filter-${s}`),i.addCss("ag-filter-filter"),t.push(i),e.appendChild(i.getGui())}removeEValues(e,t){let s=(r)=>this.removeComponents(r,e,t),{eValuesFrom:i,eValuesTo:o}=this;s(i),s(o)}},Tf=class extends Jc{constructor(){super(...arguments);this.filterTypeKeys=nM}conditionToString(e,t,s,i,o){let{filter:r,filterTo:n,type:a}=e;if(t){let l=(d)=>()=>Pt(this,"filterSummaryTextQuote",[d]),c=this.conditionForToolPanel(a,s,l(r),l(n),i,o);if(c!=null)return c}if(s)return`${r}-${n}`;if(r!=null)return`${r}`;return`${a}`}},zM=({filterOption:e,value:t,filterText:s})=>{if(s==null)return!1;switch(e){case"contains":return t.includes(s);case"notContains":return!t.includes(s);case"equals":return t===s;case"notEqual":return t!=s;case"startsWith":return t.indexOf(s)===0;case"endsWith":{let i=t.lastIndexOf(s);return i>=0&&i===t.length-s.length}default:return!1}},WM=(e)=>e,UM=(e)=>e==null?null:e.toString().toLowerCase(),KM=class extends gf{constructor(){super(Cf,dd);this.filterType="text",this.FilterModelFormatterClass=Tf}updateParams(e){super.updateParams(e);let t=e.filterParams;this.matcher=t.textMatcher??zM,this.formatter=t.textFormatter??(t.caseSensitive?WM:UM)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,s,i){let o=e.map((h)=>this.formatter(h))||[],r=this.formatter(t),{api:n,colDef:a,column:l,context:c,filterParams:{textFormatter:d}}=this.params;if(s.type==="blank")return mn(t);else if(s.type==="notBlank")return!mn(t);let u={api:n,colDef:a,column:l,context:c,node:i.node,data:i.data,filterOption:s.type,value:r,textFormatter:d};return o.some((h)=>this.matcher({...u,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){let t=(s)=>{let i={...s},{filter:o,filterTo:r}=s;if(o)i.filter=Tl(o)??null;if(r)i.filterTo=Tl(r)??null;return i};if(Fg(e))return{...e,conditions:e.conditions.map(t)};return t(e)}return e}},$M=class extends wf{constructor(){super(...arguments);this.FilterModelFormatterClass=Tf,this.filterType="text",this.defaultOptions=dd}createFloatingFilterInputService(){return this.createManagedBean(new mf)}};function jM(e){return!!e.quickFilter?.isFilterPresent()}function qM(e){return e.quickFilter?.getText()}function YM(e){e.quickFilter?.resetCache()}var XM=class extends y{constructor(){super(...arguments);this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){let e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{if(!t.get("includeHiddenColumnsInQuickFilter"))this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",(s)=>this.setFilter(s.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){let{autoColSvc:e,colModel:t,gos:s,pivotResultCols:i}=this.beans,o=t.pivotMode,r=e?.getColumns(),n=t.getColDefCols(),a=(o&&!s.get("applyQuickFilterBeforePivotOrAgg")?i?.getPivotResultCols()?.list:n)??[];if(r)a=a.concat(r);this.colsToUse=s.get("includeHiddenColumnsInQuickFilter")?a:a.filter((l)=>l.isVisible()||l.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){let t=this.gos.get("cacheQuickFilter");if(this.matcher)return this.doesRowPassMatcher(t,e);return this.quickFilterParts.every((s)=>t?this.doesRowPassCache(e,s):this.doesRowPassNoCache(e,s))}resetCache(){this.beans.rowModel.forEachNode((e)=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){let{quickFilter:e,parser:t}=this;if(e)this.quickFilterParts=t?t(e):e.split(" ");else this.quickFilterParts=null}parseFilter(e){if(!M(e))return null;return e.toUpperCase()}setFilter(e){if(e!=null&&typeof e!=="string"){F(70,{newFilter:e});return}let t=this.parseFilter(e);if(this.quickFilter!==t)this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"})}setParserAndMatcher(){let e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),s=e!==this.parser||t!==this.matcher;if(this.parser=e,this.matcher=t,s)this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"})}onColumnConfigChanged(){if(this.refreshCols(),this.resetCache(),this.isFilterPresent())this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some((s)=>{let i=this.getTextForColumn(s,e);return M(i)&&i.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let s;if(e)this.checkGenerateAggText(t),s=t.quickFilterAggregateText;else s=this.getAggText(t);let{quickFilterParts:i,matcher:o}=this;return o(i,s)}checkGenerateAggText(e){if(!e.quickFilterAggregateText)e.quickFilterAggregateText=this.getAggText(e)}getTextForColumn(e,t){let s=this.beans.filterValueSvc.getValue(e,t),i=e.colDef;if(i.getQuickFilterText){let o=I(this.gos,{value:s,node:t,data:t.data,column:e,colDef:i});s=i.getQuickFilterText(o)}return M(s)?s.toString().toUpperCase():null}getAggText(e){let t=[];for(let s of this.colsToUse){let i=this.getTextForColumn(s,e);if(M(i))t.push(i)}return t.join(`
70
- `)}},Df={moduleName:"FilterCore",version:z,beans:[YP],apiFunctions:{isAnyFilterPresent:jP,onFilterChanged:qP},css:[TP]},Af={moduleName:"FilterValue",version:z,beans:[eM]},vi={moduleName:"ColumnFilter",version:z,beans:[$P,JP],dynamicBeans:{headerFilterCellCtrl:FP},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:DP,getColumnFilterInstance:AP,destroyFilter:IP,setFilterModel:kP,getFilterModel:LP,getColumnFilterModel:GP,setColumnFilterModel:OP,showColumnFilter:BP,hideColumnFilter:VP,getColumnFilterHandler:NP,doFilterAction:_P},dependsOn:[Df,Ci,Af,Uc]};var If={moduleName:"TextFilter",version:z,dependsOn:[vi],userComponents:{agTextColumnFilter:{classImp:HM,params:{useForm:!0}},agTextColumnFloatingFilter:$M},dynamicBeans:{agTextColumnFilterHandler:KM}},kf={moduleName:"NumberFilter",version:z,dependsOn:[vi],userComponents:{agNumberColumnFilter:{classImp:OM,params:{useForm:!0}},agNumberColumnFloatingFilter:_M},dynamicBeans:{agNumberColumnFilterHandler:VM}};var Lf={moduleName:"DateFilter",version:z,dependsOn:[vi],userComponents:{agDateColumnFilter:{classImp:lM,params:{useForm:!0}},agDateInput:GM,agDateColumnFloatingFilter:kM},dynamicBeans:{agDateColumnFilterHandler:uM}},ZM={moduleName:"QuickFilterCore",version:z,rowModels:["clientSide"],beans:[XM],dependsOn:[Df,Af]},Gf={moduleName:"QuickFilter",version:z,apiFunctions:{isQuickFilterPresent:jM,getQuickFilter:qM,resetQuickFilter:YM},dependsOn:[ZM]};var QM=class extends y{constructor(){super(...arguments);this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){let s=this.wrapSvc?.wrap(e,t)??t,i=!Kr.has(e),o=i?this.asyncListeners:this.syncListeners;if(!o.has(e))o.set(e,new Set);o.get(e).add(s),this.eventSvc.addListener(e,s,i)}removeListener(e,t){let s=this.wrapSvc?.unwrap(e,t)??t,o=!!this.asyncListeners.get(e)?.delete(s);if(!o)this.syncListeners.get(e)?.delete(s);this.eventSvc.removeListener(e,s,o)}addGlobalListener(e){let t=this.wrapSvc?.wrapGlobal(e)??e,s=(r,n)=>{if(Kr.has(r))t(r,n)},i=(r,n)=>{if(!Kr.has(r))t(r,n)};this.globalListenerPairs.set(e,{syncListener:s,asyncListener:i});let o=this.eventSvc;o.addGlobalListener(s,!1),o.addGlobalListener(i,!0)}removeGlobalListener(e){let{eventSvc:t,wrapSvc:s,globalListenerPairs:i}=this,o=s?.unwrapGlobal(e)??e;if(i.has(o)){let{syncListener:n,asyncListener:a}=i.get(o);t.removeGlobalListener(n,!1),t.removeGlobalListener(a,!0),i.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((s,i)=>{s.forEach((o)=>this.eventSvc.removeListener(i,o,t)),s.clear()}),e.clear()}destroyGlobalListeners(e,t){for(let s of e)this.eventSvc.removeGlobalListener(s,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);let{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:s,asyncListener:i})=>{t.removeGlobalListener(s,!1),t.removeGlobalListener(i,!0)}),e.clear()}};function JM(e,t,s){e.apiEventSvc?.addListener(t,s)}function eT(e,t,s){e.apiEventSvc?.removeListener(t,s)}function tT(e,t){e.apiEventSvc?.addGlobalListener(t)}function sT(e,t){e.apiEventSvc?.removeGlobalListener(t)}var Of={moduleName:"EventApi",version:z,apiFunctions:{addEventListener:JM,addGlobalListener:tT,removeEventListener:eT,removeGlobalListener:sT},beans:[QM]};function kt(e,t){if(typeof e!=="number")return"";let s=t(),i=s("thousandSeparator",","),o=s("decimalSeparator",".");return e.toString().replace(".",o).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${i}`)}var iT="↑",oT="↓",rT={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},nT=class extends L{constructor(){super(rT);this.eValue=E,this.eDelta=E,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){let s=Math.abs(t),i=e.formatValue(s),o=M(i)?i:s,r=t>=0,n=this.eDelta;if(r)n.textContent=iT+o;else n.textContent=oT+o;n.classList.toggle("ag-value-change-delta-up",r),n.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;let e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{if(e===this.refreshCount)this.hideDeltaValue()},2000)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),te(this.eDelta)}refresh(e,t=!1){let{value:s,valueFormatted:i}=e,{eValue:o,lastValue:r,beans:n}=this;if(s===r)return!1;if(M(i))o.textContent=i;else if(M(s))o.textContent=s;else te(o);if(n.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;let a=s&&typeof s==="object"&&"toNumber"in s?s.toNumber():s,l=r&&typeof r==="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a==="number"&&typeof l==="number"){let c=a-l;this.showDelta(e,c)}if(r)o.classList.add("ag-value-change-value-highlight");if(!t)this.setTimerToRemoveDelta();return this.lastValue=s,!0}},aT=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",lT={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},cT=class extends L{constructor(){super(lT);this.eCurrent=E,this.refreshCount=0,this.registerCSS(aT)}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;let e=this.refreshCount;this.ePrevious?.remove();let{beans:t,eCurrent:s}=this,i=ee({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=i,i.textContent=s.textContent,this.getGui().insertBefore(i,s),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{if(e!==this.refreshCount)return;this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{if(e!==this.refreshCount)return;this.ePrevious?.remove(),this.ePrevious=null},3000)})}refresh(e,t=!1){let s=e.value;if(q(s))s="";if(s===this.lastValue)return!1;if(this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;if(!t)this.addSlideAnimation();this.lastValue=s;let i=this.eCurrent;if(M(e.valueFormatted))i.textContent=e.valueFormatted;else if(M(e.value))i.textContent=s;else te(i);return!0}},dT=class extends y{constructor(){super(...arguments);this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,s=this.beans.gos.get("cellFlashDuration"),i=this.beans.gos.get("cellFadeDuration")){let o=this.animations[t];o.delete(e);let r=Date.now(),n=r+s,a=r+s+i,l={phase:"flash",flashEndTime:n,fadeEndTime:a};o.set(e,l);let c=`ag-cell-${t}`,d=`${c}-animation`,{comp:u,eGui:{style:h}}=e;if(u.toggleCss(c,!0),u.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&n+15<this.nextAnimationTime)clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null;if(!this.nextAnimationCycle)this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),s)}),this.nextAnimationTime=n}advanceAnimations(){let e=Date.now(),t=null;for(let s of Object.keys(this.animations)){let i=this.animations[s],o=`ag-cell-${s}`,r=`${o}-animation`;for(let[n,a]of i){if(!n.isAlive()||!n.comp){i.delete(n);continue}let{phase:l,flashEndTime:c,fadeEndTime:d}=a,u=l==="flash"?c:d;if(!(e+15>=u)){t=Math.min(u,t??1/0);continue}let{comp:g,eGui:{style:p}}=n;switch(l){case"flash":g.toggleCss(o,!1),g.toggleCss(r,!0),p.transition=`background-color ${d-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(d,t??1/0),a.phase="fade";break;case"fade":g.toggleCss(o,!1),g.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),i.delete(n);break}}}if(t==null)this.nextAnimationTime=null,this.nextAnimationCycle=null;else if(t)this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t}onFlashCells(e,t){if(!e.comp)return;let s=Qt(e.cellPosition);if(t.cells[s])this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t?.flashDuration,t?.fadeDuration)}destroy(){for(let e of Object.keys(this.animations))this.animations[e].clear()}};function uT(e,t={}){let{cellFlashSvc:s}=e;if(!s)return;e.frameworkOverrides.wrapIncoming(()=>{for(let i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))s.flashCell(i,t)})}var Bf={moduleName:"HighlightChanges",version:z,beans:[dT],userComponents:{agAnimateShowChangeCellRenderer:nT,agAnimateSlideCellRenderer:cT},apiFunctions:{flashCells:uT}};var hT=class extends y{constructor(){super(...arguments);this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",(e)=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Ms(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){let t=this.columns;if(t==null)return;e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Zo(e)}createColumns(e,t){let s=()=>{gt(this.beans,this.columns?.tree),this.columns=null},i=e.treeDepth,r=(this.columns?.treeDepth??-1)==i,n=this.generateSelectionCols();if(Xo(n,this.columns?.list??[])&&r)return;s();let{colGroupSvc:l}=this.beans,c=l?.findDepth(e.tree)??0,d=l?.balanceTreeForAutoCols(n,c)??[];this.columns={list:n,tree:d,treeDepth:c,map:{}},t((h)=>{if(!h)return null;let g=h.filter((p)=>!Zt(p));return[...n,...g]})}updateColumns(e){let t=Ms(e.source),{beans:s}=this;for(let i of this.columns?.list??[]){let o=this.createSelectionColDef(e.currentValue);i.setColDef(o,null,t),Je(s,{state:[ic(o,i.colId)]},t)}}getColumn(e){return this.columns?.list.find((t)=>jt(t,e))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){let{gos:e,beans:t}=this,s=e.get("rowSelection");if(typeof s!=="object"||!ss(e))return!1;let i=(t.autoColSvc?.getColumns()?.length??0)>0;if(s.checkboxLocation==="autoGroupColumn"&&i)return!1;let o=!!Es(s),r=Hr(s);return o||r}createSelectionColDef(e){let{gos:t}=this,s=e??t.get("selectionColumnDef"),i=t.get("enableRtl"),{rowSpan:o,spanRows:r,...n}=s??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:i?"right":"left",comparator(a,l,c,d){let u=c.isSelected(),h=d.isSelected();return u===h?0:u?1:-1},editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,pinned:null,...n,colId:pg,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];let e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);let s=new Ct(e,null,t,!1);return this.createBean(s),[s]}onSelectionOptionsChanged(e,t,s){let i=t&&typeof t!=="string"?Es(t):void 0,o=e&&typeof e!=="string"?Es(e):void 0,r=i!==o,n=t&&typeof t!=="string"?Hr(t):void 0,a=e&&typeof e!=="string"?Hr(e):void 0,l=n!==a,c=zi(e),d=zi(t);if(r||l||c!==d)this.beans.colModel.refreshAll(s)}destroy(){gt(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(e,t,s){if(!this.columns?.list.length)return;let i=e.length+t.length+s.length;if(i===0)return;let o=this.columns.list[0];if(!o.isVisible())return;let r=()=>{let l;switch(o.pinned){case"left":case!0:l=e;break;case"right":l=s;break;default:l=t}if(l)ae(l,o)};if((this.beans.rowNumbersSvc?.getColumn(fg)?2:1)===i)r()}},gT=':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";cursor:pointer;inset:-8px;position:absolute}';function pT(e,t){if(!t.nodes.every((n)=>{if(n.rowPinned&&!zn(n))return F(59),!1;if(n.id===void 0)return F(60),!1;return!0}))return;let{nodes:i,source:o,newValue:r}=t;e.selectionSvc?.setNodesSelected({nodes:i,source:o??"api",newValue:r})}function fT(e,t,s="apiSelectAll"){e.selectionSvc?.selectAllRowNodes({source:s,selectAll:t})}function mT(e,t,s="apiSelectAll"){e.selectionSvc?.deselectAllRowNodes({source:s,selectAll:t})}function CT(e,t="apiSelectAllFiltered"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"filtered"})}function vT(e,t="apiSelectAllFiltered"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"filtered"})}function wT(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"currentPage"})}function bT(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function ST(e){return e.selectionSvc?.getSelectedNodes()??[]}function yT(e){return e.selectionSvc?.getSelectedRows()??[]}var Vf=(e,t)=>{for(let s=0,i=e.length;s<i;++s){let o=e[s],r=o.childrenAfterGroup;if(r!==null)Vf(r,t),t(o)}},Ae=(e,t,s,i)=>{if(s!=null){let r=s.getSortedRows();for(let n=0,a=r.length;n<a;++n){let l=r[n];if(l.childrenAfterGroup!==null&&!l.destroyed)i(l)}return}if(e==null)return;let o=e.childrenAfterGroup;if(o===null)return;if(t)Vf(o,i);i(e)},xT={tag:"div",cls:"ag-selection-checkbox",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},RT=class extends L{constructor(){super(xT,[wt]);this.eCheckbox=E}postConstruct(){this.eCheckbox.setPassive(!0)}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){let e=this.getLocaleTextFunc(),{rowNode:t,eCheckbox:s}=this,i=t.isSelected(),o=_l(e,i),[r,n]=t.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],a=e(r,n);s.setValue(i,!0),s.setInputAriaLabel(`${a} (${o})`)}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getWrapperElement(),{dblclick:Qe,click:(i)=>{if(Qe(i),this.eCheckbox.isDisabled())return;this.beans.selectionSvc?.handleSelectionEvent(i,this.rowNode,"checkboxSelected")}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",({currentValue:i,previousValue:o})=>{let r=typeof i==="object"?Pa(i):void 0,n=typeof o==="object"?Pa(o):void 0;if(r!==n)this.onSelectableChanged()}),dl(this.gos)||typeof this.getIsVisible()==="function"){let i=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:i}),this.addManagedListeners(this.rowNode,{dataChanged:i,cellChanged:i}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){let{column:e,rowNode:t,overrides:s,gos:i}=this,o=t.selectable,r=this.getIsVisible(),n;if(typeof r==="function"){let u=s?.callbackParams;if(!e)n=r({...u,node:t,data:t.data});else{let h=e.createColumnFunctionCallbackParams(t);n=r({...u,...h})}}else n=r??!1;let a=o&&!n||!o&&n,l=o||n,c=i.get("rowSelection"),d=c&&typeof c!=="string"?!Pa(c):!!e?.colDef.showDisabledCheckboxes;if(this.setVisible(l&&(a?d:!0)),this.setDisplayed(l&&(a?d:!0)),l)this.eCheckbox.setDisabled(a);if(s?.removeHidden)this.setDisplayed(l)}getIsVisible(){let e=this.overrides;if(e)return e.isVisible;let t=this.gos.get("rowSelection");if(t&&typeof t!=="string")return Es(t);return this.column?.colDef?.checkboxSelection}},FT=class{constructor(e,t){this.rowModel=e,this.pinnedRowModel=t,this.selectAll=!1,this.rootId=null,this.endId=null,this.cachedRange=[]}reset(){this.rootId=null,this.endId=null,this.cachedRange.length=0}setRoot(e){this.rootId=e.id,this.endId=null,this.cachedRange.length=0}setEndRange(e){this.endId=e.id,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){let e=this.getRoot(),t=this.getEnd();if(e==null||t==null)return this.cachedRange;this.cachedRange=this.getNodesInRange(e,t)??[]}return this.cachedRange}isInRange(e){if(this.rootId===null)return!1;return this.getRange().some((t)=>t.id===e.id)}getRoot(e){if(this.rootId)return this.getRowNode(this.rootId);if(e)return this.setRoot(e),e}getEnd(){if(this.endId)return this.getRowNode(this.endId)}getRowNode(e){let t,{rowModel:s,pinnedRowModel:i}=this;if(t??(t=s.getRowNode(e)),i?.isManual())t??(t=i.getPinnedRowById(e,"top")),t??(t=i.getPinnedRowById(e,"bottom"));return t}truncate(e){let t=this.getRange();if(t.length===0)return{keep:[],discard:[]};let s=t[0].id===this.rootId,i=t.findIndex((o)=>o.id===e.id);if(i>-1){let o=t.slice(0,i),r=t.slice(i+1);return this.setEndRange(e),s?{keep:o,discard:r}:{keep:r,discard:o}}else return{keep:t,discard:[]}}extend(e,t=!1){let s=this.getRoot();if(s==null){let o=this.getRange().slice();if(t)e.depthFirstSearch((r)=>!r.group&&o.push(r));return o.push(e),this.setRoot(e),{keep:o,discard:[]}}let i=this.getNodesInRange(s,e);if(!i)return this.setRoot(e),{keep:[e],discard:[]};if(i.find((o)=>o.id===this.endId))return this.setEndRange(e),{keep:this.getRange(),discard:[]};else{let o=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:o}}}getNodesInRange(e,t){let{pinnedRowModel:s,rowModel:i}=this;if(!s?.isManual())return i.getNodesInRangeForSelection(e,t);if(e.rowPinned==="top"&&!t.rowPinned)return it(s,"top",e,void 0).concat(i.getNodesInRangeForSelection(i.getRow(0),t)??[]);if(e.rowPinned==="bottom"&&!t.rowPinned){let o=it(s,"bottom",void 0,e),r=i.getRowCount(),n=i.getRow(r-1);return(i.getNodesInRangeForSelection(t,n)??[]).concat(o)}if(!e.rowPinned&&!t.rowPinned)return i.getNodesInRangeForSelection(e,t);if(e.rowPinned==="top"&&t.rowPinned==="top")return it(s,"top",e,t);if(e.rowPinned==="bottom"&&t.rowPinned==="top"){let o=it(s,"top",t,void 0),r=it(s,"bottom",void 0,e),n=i.getRow(0),a=i.getRow(i.getRowCount()-1);return o.concat(i.getNodesInRangeForSelection(n,a)??[]).concat(r)}if(!e.rowPinned&&t.rowPinned==="top")return it(s,"top",t,void 0).concat(i.getNodesInRangeForSelection(i.getRow(0),e)??[]);if(e.rowPinned==="top"&&t.rowPinned==="bottom"){let o=it(s,"top",e,void 0),r=it(s,"bottom",void 0,t),n=i.getRow(0),a=i.getRow(i.getRowCount()-1);return o.concat(i.getNodesInRangeForSelection(n,a)??[]).concat(r)}if(e.rowPinned==="bottom"&&t.rowPinned==="bottom")return it(s,"bottom",e,t);if(!e.rowPinned&&t.rowPinned==="bottom"){let o=it(s,"bottom",void 0,t),r=i.getRow(i.getRowCount());return(i.getNodesInRangeForSelection(e,r)??[]).concat(o)}return null}},ET=class extends y{constructor(e){super();this.column=e,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(e){let t=this.cbSelectAll;if(t.isDisplayed()&&!t.getGui().contains(j(this.beans)))e.preventDefault(),t.setValue(!t.getValue())}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e;let t=this.createManagedBean(new Nn);this.cbSelectAll=t,t.addCss("ag-header-select-all"),ge(t.getGui(),"presentation"),this.showOrHideSelectAll();let s=this.updateStateOfCheckbox.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>this.showOrHideSelectAll(),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:s,paginationChanged:s,modelUpdated:s}),this.addManagedPropertyListener("rowSelection",({currentValue:i,previousValue:o})=>{let r=(n)=>typeof n==="string"||!n||n.mode==="singleRow"?void 0:n.selectAll;if(r(i)!==r(o))this.showOrHideSelectAll();this.updateStateOfCheckbox()}),this.addManagedListeners(t,{fieldValueChanged:this.onCbSelectAll.bind(this)}),t.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onDisplayedColumnsChanged(e){if(!this.isAlive())return;this.showOrHideSelectAll(e.source==="uiColumnMoved")}showOrHideSelectAll(e=!1){let t=this.isCheckboxSelection();if(this.cbSelectAllVisible=t,this.cbSelectAll.setDisplayed(t),t)this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox();this.refreshSelectAllLabel(e)}updateStateOfCheckbox(){if(!this.cbSelectAllVisible||this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;let e=this.getSelectAllMode(),t=this.beans.selectionSvc,s=this.cbSelectAll,i=t.getSelectAllState(e);s.setValue(i);let o=t.hasNodesToSelect(e);s.setDisabled(!o),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(e=!1){let t=this.getLocaleTextFunc(),{headerCellCtrl:s,cbSelectAll:i,cbSelectAllVisible:o}=this,r=i.getValue(),n=_l(t,r),a=t("ariaRowSelectAll","Press Space to toggle all rows selection");if(s.setAriaDescriptionProperty("selectAll",o?`${a} (${n})`:null),i.setInputAriaLabel(t("ariaHeaderSelection","Column with Header Selection")),!e)s.announceAriaDescription()}checkSelectionType(e){if(!Lo(this.gos))return F(128,{feature:e}),!1;return!0}checkRightRowModelType(e){let{gos:t,rowModel:s}=this.beans;if(!(J(t)||Gs(t)))return F(129,{feature:e,rowModel:s.getType()}),!1;return!0}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;let e=this.cbSelectAll.getValue(),t=this.getSelectAllMode(),s="uiSelectAll";if(t==="currentPage")s="uiSelectAllCurrentPage";else if(t==="filtered")s="uiSelectAllFiltered";let i={source:s,selectAll:t},o=this.beans.selectionSvc;if(e)o.selectAllRowNodes(i);else o.deselectAllRowNodes(i)}isCheckboxSelection(){let{column:e,gos:t,beans:s}=this,r=typeof t.get("rowSelection")==="object"?"headerCheckbox":"headerCheckboxSelection";return Nf(s,e)&&this.checkRightRowModelType(r)&&this.checkSelectionType(r)}getSelectAllMode(){let e=rg(this.gos,!1);if(e)return e;let{headerCheckboxSelectionCurrentPageOnly:t,headerCheckboxSelectionFilteredOnly:s}=this.column.colDef;if(t)return"currentPage";if(s)return"filtered";return"all"}destroy(){super.destroy(),this.cbSelectAll=void 0,this.headerCellCtrl=void 0}};function Nf({gos:e,selectionColSvc:t},s){let i=e.get("rowSelection"),o=s.colDef,{headerCheckboxSelection:r}=o,n=!1;if(typeof i==="object"){let l=Zt(s),c=gi(s);if(zi(i)==="autoGroupColumn"&&c||l&&t?.isSelectionColumnEnabled())n=Hr(i)}else if(typeof r==="function")n=r(I(e,{column:s,colDef:o}));else n=!!r;return n}var PT=class extends y{postConstruct(){let{gos:e,beans:t}=this;this.selectionCtx=new FT(t.rowModel,t.pinnedRowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>{let s=dl(e);if(s!==this.isRowSelectable)this.isRowSelectable=s,this.updateSelectable()}),this.isRowSelectable=dl(e),this.addManagedEventListeners({cellValueChanged:(s)=>this.updateRowSelectable(s.node),rowNodeDataChanged:(s)=>this.updateRowSelectable(s.node)})}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new RT}createSelectAllFeature(e){if(Nf(this.beans,e))return new ET(e)}isMultiSelect(){return Lo(this.gos)}onRowCtrlSelected(e,t,s){let i=!!e.rowNode.isSelected();e.forEachGui(s,(o)=>{o.rowComp.toggleCss("ag-row-selected",i);let r=o.element;if(Sn(r,i),r.contains(j(this.beans)))t(o)})}announceAriaRowSelection(e){if(this.isRowSelectionBlocked(e))return;let t=e.isSelected(),s=this.beans.editSvc?.isEditing({rowNode:e});if(!e.selectable||s)return;let o=this.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row`);this.beans.ariaAnnounce?.announceValue(o,"rowSelection")}isRowSelectionBlocked(e){return!e.selectable||e.rowPinned&&!zn(e)||!ss(this.gos)}updateRowSelectable(e,t){let s=e.rowPinned&&e.pinnedSibling?e.pinnedSibling.selectable:this.isRowSelectable?.(e)??!0;return this.setRowSelectable(e,s,t),s}setRowSelectable(e,t,s){if(e.selectable!==t){if(e.selectable=t,e.dispatchRowEvent("selectableChanged"),s)return;if(Go(this.gos)){let o=this.calculateSelectedFromChildren(e);this.setNodesSelected({nodes:[e],newValue:o??!1,source:"selectableChanged"});return}if(e.isSelected()&&!e.selectable)this.setNodesSelected({nodes:[e],newValue:!1,source:"selectableChanged"})}}calculateSelectedFromChildren(e){let t=!1,s=!1;if(!e.childrenAfterGroup?.length)return e.selectable?e.__selected:null;for(let i=0;i<e.childrenAfterGroup.length;i++){let o=e.childrenAfterGroup[i],r=o.isSelected();if(!o.selectable){let n=this.calculateSelectedFromChildren(o);if(n===null)continue;r=n}switch(r){case!0:t=!0;break;case!1:s=!0;break;default:return}}if(t&&s)return;if(t)return!0;if(s)return!1;if(!e.selectable)return null;return e.__selected}selectRowNode(e,t,s,i="api"){if(t&&e.destroyed)return!1;let o=!e.selectable&&t,r=e.__selected===t;if(o||r)return!1;e.__selected=t,e.dispatchRowEvent("rowSelected");let n=e.sibling;if(n&&n.footer&&n.__localEventService)n.dispatchRowEvent("rowSelected");let a=e.pinnedSibling;if(a?.rowPinned&&a.__localEventService)a.dispatchRowEvent("rowSelected");return this.eventSvc.dispatchEvent({...pc(e,this.gos,"rowSelected"),event:s||null,source:i}),!0}isCellCheckboxSelection(e,t){let s=this.gos.get("rowSelection");if(s&&typeof s!=="string"){let i=Zt(e)&&Es(s);return e.isColumnFunc(t,i)}else return e.isColumnFunc(t,e.colDef.checkboxSelection)}inferNodeSelections(e,t,s,i){let{gos:o,selectionCtx:r}=this,n=e.isSelected(),a=Go(o),l=mw(o),c=Cw(o),d=this.isMultiSelect(),u=i==="rowClicked";if(u&&!(l||c))return null;if(t&&s&&d){let h=r.getRoot();if(!h)return null;else if(!h.isSelected()){let g=r.extend(e,a);return{select:[],deselect:g.keep,reset:!1}}else{let g=r.isInRange(e)?r.truncate(e):r.extend(e,a);return{deselect:g.discard,select:g.keep,reset:!1}}}else if(t&&d){let h=r.selectAll?this.beans.rowModel.getRow(0):void 0,g=r.getRoot(h),p=r.isInRange(e)?r.truncate(e):r.extend(e,a);return{select:p.keep,deselect:p.discard,reset:r.selectAll||!!(g&&!g.isSelected())}}else if(s){if(u){let h=!n;if(h&&!l||!h&&!c)return null;return r.setRoot(e),{node:e,newValue:h,clearSelection:!1}}return r.setRoot(e),{node:e,newValue:!n,clearSelection:!d}}else{r.setRoot(e);let h=vw(o),g=tn(o)==="filteredDescendants",p=u&&(!h||!l);if(g&&n===void 0&&J(o))return{node:e,newValue:!1,checkFilteredNodes:!0,clearSelection:!d||p};if(u){let f=n?!h:l;if(f===n&&!p||f&&!l||!f&&!c)return null;return{node:e,newValue:f,clearSelection:!d||p,keepDescendants:e.group&&a}}return{node:e,newValue:!n,clearSelection:!d||p}}}},MT=class extends PT{constructor(){super(...arguments);this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();let{gos:e}=this;this.mode=en(e),this.groupSelectsDescendants=Go(e),this.groupSelectsFiltered=tn(e)==="filteredDescendants",this.masterSelectsDetail=nu(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{let t=Go(e),s=en(e),i=tn(e)==="filteredDescendants";if(this.masterSelectsDetail=nu(e)==="detail",t!==this.groupSelectsDescendants||i!==this.groupSelectsFiltered||s!==this.mode)this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=i,this.mode=s}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,s){if(this.isRowSelectionBlocked(t))return 0;let i=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,s);if(i==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in i){if(i.reset)this.resetNodes();else this.selectRange(i.deselect,!1,s);return this.selectRange(i.select,!0,s)}else{let o=i.checkFilteredNodes?Hf(i.node):i.newValue;return this.setNodesSelected({nodes:[i.node],newValue:o,clearSelection:i.clearSelection,keepDescendants:i.keepDescendants,event:e,source:s})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:s,nodes:i,event:o,source:r,keepDescendants:n=!1}){if(i.length===0)return 0;let{gos:a}=this;if(!ss(a)&&e)return F(132),0;if(i.length>1&&!this.isMultiSelect())return F(130),0;let l=0;for(let c=0;c<i.length;c++){let d=i[c],u=d.primaryRow;if(u.rowPinned&&!zn(u)){F(59);continue}if(u.id===void 0){F(60);continue}if(e&&d.destroyed)continue;if(!(this.groupSelectsFiltered&&u.group&&!a.get("treeData"))){if(this.selectRowNode(u,e,o,r))this.detailSelection.delete(u.id),l++}if(this.groupSelectsDescendants&&u.childrenAfterGroup?.length)l+=this.selectChildren(u,e,r)}if(!s){if(i.length===1&&r==="api")this.selectionCtx.setRoot(i[0].primaryRow);if(e&&(t||!this.isMultiSelect()))l+=this.clearOtherNodes(i[0].primaryRow,n,r);if(l>0)this.updateGroupsFromChildrenSelections(r),this.dispatchSelectionChanged(r)}return l}selectRange(e,t,s){let i=0;if(e.forEach((o)=>{let r=o.primaryRow;if(r.group&&this.groupSelectsDescendants)return;if(this.selectRowNode(r,t,void 0,s))i++}),i>0)this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s);return i}selectChildren(e,t,s){let i=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;if(!i)return 0;return this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:s,nodes:i})}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){let e=[];return this.selectedNodes.forEach((t)=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){let t=new Map;this.selectedNodes.forEach((s,i)=>{if(e(s))t.set(i,s)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;let{gos:s,rowModel:i}=this.beans;if(!J(s,i))return!1;let o=i.rootNode;if(!o)return!1;let r=!1,n=(a)=>{if(a!==o){let l=this.calculateSelectedFromChildren(a);r=this.selectRowNode(a,l===null?!1:l,void 0,e)||r}};return Ae(o,this.beans.rowModel.hierarchical,t,n),r}clearOtherNodes(e,t,s){let i=new Map,o=0;return this.selectedNodes.forEach((r)=>{let n=r.id==e.id;if((t?!DT(e,r):!0)&&!n){let l=this.selectedNodes.get(r.id);if(o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:s}),this.groupSelectsDescendants&&r.parent)i.set(r.parent.id,r.parent)}}),i.forEach((r)=>{let n=this.calculateSelectedFromChildren(r);this.selectRowNode(r,n===null?!1:n,void 0,s)}),o}onRowSelected(e){let t=e.node;if(this.groupSelectsDescendants&&t.group)return;if(t.isSelected())this.selectedNodes.set(t.id,t);else this.selectedNodes.delete(t.id)}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;let t=new Vs(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){if(t&&e.id!==t.id){if(this.selectedNodes.get(t.id)==e)this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){if(this.selectedNodes.has(e.id))e.__selected=!0,this.selectedNodes.set(e.id,e);else e.__selected=!1}reset(e){let t=this.getSelectionCount();if(this.resetNodes(),t)this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach((e)=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){let{gos:e,rowModel:t}=this.beans;if(!J(e,t))return;let s=t.getTopLevelNodes();if(s===null)return;let i=[];function o(r){for(let n=0,a=r.length;n<a;n++){let l=r[n];if(l.isSelected())i.push(l);else if(l.group&&l.childrenAfterGroup)o(l.childrenAfterGroup)}}return o(s),i}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){let s=J(this.gos),i=!1,o=(r)=>{let n=this.selectRowNode(r.primaryRow,!1,void 0,e);i||(i=n)};if(t==="currentPage"||t==="filtered"){if(!s){X(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,s&&this.groupSelectsDescendants){let r=this.updateGroupsFromChildrenSelections(e);i||(i=r)}if(i)this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,s=0;return this.getNodesToSelect(e).forEach((i)=>{if(this.groupSelectsDescendants&&i.group)return;if(i.isSelected())t++;else if(i.selectable)s++}),{selectedCount:t,notSelectedCount:s}}getSelectAllState(e){let{selectedCount:t,notSelectedCount:s}=this.getSelectedCounts(e);return _f(t,s)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter((t)=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];let t=[],s=(o)=>t.push(o);if(e==="currentPage")return this.forEachNodeOnPage((o)=>{if(!o.group){s(o);return}if(!o.footer&&!o.expanded){let r=(n)=>{s(n);let a=n.childrenAfterFilter;if(a)for(let l=0,c=a.length;l<c;++l)r(a[l])};r(o);return}if(!this.groupSelectsDescendants)s(o)}),t;let i=this.beans.rowModel;if(e==="filtered")return i.forEachNodeAfterFilter(s),t;return i.forEachNode(s),t}forEachNodeOnPage(e){let{pageBounds:t,rowModel:s}=this.beans,i=t.getFirstRow(),o=t.getLastRow();for(let r=i;r<=o;r++){let n=s.getRow(r);if(n)e(n)}}selectAllRowNodes(e){let{gos:t,selectionCtx:s}=this;if(!ss(t)){F(132);return}if(fw(t)&&!Lo(t)){F(130);return}if(!this.canSelectAll())return;let{source:i,selectAll:o}=e,r=!1;if(this.getNodesToSelect(o).forEach((n)=>{let a=this.selectRowNode(n.primaryRow,!0,void 0,i);r||(r=a)}),s.selectAll=!0,J(t)&&this.groupSelectsDescendants){let n=this.updateGroupsFromChildrenSelections(i);r||(r=n)}if(r)this.dispatchSelectionChanged(i)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,s){if(!e)e=[];if(!Array.isArray(e)){X(103);return}let i=new Set(e),o=[];if(this.beans.rowModel.forEachNode((r)=>{if(i.has(r.id))o.push(r)}),s)this.resetNodes();this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return J(this.beans.gos)}updateSelectable(e){let{gos:t,rowModel:s}=this.beans;if(!ss(t))return;let i="selectableChanged",o=J(t)&&this.groupSelectsDescendants,r=[];if(o){let n=s.rootNode;if(n)Ae(n,s.hierarchical,e,(a)=>{let l=!1;for(let c of a.childrenAfterGroup)if(l||(l=c.selectable),!c.group&&!this.updateRowSelectable(c,!0)&&c.isSelected())r.push(c);this.setRowSelectable(a,l,!0)})}else s.forEachNode((n)=>{if(!this.updateRowSelectable(n,!0)&&n.isSelected())r.push(n)});if(r.length)this.setNodesSelected({nodes:r,newValue:!1,source:i});if(!e&&o)this.updateGroupsFromChildrenSelections?.(i)}updateSelectableAfterGrouping(e){if(this.updateSelectable(e),this.groupSelectsDescendants){if(this.updateGroupsFromChildrenSelections?.("rowGroupChanged",e))this.dispatchSelectionChanged("rowGroupChanged")}}refreshMasterNodeState(e,t){if(!this.masterSelectsDetail)return;let s=e.detailNode?.detailGridInfo?.api;if(!s)return;let i=TT(s);if(e.isSelected()!==i){if(this.selectRowNode(e,i,t,"masterDetail"))this.dispatchSelectionChanged("masterDetail")}if(!i)this.detailSelection.set(e.id,new Set(s.getSelectedNodes().map((r)=>r.id)))}setDetailSelectionState(e,t,s){if(!this.masterSelectsDetail)return;if(!Lo(t)){F(269);return}switch(e.isSelected()){case!0:{s.selectAll();break}case!1:{s.deselectAll();break}case void 0:{let i=this.detailSelection.get(e.id);if(i){let o=[];for(let r of i){let n=s.getRowNode(r);if(n)o.push(n)}s.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}default:break}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function TT(e){let t=0,s=0;return e.forEachNode((i)=>{if(i.isSelected())t++;else if(i.selectable)s++}),_f(t,s)}function _f(e,t){if(e===0&&t===0)return!1;if(e>0&&t>0)return;return e>0}function DT(e,t){let s=t.parent;while(s){if(s===e)return!0;s=s.parent}return!1}function Hf(e){let t=e.isSelected()===!1,s=e.childrenAfterFilter?.some(Hf)??!1;return t||s}var AT={moduleName:"SharedRowSelection",version:z,beans:[hT],css:[gT],apiFunctions:{setNodesSelected:pT,selectAll:fT,deselectAll:mT,selectAllFiltered:CT,deselectAllFiltered:vT,selectAllOnCurrentPage:wT,deselectAllOnCurrentPage:bT,getSelectedNodes:ST,getSelectedRows:yT}},zf={moduleName:"RowSelection",version:z,rowModels:["clientSide","infinite","viewport"],beans:[MT],dependsOn:[AT]},IT=class extends y{constructor(e,t){super();this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){let{column:e,cellComp:t}=this,s=e.colDef,i=s.cellClassRules,o=this.getCellClassParams(e,s);zp(this.beans.expressionSvc,i===this.cellClassRules?void 0:this.cellClassRules,i,o,(r)=>t.toggleCss(r,!0),(r)=>t.toggleCss(r,!1)),this.cellClassRules=i}applyUserStyles(){let e=this.column,t=e.colDef,s=t.cellStyle;if(!s)return;let i;if(typeof s==="function"){let o=this.getCellClassParams(e,t);i=s(o)}else i=s;if(i)this.cellComp.setUserStyles(i)}applyClassesFromColDef(){let{column:e,cellComp:t}=this,s=e.colDef,i=this.getCellClassParams(e,s);for(let r of this.staticClasses)t.toggleCss(r,!1);let o=this.beans.cellStyles.getStaticCellClasses(s,i);this.staticClasses=o;for(let r of o)t.toggleCss(r,!0)}getCellClassParams(e,t){let{value:s,rowNode:i}=this.cellCtrl;return I(this.beans.gos,{value:s,data:i.data,node:i,colDef:t,column:e,rowIndex:i.rowIndex})}},kT=class extends y{constructor(){super(...arguments);this.beanName="cellStyles"}processAllCellClasses(e,t,s,i){zp(this.beans.expressionSvc,void 0,e.cellClassRules,t,s,i),this.processStaticCellClasses(e,t,s)}getStaticCellClasses(e,t){let{cellClass:s}=e;if(!s)return[];let i;if(typeof s==="function")i=s(t);else i=s;if(typeof i==="string")i=[i];return i||[]}createCellCustomStyleFeature(e){return new IT(e,this.beans)}processStaticCellClasses(e,t,s){this.getStaticCellClasses(e,t).forEach((o)=>{s(o)})}},Wf={moduleName:"CellStyle",version:z,beans:[kT]};var LT={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,overlayComponent:!0,suppressOverlays:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,groupLockGroupColumns:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,suppressContentVisibilityAuto:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,renderingMode:!0,columnMenu:!0,suppressSetFilterByDefault:!0,getDataPath:!0,enableCellSpan:!0,enableFilterHandlers:!0,filterHandlers:!0},We="clientSide",Be="serverSide",Pi="infinite",GT={onGroupExpandedOrCollapsed:[We],refreshClientSideRowModel:[We],isRowDataEmpty:[We],forEachLeafNode:[We],forEachNodeAfterFilter:[We],forEachNodeAfterFilterAndSort:[We],resetRowHeights:[We,Be],applyTransaction:[We],applyTransactionAsync:[We],flushAsyncTransactions:[We],getBestCostNodeSelection:[We],getServerSideSelectionState:[Be],setServerSideSelectionState:[Be],applyServerSideTransaction:[Be],applyServerSideTransactionAsync:[Be],applyServerSideRowData:[Be],retryServerSideLoads:[Be],flushServerSideAsyncTransactions:[Be],refreshServerSide:[Be],getServerSideGroupLevelState:[Be],refreshInfiniteCache:[Pi],purgeInfiniteCache:[Pi],getInfiniteRowCount:[Pi],isLastRowIndexKnown:[Pi,Be],expandAll:[We,Be],collapseAll:[We,Be],onRowHeightChanged:[We,Be],setRowCount:[Pi,Be],getCacheBlockState:[Pi,Be]},OT={showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'},clearRangeSelection:{version:"v32.2",message:"Use `clearCellSelection` instead."},getInfiniteRowCount:{version:"v32.2",old:"getInfiniteRowCount()",new:"getDisplayedRowCount()"},selectAllFiltered:{version:"v33",old:"selectAllFiltered()",new:'selectAll("filtered")'},deselectAllFiltered:{version:"v33",old:"deselectAllFiltered()",new:'deselectAll("filtered")'},selectAllOnCurrentPage:{version:"v33",old:"selectAllOnCurrentPage()",new:'selectAll("currentPage")'},deselectAllOnCurrentPage:{version:"v33",old:"deselectAllOnCurrentPage()",new:'deselectAll("currentPage")'}};function BT(e,t,s){let i=OT[e];if(i){let{version:r,new:n,old:a,message:l}=i,c=a??e;return(...d)=>{let u=n?`Please use ${n} instead. `:"";return Ht(`Since ${r} api.${c} is deprecated. ${u}${l??""}`),t.apply(t,d)}}let o=GT[e];if(o)return(...r)=>{let n=s.rowModel.getType();if(!o.includes(n)){Gi(`api.${e} can only be called when gridOptions.rowModelType is ${o.join(" or ")}`);return}return t.apply(t,r)};return t}var VT={detailCellRendererCtrl:"SharedMasterDetail",dndSourceComp:"DragAndDrop",fillHandle:"CellSelection",groupCellRendererCtrl:"GroupCellRenderer",headerFilterCellCtrl:"ColumnFilter",headerGroupCellCtrl:"ColumnGroup",rangeHandle:"CellSelection",tooltipFeature:"Tooltip",highlightTooltipFeature:"Tooltip",tooltipStateManager:"Tooltip",groupStrategy:"RowGrouping",treeGroupStrategy:"TreeData",rowNumberRowResizer:"RowNumbers",singleCell:"EditCore",fullRow:"EditCore",agSetColumnFilterHandler:"SetFilter",agMultiColumnFilterHandler:"MultiFilter",agGroupColumnFilterHandler:"GroupFilter",agNumberColumnFilterHandler:"NumberFilter",agBigIntColumnFilterHandler:"BigIntFilter",agDateColumnFilterHandler:"DateFilter",agTextColumnFilterHandler:"TextFilter"},NT={expanded:1,contracted:1,"tree-closed":1,"tree-open":1,"tree-indeterminate":1,pin:1,"eye-slash":1,arrows:1,left:1,right:1,group:1,aggregation:1,pivot:1,"not-allowed":1,chart:1,cross:1,cancel:1,tick:1,first:1,previous:1,next:1,last:1,linked:1,unlinked:1,"color-picker":1,loading:1,menu:1,"menu-alt":1,filter:1,"filter-add":1,columns:1,maximize:1,minimize:1,copy:1,cut:1,paste:1,grip:1,save:1,csv:1,excel:1,"small-down":1,"small-left":1,"small-right":1,"small-up":1,asc:1,desc:1,aasc:1,adesc:1,none:1,up:1,down:1,plus:1,minus:1,settings:1,"checkbox-checked":1,"checkbox-indeterminate":1,"checkbox-unchecked":1,"radio-button-on":1,"radio-button-off":1,eye:1,"column-arrow":1,"un-pin":1,"pinned-top":1,"pinned-bottom":1,"chevron-up":1,"chevron-down":1,"chevron-left":1,"chevron-right":1,edit:1,search:1},_T={chart:"MenuCore",cancel:"EnterpriseCore",first:"Pagination",previous:"Pagination",next:"Pagination",last:"Pagination",linked:"IntegratedCharts",loadingMenuItems:"MenuCore",unlinked:"IntegratedCharts",menu:"ColumnHeaderComp",legacyMenu:"ColumnMenu",filter:"ColumnFilter",filterActive:"ColumnFilter",filterAdd:"NewFiltersToolPanel",filterCardCollapse:"NewFiltersToolPanel",filterCardExpand:"NewFiltersToolPanel",filterCardEditing:"NewFiltersToolPanel",filterTab:"ColumnMenu",filtersToolPanel:"FiltersToolPanel",columns:["MenuCore"],columnsToolPanel:["ColumnsToolPanel"],maximize:"EnterpriseCore",minimize:"EnterpriseCore",save:"MenuCore",columnGroupOpened:"ColumnGroupHeaderComp",columnGroupClosed:"ColumnGroupHeaderComp",accordionOpen:"EnterpriseCore",accordionClosed:"EnterpriseCore",accordionIndeterminate:"EnterpriseCore",columnSelectClosed:["ColumnsToolPanel","ColumnMenu"],columnSelectOpen:["ColumnsToolPanel","ColumnMenu"],columnSelectIndeterminate:["ColumnsToolPanel","ColumnMenu"],columnMovePin:"SharedDragAndDrop",columnMoveHide:"SharedDragAndDrop",columnMoveMove:"SharedDragAndDrop",columnMoveLeft:"SharedDragAndDrop",columnMoveRight:"SharedDragAndDrop",columnMoveGroup:"SharedDragAndDrop",columnMoveValue:"SharedDragAndDrop",columnMovePivot:"SharedDragAndDrop",dropNotAllowed:"SharedDragAndDrop",ensureColumnVisible:["ColumnsToolPanel","ColumnMenu"],groupContracted:"GroupCellRenderer",groupExpanded:"GroupCellRenderer",setFilterGroupClosed:"SetFilter",setFilterGroupOpen:"SetFilter",setFilterGroupIndeterminate:"SetFilter",setFilterLoading:"SetFilter",close:"EnterpriseCore",check:"MenuItem",colorPicker:"CommunityCore",groupLoading:"LoadingCellRenderer",overlayLoading:"Overlay",overlayExporting:"Overlay",menuAlt:"ColumnHeaderComp",menuPin:"MenuCore",menuValue:"MenuCore",menuAddRowGroup:["MenuCore","ColumnsToolPanel"],menuRemoveRowGroup:["MenuCore","ColumnsToolPanel"],clipboardCopy:"MenuCore",clipboardCut:"MenuCore",clipboardPaste:"MenuCore",pivotPanel:["ColumnsToolPanel","RowGroupingPanel"],rowGroupPanel:["ColumnsToolPanel","RowGroupingPanel"],valuePanel:"ColumnsToolPanel",columnDrag:"EnterpriseCore",rowDrag:["RowDrag","DragAndDrop"],csvExport:"MenuCore",excelExport:"MenuCore",smallDown:"CommunityCore",selectOpen:"CommunityCore",richSelectOpen:"RichSelect",richSelectRemove:"RichSelect",richSelectLoading:"RichSelect",smallLeft:"CommunityCore",smallRight:"CommunityCore",subMenuOpen:"MenuItem",subMenuOpenRtl:"MenuItem",panelDelimiter:"RowGroupingPanel",panelDelimiterRtl:"RowGroupingPanel",smallUp:"CommunityCore",sortAscending:["MenuCore","Sort"],sortDescending:["MenuCore","Sort"],sortAbsoluteAscending:["MenuCore","Sort"],sortAbsoluteDescending:["MenuCore","Sort"],sortUnSort:["MenuCore","Sort"],advancedFilterBuilder:"AdvancedFilter",advancedFilterBuilderDrag:"AdvancedFilter",advancedFilterBuilderInvalid:"AdvancedFilter",advancedFilterBuilderMoveUp:"AdvancedFilter",advancedFilterBuilderMoveDown:"AdvancedFilter",advancedFilterBuilderAdd:"AdvancedFilter",advancedFilterBuilderRemove:"AdvancedFilter",advancedFilterBuilderSelectOpen:"AdvancedFilter",chartsMenu:"IntegratedCharts",chartsMenuEdit:"IntegratedCharts",chartsMenuAdvancedSettings:"IntegratedCharts",chartsMenuAdd:"IntegratedCharts",chartsColorPicker:"IntegratedCharts",chartsThemePrevious:"IntegratedCharts",chartsThemeNext:"IntegratedCharts",chartsDownload:"IntegratedCharts",checkboxChecked:"CommunityCore",checkboxIndeterminate:"CommunityCore",checkboxUnchecked:"CommunityCore",radioButtonOn:"CommunityCore",radioButtonOff:"CommunityCore",rowPin:"PinnedRow",rowUnpin:"PinnedRow",rowPinBottom:"PinnedRow",rowPinTop:"PinnedRow",search:"Find"},HT=new Set(["colorPicker","smallUp","checkboxChecked","checkboxIndeterminate","checkboxUnchecked","radioButtonOn","radioButtonOff","smallDown","smallLeft","smallRight"]),zT=class extends y{constructor(){super(...arguments);this.beanName="validation",this.propertyNameCache=new Map}wireBeans(e){this.gridOptions=e.gridOptions,ow(WF)}warnOnInitialPropertyUpdate(e,t){if(e==="api"&&LT[t])F(22,{key:t})}processGridOptions(e){this.processOptions(e,Nx())}validateApiFunction(e,t){return BT(e,t,this.beans)}missingUserComponent(e,t,s,i){let o=_i[t];if(o)this.gos.assertModuleRegistered(o,`AG Grid '${e}' component: ${t}`);else F(101,{propertyName:e,componentName:t,agGridDefaults:s,jsComps:i})}missingDynamicBean(e){let t=VT[e];return t?ct(200,{...this.gos.getModuleErrorParams(),moduleName:t,reasonOrId:e}):void 0}checkRowEvents(e){if(WT.has(e))F(10,{eventType:e})}validateIcon(e){if(HT.has(e))F(43,{iconName:e});if(NT[e])return;let t=_T[e];if(t){X(200,{reasonOrId:`icon '${e}'`,moduleName:t,gridScoped:Yl(),gridId:this.beans.context.getId(),rowModelType:this.gos.get("rowModelType"),additionalText:"Alternatively, use the CSS icon name directly."});return}F(134,{iconName:e})}isProvidedUserComp(e){return!!_i[e]}validateColDef(e){this.processOptions(e,Mx())}processOptions(e,t){let{validations:s,deprecations:i,allProperties:o,allValidNames:r,objectName:n,docsUrl:a}=t,l=Object.keys(e),c=this.propertyNameCache.get(n);if(!c)c=new Map,this.propertyNameCache.set(n,c);let d=this.gridOptions.suppressPropertyNamesCheck!==!0,u=!1;for(let g of l){if(c.has(g))continue;let p=i[g];if(p){let{message:C,version:v}=p;Ht(`As of v${v}, ${g} is deprecated. ${C??""}`)}let f=s[g],m=this.gridOptions.rowModelType??"clientSide";if(f?.supportedRowModels&&!f.supportedRowModels.includes(m)){let C=e[g];if(C==null||C===!1)continue;Ht(`${g} is not supported with the '${m}' row model. It is only valid with: ${f.supportedRowModels.join(", ")}.`),c.set(g,!1);continue}if(!r.has(g)){if(d){let C=Rl({inputValue:g,allSuggestions:o}).values,v=`invalid ${n} property '${g}' did you mean any of these: ${C.slice(0,8).join(", ")}.`;if(r.has("context"))v+=`
71
- If you are trying to annotate ${n} with application data, use the '${n}.context' property instead.`;Ht(v)}u=!0,c.set(g,!1);continue}c.set(g,!0)}if(u&&a&&d){let g=this.beans.frameworkOverrides.getDocLink(a);Ht(`to see all the valid ${n} properties please check: ${g}`)}let h=new Set;if(l.forEach((g)=>{if(c.get(g)===!1)return;let p=e[g];if(p==null||p===!1)return;let f=s[g];if(!f)return;let{dependencies:m,validate:C,expectedType:v}=f;if(v){let w=typeof p;if(w!==v){h.add(`${String(g)} should be of type '${v}' but received '${w}' (${p}).`);return}}if(m){let w=this.checkForRequiredDependencies(g,m,e);if(w){h.add(w);return}}if(C){let w=C(e,this.gridOptions,this.beans);if(w){h.add(w);return}}}),h.size>0)for(let g of h)Ht(g)}checkForRequiredDependencies(e,t,s){let o=Object.entries(t).filter(([r,n])=>{let a=s[r];return!n.required.includes(a)});if(o.length===0)return null;return o.map(([r,n])=>`'${String(e)}' requires '${r}' to be one of [${n.required.map((a)=>{if(a===null)return"null";else if(a===void 0)return"undefined";return a}).join(", ")}]. ${n.reason??""}`).join(`
72
- `)}},WT=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Uf={moduleName:"Validation",version:z,beans:[zT]};var ro=class extends y{constructor(){super(...arguments);this.dispatchColumnChangedEvent=fp,this.columns=[],this.columnIndexMap={},this.updateIndexMap=()=>{this.columnIndexMap={},this.columns.forEach((e,t)=>this.columnIndexMap[e.getId()]=t)}}wireBeans(e){this.colModel=e.colModel,this.aggFuncSvc=e.aggFuncSvc,this.visibleCols=e.visibleCols,this.groupHierarchCols=e.groupHierarchyColSvc}sortColumns(e){let{groupHierarchCols:t}=this;this.columns.sort((s,i)=>t?.compareVirtualColumns(s,i)??e(s,i)),this.updateIndexMap()}setColumns(e,t){this.setColList(e,this.columns,this.eventName,!0,!0,this.columnProcessors.set,t)}addColumns(e,t){this.updateColList(e,this.columns,!0,!0,this.columnProcessors.add,this.eventName,t)}removeColumns(e,t){this.updateColList(e,this.columns,!1,!0,this.columnProcessors.remove,this.eventName,t)}getColumnIndex(e){return this.columnIndexMap[e]}setColList(e=[],t,s,i,o,r,n){let a=this.colModel.getCols();if(!a||a.length===0)return;let l=new Map;t.forEach((d,u)=>l.set(d,u)),t.length=0;for(let d of e){let u=this.colModel.getColDefCol(d);if(u)t.push(u)}t.forEach((d,u)=>{let h=l.get(d);if(h===void 0){l.set(d,0);return}if(i&&h!==u)return;l.delete(d)}),this.updateIndexMap();let c=this.colModel.getColDefCols();for(let d of c??[]){let u=t.indexOf(d)>=0;r(d,u,n)}if(o)this.colModel.refreshCols(!1,n);this.visibleCols.refresh(n),this.dispatchColumnChangedEvent(this.eventSvc,s,[...l.keys()],n)}updateColList(e=[],t,s,i,o,r,n){if(!e||e.length===0)return;let a=!1,l=new Set;for(let d of e){if(!d)continue;let u=this.colModel.getColDefCol(d);if(!u)continue;if(l.add(u),s){if(t.indexOf(u)>=0)continue;t.push(u)}else{let h=t.indexOf(u);if(h<0)continue;for(let g=h+1;g<t.length;g++)l.add(t[g]);ae(t,u)}o(u,s,n),a=!0}if(!a)return;if(this.updateIndexMap(),i)this.colModel.refreshCols(!1,n);this.visibleCols.refresh(n);let c=Array.from(l);this.eventSvc.dispatchEvent({type:r,columns:c,column:c.length===1?c[0]:null,source:n})}extractCols(e,t=[]){let s=this.columns,i=[],o=[],{setFlagFunc:r,getIndexFunc:n,getInitialIndexFunc:a,getValueFunc:l,getInitialValueFunc:c}=this.columnExtractors,d=this.colModel.getColDefCols();for(let f of d??[]){let m=!t.includes(f),C=f.colDef,v=l(C),w=c(C),S=n(C),x=a(C),R,P=v!==void 0,D=S!==void 0,O=w!==void 0,A=x!==void 0;if(P)R=v;else if(D)if(S===null)R=!1;else R=S>=0;else if(m)if(O)R=w;else if(A)R=x!=null&&x>=0;else R=!1;else R=s.indexOf(f)>=0;if(R)if(m?S!=null||x!=null:S!=null)i.push(f);else o.push(f)}let u=(f)=>{let m=f.colDef;return n(m)??a(m)};i.sort((f,m)=>u(f)-u(m));let h=[],g=this.groupHierarchCols,p=(f)=>{if(g)g.expandColumnInto(h,f);else h.push(f)};i.forEach(p);for(let f of s)if(o.indexOf(f)>=0)p(f);for(let f of o)if(h.indexOf(f)<0)p(f);for(let f of s)if(h.indexOf(f)<0)r(f,!1,e);for(let f of h)if(s.indexOf(f)<0)r(f,!0,e);return this.columns=h,this.updateIndexMap(),this.columns}restoreColumnOrder(e,t){let s=this.columns,i=this.colModel.getColDefCols();if(!s.length||!i)return e;let o=Object.keys(t),r=new Set(o),n=new Set(o),a=new Set(s.map((w)=>{let S=w.colId;return n.delete(S),S}).concat(o)),l=[],c={},d=0;for(let w=0;w<i.length;w++){let S=i[w].colId;if(a.has(S))l.push(S),c[S]=d++}let u=1000,h=!1,g=0,p=this.columnOrdering.enableProp,f=this.columnOrdering.initialEnableProp,m=this.columnOrdering.indexProp,C=this.columnOrdering.initialIndexProp,v=(w)=>{let S=c[w];for(let x=g;x<S;x++){let R=l[x];if(n.has(R))t[R][m]=u++,n.delete(R)}g=S};for(let w of s){let S=w.colId;if(r.has(S))v(S),t[S][m]=u++;else{let x=w.colDef;if(x[m]===null||x[m]===void 0&&x[C]==null){if(!h)if(x[p]||x[p]===void 0&&x[f])v(S);else{for(let D of n)t[D][m]=u+c[D];u+=l.length,h=!0}if(!e[S])e[S]={colId:S};e[S][m]=u++}}}return e}};var UT='.ag-toggle-button{flex:none;min-width:unset;width:unset}.ag-toggle-button-input-wrapper{background-color:var(--ag-toggle-button-off-background-color);border-radius:calc(var(--ag-toggle-button-height)*.5);flex:none;height:var(--ag-toggle-button-height);max-width:var(--ag-toggle-button-width);min-width:var(--ag-toggle-button-width);position:relative;transition:background-color .1s;:where(.ag-toggle-button-input){-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-toggle-button-height);margin:0;max-width:var(--ag-toggle-button-width);min-width:var(--ag-toggle-button-width);opacity:0}&.ag-checked{background-color:var(--ag-toggle-button-on-background-color)}&.ag-disabled{opacity:.5}}.ag-toggle-button-input-wrapper:before{background-color:var(--ag-toggle-button-switch-background-color);border-radius:100%;content:"";display:block;height:calc(var(--ag-toggle-button-height) - var(--ag-toggle-button-switch-inset)*2);left:var(--ag-toggle-button-switch-inset);pointer-events:none;position:absolute;top:var(--ag-toggle-button-switch-inset);transition:left .1s;width:calc(var(--ag-toggle-button-height) - var(--ag-toggle-button-switch-inset)*2)}.ag-toggle-button-input-wrapper.ag-checked:before{left:calc(100% - var(--ag-toggle-button-height) + var(--ag-toggle-button-switch-inset))}.ag-toggle-button-input-wrapper:focus-within{box-shadow:var(--ag-focus-shadow)}',ud=class extends Nn{constructor(e){super(e,"ag-toggle-button");this.registerCSS(UT)}setValue(e,t){return super.setValue(e,t),this.toggleCss("ag-selected",this.getValue()),this}},Kf={selector:"AG-TOGGLE-BUTTON",component:ud};var KT=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let s=e[0],i=e[1],o=e[2],r=e[3];s=this.ff(s,i,o,r,t[0],7,-680876936),r=this.ff(r,s,i,o,t[1],12,-389564586),o=this.ff(o,r,s,i,t[2],17,606105819),i=this.ff(i,o,r,s,t[3],22,-1044525330),s=this.ff(s,i,o,r,t[4],7,-176418897),r=this.ff(r,s,i,o,t[5],12,1200080426),o=this.ff(o,r,s,i,t[6],17,-1473231341),i=this.ff(i,o,r,s,t[7],22,-45705983),s=this.ff(s,i,o,r,t[8],7,1770035416),r=this.ff(r,s,i,o,t[9],12,-1958414417),o=this.ff(o,r,s,i,t[10],17,-42063),i=this.ff(i,o,r,s,t[11],22,-1990404162),s=this.ff(s,i,o,r,t[12],7,1804603682),r=this.ff(r,s,i,o,t[13],12,-40341101),o=this.ff(o,r,s,i,t[14],17,-1502002290),i=this.ff(i,o,r,s,t[15],22,1236535329),s=this.gg(s,i,o,r,t[1],5,-165796510),r=this.gg(r,s,i,o,t[6],9,-1069501632),o=this.gg(o,r,s,i,t[11],14,643717713),i=this.gg(i,o,r,s,t[0],20,-373897302),s=this.gg(s,i,o,r,t[5],5,-701558691),r=this.gg(r,s,i,o,t[10],9,38016083),o=this.gg(o,r,s,i,t[15],14,-660478335),i=this.gg(i,o,r,s,t[4],20,-405537848),s=this.gg(s,i,o,r,t[9],5,568446438),r=this.gg(r,s,i,o,t[14],9,-1019803690),o=this.gg(o,r,s,i,t[3],14,-187363961),i=this.gg(i,o,r,s,t[8],20,1163531501),s=this.gg(s,i,o,r,t[13],5,-1444681467),r=this.gg(r,s,i,o,t[2],9,-51403784),o=this.gg(o,r,s,i,t[7],14,1735328473),i=this.gg(i,o,r,s,t[12],20,-1926607734),s=this.hh(s,i,o,r,t[5],4,-378558),r=this.hh(r,s,i,o,t[8],11,-2022574463),o=this.hh(o,r,s,i,t[11],16,1839030562),i=this.hh(i,o,r,s,t[14],23,-35309556),s=this.hh(s,i,o,r,t[1],4,-1530992060),r=this.hh(r,s,i,o,t[4],11,1272893353),o=this.hh(o,r,s,i,t[7],16,-155497632),i=this.hh(i,o,r,s,t[10],23,-1094730640),s=this.hh(s,i,o,r,t[13],4,681279174),r=this.hh(r,s,i,o,t[0],11,-358537222),o=this.hh(o,r,s,i,t[3],16,-722521979),i=this.hh(i,o,r,s,t[6],23,76029189),s=this.hh(s,i,o,r,t[9],4,-640364487),r=this.hh(r,s,i,o,t[12],11,-421815835),o=this.hh(o,r,s,i,t[15],16,530742520),i=this.hh(i,o,r,s,t[2],23,-995338651),s=this.ii(s,i,o,r,t[0],6,-198630844),r=this.ii(r,s,i,o,t[7],10,1126891415),o=this.ii(o,r,s,i,t[14],15,-1416354905),i=this.ii(i,o,r,s,t[5],21,-57434055),s=this.ii(s,i,o,r,t[12],6,1700485571),r=this.ii(r,s,i,o,t[3],10,-1894986606),o=this.ii(o,r,s,i,t[10],15,-1051523),i=this.ii(i,o,r,s,t[1],21,-2054922799),s=this.ii(s,i,o,r,t[8],6,1873313359),r=this.ii(r,s,i,o,t[15],10,-30611744),o=this.ii(o,r,s,i,t[6],15,-1560198380),i=this.ii(i,o,r,s,t[13],21,1309151649),s=this.ii(s,i,o,r,t[4],6,-145523070),r=this.ii(r,s,i,o,t[11],10,-1120210379),o=this.ii(o,r,s,i,t[2],15,718787259),i=this.ii(i,o,r,s,t[9],21,-343485551),e[0]=this.add32(s,e[0]),e[1]=this.add32(i,e[1]),e[2]=this.add32(o,e[2]),e[3]=this.add32(r,e[3])}cmn(e,t,s,i,o,r){return t=this.add32(this.add32(t,e),this.add32(i,r)),this.add32(t<<o|t>>>32-o,s)}ff(e,t,s,i,o,r,n){return this.cmn(t&s|~t&i,e,t,o,r,n)}gg(e,t,s,i,o,r,n){return this.cmn(t&i|s&~i,e,t,o,r,n)}hh(e,t,s,i,o,r,n){return this.cmn(t^s^i,e,t,o,r,n)}ii(e,t,s,i,o,r,n){return this.cmn(s^(t|~i),e,t,o,r,n)}md51(e){let t=e.length,s=[1732584193,-271733879,-1732584194,271733878],i;for(i=64;i<=e.length;i+=64)this.md5cycle(s,this.md5blk(e.substring(i-64,i)));e=e.substring(i-64);let o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<e.length;i++)o[i>>2]|=e.charCodeAt(i)<<(i%4<<3);if(o[i>>2]|=128<<(i%4<<3),i>55){this.md5cycle(s,o);for(i=0;i<16;i++)o[i]=0}return o[14]=t*8,this.md5cycle(s,o),s}md5blk(e){let t=[];for(let s=0;s<64;s+=4)t[s>>2]=e.charCodeAt(s)+(e.charCodeAt(s+1)<<8)+(e.charCodeAt(s+2)<<16)+(e.charCodeAt(s+3)<<24);return t}rhex(e){let t="0123456789abcdef".split(""),s="",i=0;for(;i<4;i++)s+=t[e>>i*8+4&15]+t[e>>i*8&15];return s}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){let s=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(s>>16)<<16|s&65535}},Xn={"01":"GRID","02":"CHARTS","0102":"BOTH"};var Lm=class e{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new KT,this.md5.init()}validateLicense(){let t=this.getLicenseDetails(e.licenseKey),s=`AG Grid ${t.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,i=t.suppliedLicenseType===void 0?"":`AG ${t.suppliedLicenseType==="BOTH"?"Grid and AG Charts":t.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(t.missing){if(!this.isWebsiteUrl()||this.isForceWatermark())this.outputMissingLicenseKey(s)}else if(t.expired){let o=e.getGridReleaseDate(),r=e.formatDate(o);this.outputExpiredKey(t.expiry,r,s,i)}else if(!t.valid)this.outputInvalidLicenseKey(!!t.incorrectLicenseType,s,i);else if(t.isTrial&&t.trialExpired)this.outputExpiredTrialKey(t.expiry,s,i)}static extractExpiry(t){let s=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(s),10))}static extractLicenseComponents(t){let s=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(s=s.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};let i=s.length-32,o=s.substring(i),r=s.substring(0,i),[n,a,l]=e.extractBracketedInformation(s);return{md5:o,license:r,version:n,isTrial:a,type:l}}getLicenseDetails(t){let s=e.chartsLicenseManager?"BOTH":"GRID";if(!t?.length)return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};let i=e.getGridReleaseDate(),{md5:o,license:r,version:n,isTrial:a,type:l}=e.extractLicenseComponents(t),c=o===this.md5.md5(r)&&!t.includes("For_Trialing_ag-Grid_Only"),d=void 0,u=void 0,h=null,g=!1,p=void 0;function f(){d=h<new Date,u=void 0}if(c){if(h=e.extractExpiry(r),c=!isNaN(h.getTime()),c)switch(u=i>h,n){case"legacy":case"2":{if(a)f();break}case"3":if(!l?.length)c=!1;else if(p=l,l!==Xn["01"]&&l!==Xn["0102"]||s==="BOTH"&&p!=="BOTH")c=!1,g=!0;else if(a)f()}}if(!c)return{licenseKey:t,valid:c,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:p};return{licenseKey:t,valid:c,expiry:e.formatDate(h),expired:u,version:n,isTrial:a,trialExpired:d,incorrectLicenseType:g,currentLicenseType:s,suppliedLicenseType:p}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){let s=(this.document.defaultView||window).location,{hostname:i=""}=s;return i}isForceWatermark(){let s=(this.document.defaultView||window).location,{pathname:i}=s;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){return this.getHostname().match(/^(?:[\w-]+\.)?(ag-grid|bryntum)\.com$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(t){let s=["January","February","March","April","May","June","July","August","September","October","November","December"],i=t.getDate(),o=t.getMonth(),r=t.getFullYear();return i+" "+s[o]+" "+r}static getGridReleaseDate(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))}static decode(t){let i="",o,r,n,a,l,c,d,u=0,h=t.replace(/[^A-Za-z0-9+/=]/g,"");while(u<h.length){if(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(u++)),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(u++)),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(u++)),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(u++)),o=a<<2|l>>4,r=(l&15)<<4|c>>2,n=(c&3)<<6|d,i=i+String.fromCharCode(o),c!=64)i=i+String.fromCharCode(r);if(d!=64)i=i+String.fromCharCode(n)}return i=e.utf8_decode(i),i}static utf8_decode(t){t=t.replace(/rn/g,"n");let s="";for(let i=0;i<t.length;i++){let o=t.charCodeAt(i);if(o<128)s+=String.fromCharCode(o);else if(o>127&&o<2048)s+=String.fromCharCode(o>>6|192),s+=String.fromCharCode(o&63|128);else s+=String.fromCharCode(o>>12|224),s+=String.fromCharCode(o>>6&63|128),s+=String.fromCharCode(o&63|128)}return s}static setChartsLicenseManager(t){this.chartsLicenseManager=t,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(t){if(M(this.licenseKey)&&this.licenseKey!==t)Yh(291,void 0,"AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used.");this.licenseKey=t,this.chartsLicenseManager?.setLicenseKey(t,!0)}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];let s=t.match(/\[(.*?)\]/g).map((a)=>a.replace("[","").replace("]",""));if(!s||s.length===0)return["legacy",!1,void 0];let i=s.filter((a)=>a==="TRIAL").length===1,o=s.filter((a)=>a.indexOf("v")===0)[0],r=o?o.replace("v",""):"legacy",n=Xn[s.filter((a)=>Xn[a])[0]];return[r,i,n]}centerPadAndOutput(t){let s=this.totalMessageLength-t.length}padAndOutput(t,s="*",i=""){}outputInvalidLicenseKey(t,s,i){}outputExpiredTrialKey(t,s,i){}outputMissingLicenseKey(t){}outputExpiredKey(t,s,i,o){}};Lm.RELEASE_INFORMATION="MTc4MDM5NjMzMjUzMg==";var Zn=Lm,$T='.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}',jT={tag:"div",cls:"ag-watermark",children:[{tag:"div",ref:"eLicenseTextRef",cls:"ag-watermark-text"}]},qT=class extends L{constructor(){super(jT);this.eLicenseTextRef=E,this.registerCSS($T)}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){let e=this.shouldDisplayWatermark();if(this.setDisplayed(e),e)this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCss("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5000)}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},YT={selector:"AG-WATERMARK",component:qT},$f=class extends y{constructor(){super(...arguments);this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){let e=this.beans;if(e.withinStudio)this.licenseManager={isDisplayWatermark:()=>!1,getWatermarkMessage:()=>""};else{let t=new Zn(ce(e));this.licenseManager=t,t.validateLicense()}}static getLicenseDetails(e){return new Zn(null).getLicenseDetails(e)}getWatermarkSelector(){return YT}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){Zn.setLicenseKey(e)}static setChartsLicenseManager(e){Zn.setChartsLicenseManager(e)}},XT=9525,jf={"0":1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},Qn=`\r
73
- `;function qf(e,t,s){if(!t&&t!==""&&t!==0)return"";let i=t;if(typeof t==="boolean"){if(s)i=s(t)}return` ${e}="${i}"`}function ZT(e={}){let i=["version"];if(!e.version)e.version="1.0";if(e.encoding)i.push("encoding");if(e.standalone)i.push("standalone");return`<?xml ${i.map((r)=>`${r}="${e[r]}"`).join(" ")} ?>`}function Gm(e,t){let s="";if(e.properties){if(e.properties.prefixedAttributes)e.properties.prefixedAttributes.forEach((o)=>{for(let r of Object.keys(o.map))s+=qf(o.prefix+r,o.map[r],t)});if(e.properties.rawMap)for(let o of Object.keys(e.properties.rawMap))s+=qf(o,e.properties.rawMap[o],t)}let i="<"+e.name+s;if(!e.children&&e.textNode==null)return i+"/>"+Qn;if(e.textNode!=null)return i+">"+e.textNode+"</"+e.name+">"+Qn;if(i+=">"+Qn,e.children)for(let o of e.children)i+=Gm(o,t);return i+"</"+e.name+">"+Qn}var QT=(e)=>Math.round(e*96/72),no=(e)=>Math.ceil(e*XT),JT=(e)=>{if(e===void 0)return;let s=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(e||"Automatic");return Math.max(s,0)},sa=(e,t)=>{if(!t)return;let s;if(typeof t==="number")s=t;else s=t({rowIndex:e});return s},eD=(e,t)=>{let{colSpan:s,column:i}=e.position;if(!e.width)return;if(s){let o=t.slice(i-1,i+s-1),r=0;for(let n=0;n<o.length;n++){let a=o[n].getActualWidth();if(e.width<r+a){e.position.colSpan=n+1,e.totalWidth=e.width,e.width=e.totalWidth-r;break}r+=a}}else e.totalWidth=e.width},tD=(e,t)=>{let{rowSpan:s,row:i}=e.position;if(!e.height)return;if(s){let o=0,r=0;for(let n=i;n<i+s;n++){let a=QT(sa(n,t)||20);if(e.height<o+a){e.position.rowSpan=r+1,e.totalHeight=e.height,e.height=e.totalHeight-o;break}o+=a,r++}}else e.totalHeight=e.height},Ge=(e,t)=>{let s=ZT({encoding:"UTF-8",standalone:"yes"}),i=Gm(e);if(t)return i;return`${s}${i}`},Fi=(e)=>{let i=String.fromCharCode,o=Math.floor(e/26),r=e%26;if(!o||e===26)return i(65+e-1);if(!r)return Fi(o-1)+"Z";if(o<26)return i(65+o-1)+i(65+r-1);return Fi(o)+i(65+r-1)},sD=(e)=>e.replaceAll(`
74
- `,"_x000a_"),mr=(e)=>{if(e==null)return null;let t="";for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);if(i>=0&&i<=31&&i!==10){let n=`_x${i.toString(16).toUpperCase().padStart(4,"0")}_`;t+=n}else t+=e[s]}return t},iD=(e)=>{let t=[];for(let s of e.keys()){let i=s.toString(),o={name:"t",textNode:he(mr(i))};if(i.trim().length!==i.length)o.properties={rawMap:{"xml:space":"preserve"}};t.push({name:"si",children:[o]})}return t},oD=class extends Wc{constructor(e){super(e);this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.frozenRowCount=0,this.skipFrozenRows=!1,this.frozenColumnCount=0,this.skipFrozenColumns=!1,this.formulaSvc=e.formulaSvc,this.notesSvc=e.notesSvc,this.config=Object.assign({},e),this.workbook=e.workbook,this.stylesByIds={};for(let s of this.config.baseExcelStyles)this.stylesByIds[s.id]=s;let t={id:"_quotePrefix",quotePrefix:1};this.stylesByIds[t.id]=t,this.excelStyles=[...this.config.baseExcelStyles,t]}addCustomContent(e){for(let t of e){let s=this.rows.length+1,i;if(!this.config.suppressRowOutline&&t.outlineLevel!=null)i=t.outlineLevel;let o={height:sa(s,t.height||this.config.rowHeight),cells:(t.cells||[]).map((r,n)=>{let a=this.addImage(s,this.columnsToExport[n],r.data?.value),l=null;if(r.styleId)l=typeof r.styleId==="string"?[r.styleId]:r.styleId;let c=this.getStyleId(l);if(a)return this.createCell(c,this.getDataTypeForValue(a.value),a.value==null?"":a.value,void 0,r.note);let d=r.data?.value??"",u=this.getDataTypeForValue(d);if(r.mergeAcross)return this.createMergedCell(c,u,d,r.mergeAcross,r.note);return this.createCell(c,u,d,void 0,r.note)}),outlineLevel:i};if(t.collapsed!=null)o.collapsed=t.collapsed;if(t.hidden!=null)o.hidden=t.hidden;this.rows.push(o)}}onNewHeaderGroupingRow(){let e=[],{freezeRows:t,headerRowHeight:s}=this.config;if(this.rows.push({cells:e,height:sa(this.rows.length+1,s)}),t)this.frozenRowCount++;return{onColumn:(i,o,r,n,a)=>{let l=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${o}`,columnGroup:i});e.push({...this.createMergedCell(this.getStyleId(l),this.getDataTypeForValue("string"),o,n),collapsibleRanges:a})}}}onNewHeaderRow(){let{freezeRows:e,headerRowHeight:t}=this.config;if(e)this.frozenRowCount++;return this.onNewRow(this.onNewHeaderColumn,t)}onNewBodyRow(e){let{freezeRows:t,rowHeight:s}=this.config;if(!this.skipFrozenRows)if(t==="headersAndPinnedRows"&&e?.rowPinned==="top")this.frozenRowCount++;else if(typeof t==="function")if(t(I(this.gos,{node:e})))this.frozenRowCount++;else this.skipFrozenRows=!0;else this.skipFrozenRows=!0;let i=this.onNewRow(this.onNewBodyColumn,s);if(e)this.addRowOutlineIfNecessary(e);return i}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((t,s)=>this.convertColumnToExcel(t,s))}parse(){let e=this.rows.reduce((s,i)=>Math.max(s,i.cells.length),0);while(this.cols.length<e)this.cols.push(this.convertColumnToExcel(null,this.cols.length+1));let t=this.createWorksheet();return this.addWorksheetToWorkbook(t)}createWorksheet(){let{sheetName:e}=this.config,t;if(e!=null){let s=typeof e==="function"?e(I(this.gos,{})):e;t=String(s).substring(0,31)}else t="ag-grid";return{name:t,table:{columns:this.cols,rows:this.rows}}}addRowOutlineIfNecessary(e){let{gos:t,suppressRowOutline:s,rowGroupExpandState:i="expanded"}=this.config;if(t.get("groupHideOpenParents")||s||e.level==null)return;let r=e.footer?1:0,n=k(this.rows);if(e.uiLevel==null||e.level===e.uiLevel){let l=Math.min(e.level+r,7);n.outlineLevel=l}if(i==="expanded")return;let a=i==="collapsed";if(e.isExpandable()){let l=!a&&e.expanded;n.collapsed=!l}n.hidden=!!e.parent&&e.parent.level!==-1&&(a||this.isAnyParentCollapsed(e.parent))}isAnyParentCollapsed(e){while(e&&e.level!==-1){if(!e.expanded)return!0;e=e.parent}return!1}convertColumnToExcel(e,t){let s=this.config.columnWidth,o=(e?this.extractHeaderValue(e):void 0)??"",r=e?e.isFilterAllowed():!1;if(s){if(typeof s==="number")return{width:s,displayName:o,filterAllowed:r};return{width:s({column:e,index:t}),displayName:o,filterAllowed:r}}if(e)return{width:Math.max(e.getActualWidth(),75),displayName:o,filterAllowed:r};return{displayName:o,filterAllowed:r}}onNewHeaderColumn(e,t){return(s)=>{let i=this.extractHeaderValue(s),o=this.config.styleLinker({rowType:"HEADER",rowIndex:e,value:i,column:s});t.push(this.createCell(this.getStyleId(o),this.getDataTypeForValue("string"),i))}}onNewBodyColumn(e,t){let s=0,{freezeColumns:i,rightToLeft:o}=this.config;return(r,n,a)=>{if(s>0){s-=1;return}if(!this.skipFrozenColumns){let C=r.getPinned();if(i==="pinned"&&C&&(C===!0||C==="left")!==o)this.frozenColumnCount++;else if(typeof i==="function"&&i(I(this.gos,{column:r})))this.frozenColumnCount++;else this.skipFrozenColumns=!0}let{value:l,valueFormatted:c}=this.extractRowCellValue({column:r,node:a,currentColumnIndex:n,accumulatedRowIndex:e,type:"excel",useRawFormula:!0}),d=l,u=typeof d==="bigint"?d.toString():d,h=this.config.styleLinker({rowType:"BODY",rowIndex:e,value:d,column:r,node:a}),g=this.getStyleId(h),p=r.getColSpan(a),f=this.addImage(e,r,u),m=this.resolveBodyCellNote({accumulatedRowIndex:e,column:r,node:a});if(f)t.push(this.createCell(g,this.getDataTypeForValue(f.value),f.value==null?"":f.value,void 0,m));else if(p>1)s=p-1,t.push(this.createMergedCell(g,this.getDataTypeForValue(d),u,p-1,m));else{let C=r.colDef.allowFormula&&this.formulaSvc?.isFormula(u),v=this.createCell(g,C?"f":this.getDataTypeForValue(d),C?this.formulaSvc?.updateFormulaByOffset({value:u,rowDelta:e-(a.formulaRowIndex+1),useRefFormat:!1}):u,c,m);t.push(v)}}}onNewRow(e,t){let s=[];return this.rows.push({cells:s,height:sa(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,s)()}}addWorksheetToWorkbook(e){let{excelStyles:t,config:s}=this;if(this.mapSharedStrings(e),this.frozenColumnCount)s.frozenColumnCount=this.frozenColumnCount;if(this.frozenRowCount)s.frozenRowCount=this.frozenRowCount;return this.workbook.addWorksheet(t,e,s)}mapSharedStrings(e){for(let t of e.table.rows)for(let s of t.cells){let i=s.data;if(i?.type!=="s")continue;let o=i.value;if(o==null||o==="")continue;i.value=this.workbook.getStringPosition(String(o)).toString()}}getDataTypeForValue(e){if(e===void 0)return"empty";let t="s";try{if(this.isNumerical(e))t="n"}catch{}return t}getTypeFromStyle(e,t){if(this.isFormula(t))return"f";if(e?.dataType)switch(e.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:F(162,{id:e.id,dataType:e.dataType})}return null}addImage(e,t,s){if(!this.config.addImageToCell)return;let i=this.config.addImageToCell(e,t,s);if(!i)return;return this.workbook.addBodyImageToMap(i.image,e,t,this.columnsToExport,this.config.rowHeight),i}createCell(e,t,s,i,o){let r=this.getStyleById(e);if(!r?.dataType&&t==="s"&&i!=null)s=i;let n=this.getTypeFromStyle(r,s)||t,{type:a,value:l,escaped:c}=this.getCellValue(n,s),d=[];if(r)d.push(e);if(c)d.push("_quotePrefix");return e=this.getStyleId(d)||void 0,{styleId:e,data:{type:a,value:l},note:o?.text?o:void 0}}createMergedCell(e,t,s,i,o){let r=this.getStyleById(e),n=s==null?"":s,a=this.getTypeFromStyle(r,n)||t,{type:l,value:c}=this.getCellValue(a,n);return{styleId:r?e:void 0,data:{type:l,value:c},mergeAcross:i,note:o?.text?o:void 0}}resolveBodyCellNote(e){let{processNoteCallback:t,suppressGridNotesExport:s}=this.config,i=!s&&!!this.notesSvc?.hasDataSource(),r=!!this.notesSvc&&(i||!!t)?this.notesSvc?.getNote({rowNode:e.node,column:e.column,location:"cell"}):void 0,n;if(i&&r?.text!=null&&r.text!=="")n={text:r.text,author:r.author};if(!t)return n;let a=t(this.getCellNoteExportParams(e,r,n));if(a===void 0)return n;if(a?.text==null||a.text==="")return;return{text:a.text,author:a.author}}getCellNoteExportParams(e,t,s){let{column:i,node:o,accumulatedRowIndex:r}=e,n=this.valueSvc.getValueForDisplay({column:i,node:o,from:this.valueFrom}).value;return I(this.gos,{accumulatedRowIndex:r,column:i,node:o,value:n,type:"excel",parseValue:(a)=>this.valueSvc.parseValue(i,o,a,this.valueSvc.getValue(i,o,this.valueFrom)),formatValue:(a)=>this.valueSvc.formatValue(i,o,a)??a,gridNote:t,excelNote:s})}getCellValue(e,t){let s=!1;if(t==null||t===""||e==="empty")return{type:"empty",value:null,escaped:!1};if(e==="s"){if(t=String(t),t[0]==="'"){if(s=!0,t=t.slice(1),t==="")return{type:"empty",value:null,escaped:!1}}}else if(e==="f")t=this.addXlfnPrefix(t).slice(1);else if(e==="n"){let i=Number(t);if(isNaN(i))return{type:"empty",value:null,escaped:!1};else t=i.toString()}return{type:e,value:t,escaped:s}}addXlfnPrefix(e){if(!e)return e;let t=/(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi;return e.replace(t,(s,i,o,r)=>`${i}_xlfn.${o}${r}`)}getStyleId(e){if(!e?.length)return null;let t=e.filter((i)=>this.stylesByIds[i]!=null);if(!t.length)return null;if(t.length===1)return t[0];let s=t.join("-");if(!this.mixedStyles[s])this.addNewMixedStyle(t);return this.mixedStyles[s].excelID}addNewMixedStyle(e){this.mixedStyleCounter+=1;let t=`mixedStyle${this.mixedStyleCounter}`,s={};for(let o of e){let r=this.stylesByIds[o];if(r)Se(s,r,!0,!0)}s.id=t;let i=e.join("-");this.mixedStyles[i]={excelID:t,key:i,result:s},this.excelStyles.push(s),this.stylesByIds[t]=s}isFormula(e){if(e==null)return!1;let t=String(e);return this.config.autoConvertFormulas&&Gl(t)}isNumerical(e){if(typeof e==="bigint")return!1;return isFinite(e)&&e!==""&&!isNaN(parseFloat(e))}getStyleById(e){if(e==null)return null;return this.stylesByIds[e]||null}},Om={name:"rPr",children:[{name:"sz",properties:{rawMap:{val:"10"}}},{name:"color",properties:{rawMap:{rgb:"FF000000"}}},{name:"rFont",properties:{rawMap:{val:"Tahoma"}}},{name:"family",properties:{rawMap:{val:"2"}}}]},rD={name:"rPr",children:[{name:"b"},...Om.children]},nD=(e,t)=>({name:"t",properties:t?{rawMap:{"xml:space":"preserve"}}:void 0,textNode:he(mr(e)??"")}),hd=(e,t,s)=>({name:"r",children:[t?rD:Om,nD(e,s)]}),aD=(e,t,s)=>{if(!t||!s)return[hd(e,!1,e.includes(`
75
- `)||e.trim().length!==e.length)];return[hd(`${t}:
76
- `,!0,!0),hd(e,!1,e.includes(`
77
- `)||e.trim().length!==e.length)]},lD={getTemplate(e){let t=new Map,s=[],i=e.comments.map((o)=>{let r=o.author||e.defaultAuthor,n=t.get(r);if(n==null)n=s.length,s.push(r),t.set(r,n);return{name:"comment",properties:{rawMap:{ref:o.ref,authorId:n}},children:[{name:"text",children:aD(o.text,r,e.prependAuthor)}]}});return{name:"comments",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"authors",children:s.map((o)=>({name:"author",textNode:he(o)}))},{name:"commentList",children:i}]}}},cD=lD,dD={getTemplate(e){let{name:t,ContentType:s,Extension:i,PartName:o}=e;return{name:t,properties:{rawMap:{Extension:i,PartName:o,ContentType:s}}}}},uD=dD,pa=(e)=>e==="jpg"?"jpeg":e,hD={getTemplate({sheetLen:e,hasCustomProperties:t}){let s=Array(e).fill(void 0).map((g,p)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${p+1}.xml`})),i=qs.size,o=yt.size,r=Gt.size,n={};uo.forEach((g)=>{n[pa(g.type)]=!0});let a=Array(i).fill(void 0).map((g,p)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${p+1}.xml`})),l=[],c=Array(r).fill(void 0).map((g,p)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",PartName:`/xl/comments${p+1}.xml`}));xt.forEach(({name:g})=>{l.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${g}.xml`})});let d=t?[{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",PartName:"/docProps/custom.xml"}]:[],u=Object.keys(n).map((g)=>({name:"Default",ContentType:`image/${g}`,Extension:g}));if(o||r)u.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"});let h=[...u,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...s,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...a,...c,...l,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"},...d].map((g)=>uD.getTemplate(g));return{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:h}}},gD=hD,pD={getTemplate(e){let s=new Date().toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:e},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:s},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:s}]}}},fD=pD,mD="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",CD=(e)=>Object.keys(e).filter((s)=>s&&e[s]!=null).map((s,i)=>({name:"property",properties:{rawMap:{fmtid:mD,pid:(i+2).toString(),name:he(s)??""}},children:[{name:"vt:lpwstr",textNode:he(mr(String(e[s])))??""}]})),vD={getTemplate(e){return{name:"Properties",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}},children:CD(e)}}},wD=vD,Yf=(e,t)=>({name:`xdr:${e}`,children:[{name:"xdr:col",textNode:t.col.toString()},{name:"xdr:colOff",textNode:t.offsetX.toString()},{name:"xdr:row",textNode:t.row.toString()},{name:"xdr:rowOff",textNode:t.offsetY.toString()}]}),bD=(e)=>{let t=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(e.recolor?.toLowerCase()){case"grayscale":case"sepia":case"washout":t.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:t}},SD=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:e.altText!=null?e.altText:void 0}},children:[bD(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),Xf=(e)=>{if(!e.saturation&&!e.tint)return;let t=[];if(e.saturation)t.push({name:"a:satMod",properties:{rawMap:{val:e.saturation*1000}}});if(e.tint)t.push({name:"a:tint",properties:{rawMap:{val:e.tint*1000}}});return t},yD=(e,t)=>({name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:e.color}},children:Xf(e)},{name:"a:srgbClr",properties:{rawMap:{val:t.color}},children:Xf(t)}]}),xD=(e,t)=>{let s;if(e.transparency){let i=Math.min(Math.max(e.transparency,0),100);s=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(i*1000)}}}]}if(e.recolor){if(!s)s=[];switch(e.recolor.toLocaleLowerCase()){case"grayscale":s.push({name:"a:grayscl"});break;case"sepia":s.push(yD({color:"black"},{color:"D9C3A5",tint:50,saturation:180}));break;case"washout":s.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}});break;default:}}return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${t}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:s},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},RD=(e,t)=>{let s={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:t.width,cy:t.height}}}]};if(e.rotation){let r=e.rotation;s.properties={rawMap:{rot:Math.min(Math.max(r,0),360)*60000}}}return{name:"xdr:spPr",children:[s,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},FD=(e)=>{e.fitCell=!!e.fitCell||!e.width||!e.height;let{position:t={},fitCell:s,width:i=0,height:o=0,totalHeight:r,totalWidth:n}=e,{offsetX:a=0,offsetY:l=0,row:c=1,rowSpan:d=1,column:u=1,colSpan:h=1}=t;return{from:{row:c-1,col:u-1,offsetX:no(a),offsetY:no(l)},to:{row:c-1+(s?1:d-1),col:u-1+(s?1:h-1),offsetX:no(i+a),offsetY:no(o+l)},height:no(r||o),width:no(n||i)}},ED=(e,t,s,i)=>({name:"xdr:pic",children:[SD(e,t+1),xD(e,s+1),RD(e,i)]}),PD={getTemplate(e){let{sheetIndex:t}=e,s=qs.get(t),i=ho.get(t),o=s.map((r,n)=>{let a=FD(r);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[Yf("from",a.from),Yf("to",a.to),ED(r,n,i.get(r.id).index,a),{name:"xdr:clientData"}]}});return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:o}}},MD=PD,Bm=(e)=>{let t=0,s=0;while(s<e.length){let o=e.charCodeAt(s);if(o<65||o>90)break;t=t*26+(o-64),s++}return{row:Number(e.slice(s))-1,column:t-1}},TD=()=>({name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]}),DD=()=>({name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"202"}}],rawMap:{id:"_x0000_t202",coordsize:"21600,21600",path:"m0,0l0,21600,21600,21600,21600,0xe"}},children:[{name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}},{name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect"}}],rawMap:{gradientshapeok:"t"}}}]}),AD=(e)=>{let{row:t,column:s}=Bm(e.ref);return`${s+1},0,${t+1},0,${s+3},20,${t+5},20`},ID=(e)=>{let{row:t,column:s}=Bm(e.ref);return{name:"x:ClientData",properties:{rawMap:{ObjectType:"Note"}},children:[{name:"x:MoveWithCells"},{name:"x:SizeWithCells"},{name:"x:Anchor",textNode:AD(e)},{name:"x:AutoFill",textNode:"False"},{name:"x:Row",textNode:String(t)},{name:"x:Column",textNode:String(s)}]}},kD=(e,t)=>({name:"v:shape",properties:{prefixedAttributes:[{prefix:"o:",map:{insetmode:"auto"}}],rawMap:{id:`_x0000_s${1025+t}`,type:"#_x0000_t202",style:"position:absolute;margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10;visibility:hidden",fillcolor:"#ffffe1",strokecolor:"#000000"}},children:[{name:"v:fill",properties:{rawMap:{color2:"#ffffe1"}}},{name:"v:shadow",properties:{rawMap:{color:"black",obscured:"t"}}},{name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"none"}}]}},{name:"v:textbox",properties:{rawMap:{style:"mso-direction-alt:auto"}},children:[{name:"div",properties:{rawMap:{style:"text-align:left"}}}]},ID(e)]}),LD={getTemplate(e){let t=Gt.get(e.sheetIndex)||[];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:[TD(),DD(),...t.map((s,i)=>kD(s,i))]}}},GD=LD,OD={getTemplate(e){let{Id:t,Type:s,Target:i}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:s,Target:i}}}}},BD=OD,VD={getTemplate(e){let t=e.map((s)=>BD.getTemplate(s));return{name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:t}}},wr=VD,ND={getTemplate(e){return{name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.size,uniqueCount:e.size}},children:iD(e)}}},_D=ND,HD=(e)=>{switch(e){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}},zD={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},WD=["Dashed","DashDot","DashDotDot"],UD={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},KD={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},$D={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},jD=(e)=>{if(!e)return"none";return UD[e]||e},js=(e)=>{if(e==null)return e;if(e.charAt(0)==="#")e=e.substring(1);return e.length===6?"FF"+e:e},Jn=(e,t)=>{if(!e)return"thin";let s=HD(t);if(e==="Continuous")return s;let i=zD[e];if(s==="medium"&&WD.some((o)=>o===i))return`medium${i}`;return`${i.charAt(0).toLowerCase()}${i.substring(1)}`},qD=(e)=>KD[e]||"general",YD=(e)=>$D[e]||void 0,nr=(e)=>({name:"color",properties:{rawMap:{rgb:js(e||"#000000")}}}),XD={getTemplate(e){let{left:t,right:s,top:i,bottom:o,diagonal:r}=e,n=t?[nr(t.color)]:void 0,a=s?[nr(s.color)]:void 0,l=i?[nr(i.color)]:void 0,c=o?[nr(o.color)]:void 0,d=r?[nr(r.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:t?.style}},children:n},{name:"right",properties:{rawMap:{style:s?.style}},children:a},{name:"top",properties:{rawMap:{style:i?.style}},children:l},{name:"bottom",properties:{rawMap:{style:o?.style}},children:c},{name:"diagonal",properties:{rawMap:{style:r?.style}},children:d}]}}},ZD=XD,QD={getTemplate(e){return{name:"borders",properties:{rawMap:{count:e.length}},children:e.map((t)=>ZD.getTemplate(t))}}},JD=QD,eA=(e)=>{let s=["Context","LeftToRight","RightToLeft"].indexOf(e);return Math.max(s,0)},tA={getTemplate(e){let{horizontal:t,indent:s,readingOrder:i,rotate:o,shrinkToFit:r,vertical:n,wrapText:a}=e;return{name:"alignment",properties:{rawMap:{horizontal:t&&qD(t),indent:s,readingOrder:i&&eA(i),textRotation:o,shrinkToFit:r,vertical:n&&YD(n),wrapText:a}}}}},sA=tA,iA={getTemplate(e){let t=e.protected===!1?0:1;return{name:"protection",properties:{rawMap:{hidden:e.hideFormula===!0?1:0,locked:t}}}}},oA=iA,rA={getTemplate(e){let{alignment:t,borderId:s,fillId:i,fontId:o,numFmtId:r,protection:n,quotePrefix:a,xfId:l}=e,c=[];if(t)c.push(sA.getTemplate(t));if(n)c.push(oA.getTemplate(n));return{name:"xf",properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:n?1:void 0,applyBorder:s?1:void 0,applyFill:i?1:void 0,borderId:s,fillId:i,applyFont:o?1:void 0,fontId:o,applyNumberFormat:r?1:void 0,numFmtId:r,quotePrefix:a?1:void 0,xfId:l}},children:c.length?c:void 0}}},Vm=rA,nA={getTemplate(e){return{name:"cellStyleXfs",properties:{rawMap:{count:e.length}},children:e.map((t)=>Vm.getTemplate(t))}}},aA=nA,lA={getTemplate(e){let{builtinId:t,name:s,xfId:i}=e;return{name:"cellStyle",properties:{rawMap:{builtinId:t,name:s,xfId:i}}}}},cA=lA,dA={getTemplate(e){return{name:"cellStyles",properties:{rawMap:{count:e.length}},children:e.map((t)=>cA.getTemplate(t))}}},uA=dA,hA={getTemplate(e){return{name:"cellXfs",properties:{rawMap:{count:e.length}},children:e.map((t)=>Vm.getTemplate(t))}}},gA=hA,pA={getTemplate(e){let{patternType:t,fgTheme:s,fgTint:i,fgRgb:o,bgRgb:r,bgIndexed:n}=e,a={name:"patternFill",properties:{rawMap:{patternType:t}}};if(s||i||o)a.children=[{name:"fgColor",properties:{rawMap:{theme:s,tint:i,rgb:o}}}];if(n||r){if(!a.children)a.children=[];a.children.push({name:"bgColor",properties:{rawMap:{indexed:n,rgb:r}}})}return{name:"fill",children:[a]}}},fA=pA,mA={getTemplate(e){return{name:"fills",properties:{rawMap:{count:e.length}},children:e.map((t)=>fA.getTemplate(t))}}},CA=mA,vA={getTemplate(e){let{size:t,colorTheme:s,color:i="FF000000",fontName:o="Calibri",family:r,scheme:n,italic:a,bold:l,strikeThrough:c,outline:d,shadow:u,underline:h,verticalAlign:g}=e,p=[{name:"sz",properties:{rawMap:{val:t}}},{name:"color",properties:{rawMap:{theme:s,rgb:i}}},{name:"name",properties:{rawMap:{val:o}}}];if(r)p.push({name:"family",properties:{rawMap:{val:r}}});if(n)p.push({name:"scheme",properties:{rawMap:{val:n}}});if(a)p.push({name:"i"});if(l)p.push({name:"b"});if(c)p.push({name:"strike"});if(d)p.push({name:"outline"});if(u)p.push({name:"shadow"});if(h)p.push({name:"u",properties:{rawMap:{val:h}}});if(g)p.push({name:"vertAlign",properties:{rawMap:{val:g}}});return{name:"font",children:p}}},wA=vA,bA={getTemplate(e){return{name:"fonts",properties:{rawMap:{count:e.length}},children:e.map((t)=>wA.getTemplate(t))}}},SA=bA;function yA(e){let t=e.split(/(\[[^\]]*\])/);for(let s=0;s<t.length;s++){let i=t[s];if(!i.length)continue;if(!i.startsWith("["))i=i.replace(/\$/g,'"$"');t[s]=he(i)}return t.join("")}var xA={getTemplate(e){let{formatCode:t,numFmtId:s}=e;if(t.length)t=yA(t);return{name:"numFmt",properties:{rawMap:{formatCode:t,numFmtId:s}}}}},RA=xA,FA={getTemplate(e){return{name:"numFmts",properties:{rawMap:{count:e.length}},children:e.map((t)=>RA.getTemplate(t))}}},EA=FA,aa,ao,dr,ur,hr,Nm,la,_m,Ed,Hm=(e,t)=>{if(e.includes("mixedStyle")&&t>1)e+=`_${t}`;return e},zm=()=>{aa={base:0},ao=[],dr=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],ur=[{patternType:"none"},{patternType:"gray125"}],hr=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],Nm=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],la=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],_m=[{builtinId:0,name:"Normal",xfId:0}]},PA=(e)=>{let t=jD(e.pattern),s=js(e.color),i=js(e.patternColor),o=ur.findIndex((r)=>{let{patternType:n,fgRgb:a,bgRgb:l}=r;return!(n!=t||a!=s||l!=i)});if(o===-1)o=ur.length,ur.push({patternType:t,fgRgb:s,bgRgb:i});return o},MA=(e)=>{if(jf[e])return jf[e];let t=ao.findIndex((s)=>s.formatCode===e);if(t===-1)t=ao.length+164,ao.push({formatCode:e,numFmtId:t});else t=ao[t].numFmtId;return t},TA=(e)=>{let{borderBottom:t,borderTop:s,borderLeft:i,borderRight:o}=e,r,n,a,l,c,d,u,h;if(i)a=Jn(i.lineStyle,i.weight),u=js(i.color);if(o)l=Jn(o.lineStyle,o.weight),h=js(o.color);if(t)r=Jn(t.lineStyle,t.weight),c=js(t.color);if(s)n=Jn(s.lineStyle,s.weight),d=js(s.color);let g=hr.findIndex((p)=>{let{left:f,right:m,top:C,bottom:v}=p;if(!f&&(a||u))return!1;if(!m&&(l||h))return!1;if(!C&&(n||d))return!1;if(!v&&(r||c))return!1;let{style:w,color:S}=f||{},{style:x,color:R}=m||{},{style:P,color:D}=C||{},{style:O,color:A}=v||{};if(w!=a||S!=u)return!1;if(x!=l||R!=h)return!1;if(P!=n||D!=d)return!1;if(O!=r||A!=c)return!1;return!0});if(g===-1)g=hr.length,hr.push({left:{style:a,color:u},right:{style:l,color:h},top:{style:n,color:d},bottom:{style:r,color:c},diagonal:{style:void 0,color:void 0}});return g},DA=(e)=>{let{fontName:t="Calibri",color:s,size:i,bold:o,italic:r,outline:n,shadow:a,strikeThrough:l,underline:c,family:d,verticalAlign:u}=e,h=js(s),g=JT(d),p=c?c.toLocaleLowerCase():void 0,f=u?u.toLocaleLowerCase():void 0,m=dr.findIndex((C)=>!(C.fontName!=t||C.color!=h||C.size!=i||C.bold!=o||C.italic!=r||C.outline!=n||C.shadow!=a||C.strikeThrough!=l||C.underline!=p||C.verticalAlign!=f||C.family!=g));if(m===-1)m=dr.length,dr.push({fontName:t,color:h,size:i,bold:o,italic:r,outline:n,shadow:a,strikeThrough:l,underline:p,verticalAlign:f,family:g!=null?g.toString():void 0});return m},AA=(e)=>{let{alignment:t,borders:s,font:i,interior:o,numberFormat:r,protection:n,quotePrefix:a}=e,{id:l}=e,c=0,d=0,u=0,h=0;if(!l)return;if(l=Hm(l,Ed),aa[l]!=null)return;if(o)c=PA(o);if(s)d=TA(s);if(i)u=DA(i);if(r)h=MA(r.format);aa[l]=la.length,la.push({alignment:t,borderId:d||0,fillId:c||0,fontId:u||0,numFmtId:h||0,protection:n,quotePrefix:a,xfId:0})},IA={getTemplate(e){let t=EA.getTemplate(ao),s=SA.getTemplate(dr.map((l)=>({...l,size:l.size!=null?l.size:e}))),i=CA.getTemplate(ur),o=JD.getTemplate(hr),r=aA.getTemplate(Nm),n=gA.getTemplate(la),a=uA.getTemplate(_m);return zm(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[t,s,i,o,r,n,a,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},kA=(e,t)=>aa[Hm(e,t)]||0,LA=(e,t)=>{if(Ed=t,Ed===1)zm();e.forEach(AA)},GA=IA,OA={getTemplate(e,t){let{name:s,columns:i,rowRange:o,displayName:r,showRowStripes:n,showColumnStripes:a,showFilterButtons:l,highlightFirstColumn:c,highlightLastColumn:d}=e||{},u=!o||o[0]-o[1]===0;if(!e||!s||!Array.isArray(i)||!i.length||u)return{name:"table"};let h=i.map((v,w)=>({name:"filterColumn",properties:{rawMap:{colId:w.toString(),hiddenButton:l[w]?0:1}}})),g=`A${o[0]}`,p=`${Fi(i.length)}${o[1]}`,f=`${g}:${p}`,m=`${t+1}`,C=t?`${r}_${m}`:r;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:C,displayName:C,ref:f,totalsRowShown:0,id:m}},children:[{name:"autoFilter",properties:{rawMap:{ref:f}},children:h},{name:"tableColumns",properties:{rawMap:{count:i.length}},children:i.map((v,w)=>({name:"tableColumn",properties:{rawMap:{id:(w+1).toString(),name:he(sD(v)),dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:c?1:0,showLastColumn:d?1:0,showRowStripes:n?1:0,showColumnStripes:a?1:0}}}]}}},BA=OA,St=(e)=>{let[t,s,i,o]=e;return{name:`a:${t}`,children:[{name:`a:${s}`,properties:{rawMap:{val:i,lastClr:o}}}]}},VA={getTemplate(){return{name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[St(["dk1","sysClr","windowText","000000"]),St(["lt1","sysClr","window","FFFFFF"]),St(["dk2","srgbClr","44546A"]),St(["lt2","srgbClr","E7E6E6"]),St(["accent1","srgbClr","4472C4"]),St(["accent2","srgbClr","ED7D31"]),St(["accent3","srgbClr","A5A5A5"]),St(["accent4","srgbClr","FFC000"]),St(["accent5","srgbClr","5B9BD5"]),St(["accent6","srgbClr","70AD47"]),St(["hlink","srgbClr","0563C1"]),St(["folHlink","srgbClr","954F72"])]}}},NA=VA,T=(e)=>{let[t,s,i,o]=e;return{name:`a:${t}`,properties:{rawMap:{script:i,typeface:s,panose:o}}}},_A={getTemplate(){return{name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[T(["latin","Calibri Light",void 0,"020F0302020204030204"]),T(["ea",""]),T(["cs",""]),T(["font","游ゴシック Light","Jpan"]),T(["font","맑은 고딕","Hang"]),T(["font","等线 Light","Hans"]),T(["font","新細明體","Hant"]),T(["font","Times New Roman","Arab"]),T(["font","Times New Roman","Hebr"]),T(["font","Tahoma","Thai"]),T(["font","Nyala","Ethi"]),T(["font","Vrinda","Beng"]),T(["font","Shruti","Gujr"]),T(["font","MoolBoran","Khmr"]),T(["font","Tunga","Knda"]),T(["font","Raavi","Guru"]),T(["font","Euphemia","Cans"]),T(["font","Plantagenet Cherokee","Cher"]),T(["font","Microsoft Yi Baiti","Yiii"]),T(["font","Microsoft Himalaya","Tibt"]),T(["font","MV Boli","Thaa"]),T(["font","Mangal","Deva"]),T(["font","Gautami","Telu"]),T(["font","Latha","Taml"]),T(["font","Estrangelo Edessa","Syrc"]),T(["font","Kalinga","Orya"]),T(["font","Kartika","Mlym"]),T(["font","DokChampa","Laoo"]),T(["font","Iskoola Pota","Sinh"]),T(["font","Mongolian Baiti","Mong"]),T(["font","Times New Roman","Viet"]),T(["font","Microsoft Uighur","Uigh"]),T(["font","Sylfaen","Geor"]),T(["font","Arial","Armn"]),T(["font","Leelawadee UI","Bugi"]),T(["font","Microsoft JhengHei","Bopo"]),T(["font","Javanese Text","Java"]),T(["font","Segoe UI","Lisu"]),T(["font","Myanmar Text","Mymr"]),T(["font","Ebrima","Nkoo"]),T(["font","Nirmala UI","Olck"]),T(["font","Ebrima","Osma"]),T(["font","Phagspa","Phag"]),T(["font","Estrangelo Edessa","Syrn"]),T(["font","Estrangelo Edessa","Syrj"]),T(["font","Estrangelo Edessa","Syre"]),T(["font","Nirmala UI","Sora"]),T(["font","Microsoft Tai Le","Tale"]),T(["font","Microsoft New Tai Lue","Talu"]),T(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[T(["latin","Calibri",void 0,"020F0502020204030204"]),T(["ea",""]),T(["cs",""]),T(["font","游ゴシック","Jpan"]),T(["font","맑은 고딕","Hang"]),T(["font","等线","Hans"]),T(["font","新細明體","Hant"]),T(["font","Arial","Arab"]),T(["font","Arial","Hebr"]),T(["font","Tahoma","Thai"]),T(["font","Nyala","Ethi"]),T(["font","Vrinda","Beng"]),T(["font","Shruti","Gujr"]),T(["font","DaunPenh","Khmr"]),T(["font","Tunga","Knda"]),T(["font","Raavi","Guru"]),T(["font","Euphemia","Cans"]),T(["font","Plantagenet Cherokee","Cher"]),T(["font","Microsoft Yi Baiti","Yiii"]),T(["font","Microsoft Himalaya","Tibt"]),T(["font","MV Boli","Thaa"]),T(["font","Mangal","Deva"]),T(["font","Gautami","Telu"]),T(["font","Latha","Taml"]),T(["font","Estrangelo Edessa","Syrc"]),T(["font","Kalinga","Orya"]),T(["font","Kartika","Mlym"]),T(["font","DokChampa","Laoo"]),T(["font","Iskoola Pota","Sinh"]),T(["font","Mongolian Baiti","Mong"]),T(["font","Arial","Viet"]),T(["font","Microsoft Uighur","Uigh"]),T(["font","Sylfaen","Geor"]),T(["font","Arial","Armn"]),T(["font","Leelawadee UI","Bugi"]),T(["font","Microsoft JhengHei","Bopo"]),T(["font","Javanese Text","Java"]),T(["font","Segoe UI","Lisu"]),T(["font","Myanmar Text","Mymr"]),T(["font","Ebrima","Nkoo"]),T(["font","Nirmala UI","Olck"]),T(["font","Ebrima","Osma"]),T(["font","Phagspa","Phag"]),T(["font","Estrangelo Edessa","Syrn"]),T(["font","Estrangelo Edessa","Syrj"]),T(["font","Estrangelo Edessa","Syre"]),T(["font","Nirmala UI","Sora"]),T(["font","Microsoft Tai Le","Tale"]),T(["font","Microsoft New Tai Lue","Talu"]),T(["font","Ebrima","Tfng"])]}]}}},HA=_A,Jt=(e,t,s)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:s}),gd=(e)=>{let[t,s,i,o,r,n]=e,a=[];if(a.push(Jt("satMod",i)),o)a.push(Jt("lumMod",o));if(r)a.push(Jt("tint",r));if(n)a.push(Jt("shade",n));return{name:"a:gs",properties:{rawMap:{pos:t}},children:[{name:"a:schemeClr",properties:{rawMap:{val:s}},children:a}]}},ca=(e,t)=>({name:"a:solidFill",children:[Jt("schemeClr",e,t)]}),Pd=(e)=>{let[t,s,i,o,r]=e,[n,a]=r;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:t}},children:[{name:"a:gsLst",children:[gd(s),gd(i),gd(o)]},{name:"a:lin",properties:{rawMap:{ang:n,scaled:a}}}]}},pd=(e)=>{let[t,s,i,o]=e;return{name:"a:ln",properties:{rawMap:{w:t,cap:s,cmpd:i,algn:o}},children:[ca("phClr"),Jt("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},fd=(e)=>{let t=[];if(e){let[s,i,o,r,n]=e;t.push({name:"a:outerShdw",properties:{rawMap:{blurRad:s,dist:i,dir:o,algn:r,rotWithShape:n}},children:[Jt("srgbClr","000000",[Jt("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},t.length?{children:t}:{})]}},zA=()=>({name:"a:fillStyleLst",children:[ca("phClr"),Pd(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),Pd(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]}),WA=()=>({name:"a:lnStyleLst",children:[pd(["6350","flat","sng","ctr"]),pd(["12700","flat","sng","ctr"]),pd(["19050","flat","sng","ctr"])]}),UA=()=>({name:"a:effectStyleLst",children:[fd(),fd(),fd(["57150","19050","5400000","ctr","0"])]}),KA=()=>({name:"a:bgFillStyleLst",children:[ca("phClr"),ca("phClr",[Jt("tint","95000"),Jt("satMod","170000")]),Pd(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}),$A={getTemplate(){return{name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[zA(),WA(),UA(),KA()]}}},jA=$A,qA={getTemplate(){return{name:"a:themeElements",children:[NA.getTemplate(),HA.getTemplate(),jA.getTemplate()]}}},YA=qA,XA={getTemplate(){return{name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[YA.getTemplate(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]}}},ZA=XA,QA=()=>({name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]}),JA=()=>({name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}}),eI=(e)=>({name:"v:formulas",children:e.map((t)=>({name:"v:f",properties:{rawMap:{eqn:t}}}))}),tI=()=>({name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}}),Wm=(e)=>{let{aspectratio:t,rotation:s}=e||{},i={};if(t)i.aspectratio="t";if(s)i.rotation="t";return{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:i}}};function sI(e,t,s,i,o){return(e-t)/(s-t)*(o-i)+i}var iI=(e,t)=>{let s,{recolor:i,brightness:o,contrast:r,id:n}=e;if(i){if(s={},i==="Washout"||i==="Grayscale")s.gain="19661f",s.blacklevel="22938f";if(i==="Black & White"||i==="Grayscale"){if(s.grayscale="t",i==="Black & White")s.bilevel="t"}}if(!i||i==="Grayscale"){if(!s)s={};if(r!=null&&r!==50){let a="1";if(r>=0){if(r<50)a=String(r/50);else if(r<100)a=String(50/(100-r));else if(r===100)a="2147483647f"}s.gain=a}if(o!=null&&o!==50)s.blacklevel=sI(o,0,100,-0.5,0.5).toString()}return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${t}`,title:n}}],rawMap:s}}},oI=()=>{let e=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"];return{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[JA(),eI(e),tI(),Wm({aspectratio:!0})]}},Zf=(e)=>Math.floor((e??0)*0.74999943307122),rI=(e,t)=>{let{width:s=0,height:i=0,altText:o}=e,r=Zf(s),n=Zf(i);return{name:"v:shape",properties:{rawMap:{id:e.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${r}pt; height: ${n}pt; z-index: ${t+1}`,type:"#_x0000_t75",alt:o}},children:[iI(e,t+1),Wm({rotation:!0})]}},nI={getTemplate(e){let t=yt.get(e.sheetIndex)||[],s=[QA(),oI(),...t.map((i,o)=>rI(i,o))];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:s}}},aI=nI,lI={getTemplate(e,t){let s=(t+1).toString();return{name:"sheet",properties:{rawMap:{name:e,sheetId:s,"r:id":`rId${s}`}}}}},cI=lI,dI={getTemplate(e){return{name:"sheets",children:e.map((t,s)=>cI.getTemplate(t,s))}}},uI=dI,hI={getTemplate(e,t){return{name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"bookViews",children:[{name:"workbookView",properties:{rawMap:{activeTab:t}}}]},uI.getTemplate(e)]}}},gI=hI,pI=(e)=>Math.ceil((e-12)/7+1),fI={getTemplate(e){let{min:t,max:s,outlineLevel:i,s:o,width:r,hidden:n,bestFit:a}=e,l=1,c="0";if(r>1)l=pI(r),c="1";return{name:"col",properties:{rawMap:{min:t,max:s,outlineLevel:i!=null?i:void 0,width:l,style:o,hidden:n?"1":"0",bestFit:a?"1":"0",customWidth:c}}}}},mI=fI,CI={getTemplate(e){return{name:"mergeCell",properties:{rawMap:{ref:e}}}}},vI=CI,wI=(e)=>{let t=e.charAt(0).toLowerCase();return t==="s"?"inlineStr":t},bI={getTemplate(e,t,s){let{ref:i,data:o,styleId:r}=e,{type:n,value:a}=o||{type:"empty",value:null},l=n;if(n==="f")l="str";else if(n.charAt(0)===n.charAt(0).toUpperCase())l=wI(n);let c={name:"c",properties:{rawMap:{r:i,t:l==="empty"?void 0:l,s:r?kA(r,s):void 0}}};if(l==="empty")return c;let d;if(l==="str"&&n==="f")d=[{name:"f",textNode:he(mr(a))}];else if(l==="inlineStr")d=[{name:"is",children:[{name:"t",textNode:he(mr(a))}]}];else d=[{name:"v",textNode:a}];return Object.assign({},c,{children:d})}},SI=bI,yI=(e,t)=>{let s=[],i=0;for(let o=0;o<e.length;o++){let r=e[o];if(r.mergeAcross)s.push({pos:o,excelPos:i}),i+=r.mergeAcross;i++}if(s.length)for(let o=s.length-1;o>=0;o--){let r=[],n=e[s[o].pos];for(let a=1;a<=n.mergeAcross;a++)r.push({ref:`${Fi(s[o].excelPos+1+a)}${t+1}`,styleId:n.styleId,data:{type:"empty",value:null}});if(r.length)e.splice(s[o].pos+1,0,...r)}},xI=(e)=>{if(e.mergeAcross!=null||e.styleId!==void 0||e.note!==void 0)return!0;return!!e.data&&e.data.type!=="empty"&&e.data.value!==""},RI={getTemplate(e,t,s){let{collapsed:i,hidden:o,height:r,outlineLevel:n,cells:a=[]}=e;yI(a,t);let l=a.filter(xI).map((c,d)=>SI.getTemplate(c,d,s));return{name:"row",properties:{rawMap:{r:t+1,collapsed:i?"1":"0",hidden:o?"1":"0",ht:r,customHeight:r!=null?"1":"0",spans:"1:1",outlineLevel:n||void 0}},children:l}}},FI=RI,EI=(e,t,s)=>{let i=[],o=[];e.forEach((a,l)=>{let c=a.cells,d=0,u;c.forEach((h,g)=>{let p=g+d+1,f=Fi(p),m=l+1;if(h.mergeAcross){d+=h.mergeAcross;let v=Fi(g+d+1);i.push(`${f}${m}:${v}${m}`)}if(!t[p-1])t[p-1]={};let{collapsibleRanges:C}=h;if(C)C.forEach((v)=>{o.push([p+v[0],p+v[1]])});u=t[p-1],u.min=p,u.max=p,h.ref=`${f}${m}`})}),o.sort((a,l)=>{if(a[0]!==l[0])return a[0]-l[0];return l[1]-a[1]});let r=new Map,n=new Map;return o.filter((a)=>{let l=a.toString();if(r.get(l))return!1;return r.set(l,!0),!0}).forEach((a)=>{let l=t.find((d)=>d.min==a[0]&&d.max==a[1]),c=n.get(a[0]);t.push({min:a[0],max:a[1],outlineLevel:s?void 0:c||1,width:(l||{width:100}).width}),n.set(a[0],(c||0)+1)}),i},PI=(e)=>{if(!e||e!=="Portrait"&&e!=="Landscape")return"portrait";return e.toLocaleLowerCase()},MI=(e)=>{if(e==null)return 1;let s=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(e);return s===-1?1:s+1},TI=(e)=>{let t={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(let s of Object.keys(t))e=e.replace(s,t[s]);return e},DI=(e)=>{if(e==="Center")return"C";if(e==="Right")return"R";return"L"},AI=(e,t)=>{if(!t)return e;if(e+="&amp;&quot;",e+=t.fontName||"Calibri",t.bold!==t.italic)e+=t.bold?",Bold":",Italic";else if(t.bold)e+=",Bold Italic";else e+=",Regular";if(e+="&quot;",t.size)e+=`&amp;${t.size}`;if(t.strikeThrough)e+="&amp;S";if(t.underline)e+=`&amp;${t.underline==="Double"?"E":"U"}`;if(t.color)e+=`&amp;K${t.color.replace("#","").toUpperCase()}`;return e},II=(e,t,s)=>e.reduce((i,o,r)=>{let n=DI(o.position),a=AI(`${i}&amp;${n}`,o.font),l=["Left","Center","Right"];if(!o.position)o.position=l[r];let{image:c}=o;if(o.value==="&[Picture]"&&c){let d=`${n}${t}${s}`;Um(c,d)}return`${a}${he(TI(o.value))}`},""),kI=(e)=>{let t=["all","first","even"],s=[];return t.forEach((i)=>{let o=e[i],r=i==="all"?"odd":i;if(!o)return;for(let n of Object.keys(o)){let a=o[n],l=`${n.charAt(0).toUpperCase()}${n.slice(1)}`,c=n[0].toUpperCase();if(a){let d=i==="all"?"":i.toUpperCase();s.push({name:`${r}${l}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:II(a,c,d)})}}}),s},LI=(e)=>(t)=>{if(e.length)t.children.push({name:"cols",children:e.map((s)=>mI.getTemplate(s))});return t},GI=(e,t)=>{let s=[];for(let i=0;i<t.length;i++){let o=t[i].cells;for(let r=0;r<o.length;r++){let n=o[r];if(!n.note||!n.ref)continue;s.push({ref:n.ref,text:n.note.text,author:n.note.author})}}if(s.length)Gt.set(e,s);else Gt.delete(e)},OI=(e,t)=>(s)=>{if(e.length)s.children.push({name:"sheetData",children:e.map((i,o)=>FI.getTemplate(i,o,t))});return s},BI=(e)=>{let t=e.length;if(!t)return"";let s=Array(t+1);s[0]=t;for(let o=1;o<=t;o++)s[o]=e.charCodeAt(o-1)&255;let i=0;for(let o=s.length-1;o>=0;o--){let r=s[o],n=(i&16384)===0?0:1,a=i<<1&32767;i=(n|a)^r}return(i^52811).toString(16).toUpperCase().padStart(4,"0")},VI=(e)=>(t)=>{if(!e)return t;let s=typeof e==="boolean"?{}:e,i={sheet:1},o=s.password?BI(s.password):"";if(o)i.password=o;let r={autoFilter:!1,deleteColumns:!1,deleteRows:!1,formatCells:!1,formatColumns:!1,formatRows:!1,insertColumns:!1,insertHyperlinks:!1,insertRows:!1,pivotTables:!1,selectLockedCells:!0,selectUnlockedCells:!0};return Object.keys(r).forEach((n)=>{let a=s[n];if(a==null||a===r[n])return;i[n]=a?0:1}),t.children.push({name:"sheetProtection",properties:{rawMap:i}}),t},NI=(e)=>(t)=>{if(e.length)t.children.push({name:"mergeCells",properties:{rawMap:{count:e.length}},children:e.map((s)=>vI.getTemplate(s))});return t},_I=(e)=>(t)=>{let{top:s=0.75,right:i=0.7,bottom:o=0.75,left:r=0.7,header:n=0.3,footer:a=0.3}=e;return t.children.push({name:"pageMargins",properties:{rawMap:{bottom:o,footer:a,header:n,left:r,right:i,top:s}}}),t},HI=(e)=>(t)=>{if(e)t.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:PI(e.orientation),paperSize:MI(e.pageSize)}}});return t},zI=(e)=>(t)=>{if(!e)return t;let s=e.first!=null?1:0,i=e.even!=null?1:0;return t.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:s,differentOddEven:i}},children:kI(e)}),t},WI=(e)=>(t)=>{if(e)t.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}}]});return t},UI=(e)=>(t)=>{if(qs.get(e)?.length)t.children.push({name:"drawing",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}});return t},KI=(e)=>(t)=>{if(Gt.get(e)?.length)t.children.push({name:"legacyDrawing",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}});return t},$I=(e)=>(t)=>{if(yt.get(e))t.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":`rId${++t.rIdCounter}`}}});return t},jI=(e=0,t=0)=>{let s=e>0||t>0;return s?[{name:"pane",properties:{rawMap:{state:s?"frozen":void 0,topLeftCell:s?`${Fi(e+1)}${t+1}`:void 0,xSplit:e===0?void 0:e,ySplit:t===0?void 0:t}}}]:void 0},qI=(e=!1,t,s)=>(i)=>(i.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:e===!0?"1":"0",workbookViewId:"0"}},children:jI(t,s)}]}),i),YI=()=>(e)=>(e.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),e),XI=(e)=>(t)=>{let s=e.reduce((i,o)=>{if(o.outlineLevel&&o.outlineLevel>i)return o.outlineLevel;return i},0);return t.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:s?s:void 0}}}),t},ZI={getTemplate(e){let{worksheet:t,currentSheet:s,config:i}=e,{margins:o={},pageSetup:r,headerFooterConfig:n,suppressColumnOutline:a,rightToLeft:l,frozenRowCount:c,frozenColumnCount:d,protectSheet:u}=i,{table:h}=t,{rows:g,columns:p}=h,f=p?.length?EI(g,p,!!a):[];GI(s,g);let m=xt.get(s),{children:C}=[YI(),qI(l,d,c),XI(g),LI(p),OI(g,s+1),VI(u),NI(f),_I(o),HI(r),zI(n),UI(s),KI(s),$I(s),WI(m)].reduce((v,w)=>w(v),{children:[],rIdCounter:0});return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:C}}},QI=ZI,bi=new Map,st=[],xi=[],Ri=new Map,Lt=new Map,qs=new Map,yt=new Map,uo=new Map,ho=new Map,xt=new Map,Gt=new Map,JI="AG-GRID-TABLE",Ld="SINGLE_SHEET";function e2(){return Ld}function t2(e){Ld=e}function s2(e,t,s){a2(t),LA(e,st.length);let i=Object.assign({},s);if(s.exportAsExcelTable&&s.pivotModeActive)F(163,{featureName:"pivot mode"}),i.exportAsExcelTable=!1;r2(t,i);let o=P2(t,i);return M2(o),o}function i2(e){return e.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}function o2(e,t){if(xt.has(e)){F(164);return}xt.set(e,t)}function r2(e,t){let{exportAsExcelTable:s,prependContent:i,appendContent:o,headerRowCount:r=0}=t;if(!s)return;let n=typeof s==="boolean"?{}:s,{name:a,showColumnStripes:l,showRowStripes:c,showFilterButton:d,highlightFirstColumn:u,highlightLastColumn:h}=n,g=i2(a||JI),p=st.length-1,{table:f}=e,{rows:m,columns:C}=f,v=i?i.length:0,w=o?o.length:0,S=m.length,x=C.length,R=[],P=[];for(let D=0;D<x;D++){let O=C[D];R.push(O.displayName||""),P.push(d==="match"||d===void 0?O.filterAllowed??!1:d)}if(!R?.length||!S||!g){F(165);return}o2(p,{name:`table${xt.size+1}`,displayName:g,columns:R,showFilterButtons:P,rowRange:[r+v,r+(S-r)-w],showRowStripes:c??!0,showColumnStripes:l??!1,highlightFirstColumn:u??!1,highlightLastColumn:h??!1})}function Um(e,t){let s=st.length-1,i=e;i.headerFooterPosition=t,Km({imageToAdd:i,idx:s});let o=yt.get(s);if(!o)o=[],yt.set(s,o);if(!o.find((r)=>r.id===e.id))o.push(e)}function n2(e,t,s,i,o){let r=st.length,{row:n,column:a}=e.position||{},l=e;if(i){if(t!=null&&s!=null&&(!n||!a)){if(!e.position)e.position={};e.position=Object.assign({},e.position,{row:t,column:i.indexOf(s)+1})}eD(l,i),tD(l,o)}Km({imageToAdd:l,idx:r});let c=ho.get(r);if(!c)c=new Map,ho.set(r,c);let d=qs.get(r);if(!d)qs.set(r,[l]);else d.push(l);if(!c.get(e.id))c.set(e.id,{index:c.size,type:e.imageType})}function Km(e){let{imageToAdd:t,idx:s}=e,i=Lt.get(t.id);if(i){let o=i.find((r)=>r.sheetId===s);if(o)o.image.push(t);else i.push({sheetId:s,image:[t]})}else Lt.set(t.id,[{sheetId:s,image:[t]}]),uo.set(t.id,{type:t.imageType,index:uo.size})}function a2(e){let t=he(e.name)||"",s="";while(st.indexOf(`${t}${s}`)!==-1)if(s==="")s="_1";else s=`_${parseInt(s.slice(1),10)+1}`;e.name=`${t}${s}`,st.push(e.name)}function l2(e){if(bi.has(e))return bi.get(e);return bi.set(e,bi.size),bi.size-1}function c2(){bi.clear(),Lt.clear(),qs.clear(),yt.clear(),uo.clear(),ho.clear(),xt.clear(),Gt.clear(),st=[],xi=[],Ri=new Map,Ld="SINGLE_SHEET"}function d2(e){return Ge(gI.getTemplate(st,e))}function u2(e){return Ge(GA.getTemplate(e))}function h2(){return Ge(_D.getTemplate(bi))}function g2(e){return Ge(fD.getTemplate(e))}function p2(e){return Ge(wD.getTemplate(e))}function f2(e,t){return Ge(gD.getTemplate({sheetLen:e,hasCustomProperties:t}))}function m2(e){let t=[{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}];if(e)t.push({Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"});let s=wr.getTemplate(t);return Ge(s)}function C2(){return Ge(ZA.getTemplate())}function v2(e,t){return Ge(BA.getTemplate(e,t))}function w2(e){let t=Array(e).fill(void 0).map((i,o)=>({Id:`rId${o+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${o+1}.xml`})),s=wr.getTemplate([...t,{Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${e+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${e+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]);return Ge(s)}function b2(e){return Ge(MD.getTemplate({sheetIndex:e}))}function S2(e,t,s){let i=Gt.get(e)||[],o=t||"AG Grid",r=!s;return Ge(cD.getTemplate({comments:i,defaultAuthor:o,prependAuthor:r}))}function y2(e){let t=ho.get(e)||[],s=[];for(let[i,o]of t){let{index:r,type:n}=o;s.push({Id:`rId${r+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${uo.get(i).index+1}.${pa(n)}`})}return Ge(wr.getTemplate(s))}function x2(e){return Ge(aI.getTemplate({sheetIndex:e}),!0)}function R2(e){return Ge(GD.getTemplate({sheetIndex:e}),!0)}function F2(e){let t=yt.get(e)||[],s=[];for(let i=0;i<t.length;i++){let o=t[i],r=uo.get(o.id);if(!r)continue;let{index:n,type:a}=r;s.push({Id:`rId${i+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${n+1}.${pa(a)}`})}return Ge(wr.getTemplate(s))}function E2({drawingIndex:e,noteVmlDrawingIndex:t,headerFooterVmlDrawingIndex:s,commentsIndex:i,tableName:o}={}){if(e===void 0&&t===void 0&&s===void 0&&i===void 0&&o===void 0)return"";let r=[];if(e!=null)r.push({Id:`rId${r.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`});if(t!=null)r.push({Id:`rId${r.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${t+1}.vml`});if(s!=null)r.push({Id:`rId${r.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${s+1}.vml`});if(o!=null)r.push({Id:`rId${r.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:`../tables/${o}.xml`});if(i!=null)r.push({Id:`rId${r.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Target:`../comments${i+1}.xml`});let n=wr.getTemplate(r);return Ge(n)}function P2(e,t){return Ge(QI.getTemplate({worksheet:e,currentSheet:st.length-1,config:t}))}var ar=(e,t)=>{if(!e.size)return;let s=new Map;t.forEach((i,o)=>{if(e.has(i))s.set(o,e.get(i))}),e.clear(),s.forEach((i,o)=>e.set(o,i))},M2=(e)=>{let t=Ri.get(e)??[];t.push(st.length-1),Ri.set(e,t),xi.push(e)},T2=(e)=>{let t=new Map(Ri),s=[];for(let i of e){let o=t.get(i);if(!o?.length)return null;let r=o.shift();s.push(r),t.set(i,o)}return s},D2=(e)=>{if(!e.length||xi.length===0)return null;let t=new Set,s=[];for(let i of e){let o=xi.findIndex((r,n)=>!t.has(n)&&r===i);if(o===-1)return null;t.add(o),s.push(o)}return s},A2=(e)=>{let t=new Map;e.forEach((s,i)=>t.set(s,i)),st=e.map((s)=>st[s]),xi=e.map((s)=>xi[s]),ar(qs,e),ar(yt,e),ar(xt,e),ar(Gt,e),ar(ho,e),Lt.forEach((s)=>{s.forEach((i)=>{let o=t.get(i.sheetId);if(o!=null)i.sheetId=o})}),Ri=new Map,xi.forEach((s,i)=>{let o=Ri.get(s)??[];o.push(i),Ri.set(s,o)})},I2=(e)=>{if(e.length<=1)return;let t=T2(e)??D2(e);if(!t)return;A2(t)},Gd=class{getStringPosition(e){return l2(e)}addBodyImageToMap(e,t,s,i,o){n2(e,t,s,i,o)}addHeaderFooterImageToMap(e,t){Um(e,t)}addWorksheet(e,t,s){return s2(e,t,s)}syncOrderWithSheetData(e){I2(e)}reset(){c2()}setFactoryMode(e){t2(e)}getFactoryMode(){return e2()}getSheetNames(){return[...st]}},k2=async(e)=>{let t=0,s=[],i=new WritableStream({write:(n)=>{s.push(n),t+=n.length}}),o=new ReadableStream({start:(n)=>{let a=new FileReader;a.onload=(l)=>{if(l.target?.result)n.enqueue(l.target.result);n.close()},a.readAsArrayBuffer(e)}}),r=new window.CompressionStream("deflate-raw");return await o.pipeThrough(r).pipeTo(i),{size:t,content:new Blob(s)}},L2=async(e)=>{let t=new Blob([e]),{size:s,content:i}=await k2(t),o=new Uint8Array(await i.arrayBuffer());return{size:s,content:o}},G2=(e)=>{let t=e.getHours();return t<<=6,t=t|e.getMinutes(),t<<=5,t=t|e.getSeconds()/2,t},O2=(e)=>{let t=e.getFullYear()-1980;return t<<=4,t=t|e.getMonth()+1,t<<=5,t=t|e.getDate(),t};function Ne(e,t){let s="";for(let i=0;i<t;i++)s+=String.fromCharCode(e&255),e>>>=8;return s}var Qf=(e)=>{if(!e.length)return 0;let t=-1;for(let s=0;s<e.length;s++){let i=e[s],o=(t^i)&255,r=B2[o];t=t>>>8^r}return t^-1},Jf=(e)=>{if(!e.length)return 0;if(typeof e==="string")return Qf(new TextEncoder().encode(e));return Qf(e)},B2=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function V2(e){let t=String.fromCharCode;function s(u){let h=[];if(!u)return[];let g=u.length,p=0,f,m;while(p<g)if(f=u.charCodeAt(p++),f>=55296&&f<=56319&&p<g)if(m=u.charCodeAt(p++),(m&64512)==56320)h.push(((f&1023)<<10)+(m&1023)+65536);else h.push(f),p--;else h.push(f);return h}function i(u){if(u>=55296&&u<=57343)throw Error(ct(255,{point:u}))}function o(u,h){return t(u>>h&63|128)}function r(u){if((u&4294967168)==0)return t(u);let h="";if((u&4294965248)==0)h=t(u>>6&31|192);else if((u&4294901760)==0)i(u),h=t(u>>12&15|224),h+=o(u,6);else if((u&4292870144)==0)h=t(u>>18&7|240),h+=o(u,12),h+=o(u,6);return h+=t(u&63|128),h}let n=s(e),a=n.length,l=-1,c,d="";while(++l<a)c=n[l],d+=r(c);return d}var $m=(e,t,s,i,o,r)=>{let{content:n,path:a,created:l}=e,c=G2(l),d=O2(l),u=Jf(o),h=r!==void 0?r:i,g=V2(a),p=g!==a,f="";if(p){let w=Ne(1,1)+Ne(Jf(g),4)+g;f="up"+Ne(w.length,2)+w}let m="\x14\x00"+(p?"\x00\b":"\x00\x00")+Ne(t?8:0,2)+Ne(c,2)+Ne(d,2)+Ne(h?u:0,4)+Ne(r??i,4)+Ne(i,4)+Ne(g.length,2)+Ne(f.length,2),C="PK\x03\x04"+m+g+f,v="PK\x01\x02\x14\x00"+m+"\x00\x00\x00\x00\x00\x00"+(n?"\x00\x00\x00\x00":"\x10\x00\x00\x00")+Ne(s,4)+g+f;return{localFileHeader:Uint8Array.from(C,(w)=>w.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,(w)=>w.charCodeAt(0))}},jm=(e)=>{let t;if(typeof e==="string"){let s=atob(e.split(";base64,")[1]);t=Uint8Array.from(s,(i)=>i.charCodeAt(0))}else t=e;return{size:t.length,content:t}},N2=async(e)=>{let{content:t}=e,{size:s,content:i}=!t?{size:0,content:Uint8Array.from([])}:jm(t),o,r,n=!1;if(e.type==="file"&&i&&s>0){let l=await L2(i);o=l.content,r=l.size,n=!0}return{rawContent:i,rawSize:s,deflatedContent:o,deflatedSize:r,isCompressed:n}},_2=(e,t)=>{let{content:s}=e,{content:i}=!s?{content:Uint8Array.from([])}:jm(s);return{...$m(e,!1,t,i.length,i,void 0),content:i,isCompressed:!1}},H2=(e,t,s)=>{let i="PK\x05\x06\x00\x00\x00\x00"+Ne(e,2)+Ne(e,2)+Ne(t,4)+Ne(s,4)+"\x00\x00";return Uint8Array.from(i,(o)=>o.charCodeAt(0))},qm=class{constructor(){this.folders=[],this.files=[]}addFolders(e){e.forEach(this.addFolder.bind(this))}addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}addFile(e,t,s=!1){this.files.push({path:e,created:new Date,content:s?t:new TextEncoder().encode(t),isBase64:s,type:"file"})}async getZipFile(e="application/zip"){let t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}getUncompressedZipFile(e="application/zip"){let t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}clearStream(){this.folders=[],this.files=[]}packageFiles(e){let t=0,s=0;for(let c of e){let{localFileHeader:d,centralDirectoryHeader:u,content:h}=c;t+=d.length+h.length,s+=u.length}let i=new Uint8Array(t),o=new Uint8Array(s),r=0,n=0;for(let c of e){let{localFileHeader:d,centralDirectoryHeader:u,content:h}=c;i.set(d,r),r+=d.length,i.set(h,r),r+=h.length,o.set(u,n),n+=u.length}let a=H2(e.length,s,t),l=new Uint8Array(i.length+o.length+a.length);return l.set(i),l.set(o,i.length),l.set(a,i.length+o.length),l}async buildCompressedFileStream(){let e=[...this.folders,...this.files],t=await Promise.all(e.map(N2)),s=[],i=0;for(let o=0;o<e.length;o++){let r=e[o],{rawContent:n,rawSize:a,deflatedContent:l,deflatedSize:c,isCompressed:d}=t[o],u=$m(r,d,i,a,n,c),h=l??n;s.push({...u,content:h,isCompressed:d}),i+=u.localFileHeader.length+h.length}return this.packageFiles(s)}buildFileStream(){let e=[...this.folders,...this.files],t=[],s=0;for(let i of e){let o=_2(i,s),{localFileHeader:r,content:n}=o;t.push(o),s+=r.length+n.length}return this.packageFiles(t)}},z2=(e)=>{if(e.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),Lt.size||xt.size||yt.size||Gt.size)e.addFolders(["xl/worksheets/_rels"]);if(Lt.size||yt.size||Gt.size)e.addFolders(["xl/drawings/"]);if(Lt.size||yt.size)e.addFolders(["xl/drawings/_rels"]);if(xt.size)e.addFolders(["xl/tables/"]);if(!Lt.size)return;e.addFolders(["xl/media/"]);let t=0;Lt.forEach((s)=>{let i=s[0].image[0],{base64:o,imageType:r}=i;e.addFile(`xl/media/image${++t}.${pa(r)}`,o,!0)})},W2=(e,t,s,i)=>{let o=0,r=0,n=0;for(let a=0;a<t.length;a++){let l=t[a];e.addFile(`xl/worksheets/sheet${a+1}.xml`,l,!1);let c=Lt.size>0&&qs.has(a),d=xt.size>0&&xt.get(a),u=Lt.size&&yt.has(a),h=!!Gt.get(a)?.length;if(!c&&!d&&!u&&!h)continue;let g,p,f,m,C;if(c)U2(e,a,o),p=o,o++;if(h)K2(e,a,r,n,s,i),C=r,f=n,r++,n++;if(u)$2(e,a,n),m=n,n++;if(d)g=d.name;let v=`xl/worksheets/_rels/sheet${a+1}.xml.rels`;e.addFile(v,E2({tableName:g,drawingIndex:p,noteVmlDrawingIndex:f,headerFooterVmlDrawingIndex:m,commentsIndex:C}))}},U2=(e,t,s)=>{let o=`xl/drawings/drawing${s+1}.xml`,r=`xl/drawings/_rels/drawing${s+1}.xml.rels`;e.addFile(r,y2(t)),e.addFile(o,b2(t))},K2=(e,t,s,i,o,r)=>{e.addFile(`xl/comments${s+1}.xml`,S2(t,o,r)),e.addFile(`xl/drawings/vmlDrawing${i+1}.vml`,R2(t))},$2=(e,t,s)=>{let o=`xl/drawings/vmlDrawing${s+1}.vml`,r=`xl/drawings/_rels/vmlDrawing${s+1}.vml.rels`;e.addFile(o,x2(t)),e.addFile(r,F2(t))},j2=(e)=>{let t=xt,s=Array.from(t.keys());for(let i=0;i<s.length;i++){let o=s[i],r=t.get(o);if(!r)continue;e.addFile(`xl/tables/${r.name}.xml`,v2(r,i))}},q2=(e,t,s,i,o,r)=>{let n=!!r&&Object.keys(r).some((a)=>r[a]!=null);if(e.addFile("xl/workbook.xml",d2(o)),e.addFile("xl/styles.xml",u2(t)),e.addFile("xl/sharedStrings.xml",h2()),e.addFile("xl/theme/theme1.xml",C2()),e.addFile("xl/_rels/workbook.xml.rels",w2(i)),e.addFile("docProps/core.xml",g2(s)),n)e.addFile("docProps/custom.xml",p2(r));e.addFile("[Content_Types].xml",f2(i,n)),e.addFile("_rels/.rels",m2(n))},Ym=(e,t,s={},i)=>{if(!t||t.length===0)return F(159),i.reset(),!1;i.syncOrderWithSheetData(t);let{fontSize:o=11,author:r="AG Grid",activeTab:n=0,customMetadata:a,suppressPrependAuthorToNotes:l}=s,c=t.length,d=Math.max(Math.min(n,c-1),0);return z2(e),j2(e),W2(e,t,r,l),q2(e,o,r,c,d,a),i.reset(),!0},em=(e,t=new Gd)=>{let{data:s,fontSize:i,author:o,activeSheetIndex:r,customMetadata:n,suppressPrependAuthorToNotes:a}=e,l=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",c=new qm;if(!Ym(c,s,{author:o,fontSize:i,activeTab:r,customMetadata:n,suppressPrependAuthorToNotes:a},t))return Promise.resolve(void 0);return c.getZipFile(l)},tm=(e,t=new Gd)=>{let{data:s,fontSize:i,author:o,activeSheetIndex:r,customMetadata:n,suppressPrependAuthorToNotes:a}=e,l=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",c=new qm;if(!Ym(c,s,{author:o,fontSize:i,activeTab:r,customMetadata:n,suppressPrependAuthorToNotes:a},t))return;return c.getUncompressedZipFile(l)};var Y2=class extends zc{constructor(){super(...arguments);this.beanName="excelCreator",this.workbook=new Gd}getMergedParams(e){let t=this.gos.get("defaultExcelExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){F(160);return}let t=()=>{let i=this.getMergedParams(e),o=this.getData(i),{fontSize:r,author:n,mimeType:a,customMetadata:l,suppressPrependAuthorToNotes:c}=i,d={data:[o],fontSize:r,author:n,mimeType:a,customMetadata:l,suppressPrependAuthorToNotes:c};this.packageCompressedFile(d).then((u)=>{if(u){let{fileName:h}=i,g=typeof h==="function"?h(I(this.gos,{})):h;Kn(this.getFileName(g),u)}})},{overlays:s}=this.beans;if(s)s.showExportOverlay(t);else t()}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){let t=this.getMergedParams(e),s=this.getData(t),{fontSize:i,author:o,mimeType:r,customMetadata:n,suppressPrependAuthorToNotes:a}=t,l={data:[s],fontSize:i,author:o,mimeType:r,customMetadata:n,suppressPrependAuthorToNotes:a};return this.packageFile(l)}setFactoryMode(e){this.workbook.setFactoryMode(e)}getFactoryMode(){return this.workbook.getFactoryMode()}getSheetDataForExcel(e){let t=this.getMergedParams(e);return this.getData(t)}getMultipleSheetsAsExcel(e){return tm(e,this.workbook)}exportMultipleSheetsAsExcel(e){em(e,this.workbook).then((t)=>{let{fileName:s="export.xlsx"}=e;if(t){let i=typeof s==="function"?s():s;Kn(i,t)}})}getDefaultFileExtension(){return"xlsx"}createSerializingSession(e){let{colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:o,formula:r,gos:n,notesSvc:a}=this.beans,l=n.get("excelStyles")||[],c=this.createStyleLinker(l),d={...e,colModel:t,colNames:s,rowGroupColsSvc:i,valueSvc:o,formulaSvc:r,gos:n,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:l,rightToLeft:e.rightToLeft??n.get("enableRtl"),styleLinker:c,headerRowCount:_g(t),notesSvc:a,pivotModeActive:t.isPivotActive(),workbook:this.workbook};return new oD(d)}createStyleLinker(e){let t=[],s=new Set,i=new Map;e.forEach((n,a)=>{t.push(n.id),s.add(n.id),i.set(n.id,a)});let{gos:o,cellStyles:r}=this.beans;return(n)=>{let{rowType:a,rowIndex:l,value:c,column:d,columnGroup:u,node:h}=n,g=a==="HEADER",p=a==="HEADER_GROUPING",f=g?d:u,m=[];if(g||p){if(m.push("header"),p)m.push("headerGroup");if(f)m=m.concat(Gn(f.getDefinition(),o,d||null,u||null));return m}let C=["cell"];if(!t.length)return C;let v=d.getDefinition();return r?.processAllCellClasses(v,I(o,{value:c,data:h.data,node:h,colDef:v,column:d,rowIndex:l}),(w)=>{if(s.has(w))C.push(w)}),C.sort((w,S)=>{let x=i.get(w)??-1,R=i.get(S)??-1;return x===R?0:x<R?-1:1})}}isExportSuppressed(){return this.gos.get("suppressExcelExport")}packageCompressedFile(e){return em(e,this.workbook)}packageFile(e){return tm(e,this.workbook)}},X2=":where(.ag-virtual-list-viewport) .ag-tab-guard{position:sticky}.ag-virtual-list-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:auto;position:relative;width:100%}.ag-virtual-list-container{overflow:hidden;position:relative}.ag-virtual-list-item{height:var(--ag-list-item-height);position:absolute;width:100%}";function Z2(e){return{tag:"div",cls:`ag-virtual-list-viewport ag-${e}-virtual-list-viewport`,role:"presentation",children:[{tag:"div",ref:"eContainer",cls:`ag-virtual-list-container ag-${e}-virtual-list-container`}]}}var Q2=class extends ds{constructor(e,t){super(Z2(t?.cssIdentifier||"default"));this.stopPropagationCallbacks=e,this.renderedRows=new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0,this.eContainer=E,this.awaitStableCallbacks=[],this.registerCSS(X2);let{cssIdentifier:s="default",ariaRole:i="listbox",listName:o,moveItemCallback:r}=t||{};this.cssIdentifier=s,this.ariaRole=i,this.listName=o,this.moveItemCallback=r}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:(e)=>this.onFocusIn(e),onFocusOut:(e)=>this.onFocusOut(e),focusInnerElement:(e)=>this.focusInnerElement(e),onTabKeyDown:(e)=>this.onTabKeyDown(e),handleKeyDown:(e)=>this.handleKeyDown(e)},this.stopPropagationCallbacks),this.refreshAriaProperties(),this.addManagedEventListeners({stylesChanged:this.onStylesChanged.bind(this)})}onStylesChanged(e){if(e.listItemHeightChanged)this.rowHeight=this.getItemHeight(),this.refresh()}refreshAriaProperties(){let t=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),s=this.eContainer;ge(s,this.model?.getRowCount()>0?this.ariaRole:"presentation"),fe(s,t)}addResizeObserver(){let e=()=>et(this.beans,()=>this.drawVirtualRows()),t=It(this.beans,this.getGui(),e);this.addDestroyFunc(t)}focusInnerElement(e){return this.focusRow(e?this.model.getRowCount()-1:0),!0}onFocusIn(e){let t=e.target;if(t.classList.contains("ag-virtual-list-item"))this.lastFocusedRowIndex=yh(t)-1}onFocusOut(e){if(!this.getFocusableElement().contains(e.relatedTarget))this.lastFocusedRowIndex=null}handleKeyDown(e){let{key:t,shiftKey:s}=e;switch(t){case b.UP:case b.DOWN:{let i=t===b.UP;if(e.preventDefault(),s)this.moveItem(i);else this.navigate(i)}break;case b.PAGE_HOME:case b.PAGE_END:case b.PAGE_UP:case b.PAGE_DOWN:if(this.navigateToPage(t)!==null)e.preventDefault();break}}onTabKeyDown(e){this.stopPropagationCallbacks?.stopPropagation(e),this.forceFocusOutOfContainer(e.shiftKey)}getNextRow(e){if(this.lastFocusedRowIndex==null)return;let t=this.lastFocusedRowIndex+(e?-1:1);if(t<0||t>=this.model.getRowCount())return;return t}moveItem(e){if(!this.moveItemCallback)return;let t=this.getComponentAt(this.lastFocusedRowIndex);if(!t)return;this.moveItemCallback(t,e)}navigate(e){let t=this.getNextRow(e);if(t===void 0)return;this.focusRow(t)}navigateToPage(e,t="focused"){let s=!1;if(t==="focused")t=this.getLastFocusedRow(),s=!0;let i=this.model.getRowCount()-1,o=-1;if(e===b.PAGE_HOME)o=0;else if(e===b.PAGE_END)o=i;else if(e===b.PAGE_DOWN)o=Math.min(t+this.pageSize,i);else if(e===b.PAGE_UP)o=Math.max(t-this.pageSize,0);if(o===-1)return null;if(s)this.focusRow(o);else this.ensureIndexVisible(o);return o}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){if(this.isScrolling)return;this.isScrolling=!0,this.ensureIndexVisible(e),et(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;let t=this.renderedRows.get(e);if(t)t.eDiv.focus()})}getComponentAt(e){return this.renderedRows.get(e)?.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,s)=>e(t.rowComponent,s))}getItemHeight(){if(!this.isHeightFromTheme)return this.rowHeight;return this.beans.environment.getDefaultListItemHeight()}ensureIndexVisible(e,t=!0){let s=this.model.getRowCount();if(typeof e!=="number"||e<0||e>=s)return!1;let i=e*this.rowHeight,o=i+this.rowHeight,r=this.getGui(),{scrollTop:n,offsetHeight:a}=r,l=n+a,c=t?0:this.rowHeight,d=n>i+c,u=l<o-c;if(d)return r.scrollTop=i,!0;if(u){let h=o-a;return r.scrollTop=h,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(this.model==null||!this.isAlive())return;let t=this.model.getRowCount();this.eContainer.style.height=`${t*this.rowHeight}px`,this.refreshAriaProperties(),this.awaitStable(()=>{if(!this.isAlive())return;if(this.canSoftRefresh(e))this.drawVirtualRows(!0);else this.clearVirtualRows(),this.drawVirtualRows()})}awaitStable(e){if(this.awaitStableCallbacks.push(e),this.awaitStableCallbacks.length>1)return;let t=this.model.getRowCount();$l(this,()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{if(!this.isAlive())return;let s=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(let i of s)i()})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual==="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;let t=this.getGui(),s=t.scrollTop,i=s+t.offsetHeight;if(s===i)this.clearVirtualRows();else{let o=Math.floor(s/this.rowHeight),r=Math.floor(i/this.rowHeight);this.pageSize=Math.floor((i-s)/this.rowHeight),this.ensureRowsRendered(o,r,e)}}ensureRowsRendered(e,t,s){if(this.renderedRows.forEach((i,o)=>{if((o<e||o>t)&&o!==this.lastFocusedRowIndex)this.removeRow(o)}),s)this.refreshRows();for(let i=e;i<=t;i++){if(this.renderedRows.has(i))continue;if(i<this.model.getRowCount())this.insertRow(i)}}insertRow(e){let{model:t}=this;if(e<0||e>=t.getRowCount())return;let{cssIdentifier:s,ariaRole:i,renderedRows:o,eContainer:r}=this,n=t.getRow(e),a=i==="tree"?"treeitem":"option",l=me({tag:"div",cls:`ag-virtual-list-item ag-${s}-virtual-list-item`,role:a,attrs:{tabindex:"-1"}});Wo(l,t.getRowCount()),Uo(l,e+1);let c=this.rowHeight;l.style.height=`${c}px`,l.style.top=`${c*e}px`;let d=this.componentCreator(n,l);if(d.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),l.appendChild(d.getGui()),o.has(e-1))o.get(e-1).eDiv.insertAdjacentElement("afterend",l);else if(o.has(e+1))o.get(e+1).eDiv.insertAdjacentElement("beforebegin",l);else r.appendChild(l);o.set(e,{rowComponent:d,eDiv:l,value:n})}removeRow(e){let t=this.renderedRows.get(e);t.eDiv.remove(),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){let e=this.model.getRowCount();this.renderedRows.forEach((t,s)=>{if(s>=e)this.removeRow(s);else{let i=this.model.getRow(s);if(this.model.areRowsEqual?.(t.value,i))this.componentUpdater(i,t.rowComponent);else this.removeRow(s)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){if(!this.isAlive())return;this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy()}},J2='.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}',md="ag-list-item-hovered",e3=class extends xe{constructor(e,t,s){super();this.comp=e,this.virtualList=t,this.params=s,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.beans.environment.addGlobalCSS(J2,"component-AgVirtualListDragFeature"),this.params.addListeners(this,this.listItemDragStart.bind(this),this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){let e={isInterestedIn:(t)=>t===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:(t)=>this.onDragging(t),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()};this.beans.dragAndDrop?.addDropTarget(e)}createAutoScrollService(){let e=this.virtualList.getGui();this.autoScrollService=new Bn({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:(t)=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;let t=this.getListDragItem(e),s=this.virtualList.getComponentAt(t.rowIndex);if(!s)return;let i=s.getGui().parentElement;if(this.lastHoveredListItem?.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position)return;this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,Hl(i,md),Hl(i,`ag-item-highlight-${t.position}`)}getListDragItem(e){let t=this.virtualList.getGui(),s=Number.parseFloat(window.getComputedStyle(t).paddingTop),i=this.virtualList.getRowHeight(),o=this.virtualList.getScrollTop(),r=Math.max(0,(e.y-s+o)/i),n=this.params.getNumRows(this.comp)-1,a=Math.min(n,r)|0;return{rowIndex:a,position:Math.round(r)>r||r>n?"bottom":"top",component:this.virtualList.getComponentAt(a)}}onDragStop(){if(this.moveBlocked)return;this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties()}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){let e=this.virtualList.getGui();for(let t of e.querySelectorAll(`.${md}`))for(let s of[md,"ag-item-highlight-top","ag-item-highlight-bottom"])t.classList.remove(s);this.lastHoveredListItem=null}};var t3=".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-family:var(--ag-panel-title-bar-font-family);font-size:var(--ag-panel-title-bar-font-size);font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}";function s3(e){return e??(e=e||"default"),{tag:"div",cls:`ag-panel ag-${e}-panel`,attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eTitleBar",cls:`ag-panel-title-bar ag-${e}-panel-title-bar ag-unselectable`,children:[{tag:"span",ref:"eTitle",cls:`ag-panel-title-bar-title ag-${e}-panel-title-bar-title`},{tag:"div",ref:"eTitleBarButtons",cls:`ag-panel-title-bar-buttons ag-${e}-panel-title-bar-buttons`}]},{tag:"div",ref:"eContentWrapper",cls:`ag-panel-content-wrapper ag-${e}-panel-content-wrapper`}]}}var i3=class extends Le{constructor(e){super(s3(e.cssIdentifier));this.config=e,this.closable=!0,this.eContentWrapper=E,this.eTitleBar=E,this.eTitleBarButtons=E,this.eTitle=E,this.registerCSS(t3)}postConstruct(){let{component:e,closable:t,hideTitleBar:s,title:i,minWidth:o=250,width:r,minHeight:n=250,height:a,centered:l,popup:c,x:d,y:u,postProcessPopupParams:h}=this.config,g=this.beans,p=this.createManagedBean(new lc(this.getGui(),{minWidth:o,width:r,minHeight:n,height:a,centered:l,x:d,y:u,popup:c,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=p;let f=this.getGui();if(e)this.setBodyComponent(e);if(!s){if(i)this.setTitle(i);this.setClosable(t!=null?t:this.closable)}else G(this.eTitleBar,!1);if(this.addManagedElementListeners(this.eTitleBar,{mousedown:(C)=>{if(f.contains(C.relatedTarget)||f.contains(j(g))||this.eTitleBarButtons.contains(C.target)){C.preventDefault();return}let v=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");if(v)v.focus()}}),c&&p.isPositioned())return;if(this.renderComponent)this.renderComponent();let m;if(h){let{type:C,eventSource:v,mouseEvent:w}=h;m=()=>g.popupSvc?.callPostProcessPopup(h,C,f,v,w)}p.initialisePosition(m),this.eContentWrapper.style.height="0"}renderComponent(){let e=this.getGui();e.focus(),this.close=()=>{e.remove(),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}get isResizing(){return this.positionableFeature.isResizing}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable)this.closable=e;if(e){let t=this.closeButtonComp=new Le({tag:"div",cls:"ag-button"});this.createBean(t);let s=t.getGui(),i=this.beans.iconSvc.createIconNoSpan("close",this.beans);i.classList.add("ag-panel-title-bar-button-icon"),s.appendChild(i),this.addTitleBarButton(t),t.addManagedElementListeners(s,{click:this.onBtClose.bind(this)})}else if(this.closeButtonComp)this.closeButtonComp.getGui().remove(),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){let s=this.eTitleBarButtons,i=s.children,o=i.length;if(t==null)t=o;t=Math.max(0,Math.min(t,o)),e.addCss("ag-panel-title-bar-button");let r=e.getGui();if(t===0)s.prepend(r);else if(t===o)s.append(r);else i[t-1].after(r);e.setParentComponent(this)}getBodyHeight(){return Ko(this.eContentWrapper)}getBodyWidth(){return ni(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){if(this.closeButtonComp)this.closeButtonComp=this.destroyBean(this.closeButtonComp);let e=this.getGui();if(e&&ve(e))this.close();super.destroy()}},o3=class extends i3{constructor(e,t){super({...e,popup:!0});this.callbacks=t,this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){let e=this.getGui(),{movable:t,resizable:s,maximizable:i,modal:o}=this.config;if(this.addCss("ag-dialog"),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new Fc(this,this.callbacks?.stopPropagationCallbacks)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(e)},onTabKeyDown:(r)=>{if(o)return;let n=r.shiftKey,a=Ie(this.beans,e,!1,n);if(!a||this.tabGuardFeature.getTabGuardCtrl().isTabGuard(a)){if(this.callbacks?.focusNextContainer(this.beans,n))r.preventDefault()}}}),t)this.setMovable(t);if(i)this.setMaximizable(i);if(s)this.setResizable(s);if(!this.config.modal)this.callbacks?.configureFocusableContainer(this.beans,this)}setAllowFocus(e){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(e)}renderComponent(){let e=this.getGui(),{alwaysOnTop:t,modal:s,title:i,afterGuiAttached:o}=this.config,r=this.getLocaleTextFunc(),n=this.popupSvc?.addPopup({modal:s,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:i||r("ariaLabelDialog","Dialog"),afterGuiAttached:o});if(n)this.close=n.hideFunc}onClosed(e){this.destroy(),this.config.closedCallback?.(e)}setMaximized(e){if(this.isMaximizable&&e!==this.isMaximized)this.toggleMaximize()}toggleMaximize(){let e=this.positionableFeature.getPosition();if(this.isMaximized){let{x:t,y:s,width:i,height:o}=this.lastPosition;this.setWidth(i),this.setHeight(o),this.positionableFeature.offsetElement(t,s)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){G(this.maximizeIcon,!this.isMaximized),G(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){if(this.maximizeListeners.length){for(let e of this.maximizeListeners)e();this.maximizeListeners.length=0}if(this.resizeListenerDestroy)this.resizeListenerDestroy(),this.resizeListenerDestroy=null}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e){if(this.clearMaximizebleListeners(),this.maximizeButtonComp)this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0;return}let t=this.eTitleBar;if(!t||e===this.isMaximizable)return;this.isMaximizable=e;let s=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),s.addManagedElementListeners(s.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton(s,0),this.maximizeListeners.push(...this.addManagedElementListeners(t,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){let e=this.maximizeButtonComp=this.createBean(new Le({tag:"div",cls:"ag-dialog-button"})),t=e.getGui(),s=this.beans.iconSvc;return this.maximizeIcon=s.createIconNoSpan("maximize"),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=s.createIconNoSpan("minimize"),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}};var r3=class extends ds{constructor(e){super();this.setTemplateFromElement(e.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(e)=>this.onTabKeyDown(e),handleKeyDown:(e)=>this.handleKeyDown(e)})}handleKeyDown(e){if(e.key===b.ESCAPE)this.closePanel()}onTabKeyDown(e){if(e.defaultPrevented)return;this.closePanel(),e.preventDefault()}closePanel(){let e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}},Md=class extends xe{constructor(e){super();this.callbacks=e,this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){let{menuItemDef:t,isAnotherSubMenuOpen:s,level:i,childComponent:o,contextParams:r}=e;return this.params=e.menuItemDef,this.level=i,this.isAnotherSubMenuOpen=s,this.childComponent=o,this.contextParams=r,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",this.callbacks.getMenuItemComp(this.beans,this.params,{...t,level:i,isAnotherSubMenuOpen:s,openSubMenu:(n)=>this.openSubMenu(n),closeSubMenu:()=>this.closeSubMenu(),closeMenu:(n)=>this.closeMenu(n),updateTooltip:(n,a)=>this.refreshTooltip(n,a),onItemActivated:()=>this.onItemActivated()}).then((n)=>{if(!n)return;this.menuItemComp=n;let a=n.configureDefaults?.();if(a)this.configureDefaults(a===!0?void 0:a)})}addListeners(e,t){if(!t?.suppressClick)this.addManagedElementListeners(e,{click:(s)=>this.onItemSelected(s)});if(!t?.suppressKeyboardSelect)this.addManagedElementListeners(e,{keydown:(s)=>{if(s.key===b.ENTER||s.key===b.SPACE)s.preventDefault(),this.onItemSelected(s)}});if(!t?.suppressMouseDown)this.addManagedElementListeners(e,{mousedown:(s)=>{s.stopPropagation(),s.preventDefault()}});if(!t?.suppressMouseOver)this.addManagedElementListeners(e,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1,t){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;let s=ee({tag:"div",cls:"ag-menu",role:"presentation"});this.eSubMenuGui=s;let i,o=()=>{this.subMenuIsOpening=!1};if(this.childComponent){let c=this.createBean(new r3(this.childComponent));c.setParentComponent(this);let d=c.getGui(),u="mouseenter",h=()=>this.cancelDeactivate();if(d.addEventListener(u,h),i=()=>{d.removeEventListener(u,h),this.destroyBean(c)},s.appendChild(d),this.childComponent.afterGuiAttached)o=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1}}else if(this.params.subMenu){let c=this.createBean(new Od(this.level+1,this.contextParams,this.callbacks));if(c.setParentComponent(this),c.addMenuItems(this.params.subMenu),s.appendChild(c.getGui()),this.addManagedListeners(c,{closeMenu:(d)=>this.dispatchLocalEvent(d)}),c.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),i=()=>this.destroyBean(c),e)o=()=>{c.activateFirstItem(),this.subMenuIsOpening=!1}}let r=this.beans.popupSvc,n=()=>{let c=this.eGui;r?.positionPopupForMenu({eventSource:c,ePopup:s,event:t instanceof MouseEvent?t:void 0,additionalParams:this.callbacks.getPostProcessPopupParams(this.contextParams)})},a=this.getLocaleTextFunc(),l=r?.addPopup({modal:!0,eChild:s,positionCallback:n,anchorToElement:this.eGui,ariaLabel:a("ariaLabelSubMenu","SubMenu"),afterGuiAttached:o});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{if(l)l.hideFunc();this.subMenuIsOpen=!1,this.setAriaExpanded(!1),i(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(e){if(!this.suppressAria)De(this.eGui,e)}closeSubMenu(){if(!this.hideSubMenu)return;this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1)}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e,t){if(this.cancelActivate(),this.params.disabled&&!t)return;if(this.isActive=!0,!this.suppressRootStyles)this.eGui.classList.add(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!0),!this.suppressFocus)this.callbacks.preserveRangesWhile(this.beans,()=>this.eGui.focus({preventScroll:!t}));if(e&&this.params.subMenu)window.setTimeout(()=>{if(this.isAlive()&&this.isActive)this.openSubMenu()},300);this.onItemActivated()}deactivate(){if(this.cancelDeactivate(),!this.suppressRootStyles)this.eGui.classList.remove(`${this.cssClassPrefix}-active`);if(this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen)this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){if(this.menuItemComp.select?.(),this.params.action)this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(this.gos.addCommon({...this.contextParams})));else this.openSubMenu(e?.type==="keydown",e);if(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)return;this.closeMenu(e)}closeMenu(e){let t={type:"closeMenu"};if(e)if(e instanceof MouseEvent)t.mouseEvent=e;else t.keyboardEvent=e;this.dispatchLocalEvent(t)}onItemActivated(){let e={type:"menuItemActivated",menuItem:this};this.dispatchLocalEvent(e)}cancelActivate(){if(this.activateTimeoutId)window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0}cancelDeactivate(){if(this.deactivateTimeoutId)window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0}onMouseEnter(){if(this.cancelDeactivate(),this.isAnotherSubMenuOpen())this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),this.ACTIVATION_DELAY);else this.activate(!0)}onMouseLeave(){if(this.cancelActivate(),this.isSubMenuOpen())this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY);else this.deactivate()}refreshRootElementGui(e){let t=this.menuItemComp.getGui(),{cssClassPrefix:s,params:{cssClasses:i,disabled:o}}=this,r=this.menuItemComp.getRootElement?.();if(r){if(!e)t.classList.add("ag-menu-option-custom");t=r}if(this.suppressRootStyles=!!e,!this.suppressRootStyles){t.classList.add(s);for(let n of i??[])t.classList.add(n);if(o)t.classList.add(`${s}-disabled`)}return t}applyAriaProperties(e){let{params:{checked:t,subMenu:s,subMenuRole:i,disabled:o}}=this,r=t!=null;if(ge(e,r?"menuitemcheckbox":"menuitem"),s)Ph(e,i??"menu");if(o)Rh(e,!0)}configureDefaults(e){if(!this.menuItemComp){setTimeout(()=>this.configureDefaults(e));return}let{suppressRootStyles:t,suppressTooltip:s,suppressAria:i,suppressTabIndex:o,suppressFocus:r}=e||{},{params:{tooltip:n,disabled:a}}=this,l=this.eGui=this.refreshRootElementGui(!!t);if(this.suppressAria=!!i,!i)this.applyAriaProperties(l);if(!o)l.setAttribute("tabindex","-1");if(!s)this.refreshTooltip(n);if(!a)this.addListeners(l,e);this.suppressFocus=!!r}refreshTooltip(e,t){if(this.tooltip=e,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!e||!this.menuItemComp)return;let s=this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t});if(s)this.tooltipFeature=this.createBean(s)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},Od=class extends ds{constructor(e=0,t,s){super({tag:"div",cls:"ag-menu-list",role:"menu"});this.level=e,this.menuActionParams=t,this.callbacks=s,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:(e)=>this.onTabKeyDown(e),handleKeyDown:(e)=>this.callbacks.preserveRangesWhile(this.beans,()=>this.handleKeyDown(e)),onFocusIn:(e)=>this.handleFocusIn(e),onFocusOut:(e)=>this.handleFocusOut(e)})}onTabKeyDown(e){if(!this.getParentComponent()?.getGui()?.classList.contains("ag-focus-managed"))e.preventDefault();if(e.shiftKey)this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case b.UP:case b.RIGHT:case b.DOWN:case b.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case b.ESCAPE:if(this.closeIfIsChild())this.callbacks.stopPropagationCallbacks.stopPropagation(e);break}}handleFocusIn(e){let t=e.relatedTarget;if(!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(t)&&(this.getGui().contains(t)||this.activeMenuItem?.getSubMenuGui()?.contains(t)))return;if(this.activeMenuItem)this.activeMenuItem.activate();else this.activateFirstItem()}handleFocusOut(e){let t=e.relatedTarget;if(!this.activeMenuItem||this.getGui().contains(t)||this.activeMenuItem.getSubMenuGui()?.contains(t))return;if(!this.activeMenuItem.isSubMenuOpening())this.activeMenuItem.deactivate()}clearActiveItem(){if(this.activeMenuItem)this.activeMenuItem.deactivate(),this.activeMenuItem=null}addMenuItems(e){if(e==null)return;B.all(e.map((t)=>{if(t==="separator")return B.resolve({eGui:this.createSeparator()});else if(typeof t==="string")return this.callbacks.warnNoItem?.(t),B.resolve({eGui:null});else return this.addItem(t)})).then((t)=>{for(let s of t??[])if(s?.eGui){if(this.appendChild(s.eGui),s.comp)this.menuItems.push(s.comp)}})}addItem(e){let t=this.createManagedBean(new Md(this.callbacks));return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some((s)=>s.isSubMenuOpen()),level:this.level,contextParams:this.menuActionParams}).then(()=>(t.setParentComponent(this),this.addManagedListeners(t,{closeMenu:(s)=>{this.dispatchLocalEvent(s)},menuItemActivated:(s)=>{if(this.activeMenuItem&&this.activeMenuItem!==s.menuItem)this.activeMenuItem.deactivate();this.activeMenuItem=s.menuItem}}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){let e=this.menuItems.filter((t)=>!t.isDisabled())[0];if(!e)return;e.activate()}createSeparator(){let e={tag:"div",cls:"ag-menu-separator-part"};return me({tag:"div",cls:"ag-menu-separator",attrs:{"aria-hidden":"true"},children:[e,e,e,e]})}handleNavKey(e){switch(e){case b.UP:case b.DOWN:{let s=this.findNextItem(e===b.UP);if(s&&s!==this.activeMenuItem)s.activate(!1,!0);return}}let t=this.gos.get("enableRtl")?b.RIGHT:b.LEFT;if(e===t)this.closeIfIsChild();else this.openChild()}closeIfIsChild(e){let t=this.getParentComponent();if(t&&t instanceof Md){if(e)e.preventDefault();return t.closeSubMenu(),t.getGui().focus(),!0}return!1}openChild(){if(this.activeMenuItem)this.activeMenuItem.openSubMenu(!0)}findNextItem(e){let t=[...this.menuItems];if(!t.length)return;if(!this.activeMenuItem)return e?k(t):t[0];if(e)t.reverse();let s,i=!1;for(let o of t){if(!i){if(o===this.activeMenuItem)i=!0;continue}s=o;break}if(i&&!s)return t[0];return s||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}},n3="ag-menu",a3="ag-context-menu-loading-icon",l3=class extends xe{constructor(e){super();this.params=e,this.destroyLoadingSpinner=null,this.lastPromise=0}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenu(e,t,s){let{getMenuItems:i,shouldBlockMenuOpen:o}=this.params,r=i(e,t);if(bg(r)){let n=this.lastPromise+1;if(this.lastPromise=n,!this.destroyLoadingSpinner)this.createLoadingIcon(t);return r.then((a)=>{if(this.lastPromise!==n)return;let{target:l}=t,c=!l;if(a?.length&&(c||ve(l))&&!o?.())this.createContextMenu({menuItems:a,menuActionParams:e,mouseEvent:t,anchorToElement:s});this.destroyLoadingSpinner?.()}),!0}if(!r?.length)return!1;return this.createContextMenu({menuItems:r,menuActionParams:e,mouseEvent:t,anchorToElement:s}),!0}createLoadingIcon(e){let{beans:t}=this,s=this.getLocaleTextFunc(),i=t.iconSvc.createIconNoSpan("loadingMenuItems"),o=me({tag:"div",cls:a3});o.appendChild(i);let r=Ue(t),n=Ls(t);if(!n)return;n.appendChild(o),t.ariaAnnounce?.announceValue(s("ariaLabelLoadingContextMenu","Loading Context Menu"),"contextmenu"),t.environment.applyThemeClasses(o),Rn(o,e,t);let a=(l)=>{Rn(o,l,t)};r.addEventListener("mousemove",a),this.destroyLoadingSpinner=()=>{r.removeEventListener("mousemove",a),o.remove(),this.destroyLoadingSpinner=null}}createContextMenu(e){let{mapMenuItems:t,menuItemCallbacks:s,beforeMenuOpen:i,onMenuClose:o,afterMenuDestroyed:r,onVisibleChanged:n,onMenuOpen:a}=this.params,{menuItems:l,menuActionParams:c,mouseEvent:d,anchorToElement:u}=e,h=this.beans.popupSvc,p=new c3(t?(S)=>t(l,c,S):()=>l,c,s);this.createBean(p);let f=p.getGui();i?.(c);let m={additionalParams:s.getPostProcessPopupParams(c),type:"contextMenu",mouseEvent:d,ePopup:f,nudgeY:1},C=this.getLocaleTextFunc(),v=h?.addPopup({modal:!0,eChild:f,closeOnEsc:!0,closedCallback:(S)=>{s.preserveRangesWhile(this.beans,()=>{o?.(),this.destroyBean(p),r?.(),n?.(!1,S===void 0?"api":"ui")})},click:d,positionCallback:()=>{let S=this.gos.get("enableRtl");h?.positionPopupUnderMouseEvent({...m,nudgeX:S?(f.offsetWidth+1)*-1:1})},anchorToElement:u,ariaLabel:C("ariaLabelContextMenu","Context Menu")});if(v)a?.(),p.afterGuiAttached({container:"contextMenu",hidePopup:v.hideFunc});if(this.activeMenu)this.hideActiveMenu();if(this.activeMenu=p,p.addEventListener("destroyed",()=>{if(this.activeMenu===p)this.activeMenu=null}),v)p.addEventListener("closeMenu",(S)=>v.hideFunc({mouseEvent:S.mouseEvent??void 0,keyboardEvent:S.keyboardEvent??void 0,forceHide:!0}));let w=d&&d instanceof MouseEvent&&d.type==="mousedown";n?.(!0,w?"api":"ui")}destroy(){this.destroyLoadingSpinner?.(),super.destroy()}},c3=class extends Le{constructor(e,t,s){super({tag:"div",cls:n3,role:"presentation"});this.getMenuItems=e,this.menuActionParams=t,this.callbacks=s,this.menuList=null}postConstruct(){let e=this.createManagedBean(new Od(0,this.menuActionParams,this.callbacks)),t=this.getMenuItems(()=>this.getGui());e.addMenuItems(t),this.appendChild(e),this.menuList=e,e.addEventListener("closeMenu",(s)=>this.dispatchLocalEvent(s))}afterGuiAttached({hidePopup:e}){if(e)this.addDestroyFunc(e);let t=this.menuList;if(t)this.callbacks.preserveRangesWhile(this.beans,()=>pe(t.getGui()))}},d3=class extends Le{constructor(e){super({tag:"div"});this.callbacks=e}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){let{checked:e,subMenu:t}=this.params,s=this.getGui();if(e)yn(s,e);if(t)De(s,!1)}addIcon(){if(this.params.isCompact)return;let e=me({tag:"span",ref:"eIcon",cls:`${this.getClassName("part")} ${this.getClassName("icon")}`,role:"presentation"}),{checked:t,icon:s}=this.params;if(t)e.appendChild(this.beans.iconSvc.createIconNoSpan("check"));else if(s)if(jo(s))e.appendChild(s);else if(typeof s==="string")e.innerHTML=s;else this.callbacks?.warnNoIcon?.();this.getGui().appendChild(e)}addName(){let e=me({tag:"span",ref:"eName",cls:`${this.getClassName("part")} ${this.getClassName("text")}`,children:this.params.name||""});this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;let e=me({tag:"span",ref:"eShortcut",cls:`${this.getClassName("part")} ${this.getClassName("shortcut")}`,children:this.params.shortcut||""});this.getGui().appendChild(e)}addSubMenu(){let e=me({tag:"span",ref:"ePopupPointer",cls:`${this.getClassName("part")} ${this.getClassName("popup-pointer")}`}),t=this.getGui();if(this.params.subMenu){let s=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";e.appendChild(this.beans.iconSvc.createIconNoSpan(s))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}};function Td(e,t){if(!t)return null;let s=dt(e),i=s.indexOf(t);if(i===-1)return null;let o=-1;for(let r=i-1;r>=0;r--)if(s[r].classList.contains(Ro.TAB_GUARD_TOP)){o=r;break}if(o<=0)return null;return s[o-1]}function Xm(e,t){if(!t)return!1;let s=e.querySelectorAll(`.${dc}`);if(!s.length)return!1;for(let i=0;i<s.length;i++)if(s[i].contains(t))return!0;return!1}function u3(e){return{tag:"div",cls:`ag-tabs ${e}`,children:[{tag:"div",ref:"eHeader"},{tag:"div",ref:"eBody",role:"presentation",cls:"ag-tabs-body"+e?` ${e}-body`:""}]}}var h3=class extends ds{constructor(e){super(u3(e.cssClass));this.eHeader=E,this.eBody=E,this.items=[],this.tabbedItemScrollMap=new Map,this.params=e}postConstruct(){if(this.setupHeader(),this.params.items)for(let e of this.params.items)this.addItem(e);this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>this.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){let{enableCloseButton:e,cssClass:t}=this.params,s=(i,o)=>{if(i.classList.add(`ag-tabs-${o}`),t)i.classList.add(`${t}-${o}`)};if(e)this.setupCloseButton(s),this.eTabHeader=me({tag:"div",role:"presentation"}),s(this.eHeader,"header-wrapper"),this.eHeader.appendChild(this.eTabHeader);else this.eTabHeader=this.eHeader;ge(this.eTabHeader,"tablist"),s(this.eTabHeader,"header")}setupCloseButton(e){let t=me({tag:"button"});e(t,"close-button");let s=this.beans.iconSvc.createIconNoSpan("close");fe(t,this.params.closeButtonAriaLabel),t.appendChild(s),this.addManagedElementListeners(t,{click:()=>this.params.onCloseClicked?.()});let i=me({tag:"div",role:"presentation"});e(i,"close-button-wrapper"),i.appendChild(t),this.eHeader.appendChild(i),this.eCloseButton=t}handleKeyDown(e){switch(e.key){case b.RIGHT:case b.LEFT:{if(!this.eTabHeader.contains(j(this.beans)))return;let t=e.key===b.RIGHT,s=this.gos.get("enableRtl"),i=this.items.indexOf(this.activeItem),o=t!==s?Math.min(i+1,this.items.length-1):Math.max(i-1,0);if(i===o)return;e.preventDefault();let r=this.items[o];this.showItemWrapper(r),r.eHeaderButton.focus();break}case b.UP:case b.DOWN:e.stopPropagation();break}}onTabKeyDown(e){if(e.defaultPrevented)return;let{beans:t,eHeader:s,eBody:i,activeItem:o,params:r}=this,{suppressTrapFocus:n,enableCloseButton:a}=r,l=j(t),{target:c,shiftKey:d}=e;if(s.contains(l)){if(e.preventDefault(),a&&d&&!this.eCloseButton?.contains(l))this.eCloseButton?.focus();else if(n&&d)Td(ce(t).body,c)?.focus();else this.focusBody(e.shiftKey);return}let u=null;if(Xm(i,c)){if(d)u=Td(i,c);if(!u&&!n)u=o.eHeaderButton}if(!u&&i.contains(l)){if(u=Ie(t,i,!1,d),!u){if(n&&!d)this.forceFocusOutOfContainer(d);else if(a&&!d)e.preventDefault(),this.eCloseButton?.focus();else e.preventDefault(),this.focusHeader();return}}if(u)e.preventDefault(),u.focus()}focusInnerElement(e){if(e)return this.focusBody(!0);else return this.focusHeader(),!0}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){return pe(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){if(this.items.length>0)this.showItemWrapper(this.items[0])}addItem(e){let t=me({tag:"span",cls:"ag-tab",role:"tab",attrs:{tabindex:"-1"}});t.appendChild(e.title),this.eTabHeader.appendChild(t),fe(t,e.titleLabel);let s={tabbedItem:e,eHeaderButton:t};this.items.push(s),t.addEventListener("click",this.showItemWrapper.bind(this,s))}showItem(e){let t=this.items.find((s)=>s.tabbedItem===e);if(t)this.showItemWrapper(t)}showItemWrapper(e){let{tabbedItem:t,eHeaderButton:s}=e;if(this.params.onItemClicked?.({item:t}),this.activeItem===e){this.params.onActiveItemClicked?.();return}if(this.lastScrollListener)this.lastScrollListener=this.lastScrollListener();if(te(this.eBody),t.bodyPromise.then((i)=>{this.eBody.appendChild(i);let o=!Ji();if(!this.params.suppressFocusBodyOnOpen)pe(this.eBody,!1,o);if(t.afterAttachedCallback)t.afterAttachedCallback(this.afterAttachedParams);if(this.params.keepScrollPosition){let r=t.getScrollableContainer?.()||i;[this.lastScrollListener]=this.addManagedElementListeners(r,{scroll:()=>{this.tabbedItemScrollMap.set(t.name,r.scrollTop)}});let n=this.tabbedItemScrollMap.get(t.name);if(n!==void 0)setTimeout(()=>{r.scrollTop=n},0)}}),this.activeItem)this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.();s.classList.add("ag-tab-selected"),this.activeItem=e}},g3=".ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}";function p3(e){let t=e.cssIdentifier||"default",s=e.direction||"vertical";return{tag:"div",cls:`ag-group ag-${t}-group`,role:"presentation",children:[{tag:"div",ref:"eToolbar",cls:`ag-group-toolbar ag-${t}-group-toolbar`,children:[{tag:"ag-checkbox",ref:"cbGroupEnabled"}]},{tag:"div",ref:"eContainer",cls:`ag-group-container ag-group-container-${s} ag-${t}-group-container`}]}}var f3=class extends Le{constructor(e={}){super(p3(e),[wt]);this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=E,this.cbGroupEnabled=E,this.eContainer=E,this.registerCSS(g3);let{enabled:t,items:s,suppressEnabledCheckbox:i,expanded:o,suppressToggleExpandOnEnableChange:r,useToggle:n}=e;if(this.cssIdentifier=e.cssIdentifier||"default",this.enabled=t!=null?t:!0,this.items=s||[],this.useToggle=n??!1,this.alignItems=e.alignItems||"center",this.expanded=o==null?!0:o,i!=null)this.suppressEnabledCheckbox=i;if(r!=null)this.suppressToggleExpandOnEnableChange=r}postConstruct(){if(this.setupTitleBar(),this.items.length){let o=this.items;this.items=[],this.addItems(o)}let e=this.getLocaleTextFunc();if(this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled)this.setEnabled(this.enabled,void 0,!0);this.setAlignItems(this.alignItems);let{onEnableChange:t,onExpandedChange:s,suppressOpenCloseIcons:i}=this.params;if(this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(i??!1),this.refreshChildDisplay(),G(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange((o)=>{this.setEnabled(o,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(o)}),t!=null)this.onEnableChange(t);if(s!=null)this.onExpandedChange(s)}refreshChildDisplay(){G(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){if(this.alignItems!==e)this.removeCss(`ag-group-item-alignment-${this.alignItems}`);this.alignItems=e;let t=`ag-group-item-alignment-${this.alignItems}`;return this.addCss(t),this}toggleGroupExpand(e,t){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)e=!0,t=!0;else if(e=e!=null?e:!this.expanded,this.expanded===e)return this;if(this.expanded=e,this.refreshChildDisplay(),G(this.eContainer,e),!t)this.dispatchLocalEvent({type:e?"expanded":"collapsed"});return this}addItems(e){for(let t of e)this.addItem(t)}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}updateItems(e){let t=this.items,s=0;for(let i=0;i<t.length;++i){let o=t[i];if(o===e[s])s++;else{let r=Wi(o)?o.getGui():o;Me(r)}}while(s<e.length)this.insertItem(e[s++]);this.items=e}insertItem(e,t){let s=this.eContainer,i=Wi(e)?e.getGui():e;if(i.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t)s.prepend(i),this.items.unshift(i);else s.appendChild(i),this.items.push(i)}hideItem(e,t){let s=this.items[t];G(s,!e)}getItemIndex(e){let t=Wi(e)?e.getGui():e;return this.items.indexOf(t)}setTitle(e){return this.eTitleBar?.setTitle(e),this}addTitleBarWidget(e){return this.eTitleBar?.addWidget(e),this}addCssClassToTitleBar(e){this.eTitleBar?.addCss(e)}dispatchEnableChangeEvent(e){let t={type:"enableChange",enabled:e};this.dispatchLocalEvent(t)}setEnabled(e,t,s){if(this.enabled=e,this.refreshDisabledStyles(),!s)this.toggleGroupExpand(e);if(!t)this.cbGroupEnabled.setValue(e),this.eToggle?.setValue(e);return this}isEnabled(){return this.enabled}onEnableChange(e){return this.addManagedListeners(this,{enableChange:(t)=>e(t.enabled)}),this}onExpandedChange(e){return this.addManagedListeners(this,{expanded:()=>e(!0),collapsed:()=>e(!1)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.eTitleBar?.hideOpenCloseIcons(e),this}refreshDisabledStyles(){let e=!this.enabled;this.eContainer.classList.toggle("ag-disabled",e),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&e),this.eContainer.classList.toggle("ag-disabled-group-container",e)}setupTitleBar(){let e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){let e=this.createManagedBean(new C3(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListeners(e,{expandedChanged:(t)=>this.toggleGroupExpand(t.expanded)}),e}createToggleTitleBar(){let e=this.createManagedBean(new ud({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:(t)=>{this.setEnabled(t,!0),this.dispatchEnableChangeEvent(t)}}));return e.addCss("ag-group-title-bar"),e.addCss(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=e,this.toggleGroupExpand(this.enabled),e}},Cd="ag-disabled-group-title-bar";function m3(e){let t=e.cssIdentifier??"default";return{tag:"div",cls:`ag-group-title-bar ag-${t}-group-title-bar ag-unselectable`,role:e.suppressKeyboardNavigation?"presentation":"group",children:[{tag:"span",ref:"eGroupOpenedIcon",cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eGroupClosedIcon",cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eTitle",cls:`ag-group-title ag-${t}-group-title`}]}}var C3=class extends Le{constructor(e={}){super(m3(e));this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=E,this.eGroupClosedIcon=E,this.eTitle=E;let{title:t,suppressOpenCloseIcons:s,suppressKeyboardNavigation:i}=e;if(!!t&&t.length>0)this.title=t;if(s!=null)this.suppressOpenCloseIcons=s;this.suppressKeyboardNavigation=i??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){let e=this.beans.iconSvc;this.eGroupClosedIcon.appendChild(e.createIconNoSpan("accordionClosed")),this.eGroupOpenedIcon.appendChild(e.createIconNoSpan("accordionOpen")),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:(t)=>{switch(t.key){case b.ENTER:case b.SPACE:t.preventDefault(),this.dispatchExpandChanged();break;case b.RIGHT:case b.LEFT:t.preventDefault(),this.dispatchExpandChanged(t.key===b.RIGHT);break}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){if(!this.suppressOpenCloseIcons)De(this.getGui(),e)}refreshOpenCloseIcons(e){let t=!this.suppressOpenCloseIcons;G(this.eGroupOpenedIcon,t&&e),G(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){let t={type:"expandedChanged",expanded:e};this.dispatchLocalEvent(t)}setTitle(e){let t=this.getGui(),s=!!e&&e.length>0;if(e=s?e:void 0,this.eTitle.textContent=e??"",G(t,s),e!==this.title)this.title=e;let i=t.classList.contains(Cd);return this.refreshDisabledStyles(i),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){if(this.suppressOpenCloseIcons=e,e)this.dispatchExpandChanged(!0);return this}refreshDisabledStyles(e){let t=this.getGui();if(e)t.classList.add(Cd),t.removeAttribute("tabindex"),ge(t,"presentation");else if(t.classList.remove(Cd),typeof this.title==="string"&&!this.suppressKeyboardNavigation)this.activateTabIndex([t]),ge(t,"group");else t.removeAttribute("tabindex"),ge(t,"presentation")}};var ie="35.3.1",_e={moduleName:"EnterpriseCore",version:ie,beans:[$f],icons:{accordionOpen:"tree-open",accordionClosed:"tree-closed",accordionIndeterminate:"tree-indeterminate",close:"cross",cancel:"cancel",maximize:"maximize",minimize:"minimize",columnDrag:"grip"},dependsOn:[],setLicenseKey:$f.setLicenseKey};var v3={stopPropagationCallbacks:Bs,focusNextContainer:(e,t)=>pt(e,t),configureFocusableContainer:(e,t)=>{let s=e.ctrlsSvc.get("gridCtrl");s.addFocusableContainer(t),t.addDestroyFunc(()=>s.removeFocusableContainer(t))}},w3=class extends o3{constructor(e){super(e,v3)}getFocusableContainerName(){return"dialog"}};var Bd=class extends Q2{constructor(e){super(Bs,e)}};var b3=class extends e3{};function S3(e){return e.sideBar?.comp.isDisplayed()??!1}function y3(e,t){e.sideBar?.comp.setDisplayed(t)}function x3(e,t){e.sideBar?.comp.setSideBarPosition(t)}function R3(e,t,s){e.sideBar?.comp.openToolPanel(t,"api",s)}function F3(e){e.sideBar?.comp.close("api")}function E3(e){return e.sideBar?.comp.openedItem()??null}function P3(e){e.sideBar?.comp.refresh()}function M3(e){return e.sideBar?.comp.isToolPanelShowing()??!1}function T3(e,t){let s=e.sideBar?.comp.getToolPanelInstance(t);return as(s)}function D3(e){return e.sideBar?.comp.getDef()}var A3=`.ag-tool-panel-wrapper{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-horizontal-size,var(--ag-side-bar-panel-width))}.ag-tool-panel-content{display:flex;height:100%;overflow:hidden auto}.ag-tool-panel-wrapper.ag-tool-panel-animating{
78
- /* !important required to override .ag-hidden to tool panel remains visible while animating */display:block!important;transition:width var(--ag-side-bar-panel-animation-duration) ease-in-out}@media (prefers-reduced-motion:reduce){.ag-tool-panel-wrapper.ag-tool-panel-animating{transition:none}}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);overflow:hidden auto;padding-top:var(--ag-side-button-bar-top-padding);position:relative;scrollbar-width:thin}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative}.ag-side-button:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}:where(.ag-ltr) .ag-side-button:before{left:0}:where(.ag-rtl) .ag-side-button:before{right:0}.ag-side-button:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}.ag-side-button.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color)}.ag-side-button.ag-selected:before{background-color:var(--ag-side-button-selected-underline-color)}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}`,I3={tag:"div",cls:"ag-side-button",role:"presentation",children:[{tag:"button",ref:"eToggleButton",cls:"ag-button ag-side-button-button",role:"tab",attrs:{type:"button",tabindex:"-1","aria-expanded":"false"},children:[{tag:"div",ref:"eIconWrapper",cls:"ag-side-button-icon-wrapper",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eLabel",cls:"ag-side-button-label"}]}]},k3=class extends L{constructor(e){super();this.toolPanelDef=e,this.eToggleButton=E,this.eIconWrapper=E,this.eLabel=E}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(I3,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}setLabel(){let e=this.toolPanelDef,t=this.getLocaleTextFunc()(e.labelKey,e.labelDefault);this.eLabel.textContent=t}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",N(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(e){this.toggleCss("ag-selected",e),De(this.eToggleButton,e)}},L3={tag:"div",cls:"ag-side-buttons",role:"tablist"},G3=class extends L{constructor(){super(L3);this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){if(e.key!==b.TAB||!e.shiftKey)return;if(pt(this.beans,!0)){e.preventDefault();return}Qe(e)}setActiveButton(e){for(let t of this.buttonComps)t.setSelected(e===t.getToolPanelId())}addButtonComp(e){let t=this.createBean(new k3(e));return this.buttonComps.push(t),this.appendChild(t),t.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:e.id})}),t}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),te(this.getGui())}destroy(){this.clearButtons(),super.destroy()}},O3={selector:"AG-SIDE-BAR-BUTTONS",component:G3},Zm={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},Qm={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},B3={id:"filters-new",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agNewFiltersToolPanel"},gr={columns:Zm,filters:Qm,"filters-new":B3};function Dd(e){if(!e)return;if(e===!0)return{toolPanels:[Zm,Qm],defaultToolPanel:"columns"};if(typeof e==="string")return Dd([e]);if(Array.isArray(e)){let t=[];for(let s of e){let i=gr[s];if(!i){F(215,{key:s,defaultByKey:gr});continue}t.push(i)}if(t.length===0)return;return{toolPanels:t,defaultToolPanel:t[0].id}}return{toolPanels:V3(e.toolPanels),defaultToolPanel:e.defaultToolPanel,hiddenByDefault:e.hiddenByDefault,position:e.position,hideButtons:e.hideButtons}}function V3(e){let t=[];if(!e)return t;return e.forEach((s)=>{let i=N3(s);if(!i)return;t.push(i)}),t}function N3(e){if(typeof e!=="string")return e;if(gr[e])return gr[e];return F(215,{key:e,defaultByKey:gr}),null}var _3=class extends L{constructor(){super({tag:"div",cls:"ag-tool-panel-horizontal-resize"});this.minWidth=100,this.maxWidth=null}postConstruct(){let e=this.beans.horizontalResizeSvc.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.inverted=this.gos.get("enableRtl")}dispatchResizeEvent(e,t,s){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:s,started:e,ended:t})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(e){return this.onResizing(e,!0)}onResizing(e,t=!1){let s=this.inverted?-1:1,i=Math.max(this.minWidth,Math.floor(this.startingWidth-e*s));if(this.maxWidth!=null)i=Math.min(this.maxWidth,i);this.elementToResize.style.setProperty("--ag-horizontal-size",`${i}px`),this.dispatchResizeEvent(!1,t,i)}};function H3(e,t,s){return e.getCompDetails(t,z3,void 0,s,!0)}var z3={name:"toolPanel",optionalMethods:["refresh","getState"]},W3={tag:"div",cls:"ag-tool-panel-wrapper",role:"tabpanel",children:[{tag:"div",cls:"ag-tool-panel-content",ref:"eContent"}]},U3=class extends L{constructor(){super(W3);this.eContent=E,this.animationId=0,this.defParent=null}postConstruct(){let e=this.getGui(),t=this.resizeBar=this.createManagedBean(new _3);e.setAttribute("id",`ag-${this.getCompId()}`),t.elementToResize=e,this.appendChild(t)}getToolPanelId(){return this.toolPanelId}getDefParent(){return this.defParent}setDefParent(e){this.defParent=e}setToolPanelDef(e,t){let{id:s,minWidth:i,maxWidth:o,width:r,parent:n}=e;if(this.toolPanelId=s,this.defParent=n??null,r)this.getGui().style.setProperty("--ag-side-bar-panel-width",`${r}px`);let a=H3(this.beans.userCompFactory,e,t);if(a==null)return!1;let l=a.newAgStackInstance();this.params=a.params,l.then(this.setToolPanelComponent.bind(this));let c=this.resizeBar;if(i!=null)c.minWidth=i;if(o!=null)c.maxWidth=o;return!0}setToolPanelComponent(e){this.toolPanelCompInstance=e;let{eContent:t}=this;t.appendChild(e.getGui()),this.addDestroyFunc(()=>{this.destroyBean(e)})}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(e){let t=this.gos.get("enableRtl"),s=e==="left",i=t?s:!s;this.resizeBar.inverted=i}refresh(){this.toolPanelCompInstance?.refresh(this.params)}animateDisplayed(e){if(this.isDisplayed()===e)return;let t=++this.animationId,{eContent:s}=this,i=()=>{if(this.animationId===t)o.classList.remove("ag-tool-panel-animating"),s.style.width="",o.style.width=""},o=this.getGui(),r=o.offsetWidth;this.setDisplayed(e),o.classList.add("ag-tool-panel-animating");let n=getComputedStyle(o).transitionDuration;if(!parseFloat(n)){i();return}o.style.transition="none",o.style.width="",s.style.width=`${s.offsetWidth}px`,o.style.width=`${r}px`;let a=o.offsetWidth;o.style.transition="",o.style.width=e?"":"0";let l=setTimeout(i,100);o.addEventListener("transitionstart",()=>clearTimeout(l),{once:!0}),o.addEventListener("transitionend",i,{once:!0})}},K3={tag:"div",cls:"ag-side-bar ag-unselectable",children:[{tag:"ag-side-bar-buttons",ref:"sideBarButtons"}]},$3=class extends L{constructor(){super(K3,[O3]);this.sideBarButtons=E,this.toolPanelWrappers=[],this.registerCSS(A3)}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));let{beans:e,gos:t}=this,{sideBar:s}=t.get("initialState")??{};this.setSideBarDef({sideBarDef:Dd(t.get("sideBar")),sideBarState:s}),this.addManagedPropertyListener("sideBar",()=>this.setState()),e.sideBar.comp=this;let i=this.getFocusableElement();this.createManagedBean(new ls(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),Ns(e,this,i),this.addManagedPropertyListener("enableAdvancedFilter",this.onAdvancedFilterChanged.bind(this))}getFocusableContainerName(){return"sideBar"}onTabKeyDown(e){if(e.defaultPrevented)return;let{beans:t,sideBarButtons:s}=this,i=this.getGui(),o=s.getGui(),r=j(t),n=i.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),{target:a,shiftKey:l}=e;if(!n){if(pt(t,l,!0))return e.preventDefault(),!0;return Ng(e),!1}if(o.contains(r)){if(pe(n,l))e.preventDefault();return}if(!l)return;let c=null;if(n.contains(r))c=Ie(t,n,void 0,!0);else if(Xm(n,a))c=Td(n,a);if(!c)c=o.querySelector(".ag-selected button"),c=ve(c)?c:null;if(c&&c!==e.target)e.preventDefault(),c.focus()}handleKeyDown(e){let t=j(this.beans),s=this.sideBarButtons;if(!s.getGui().contains(t))return;let i=s.getGui(),o=Array.prototype.slice.call(i.querySelectorAll(".ag-side-button")),r=o.findIndex((l)=>l.contains(t)),n=null;switch(e.key){case b.LEFT:case b.UP:n=Math.max(0,r-1);break;case b.RIGHT:case b.DOWN:n=Math.min(r+1,o.length-1);break}if(n===null)return;let a=o[n].querySelector("button");if(a)a.focus(),e.preventDefault()}onToolPanelButtonClicked(e){let t=e.toolPanelId;if(this.openedItem()===t)this.openToolPanel(void 0,"sideBarButtonClicked");else this.openToolPanel(t,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:e,sideBarState:t,existingToolPanelWrappers:s}){if(this.setDisplayed(!1),this.sideBar=e,e)this.sideBarButtons.setDisplayed(!e.hideButtons);if(e?.toolPanels){let i=e.toolPanels;if(this.createToolPanelsAndSideButtons(i,t,s),!this.toolPanelWrappers.length)return;let o=t?t.visible:!e.hiddenByDefault;if(this.setDisplayed(o),this.setSideBarPosition(t?t.position:e.position),o)if(t){let{openToolPanel:r}=t;if(r)this.openToolPanel(r,"sideBarInitializing")}else this.openToolPanel(e.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(e){if(!e)e="right";this.position=e;let t=e==="left",s=t?"right":"left";this.toggleCss("ag-side-bar-left",t),this.toggleCss("ag-side-bar-right",!t);for(let i of this.toolPanelWrappers)i.setResizerSizerSide(s);return this.dispatchSideBarUpdated(),this}setDisplayed(e,t){super.setDisplayed(e,t),this.dispatchSideBarUpdated()}getState(){let e={};for(let t of this.toolPanelWrappers)e[t.getToolPanelId()]=t.getToolPanelInstance()?.getState?.();return{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}}createToolPanelsAndSideButtons(e,t,s){for(let i of e)this.createToolPanelAndSideButton(i,t?.toolPanels?.[i.id],s?.[i.id])}validateDef(e){let{id:t,toolPanel:s}=e;if(t==null)return F(212),!1;if(sm(s)){if(this.beans.filterManager?.isAdvFilterEnabled())return F(213),!1}return!0}createToolPanelAndSideButton(e,t,s){if(!this.validateDef(e)){this.destroyBean(s);return}let i;if(s)i=s,i.setDefParent(e.parent??null);else if(i=this.createBean(new U3),!i.setToolPanelDef(e,I(this.gos,{initialState:t,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;i.setDisplayed(!1),this.renderToolPanelUnderParent(i,e.parent),this.toolPanelWrappers.push(i);let o=this.sideBarButtons.addButtonComp(e);Nl(o.eToggleButton,i.getGui())}refresh(){for(let e of this.toolPanelWrappers)e.refresh()}renderToolPanelUnderParent(e,t){let s=e.getGui();if(t)this.beans.environment.applyThemeClasses(t,["ag-external","ag-tool-panel-external"]),s.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");let i=t??e.getDefParent()??this.getGui();if(s.parentElement!==i)i.appendChild(s)}getWrapper(e){return this.toolPanelWrappers.find((t)=>t.getToolPanelId()===e)}openToolPanel(e,t="api",s){let i=this.openedItem(),r=!!e&&!!i||t==="sideBarInitializing";for(let l of this.toolPanelWrappers){let c=e===l.getToolPanelId();if(c)this.renderToolPanelUnderParent(l,s??null);if(r)l.setDisplayed(c);else l.animateDisplayed(c)}let n=this.openedItem();if(i!==n)this.sideBarButtons.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,i??void 0,t)}getToolPanelInstance(e){let t=this.getWrapper(e);if(!t){F(214,{key:e});return}return t.getToolPanelInstance()}raiseToolPanelVisibleEvent(e,t,s){let i=!!e&&!!t,o=this.eventSvc;if(t)o.dispatchEvent({type:"toolPanelVisibleChanged",source:s,key:t,visible:!1,switchingToolPanel:i});if(e)o.dispatchEvent({type:"toolPanelVisibleChanged",source:s,key:e,visible:!0,switchingToolPanel:i})}close(e="api"){this.openToolPanel(void 0,e)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let e=null;for(let t of this.toolPanelWrappers)if(t.isDisplayed())e=t.getToolPanelId();return e}setState(e){let t=Dd(this.gos.get("sideBar")),s={};if(t&&this.sideBar)t.toolPanels?.forEach((i)=>{let{id:o}=i;if(!o)return;let r=this.sideBar.toolPanels?.find((c)=>c.id===o);if(!r||i.toolPanel!==r.toolPanel)return;let n=this.getWrapper(o);if(!n)return;let a=I(this.gos,{...i.toolPanelParams??{},initialState:e?.toolPanels?.[o],onStateUpdated:()=>this.dispatchSideBarUpdated()});if(n.getToolPanelInstance()?.refresh(a)!==!0)return;this.toolPanelWrappers=this.toolPanelWrappers.filter((c)=>c!==n),Me(n.getGui()),s[o]=n});this.clearDownUi(),this.setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:s})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){for(let e of this.toolPanelWrappers)Me(e.getGui()),this.destroyBean(e);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){if(this.sideBar?.toolPanels?.some((t)=>sm(typeof t==="string"?t:t.toolPanel)))this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}};function sm(e){return e==="agFiltersToolPanel"||e==="agNewFiltersToolPanel"}var j3={selector:"AG-SIDE-BAR",component:$3},q3=class extends y{constructor(){super(...arguments);this.beanName="sideBar"}getSelector(){return j3}},Vd={moduleName:"SideBar",version:ie,beans:[q3],apiFunctions:{isSideBarVisible:S3,setSideBarVisible:y3,setSideBarPosition:x3,openToolPanel:R3,closeToolPanel:F3,getOpenedToolPanel:E3,refreshToolPanel:P3,isToolPanelShowing:M3,getToolPanelInstance:T3,getSideBar:D3},dependsOn:[_e,Tc]},Y3='.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}',Jm=class extends d3{constructor(){super({warnNoIcon:()=>F(227)})}},Nd={moduleName:"MenuItem",version:ie,userComponents:{agMenuItem:Jm},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:[Y3]},X3=".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{flex:none;height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding)}.ag-column-select-column,.ag-column-select-column-group,.ag-column-select-header{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);position:relative}.ag-column-select-column,.ag-column-select-column-group{height:100%}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-column-group:where(:not(:last-child)),.ag-column-select-column:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}",Z3=300,Q3={tag:"div",cls:"ag-column-select-header",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-column-select-header-icon"},{tag:"ag-checkbox",ref:"eSelect",cls:"ag-column-select-header-checkbox"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-column-select-header-filter-wrapper"}]},J3=class extends L{constructor(){super(Q3,[wt,us]);this.eExpand=E,this.eSelect=E,this.eFilterTextField=E}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:(t)=>{if(t.key===b.SPACE)t.preventDefault(),this.onExpandClicked()}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});let e=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){let e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.toggleCss("ag-column-select-column-readonly",e)}init(e){this.params=e;let t=this.gos.get("functionsReadOnly");if(this.eSelect.setReadOnly(t),this.eSelect.toggleCss("ag-column-select-column-readonly",t),this.beans.colModel.ready)this.showOrHideOptions()}createExpandIcons(){let e=this.beans;this.eExpand.appendChild(this.eExpandChecked=N("columnSelectOpen",e)),this.eExpand.appendChild(this.eExpandUnchecked=N("columnSelectClosed",e)),this.eExpand.appendChild(this.eExpandIndeterminate=N("columnSelectIndeterminate",e)),this.setExpandState(0)}showOrHideOptions(){let e=this.params,t=!e.suppressColumnFilter,s=!e.suppressColumnSelectAll,i=!e.suppressColumnExpandAll,o=!!this.beans.colModel.colDefCols?.treeDepth,r=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(r("searchOoo","Search...")),G(this.eFilterTextField.getGui(),t),G(this.eSelect.getGui(),s),G(this.eExpand,i&&o)}onFilterTextChanged(){if(!this.onFilterTextChangedDebounced)this.onFilterTextChangedDebounced=$e(this,()=>{let e=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:e})},Z3);this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:this.expandState===0?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,G(this.eExpandChecked,e===0),G(this.eExpandUnchecked,e===1),G(this.eExpandIndeterminate,e===2)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}},ek={selector:"AG-PRIMARY-COLS-HEADER",component:J3};function co(e){return!!e&&typeof e.children<"u"}function Us(e){return co(e)?e.groupId:e.colId}function eC(e,t,s){let i=(n,a)=>{let c=n.children.map(Us).includes(Us(a)),d=k(n.children),u=d&&Us(d)!==Us(a);return c&&u};if(!co(e))return!0;let o=e,r=s;if(i(o,r))return o.children.push(r),!0;if(o.groupId===t){if(!o.children.map(Us).includes(Us(r)))return o.children.push(r),!0}for(let n=o.children.length-1;n>=0;n--)if(eC(o.children[n],t,s))break;return!1}function tC(e){let t=(o,r)=>co(o)&&co(r)&&Us(o)===Us(r),s=(o,r)=>{if(!co(r))return o;let n=o,a=r;if(a.children&&a.groupId){if(eC(n,a.groupId,a.children[0]))return n}for(let l of a.children)s(n,l);return n},i=[];for(let o=1;o<=e.length;o++){let r=e[o-1],n=e[o];if(t(r,n))e[o]=s(r,n);else i.push(r)}return i}function tk(e,t){let s=[],i=(r,n)=>{if(co(r)){let a=r,l=typeof a.groupId<"u"?a.groupId:a.headerName,c=new ii(a,l,!1,n),d=[];for(let u of a.children){let h=i(u,n+1);if(h)d.push(h)}return c.setChildren(d),c}else{let a=r,l=a.colId?a.colId:a.field,c=e.getColDefCol(l);if(!c)s.push(a);return c}},o=[];for(let r of t){let n=i(r,0);if(n)o.push(n)}if(s.length>0)F(217,{invalidColIds:s});return o}function sk(e,t){let s=sC(ok(e)),i=tC(s);t(i)}function ik(e,t){let s=sC(e),i=tC(s);t(i)}function sC(e){let t=(s,i)=>{let o;if(ue(s))if(s.isPadding())o=i;else{let n=Object.assign({},s.getColGroupDef());n.groupId=s.getGroupId(),n.children=[i],o=n}else{let n=Object.assign({},s.colDef);n.colId=s.colId,o=n}let r=s.getOriginalParent();if(r)return t(r,o);else return o};return e.map((s)=>t(s,s.colDef))}function ok(e){return e.getCols().filter((t)=>t.primary&&!t.colDef.showRowGroup)}var im=class{constructor(e,t,s,i=!1,o){if(this.displayName=e,this.depth=s,this.group=i,this.localEventService=new Dt,i)this.columnGroup=t,this._expanded=o,this.children=[];else this.column=t}get expanded(){return!!this._expanded}set expanded(e){if(e===this._expanded)return;this._expanded=e,this.localEventService.dispatchEvent({type:"expandedChanged"})}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};function K(e){return!!e?.buttons?.includes("apply")}function ze(e,t){if(!K(t))return;let s=e.sideBar?.comp.openedItem();if(!s)return;e.sideBar?.comp.getToolPanelInstance(s)?.refreshDeferredUi()}function iC(e,t,s,i,o){let r=rk(t);oC(e,r,s,i,o)}function oC(e,t,s,i,o){if(e.columnStateUpdateStrategy.getPivotMode(K(o)))ak(e,t,s,i,o);else nk(e,t,s,i,o)}function rk(e){let t=[],s=(i)=>{for(let o of i){if(!o.passesFilter)continue;if(o.group)s(o.children);else t.push(o.column)}};return s(e),t}function nk(e,t,s,i,o){let r=e.columnStateUpdateStrategy,n=[];for(let a of t){if(a.colDef.lockVisible)continue;if(r.isColumnVisibleInToolPanel(K(o),a)!==s)n.push({colId:a.getId(),hide:!s})}r.applyColumnState(K(o),n,i),ze(e,o)}function ak(e,t,s,i,o){lk(e,t,s,i,o)}function lk(e,t,s,i,o){let r=e.columnStateUpdateStrategy,n=[],c=s?(d)=>{if(r.isColumnSelectedInPivotModeToolPanel(K(o),d))return;if(d.isAllowValue()){let u=typeof d.getAggFunc()==="string"?d.getAggFunc():e.aggFuncSvc?.getDefaultAggFunc(d);n.push({colId:d.getId(),aggFunc:u})}else if(d.isAllowRowGroup())n.push({colId:d.getId(),rowGroup:!0});else if(d.isAllowPivot())n.push({colId:d.getId(),pivot:!0})}:(d)=>{if(r.isColumnSelectedInPivotModeToolPanel(K(o),d))n.push({colId:d.getId(),pivot:!1,rowGroup:!1,aggFunc:null})};t.forEach(c),r.applyColumnState(K(o),n,i),ze(e,o)}function rC(e,t){let{columns:s,visibleState:i,pivotState:o,eventType:r}=t,n=e.columnStateUpdateStrategy,a=n.getPivotMode(K(t)),l=s.map((c)=>{let d=c.colId;if(a){let u=o?.[d];return{colId:d,pivot:u?.pivot,rowGroup:u?.rowGroup,aggFunc:u?.aggFunc}}else return{colId:d,hide:!i?.[d]}});n.applyColumnState(K(t),l,r),ze(e,t)}function ck(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}function nC(e,t,s){if(!s)return ck(e);let i=t.getRowGroupColumns(s).includes(e),o=t.getPivotColumns(s).includes(e),r=t.getValueColumns(s).includes(e);return{pivot:o,rowGroup:i,aggFunc:r?t.getColumnAggFunc(s,e):void 0}}var aC=(e,t)=>{if(!t)return[];let s=e;for(let i=0,o=t.length;i<o&&s;++i)s=s[t[i]];return Array.isArray(s)?s:[]},lo=(e,t,s)=>{let i=e.aggData;if(i===t)return;if(e.aggData=t,e.__localEventService)dk(e,i,t,s)},om=(e,t,s)=>{lo(e,t,s);let i=e.pinnedSibling;if(i)lo(i,t,s);let o=e.sibling;if(o){lo(o,t,s);let r=o.pinnedSibling;if(r)lo(r,t,s)}},dk=(e,t,s,i)=>{if(!s){if(!t)return;let n=Object.keys(t);for(let a=0,l=n.length;a<l;++a){let c=n[a],d=i.getColById(c);if(d)e.dispatchCellChangedEvent(d,void 0,t[c])}return}let o=Object.keys(s);for(let n=0,a=o.length;n<a;++n){let l=o[n],c=s[l],d=t?t[l]:void 0;if(c===d)continue;let u=i.getColById(l);if(u)e.dispatchCellChangedEvent(u,c,d)}if(!t)return;let r=Object.keys(t);for(let n=0,a=r.length;n<a;++n){let l=r[n];if(l in s)continue;let c=i.getColById(l);if(c)e.dispatchCellChangedEvent(c,void 0,t[l])}};var rm=(e,t,s)=>{if(!e)return;let i=e.group;if(i===s)return;if(e.group=s,e.updateHasChildren(),i&&!s)lo(e,null,t.colModel),e.setAllChildrenCount(null);t.selectionSvc?.updateRowSelectable(e),e.dispatchRowEvent("groupChanged")},lC=(e,t,s)=>{rm(e,t,s),rm(e.pinnedSibling,t,s)},Cr=(e,t)=>{let{gos:s,rowGroupColsSvc:i}=t;if(!i||!e)return!1;let o=s.get("groupLockGroupColumns");if(!e.isRowGroupActive()||o===0)return!1;if(o===-1)return!0;let r=i.columns.findIndex((n)=>n.colId===e.colId);return o>r},pr=(e,t,s)=>{let o=e(t,`${t==="groupBy"?"Group by":"Un-Group by"} ${s}`,[s]);if(o.indexOf(s)>=0)return o;else return`${o} ${s}`};function uk(e){let t=Ue(e),s="getSelection"in t?t.getSelection():null,i=[];for(let o=0;o<(s?.rangeCount??0);o++){let r=s?.getRangeAt(o);if(r)i.push(r)}return{selection:s,ranges:i}}function hk(e,t){if(!e.gos.get("enableCellTextSelection"))return t();if(!li()&&!Os())return t();let{selection:i,ranges:o}=uk(e);t(),i?.removeAllRanges();for(let r of o)i?.addRange(r)}var gk={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},_d={getMenuItemComp:(e,t,s)=>e.userCompFactory.getCompDetails(t,gk,"agMenuItem",I(e.gos,s),!0)?.newAgStackInstance()??B.resolve(),getPostProcessPopupParams:({column:e,node:t})=>({column:e,rowNode:t}),preserveRangesWhile:hk,stopPropagationCallbacks:Bs,warnNoItem:(e)=>{F(228,{menuItemOrString:e})}},pk=class extends Md{constructor(){super(_d)}},Hd=class extends Od{constructor(e,t={column:null,node:null,value:null}){super(e,t,_d)}},cC=class extends L{constructor(e,t,s,i={}){super({tag:"div",cls:"ag-menu"});this.column=e,this.mouseEventOrTouch=t,this.parentEl=s,this.params=i,this.displayName=null}postConstruct(){let{column:e,beans:{colNames:t}}=this;this.initializeProperties(e);let s;if(ht(e))s=t.getDisplayNameForColumn(e,"columnToolPanel");else s=t.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel");if(this.displayName=s,this.buildMenuItemMap(),this.isActive()){let i=this.mouseEventOrTouch;if("preventDefault"in i)i.preventDefault();let o=this.getMappedMenuItems();if(o.length===0)return;this.displayContextMenu(o)}}initializeProperties(e){let t=this.beans.columnStateUpdateStrategy,s;if(ue(e))s=e.getLeafColumns();else s=[e];this.columns=s;let i=t.getPivotMode(K(this.params));this.allowScrollIntoView=!i&&s.some(this.isColumnValidForScrollIntoView),this.allowGrouping=s.some((o)=>o.primary&&o.isAllowRowGroup()),this.allowValues=s.some((o)=>o.primary&&o.isAllowValue()),this.allowPivoting=i&&s.some((o)=>o.isPrimary()&&o.isAllowPivot())}buildMenuItemMap(){let e=this.getLocaleTextFunc(),{beans:t,displayName:s}=this,i=this.beans.columnStateUpdateStrategy,o=new Map;this.menuItemMap=o;let r=K(this.params),n=i.getPivotMode(r),a=new Set(i.getRowGroupColumns(r).map((g)=>g.colId)),l=new Set(i.getValueColumns(r).map((g)=>g.colId)),c=new Set(i.getPivotColumns(r).map((g)=>g.colId));o.set("scrollIntoView",{allowedFunction:(g)=>!g.isPinned()&&!n&&this.isColumnValidForScrollIntoView(g),activeFunction:()=>!1,activateLabel:()=>e("scrollColumnIntoView",`Scroll ${s} into View`,[s]),activateFunction:()=>{let g=this.columns.find(this.isColumnValidForScrollIntoView);if(g)this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(g)},deActivateFunction:()=>{},addIcon:"ensureColumnVisible"});let d=(g)=>g.primary&&g.isAllowRowGroup()&&!Cr(g,t);o.set("rowGroup",{allowedFunction:d,activeFunction:(g)=>a.has(g.colId),activateLabel:()=>pr(e,"groupBy",s),deactivateLabel:()=>pr(e,"ungroupBy",s),activateFunction:()=>{let g=this.addColumnsToList(i.getRowGroupColumns(r),d);i.setRowGroupColumns(r,g,"toolPanelUi"),ze(this.beans,this.params)},deActivateFunction:()=>{let g=this.removeColumnsFromList(i.getRowGroupColumns(r),d);i.setRowGroupColumns(r,g,"toolPanelUi"),ze(this.beans,this.params)},addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"});let u=(g)=>g.primary&&g.isAllowValue();o.set("value",{allowedFunction:u,activeFunction:(g)=>l.has(g.colId),activateLabel:()=>e("addToValues",`Add ${s} to values`,[s]),deactivateLabel:()=>e("removeFromValues",`Remove ${s} from values`,[s]),activateFunction:()=>{let g=this.addColumnsToList(i.getValueColumns(r),u);i.setValueColumns(r,g,"toolPanelUi"),ze(this.beans,this.params)},deActivateFunction:()=>{let g=this.removeColumnsFromList(i.getValueColumns(r),u);i.setValueColumns(r,g,"toolPanelUi"),ze(this.beans,this.params)},addIcon:"valuePanel",removeIcon:"valuePanel"});let h=(g)=>n&&g.primary&&g.isAllowPivot();o.set("pivot",{allowedFunction:h,activeFunction:(g)=>c.has(g.colId),activateLabel:()=>e("addToLabels",`Add ${s} to labels`,[s]),deactivateLabel:()=>e("removeFromLabels",`Remove ${s} from labels`,[s]),activateFunction:()=>{let g=this.addColumnsToList(i.getPivotColumns(r),h);i.setPivotColumns(r,g,"toolPanelUi"),ze(this.beans,this.params)},deActivateFunction:()=>{let g=this.removeColumnsFromList(i.getPivotColumns(r),h);i.setPivotColumns(r,g,"toolPanelUi"),ze(this.beans,this.params)},addIcon:"pivotPanel",removeIcon:"pivotPanel"})}isColumnValidForScrollIntoView(e){if(!e.isVisible())return!1;let s=e.getParent();if(!s)return!0;return s.getDisplayedChildren()?.includes(e)??!0}addColumnsToList(e,t){return[...e].concat(this.columns.filter((s)=>t(s)&&!e.includes(s)))}removeColumnsFromList(e,t){return e.filter((s)=>!t(s)||!this.columns.includes(s))}displayContextMenu(e){let t=this.getGui(),s=this.createBean(new Hd),i=this.getLocaleTextFunc(),o=()=>{};t.appendChild(s.getGui()),s.addMenuItems(e),s.addManagedListeners(s,{closeMenu:()=>{this.parentEl.focus(),o()}});let r=this.beans.popupSvc,n=r.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>pe(s.getGui()),ariaLabel:i("ariaLabelContextMenu","Context Menu"),closedCallback:(a)=>{if(a instanceof KeyboardEvent)this.parentEl.focus();this.destroyBean(s)}});if(n)o=n.hideFunc;r.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEventOrTouch,ePopup:t})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){let e=[],{menuItemMap:t,columns:s,displayName:i,beans:o}=this;for(let r of t.values()){let n=s.some((l)=>r.allowedFunction(l)&&!r.activeFunction(l)),a=s.some((l)=>r.allowedFunction(l)&&r.activeFunction(l));if(n)e.push({name:r.activateLabel(i),icon:N(r.addIcon,o,null),action:()=>r.activateFunction()});if(a&&r.removeIcon&&r.deactivateLabel)e.push({name:r.deactivateLabel(i),icon:N(r.removeIcon,o,null),action:()=>r.deActivateFunction?.()})}return e}},fk={tag:"div",cls:"ag-column-select-column-group",children:[{tag:"span",ref:"eColumnGroupIcons",cls:"ag-column-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-column-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-column-group-opened-icon"}]},{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},dC=class extends L{constructor(e,t,s,i,o){super();this.modelItem=e,this.allowDragging=t,this.eventType=s,this.focusWrapper=i,this.params=o,this.cbSelect=E,this.eLabel=E,this.eGroupOpenedIcon=E,this.eGroupClosedIcon=E,this.eColumnGroupIcons=E,this.processingColumnStateChange=!1;let{columnGroup:r,depth:n,displayName:a}=e;this.columnGroup=r,this.columnDepth=n,this.displayName=a}postConstruct(){this.setTemplate(fk,[wt]);let{beans:e,cbSelect:t,eLabel:s,displayName:i,columnDepth:o,modelItem:r,focusWrapper:n,columnGroup:a}=this,{registry:l,gos:c}=e,d=N("columnDrag",e);this.eDragHandle=d,d.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");let u=t.getGui(),h=t.getInputElement();u.after(d),h.setAttribute("tabindex","-1"),s.textContent=i??"",this.setupExpandContract(),this.addCss("ag-column-select-indent-"+o),this.getGui().style.setProperty("--ag-indentation-level",String(o)),this.tooltipFeature=this.createOptionalManagedBean(l.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:so(c,()=>s)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(s,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(r,{expandedChanged:this.onExpandChanged.bind(this)});let g=new Ke(this.getGui(),!1);this.addManagedListeners(g,{longTap:(f)=>this.onContextMenu(f.touchStart)}),this.addDestroyFunc(g.destroy.bind(g)),this.addManagedListeners(n,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip();let p=On(a.getColGroupDef(),c,null,a);for(let f of p)this.toggleCss(f,!0)}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){let e=this.columnGroup.getColGroupDef();if(!e)return;let t=()=>this.tooltipFeature?.setTooltipAndRefresh(e.headerTooltip);t(),this.addManagedEventListeners({newColumnsLoaded:t})}handleKeyDown(e){switch(e.key){case b.LEFT:e.preventDefault(),this.modelItem.expanded=!1;break;case b.RIGHT:e.preventDefault(),this.modelItem.expanded=!0;break;case b.SPACE:if(e.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected());break}}onContextMenu(e){let{columnGroup:t,gos:s}=this;if(s.get("functionsReadOnly"))return;let i=this.createBean(new cC(t,e,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(i.isAlive())this.destroyBean(i)})}addVisibilityListenersToAllChildren(){let e=this.onColumnStateChanged.bind(this);for(let t of this.columnGroup.getLeafColumns())this.addManagedListeners(t,{visibleChanged:e,columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e})}setupDragging(){if(!this.allowDragging){G(this.eDragHandle,!1);return}let e=this.beans,{gos:t,eventSvc:s,dragAndDrop:i}=e,o=!t.get("suppressDragLeaveHidesColumns"),r={type:vt.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>o?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{o=!t.get("suppressDragLeaveHidesColumns"),s.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{s.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(n)=>{if(o)rC(e,{columns:this.columnGroup.getLeafColumns(),visibleState:n?.visibleState,pivotState:n?.pivotState,eventType:this.eventType,buttons:this.params.buttons})},onGridExit:()=>{if(o)this.onChangeCommon(!1)}};i.addDragSource(r,!0),this.addDestroyFunc(()=>i.removeDragSource(r))}createDragItem(){let e=this.columnGroup.getLeafColumns(),t={},s={},i=this.beans.columnStateUpdateStrategy,o=K(this.params);for(let r of e){let n=r.getId();t[n]=r.isVisible(),s[n]=nC(r,i,o)}return{columns:e,visibleState:t,pivotState:s}}setupExpandContract(){let{beans:e,eGroupClosedIcon:t,eGroupOpenedIcon:s,eColumnGroupIcons:i}=this;t.appendChild(_s("columnSelectClosed",e,null)),s.appendChild(_s("columnSelectOpen",e,null));let o=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(t,{click:o}),this.addManagedElementListeners(s,{click:o});let r=new Ke(i,!0);this.addManagedListeners(r,{tap:o}),this.addDestroyFunc(r.destroy.bind(r))}onLabelClicked(){let e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){let e=[],t=(s)=>{for(let i of s)if(i.passesFilter)if(i.group)t(i.children);else e.push(i.column)};return t(this.modelItem.children),e}onChangeCommon(e){if(this.refreshAriaLabel(),this.processingColumnStateChange)return;iC(this.beans,this.modelItem.children,e,this.eventType,this.params)}refreshAriaLabel(){let{cbSelect:e,focusWrapper:t,displayName:s}=this,i=this.getLocaleTextFunc(),o=i("ariaColumnGroup","Column Group"),r=e.getValue(),n=r===void 0?i("ariaIndeterminate","indeterminate"):r?i("ariaVisible","visible"):i("ariaHidden","hidden"),a=i("ariaToggleVisibility","Press SPACE to toggle visibility");fe(t,`${s} ${o}`),e.setInputAriaLabel(`${a} (${n})`),Xi(t,e.getInputElement().id)}onColumnStateChanged(){let e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;let s=this.cbSelect;s.setValue(e),s.setReadOnly(t),this.toggleCss("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1}workOutSelectedValue(){let t=this.beans.columnStateUpdateStrategy.getPivotMode(K(this.params)),s=this.getVisibleLeafColumns(),i=0,o=0;for(let r of s)if(t||!r.colDef.lockVisible)if(this.isColumnChecked(r))i++;else o++;if(i>0&&o>0)return;return i>0}workOutReadOnlyValue(){let e=this.beans.columnStateUpdateStrategy.getPivotMode(K(this.params)),t=0;for(let s of this.columnGroup.getLeafColumns())if(e){if(s.isAnyFunctionAllowed())t++}else if(!s.colDef.lockVisible)t++;return t===0}isColumnChecked(e){let t=this.beans.columnStateUpdateStrategy;if(t.getPivotMode(K(this.params)))return t.isColumnSelectedInPivotModeToolPanel(K(this.params),e);return t.isColumnVisibleInToolPanel(K(this.params),e)}onExpandOrContractClicked(){let e=this.modelItem,t=e.expanded;e.expanded=!t}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){let e=this.modelItem.expanded;G(this.eGroupClosedIcon,!e),G(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){De(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(e){let t=this.cbSelect,s=t.getValue();if(!t.isReadOnly()&&(e&&!s||!e&&s))t.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}},vd=(e)=>{if(ue(e))return e.getLeafColumns();return e?[e]:[]},mk=(e,t,s,i)=>{if(!t||!e)return null;let o=i.indexOf(t),r=s?o:o+1,n=Ck(i,e,r);return r-n},Ck=(e,t,s)=>{if(!t)return 0;let i=t[0],o=t.length;if(e.indexOf(i)<s)return o;return 0},nm=(e,t,s,i)=>{let o=K(i);if(e.get("suppressMovableColumns")||t.columnStateUpdateStrategy.getPivotMode(o))return!0;return!!s.find(({colDef:a})=>!!a.suppressMovable||!!a.lockPosition)},am=(e,t,s,i)=>{if(!s)return;let{component:o}=s,r=null,n=s.position==="top";if(o instanceof dC)r=o.getColumns()[0],n=!0;else if(o)r=o.column;if(!r)return;let a=K(i),l=a?e.columnStateUpdateStrategy.getPrimaryColumns(a):e.colModel.getCols(),c=mk(t,r,n,l);if(c!=null)e.columnStateUpdateStrategy.moveColumns(a,t,c,"toolPanelUi"),ze(e,i)},vk=(e)=>e.column,wk={tag:"div",cls:"ag-column-select-column",children:[{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},bk=class extends L{constructor(e,t,s,i,o){super();this.modelItem=e,this.allowDragging=t,this.groupsExist=s,this.focusWrapper=i,this.params=o,this.eLabel=E,this.cbSelect=E,this.processingColumnStateChange=!1;let{column:r,depth:n,displayName:a}=e;this.column=r,this.columnDepth=n,this.displayName=a}postConstruct(){this.setTemplate(wk,[wt]);let{beans:e,cbSelect:t,displayName:s,eLabel:i,columnDepth:o,groupsExist:r,column:n,gos:a,focusWrapper:l}=this,c=N("columnDrag",e);this.eDragHandle=c,c.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");let d=t.getGui(),u=t.getInputElement();if(d.after(c),u.setAttribute("tabindex","-1"),i.textContent=s,r)this.addCss("ag-column-select-add-group-indent");this.addCss(`ag-column-select-indent-${o}`),this.getGui().style.setProperty("--ag-indentation-level",String(o)),this.tooltipFeature=this.createOptionalManagedBean(e.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumn",shouldDisplayTooltip:so(a,()=>i),getAdditionalParams:()=>({colDef:n.colDef})})),this.setupDragging();let h=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:h}),this.addManagedListeners(n,{columnValueChanged:h,columnPivotChanged:h,columnRowGroupChanged:h,visibleChanged:h}),this.addManagedListeners(l,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});let g=new Ke(l);this.addManagedListeners(g,{longTap:(f)=>this.onContextMenu(f.touchStart)}),this.addDestroyFunc(g.destroy.bind(g)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(i,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();let p=On(n.colDef,a,n,null);for(let f of p)this.toggleCss(f,!0)}getColumn(){return this.column}setupTooltip(){let e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.colDef.headerTooltip);e(),this.addManagedEventListeners({newColumnsLoaded:e})}onContextMenu(e){let{column:t,gos:s}=this;if(s.get("functionsReadOnly"))return;let i=this.createBean(new cC(t,e,this.focusWrapper,this.params));this.addDestroyFunc(()=>{if(i.isAlive())this.destroyBean(i)})}handleKeyDown(e){if(e.key===b.SPACE){if(e.preventDefault(),this.isSelectable())this.onSelectAllChanged(!this.isSelected())}}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;let e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){if(this.cbSelect.isReadOnly())return;if(this.refreshAriaLabel(),this.processingColumnStateChange)return;oC(this.beans,[this.column],e,"toolPanelUi",this.params)}refreshAriaLabel(){let{cbSelect:e,focusWrapper:t,displayName:s}=this,i=this.getLocaleTextFunc(),o=i("ariaColumn","Column"),r=e.getValue()?i("ariaVisible","visible"):i("ariaHidden","hidden"),n=i("ariaToggleVisibility","Press SPACE to toggle visibility");fe(t,`${s} ${o}`),this.cbSelect.setInputAriaLabel(`${n} (${r})`),Xi(t,e.getInputElement().id)}setupDragging(){let e=this.eDragHandle;if(!this.allowDragging){G(e,!1);return}let t=this.beans,{gos:s,eventSvc:i,dragAndDrop:o}=t;if(K(this.params))e.setAttribute("data-column-tool-panel-deferred","");let r=!s.get("suppressDragLeaveHidesColumns"),n={type:vt.ToolPanel,eElement:e,dragItemName:this.displayName,getDefaultIconName:()=>r&&!K(this.params)?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{r=!s.get("suppressDragLeaveHidesColumns"),i.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{i.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:(a)=>{if(r&&!K(this.params))rC(t,{columns:[this.column],visibleState:a?.visibleState,pivotState:a?.pivotState,eventType:"toolPanelUi",buttons:this.params.buttons})},onGridExit:()=>{if(r&&!K(this.params))this.onChangeCommon(!1)}};o.addDragSource(n,!0),this.addDestroyFunc(()=>o.removeDragSource(n))}createDragItem(){let e=this.column.colId,t={[e]:this.column.isVisible()},s=this.beans.columnStateUpdateStrategy,i={[e]:nC(this.column,s,K(this.params))};return{columns:[this.column],visibleState:t,pivotState:i}}onColumnStateChanged(){this.processingColumnStateChange=!0;let e=this.beans.columnStateUpdateStrategy,t=e.getPivotMode(K(this.params));if(t){let o=e.isColumnSelectedInPivotModeToolPanel(K(this.params),this.column);this.cbSelect.setValue(o)}else this.cbSelect.setValue(e.isColumnVisibleInToolPanel(K(this.params),this.column));let s,i;if(t){let o=this.gos.get("functionsReadOnly"),r=!this.column.isAnyFunctionAllowed();s=!o&&!r,i=s}else{let{enableRowGroup:o,enableValue:r,lockPosition:n,suppressMovable:a,lockVisible:l}=this.column.colDef,c=!!o||!!r,d=!!n||!!a;s=!l,i=c||!d}this.cbSelect.setReadOnly(!s),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!i),this.toggleCss("ag-column-select-column-readonly",!i&&!s),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){let t=this.cbSelect;if(e!==t.getValue()){if(!t.isReadOnly())t.toggle()}}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){F(158)}},Sk=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},yk="ag-column-select-list",xk=class extends L{constructor(){super({tag:"div",cls:yk,role:"presentation"});this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1,this.skipRefocus=!1}wireBeans(e){this.colModel=e.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[];for(let e of this.destroyColumnItemFuncs)e();this.destroyColumnItemFuncs=[]}init(e,t,s){this.params=e;let{suppressSyncLayoutWithGrid:i,contractColumnSelection:o,suppressColumnMove:r}=e;if(this.allowDragging=t,this.eventType=s,!i)this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)});this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});let n=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:n,columnPivotModeChanged:n,columnRowGroupChanged:n,columnValueChanged:n,columnVisible:n,newColumnsLoaded:n}),this.expandGroupsByDefault=!o;let a=r||i,l=this.createManagedBean(new Bd({cssIdentifier:"column-select",ariaRole:"tree",moveItemCallback:(c,d)=>{if(a)return;this.moveItems(c,d)}}));if(this.virtualList=l,this.appendChild(l.getGui()),l.setComponentCreator((c,d)=>(wn(d,c.depth+1),this.createComponentFromItem(c,d))),this.colModel.ready)this.onColumnsChanged();if(a)return;this.createItemDragFeature()}createItemDragFeature(){let{gos:e,beans:t,virtualList:s}=this;this.createManagedBean(new b3(this,s,{dragSourceType:vt.ToolPanel,addListeners:(i,o,r)=>{i.addManagedEventListeners({columnPanelItemDragStart:o,columnPanelItemDragEnd:r})},getCurrentDragValue:(i)=>vk(i),isMoveBlocked:(i)=>nm(e,t,vd(i),this.params),getNumRows:(i)=>i.getDisplayedColsList().length,moveItem:(i,o)=>am(t,vd(i),o,this.params)}))}moveItems(e,t){let{gos:s,beans:i}=this,{modelItem:o}=e,{group:r,columnGroup:n,column:a,expanded:l}=o,c=vd(r?n:a);if(nm(s,i,c,this.params))return;let d=this.displayedColsList.indexOf(o),u=t?-1:1,h=0;if(t){let p=e.columnDepth>0?a.getParent()?.getChildren():null;if(p?.length&&a===p[0])h=-1}else if(r)h=l?o.children.length:0;let g=Math.min(Math.max(d+h+u,0),this.displayedColsList.length-1);this.skipRefocus=!0,am(i,c,{rowIndex:g,position:t?"top":"bottom",component:this.virtualList.getComponentAt(g)},this.params),this.focusRowIfAlive(g-h).then(()=>{this.skipRefocus=!1})}createComponentFromItem(e,t){let s=this.allowDragging;if(e.group){let o=new dC(e,s,this.eventType,t,this.params);return this.createBean(o),o}let i=new bk(e,s,this.groupsExist,t,this.params);return this.createBean(i),i}onColumnsChanged(){let e=this.params;if(!this.hasLoadedInitialState)this.hasLoadedInitialState=!0,this.isInitialState=!!e.initialState;let t=this.getExpandedStates(),s=this.colModel.pivotMode,i=K(e),o=i&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(i);if((!e.suppressSyncLayoutWithGrid||i)&&!s||o)this.buildTreeFromWhatGridIsDisplaying();else this.buildTreeFromProvidedColumnDefs();this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){let e={};if(this.isInitialState){let{expandedGroupIds:t}=this.params.initialState;for(let s of t)e[s]=!0;return e}if(!this.allColsTree)return{};return this.forEachItem((t)=>{if(!t.group)return;let s=t.columnGroup;if(s)e[s.getId()]=t.expanded}),e}setExpandedStates(e){if(!this.allColsTree)return;let{isInitialState:t}=this;this.forEachItem((s)=>{if(!s.group)return;let i=s.columnGroup;if(i){let o=e[i.getId()];if(o!=null||t)s.expanded=!!o}})}buildTreeFromWhatGridIsDisplaying(){let e=K(this.params);if(e&&this.beans.columnStateUpdateStrategy.hasDeferredColumnOrder(e)){let t=this.beans.columnStateUpdateStrategy.getPrimaryColumns(e);if(t.length>0){ik(t,this.setColumnLayout.bind(this));return}}if(this.params.suppressSyncLayoutWithGrid){this.buildTreeFromProvidedColumnDefs();return}sk(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(e){let t=tk(this.colModel,e);this.buildListModel(t),this.groupsExist=e.some((s)=>s&&typeof s.children<"u"),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){let e=this.colModel;this.buildListModel(e.getColDefColTree()),this.groupsExist=!!e.colDefCols?.treeDepth}buildListModel(e){let t=this.onColumnExpanded.bind(this),s=(a)=>{a.addEventListener("expandedChanged",t);let l=a.removeEventListener.bind(a,"expandedChanged",t);this.destroyColumnItemFuncs.push(l)},i=this.beans.colNames,o=(a,l,c)=>{for(let d of a)if(ue(d))r(d,l,c);else n(d,l,c)},r=(a,l,c)=>{if(a.getColGroupDef()?.suppressColumnsToolPanel)return;if(a.isPadding()){o(a.getChildren(),l,c);return}let h=i.getDisplayNameForProvidedColumnGroup(null,a,"columnToolPanel"),g=new im(h,a,l,!0,this.expandGroupsByDefault);c.push(g),s(g),o(a.getChildren(),l+1,g.children)},n=(a,l,c)=>{if(a.colDef?.suppressColumnsToolPanel)return;let u=i.getDisplayNameForColumn(a,"columnToolPanel");c.push(new im(u,a,l))};this.destroyColumnTree(),o(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];let e=(i)=>{if(!i.passesFilter)return;if(this.displayedColsList.push(i),i.group&&i.expanded)i.children.forEach(e)},t=this.virtualList;this.allColsTree.forEach(e),t.setModel(new Sk(this.displayedColsList));let s=null;if(!this.skipRefocus)s=t.getLastFocusedRow();if(t.refresh(),s!=null)this.focusRowIfAlive(s);this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){let e=this.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),s=e("columns","Columns"),i=this.displayedColsList.length;fe(this.virtualList.getAriaElement(),`${t} ${i} ${s}`)}focusRowIfAlive(e){if(e===-1)return Promise.resolve();return new Promise((t)=>{window.setTimeout(()=>{if(this.isAlive())this.virtualList.focusRow(e);t()},0)})}forEachItem(e){let t=(i)=>{for(let o of i)if(e(o),o.group)t(o.children)},s=this.allColsTree;if(!s)return;t(s)}doSetExpandedAll(e){this.forEachItem((t)=>{if(t.group)t.expanded=e})}setGroupsExpanded(e,t){if(!t){this.doSetExpandedAll(e);return}let s=[];this.forEachItem((o)=>{if(!o.group)return;let r=o.columnGroup.getId();if(t.indexOf(r)>=0)o.expanded=e,s.push(r)});let i=t.filter((o)=>!s.includes(o));if(i.length>0)F(157,{unrecognisedGroupIds:i})}getExpandState(){let e=0,t=0;if(this.forEachItem((s)=>{if(!s.group)return;if(s.expanded)e++;else t++}),e>0&&t>0)return 2;if(t>0)return 1;return 0}doSetSelectedAll(e){iC(this.beans,this.allColsTree,e,this.eventType,this.params),this.syncVisibleSelectionState(),this.fireSelectionChangedEvent()}syncVisibleSelectionState(){for(let e=0;e<this.displayedColsList.length;e++)this.virtualList.getComponentAt(e)?.onColumnStateChanged?.()}getSelectionState(){let e=0,t=0,s=this.beans.columnStateUpdateStrategy,i=s.getPivotMode(K(this.params));if(this.forEachItem((o)=>{if(o.group)return;if(!o.passesFilter)return;let r=o.column,n=r.colDef,a;if(i){if(!r.isAllowPivot()&&!r.isAllowRowGroup()&&!r.isAllowValue())return;a=s.isColumnSelectedInPivotModeToolPanel(K(this.params),r)??!1}else{if(n.lockVisible)return;a=s.isColumnVisibleInToolPanel(K(this.params),r)??!1}if(a)e++;else t++}),e>0&&t>0)return;return!(e===0||t>0)}setFilterText(e){this.filterText=M(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){let e=(s)=>{if(!M(this.filterText))return!0;return s.displayName?.toLowerCase().indexOf(this.filterText)!==-1},t=(s,i)=>{let o=!1;if(s.group){let n=e(s);for(let a of s.children){let l=t(a,n||i);if(l)o=l}}let r=i||o?!0:e(s);return s.passesFilter=r,r};for(let s of this.allColsTree)t(s,!1)}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){let e=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;let e=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:e})}getExpandedGroups(){let e=[];if(!this.allColsTree)return e;return this.forEachItem((t)=>{if(t.group&&t.expanded)e.push(t.columnGroup.getId())}),e}},Rk={selector:"AG-PRIMARY-COLS-LIST",component:xk},Fk={tag:"div",cls:"ag-column-select",children:[{tag:"ag-primary-cols-header",ref:"primaryColsHeaderPanel"},{tag:"ag-primary-cols-list",ref:"primaryColsListPanel"}]},uC=class extends L{constructor(){super(Fk,[ek,Rk]);this.primaryColsHeaderPanel=E,this.primaryColsListPanel=E,this.registerCSS(X3)}init(e,t,s){let{primaryColsHeaderPanel:i,primaryColsListPanel:o}=this;i.init(t);let{suppressColumnFilter:r,suppressColumnSelectAll:n}=t;if(t.suppressColumnExpandAll&&r&&n)i.setDisplayed(!1);this.addManagedListeners(o,{groupExpanded:(l)=>{i.setExpandState(l.state),t.onStateUpdated()},selectionChanged:(l)=>i.setSelectionState(l.state)}),o.init(t,e,s),this.addManagedListeners(i,{expandAll:o.doSetExpandedAll.bind(o,!0),collapseAll:o.doSetExpandedAll.bind(o,!1),selectAll:o.doSetSelectedAll.bind(o,!0),unselectAll:o.doSetSelectedAll.bind(o,!1),filterChanged:(l)=>o.setFilterText(l.filterText)}),this.positionableFeature=this.createManagedBean(new Jo(this.getGui(),{minHeight:100}))}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1)}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}},Ek=".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select:where(:not(.ag-last-visible-child)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px}:where(.ag-column-panel) .ag-column-drop-vertical:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-buttons{display:flex;flex-wrap:wrap;gap:var(--ag-widget-vertical-spacing) var(--ag-widget-horizontal-spacing);justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding) 0;:where(.ag-standard-button){transition:background-color .25s ease-in-out,color .25s ease-in-out}}.ag-column-panel-buttons:where(:last-child){padding-bottom:var(--ag-widget-container-vertical-padding)}.ag-column-panel-buttons-button{line-height:1.5}:where(.ag-column-panel) .ag-column-panel-buttons-apply-button:not(:disabled){background-color:var(--ag-column-panel-apply-button-background-color);color:var(--ag-column-panel-apply-button-color)}",Pk="ag-column-panel-deferred",Mk=class extends L{constructor(){super({tag:"div",cls:"ag-column-panel"});this.initialised=!1,this.childDestroyFuncs=[],this.isDeferModeEnabled=!1,this.isCommitting=!1,this.onDeferredApply=()=>{this.isCommitting=!0;try{this.beans.columnStateUpdateStrategy.commit(this.isDeferModeEnabled)}finally{this.isCommitting=!1}this.deferredButtonsComp?.updateValidity(!1),this.lastKnownGridState=this.captureGridState()},this.onDeferredCancel=()=>{this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy(),this.lastKnownGridState=this.captureGridState()},this.onPivotModePanelValueChanged=()=>{this.refreshToolPanelLayouts(),this.setLastVisible(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))},this.onColumnEverythingChanged=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;let e=this.captureGridState();if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled)){this.lastKnownGridState=e;return}let t=this.lastKnownGridState&&this.isGridStateEqual(this.lastKnownGridState,e);if(this.lastKnownGridState=e,!t)return;this.resetDeferredState()},this.onExternalGridChange=()=>{if(!this.isDeferModeEnabled||this.isCommitting)return;if(!this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))return;this.resetDeferredState(),this.lastKnownGridState=this.captureGridState()},this.registerCSS(Ek)}wireBeans(e){this.colToolPanelFactory=e.colToolPanelFactory}setVisible(e){if(super.setDisplayed(e),e&&!this.initialised)this.init(this.params)}init(e){let s={...I(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),...e};this.params=s;let{childDestroyFuncs:i,colToolPanelFactory:o,gos:r}=this,n=r.isModuleRegistered("SharedPivot"),a=n||r.isModuleRegistered("SharedRowGrouping");if(this.isDeferModeEnabled=K(s),this.toggleCss(Pk,this.isDeferModeEnabled),!s.suppressPivotMode&&o&&n)this.pivotModePanel=o.createPivotModePanel(this,i,s,this.onPivotModePanelValueChanged);let l=this.createBean(new uC);if(this.primaryColsPanel=l,i.push(()=>this.destroyBean(this.primaryColsPanel)),l.init(!0,s,"toolPanelUi"),l.addCss("ag-column-panel-column-select"),this.appendChild(l),o){if(!s.suppressRowGroups&&a)this.rowGroupDropZonePanel=o.createRowGroupPanel(this,i,s);if(!s.suppressValues&&a)this.valuesDropZonePanel=o.createValuesPanel(this,i,s);if(!s.suppressPivots&&n)this.pivotDropZonePanel=o.createPivotPanel(this,i,s);this.setLastVisible();let[c]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});i.push(()=>c())}if(this.isDeferModeEnabled){let c=this.onExternalGridChange;i.push(...this.addManagedEventListeners({columnEverythingChanged:this.onColumnEverythingChanged,sortChanged:c,columnVisible:c,columnRowGroupChanged:c,columnValueChanged:c,columnPivotChanged:c,columnPivotModeChanged:c,newColumnsLoaded:c,...s.suppressSyncLayoutWithGrid?{}:{columnMoved:c}}))}if(s.buttons){if(!s.buttons.includes("apply"))F(298);if(s.buttons.length)this.initDeferredButtons(s.buttons)}this.initialised=!0}initDeferredButtons(e){let t=this.createBean(new qc({className:"ag-column-panel-buttons"}));this.deferredButtonsComp=t,this.childDestroyFuncs.push(()=>{this.deferredButtonsComp=this.destroyBean(this.deferredButtonsComp)});let s=this.getLocaleTextFunc(),i=e.map((o)=>({type:o,label:s(o==="apply"?"applyColumnToolPanel":"cancelColumnToolPanel",o==="apply"?"Apply":"Cancel")}));t.updateButtons(i),t.updateValidity(!1),t.addManagedListeners(t,{apply:this.onDeferredApply,cancel:this.onDeferredCancel}),this.appendChild(t)}resetDeferredState(){this.beans.columnStateUpdateStrategy.reset(this.isDeferModeEnabled),this.deferredButtonsComp?.updateValidity(!1),this.refreshToolPanelLayouts(),this.pivotModePanel?.refreshEditStrategy()}captureGridState(){let{beans:e}=this,t=(s)=>(s??[]).map((i)=>i.getColId());return{rowGroupColIds:t(e.rowGroupColsSvc?.columns),valueColIds:t(e.valueColsSvc?.columns),pivotColIds:t(e.pivotColsSvc?.columns),pivotMode:e.colModel.pivotMode,columnOrder:e.colModel.getCols().map((s)=>s.colId),visibleColIds:e.colModel.getCols().filter((s)=>s.isVisible()).map((s)=>s.colId),sortState:e.colModel.getCols().filter((s)=>s.getSort()).map((s)=>`${s.colId}:${s.getSort()}:${s.getSortIndex()}`),aggFuncState:(e.valueColsSvc?.columns??[]).map((s)=>s.getAggFunc()),widthState:e.colModel.getCols().map((s)=>`${s.colId}:${s.getActualWidth()}`)}}isGridStateEqual(e,t){return se(e.rowGroupColIds,t.rowGroupColIds)&&se(e.valueColIds,t.valueColIds)&&se(e.pivotColIds,t.pivotColIds)&&e.pivotMode===t.pivotMode&&se(e.columnOrder,t.columnOrder)&&se(e.visibleColIds,t.visibleColIds)&&se(e.sortState,t.sortState)&&se(e.aggFuncState,t.aggFuncState)&&se(e.widthState,t.widthState)}refreshDeferredUi(){this.refreshToolPanelLayouts(),this.setLastVisible(),this.pivotModePanel?.refreshEditStrategy(),this.deferredButtonsComp?.updateValidity(this.beans.columnStateUpdateStrategy.hasPendingChanges(this.isDeferModeEnabled))}refreshToolPanelLayouts(){this.primaryColsPanel.syncLayoutWithGrid(),this.rowGroupDropZonePanel?.refreshGui(),this.valuesDropZonePanel?.refreshGui(),this.pivotDropZonePanel?.refresh()}setPivotModeSectionVisible(e){let t=this.colToolPanelFactory;if(!t)return;this.pivotModePanel=t.setPanelVisible(this.pivotModePanel,e,t.createPivotModePanel.bind(t,this,this.childDestroyFuncs,this.params,this.onPivotModePanelValueChanged,!0)),this.setLastVisible()}setRowGroupsSectionVisible(e){let t=this.colToolPanelFactory;if(!t)return;this.rowGroupDropZonePanel=t.setPanelVisible(this.rowGroupDropZonePanel,e,t.createRowGroupPanel.bind(t,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setValuesSectionVisible(e){let t=this.colToolPanelFactory;if(!t)return;this.valuesDropZonePanel=t.setPanelVisible(this.valuesDropZonePanel,e,t.createValuesPanel.bind(t,this,this.childDestroyFuncs,this.params)),this.setLastVisible()}setPivotSectionVisible(e){let t=this.colToolPanelFactory;if(!t)return;this.pivotDropZonePanel=t.setPanelVisible(this.pivotDropZonePanel,e,t.createPivotPanel.bind(t,this,this.childDestroyFuncs,this.params)),this.pivotDropZonePanel?.setDisplayed(e),this.setLastVisible()}setResizers(){for(let e of[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel]){if(!e)continue;let t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden")&&!t.classList.contains("ag-last-visible-child"))}}setLastVisible(){let e=this.getGui(),t=Array.prototype.slice.call(e.querySelectorAll(".ag-column-drop"));for(let o of t)o.classList.remove("ag-last-column-drop");let s=e.querySelectorAll(".ag-column-drop:not(.ag-hidden)"),i=k(s);if(i)i.classList.add("ag-last-column-drop");this.primaryColsPanel.getGui().classList.toggle("ag-last-visible-child",!i),this.setResizers()}resetChildrenHeight(){let t=this.getGui().children;for(let s=0;s<t.length;s++){let{style:i}=t[s];i.removeProperty("height"),i.removeProperty("flex")}}expandColumnGroups(e){this.primaryColsPanel.expandGroups(e)}collapseColumnGroups(e){this.primaryColsPanel.collapseGroups(e)}setColumnLayout(e){this.primaryColsPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsPanel.syncLayoutWithGrid()}destroyChildren(){let e=this.childDestroyFuncs;for(let t of e)t();e.length=0,te(this.getGui())}refresh(e){return this.destroyChildren(),this.init(e),!0}getState(){return{expandedGroupIds:this.primaryColsPanel.getExpandedGroups()}}destroy(){this.destroyChildren(),super.destroy()}},Tk=".ag-column-drop{align-items:center;display:inline-flex;overflow:auto;position:relative;width:100%}.ag-column-drop-list{align-items:center;display:flex}.ag-column-drop-cell{align-items:center;background-color:var(--ag-column-drop-cell-background-color);border:var(--ag-column-drop-cell-border);border-radius:500px;color:var(--ag-column-drop-cell-text-color);display:flex;font-weight:400;padding:calc(var(--ag-spacing)*.25);position:relative;&:focus-visible{box-shadow:var(--ag-focus-shadow)}:where(.ag-drag-handle){color:var(--ag-column-drop-cell-drag-handle-color)}}:where(.ag-ltr) .ag-column-drop-cell{padding-left:calc(var(--ag-spacing)*.75)}:where(.ag-rtl) .ag-column-drop-cell{padding-right:calc(var(--ag-spacing)*.75)}.ag-column-drop-cell-text{flex:1 1 auto;margin:0 var(--ag-spacing);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-drop-vertical{align-items:stretch;display:flex;flex-direction:column;min-height:75px;overflow:hidden}.ag-column-drop-vertical-title-bar{align-items:center;display:flex;flex:none;padding:var(--ag-widget-container-vertical-padding) calc(var(--ag-spacing)*2) 0}.ag-column-drop-vertical-list{align-items:stretch;flex-direction:column;flex-grow:1;overflow-x:auto;padding-bottom:var(--ag-spacing);padding-left:var(--ag-spacing);padding-right:var(--ag-spacing);position:relative}:where(.ag-column-drop-empty) .ag-column-drop-vertical-list{overflow:hidden}.ag-column-drop-cell-button{cursor:pointer;min-width:0;opacity:.75}:where(.ag-ltr) .ag-column-drop-cell-button{margin-right:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-button{margin-left:calc(var(--ag-spacing)/4)}.ag-column-drop-cell-button:hover{opacity:1}:where(.ag-ltr) .ag-column-drop-cell-drag-handle{margin-left:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-drag-handle{margin-right:calc(var(--ag-spacing)/4)}.ag-column-drop-wrapper{display:flex}.ag-column-drop-horizontal-half-width{width:50%!important}.ag-column-drop-cell-ghost{opacity:.5}.ag-column-drop-horizontal{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:auto hidden;scrollbar-width:thin;white-space:nowrap}:where(.ag-ltr) .ag-column-drop-horizontal{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-column-drop-horizontal{padding-right:var(--ag-cell-horizontal-padding)}.ag-column-drop-horizontal-list{gap:var(--ag-cell-widget-spacing)}.ag-column-drop-vertical-cell{margin-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-icon{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-icon{margin-left:var(--ag-widget-horizontal-spacing)}.ag-select-agg-func-popup{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);height:calc(var(--ag-spacing)*5*3.5);padding:0;position:absolute}.ag-select-agg-func-virtual-list-item{cursor:default}:where(.ag-ltr) .ag-select-agg-func-virtual-list-item{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-select-agg-func-virtual-list-item{padding-right:calc(var(--ag-spacing)*2)}.ag-select-agg-func-virtual-list-item:hover{background-color:var(--ag-selected-row-background-color)}:where(.ag-ltr) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-left:solid var(--ag-border-width) var(--ag-border-color)}";function lm(e,t,s){if(e==null||t==null)return;e.splice(s,0,...t)}var Dk={tag:"div",cls:"ag-unselectable",role:"presentation"},Ak=class extends L{constructor(e){super(Dk);this.horizontal=e,this.state="notDragging",this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=ee({tag:"div"}),this.addElementClasses(this.ePillDropList,"list"),this.registerCSS(Tk)}toggleResizable(e){this.positionableFeature.setResizable(e?{bottom:!0}:!1),this.resizeEnabled=e}isSourceEventFromTarget(e){let{dropZoneTarget:t,dragSource:s}=e;return t.contains(s.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){for(let e of this.guiDestroyFunctions)e();this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,te(this.getGui()),te(this.ePillDropList)}init(e){this.params=e??{},this.createManagedBean(new ls(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.onKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Jo(this.getGui()),this.createManagedBean(this.positionableFeature),this.refreshGui(),fe(this.ePillDropList,this.getAriaLabel()),this.addManagedElementListeners(this.getFocusableElement(),{focusin:this.onFocusIn.bind(this)})}onTabKeyDown(e){let t=dt(this.getFocusableElement(),null,!0),s=t.length;if(s===0)return;let{shiftKey:i}=e,o=j(this.beans),r=o===t[0],n=o===k(t);if(!(s===1||r&&i||n&&!i))t[i?0:s-1].focus({preventScroll:!0})}onFocusIn(e){let t=this.getFocusableElement();if(t.contains(e.relatedTarget))return;let s=e.target;if(s)cm(t,s)}onKeyDown(e){let{key:t}=e,s=!this.horizontal,i=t===b.DOWN,o=t===b.UP;if(!s){let r=this.gos.get("enableRtl");i=!r&&t===b.RIGHT||r&&t===b.LEFT,o=!r&&t===b.LEFT||r&&t===b.RIGHT}if(!i&&!o)return;if(e.preventDefault(),e.shiftKey)this.moveFocusedItem(o);else{let r=this.getFocusableElement(),n=Ie(this.beans,r,!1,o);if(n)n.focus(),cm(r,n)}}moveFocusedItem(e){let t=this.getFocusedItem();if(t===-1)return;let s=e?-1:1;if(!this.normalizeAndUpdateInsertIndex(t,t+s))return;let o=this.childPillComponents[t];if(!o.isMovable())return;let r=o.getItem();this.focusItemAtIndex(this.insertIndex),this.rearrangeItems([r],!0)}addElementClasses(e,t){t=t?`-${t}`:"";let s=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${s}${t}`)}setupDropTarget(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),onDragCancel:this.onDragCancel.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.beans.dragAndDrop?.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){let t=this.getNewInsertIndex(e);if(t<0)return!1;return this.normalizeAndUpdateInsertIndex(this.insertIndex,t)}normalizeAndUpdateInsertIndex(e,t){let s=this.minimumAllowedNewInsertIndex(),i=Math.max(s,t),o=i!==e;if(o)this.insertIndex=i;return o}getNewInsertIndex(e){let t=e.event,s=this.horizontal?t.clientX:t.clientY,i=this.childPillComponents.map((r)=>r.getGui().getBoundingClientRect()),o=i.findIndex((r)=>this.horizontal?r.right>s&&r.left<s:r.top<s&&r.bottom>s);if(o===-1){let r=this.gos.get("enableRtl");if(i.every((l)=>s>(this.horizontal?l.right:l.bottom)))return r&&this.horizontal?0:this.childPillComponents.length;if(i.every((l)=>s<(this.horizontal?l.left:l.top)))return r&&this.horizontal?this.childPillComponents.length:0;return this.insertIndex}if(this.insertIndex<=o)return o+1;return o}checkDragStartedBySelf(e){if(this.state!=="notDragging")return;this.state="rearrangeItems",this.potentialDndItems=this.getItems(e.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(e),this.refreshGui()}onDragging(e){if(this.checkDragStartedBySelf(e),this.checkInsertIndex(e))this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(e){let t=this.getItems(e.dragSource.getDragItem());this.state="newItemsIn";let s=t.filter((o)=>this.isItemDroppable(o,e)),i=s.every((o)=>this.childPillComponents.map((r)=>r.getItem()).indexOf(o)!==-1);if(s.length===0)return;if(this.potentialDndItems=s,i){this.state="notDragging";return}this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(e){}onDragLeave(e){if(this.state==="rearrangeItems"){let t=this.getItems(e.dragSource.getDragItem());this.removeItems(t)}if(this.isPotentialDndItems())this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui();this.state="notDragging"}onDragCancel(e){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.handleDragLeaveEnd(e);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}onDragStop(){if(this.isPotentialDndItems()){if(this.state==="newItemsIn")this.addItems(this.potentialDndItems);else this.rearrangeItems(this.potentialDndItems);this.potentialDndItems=[],this.refreshGui()}this.state="notDragging"}removeItems(e){let t=this.getExistingItems().filter((s)=>!e.includes(s));this.updateItems(t),this.refreshGui()}addItems(e){if(!e)return;let t=this.getExistingItems().slice(),s=e.filter((i)=>t.indexOf(i)<0);lm(t,s,this.insertIndex),this.updateItems(t),this.refreshGui()}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e])}rearrangeItems(e,t){let s;if(!t)s=this.getNonGhostItems().slice();else s=this.getExistingItems().filter((i)=>e.indexOf(i)===-1);if(lm(s,e,this.insertIndex),se(s,this.getExistingItems()))return!1;return this.updateItems(s),this.refreshGui(),!0}refreshGui(){let e=0;if(!this.horizontal)e=this.ePillDropList.scrollTop;let t=this.resizeEnabled,s=this.getFocusedItem(),{eGridDiv:i}=this.beans,o=Ji(),r=null;if(o)r=Ie(this.beans,i)??Ie(this.beans,i,!1,!0);if(this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),e!==0)this.ePillDropList.scrollTop=e;if(t)this.toggleResizable(t);if(o)this.restoreFocus(s,r)}getFocusedItem(){let e=this.getGui(),t=j(this.beans);if(!e.contains(t))return-1;return Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t)}focusItemAtIndex(e){let t=this.getGui(),i=Array.from(t.querySelectorAll(".ag-column-drop-cell"))[e];if(!i)return;i.focus({preventScroll:!0})}restoreFocus(e,t){let s=this.getGui(),i=Array.from(s.querySelectorAll(".ag-column-drop-cell"));if(e===-1)return;if(i.length===0)t.focus();let o=Math.min(i.length-1,e),r=i[o];if(r)r.focus()}focusList(e){let t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){let e=this.getExistingItems();if(this.isPotentialDndItems())return e.filter((t)=>!this.potentialDndItems.includes(t));return e}addItemsToGui(){let t=this.getNonGhostItems().map((s)=>this.createItemComponent(s,!1));if(this.isPotentialDndItems()){let s=this.potentialDndItems.map((i)=>this.createItemComponent(i,!0));if(this.insertIndex>=t.length)t.push(...s);else t.splice(this.insertIndex,0,...s)}this.appendChild(this.ePillDropList),t.forEach((s,i)=>{if(i>0)this.addArrow(this.ePillDropList);this.ePillDropList.appendChild(s.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){let{childPillComponents:e,ePillDropList:t}=this,s=e.length;ge(t,s===0?"presentation":"listbox");for(let i=0;i<s;i++){let r=e[i].getGui();Uo(r,i+1),Wo(r,s)}}createItemComponent(e,t){let s=this.createPillComponent(e,this.dropTarget,t,this.horizontal);if(s.addEventListener("columnRemove",this.removeItems.bind(this,[e])),this.createBean(s),this.guiDestroyFunctions.push(()=>this.destroyBean(s)),!t)this.childPillComponents.push(s);return s}addIconAndTitleToGui(){let{title:e,icon:t}=this.params;if(!e||!t)return;let s=ee({tag:"div"});if(bn(s,!0),this.addElementClasses(s,"title-bar"),this.addElementClasses(t,"icon"),this.toggleCss("ag-column-drop-empty",this.isExistingItemsEmpty()),s.appendChild(t),!this.horizontal){let i=ee({tag:"span"});this.addElementClasses(i,"title"),i.textContent=e,s.appendChild(i)}this.appendChild(s)}isExistingItemsEmpty(){return this.getExistingItems().length===0}addEmptyMessageToGui(){let{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;let t=ee({tag:"span"});t.textContent=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){let t=this.gos.get("enableRtl"),s=N(t?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses(s,"cell-separator"),e.appendChild(s)}}};function cm(e,t){if(t===dt(e,null,!0)[0])e.scrollLeft=0;let s=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(i.left<s.left)e.scrollLeft-=s.left-i.left;else if(i.right>s.right)e.scrollLeft+=i.right-s.right}var Ik={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},kk=class extends L{constructor(e,t,s,i,o){super();this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=s,this.template=i,this.agComponents=o,this.eText=E,this.eDragHandle=E,this.eButton=E}postConstruct(){this.setTemplate(this.template??Ik,this.agComponents);let e=this.getGui(),{beans:t,eDragHandle:s,eText:i,eButton:o}=this;if(this.addElementClasses(e),this.addElementClasses(s,"drag-handle"),this.addElementClasses(i,"text"),this.addElementClasses(o,"button"),s.appendChild(N("columnDrag",t)),o.appendChild(N("cancel",t)),this.tooltipFeature=this.createOptionalManagedBean(t.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui()})),this.setupComponents(),!this.ghost&&this.isDraggable())this.addDragSource();this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){let e=this.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),fe(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){let s=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(s)}}setupTooltip(){let e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());e(),this.addManagedEventListeners({newColumnsLoaded:e})}getDragSourceId(){return}getDefaultIconName(){return"notAllowed"}addDragSource(){let{beans:{dragAndDrop:e},eDragHandle:t}=this,s=this.createGetDragItem(),i=this.getDefaultIconName(),o={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>i,getDragItem:s,dragItemName:this.getDisplayName()};e?.addDragSource(o,!0),this.addDestroyFunc(()=>e?.removeDragSource(o))}setupComponents(){if(this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost)this.addCss("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){G(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();let e={type:"columnRemove"};this.addGuiEventListener("keydown",(s)=>this.onKeyDown(s)),this.addManagedElementListeners(this.eButton,{click:(s)=>{this.dispatchLocalEvent(e),s.stopPropagation()}});let t=new Ke(this.eButton);this.addManagedListeners(t,{tap:()=>this.dispatchLocalEvent(e)}),this.addDestroyFunc(t.destroy.bind(t))}onKeyDown(e){if(e.key===b.DELETE){if(this.isRemovable())e.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"})}}getDisplayValue(){return this.getDisplayName()}addElementClasses(e,t){t=t?`-${t}`:"";let s=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${s}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},Lk=class extends kk{constructor(e,t,s,i,o,r){super(t,s,o);this.column=e,this.dropZonePurpose=i,this.updateParams=r,this.eSortIndicator=E,this.popupShowing=!1,this.deferApply=K(r)}postConstruct(){let{sortSvc:e,colNames:t}=this.beans;if(this.template={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},e?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:void 0,{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},e)this.agComponents=[e.getSortIndicatorSelector()];if(this.displayName=t.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),this.deferApply)this.eDragHandle.setAttribute("data-column-tool-panel-deferred","");if(e)this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}});if(this.isGroupingZone())this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.colDef.headerTooltip}addAdditionalAriaInstructions(e,t){let s=this.gos.get("rowGroupPanelSuppressSort"),i=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!i){let o=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");e.push(o)}if(this.isGroupingZone()&&this.column.isSortable()&&!s){let o=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");e.push(o)}super.addAdditionalAriaInstructions(e,t)}isMovable(){return this.isDraggable()}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){let e=this.getLocaleTextFunc(),{name:t,aggFuncName:s}=this.getColumnAndAggFuncName(),i=e("ariaDropZoneColumnComponentAggFuncSeparator"," of "),o={asc:e("ariaDropZoneColumnComponentSortAscending","ascending"),desc:e("ariaDropZoneColumnComponentSortDescending","descending")},r=this.getCurrentSortDirection(this.column),n=this.gos.get("rowGroupPanelSuppressSort");return[s&&`${s}${i}`,t,this.isGroupingZone()&&!n&&r&&`, ${o[r]}`].filter((a)=>!!a).join("")}getColumnAndAggFuncName(){let e=this.displayName,t="";if(this.isAggregationZone()){let s=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),i=typeof s==="string"?s:"agg";t=this.getLocaleTextFunc()(i,i)}return{name:e,aggFuncName:t}}setupSort(){if(!this.column.isSortable()||!this.isGroupingZone())return;let{gos:e,column:t,eSortIndicator:s}=this;if(!e.get("rowGroupPanelSuppressSort")){s.setupSort(t,!0,this.getSortDefOverride.bind(this));let i=(o)=>{o.preventDefault(),this.beans.columnStateUpdateStrategy.progressSortFromEvent(this.deferApply,t,o),s.refresh(),this.setupAria(),ze(this.beans,this.updateParams)};this.addGuiEventListener("click",i),this.addGuiEventListener("keydown",(o)=>{if(o.key===b.ENTER&&this.isGroupingZone())i(o)})}}getCurrentSortDirection(e){return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,e)?.direction??null}getSortDefOverride(){if(!this.deferApply)return;return this.beans.columnStateUpdateStrategy.getSortDef(this.deferApply,this.column)}getDefaultIconName(){return"hide"}createGetDragItem(){let{column:e}=this;return()=>{let t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}}setupComponents(){if(super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(e){if(super.onKeyDown(e),e.key===b.ENTER&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly"))e.preventDefault(),this.onShowAggFuncSelection()}getDisplayValue(){let{name:e,aggFuncName:t}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${t}(${e})`:e}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;let{aggFuncSvc:e,popupSvc:t}=this.beans,s=new Bd({cssIdentifier:"select-agg-func"}),i=e.getFuncNames(this.column),o=this.getGui(),r=s.getGui();s.setModel({getRow:function(g){return i[g]},getRowCount:function(){return i.length}}),this.createBean(s);let n=ee({tag:"div",cls:"ag-select-agg-func-popup"});n.style.top="0px",n.style.left="0px",n.appendChild(r),n.style.width=`${o.clientWidth}px`;let[a]=this.addManagedElementListeners(n,{focusout:(g)=>{if(!n.contains(g.relatedTarget)&&d)d.hideFunc()}}),l=(g)=>{if(this.destroyBean(s),this.popupShowing=!1,g?.key==="Escape")o.focus();if(a)a()},c=this.getLocaleTextFunc(),d=t.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:l,ariaLabel:c("ariaLabelAggregationFunction","Aggregation Function")});if(d)s.setComponentCreator(this.createAggSelect.bind(this,d.hideFunc));s.addGuiEventListener("keydown",(g)=>{if(g.key===b.ENTER||g.key===b.SPACE){let p=s.getLastFocusedRow();if(p==null)return;let f=s.getComponentAt(p);if(f)f.selectItem()}}),t.positionPopupByComponent({type:"aggFuncSelect",eventSource:o,ePopup:n,keepWithinBounds:!0,additionalParams:{column:this.column},position:"under"}),s.refresh();let u=this.beans.columnStateUpdateStrategy.getColumnAggFunc(this.deferApply,this.column),h=i.findIndex((g)=>g===u);if(h===-1)h=0;s.focusRow(h)}createAggSelect(e,t){let s=()=>{if(e(),this.getGui().focus(),this.beans.columnStateUpdateStrategy.setColumnAggFunc(this.deferApply,this.column,t,"toolPanelDragAndDrop"),this.column){let a=this.getGui().querySelector(".ag-column-drop-cell-text");if(a)a.textContent=this.getDisplayValue();this.setupAria()}ze(this.beans,this.updateParams)},i=this.getLocaleTextFunc(),o=(t||"").toString(),r=i(o,o);return new Gk(s,r)}isGroupingAndLocked(){return this.isGroupingZone()&&Cr(this.column,this.beans)}isAggregationZone(){return this.dropZonePurpose==="aggregation"}isGroupingZone(){return this.dropZonePurpose==="rowGroup"}getDragSourceType(){return vt.ToolPanel}destroy(){super.destroy(),this.column=null}},Gk=class extends L{constructor(e,t){super({tag:"div",cls:"ag-select-agg-func-item",children:t});this.selectItem=e,this.addGuiEventListener("click",this.selectItem)}},zd=class extends Ak{constructor(e,t,s,i=!1){super(e);this.dropZonePurpose=t,this.updateParams=s,this.embedded=i,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(e){super.init(e),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(e){return e.columns??[]}isInterestedIn(e,t){if(e===vt.HeaderCell)return!0;if(e!==vt.ToolPanel)return!1;if(!this.horizontal)return!0;return!t.hasAttribute("data-column-tool-panel-deferred")}minimumAllowedNewInsertIndex(){let{gos:e,rowGroupColsSvc:t}=this.beans,s=e.get("groupLockGroupColumns"),i=t?.columns.length??0;if(s===-1)return i;return Math.min(s,i)}shouldToggleColumnVisibility(e,t){return this.isRowGroupPanel()&&Tn(this.gos,t)&&!e.fromNudge}handleDragEnterEnd(e){if(this.shouldToggleColumnVisibility(e,!0)){let s=e.dragSource.getDragItem().columns;this.setColumnsVisible(s,!1,"uiColumnDragged")}}handleDragLeaveEnd(e){if(this.shouldToggleColumnVisibility(e,!1)){let t=e.dragSource.getDragItem();this.setColumnsVisible(t.columns,!0,"uiColumnDragged")}}setColumnsVisible(e,t,s){if(!e)return;if(K(this.updateParams))return;let i=e.filter((o)=>!o.colDef.lockVisible);this.beans.columnStateUpdateStrategy.setColumnsVisible(!1,i,t,s)}isRowGroupPanel(){return this.dropZonePurpose==="rowGroup"}createPillComponent(e,t,s,i){return new Lk(e,t,s,this.dropZonePurpose,i,this.updateParams)}},Ok=class extends zd{constructor(e,t,s=!1){super(e,"pivot",t,s)}postConstruct(){let e=this.getLocaleTextFunc(),t=e("pivotColumnsEmptyMessage","Drag here to set column labels"),s=e("pivots","Column Labels");if(super.init({icon:N("pivotPanel",this.beans,null),emptyMessage:t,title:s}),this.horizontal&&!this.embedded)Ns(this.beans,this,this.getGui());this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){let e=this.beans.colModel,t=e.pivotMode;if(this.horizontal)switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{let s=e.isPivotActive();this.setDisplayed(t&&s);break}default:this.setDisplayed(!1);break}else this.setDisplayed(this.beans.columnStateUpdateStrategy.getPivotMode(K(this.updateParams)))}isItemDroppable(e,t){if(this.gos.get("functionsReadOnly")||!e.primary)return!1;let s=this.beans.columnStateUpdateStrategy.getPivotColumns(K(this.updateParams)).includes(e);return e.isAllowPivot()&&(!s||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.columnStateUpdateStrategy.setPivotColumns(K(this.updateParams),e,"toolPanelUi"),ze(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getPivotColumns(K(this.updateParams))}getFocusableContainerName(){return"pivotToolbar"}},Bk=class extends zd{constructor(e,t,s=!1){super(e,"rowGroup",t,s)}postConstruct(){let e=this.getLocaleTextFunc(),t=e("rowGroupColumnsEmptyMessage","Drag here to set row groups"),s=e("groups","Row Groups");if(super.init({icon:N("rowGroupPanel",this.beans,null),emptyMessage:t,title:s}),this.horizontal&&!this.embedded)Ns(this.beans,this,this.getGui());this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}isItemDroppable(e,t){if(this.gos.get("functionsReadOnly")||!e.primary||e.colDef.showRowGroup)return!1;let s=this.beans.columnStateUpdateStrategy.getRowGroupColumns(K(this.updateParams)).includes(e);return e.isAllowRowGroup()&&(!s||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.columnStateUpdateStrategy.setRowGroupColumns(K(this.updateParams),e,"toolPanelUi"),ze(this.beans,this.updateParams)}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.columnStateUpdateStrategy.getRowGroupColumns(K(this.updateParams))}getFocusableContainerName(){return"rowGroupToolbar"}},Vk=class extends zd{constructor(e,t){super(e,"aggregation",t)}postConstruct(){let e=this.getLocaleTextFunc(),t=e("valueColumnsEmptyMessage","Drag here to aggregate"),s=e("values","Values");super.init({icon:N("valuePanel",this.beans,null),emptyMessage:t,title:s}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(e,t){if(this.gos.get("functionsReadOnly")||!e.primary)return!1;let s=this.beans.columnStateUpdateStrategy.getValueColumns(K(this.updateParams)).includes(e);return e.isAllowValue()&&(!s||this.isSourceEventFromTarget(t))}updateItems(e){this.beans.columnStateUpdateStrategy.setValueColumns(K(this.updateParams),e,"toolPanelUi"),ze(this.beans,this.updateParams)}getExistingItems(){return this.beans.columnStateUpdateStrategy.getValueColumns(K(this.updateParams))}},Nk={tag:"div",cls:"ag-pivot-mode-panel",children:[{tag:"ag-toggle-button",ref:"cbPivotMode",cls:"ag-pivot-mode-select"}]},_k=class extends L{constructor(e,t){super();this.params=e,this.onPivotModeValueChanged=t,this.cbPivotMode=E}getCurrentPivotMode(){return this.beans.columnStateUpdateStrategy.getPivotMode(K(this.params))}syncFromGrid(){this.cbPivotMode.setValue(this.getCurrentPivotMode())}refreshEditStrategy(){this.syncFromGrid()}postConstruct(){this.setTemplate(Nk,[Kf]);let e=this.cbPivotMode;e.setValue(this.getCurrentPivotMode());let t=this.getLocaleTextFunc();e.setLabel(t("pivotMode","Pivot Mode"));let s=()=>{let o=!!e.getValue();this.beans.columnStateUpdateStrategy.setPivotMode(K(this.params),o,"toolPanelUi"),this.onPivotModeValueChanged?.()},i=()=>{e.setValue(this.getCurrentPivotMode())};this.addManagedListeners(e,{fieldValueChanged:s}),this.addManagedEventListeners({newColumnsLoaded:i,columnPivotModeChanged:i})}},Hk=class extends y{constructor(){super(...arguments);this.beanName="colToolPanelFactory"}setPanelVisible(e,t,s){if(e)e.setDisplayed(t);else if(t)e=s();return e}createRowGroupPanel(e,t,s){return this.createPanel(e,t,new Bk(!1,s))}createValuesPanel(e,t,s){return this.createPanel(e,t,new Vk(!1,s))}createPivotPanel(e,t,s){return this.createPanel(e,t,new Ok(!1,s))}createPivotModePanel(e,t,s,i,o){return this.createPanel(e,t,new _k(s,i),o)}createPanel(e,t,s,i){if(s=e.createBean(s),t.push(()=>e.destroyBean(s)),i)e.prependChild(s);else e.appendChild(s);return s}},dm=()=>{},zk=class extends y{constructor(){super(...arguments);this.beanName="columnStateUpdateExecutionStrategy"}applyColumnState(e,t,s){this.getUpdateStrategy(e).applyColumnState(t,s)}commit(e){this.getUpdateStrategy(e).commit()}hasPendingChanges(e){return this.getUpdateStrategy(e).hasPendingChanges()}moveColumns(e,t,s,i){this.getUpdateStrategy(e).moveColumns(t,s,i)}reset(e){this.getUpdateStrategy(e).reset()}setColumnsVisible(e,t,s,i){this.getUpdateStrategy(e).setColumnsVisible(t,s,i)}isColumnVisibleInToolPanel(e,t){return this.getUpdateStrategy(e).isColumnVisibleInToolPanel(t)}setRowGroupColumns(e,t,s){this.getUpdateStrategy(e).setRowGroupColumns(t,s)}getRowGroupColumns(e){return this.getUpdateStrategy(e).getRowGroupColumns()}getPrimaryColumns(e){return this.getUpdateStrategy(e).getPrimaryColumns()}hasDeferredColumnOrder(e){return this.getUpdateStrategy(e).hasDeferredColumnOrder()}setValueColumns(e,t,s){this.getUpdateStrategy(e).setValueColumns(t,s)}getValueColumns(e){return this.getUpdateStrategy(e).getValueColumns()}setColumnAggFunc(e,t,s,i){this.getUpdateStrategy(e).setColumnAggFunc(t,s,i)}getColumnAggFunc(e,t){return this.getUpdateStrategy(e).getColumnAggFunc(t)}setPivotColumns(e,t,s){this.getUpdateStrategy(e).setPivotColumns(t,s)}getPivotColumns(e){return this.getUpdateStrategy(e).getPivotColumns()}setPivotMode(e,t,s){this.getUpdateStrategy(e).setPivotMode(t,s)}getPivotMode(e){return this.getUpdateStrategy(e).getPivotMode()}isColumnSelectedInPivotModeToolPanel(e,t){return this.getUpdateStrategy(e).isColumnSelectedInPivotModeToolPanel(t)}progressSortFromEvent(e,t,s){this.getUpdateStrategy(e).progressSortFromEvent(t,s)}getSortDef(e,t){return this.getUpdateStrategy(e).getSortDef(t)}getUpdateStrategy(e){return e?this.getDeferredUpdateStrategy():this.getSyncUpdateStrategy()}getSyncUpdateStrategy(){return this.syncUpdateStrategy??(this.syncUpdateStrategy=new Wk(this.beans))}getDeferredUpdateStrategy(){return this.deferredUpdateStrategy??(this.deferredUpdateStrategy=new Uk(this.beans))}},Wk=class{constructor(e){this.beans=e,this.lastPivotColIds=[],this.reset=dm,this.commit=dm,this.hasPendingChanges=()=>!1,this.hasDeferredColumnOrder=()=>!1}applyColumnState(e,t){if(e.length===0)return;Je(this.beans,{state:e},t)}moveColumns(e,t,s){this.beans.colMoves?.moveColumns(e,t,s),Kk(this.beans)}setColumnsVisible(e,t,s){let i=e.filter((o)=>!o.colDef.lockVisible);this.beans.colModel.setColsVisible(i,t,s)}setRowGroupColumns(e,t){this.beans.rowGroupColsSvc?.setColumns(e,t)}getRowGroupColumns(){return this.beans.rowGroupColsSvc?.columns??[]}getPrimaryColumns(){return Wd(this.beans)}setValueColumns(e,t){this.beans.valueColsSvc?.setColumns(e,t)}getValueColumns(){return this.beans.valueColsSvc?.columns??[]}setColumnAggFunc(e,t,s){this.beans.valueColsSvc?.setColumnAggFunc?.(e,t,s)}getColumnAggFunc(e){return e.getAggFunc()}setPivotColumns(e,t){this.lastPivotColIds=e.map((s)=>s.colId),this.beans.pivotColsSvc?.setColumns(e,t)}getPivotColumns(){return this.beans.pivotColsSvc?.columns??[]}setPivotMode(e,t){let{colModel:s,gos:i,ctrlsSvc:o}=this.beans;if(e===s.pivotMode)return;let r=this.beans.pivotColsSvc?.columns.map((n)=>n.colId)??[];if(r.length>0)this.lastPivotColIds=r;if(!e){let n=this.beans.colModel.getColDefCols()??[];Je(this.beans,{state:n.map((a)=>({colId:a.colId,pivot:!1,pivotIndex:null}))},t)}if(i.updateGridOptions({options:{pivotMode:e},source:t}),e&&this.lastPivotColIds.length>0)this.beans.pivotColsSvc?.setColumns(this.lastPivotColIds,t);for(let n of o.getHeaderRowContainerCtrls())n.refresh()}progressSortFromEvent(e,t){this.beans.sortSvc?.progressSortFromEvent(e,t)}isColumnVisibleInToolPanel(e){return e.isVisible()}isColumnSelectedInPivotModeToolPanel(e){return e.isAnyFunctionActive()}getPivotMode(){return this.beans.colModel.pivotMode}getSortDef(e){return e.getSortDef()}},Uk=class{constructor(e){this.beans=e,this.state={},this.sequence=0,this.lastPivotColIds=[]}reset(){this.sequence=0,this.state={}}hasPendingChanges(){let{state:e,beans:t}=this,{columnState:s,columnOrder:i,rowGroup:o,aggregation:r,pivot:n,pivotMode:a,sort:l,aggFuncs:c}=e,d=(u)=>(u??[]).map((h)=>h.colId);if(s)for(let[u,h]of s.patches){let g=t.colModel.getColDefCol(u);if(!g)continue;if(h.hide!==void 0&&h.hide!==!g.isVisible()||h.rowGroup!==void 0&&!!h.rowGroup!==g.isRowGroupActive()||h.pivot!==void 0&&!!h.pivot!==g.isPivotActive()||h.aggFunc!==void 0&&(h.aggFunc??null)!==(g.getAggFunc()??null))return!0}if(i&&!se(i.colIds,bd(t)))return!0;if(o&&!se(o.colIds,d(t.rowGroupColsSvc?.columns)))return!0;if(r&&!se(r.colIds,d(t.valueColsSvc?.columns)))return!0;if(n&&!se(n.colIds,d(t.pivotColsSvc?.columns)))return!0;if(a&&a.pivotMode!==t.colModel.pivotMode)return!0;if(l){for(let[u,h]of l.sortDefsByColId){let g=t.colModel.getColDefCol(u);if(!g)continue;if((h?.direction??null)!==(g.getSortDef()?.direction??null))return!0}if(l.baselineCleared){let u=Wd(t);for(let h of u)if(!l.sortDefsByColId.has(h.colId)&&h.getSortDef()!==null)return!0}}if(c)for(let[u,h]of c.values){let g=t.colModel.getColDefCol(u);if(!g)continue;if(h!==g.getAggFunc())return!0}return!1}commit(){let{beans:e,state:t}=this,s=[];for(let o of Object.keys(t)){let r=t[o];if(r)s.push({type:o,...r})}let i=s.sort((o,r)=>o.seq-r.seq);for(let o of i)switch(o.type){case"columnState":{Je(e,{state:[...o.patches.values()]},o.eventType);break}case"columnOrder":{let r=o.colIds.map((n)=>e.colModel.getColDefCol(n)).filter((n)=>!!n&&vr(n));if(!e.colModel.pivotMode)for(let n=0;n<r.length;n++){let a=r[n],l=e.colModel.getCols(),c=l.findIndex((u)=>vr(u)),d=(c>=0?c:0)+n;if(l[d]!==a)e.colMoves?.moveColumns([a],d,o.eventType,!0)}hC(e,r);break}case"rowGroup":{e.rowGroupColsSvc?.setColumns(o.colIds,o.eventType);break}case"aggregation":{e.valueColsSvc?.setColumns(o.colIds,o.eventType);break}case"pivot":{this.lastPivotColIds=o.colIds,e.pivotColsSvc?.setColumns(o.colIds,o.eventType);break}case"pivotMode":{let{colModel:r,ctrlsSvc:n,gos:a,stateSvc:l}=e;if(o.pivotMode!==r.pivotMode){let c=e.pivotColsSvc?.columns.map((h)=>h.colId)??[];if(c.length>0)this.lastPivotColIds=c;let d=l?.getState().pivot?.pivotColIds??c,u=o.pivotMode?this.state.pivot?.colIds??this.lastPivotColIds:d;if(l?.setState({...l.getState(),pivot:{pivotMode:o.pivotMode,pivotColIds:u}},["pivot"]),!o.pivotMode){let h=e.colModel.getColDefCols()??[];Je(e,{state:h.map((g)=>({colId:g.colId,pivot:!1,pivotIndex:null}))},o.eventType)}if(a.updateGridOptions({options:{pivotMode:o.pivotMode},source:o.eventType}),o.pivotMode&&u.length>0)e.pivotColsSvc?.setColumns(u,o.eventType);for(let h of n.getHeaderRowContainerCtrls())h.refresh()}break}case"sort":{let r=[],n=0;for(let[a,l]of o.sortDefsByColId)r.push({colId:a,sort:l?.direction??null,sortIndex:l?.direction?n++:null,sortType:l?.type??void 0});Je(e,{state:r,defaultState:o.baselineCleared?{sort:null,sortIndex:null,sortType:void 0}:void 0},o.eventType);break}case"aggFuncs":{for(let[r,n]of o.values){let a=e.colModel.getColDefCol(r);if(!a)continue;e.valueColsSvc?.setColumnAggFunc?.(a,n,o.eventType)}break}}this.reset()}applyColumnState(e,t){for(let i of e)Sd(this.state,i);let s=ia(this.state);s.seq=hs(this.sequence),this.sequence=s.seq,s.eventType=t}moveColumns(e,t,s){let i=new Set(e.map((l)=>l.colId)),r=(this.state.columnOrder?.colIds??bd(this.beans)).filter((l)=>!i.has(l)),n=e.map((l)=>l.colId),a=hs(this.sequence);this.sequence=a,this.state.columnOrder={colIds:[...r.slice(0,t),...n,...r.slice(t)],eventType:s,seq:a}}setColumnsVisible(e,t,s){for(let o of e){if(o.colDef.lockVisible)continue;Sd(this.state,{colId:o.colId,hide:!t})}let i=ia(this.state);i.seq=hs(this.sequence),this.sequence=i.seq,i.eventType=s}setRowGroupColumns(e,t){yd(this.state,"rowGroup");let s=hs(this.sequence);this.sequence=s,this.state.rowGroup={colIds:e.map((i)=>i.colId),eventType:t,seq:s}}setValueColumns(e,t){yd(this.state,"aggFunc");let s=new Set((this.beans.valueColsSvc?.columns??[]).map((r)=>r.colId)),i=um(this.state);for(let r of e)if(!s.has(r.colId)&&!i.values.has(r.colId)){let n=r.getAggFunc(),a=n!=null?n:this.beans.aggFuncSvc?.getDefaultAggFunc(r);if(a!=null)i.values.set(r.colId,a)}let o=hs(this.sequence);this.sequence=o,i.seq=o,i.eventType=t,this.state.aggregation={colIds:e.map((r)=>r.colId),eventType:t,seq:o}}setColumnAggFunc(e,t,s){Sd(this.state,{colId:e.colId,aggFunc:t});let i=ia(this.state);i.seq=hs(this.sequence),this.sequence=i.seq,i.eventType=s;let o=um(this.state);o.seq=i.seq,o.eventType=s,o.values.set(e.colId,t)}getColumnAggFunc(e){let t=e.colId;if(this.state.aggFuncs?.values.has(t))return this.state.aggFuncs.values.get(t);return e.getAggFunc()}isColumnVisibleInToolPanel(e){let t=this.state.columnState?.patches.get(e.colId);if(t?.hide!==void 0)return!t.hide;return e.isVisible()}isColumnSelectedInPivotModeToolPanel(e){let t=e.colId,s=this.state.columnState?.patches.get(t),i;if(s?.rowGroup!==void 0)i=!!s.rowGroup;else if(this.state.rowGroup)i=this.state.rowGroup.colIds.includes(t);else i=e.isRowGroupActive();let o;if(s?.pivot!==void 0)o=!!s.pivot;else if(this.state.pivot)o=this.state.pivot.colIds.includes(t);else o=e.isPivotActive();let r;if(s?.aggFunc!==void 0)r=s.aggFunc!=null;else if(this.state.aggregation)r=this.state.aggregation.colIds.includes(t);else r=e.isValueActive();return i||o||r}setPivotColumns(e,t){yd(this.state,"pivot");let s=hs(this.sequence);this.sequence=s,this.state.pivot={colIds:e.map((i)=>i.colId),eventType:t,seq:s}}setPivotMode(e,t){let s=hs(this.sequence);this.sequence=s,this.state.pivotMode={pivotMode:e,eventType:t,seq:s}}getRowGroupColumns(){return lr(this.beans,wd(this.state.rowGroup?.colIds,this.beans.rowGroupColsSvc?.columns,this.state.columnState?.patches,(e)=>e.rowGroup==null?void 0:!!e.rowGroup))}getPrimaryColumns(){return lr(this.beans,this.state.columnOrder?.colIds??bd(this.beans))}hasDeferredColumnOrder(){return!!this.state.columnOrder}getValueColumns(){return lr(this.beans,wd(this.state.aggregation?.colIds,this.beans.valueColsSvc?.columns,this.state.columnState?.patches,(e)=>e.aggFunc===void 0?void 0:e.aggFunc!=null))}getPivotColumns(){if(!this.getPivotMode())return[];let e=this.beans.pivotColsSvc?.columns,t=e?.length?e:lr(this.beans,this.lastPivotColIds);return lr(this.beans,wd(this.state.pivot?.colIds,t,this.state.columnState?.patches,(s)=>s.pivot==null?void 0:!!s.pivot))}getPivotMode(){return this.state.pivotMode?.pivotMode??this.beans.colModel.pivotMode}getSortDef(e){let t=this.state.sort,s=e.colId,i=t?.sortDefsByColId;if(i?.has(s))return i.get(s)??null;if(t?.baselineCleared)return null;return e.getSortDef()}progressSortFromEvent(e,t){let s=this.state.sort??{sortDefsByColId:new Map,baselineCleared:!1,seq:0,eventType:"toolPanelUi"},{sortSvc:i}=this.beans,o=e.colId,r;if(s.sortDefsByColId.has(o))r=s.sortDefsByColId.get(o);else if(s.baselineCleared)r=null;else r=e.getSortDef();let n=i?.getNextSortDirection(e,r);if(!n)return;let{gos:a}=this.beans;if(!(((a.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey)||a.get("alwaysMultiSort"))&&!a.get("suppressMultiSort")))s.sortDefsByColId.clear(),s.baselineCleared=!0;s.sortDefsByColId.set(o,n.direction?n:null),s.seq=hs(this.sequence),this.sequence=s.seq,this.state.sort=s}};function lr(e,t){if(!t)return[];return t.map((s)=>e.colModel.getColDefCol(s)).filter((s)=>!!s)}function wd(e,t,s,i){let o=[...e??t?.map((n)=>n.colId)??[]];if(!s?.size)return o;let r=new Set(o);for(let[n,a]of s){let l=i(a);if(l===void 0)continue;if(l){if(!r.has(n))o.push(n),r.add(n);continue}if(!r.has(n))continue;r.delete(n);let c=o.indexOf(n);if(c>=0)o.splice(c,1)}return o}function Kk(e){let t=e.colModel.getCols().filter((s)=>vr(s)).map((s)=>e.colModel.getColDefCol(s.colId)).filter((s)=>!!s);hC(e,t)}function hC(e,t){let s=$k(e);if(!s)return;let i=new Set(t);s.list=[...t,...s.list.filter((o)=>vr(o)&&!i.has(o))]}function bd(e){return Wd(e).map((t)=>t.colId)}function Wd(e){return(e.colModel.getColDefCols()??e.colModel.getCols()).filter((t)=>vr(t))}function $k(e){let t=e.colModel.colDefCols,s=t?.list;if(!Array.isArray(s))return;return t}function vr(e){if(!e.primary)return!1;return!gi(e)&&!Yo(e)}function hs(e){return e+1}function Sd(e,t){let s=ia(e),i=s.patches.get(t.colId);s.patches.set(t.colId,i?{...i,...t}:t)}function yd(e,t){let s=e.columnState?.patches;if(!s?.size)return;for(let[i,o]of s){if(!(t in o))continue;let r={...o};if(delete r[t],Object.keys(r).length===1){s.delete(i);continue}s.set(i,r)}}function ia(e){let{columnState:t}=e;if(!t)t={patches:new Map,seq:0,eventType:"toolPanelUi"},e.columnState=t;return t}function um(e){let{aggFuncs:t}=e;if(!t)t={values:new Map,seq:0,eventType:"toolPanelUi"},e.aggFuncs=t;return t}var jk=class extends y{constructor(){super(...arguments);this.beanName="columnStateUpdateStrategy"}applyColumnState(e,t,s){this.delegate("applyColumnState",e,t,s)}commit(e){this.delegate("commit",e)}hasPendingChanges(e){return this.delegate("hasPendingChanges",e)}moveColumns(e,t,s,i){this.delegate("moveColumns",e,t,s,i)}reset(e){this.delegate("reset",e)}setColumnsVisible(e,t,s,i){this.delegate("setColumnsVisible",e,t,s,i)}isColumnVisibleInToolPanel(e,t){return this.delegate("isColumnVisibleInToolPanel",e,t)}setRowGroupColumns(e,t,s){this.delegate("setRowGroupColumns",e,t,s)}getRowGroupColumns(e){return this.delegate("getRowGroupColumns",e)}getPrimaryColumns(e){return this.delegate("getPrimaryColumns",e)}hasDeferredColumnOrder(e){return this.delegate("hasDeferredColumnOrder",e)}setValueColumns(e,t,s){this.delegate("setValueColumns",e,t,s)}getValueColumns(e){return this.delegate("getValueColumns",e)}setColumnAggFunc(e,t,s,i){this.delegate("setColumnAggFunc",e,t,s,i)}getColumnAggFunc(e,t){return this.delegate("getColumnAggFunc",e,t)}setPivotColumns(e,t,s){this.delegate("setPivotColumns",e,t,s)}getPivotColumns(e){return this.delegate("getPivotColumns",e)}setPivotMode(e,t,s){this.delegate("setPivotMode",e,t,s)}getPivotMode(e){return this.delegate("getPivotMode",e)}isColumnSelectedInPivotModeToolPanel(e,t){return this.delegate("isColumnSelectedInPivotModeToolPanel",e,t)}progressSortFromEvent(e,t,s){this.delegate("progressSortFromEvent",e,t,s)}getSortDef(e,t){return this.delegate("getSortDef",e,t)}getUpdateStrategy(){return this.executionStrategy??(this.executionStrategy=this.createManagedBean(new zk))}delegate(e,...t){let s=this.getUpdateStrategy();return s[e].bind(s)(...t)}},gC={moduleName:"SharedColumnStateUpdateStrategy",version:ie,beans:[jk],dependsOn:[_e]},pC={moduleName:"ColumnsToolPanel",version:ie,beans:[Hk],userComponents:{agColumnsToolPanel:Mk},icons:{ensureColumnVisible:"column-arrow",columnsToolPanel:"columns",menuAddRowGroup:"group",menuRemoveRowGroup:"group",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},dependsOn:[_e,gC,Vd,or,ir,Ci,Nd]},qk=class extends y{constructor(){super(...arguments);this.beanName="chartMenuItemMapper"}getChartItems(e){let t=this.beans,s=t.chartSvc,i=e==="pivotChart";if(!s)return null;let o=this.getLocaleTextFunc.bind(this),r=i?new Yk(t,s,o):new Xk(t,s,o),n=s.isEnterprise(),a=r.getMenuItem();if(a?.subMenu&&!n){let c=(d)=>({...d,subMenu:d.subMenu?.filter((u)=>!u._enterprise).map((u)=>c(u))});a=c(a)}let l=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;if(l)a=this.filterAndOrderChartMenu(a,l,r.getConfigLookup());return this.cleanInternals(a)}cleanInternals(e){if(!e)return e;let t=(s)=>{delete s?._key,delete s?._enterprise;for(let i of s?.subMenu??[])t(i);return s};return t(e)}buildLookup(e){let t={},s=(i)=>{if(t[i._key]=i,i.subMenu)for(let o of i.subMenu)s(o)};return s(e),t}filterAndOrderChartMenu(e,t,s){let i=this.buildLookup(e),o={...e,subMenu:[]};for(let r of Object.keys(t)){let n=t[r],a=s[r];if(a===null)continue;if(a==null){F(173,{group:r});continue}let l=i[a._key];if(l)if(l.subMenu){let c=n.map((d)=>{let u=a[d];if(u==null){F(174,{group:r,chartType:d});return}return i[u]}).filter((d)=>d!==void 0);if(c.length>0)l.subMenu=c,o.subMenu?.push(l)}else o.subMenu?.push(l)}if(o.subMenu?.length==0)return null;return o}},Yk=class{constructor(e,t,s){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=s}getMenuItem(){let e=this.getLocaleTextFunc(),t=(s,i,o,r,n=!1)=>({name:e(s,i+"‎"),action:()=>this.chartSvc.createPivotChart({chartType:o}),_key:r,_enterprise:n});return{name:e("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped","groupedColumn","pivotGroupedColumn"),t("stackedColumn","Stacked","stackedColumn","pivotStackedColumn"),t("normalizedColumn","100% Stacked","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped","groupedBar","pivotGroupedBar"),t("stackedBar","Stacked","stackedBar","pivotStackedBar"),t("normalizedBar","100% Stacked","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:e("pieChart","Pie"),subMenu:[t("pie","Pie","pie","pivotPie"),t("donut","Donut","donut","pivotDonut")]},{_key:"pivotLineChart",name:e("lineChart","Line"),subMenu:[t("lineChart","Line","line","pivotLineChart"),t("stackedLine","Stacked","stackedLine","pivotStackedLine"),t("normalizedLine","100% Stacked","normalizedLine","pivotNormalizedLine")]},{_key:"pivotAreaChart",name:e("areaChart","Area"),subMenu:[t("areaChart","Area","area","pivotArea"),t("stackedArea","Stacked","stackedArea","pivotStackedArea"),t("normalizedArea","100% Stacked","normalizedArea","pivotNormalizedArea")]},{_key:"pivotXYChart",name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter","scatter","pivotScatter"),t("bubble","Bubble","bubble","pivotBubble")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:e("statisticalChart","Statistical"),subMenu:[t("histogramChart","Histogram","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemapChart","Treemap","treemap","pivotTreemap",!0),t("sunburstChart","Sunburst","sunburst","pivotSunburst",!0)]},{_key:"pivotFunnel",name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel","funnel","pivotFunnel"),t("coneFunnel","Cone Funnel","coneFunnel","pivotConeFunnel"),t("pyramid","Pyramid","pyramid","pivotPyramid")]},{_key:"pivotCombinationChart",name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line","columnLineCombo","pivotColumnLineCombo"),t("AreaColumnCombo","Area & Column","areaColumnCombo","pivotAreaColumnCombo")]}],icon:N("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart",stackedLine:"pivotStackedLine",normalizedLine:"pivotNormalizedLine"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},funnelGroup:{_key:"pivotFunnel",funnel:"pivotFunnel",coneFunnel:"pivotConeFunnel",pyramid:"pivotPyramid"},polarGroup:null,specializedGroup:null}}},Xk=class{constructor(e,t,s){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=s}getMenuItem(){let e=this.getLocaleTextFunc(),t=(s,i,o,r,n=!1)=>({name:e(s,i),action:()=>this.chartSvc.createChartFromCurrentRange(o),_key:r,_enterprise:n});return{name:e("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped","groupedColumn","rangeGroupedColumn"),t("stackedColumn","Stacked","stackedColumn","rangeStackedColumn"),t("normalizedColumn","100% Stacked","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped","groupedBar","rangeGroupedBar"),t("stackedBar","Stacked","stackedBar","rangeStackedBar"),t("normalizedBar","100% Stacked","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:e("pieChart","Pie"),subMenu:[t("pie","Pie","pie","rangePie"),t("donut","Donut","donut","rangeDonut")],_key:"rangePieChart"},{name:e("lineChart","Line"),subMenu:[t("lineChart","Line","line","rangeLineChart"),t("stackedLine","Stacked","stackedLine","rangeStackedLine"),t("normalizedLine","100% Stacked","normalizedLine","rangeNormalizedLine")],_key:"rangeLineChart"},{name:e("areaChart","Area"),subMenu:[t("areaChart","Area","area","rangeArea"),t("stackedArea","Stacked","stackedArea","rangeStackedArea"),t("normalizedArea","100% Stacked","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter","scatter","rangeScatter"),t("bubble","Bubble","bubble","rangeBubble")],_key:"rangeXYChart"},{name:e("polarChart","Polar"),subMenu:[t("radarLine","Radar Line","radarLine","rangeRadarLine"),t("radarArea","Radar Area","radarArea","rangeRadarArea"),t("nightingale","Nightingale","nightingale","rangeNightingale"),t("radialColumn","Radial Column","radialColumn","rangeRadialColumn"),t("radialBar","Radial Bar","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:e("statisticalChart","Statistical"),subMenu:[t("boxPlot","Box Plot","boxPlot","rangeBoxPlot",!0),t("histogramChart","Histogram","histogram","rangeHistogram",!1),t("rangeBar","Range Bar","rangeBar","rangeRangeBar",!0),t("rangeArea","Range Area","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemap","Treemap","treemap","rangeTreemap"),t("sunburst","Sunburst","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:e("specializedChart","Specialized"),subMenu:[t("heatmap","Heatmap","heatmap","rangeHeatmap"),t("waterfall","Waterfall","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel","funnel","rangeFunnel"),t("coneFunnel","Cone Funnel","coneFunnel","rangeConeFunnel"),t("pyramid","Pyramid","pyramid","rangePyramid")],_key:"rangeFunnel",_enterprise:!0},{name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line","columnLineCombo","rangeColumnLineCombo"),t("AreaColumnCombo","Area & Column","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:N("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart",stackedLine:"rangeStackedLine",normalizedLine:"rangeNormalizedLine"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},funnelGroup:{_key:"rangeFunnel",funnel:"rangeFunnel",coneFunnel:"rangeConeFunnel",pyramid:"rangePyramid"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},Zk=class extends y{constructor(){super(...arguments);this.beanName="colChooserFactory"}createColumnSelectPanel(e,t,s,i){let o=e.createManagedBean(new uC),r=i??t?.colDef.columnChooserParams??{},{contractColumnSelection:n,suppressColumnExpandAll:a,suppressColumnFilter:l,suppressColumnSelectAll:c,suppressSyncLayoutWithGrid:d,columnLayout:u}=r;if(o.init(!!s,I(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!n,suppressColumnExpandAll:!!a,suppressColumnFilter:!!l,suppressColumnSelectAll:!!c,suppressSyncLayoutWithGrid:!!u||!!d,onStateUpdated:()=>{}}),"columnMenu"),u)o.setColumnLayout(u);return o}showColumnChooser({column:e,chooserParams:t,eventSource:s,headerPosition:i}){this.hideActiveColumnChooser();let o=this.createColumnSelectPanel(this,e,!0,t),r=this.getLocaleTextFunc(),n=this.beans,{visibleCols:a,focusSvc:l,menuUtils:c}=n,d=a.allCols.indexOf(e),u=e?l.focusedHeader??i??null:null;this.activeColumnChooserDialog=this.createBean(new w3({title:r("chooseColumns","Choose Columns"),component:o,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{Ie(n,o.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:(h)=>{let g=this.activeColumnChooser.getGui();if(this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e)c.restoreFocusOnClose({column:e,headerPosition:u,columnIndex:d,eventSource:s},g,h,!0)},postProcessPopupParams:{type:"columnChooser",column:e,eventSource:s}})),this.activeColumnChooser=o}hideActiveColumnChooser(){this.activeColumnChooserDialog=this.destroyBean(this.activeColumnChooserDialog)}destroy(){this.hideActiveColumnChooser(),super.destroy()}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:"columnChooser",column:t??null})}},Qk={pinSubMenu:"PinnedColumn",pinLeft:"PinnedColumn",pinRight:"PinnedColumn",clearPinned:"PinnedColumn",pinRowSubMenu:"PinnedRow",pinBottom:"PinnedRow",pinTop:"PinnedRow",unpinRow:"PinnedRow",valueAggSubMenu:"SharedAggregation",autoSizeThis:"ColumnAutoSize",autoSizeAll:"ColumnAutoSize",rowGroup:"SharedRowGrouping",rowUnGroup:"SharedRowGrouping",resetColumns:"CommunityCore",expandAll:["CsrmHierarchy","ServerSideRowModel"],contractAll:["CsrmHierarchy","ServerSideRowModel"],copy:"Clipboard",copyWithHeaders:"Clipboard",copyWithGroupHeaders:"Clipboard",cut:"Clipboard",paste:"Clipboard",note:"Notes",export:["CsvExport","ExcelExport"],csvExport:"CsvExport",excelExport:"ExcelExport",separator:"CommunityCore",pivotChart:"IntegratedCharts",chartRange:"IntegratedCharts",columnFilter:"ColumnFilter",columnChooser:"ColumnMenu",sortAscending:"Sort",sortDescending:"Sort",sortAbsoluteAscending:"Sort",sortAbsoluteDescending:"Sort",sortUnSort:"Sort"};function Jk(e,t){let s=Qk[t];if(s)e.assertModuleRegistered(s,`menu item '${t}'`)}var gs="separator";function fC(e,t){if(!e?.length)return;let s=0,i=!0;for(let o of e){let r=o===t;if(r&&i)continue;e[s++]=o,i=r}if(s>0&&e[s-1]===t)s--;e.length=s}var eL={sortAscending:{fallback:"Sort Ascending",getSortDef:()=>({type:"default",direction:"asc"})},sortDescending:{fallback:"Sort Descending",getSortDef:()=>({type:"default",direction:"desc"})},sortAbsoluteAscending:{fallback:"Sort Absolute Ascending",getSortDef:()=>({type:"absolute",direction:"asc"})},sortAbsoluteDescending:{fallback:"Sort Absolute Descending",getSortDef:()=>({type:"absolute",direction:"desc"})},sortUnSort:{fallback:"Clear Sort",getSortDef:(e)=>({type:At(e.getSortDef()?.type),direction:null})}},tL=class extends y{constructor(){super(...arguments);this.beanName="menuItemMapper"}mapWithStockItems(e,t,s,i,o,r){if(!e)return[];let n=[],a=this.getLocaleTextFunc(),{beans:l,gos:c}=this,{pinnedCols:d,colAutosize:u,aggFuncSvc:h,rowGroupColsSvc:g,colNames:p,colModel:f,clipboardSvc:m,expansionSvc:C,focusSvc:v,csvCreator:w,excelCreator:S,menuSvc:x,colChooserFactory:R,sortSvc:P,chartMenuItemMapper:D,valueColsSvc:O,pinnedRowModel:A,notesSvc:_}=l,oe=(Y,V,re,le)=>{switch(Jk(c,Y),Y){case"pinSubMenu":return d&&V?{name:a("pinColumn","Pin Column"),icon:N("menuPin",l,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return d&&V?{name:a("pinLeft","Pin Left"),action:()=>d.setColsPinned([V],"left",le),checked:!!V&&V.isPinnedLeft()}:null;case"pinRight":return d&&V?{name:a("pinRight","Pin Right"),action:()=>d.setColsPinned([V],"right",le),checked:!!V&&V.isPinnedRight()}:null;case"clearPinned":return d&&V?{name:a("noPin","No Pin"),action:()=>d.setColsPinned([V],null,le),checked:!!V&&!V.isPinned()}:null;case"pinRowSubMenu":{let U=c.get("enableRowPinning"),W=[],Re=s?.rowPinned??s?.pinnedSibling?.rowPinned;if(Re)W.push("unpinRow");if(U&&U!=="bottom"&&Re!="top")W.push("pinTop");if(U&&U!=="top"&&Re!="bottom")W.push("pinBottom");return A?.isManual()?{name:a("pinRow","Pin Row"),icon:N("rowPin",l,V),subMenu:W}:null}case"pinTop":return A?.isManual()?{name:a("pinTop","Pin to Top"),icon:N("rowPinTop",l,V),action:({node:U,column:W})=>U&&A.pinRow(U,"top",W)}:null;case"pinBottom":return A?.isManual()?{name:a("pinBottom","Pin to Bottom"),icon:N("rowPinBottom",l,V),action:({node:U,column:W})=>U&&A.pinRow(U,"bottom",W)}:null;case"unpinRow":return A?.isManual()?{name:a("unpinRow","Unpin Row"),icon:N("rowUnpin",l,V),action:({node:U,column:W})=>U&&A.pinRow(U,null,W)}:null;case"valueAggSubMenu":if(h&&O&&(V?.primary||V?.colDef.pivotValueColumn))return{name:a("valueAggregation","Value Aggregation"),icon:N("menuValue",l,null),subMenu:iL(V,h,O,a),disabled:c.get("functionsReadOnly")};else return null;case"autoSizeThis":return u?{name:a("autosizeThisColumn","Autosize This Column"),action:()=>V&&u.autoSizeColumn(V,le,c.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return u?{name:a("autosizeAllColumns","Autosize All Columns"),action:()=>u.autoSizeAllColumns({source:le,skipHeader:c.get("skipHeaderOnAutoSize")})}:null;case"rowGroup":return g?{name:pr(a,"groupBy",p.getDisplayNameForColumn(V,"header")),disabled:c.get("functionsReadOnly")||V?.isRowGroupActive()||!V?.colDef.enableRowGroup,action:()=>g.addColumns([V],le),icon:N("menuAddRowGroup",l,null)}:null;case"rowUnGroup":if(g&&c.isModuleRegistered("SharedRowGrouping")){let U=V?.colDef.showRowGroup,W=c.get("groupLockGroupColumns"),Re,ne,Ot;if(U===!0)Re=a("ungroupAll","Un-Group All"),ne=c.get("functionsReadOnly")||W===-1||W>=(g.columns.length??0),Ot=()=>g.setColumns(g.columns.slice(0,W),le);else if(typeof U==="string"){let Ys=f.getColDefCol(U),fs=Ys!=null?p.getDisplayNameForColumn(Ys,"header"):U;Re=pr(a,"ungroupBy",fs),ne=c.get("functionsReadOnly")||Cr(Ys,l),Ot=()=>{g.removeColumns([U],le)}}else Re=pr(a,"ungroupBy",p.getDisplayNameForColumn(V,"header")),ne=c.get("functionsReadOnly")||!V?.isRowGroupActive()||!V?.colDef.enableRowGroup||Cr(V,l),Ot=()=>g.removeColumns([V],le);return{name:Re,disabled:ne,action:Ot,icon:N("menuRemoveRowGroup",l,null)}}else return null;case"resetColumns":return{name:a("resetColumns","Reset Columns"),action:()=>Cp(l,le)};case"expandAll":return C?{name:a("expandAll","Expand All Row Groups"),action:()=>C.expandAll(!0)}:null;case"contractAll":return C?{name:a("collapseAll","Collapse All Row Groups"),action:()=>C.expandAll(!1)}:null;case"copy":return m?{name:a("copy","Copy"),shortcut:a("ctrlC","Ctrl+C"),icon:N("clipboardCopy",l,null),action:()=>m.copyToClipboard()}:null;case"copyWithHeaders":return m?{name:a("copyWithHeaders","Copy with Headers"),icon:N("clipboardCopy",l,null),action:()=>m.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return m?{name:a("copyWithGroupHeaders","Copy with Group Headers"),icon:N("clipboardCopy",l,null),action:()=>m.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(m){let U=v.getFocusedCell(),W=U?Ee(l,U):null,Re=W?U?.column.isCellEditable(W):!1;return{name:a("cut","Cut"),shortcut:a("ctrlX","Ctrl+X"),icon:N("clipboardCut",l,null),disabled:!Re||c.get("suppressCutToClipboard"),action:()=>m.cutToClipboard(void 0,"contextMenu")}}else return null;case"paste":if(m){let U=c.get("suppressClipboardApi")||c.get("suppressClipboardPaste")||!V||!s||!V.isCellEditable(s)||V.isSuppressPaste(s);return{name:a("paste","Paste"),shortcut:a("ctrlV","Ctrl+V"),icon:N("clipboardPaste",l,null),disabled:U,action:()=>m.pasteFromClipboard()}}else return null;case"export":{let U=[];if(!c.get("suppressCsvExport")&&w)U.push("csvExport");if(!c.get("suppressExcelExport")&&S)U.push("excelExport");return U.length?{name:a("export","Export"),subMenu:U,icon:N("save",l,null)}:null}case"csvExport":return w?{name:a("csvExport","CSV Export"),icon:N("csvExport",l,null),action:()=>w.exportDataAsCsv()}:null;case"excelExport":return S?{name:a("excelExport","Excel Export"),icon:N("excelExport",l,null),action:()=>S.exportDataAsExcel()}:null;case"separator":return Y;case"pivotChart":case"chartRange":return D.getChartItems(Y);case"columnFilter":return x&&V?{name:a("columnFilter","Column Filter"),icon:N("filter",l,null),action:()=>x.showFilterMenu({column:V,buttonElement:re(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{let U=v.focusedHeader;return R?{name:a("columnChooser","Choose Columns"),icon:N("columns",l,null),action:()=>R.showColumnChooser({column:V,eventSource:re(),headerPosition:U})}:null}case"sortUnSort":case"sortAscending":case"sortDescending":case"sortAbsoluteAscending":case"sortAbsoluteDescending":{if(!P||!V)return null;let{fallback:U,getSortDef:W}=eL[Y];return{name:a(Y,U),icon:N(Y,l,null),action:()=>P.setSortForColumn(V,W(V),!1,le)}}default:return F(176,{key:Y}),null}};for(let Y of e){let V;if(typeof Y==="string"){if(Y==="note"){let U=sL({notesSvc:_,column:t,node:s,noteParams:i,localeTextFunc:a});if(U.length)n.push(gs,...U,gs);continue}V=oe(Y,t,o,r)}else V={...Y};if(!V)continue;let re=V,{subMenu:le}=re;if(le&&le instanceof Array)re.subMenu=this.mapWithStockItems(le,t,s,i,o,r);if(V!=null)n.push(V)}return fC(n,gs),n}};function sL({notesSvc:e,column:t,node:s,noteParams:i,localeTextFunc:o}){let r=e?.hasDataSource()?i?e.getNoteAccess(i):t&&s?e.getNoteAccess({rowNode:s,column:t}):void 0:void 0;if(!r)return[];let n=[];if(!r.note)return n.push({name:o("addNote","Add Note"),shortcut:o("shiftF2","Shift+F2"),disabled:!r.canCreate,action:r.canCreate?()=>e.showNote(r.params,!0):void 0}),n;if(r.canView&&(r.isReadOnly||r.isSuppressed))n.push({name:o("viewNote","View Note"),shortcut:o("shiftF2","Shift+F2"),action:()=>e.showNote(r.params,!0)});if(!r.isReadOnly&&!r.isSuppressed)n.push({name:o("editNote","Edit Note"),shortcut:o("shiftF2","Shift+F2"),disabled:!r.canEdit,action:r.canEdit?()=>e.showNote(r.params,!0):void 0});return n.push({name:o("deleteNote","Remove Note"),disabled:!r.canDelete,action:r.canDelete?()=>e.setNote({...r.params,note:void 0}):void 0}),n}function iL(e,t,s,i){let o;if(e.primary)o=e;else{let n=e.colDef.pivotValueColumn;o=M(n)?n:void 0}let r=[];if(o){let n=o.isValueActive(),a=t.getFuncNames(o);r.push({name:i("noAggregation","None"),action:()=>{s.removeColumns([o],"contextMenu"),s.setColumnAggFunc(o,void 0,"contextMenu")},checked:!n});for(let l of a)r.push({name:i(l,t.getDefaultFuncLabel(l)),action:()=>{s.setColumnAggFunc(o,l,"contextMenu"),s.addColumns([o],"contextMenu")},checked:n&&o.getAggFunc()===l})}return r}var oL=class extends y{constructor(){super(...arguments);this.beanName="colMenuFactory"}createMenu(e,t,s,i){let o=e.createManagedBean(new Hd(0,{column:s??null,node:null,value:null})),r=this.beans.menuItemMapper.mapWithStockItems(t,s??null,null,void 0,i,"columnMenu");return o.addMenuItems(r),o}getMenuItems(e=null,t=null){let s=this.getDefaultMenuOptions(e),i,o=(e?.colDef??t?.getColGroupDef())?.mainMenuItems;if(Array.isArray(o))i=o;else if(typeof o==="function")i=o(I(this.gos,{column:e,columnGroup:t,defaultItems:s}));else{let r=this.gos.getCallback("getMainMenuItems");if(r)i=r({column:e,columnGroup:t,defaultItems:s});else i=s}return fC(i,gs),i}getDefaultMenuOptions(e){let t=[],{beans:s,gos:i}=this,{colChooserFactory:o,rowGroupColsSvc:r,colModel:n,expansionSvc:a,sortSvc:l,menuSvc:c,pinnedCols:d,aggFuncSvc:u,colAutosize:h}=s,g=be(i),p=()=>{if(!g&&o)t.push("columnChooser");t.push("resetColumns")};if(!e)return p(),t;let{colDef:f}=e,m=d&&!f.lockPinned,C=r?.columns.length??0,v=C>0,w=Xt(i),S=i.get("treeData"),x=e.primary,R=!x||u&&e.isAllowValue()&&(v||w||S);if(l&&!g&&e.isSortable()){let{isDefaultSortAllowed:P,isAbsoluteSortAllowed:D,isAbsoluteSort:O,isDefaultSort:A,isAscending:_,isDescending:oe,direction:Y}=tc(e,s);if(P&&!(_&&A))t.push("sortAscending");if(P&&!(oe&&A))t.push("sortDescending");if(D&&!(_&&O))t.push("sortAbsoluteAscending");if(D&&!(oe&&O))t.push("sortAbsoluteDescending");if(Y)t.push("sortUnSort");t.push(gs)}if(c?.isFilterMenuItemEnabled(e))t.push("columnFilter"),t.push(gs);if(m)t.push("pinSubMenu");if(R)t.push("valueAggSubMenu");if(m||R)t.push(gs);if(h){if(!f.suppressAutoSize)t.push("autoSizeThis");t.push("autoSizeAll"),t.push(gs)}if(r&&i.isModuleRegistered("SharedRowGrouping")){let P=t.length;if(f.showRowGroup)t.push("rowUnGroup");else if(e.isAllowRowGroup()&&x)if(e.isRowGroupActive()){if(!Cr(e,s))t.push("rowUnGroup")}else t.push("rowGroup");if(t.length>P)t.push(gs)}if(p(),a&&(J(i)||i.get("ssrmExpandAllAffectsAllRows"))&&(S||C>(n.pivotMode?1:0)))t.push("expandAll"),t.push("contractAll");return t}},hm="ag-context-menu-open",rL=class extends y{constructor(){super(...arguments);this.beanName="contextMenuSvc",this.focusedCell=null}postConstruct(){this.menu=this.createManagedBean(new l3({menuItemCallbacks:_d,getMenuItems:this.getMenuItems.bind(this),mapMenuItems:this.mapWithStockItems.bind(this),beforeMenuOpen:this.beforeMenuOpen.bind(this),onMenuOpen:this.onMenuOpen.bind(this),onMenuClose:this.onMenuClose.bind(this),afterMenuDestroyed:this.afterMenuDestroyed.bind(this),onVisibleChanged:this.dispatchVisibleChangedEvent.bind(this),shouldBlockMenuOpen:()=>!!this.beans.overlays?.exclusive}))}hideActiveMenu(){this.menu.hideActiveMenu()}getMenuItems(e,t){let{column:s,node:i,value:o}=e,r=[],{clipboardSvc:n,chartSvc:a,csvCreator:l,excelCreator:c,colModel:d,rangeSvc:u,gos:h,notesSvc:g}=this.beans;if(M(i)&&n){if(s){if(!h.get("suppressCutToClipboard"))r.push("cut");r.push("copy","copyWithHeaders","copyWithGroupHeaders","paste","separator")}}if(M(i)&&s&&g?.hasDataSource())r.push("note");if(h.get("enableCharts")&&a){if(d.pivotMode)r.push("pivotChart");if(u&&!u.isEmpty())r.push("chartRange")}if(M(i)){let C=h.get("enableRowPinning"),v=h.get("isRowPinnable");if(C){let P=i.level>-1&&i.footer,D=i.level===-1&&i.footer,O=Xt(h);if(D&&!(O==="pinnedBottom"||O==="pinnedTop")||!D&&!P){if(v?.(i)??!0)r.push("pinRowSubMenu")}}let w=h.get("suppressExcelExport")||!c,S=h.get("suppressCsvExport")||!l;if(!os()&&(!w||!S))r.push("export")}let p=r.length?r:void 0,f=s?.getColDef().contextMenuItems;if(Array.isArray(f))return f;if(typeof f==="function")return f(I(h,{column:s,node:i,value:o,defaultItems:p,event:t}));return h.getCallback("getContextMenuItems")?.({column:s,node:i,value:o,defaultItems:p,event:t})??r}getContextMenuPosition(e,t){let s=this.getRowCtrl(e),i=this.getCellGui(s,t);if(!i)return{x:0,y:s?.getRowYPosition()??0};let o=i.getBoundingClientRect();return{x:o.x+o.width/2,y:o.y+o.height/2}}showContextMenu(e){let t=e.rowNode??null,s=e.column??null,{anchorToElement:i,value:o,source:r,noteParams:n}=e;if(t&&s&&o==null)o=this.beans.valueSvc.getValueForDisplay({column:s,node:t,from:"edit"}).value;if(i==null)i=this.getContextMenuAnchorElement(t,s);this.beans.menuUtils.onContextMenu({mouseEvent:e.mouseEvent??null,touchEvent:e.touchEvent??null,showMenuCallback:(a)=>this.menu.showMenu({node:t,column:s,value:o,noteParams:n},a,i),source:r})}handleContextMenuMouseEvent(e,t,s,i){let o=s?.findFullWidthInfoForEvent(e||t),r=i?.rowNode??s?.rowNode??null,n=i?.column??o?.column??null,a=i?{rowNode:i.rowNode,column:i.column}:s&&o?{rowNode:s.rowNode,location:"fullWidthRow",pinned:o.pinned==="left"||o.pinned==="right"?o.pinned:void 0}:void 0,{valueSvc:l,ctrlsSvc:c}=this.beans,d=n?l.getValue(n,r,"edit"):null,u=c.getGridBodyCtrl(),h=i?i.eGui:u.eGridBody;this.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:r,column:n,value:d,anchorToElement:h,noteParams:a,source:"ui"})}beforeMenuOpen(e){if(!e.column)this.beans.focusSvc.clearFocusedCell()}onMenuOpen(){let{ctrlsSvc:e,focusSvc:t}=this.beans;e.getGridBodyCtrl().eGridBody.classList.add(hm),this.focusedCell=t.getFocusedCell()}onMenuClose(){this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.classList.remove(hm)}afterMenuDestroyed(){let{beans:e,focusedCell:t}=this;mc(e,t)}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"contextMenuVisibleChanged",visible:e,source:t})}getRowCtrl(e){let{rowIndex:t,rowPinned:s}=e||{};if(t==null)return;return this.beans.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:s})||void 0}getCellGui(e,t){if(!e||!t)return;return e.getCellCtrl(t)?.eGui||void 0}getContextMenuAnchorElement(e,t){let s=this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody,i=this.getRowCtrl(e);if(!i)return s;let o=this.getCellGui(i,t);if(o)return o;if(i.isFullWidth())return i.getFullWidthElement();return s}mapWithStockItems(e,t,s){let{column:i,node:o}=t;return this.beans.menuItemMapper.mapWithStockItems(e,i,o,t.noteParams,s,"contextMenu")}},Ks="filterMenuTab",$s="generalMenuTab",wi="columnsMenuTab",oa=[$s,Ks,wi],nL=class extends y{constructor(){super(...arguments);this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,s,i,o){let{column:r,columnGroup:n}=this.splitColumnOrGroup(e),a=o?"filterMenuTab":void 0;this.showMenu(r,n,(l)=>{let c=l.getGui();if(this.beans.popupSvc.positionPopupUnderMouseEvent({type:s,additionalParams:{column:r},mouseEvent:t,ePopup:c}),a)l.showTab?.(a);this.dispatchVisibleChangedEvent(!0,!1,r,n,a)},s,a,void 0,t.target,i)}splitColumnOrGroup(e){let t=e&&ht(e);return{column:t?e:void 0,columnGroup:t?void 0:e}}showMenuAfterButtonClick(e,t,s,i,o){let r=-1,n="left";if(this.gos.get("enableRtl"))r=1,n="right";let a=o?"filterMenuTab":void 0,l=a?[a]:void 0,c=be(this.gos),d=(c?9:4)*r,u=c?-23:4,{column:h,columnGroup:g}=this.splitColumnOrGroup(e);this.showMenu(h,g,(p)=>{let f=p.getGui();if(this.beans.popupSvc.positionPopupByComponent({type:s,additionalParams:{column:h},eventSource:t,ePopup:f,alignSide:n,nudgeX:d,nudgeY:u,position:"under",keepWithinBounds:!0}),a)p.showTab?.(a);this.dispatchVisibleChangedEvent(!0,!1,h,g,a)},s,a,l,t,i)}showMenu(e,t,s,i,o,r,n,a){let l=this.getMenuParams(e,t,r,n);if(!l)return;let{menu:c,eMenuGui:d,anchorToElement:u,restoreFocusParams:h}=l,g=[],{menuUtils:p,popupSvc:f}=this.beans;g.push((C)=>{let v=c.getGui();if(this.destroyBean(c),e)_o(e,!1,"contextMenu"),p.restoreFocusOnClose(h,v,C);a?.()});let m=this.getLocaleTextFunc();if(f.addPopup({modal:!0,eChild:d,closeOnEsc:!0,closedCallback:(C)=>{for(let v of g)v(C);this.dispatchVisibleChangedEvent(!1,!1,e,t,o)},afterGuiAttached:(C)=>c.afterGuiAttached(Object.assign({},{container:i},C)),positionCallback:o?()=>s(c):void 0,ariaLabel:m("ariaLabelColumnMenu","Column Menu")}),!o)c.showTabBasedOnPreviousSelection?.(),s(c);if(Ql(this.gos)){let C=f.setPopupPositionRelatedToElement(d,u);if(C&&e)this.addStopAnchoring(C,e,g)}if(c.addEventListener("tabSelected",(C)=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=C.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),e)_o(e,!0,"contextMenu");this.activeMenu=c,c.addEventListener("destroyed",()=>{if(this.activeMenu===c)this.activeMenu=null})}addStopAnchoring(e,t,s){e.then((i)=>{t.__addEventListener("leftChanged",i),t.__addEventListener("visibleChanged",i),s.push(()=>{t.__removeEventListener("leftChanged",i),t.__removeEventListener("visibleChanged",i)})})}getMenuParams(e,t,s,i){let{focusSvc:o,visibleCols:r,ctrlsSvc:n}=this.beans,a={column:e,headerPosition:o.focusedHeader,columnIndex:r.allCols.indexOf(e),eventSource:i},l=this.createMenu(e,t,a,s,i);return l?{menu:l,eMenuGui:l.getGui(),anchorToElement:i||n.getGridBodyCtrl().eGridBody,restoreFocusParams:a}:void 0}createMenu(e,t,s,i,o){if(be(this.gos))return this.createBean(new aL(e,s,this.lastSelectedTab,i,o));else{let r=this.beans.colMenuFactory.getMenuItems(e,t);return r.length?this.createBean(new lL(r,e,s,o)):void 0}}dispatchVisibleChangedEvent(e,t,s,i,o){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:t,key:this.lastSelectedTab??o??(be(this.gos)?$s:"columnMenu"),column:s??null,columnGroup:i??null})}isMenuEnabled(e){if(!be(this.gos))return!0;let t=!this.beans.filterManager?.isFilterAllowed(e),s=e.colDef.menuTabs??oa;return(t&&s.includes(Ks)?s.length-1:s.length)>0}showMenuAfterContextMenuEvent(e,t,s){this.beans.menuUtils.onContextMenu({mouseEvent:t,touchEvent:s,source:"ui",showMenuCallback:(i)=>(this.showMenuAfterMouseEvent(e,i,"columnMenu"),!0)})}},aL=class extends y{constructor(e,t,s,i,o){super();this.column=e,this.restoreFocusParams=t,this.initialSelection=s,this.restrictTo=i,this.sourceElement=o,this.tabFactories={},this.includeChecks={};let{tabFactories:r,includeChecks:n}=this;r[$s]=this.createMainPanel.bind(this),r[Ks]=this.createFilterPanel.bind(this),r[wi]=this.createColumnsPanel.bind(this),n[$s]=()=>!0,n[Ks]=()=>e?!!this.beans.filterManager?.isFilterAllowed(e):!1,n[wi]=()=>!0}postConstruct(){let e=this.getTabsToCreate().map((s)=>this.createTab(s)),t=new h3({items:e,cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(t),this.mainMenuList?.setParentComponent(t),this.addDestroyFunc(()=>this.destroyBean(t))}getTabsToCreate(){if(this.restrictTo)return this.restrictTo;return(this.column?.colDef.menuTabs??oa).filter((e)=>this.isValidMenuTabItem(e)&&this.isNotSuppressed(e))}isValidMenuTabItem(e){let t=!0,s=oa;if(this.restrictTo!=null)t=this.restrictTo.indexOf(e)>-1,s=this.restrictTo;if(t=t&&oa.indexOf(e)>-1,!t)F(175,{menuTabName:e,itemsToConsider:s});return t}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(e){let{tabItemColumns:t,tabbedLayout:s,tabItemFilter:i,tabItemGeneral:o}=this;if(t&&e===wi)s.showItem(t);else if(i&&e===Ks)s.showItem(i);else if(o&&e===$s)s.showItem(o);else s.showFirstItem()}onTabItemClicked(e){let t=null;switch(e.item){case this.tabItemColumns:t=wi;break;case this.tabItemFilter:t=Ks;break;case this.tabItemGeneral:t=$s;break}if(t)this.activateTab(t)}activateTab(e){let t={type:"tabSelected",key:e};this.dispatchLocalEvent(t)}createMainPanel(){let{beans:e,column:t}=this,s=e.colMenuFactory,i=s.createMenu(this,s.getMenuItems(t),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=i,i.addEventListener("closeMenu",this.onHidePopup.bind(this));let o={title:N("legacyMenu",e,t),titleLabel:$s.replace("MenuTab",""),bodyPromise:B.resolve(i.getGui()),name:$s};return this.tabItemGeneral=o,o}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){let e=this.column?this.createBean(new Xc(this.column,"COLUMN_MENU")):null;if(this.filterComp=e,!e?.hasFilter())X(119);let t=(i)=>e?.afterGuiAttached(i),s=()=>e?.afterGuiDetached();return this.tabItemFilter={title:N("filterTab",this.beans,this.column),titleLabel:Ks.replace("MenuTab",""),bodyPromise:B.resolve(e?.getGui()),afterAttachedCallback:t,afterDetachedCallback:s,name:Ks},this.tabItemFilter}createColumnsPanel(){let e=ee({tag:"div",cls:"ag-menu-column-select-wrapper"}),{beans:t,column:s}=this,o=t.colChooserFactory.createColumnSelectPanel(this,s).getGui();o.classList.add("ag-menu-column-select"),e.appendChild(o);let r={title:N("columns",t,s),titleLabel:wi.replace("MenuTab",""),bodyPromise:B.resolve(e),name:wi};return this.tabItemColumns=r,r}afterGuiAttached(e){let{container:t,hidePopup:s}=e;if(this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:s}),s)this.hidePopupFunc=s,this.addDestroyFunc(s)}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},lL=class extends L{constructor(e,t,s,i){super({tag:"div",ref:"eColumnMenu",cls:"ag-menu ag-column-menu",role:"presentation"});this.menuItems=e,this.column=t,this.restoreFocusParams=s,this.sourceElement=i,this.eColumnMenu=E}postConstruct(){let e=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=e,e.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(e.getGui())}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){if(e)this.hidePopupFunc=e,this.addDestroyFunc(e);pe(this.mainMenuList.getGui())}};function cL(e,t){let{contextMenuSvc:s}=e;if(!s)return;let{rowNode:i,column:o,value:r,x:n,y:a}=t||{},{x:l,y:c}=s.getContextMenuPosition(i,o);if(n!=null)l=n;if(a!=null)c=a;s.showContextMenu({mouseEvent:new MouseEvent("mousedown",{clientX:l,clientY:c}),rowNode:i,column:o,value:r,source:"api"})}function dL(e,t){e.colChooserFactory?.showColumnChooser({chooserParams:t})}function uL(e){e.colChooserFactory?.hideActiveColumnChooser()}var hL=class extends y{constructor(){super(...arguments);this.beanName="menuUtils"}restoreFocusOnClose(e,t,s,i){let{eventSource:o}=e,r=s instanceof KeyboardEvent;if(!i&&!r||!o)return;let n=j(this.beans);if(!t.contains(n)&&!ks(this.beans))return;this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,s){let i;if(s?.keyboardEvent)i=s.keyboardEvent;e(i&&{keyboardEvent:i});let o=this.beans,r=o.focusSvc,n=r.getFocusedCell();if(ks(o))if(n){let{rowIndex:a,rowPinned:l,column:c}=n;r.setFocusedCell({rowIndex:a,column:c,rowPinned:l,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e){let{mouseEvent:t,touchEvent:s,showMenuCallback:i,source:o}=e;if(!this.gos.get("allowContextMenuWithControlKey")){if(t&&(t.ctrlKey||t.metaKey))return}if(t)this.blockMiddleClickScrollsIfNeeded(t);if(o==="ui"&&this.gos.get("suppressContextMenu"))return;let r=t??s.touches[0];if(i(r)){let n=t??s;if(n?.cancelable)n.preventDefault()}}async focusHeaderCell(e){let{column:t,columnIndex:s,headerPosition:i,eventSource:o}=e,{visibleCols:r,headerNavigation:n,focusSvc:a}=this.beans,l=await r.allCols.some((c)=>c===t);if(!this.isAlive())return;if(t?.isAlive()&&l&&o&&ve(o)){let c=kn(o);if(c)n?.scrollToColumn(t),c.focus()}else if(i&&s!==-1){let c=r.allCols,d=c[s]||k(c);if(d)a.focusHeaderPosition({headerPosition:{headerRowIndex:i.headerRowIndex,column:d}})}}blockMiddleClickScrollsIfNeeded(e){if(this.gos.get("suppressMiddleClickScrolls")&&e.which===2)e.preventDefault()}},gL=class extends y{constructor(){super(...arguments);this.beanName="toolbarMenuBuilder"}showMenu(e){let{anchorElement:t,menuItems:s,ariaLabel:i,onClose:o}=e,{popupSvc:r,menuItemMapper:n}=this.beans;if(!r||!n)return;let a=ee({tag:"div",cls:"ag-menu"}),l=this.createBean(new Hd);a.appendChild(l.getGui()),l.addMenuItems(n.mapWithStockItems(s,null,null,void 0,()=>t,"contextMenu"));let c;l.addManagedListeners(l,{closeMenu:()=>c?.()}),r.addPopup({modal:!0,eChild:a,closeOnEsc:!0,afterGuiAttached:(d)=>{c=d.hidePopup,pe(l.getGui())},ariaLabel:i,closedCallback:()=>{this.destroyBean(l),o?.()}}),r.positionPopupByComponent({type:"toolbar",eventSource:t,ePopup:a,position:"under",nudgeY:4,keepWithinBounds:!0})}},mC={moduleName:"MenuCore",version:ie,beans:[tL,qk,hL,gL],icons:{chart:"chart",columns:"columns",loadingMenuItems:"loading",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",save:"save",csvExport:"csv",excelExport:"excel",sortAscending:"asc",sortDescending:"desc",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc",sortUnSort:"none"},dependsOn:[_e,Ci,Uc,Nd]},CC={moduleName:"ColumnMenu",version:ie,beans:[nL,oL,Zk],icons:{ensureColumnVisible:"column-arrow",legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:dL,hideColumnChooser:uL},dependsOn:[mC,gC,ir,or]},vC={moduleName:"ContextMenu",version:ie,beans:[rL],apiFunctions:{showContextMenu:cL},dependsOn:[mC]};var Si="__AG_SELECT_ALL__",yi="__AG_ADD_SELECTION_TO_FILTER__",pL=class{constructor(e,t,s,i){this.valueSvc=e,this.getValueFormatter=t,this.formatter=s,this.column=i,this.displayedKeys=[]}updateDisplayedValuesToAllAvailable(e,t,s){this.displayedKeys=Array.from(s)}updateDisplayedValuesToMatchMiniFilter(e,t,s,i,o){this.displayedKeys=[];let r=this.getValueFormatter();for(let n of s)if(n==null){if(o)this.displayedKeys.push(n)}else{let a=e(n),l=this.valueSvc.formatValue(this.column,null,a,r,!1),c=this.formatter(l);if(i(c))this.displayedKeys.push(n)}}getDisplayedValueCount(){return this.displayedKeys.length}getDisplayedItem(e){return this.displayedKeys[e]}getSelectAllItem(){return Si}getAddSelectionToFilterItem(){return yi}getDisplayedKeys(){return this.displayedKeys}forEachDisplayedKey(e){this.displayedKeys.forEach(e)}someDisplayedKey(e){return this.displayedKeys.some(e)}hasGroups(){return!1}refresh(){}},fL={tag:"div",cls:"ag-set-filter-item",attrs:{"aria-hidden":"true"},children:[{tag:"span",cls:"ag-set-filter-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-set-filter-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-set-filter-group-opened-icon"},{tag:"span",ref:"eGroupIndeterminateIcon",cls:"ag-set-filter-group-indeterminate-icon"}]},{tag:"ag-checkbox",ref:"eCheckbox",cls:"ag-set-filter-item-checkbox"}]},mL={tag:"div",cls:"ag-set-filter-item",children:[{tag:"ag-checkbox",ref:"eCheckbox",cls:"ag-set-filter-item-checkbox"}]},CL=class extends L{constructor(e){super(e.isGroup?fL:mL,[wt]);this.eCheckbox=E,this.eGroupOpenedIcon=E,this.eGroupClosedIcon=E,this.eGroupIndeterminateIcon=E,this.formattedValue=null,this.focusWrapper=e.focusWrapper,this.value=e.value,this.params=e.params,this.translate=e.translate,this.valueFormatter=e.valueFormatter,this.item=e.item,this.isSelected=e.isSelected,this.isTree=e.isTree,this.depth=e.depth??0,this.isGroup=e.isGroup,this.groupsExist=e.groupsExist,this.isExpanded=e.isExpanded,this.hasIndeterminateExpandState=e.hasIndeterminateExpandState}postConstruct(){if(this.tooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"setFilterValue",shouldDisplayTooltip:()=>this.shouldDisplayTooltip?.()??!0,getAdditionalParams:()=>{let{colDef:e,column:t}=this.params,s={colDef:e,column:t,valueFormatted:this.formattedValue??void 0};if(this.isTree)s.level=this.depth;return s}})),this.addDestroyFunc(()=>this.destroyCellRendererComponent?.()),this.render(),this.eCheckbox.setLabelEllipsis(!0).setValue(this.isSelected,!0).setDisabled(!!this.params.readOnly).getInputElement().setAttribute("tabindex","-1"),this.refreshVariableAriaLabels(),this.isTree){if(this.depth>0)this.addCss("ag-set-filter-indent-"+this.depth),this.getGui().style.setProperty("--ag-indentation-level",String(this.depth));if(this.isGroup)this.setupExpansion();else if(this.groupsExist)this.addCss("ag-set-filter-add-group-indent");wn(this.getAriaElement(),this.depth+1)}if(this.refreshAriaChecked(),this.params.readOnly)return;this.eCheckbox.onValueChange((e)=>this.onCheckboxChanged(!!e))}getFocusableElement(){return this.focusWrapper}setupExpansion(){let{eGroupClosedIcon:e,eGroupOpenedIcon:t,eGroupIndeterminateIcon:s,hasIndeterminateExpandState:i,beans:o}=this;e.appendChild(_s("setFilterGroupClosed",o,null)),t.appendChild(_s("setFilterGroupOpen",o,null));let r=this.onExpandOrContractClicked.bind(this);if(this.addManagedElementListeners(e,{click:r}),this.addManagedElementListeners(t,{click:r}),i)s.appendChild(_s("setFilterGroupIndeterminate",o,null)),this.addManagedElementListeners(s,{click:r});this.setExpandedIcons(),this.refreshAriaExpanded()}onExpandOrContractClicked(){this.setExpanded(!this.isExpanded)}setExpanded(e,t){if(this.isGroup&&e!==this.isExpanded){this.isExpanded=e;let s={type:"expandedChanged",isExpanded:!!e,item:this.item};if(!t)this.dispatchLocalEvent(s);this.setExpandedIcons(),this.refreshAriaExpanded()}}setExpandedIcons(){let{isExpanded:e,hasIndeterminateExpandState:t,eGroupClosedIcon:s,eGroupOpenedIcon:i,eGroupIndeterminateIcon:o}=this;if(G(s,t?e===!1:!e),G(i,e===!0),t)G(o,e===void 0)}onCheckboxChanged(e){this.isSelected=e;let t={type:"selectionChanged",isSelected:e,item:this.item};this.dispatchLocalEvent(t),this.refreshVariableAriaLabels(),this.refreshAriaChecked()}toggleSelected(){if(this.params.readOnly)return;this.setSelected(!this.isSelected)}setSelected(e,t){this.isSelected=e,this.eCheckbox.setValue(e,t),this.refreshAriaChecked()}refreshVariableAriaLabels(){if(!this.isTree)return;let e=this.getLocaleTextFunc(),t=this.eCheckbox.getValue(),s=t===void 0?e("ariaIndeterminate","indeterminate"):t?e("ariaVisible","visible"):e("ariaHidden","hidden"),i=e("ariaToggleVisibility","Press SPACE to toggle visibility");ri(this.eCheckbox.getInputElement(),void 0),this.eCheckbox.setInputAriaLabel(`${i} (${s})`)}setupFixedAriaLabels(e){if(!this.isTree)return;let s=this.getLocaleTextFunc()("ariaFilterValue","Filter Value"),i=this.getAriaElement();fe(i,`${e} ${s}`),Xi(i,this.eCheckbox.getInputElement().id)}refreshAriaChecked(){let e=this.getAriaElement();yn(e,this.eCheckbox.getValue())}refreshAriaExpanded(){De(this.getAriaElement(),!!this.isExpanded)}refresh(e,t,s){if(this.item=e,t!==this.isSelected)this.setSelected(t,!0);this.setExpanded(s,!0);let{cellRendererComponent:i,cellRendererParams:o,beans:r,params:n}=this;if(this.valueFunction){let a=this.valueFunction();if(this.setTooltipAndCellRendererParams(a,a),!i)this.renderCellWithoutCellRenderer()}if(i){let a=Ds(r.userCompFactory,n,o);if(!i.refresh?.(a?.params??o)){let c=i;this.renderCell(),this.destroyBean(c)}}}render(){let{params:{column:e}}=this,{value:t}=this,s;if(typeof t==="function")this.valueFunction=t,s=this.valueFunction(),t=s;else if(this.isTree)s=je(t);else s=this.getFormattedValue(e,t);this.formattedValue=s,this.setTooltipAndCellRendererParams(t,s),this.renderCell()}setTooltipAndCellRendererParams(e,t){let s=this.gos;if(this.params.showTooltips&&(!ji(s)||!this.params.cellRenderer)){let i=t!=null?t:je(e);this.shouldDisplayTooltip=so(s,()=>this.eCheckbox.getGui().querySelector(".ag-label")),this.tooltipFeature?.setTooltipAndRefresh(i)}this.cellRendererParams=I(s,{value:e,valueFormatted:t,colDef:this.params.colDef,column:this.params.column,setTooltip:(i,o)=>{s.assertModuleRegistered("Tooltip",3),this.shouldDisplayTooltip=o,this.tooltipFeature?.setTooltipAndRefresh(i)}})}getFormattedValue(e,t){return this.beans.valueSvc.formatValue(e,null,t,this.valueFormatter,!1)}renderCell(){let t=Ds(this.beans.userCompFactory,this.params,this.cellRendererParams)?.newAgStackInstance();if(t==null){this.renderCellWithoutCellRenderer();return}t.then((s)=>{if(s)this.cellRendererComponent=s,this.eCheckbox.setLabel(s.getGui()),this.destroyCellRendererComponent=()=>this.destroyBean(s)})}renderCellWithoutCellRenderer(){let{valueFormatted:e,value:t}=this.cellRendererParams,s=(e==null?t:e)??this.translate("blanks");if(typeof s!=="string")F(208),s="";this.eCheckbox.setLabel(s),this.setupFixedAriaLabels(s)}getComponentHolder(){return this.params.column.getColDef()}},vL={loadingOoo:"Loading...",blanks:"(Blanks)",searchOoo:"Search...",selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",noMatches:"No matches.",ariaSearchFilterValues:"Search filter values",ariaFilterList:"Filter List",filterSummaryListInactive:"is (All)",filterSummaryListSeparator:", ",filterSummaryListShort:(e)=>`is (${e[0]})`,filterSummaryListLong:(e)=>`is (${e[0]}) and ${e[1]} more`};function Ad(e,t,s){let i=e;if(!i)return null;if(i=i.map((o)=>je(de(o))),!t&&s&&i.some((o)=>o==null)){if(k(i)==null)return null;return i.filter((o)=>o!=null)}return i}function Ze(e,t,s){return Kl(e,vL,t,s)}function wL(e){if(e.excelMode==="windows"){if(!e.buttons)e.buttons=["apply","cancel"];if(e.closeOnApply==null)e.closeOnApply=!0}else if(e.excelMode==="mac"){if(!e.buttons)e.buttons=["reset"];if(e.applyMiniFilterWhileTyping==null)e.applyMiniFilterWhileTyping=!0;if(e.debounceMs==null)e.debounceMs=500}if(e.excelMode&&e.defaultToNothingSelected)e.defaultToNothingSelected=!1,F(207)}function bL(){return([e,t],[s,i])=>{if(t==null)return i==null?0:-1;else if(i==null)return 1;for(let o=0;o<t.length;o++){if(o>=i.length)return 1;let r=Yi(t[o],i[o]);if(r!==0)return r}return 0}}var gm=class{constructor(e,t,s,i){this.formatter=e,this.treeListPathGetter=t,this.treeListFormatter=s,this.treeDataOrGrouping=i,this.allDisplayedItemsTree=new Map,this.activeDisplayedItemsFlat=[],this.selectAllItem={depth:0,filterPasses:!0,available:!0,treeKey:Si,children:this.allDisplayedItemsTree,expanded:!0,key:Si,parentTreeKeys:[]},this.addSelectionToFilterItem={depth:0,filterPasses:!0,available:!0,treeKey:yi,expanded:!0,key:yi,parentTreeKeys:[]}}updateParams(e,t){this.treeListPathGetter=e,this.treeListFormatter=t}updateDisplayedValuesToAllAvailable(e,t,s,i){if(i==="reload")this.generateItemTree(e,t,s);else if(i==="otherFilter")this.updateAvailable(s),this.updateExpandAll();else if(i==="miniFilter")this.resetFilter(),this.updateExpandAll();this.flattenItems()}updateDisplayedValuesToMatchMiniFilter(e,t,s,i,o,r){if(r==="reload")this.generateItemTree(e,t,s);else if(r==="otherFilter")this.updateAvailable(s);this.updateFilter(i,o),this.updateExpandAll(),this.flattenItems()}generateItemTree(e,t,s){let i=new Map;this.allDisplayedItemsTree=i;let o=!1,r=this.getTreeListPathGetter(e,s);for(let n of t){let a=e(n),l=r(a)??[null],c=l.length;if(c>1)o=!0;let d=s.has(n),u=i,h,g=[];for(let p=0;p<c;p++){let f=l[p];if(!u)u=new Map,h.children=u;let m=f?.toUpperCase()??null;if(h=u.get(m),!h){if(h={treeKey:f,depth:p,filterPasses:!0,expanded:!1,available:d,parentTreeKeys:g},p===l.length-1)h.key=n;u.set(m,h)}u=h.children,g=[...g,f]}}this.groupsExist=o,this.updateAvailable(s),this.selectAllItem.children=i,this.selectAllItem.expanded=!1}getTreeListPathGetter(e,t){if(this.treeListPathGetter)return this.treeListPathGetter;if(this.treeDataOrGrouping)return(i)=>i;let s=!1;for(let i of t){let o=e(i);if(o instanceof Date){s=!0;break}else if(o!=null)break}if(s)return(i)=>Rs(i,!1);return F(211),(i)=>[String(i)]}flattenItems(){this.activeDisplayedItemsFlat=[];let e=(t)=>{for(let s of t.values()){if(!s.filterPasses||!s.available)continue;if(this.activeDisplayedItemsFlat.push(s),s.children&&s.expanded)e(s.children)}};e(this.allDisplayedItemsTree)}resetFilter(){let e=(t)=>{let s=t.children;if(s)for(let i of s.values())e(i);t.filterPasses=!0};for(let t of this.allDisplayedItemsTree.values())e(t)}updateFilter(e,t){let s=(i)=>{if(!i.available)return!1;if(i.treeKey==null)return t;return e(this.formatter(this.treeListFormatter?this.treeListFormatter(i.treeKey,i.depth,i.parentTreeKeys):i.treeKey))};for(let i of this.allDisplayedItemsTree.values())this.recursiveItemCheck(i,!1,s,"filterPasses")}getDisplayedValueCount(){return this.activeDisplayedItemsFlat.length}getDisplayedItem(e){return this.activeDisplayedItemsFlat[e]}getSelectAllItem(){return this.selectAllItem}getAddSelectionToFilterItem(){return this.addSelectionToFilterItem}getDisplayedKeys(){let e=[];return this.forEachDisplayedKey((t)=>e.push(t)),e}forEachDisplayedKey(e){let t=(s,i)=>{let o=s.children;if(o){if(!s.expanded||!i){for(let r of o.values())if(r.filterPasses)t(r,!1)}}else e(s.key)};for(let s of this.activeDisplayedItemsFlat)t(s,!0)}someDisplayedKey(e){let t=(s,i)=>{let o=s.children;if(o){if(!s.expanded||!i){for(let r of o.values())if(r.filterPasses&&t(r,!1))return!0;return!1}}else return e(s.key);return!1};return this.activeDisplayedItemsFlat.some((s)=>t(s,!0))}hasGroups(){return this.groupsExist}refresh(){this.updateExpandAll(),this.flattenItems()}updateExpandAll(){let e=(s,i,o)=>{for(let r of s.values()){if(!r.filterPasses||!r.available||!r.children)continue;if(i=i||!!r.expanded,o=o||!r.expanded,i&&o)return;let n=e(r.children,i,o);if(n===void 0)return;else if(n)i=!0;else o=!0}return i&&o?void 0:i},t=this.getSelectAllItem();t.expanded=e(t.children,!1,!1)}recursiveItemCheck(e,t,s,i){let o=!1,r=e.children;if(r)for(let a of r.values()){let l=this.recursiveItemCheck(a,t||s(e),s,i);o=o||l}let n=t||o||s(e);return e[i]=n,n}updateAvailable(e){let t=(s)=>e.has(s.key);for(let s of this.allDisplayedItemsTree.values())this.recursiveItemCheck(s,!1,t,"available")}},wC=class extends pi{constructor(){super("setFilter","set-filter");this.filterType="set",this.eMiniFilter=E,this.eFilterLoading=E,this.eFilterLoadingIcon=E,this.eSetFilterList=E,this.eFilterNoMatches=E,this.hardRefreshVirtualList=!1,this.miniFilterText=null,this.addCurrentSelectionToFilter=!1,this.selectedKeys=new Set}setParams(e){super.setParams(e);let t=this.updateHandler(e.getHandler()),{column:s,textFormatter:i,treeList:o,treeListPathGetter:r,treeListFormatter:n}=e;if(this.formatter=i??((a)=>a??null),this.displayValueModel=o?new gm(this.formatter,r,n,t.isTreeDataOrGrouping()):new pL(this.beans.valueSvc,()=>this.handler.valueFormatter,this.formatter,s),t.valueModel.allKeys.then((a)=>{if(!this.isAlive())return;this.updateDisplayedValues("reload",a??[]),this.resetSelectionState(a??[])}),t.valueModel.isLoading())this.setIsLoading(!0);this.initialiseFilterBodyUi()}refresh(e){if(this.params.treeList!==e.treeList)return!1;return this.updateHandler(e.getHandler()),super.refresh(e)}updateParams(e,t){if(super.updateParams(e,t),this.updateMiniFilter(),e.suppressSelectAll!==t.suppressSelectAll)this.createVirtualListModel(e);let{textFormatter:s,treeListPathGetter:i,treeListFormatter:o}=e;if(this.formatter=s??((r)=>r??null),this.displayValueModel instanceof gm)this.displayValueModel.updateParams(i,o);this.handler.refreshFilterValues(!0)}updateHandler(e){if(this.handler!==e){for(let s of this.handlerDestroyFuncs??[])s();this.handlerDestroyFuncs=[...this.addManagedListeners(e,{anyFilterChanged:(s)=>{e.valueModel.allKeys.then((i)=>{if(this.isAlive()){if(this.updateDisplayedValues("otherFilter",i??[]),s.updated)this.checkAndRefreshVirtualList(),this.showOrHideResults()}})},dataChanged:({hardRefresh:s})=>{e.valueModel.allKeys.then((i)=>{if(this.isAlive()){if(this.updateDisplayedValues("reload",i??[]),this.setSelectedModel(this.state.model?.values??null),s)this.hardRefreshVirtualList=!0;this.checkAndRefreshVirtualList()}})}}),...this.addManagedListeners(e.valueModel,{loadingStart:()=>this.setIsLoading(!0),loadingEnd:()=>this.setIsLoading(!1)})],this.handler=e}return e}updateUiVisibility(){}createBodyTemplate(){return{tag:"div",cls:"ag-set-filter",children:[{tag:"div",ref:"eFilterLoading",cls:"ag-filter-loading ag-loading ag-hidden",children:[{tag:"span",ref:"eFilterLoadingIcon",cls:"ag-loading-icon"},{tag:"span",cls:"ag-loading-text",children:Ze(this,"loadingOoo")}]},{tag:"ag-input-text-field",ref:"eMiniFilter",cls:"ag-mini-filter"},{tag:"div",ref:"eFilterNoMatches",cls:"ag-filter-no-matches ag-hidden",children:Ze(this,"noMatches")},{tag:"div",ref:"eSetFilterList",cls:"ag-set-filter-list",role:"presentation"}]}}getAgComponents(){return[us]}handleKeyDown(e){if(super.handleKeyDown(e),e.defaultPrevented)return;let t=()=>{if(!this.eSetFilterList.contains(j(this.beans)))return;let s=this.virtualList.getLastFocusedRow();if(s==null)return;let i=this.virtualList.getComponentAt(s);if(i==null)return;e.preventDefault();let{readOnly:o}=this.params;if(o)return;return i};switch(e.key){case b.SPACE:t()?.toggleSelected();break;case b.ENTER:this.handleKeyEnter(e);break;case b.LEFT:t()?.setExpanded(!1);break;case b.RIGHT:t()?.setExpanded(!0);break}}handleKeyEnter(e){e.preventDefault();let{excelMode:t,readOnly:s}=this.params;if(!t||!!s)return;if(this.params.onAction("apply",void 0,e),this.params.excelMode==="mac")this.eMiniFilter.getInputElement().select()}setModelAndRefresh(e){return this.setSelectedModel(e).then(()=>{if(this.isAlive())this.checkAndRefreshVirtualList()})}setModelIntoUi(e){this.setMiniFilter(this.params.state.state?.miniFilterValue??null,!0);let t=e==null?null:e.values;return this.setModelAndRefresh(t)}getModelFromUi(){let e=this.getSelectedModel();if(!e)return null;return{values:e,filterType:this.filterType}}areNonNullModelsEqual(e,t){return se(e.values,t.values)}setIsLoading(e){if(G(this.eFilterLoading,e),!e)this.hardRefreshVirtualList=!0}initialiseFilterBodyUi(){this.initVirtualList(),this.initMiniFilter(),this.initLoading()}initLoading(){let e=N("setFilterLoading",this.beans,this.params.column);if(e)this.eFilterLoadingIcon.appendChild(e)}initVirtualList(){let e=Ze(this,"ariaFilterList"),t=!!this.params.treeList,s=this.virtualList=this.createBean(new Bd({cssIdentifier:"filter",ariaRole:t?"tree":"listbox",listName:e})),i=this.eSetFilterList;if(t)i.classList.add("ag-set-filter-tree-list");i.appendChild(s.getGui());let{cellHeight:o}=this.params;if(o!=null)s.setRowHeight(o);let r=(a,l)=>this.createSetListItem(a,t,l);s.setComponentCreator(r);let n=(a,l)=>this.updateSetListItem(a,l);s.setComponentUpdater(n),this.createVirtualListModel(this.params)}createVirtualListModel(e){let t;if(e.suppressSelectAll)t=new SL(this.displayValueModel);else t=new yL(this.displayValueModel,this.showAddCurrentSelectionToFilter.bind(this));if(e.treeList)t=new xL(t);this.virtualList.setModel(t)}getSelectAllLabel(){let e=this.miniFilterText==null||!this.params.excelMode?"selectAll":"selectAllSearchResults";return Ze(this,e)}getAddSelectionToFilterLabel(){return Ze(this,"addCurrentSelectionToFilter")}createSetListItem(e,t,s){let i=this.displayValueModel.hasGroups(),{isSelected:o,isExpanded:r}=this.isSelectedExpanded(e),{value:n,depth:a,isGroup:l,hasIndeterminateExpandState:c,selectedListener:d,expandedListener:u}=this.newSetListItemAttributes(e),h={focusWrapper:s,value:n,params:this.params,translate:(p)=>Ze(this,p),valueFormatter:this.handler.valueFormatter,item:e,isSelected:o,isTree:t,depth:a,groupsExist:i,isGroup:l,isExpanded:r,hasIndeterminateExpandState:c},g=this.createBean(new CL(h));if(g.addEventListener("selectionChanged",d),u)g.addEventListener("expandedChanged",u);return g}newSetTreeItemAttributes(e){let t=this.displayValueModel.hasGroups();if(e.key===Si)return{value:()=>this.getSelectAllLabel(),isGroup:t,depth:e.depth,hasIndeterminateExpandState:!0,selectedListener:(s)=>this.onSelectAll(s.isSelected),expandedListener:(s)=>this.onExpandAll(s.item,s.isExpanded)};if(e.key===yi)return{value:()=>this.getAddSelectionToFilterLabel(),depth:e.depth,isGroup:!1,hasIndeterminateExpandState:!1,selectedListener:(s)=>{this.addCurrentSelectionToFilter=s.isSelected,this.refreshAfterSelection()}};if(e.children)return{value:this.params.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,isGroup:!0,selectedListener:(s)=>this.onGroupItemSelected(s.item,s.isSelected),expandedListener:(s)=>this.onExpandedChanged(s.item,s.isExpanded)};return{value:this.params.treeListFormatter?.(e.treeKey,e.depth,e.parentTreeKeys)??e.treeKey,depth:e.depth,selectedListener:(s)=>this.onItemSelected(s.item.key,s.isSelected)}}newSetListItemAttributes(e){if(this.isSetFilterModelTreeItem(e))return this.newSetTreeItemAttributes(e);if(e===Si)return{value:()=>this.getSelectAllLabel(),selectedListener:(t)=>this.onSelectAll(t.isSelected)};if(e===yi)return{value:()=>this.getAddSelectionToFilterLabel(),selectedListener:(t)=>{this.addCurrentSelectionToFilter=t.isSelected,this.refreshAfterSelection()}};return{value:this.handler.valueModel.allValues.get(e)??null,selectedListener:(t)=>this.onItemSelected(t.item,t.isSelected)}}updateSetListItem(e,t){let{isSelected:s,isExpanded:i}=this.isSelectedExpanded(e);t.refresh(e,s,i)}isSelectedExpanded(e){let t,s;if(this.isSetFilterModelTreeItem(e))if(s=e.expanded,e.key===Si)t=this.isSelectAllSelected();else if(e.key===yi)t=this.isAddCurrentSelectionToFilterChecked();else if(e.children)t=this.areAllChildrenSelected(e);else t=this.selectedKeys.has(e.key);else if(e===Si)t=this.isSelectAllSelected();else if(e===yi)t=this.isAddCurrentSelectionToFilterChecked();else t=this.selectedKeys.has(e);return{isSelected:t,isExpanded:s}}isSetFilterModelTreeItem(e){return e?.treeKey!==void 0}initMiniFilter(){let{eMiniFilter:e}=this;this.updateMiniFilter(),e.onValueChange(()=>this.onMiniFilterInput()),e.setInputAriaLabel(Ze(this,"ariaSearchFilterValues")),this.addManagedElementListeners(e.getInputElement(),{keydown:(t)=>this.onMiniFilterKeyDown(t)})}updateMiniFilter(){let{eMiniFilter:e,miniFilterText:t,params:s}=this;e.setDisplayed(!s.suppressMiniFilter),e.setValue(t)}afterGuiAttached(e){super.afterGuiAttached(e),this.resetExpansion(),this.refreshVirtualList();let{eMiniFilter:t}=this;if(t.setInputPlaceholder(Ze(this,"searchOoo")),!e?.suppressFocus)if(t.isDisplayed())t.getFocusableElement().focus();else this.virtualList.awaitStable(()=>this.virtualList.focusRow(0))}afterGuiDetached(){super.afterGuiDetached();let{column:e,excelMode:t,model:s,onStateChange:i}=this.params;if(this.beans.colFilter?.shouldKeepStateOnDetach(e))return;if(t)this.resetMiniFilter();if(t||s!==this.state.model)i({model:s,state:this.getState()}),this.showOrHideResults()}canApply(e){return this.params.excelMode?e==null||e.values.length>0:!0}onNewRowsLoaded(){}setFilterValues(e){F(283),this.handler.setFilterValues(e)}resetFilterValues(){F(283),this.handler.resetFilterValues()}refreshFilterValues(){F(283),this.doRefreshFilterValues()}doRefreshFilterValues(){this.handler.refreshFilterValues()}onAnyFilterChanged(){}onMiniFilterInput(e){if(!this.doSetMiniFilter(this.eMiniFilter.getValue()))return;if(e){this.showOrHideResults();return}let{applyMiniFilterWhileTyping:t,readOnly:s,excelMode:i}=this.params,o=!s&&(t||!!i),r=t&&!s?"debounce":void 0;this.updateUiAfterMiniFilterChange(o,r)}updateUiAfterMiniFilterChange(e,t){if(e){let{excelMode:s,readOnly:i,model:o}=this.params;if(s&&!i&&this.miniFilterText==null)this.setModelAndRefresh(o?.values??null);else this.selectAllMatchingMiniFilter(!0)}this.checkAndRefreshVirtualList(),this.onUiChanged(e?t:"prevent"),this.showOrHideResults()}showOrHideResults(){let e=this.miniFilterText!=null&&this.displayValueModel.getDisplayedValueCount()<1;G(this.eFilterNoMatches,e),G(this.eSetFilterList,!e)}resetMiniFilter(){this.eMiniFilter.setValue(null,!0),this.doSetMiniFilter(null)}onMiniFilterKeyDown(e){let{excelMode:t,readOnly:s}=this.params;if(e.key===b.ENTER&&!t&&!s)this.updateUiAfterMiniFilterChange(!0,"immediately")}focusRowIfAlive(e){if(e==null)return Promise.resolve();return new Promise((t)=>{window.setTimeout(()=>{if(this.isAlive())this.virtualList.focusRow(e);t()},0)})}onSelectAll(e){if(e)this.selectAllMatchingMiniFilter();else this.deselectAllMatchingMiniFilter();this.refreshAfterSelection()}onGroupItemSelected(e,t){let s=(i)=>{if(!i.filterPasses)return;let o=i.children;if(o)for(let r of o.values())s(r);else this.setKeySelected(i.key,t)};s(e),this.refreshAfterSelection()}onItemSelected(e,t){this.setKeySelected(e,t),this.refreshAfterSelection()}onExpandAll(e,t){let s=(i)=>{if(i.filterPasses&&i.available&&i.children){for(let o of i.children.values())s(o);i.expanded=t}};s(e),this.refreshAfterExpansion()}onExpandedChanged(e,t){e.expanded=t,this.refreshAfterExpansion()}refreshAfterExpansion(){let e=this.virtualList.getLastFocusedRow();this.updateDisplayedValues("expansion"),this.checkAndRefreshVirtualList(),this.focusRowIfAlive(e)}refreshAfterSelection(){let e=this.virtualList.getLastFocusedRow();this.checkAndRefreshVirtualList(),this.onUiChanged(),this.focusRowIfAlive(e)}setMiniFilter(e,t){this.eMiniFilter.setValue(e,t),this.onMiniFilterInput(t)}doSetMiniFilter(e){if(e=de(e),this.miniFilterText===e)return!1;if(e===null)this.addCurrentSelectionToFilter=!1;return this.miniFilterText=e,this.updateDisplayedValues("miniFilter"),!0}getMiniFilter(){return this.miniFilterText}getUiChangeEventParams(){return{miniFilterValue:this.miniFilterText}}getState(){let e=this.miniFilterText;return e?{miniFilterValue:e}:void 0}checkAndRefreshVirtualList(){if(this.virtualList.refresh(!this.hardRefreshVirtualList),this.hardRefreshVirtualList)this.hardRefreshVirtualList=!1}getFilterKeys(){return F(283),this.handler.getFilterKeys()}getFilterValues(){return F(283),this.handler.getFilterValues()}refreshVirtualList(){if(this.params.refreshValuesOnOpen)this.doRefreshFilterValues();else this.checkAndRefreshVirtualList()}isSelectAllSelected(){if(!this.params.defaultToNothingSelected){if(this.hasSelections()&&this.isNothingVisibleSelected())return!1;if(this.isEverythingVisibleSelected())return!0}else{if(this.hasSelections()&&this.isEverythingVisibleSelected())return!0;if(this.isNothingVisibleSelected())return!1}return}areAllChildrenSelected(e){let t=(s)=>{if(s.children){let i=!1,o=!1;for(let r of s.children.values()){if(!r.filterPasses||!r.available)continue;let n=t(r);if(n===void 0)return;if(n)i=!0;else o=!0;if(i&&o)return}return i}else return this.selectedKeys.has(s.key)};if(!this.params.defaultToNothingSelected)return t(e);else return this.hasSelections()&&t(e)}resetExpansion(){if(!this.params.treeList)return;let e=this.displayValueModel.getSelectAllItem();if(this.isSetFilterModelTreeItem(e)){let t=(s)=>{let i=s.children;if(i){for(let o of i.values())t(o);s.expanded=!1}};t(e),this.updateDisplayedValues("expansion")}}getModelAsString(e){return this.handler.getModelAsString(e)}getPositionableElement(){return this.eSetFilterList}updateDisplayedValues(e,t){if(e==="expansion"){this.displayValueModel.refresh();return}let s=this.handler,i=s.valueModel;if(this.miniFilterText==null){this.displayValueModel.updateDisplayedValuesToAllAvailable((a)=>i.allValues.get(a)??null,t,i.availableKeys,e);return}let o=s.caseFormat(this.formatter(this.miniFilterText)||""),r=(a)=>a!=null&&s.caseFormat(a).includes(o),n=!!this.params.excelMode&&r(Ze(this,"blanks"));this.displayValueModel.updateDisplayedValuesToMatchMiniFilter((a)=>i.allValues.get(a)??null,t,i.availableKeys,r,n,e)}hasSelections(){return this.params.defaultToNothingSelected?this.selectedKeys.size>0:this.handler.valueModel.allValues.size!==this.selectedKeys.size}isInWindowsExcelMode(){return this.params.excelMode==="windows"}isAddCurrentSelectionToFilterChecked(){return this.isInWindowsExcelMode()&&this.addCurrentSelectionToFilter}showAddCurrentSelectionToFilter(){return this.isInWindowsExcelMode()&&M(this.miniFilterText)&&this.miniFilterText.length>0}selectAllMatchingMiniFilter(e=!1){if(this.miniFilterText==null)this.selectedKeys=new Set(this.handler.valueModel.allValues.keys());else{if(e)this.selectedKeys.clear();this.displayValueModel.forEachDisplayedKey((t)=>this.selectedKeys.add(t))}}deselectAllMatchingMiniFilter(){if(this.miniFilterText==null)this.selectedKeys.clear();else this.displayValueModel.forEachDisplayedKey((e)=>this.selectedKeys.delete(e))}setKeySelected(e,t){if(t)this.selectedKeys.add(e);else{if(this.params.excelMode&&this.isEverythingVisibleSelected())this.resetSelectionState(this.displayValueModel.getDisplayedKeys());this.selectedKeys.delete(e)}}isEverythingVisibleSelected(){return!this.displayValueModel.someDisplayedKey((e)=>!this.selectedKeys.has(e))}isNothingVisibleSelected(){return!this.displayValueModel.someDisplayedKey((e)=>this.selectedKeys.has(e))}getSelectedModel(){if(!this.hasSelections())return null;let e=this.isAddCurrentSelectionToFilterChecked()?this.params.model?.values:void 0;if(e?.length){if(this.selectedKeys){let t=new Set([...e,...this.selectedKeys]);return Array.from(t)}return Array.from(e)}return Array.from(this.selectedKeys)}setSelectedModel(e){let t=this.handler,s=t.valueModel;return s.allKeys.then((i)=>{if(e==null)this.resetSelectionState(i??[]);else{this.selectedKeys.clear();let o=new Map;s.allValues.forEach((r,n)=>{o.set(t.caseFormat(n),n)}),e.forEach((r)=>{let n=t.caseFormat(de(r)),a=o.get(n);if(a!==void 0)this.selectedKeys.add(a)})}})}resetSelectionState(e){if(this.params.defaultToNothingSelected)this.selectedKeys.clear();else this.selectedKeys=new Set(e)}getFilterHandler(){return this.handler}destroy(){this.virtualList=this.destroyBean(this.virtualList);for(let e of this.handlerDestroyFuncs??[])e();this.handler=void 0,this.displayValueModel=void 0,this.selectedKeys.clear(),super.destroy()}},SL=class{constructor(e){this.model=e}getRowCount(){return this.model.getDisplayedValueCount()}getRow(e){return this.model.getDisplayedItem(e)}areRowsEqual(e,t){return e===t}},yL=class{constructor(e,t){this.model=e,this.showAddCurrentSelectionToFilter=t}getRowCount(){let t=this.showAddCurrentSelectionToFilter()?2:1;return this.model.getDisplayedValueCount()+t}getRow(e){if(e===0)return this.model.getSelectAllItem();let t=this.showAddCurrentSelectionToFilter(),s=t?2:1;if(e===1&&t)return this.model.getAddSelectionToFilterItem();return this.model.getDisplayedItem(e-s)}areRowsEqual(e,t){return e===t}},xL=class{constructor(e){this.model=e}getRowCount(){return this.model.getRowCount()}getRow(e){return this.model.getRow(e)}areRowsEqual(e,t){if(e==null&&t==null)return!0;return e?.treeKey===t?.treeKey&&e?.depth===t?.depth}},RL=class extends y{constructor(e,t,s,i,o){super();this.createKey=e,this.caseFormat=t,this.getValue=s,this.isTreeDataOrGrouping=i,this.isTreeData=o}extractUniqueValuesAsync(e,t){return new B((s)=>{if(this.beans.rowModel.rowCountReady)s(this.extractUniqueValues(e,t));else{let[i]=this.addManagedEventListeners({rowCountReady:()=>{i?.(),s(this.extractUniqueValues(e,t))}})}})}extractUniqueValues(e,t){let s=new Map,i=this.extractExistingFormattedKeys(t),o=new Set,r=this.isTreeData(),n=this.isTreeDataOrGrouping(),a=this.beans.rowGroupColsSvc?.columns,l=this.gos.get("groupAllowUnbalanced"),c=(d,u)=>{let h=this.caseFormat(d);if(!o.has(h)){o.add(h);let g=d,p=de(u),f=i?.get(h);if(f!=null)g=f,p=t.get(f);s.set(g,p)}};return this.beans.rowModel.forEachLeafNode((d)=>{if(!d.data||!e(d))return;if(n){this.addValueForTreeDataOrGrouping(d,r,a,c,l);return}let u=this.getValue(d);if(u!=null&&Array.isArray(u)){for(let h of u)c(this.createKey(h,d),h);if(u.length===0)c(null,null)}else c(this.createKey(u,d),u)}),s}addValueForTreeDataOrGrouping(e,t,s=[],i,o){let r;if(t){if(e.childrenAfterGroup?.length)return;r=e.getRoute()??[e.key??e.id]}else r=s.map((a)=>this.beans.valueSvc.getKeyForNode(a,e)),r.push(this.getValue(e));let n=Ad(r,t,o);i(this.createKey(n),n)}extractExistingFormattedKeys(e){if(!e)return null;let t=new Map;return e.forEach((s,i)=>{t.set(this.caseFormat(i),i)}),t}},FL=class{constructor(e){this.caseFormat=e,this.keys=null}isNull(){return this.keys==null}isEmpty(){return!this.keys?.size}update(e){let t=new Set;this.keys=t;let s=e?.values;if(s){let i=this.caseFormat;for(let o=0,r=s.length;o<r;o++)t.add(i(s[o]))}}has(e){return!!this.keys?.has(this.caseFormat(e))}destroy(){this.keys=null}},bC=((e)=>(e[e.PROVIDED_LIST=0]="PROVIDED_LIST",e[e.PROVIDED_CALLBACK=1]="PROVIDED_CALLBACK",e[e.TAKEN_FROM_GRID_VALUES=2]="TAKEN_FROM_GRID_VALUES",e))(bC||{}),xd=bC,EL=class extends y{constructor(e,t,s,i,o){super();this.csrmValuesExtractor=e,this.caseFormat=t,this.createKey=s,this.isTreeDataOrGrouping=i,this.params=o,this.allValues=new Map,this.availableKeys=new Set,this.providedValues=null,this.initialised=!1}postConstruct(){let e=this.params,t=e.handlerParams.filterParams.values;if(this.updateParams(e),t==null)this.valuesType=2;else this.valuesType=Array.isArray(t)?0:1,this.providedValues=t;this.updateAllValues()}refresh(e){let t=e.handlerParams;if(t.source!=="colDef")return;let{values:s,suppressSorting:i}=t.filterParams,o=this.providedValues,r=this.params.handlerParams.filterParams.suppressSorting;if(this.params=e,this.updateParams(e),this.providedValues=s??null,this.providedValues!==o||i!==r){if(!s||s.length===0)this.valuesType=2,this.providedValues=null;else this.valuesType=Array.isArray(s)?0:1;this.updateAllValues()}}updateParams(e){let{handlerParams:{colDef:t,filterParams:{comparator:s,treeList:i,treeListPathGetter:o}},usingComplexObjects:r}=e,n=s??t.comparator,a=this.isTreeDataOrGrouping(),l;if(a&&!n)l=bL();else if(i&&!o&&!n)l=([c,d],[u,h])=>Yi(d,h);else l=([c,d],[u,h])=>n(d,h);this.entryComparator=l,this.keyComparator=n??Yi,this.compareByValue=!!(r&&n||a||i&&!o)}updateAllValues(){return this.allKeys=new B((e)=>{switch(this.valuesType){case 2:this.getValuesFromRowsAsync().then((t)=>e(this.processAllValues(t)));break;case 0:{e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(this.providedValues))));break}case 1:{this.dispatchLocalEvent({type:"loadingStart"});let t=this.providedValues,{column:s,colDef:i}=this.params.handlerParams,o=I(this.gos,{success:(r)=>{this.dispatchLocalEvent({type:"loadingEnd"}),e(this.processAllValues(this.uniqueValues(this.validateProvidedValues(r))))},colDef:i,column:s});window.setTimeout(()=>t(o),0);break}}}),this.allKeys.then((e)=>{this.updateAvailableKeys(e??[]),this.initialised=!0}),this.allKeys}getAvailableValues(e){return this.sortKeys(this.getValuesFromRows(e))}overrideValues(e){return this.allKeys.then(()=>{this.valuesType=0,this.providedValues=e})}refreshAvailable(){return new B((e)=>{if(this.showAvailableOnly()){this.allKeys.then((t)=>{let s=t??[];this.updateAvailableKeys(s),e(!0)});return}e(!1)})}refreshAll(){return new B((e)=>{this.allKeys.then(()=>{this.updateAllValues().then(()=>{e()})})})}isLoading(){return!this.initialised&&this.valuesType===1}isInitialised(){return this.initialised}getValueForFormatter(e){return this.initialised?this.allValues.get(e):e}getAvailableKeys(e){return this.initialised?e.filter((t)=>this.availableKeys.has(t)):e}getParamsForValuesFromRows(e){if(!this.csrmValuesExtractor){X(113);return}return e&&!this.params.handlerParams.filterParams.caseSensitive?this.allValues:void 0}getValuesFromRows(e){let t=this.getParamsForValuesFromRows(!0);return this.csrmValuesExtractor?.extractUniqueValues(e,t)??null}getValuesFromRowsAsync(){let e=this.getParamsForValuesFromRows(!1);return this.csrmValuesExtractor?.extractUniqueValuesAsync(()=>!0,e)??B.resolve(null)}processAllValues(e){let t=this.sortKeys(e);return this.allValues=e??new Map,t}uniqueValues(e){let t=new Map,s=new Set,{caseFormat:i,createKey:o}=this;for(let r of e??[]){let n=de(r),a=o(n),l=i(a);if(!s.has(l))s.add(l),t.set(a,n)}return t}validateProvidedValues(e){if(this.params.usingComplexObjects&&e?.length){let t=e[0];if(t&&typeof t!=="object"&&typeof t!=="function")if(this.createKey(t)==null)F(209);else F(210)}return e}sortKeys(e){let t=e??new Map,s=this.params.handlerParams.filterParams;if(s.suppressSorting)return Array.from(t.keys());let i;if(this.compareByValue)i=Array.from(t.entries()).sort(this.entryComparator).map(([o])=>o);else i=Array.from(t.keys()).sort(this.keyComparator);if(s.excelMode&&t.has(null))i=i.filter((o)=>o!=null),i.push(null);return i}showAvailableOnly(){return this.valuesType===2}updateAvailableKeys(e){let t=this.showAvailableOnly()?this.getAvailableValues((s)=>this.params.handlerParams.doesRowPassOtherFilter(s)):e;this.availableKeys=new Set(t),window.setTimeout(()=>{if(this.isAlive())this.dispatchLocalEvent({type:"availableValuesChanged"})})}},PL=class extends y{constructor(){super(...arguments);this.filterType="set",this.treeDataTreeList=!1,this.groupingTreeList=!1,this.caseSensitive=!1,this.noValueFormatterSupplied=!1}init(e){this.updateParams(e);let t=this.isTreeDataOrGrouping.bind(this),s=()=>this.treeDataTreeList,i=this.createKey,o=this.caseFormat.bind(this),{gos:r,beans:n}=this,a=J(r,n.rowModel)?this.createManagedBean(new RL(i,o,e.getValue,t,s)):void 0,l=this.createManagedBean(new EL(a,o,i,t,{handlerParams:e,usingComplexObjects:!!(e.filterParams.keyCreator??e.colDef.keyCreator)}));this.addManagedListeners(l,{availableValuesChanged:e.onModelAsStringChange}),this.valueModel=l,this.appliedModel=new FL(this.caseFormat.bind(this)),this.appliedModel.update(e.model),this.validateModel(e),this.addEventListenersForDataChanges()}refresh(e){this.updateParams(e),this.valueModel.refresh({handlerParams:e,usingComplexObjects:!!(e.filterParams.keyCreator??e.colDef.keyCreator)}),this.appliedModel.update(e.model),this.validateModel(e)}updateParams(e){this.params=e;let{colDef:t,filterParams:{caseSensitive:s,treeList:i,keyCreator:o,valueFormatter:r}}=e;this.caseSensitive=!!s;let n=!!t.showRowGroup;this.treeDataTreeList=this.gos.get("treeData")&&!!i&&n,this.groupingTreeList=!!this.beans.rowGroupColsSvc?.columns.length&&!!i&&n;let a=o??t.keyCreator;this.createKey=this.generateCreateKey(a,this.isTreeDataOrGrouping()),this.setValueFormatter(r,a,!!i,!!t.refData)}doesFilterPass(e){let{appliedModel:t,treeDataTreeList:s,groupingTreeList:i}=this;if(t.isNull())return!0;if(t.isEmpty())return!1;let{node:o}=e;if(s)return this.doesFilterPassForTreeData(o);if(i)return this.doesFilterPassForGrouping(o);let r=this.params.getValue(o);if(r!=null&&Array.isArray(r)){if(r.length===0)return t.has(null);return r.some((n)=>t.has(this.createKey(n,o)))}return t.has(this.createKey(r,o))}getFormattedValue(e){let t=this.valueModel.getValueForFormatter(e);if(this.noValueFormatterSupplied&&this.isTreeDataOrGrouping()&&Array.isArray(t))t=k(t);let s=this.beans.valueSvc.formatValue(this.params.column,null,t,this.valueFormatter,!1);return(s==null?je(t):s)??Ze(this,"blanks")}getModelAsString(e,t){let{values:s}=e??{},i=t==="filterToolPanel";if(s==null)return i?Ze(this,"filterSummaryListInactive"):"";let o=this.valueModel.getAvailableKeys(s),r=o.length,n=i?3:10,a=o.slice(0,n).map((l)=>this.getFormattedValue(l));if(i){let l=a.join(Ze(this,"filterSummaryListSeparator"));if(r>3)return Ze(this,"filterSummaryListLong",[l,String(r-3)]);else return Ze(this,"filterSummaryListShort",[l])}return`(${r}) ${a.join(",")}${r>10?",...":""}`}onAnyFilterChanged(){window.setTimeout(()=>{if(!this.isAlive())return;this.valueModel.refreshAvailable().then((e)=>{this.dispatchLocalEvent({type:"anyFilterChanged",updated:!!e})})})}onNewRowsLoaded(){this.syncAfterDataChange()}setFilterValues(e){this.valueModel.overrideValues(e).then(()=>{this.refreshFilterValues()})}resetFilterValues(){this.valueModel.valuesType=xd.TAKEN_FROM_GRID_VALUES,this.syncAfterDataChange()}refreshFilterValues(e){if(!this.valueModel.isInitialised())return;this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:"dataChanged",hardRefresh:!0}),this.validateModel(this.params,void 0,!e)})}getFilterKeys(){return Array.from(this.valueModel.allValues.keys())}getFilterValues(){return Array.from(this.valueModel.allValues.values())}isTreeDataOrGrouping(){return this.treeDataTreeList||this.groupingTreeList}caseFormat(e){if(e==null||typeof e!=="string")return e;return this.caseSensitive?e:e.toUpperCase()}addEventListenersForDataChanges(){this.addManagedPropertyListeners(["groupAllowUnbalanced"],()=>this.syncAfterDataChange());let e=$e(this,this.syncAfterDataChange.bind(this),0);this.addManagedEventListeners({cellValueChanged:(t)=>{if(t.column===this.params.column)e()}})}syncAfterDataChange(){if(!this.isValuesTakenFromGrid())return;this.valueModel.refreshAll().then(()=>{this.dispatchLocalEvent({type:"dataChanged"}),this.validateModel(this.params,{afterDataChange:!0})})}validateModel(e,t,s){let i=this.valueModel;i.allKeys.then(()=>{let o=e.model;if(o==null)return;let r=new Map,n=(g)=>r.set(this.caseFormat(g),g);if(s)for(let g of i.availableKeys)n(g);else i.allValues.forEach((g,p)=>n(p));let a=[],l=!1;for(let g of o.values){let p=this.caseFormat(de(g)),f=r.get(p);if(f!==void 0){if(a.push(f),f!==g)l=!0}else l=!0}let c=a.length,d=e.filterParams;if(c===0&&d.excelMode){e.onModelChange(null,t);return}let h=!d.defaultToNothingSelected&&(this.valueModel.valuesType===xd.TAKEN_FROM_GRID_VALUES||!d.suppressClearModelOnRefreshValues)&&c===r.size;if(l||!o.filterType||h){let g=h?null:{filterType:this.filterType,values:a};e.onModelChange(g,t)}})}isValuesTakenFromGrid(){return this.valueModel.valuesType===xd.TAKEN_FROM_GRID_VALUES}doesFilterPassForTreeData(e){if(e.childrenAfterGroup?.length)return!1;let{gos:t,appliedModel:s}=this;return s.has(this.createKey(Ad(e.getRoute()??[e.key??e.id],!0,t.get("groupAllowUnbalanced"))))}doesFilterPassForGrouping(e){let{appliedModel:t,params:s,gos:i,beans:{rowGroupColsSvc:o,valueSvc:r}}=this,n=(o?.columns??[]).map((a)=>r.getKeyForNode(a,e));return n.push(s.getValue(e)),t.has(this.createKey(Ad(n,!1,i.get("groupAllowUnbalanced"))))}generateCreateKey(e,t){if(t&&!e)return X(250),()=>null;if(e)return(s,i=null)=>{let o=this.getKeyCreatorParams(s,i);return de(e(o))};return(s)=>de(je(s))}getKeyCreatorParams(e,t=null){let{colDef:s,column:i}=this.params;return I(this.gos,{value:e,colDef:s,column:i,node:t,data:t?.data})}setValueFormatter(e,t,s,i){let o=e;if(!o){if(t&&!s){X(249);return}if(this.noValueFormatterSupplied=!0,!i)o=(r)=>je(r.value)}this.valueFormatter=o}getCrossFilterModel(e){let{createKey:t,valueModel:s,params:i}=this;return e(t,s.availableKeys,i.model?.values)}destroy(){this.appliedModel.destroy(),super.destroy(),this.valueModel=void 0}},ML={tag:"div",cls:"ag-floating-filter-input ag-set-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},TL=class extends L{constructor(){super(ML,[us]);this.eFloatingFilterText=E}init(e){this.params=e,this.eFloatingFilterText.setDisabled(!0).addGuiEventListener("click",()=>this.params.showParentFilter()),this.setParams(e)}setParams(e){let t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0),s=this.getLocaleTextFunc();if(this.eFloatingFilterText.setInputAriaLabel(`${t} ${s("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){let i=e;this.updateFloatingFilterText(i.model)}}refresh(e){this.params=e,this.setParams(e)}onParentModelChanged(e){this.updateFloatingFilterText(e)}parentSetFilterInstance(e){this.params.parentFilterInstance((t)=>{if(!(t instanceof wC)){X(248);return}e(t)})}updateFloatingFilterText(e){if(e==null)this.eFloatingFilterText.setValue("");else if(this.gos.get("enableFilterHandlers"))this.eFloatingFilterText.setValue(this.params.getHandler().getModelAsString?.(e)??"");else this.parentSetFilterInstance((t)=>{this.eFloatingFilterText.setValue(t.getModelAsString(e))})}},SC={moduleName:"SetFilter",version:ie,userComponents:{agSetColumnFilter:{classImp:wC,params:{useForm:!0},processParams:(e)=>(wL(e),e)},agSetColumnFloatingFilter:TL},dynamicBeans:{agSetColumnFilterHandler:PL},icons:{setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",setFilterLoading:"loading"},dependsOn:[_e,vi]},DL=".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}";function AL(e,t,s){return e.getCompDetails(t,IL,void 0,s,!0)}var IL={name:"statusPanel",optionalMethods:["refresh"]},kL={agAggregationComponent:{rowModels:["clientSide","serverSide"],warnArgs:[221]},agFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[222]},agSelectedRowCountComponent:{rowModels:["clientSide","serverSide"],warnArgs:[223]},agTotalAndFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[224]},agTotalRowCountComponent:{rowModels:["clientSide"],warnArgs:[225]}},LL={tag:"div",cls:"ag-status-bar",children:[{tag:"div",ref:"eStatusBarLeft",cls:"ag-status-bar-left",role:"status"},{tag:"div",ref:"eStatusBarCenter",cls:"ag-status-bar-center",role:"status"},{tag:"div",ref:"eStatusBarRight",cls:"ag-status-bar-right",role:"status"}]},GL=class extends L{constructor(){super(LL);this.updateQueued=!1,this.panelsPromise=B.resolve(),this.eStatusBarLeft=E,this.eStatusBarCenter=E,this.eStatusBarRight=E,this.compDestroyFunctions={},this.registerCSS(DL)}wireBeans(e){this.userCompFactory=e.userCompFactory,this.statusBarSvc=e.statusBarSvc}postConstruct(){this.processStatusPanels(new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this)),Ns(this.beans,this,this.getGui())}getFocusableContainerName(){return"statusBar"}getValidPanels(){let e=this.gos,t=e.get("statusBar")?.statusPanels;if(!t)return t;return t.filter((s)=>{let{rowModels:i,warnArgs:o}=kL[s.statusPanel]??{};if(!i)return!0;if(i.includes(e.get("rowModelType")))return!0;return F(...o),!1})}processStatusPanels(e){let t=this.getValidPanels();if(t){let s=t.filter((r)=>r.align==="left"),i=t.filter((r)=>r.align==="center"),o=t.filter((r)=>!r.align||r.align==="right");this.panelsPromise=B.all([this.createAndRenderComponents(s,this.eStatusBarLeft,e),this.createAndRenderComponents(i,this.eStatusBarCenter,e),this.createAndRenderComponents(o,this.eStatusBarRight,e)])}else this.setDisplayed(!1)}handleStatusBarChanged(){if(this.updateQueued)return;this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1})}updateStatusBar(){let e=this.getValidPanels(),t=Array.isArray(e)&&e.length>0;this.setDisplayed(t);let s=new Map;if(t)for(let i of e){let o=i.key??i.statusPanel,r=this.statusBarSvc.getStatusPanel(o);if(r?.refresh){let n=I(this.gos,{...i.statusPanelParams??{},key:o});if(r.refresh(n))s.set(o,r),delete this.compDestroyFunctions[o],Me(r.getGui())}}if(this.resetStatusBar(),t)this.processStatusPanels(s)}resetStatusBar(){te(this.eStatusBarLeft),te(this.eStatusBarCenter),te(this.eStatusBarRight),this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){for(let e of Object.values(this.compDestroyFunctions))e();this.compDestroyFunctions={}}createAndRenderComponents(e,t,s){let i=[];for(let o of e){let r=o.key||o.statusPanel,n=s.get(r),a;if(n)a=B.resolve(n);else{let l=AL(this.userCompFactory,o,I(this.gos,{key:r}));if(l==null)continue;a=l.newAgStackInstance()}i.push({key:r,promise:a})}return B.all(i.map((o)=>o.promise)).then(()=>{for(let o of i)o.promise.then((r)=>{let n=()=>{this.destroyBean(r)};if(this.isAlive())this.statusBarSvc.registerStatusPanel(o.key,r),t.appendChild(r.getGui()),this.compDestroyFunctions[o.key]=n;else n()})})}},OL={selector:"AG-STATUS-BAR",component:GL},BL={tag:"div",cls:"ag-status-name-value",children:[{tag:"span",ref:"eLabel"},": ",{tag:"span",ref:"eValue",cls:"ag-status-name-value-value"}]},VL=BigInt(Number.MIN_SAFE_INTEGER),NL=BigInt(Number.MAX_SAFE_INTEGER),br=class extends L{constructor(){super(BL);this.eLabel=E,this.eValue=E}setLabel(e,t){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(e,t)}setValue(e,t){let s=null,i;if(typeof e==="bigint"){if(i=e,e>=VL&&e<=NL)s=Number(e)}else s=e;this.eValue.textContent=this.valueFormatter(I(this.gos,{value:s,bigintValue:i,totalRows:t,key:this.key}))}},_L={selector:"AG-NAME-VALUE",component:br},yC=(e)=>{let t=0;return e.forEachNodeAfterFilter((s)=>{if(s.data)t++}),t},Sr=(e)=>{let t=0;return e.forEachNode((s)=>{if(s.data)t++}),t};function HL(e,t){if(typeof e!=="number")return"";return kt(Math.round(e*100)/100,t)}var zL={tag:"div",cls:"ag-status-panel ag-status-panel-aggregations",children:[{tag:"ag-name-value",ref:"avgAggregationComp"},{tag:"ag-name-value",ref:"countAggregationComp"},{tag:"ag-name-value",ref:"minAggregationComp"},{tag:"ag-name-value",ref:"maxAggregationComp"},{tag:"ag-name-value",ref:"sumAggregationComp"}]},WL=class extends L{constructor(){super(zL,[_L]);this.sumAggregationComp=E,this.countAggregationComp=E,this.minAggregationComp=E,this.maxAggregationComp=E,this.avgAggregationComp=E}postConstruct(){this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(e){this.refresh(e)}refresh(e){this.params=e;let t=e.valueFormatter??((i)=>{let{value:o,bigintValue:r}=i;if(r!=null)return r.toString();return HL(o,this.getLocaleTextFunc.bind(this))}),s=["avg","count","min","max","sum"];for(let i of s){let o=this.getAllowedAggregationValueComponent(i);if(o)o.key=i,o.valueFormatter=t.bind(this)}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(e,t,s){let i=this.getAllowedAggregationValueComponent(e),o=Sr(this.beans.rowModel);if(M(i)&&i)i.setValue(t,o),i.setDisplayed(s);else this.getAggregationValueComponent(e)?.setDisplayed(!1)}getAllowedAggregationValueComponent(e){let{aggFuncs:t}=this.params;if(!t||t.includes(e))return this.getAggregationValueComponent(e);return null}getAggregationValueComponent(e){let t=`${e}AggregationComp`;return this[t]}onCellSelectionChanged(){let e=this.beans,{valueSvc:t,formula:s,rangeSvc:i}=e,o=i?.getCellRanges(),r=0,n=0n,a=!1,l=!1,c=0,d=0,u=null,h=null,g=null,p=null,f=(A)=>{if(typeof A==="number"){if(r+=A,u===null||A<u)u=A;if(h===null||A>h)h=A;if(!Number.isInteger(A)||!Number.isSafeInteger(A))l=!0;else{let _=BigInt(A);if(n+=_,g===null||_<g)g=_;if(p===null||_>p)p=_}}else{if(a=!0,n+=A,g===null||A<g)g=A;if(p===null||A>p)p=A;let _=Number(A);if(r+=_,u===null||_<u)u=_;if(h===null||_>h)h=_}d++},m={};if(o?.length&&i)for(let A=0;A<o.length;A++){let _=o[A],oe=i.getRangeStartRow(_),Y=i.getRangeEndRow(_);while(!0){if(q(oe)||!oe||Ce(Y,oe)||!oe||!_.columns)break;_.columns.forEach((re)=>{if(oe===null)return;let le=Qt({rowPinned:oe.rowPinned,column:re,rowIndex:oe.rowIndex});if(m[le])return;m[le]=!0;let U=Ee(e,oe);if(q(U))return;let W=t.getValue(re,U,"data");if(re.colDef.allowFormula&&s?.isFormula(W))W=s.resolveValue(re,U);if(q(W)||W==="")return;if(c++,typeof W==="object"&&"value"in W){if(W=W.value,W==="")return}if(typeof W==="string"){let Re=W.trim();if(Re==="")return;let ne=Number(Re);if(!Number.isFinite(ne))return;if(r+ne>=Number.MAX_SAFE_INTEGER||r+ne<=Number.MIN_SAFE_INTEGER||ne>=Number.MAX_SAFE_INTEGER||ne<=Number.MIN_SAFE_INTEGER){if(W=Is(Re),W===null)W=ne}else W=ne}if(typeof W==="number"&&!isNaN(W)||typeof W==="bigint")f(W)}),oe=ye(e,oe)}}let C=c>1,v=d>1,w=a&&!l,S;if(w)S=n/BigInt(d);else S=r/d;let x=v?w?n:r:null,R=v?w?g:u:null,P=v?w?p:h:null,D=v?S:null,O=v;this.setAggregationComponentValue("count",c,C),this.setAggregationComponentValue("sum",x,v),this.setAggregationComponentValue("min",R,v),this.setAggregationComponentValue("max",P,v),this.setAggregationComponentValue("avg",D,O)}},UL=class extends br{postConstruct(){this.setLabel("filteredRows","Filtered"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);let e=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:e})}onDataChanged(){let{rowModel:e}=this.beans,t=Sr(e),s=yC(e);this.setValue(s,t),this.setDisplayed(t!==s)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t})=>kt(t,this.getLocaleTextFunc.bind(this)))}refresh(e){let{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}},KL=class extends br{postConstruct(){this.setLabel("selectedRows","Selected"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-selected-row-count");let e=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:e,selectionChanged:e})}onRowSelectionChanged(){let{selectionSvc:e,rowModel:t}=this.beans,s=e?.getSelectionCount()??0,i=Sr(t);if(this.setValue(s,i),s<0){this.setDisplayed(!0);return}this.setDisplayed(s>0)}init(e){this.refresh(e),this.onRowSelectionChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t})=>{if(t==null||t>=0)return kt(t,this.getLocaleTextFunc.bind(this));return this.getLocaleTextFunc()("statusBarLastRowUnknown","?")})}refresh(e){let{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}},$L=class extends br{postConstruct(){this.setLabel("totalAndFilteredRows","Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let{rowModel:e}=this.beans,t=yC(e),s=Sr(e);this.setValue(t,s)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t,totalRows:s})=>{let i=this.getLocaleTextFunc.bind(this),o=kt(t,i),r=kt(s??t,i);if(t===s)return o;let n=i();return`${o} ${n("of","of")} ${r}`})}refresh(e){let{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}},jL=class extends br{postConstruct(){this.setLabel("totalRows","Total Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){let e=Sr(this.beans.rowModel);this.setValue(e,e)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:t})=>kt(t,this.getLocaleTextFunc.bind(this)))}refresh(e){let{key:t,valueFormatter:s}=e;return this.key=t,this.updateValueFormatter(s),!0}};function qL(e,t){let s=e.statusBarSvc?.getStatusPanel(t);return as(s)}var YL=class extends y{constructor(){super();this.beanName="statusBarSvc",this.comps=new Map}registerStatusPanel(e,t){this.comps.set(e,t)}unregisterStatusPanel(e){this.comps.delete(e)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(e){return this.comps.get(e)}destroy(){this.unregisterAllComponents(),super.destroy()}},xC={moduleName:"StatusBar",version:ie,beans:[YL],userComponents:{agAggregationComponent:WL,agTotalRowCountComponent:jL,agFilteredRowCountComponent:UL,agTotalAndFilteredRowCountComponent:$L,agSelectedRowCountComponent:KL},selectors:[OL],apiFunctions:{getStatusPanel:qL},dependsOn:[_e,mi]};function RC(e){if(e.excelCreator?.getFactoryMode()==="MULTI_SHEET")return F(161),!1;return!0}function XL(e,t){if(RC(e))return e.excelCreator?.getDataAsExcel(t);return}function ZL(e,t){if(RC(e))e.excelCreator?.exportDataAsExcel(t)}function QL(e,t){return e.excelCreator?.setFactoryMode("MULTI_SHEET"),e.excelCreator?.getSheetDataForExcel(t)}function JL(e,t){return e.excelCreator?.getMultipleSheetsAsExcel(t)}function eG(e,t){e.excelCreator?.exportMultipleSheetsAsExcel(t)}var FC={moduleName:"ExcelExport",version:ie,beans:[Y2],apiFunctions:{getDataAsExcel:XL,exportDataAsExcel:ZL,getSheetDataForExcel:QL,getMultipleSheetsAsExcel:JL,exportMultipleSheetsAsExcel:eG},dependsOn:[Hc,_e]};function fa(e){let{filters:t}=e;return t&&t.length>0?t:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function da(e,t){if(e==null)return;for(let s=e.length-1;s>=0;s--)t(e[s],s)}function tG(e,t){if(t.title!=null)return t.title;return e instanceof pi?e.getFilterTitle():"Filter"}function ua(e,t,s,i){let o=[],r=e?.filterModels;for(let n=0;n<t;n++)o[n]=(n===i?s:r?.[n])??null;return o.every((n)=>n==null)?null:{filterType:"multi",filterModels:o}}function ps(e,t){return e?.filterModels?.[t]??null}function ha(e,t,s,i){let o=s.filterValueGetter;return o?e.colFilter.createGetValue(t,o):i}var EC=class extends Ec{constructor(){super({tag:"div",cls:"ag-multi-filter ag-menu-list-compact"});this.filterDefs=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.lastActivatedMenuItem=null}postConstruct(){this.initialiseTabGuard({onFocusIn:(e)=>this.onFocusIn(e)})}refreshGui(e){if(e===this.lastOpenedInContainer)return B.resolve();return this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),B.all(this.getFilterWrappers().map((t,s)=>{if(!t)return B.resolve(null);let i=this.getFilterFromWrapper(t),o=this.getCompFromWrapper(t),r=this.filterDefs[s],n=tG(i,r),a;if(r.display==="subMenu"&&e!=="toolPanel")a=this.insertFilterMenu(o,i,n).then((l)=>l.getGui());else if(r.display==="subMenu"||r.display==="accordion"){let l=this.insertFilterGroup(i,o,n);a=B.resolve(l.getGui())}else a=B.resolve(o.getGui());return a})).then((t)=>{t.forEach((s,i)=>{if(!s)return;if(i>0)this.appendChild(ee({tag:"div",cls:"ag-filter-separator"}));this.appendChild(s)}),this.filterGuis=t,this.lastOpenedInContainer=e})}destroyChildren(){for(let e of this.guiDestroyFuncs)e();this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(e,t,s){let i=e.getGui();ge(i,"dialog");let o=this.createBean(new pk),r={getGui:()=>e.getGui(),afterGuiAttached:(n)=>{if(e.afterGuiAttached?.(n),e!==t)t.afterGuiAttached?.(n)}};return o.init({menuItemDef:{name:s,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:Jm,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:r,contextParams:{column:null,node:null,value:null}}).then(()=>{o.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(o)),this.addManagedListeners(o,{menuItemActivated:(a)=>{if(this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==a.menuItem)this.lastActivatedMenuItem.deactivate();this.lastActivatedMenuItem=a.menuItem}});let n=o.getGui();return o.addManagedElementListeners(n,{keydown:(a)=>{let{key:l}=a;switch(l){case b.UP:case b.RIGHT:case b.DOWN:case b.LEFT:if(a.preventDefault(),l===b.RIGHT)o.openSubMenu(!0);break}},focusin:()=>o.activate(),focusout:()=>{if(!o.isSubMenuOpen()&&!o.isSubMenuOpening())o.deactivate()}}),o})}insertFilterGroup(e,t,s){let i=this.createBean(new f3({title:s,cssIdentifier:"multi-filter"}));if(this.guiDestroyFuncs.push(()=>this.destroyBean(i)),i.addItem(t.getGui()),i.toggleGroupExpand(!1),e.afterGuiAttached)i.addManagedListeners(i,{expanded:()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})});return i}afterGuiAttached(e){let t;if(e)this.hidePopup=e.hidePopup,t=this.refreshGui(e.container);else this.hidePopup=void 0,t=B.resolve();let s=e?.suppressFocus;t.then(()=>{let{filterDefs:i,filterGuis:o,beans:r}=this,n=this.getFilterWrappers(),a=!!s;if(i)da(i,(c,d)=>{let u=d===0,h=c.display&&c.display!=="inline",g=s||!u||h,p={...e??{},suppressFocus:g},f=n[d],m=f?this.getFilterFromWrapper(f):void 0;if(f){let C=this.getCompFromWrapper(f);if(C!==m)C.afterGuiAttached(p)}if(m){if(this.executeFunctionIfExistsOnFilter(m,"afterGuiAttached",p),u&&!g)a=!0}if(!s&&u&&h){let C=o[d];if(C){if(!pe(C))C.focus({preventScroll:!0});a=!0}}});let l=j(r);if(!a&&(ks(r)||this.getGui().contains(l)))this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged",(e)=>this.executeOnWrapper(e,"onAnyFilterChanged"))}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded",(e)=>this.executeOnWrapper(e,"onNewRowsLoaded"))}destroy(){this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeOnWrapper(e,t){}executeFunctionIfExists(e,t){da(this.getFilterWrappers(),(s)=>{if(s)t?.(s),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper(s),e)})}executeFunctionIfExistsOnFilter(e,t,...s){let i=e[t];if(typeof i==="function")i.apply(e,s)}onFocusIn(e){let t=this.lastActivatedMenuItem;if(t!=null&&!t.getGui().contains(e.target))t.deactivate(),this.lastActivatedMenuItem=null}},PC=class extends EC{constructor(){super(...arguments);this.filterType="multi",this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}init(e){this.params=e,this.filterDefs=fa(e);let t=Fe(this.beans.colFilter.model,e.column.getColId()),{filterChangedCallback:s}=e;this.filterChangedCallback=s;let i=this.filterDefs.map((o,r)=>this.createFilter(o,r,t));return new B((o)=>{B.all(i).then((r)=>{this.wrappers=r,this.refreshGui("columnMenu").then(()=>{o()})})}).then(()=>{for(let o of this.afterFiltersReadyFuncs)o();this.afterFiltersReadyFuncs.length=0})}refresh(e){return this.params=e,!0}isFilterActive(){return this.wrappers.some((e)=>{if(!e)return!1;let{filter:t,handler:s,model:i}=e;if(s)return i!=null;return t.isFilterActive()})}getLastActiveFilterIndex(){let e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}doesFilterPass(e,t){return this.wrappers.every((s,i)=>{if(!s||t!=null&&i===t)return!0;let{handler:o,filter:r,model:n}=s;if(o)return n==null||o.doesFilterPass({...e,model:n,handlerParams:s.handlerParams});return!r.isFilterActive()||r.doesFilterPass(e)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map((t)=>{if(!t)return null;let s=t.filter;if(typeof s.getModelFromUi==="function")return s.getModelFromUi();return null})}}getModel(){if(!this.isFilterActive())return null;return{filterType:this.filterType,filterModels:this.wrappers.map((t)=>{if(!t)return null;let{filter:s,handler:i,model:o}=t;if(i)return o;return s.isFilterActive()?s.getModel():null})}}setModel(e){let t=(i,o)=>new B((r)=>{let n=i.setModel(o);if(n)n.then(r);else r()}),s=[];return this.wrappers.forEach((i,o)=>{if(!i)return;let r=ps(e,o),{filter:n,filterParams:a,handler:l,handlerParams:c,state:d}=i;if(l){let u={model:r,state:d?.state};i.state=u,i.model=r,s.push($n(()=>B.resolve({filter:n,filterParams:a}),l,c,r,u,"api").then(()=>{this.updateActiveListForHandler(o,i.model)}))}else s.push(t(n,r).then(()=>{this.updateActiveListForFilter(o,n)}))}),B.all(s).then(()=>{})}applyModel(e="api"){let t=!1;for(let s of this.wrappers)if(s){let i=s.filter;if(i instanceof pi)t=i.applyModel(e)||t}return t}getChildFilterInstance(e){return this.wrappers[e]?.filter}getNumChildFilters(){return this.wrappers.length}destroy(){for(let e of this.wrappers)this.destroyBean(e?.filter),this.destroyBean(e?.handler);this.wrappers.length=0,super.destroy()}getFilterWrappers(){return this.wrappers}getFilterFromWrapper(e){return e.filter}getCompFromWrapper(e){return e.comp}executeOnWrapper(e,t){e.handler?.[t]?.()}createFilter(e,t,s){let i=this.params.column,o=null,r,n=this.beans,a=(g,p)=>{let f=this.wrappers[t];if(!f)return;let m={model:g,state:f.state?.state};f.state=m,f.model=g,$n(()=>B.resolve({filter:f.filter,filterParams:f.filterParams}),f.handler,f.handlerParams,g,m,"ui").then(()=>{this.onHandlerModelChanged(t,f.model,p)})},{compDetails:l,handler:c,handlerParams:d,createFilterUi:u}=n.colFilter.createFilterInstance(i,e,"agTextColumnFilter",(g,p)=>{let f={...g,filterChangedCallback:p?()=>{}:(m)=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(t,m))},doesRowPassOtherFilter:(m)=>g.doesRowPassOtherFilter(m)&&this.doesFilterPass({node:m,data:m.data},t),getValue:ha(n,i,e,g.getValue)};if(p)o=ps(s,t),r=this.updateDisplayParams(f,t,o,()=>l,()=>c,a);return f});if(!u)return B.resolve(null);let h;if(c){let{doesRowPassOtherFilter:g,getValue:p}=d;h={...d,onModelChange:a,doesRowPassOtherFilter:(f)=>g(f)&&this.doesFilterPass({node:f,data:f.data},t),getValue:ha(n,i,e,p)},c.init?.({...h,model:o,source:"init"})}return u().then((g)=>{if(!c)return{filter:g,comp:g};let p=l?.params,f=r(g);return{filter:g,comp:f,filterParams:p,handler:c,handlerParams:h,model:o}})}updateDisplayParams(e,t,s,i,o,r){let n=this.params.column,a=new Dt;e.model=s,e.state={model:s},e.onModelChange=r,e.getHandler=o;let l=(d,u)=>{d.state=u,a.dispatchEvent({type:"filterStateChanged",column:n,state:u})};e.onStateChange=(d)=>{let u=this.wrappers[t];if(!u)return;l(u,d),oo(u.filter,u.filterParams,u.model??null,d,"ui")};let c=(d,u,h)=>{let g=this.wrappers[t];if(!g)return;let p=()=>g?.model??null;fn({action:u,filterParams:g.filterParams,getFilterUi:()=>{let f=B.resolve(g.filter);return{created:!0,filterParams:g.filterParams,compDetails:i(),create:()=>f,promise:f}},getModel:p,getState:()=>g?.state??{model:p()},updateState:(f)=>l(g,f),updateModel:(f)=>g.filterParams?.onModelChange(f,h),processModelToApply:g.handler?.processModelToApply?.bind(g.handler)})};return e.onAction=(d,u,h)=>{c(n,d,u),a.dispatchEvent({type:"filterAction",column:n,action:d,event:h})},(d)=>{let u=i()?.params;return this.createManagedBean(new Yc(n,{comp:d,params:u,isHandler:!0},a,c,!1))}}executeWhenAllFiltersReady(e){if((this.wrappers?.length??0)>0)e();else this.afterFiltersReadyFuncs.push(e)}updateActiveListForFilter(e,t){this.updateActiveList(e,()=>t?.isFilterActive())}updateActiveListForHandler(e,t){this.updateActiveList(e,()=>t!=null)}updateActiveList(e,t){let s=this.activeFilterIndices;if(ae(this.activeFilterIndices,e),t())s.push(e)}onFilterModelChanged(e,t){this.updateActiveListForFilter(e,this.wrappers[e]?.filter),this.filterChanged(e,t)}onHandlerModelChanged(e,t,s){this.updateActiveListForHandler(e,t),this.filterChanged(e,s)}filterChanged(e,t){this.filterChangedCallback(t),this.wrappers.forEach((s,i)=>{if(e===i||!s)return;let{filter:o,handler:r}=s;if(r?.onAnyFilterChanged?.(),typeof o.onAnyFilterChanged==="function")o.onAnyFilterChanged()})}getModelAsString(e){if(!e?.filterModels?.length)return"";let t=this.getLastActiveFilterIndex()??0;return this.wrappers[t]?.filter?.getModelAsString?.(e.filterModels[t])??""}},sG=class extends y{constructor(){super(...arguments);this.filterType="multi",this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(e){this.params=e;let t=fa(e.filterParams);this.filterDefs=t,t.forEach((s,i)=>{let o=this.beans.colFilter.createHandler(e.column,s,"agTextColumnFilter");if(this.handlerWrappers.push(o),!o){F(278,{colId:e.column.getColId()});return}let{handler:r,handlerParams:n}=o;r.init?.({...this.updateHandlerParams(n,i,!0),model:ps(e.model,i),source:"init"})}),this.resetActiveList(e.model)}refresh(e){this.params=e;let{model:t,source:s,filterParams:i}=e,o=i?.filters;if(this.handlerWrappers.forEach((r,n)=>{if(r){let a=this.updateHandlerParams(e,n,!1,o?.[n].filterParams);r.handlerParams=a,r.handler.refresh?.({...a,model:ps(t,n),source:s})}}),e.source!=="floating"&&e.source!=="ui")this.resetActiveList(e.model);if(e.additionalEventAttributes?.fromButtons||e.source==="floating")this.onAnyFilterChanged()}updateHandlerParams(e,t,s,i){let{onModelChange:o,doesRowPassOtherFilter:r,getValue:n}=e,a={...e,onModelChange:(l,c)=>o(ua(this.params.model,this.handlerWrappers.length,l,t),c),doesRowPassOtherFilter:(l)=>r(l)&&this.doesFilterPass({node:l,data:l.data,model:this.params.model,handlerParams:a},t),getValue:ha(this.beans,e.column,this.filterDefs[t],n),filterParams:this.updateFilterParams(e,s,i)};return a}updateFilterParams(e,t,s){let i=e.filterParams;if(s?.buttons&&t)F(292,{colId:e.column.getColId()});let o=s?{...i,...s}:i;if(!o.buttons)return o;if(s)return delete o.buttons,o;let{buttons:r,...n}=o;return n}doesFilterPass(e,t){let s=e.model?.filterModels;if(s==null)return!0;return this.handlerWrappers.every((i,o)=>{let r=s[o];if(r==null||t!=null&&o===t)return!0;let n=i?.handler;return!n||n.doesFilterPass({...e,model:r,handlerParams:i.handlerParams})})}resetActiveList(e){this.activeFilterIndices=[];let t=e?.filterModels;if(t==null)return;for(let s=0;s<this.handlerWrappers.length;s++)if(t[s]!=null)this.activeFilterIndices.push(s)}updateActiveList(e,t){let s=this.activeFilterIndices;if(ae(s,e),t!=null)s.push(e)}getLastActiveFilterIndex(){let e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}getModelAsString(e,t){let s=t==="filterToolPanel",i=()=>s?this.getLocaleTextFunc()("filterSummaryInactive","is (All)"):"";if(!e?.filterModels?.length)return i();let o=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[o]?.handler.getModelAsString?.(e.filterModels[o],t)??i()}getHandler(e){return this.handlerWrappers[e]?.handler}onAnyFilterChanged(){da(this.handlerWrappers,(e)=>e?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){da(this.handlerWrappers,(e)=>e?.handler?.onNewRowsLoaded?.())}destroy(){for(let e of this.handlerWrappers)this.destroyBean(e?.handler);this.handlerWrappers.length=0,super.destroy()}},iG=class extends y{constructor(){super(...arguments);this.beanName="multiFilter"}getParamsForDataType(e,t,s,i){let o=e?.filters,r=this.beans;if(!o)o=[{filter:$c(s.baseDataType)},{filter:"agSetColumnFilter"}];let n=this.getLocaleTextFunc();return o=o.map((a)=>{let{filter:l,filterParams:c,filterValueGetter:d}=a;if(typeof l!=="string")return a;let{filterParams:u,filterValueGetter:h}=Kc(l,c,d??t,s,i,r,n);return{...a,filterParams:u,filterValueGetter:h}}),{filterParams:{...e,filters:o}}}},MC=class extends EC{constructor(){super(...arguments);this.filterType="multi",this.filters=[],this.filterParams=[],this.validity=[]}init(e){this.params=e;let t=fa(e).map((i)=>{if(i.filterParams?.buttons){F(292,{colId:e.column.getColId()});let o={...i.filterParams};return delete o.buttons,{...i,filterParams:o}}return i});this.filterDefs=t,this.allState=e.state;let s=this.filterDefs.map((i,o)=>this.createFilter(i,o));return new B((i)=>{B.all(s).then((o)=>{if(!this.isAlive()){this.destroyBeans(o??[]),i();return}this.filters=o,this.refreshGui("columnMenu").then(()=>{i()})})})}refresh(e){let{model:t,state:s,source:i}=e;if(i==="colDef")return!1;this.params=e;let o=this.filterParams;if(s===this.allState)return!0;this.allState=s;let r=s.state;return this.filters.forEach((n,a)=>{let l=ps(t,a),c={state:r?.[a],model:ps(s.model,a)};oo(n,o[a],l,c,i)}),!0}getLastActiveFilterIndex(){return this.getHandler().getLastActiveFilterIndex?.()??null}getChildFilterInstance(e){return this.filters[e]??void 0}getNumChildFilters(){return this.filters.length}destroy(){this.filters=this.destroyBeans(this.filters),super.destroy()}getFilterWrappers(){return this.filters}getFilterFromWrapper(e){return e}getCompFromWrapper(e){return e}createFilter(e,t){let s=this.beans.userCompFactory,i=this.updateParams(e,this.params,t),o=nc(s,e,i,"agTextColumnFilter");if(!o)return B.resolve(null);return this.filterParams[t]=o.params,o.newAgStackInstance()}updateParams(e,t,s){let{doesRowPassOtherFilter:i,model:o,onModelChange:r,state:n,onStateChange:a,column:l,source:c,onAction:d,onUiChange:u,getValue:h}=t,g=ps(o,s),p=n?{model:ps(n.model,s),state:n.state?.[s]}:{model:g},f=()=>{let C=this.getHandler();this.filters.forEach((v,w)=>{if(s!==w)C.getHandler(w)?.onAnyFilterChanged?.(),v?.onAnyFilterChanged?.()})},m=this.beans.colFilter;return{...m.createBaseFilterParams(l),...e,doesRowPassOtherFilter:(C)=>i(C)&&this.getHandler().doesFilterPass({node:C,data:C.data,model:this.params.model,handlerParams:m.getHandlerParams(l)},s),model:g,state:p,onModelChange:(C,v)=>{let{filters:w,params:S}=this,x=ua(S.model,w.length,C,s);this.updateActiveList(s,C),r(x,v),f()},onStateChange:(C)=>this.onStateChange(a,s,C),getHandler:()=>this.getHandler().getHandler(s),onAction:(C,v,w)=>{if(eo(t))return;let S=C==="apply"||C==="reset";if(S)this.updateActiveList(s,ps(this.params.state.model,s));if(d(C,v,w),S)f()},onUiChange:u,source:c,getValue:ha(this.beans,l,e,h)}}updateActiveList(e,t){this.getHandler().updateActiveList?.(e,t)}getHandler(){return this.params.getHandler()}onStateChange(e,t,s){let{model:i,state:o,valid:r}=s,n=this.validity;n[t]=r;let a=this.allState,l=ua(a.model,this.filters.length,i,t),c=n.every((h)=>h!==!1),d=[...a.state??[]];d[t]=o;let u={state:d,model:l,valid:c};this.allState=u,e(u)}getModelAsString(e){return this.getHandler().getModelAsString?.(e)??""}},oG={tag:"div",cls:"ag-multi-floating-filter ag-floating-filter-input"},rG=class extends L{constructor(){super(oG);this.floatingFilters=[],this.compDetailsList=[]}init(e){this.params=e;let{compDetailsList:t}=this.getCompDetailsList(e);return this.setParams(t)}setParams(e){let t=[];return e.forEach((s)=>{let i=s?.newAgStackInstance();if(i!=null)this.compDetailsList.push(s),t.push(i)}),B.all(t).then((s)=>{s.forEach((i,o)=>{this.floatingFilters.push(i);let r=i.getGui();if(this.appendChild(r),o>0)G(r,!1)})})}refresh(e){this.params=e;let{compDetailsList:t,floatingFilterParamsList:s}=this.getCompDetailsList(e);if(t.length===this.compDetailsList.length&&t.every((o,r)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[r],o))){if(s.forEach((o,r)=>{this.floatingFilters[r].refresh?.(o)}),this.gos.get("enableFilterHandlers")){let o=e;if(o.model==null)this.floatingFilters.forEach((r,n)=>{G(r.getGui(),n===0)});else{let r=o.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((n,a)=>{let l=r==null?a===0:a===r;G(n.getGui(),l)})}}}else te(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t)}getCompDetailsList(e){let t=[],s=[],{filterParams:i,currentParentModel:o}=e,r=fa(i);return r.forEach((n,a)=>{let l={...e,parentFilterInstance:(d)=>{this.parentMultiFilterInstance((u)=>{let h=u.getChildFilterInstance(a);if(h==null)return;d(h)})},currentParentModel:()=>o()?.filterModels?.[a]??null};if(this.gos.get("enableFilterHandlers")){let d=l;d.model=d.model?.filterModels?.[a]??null;let{onModelChange:u,getHandler:h}=d;d.onModelChange=(g,p)=>u(ua(this.params.model,r.length,g,a),p),d.getHandler=()=>h().getHandler(a)}Se(l.filterParams,n.filterParams);let c=this.getCompDetails(n,l);if(c)t.push(c),s.push(l)}),{compDetailsList:t,floatingFilterParamsList:s}}onParentModelChanged(e,t){if(t?.afterFloatingFilter)return;this.parentMultiFilterInstance((s)=>{if(e==null)this.floatingFilters.forEach((i,o)=>{i.onParentModelChanged(null,t),G(i.getGui(),o===0)});else{let i=s.getLastActiveFilterIndex();this.floatingFilters.forEach((o,r)=>{let n=e.filterModels.length>r?e.filterModels[r]:null;o.onParentModelChanged(n,t);let a=i==null?r===0:r===i;G(o.getGui(),a)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){let{colFilter:s,frameworkOverrides:i,userCompFactory:o}=this.beans,r=jc(i,e,()=>s.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter";return ac(o,e,t,r)}parentMultiFilterInstance(e){this.params.parentFilterInstance((t)=>{if(!(t instanceof PC||t instanceof MC))X(120);e(t)})}},TC={moduleName:"MultiFilter",version:ie,userComponents:{agMultiColumnFilter:{getComp:(e)=>e.gos.get("enableFilterHandlers")?{classImp:MC,params:{useForm:!0}}:PC},agMultiColumnFloatingFilter:rG},beans:[iG],dynamicBeans:{agMultiColumnFilterHandler:sG},dependsOn:[_e,vi,Nd]},nG=class extends y{constructor(){super(...arguments);this.beanName="aggColNameSvc"}getHeaderName(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;let{valueColsSvc:s,colModel:i,rowGroupColsSvc:o}=this.beans,r=e.colDef.pivotValueColumn,n=M(r),a=null,l;if(n){let c=s?.columns??[],d=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&c.length===1,u=e.colDef.pivotTotalColumnIds!==void 0;if(d&&!u)return t;a=r?r.getAggFunc():null,l=!0}else{let c=e.isValueActive(),d=o?.columns.length!==0,u=i.pivotMode||d||this.gos.get("treeData");if(c&&u)a=e.getAggFunc(),l=!0;else l=!1}if(l){let c=typeof a==="string"?a:"func";return`${this.getLocaleTextFunc()(c,c)}(${t})`}return t}},aG={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"},lG=class extends y{constructor(){super(...arguments);this.beanName="aggFuncSvc",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){if(this.initialised)return;this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs"))}initialiseWithDefaultAggregations(){let e=this.aggFuncsMap;e.sum=cG,e.first=dG,e.last=uG,e.min=hG,e.max=gG,e.count=fG,e.avg=CG,this.initialised=!0}isAggFuncPossible(e,t){let i=this.getFuncNames(e).includes(t),o=M(this.aggFuncsMap[t]);return i&&o}getDefaultFuncLabel(e){return aG[e]??e}getDefaultAggFunc(e){let t=e.colDef.defaultAggFunc;if(M(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,"sum"))return"sum";let s=this.getFuncNames(e);return s?.length?s[0]:null}addAggFuncs(e){if(this.init(),!e)return;for(let t of Object.keys(e))if(e[t])this.aggFuncsMap[t]=e[t]}getAggFunc(e){return this.init(),this.aggFuncsMap[e]}getFuncNames(e){let t=e.colDef.allowedAggFuncs;return t==null?Object.keys(this.aggFuncsMap).sort():t}clear(){this.aggFuncsMap={}}};function cG(e){let{values:t}=e,s=null;for(let i=0;i<t.length;i++){let o=t[i];if(typeof o==="number")if(s===null)s=o;else s+=typeof s==="number"?o:BigInt(o);else if(typeof o==="bigint")if(s===null)s=o;else s=(typeof s==="bigint"?s:BigInt(s))+o}return s}function dG(e){return e.values.length>0?e.values[0]:null}function uG(e){return e.values.length>0?k(e.values):null}function hG(e){let{values:t}=e,s=null;for(let i=0;i<t.length;i++){let o=t[i];if((typeof o==="number"||typeof o==="bigint")&&(s===null||s>o))s=o}return s}function gG(e){let{values:t}=e,s=null;for(let i=0;i<t.length;i++){let o=t[i];if((typeof o==="number"||typeof o==="bigint")&&(s===null||s<o))s=o}return s}var pG=Object.freeze({toString:function(){return this.value.toString()},toNumber:function(){return this.value}});function fG(e){let{values:t}=e,s=0;for(let r=0;r<t.length;r++){let n=t[r];s+=n!=null&&typeof n.value==="number"?n.value:1}let i=e.rowNode?.aggData?.[e.column.getColId()];if(i?.value===s)return i;let o=Object.create(pG);return o.value=s,o}var mG=Object.freeze({toString:function(){return typeof this.value==="number"||typeof this.value==="bigint"?this.value.toString():""},toNumber:function(){return this.value}});function CG(e){let{values:t}=e,s=0,i=0;for(let a=0;a<t.length;a++){let l=t[a],c=null;if(typeof l==="number"||typeof l==="bigint")c=l,i++;else if(l!=null&&(typeof l.value==="number"||typeof l.value==="bigint")&&typeof l.count==="number")c=l.value*(typeof l.value==="number"?l.count:BigInt(l.count)),i+=l.count;if(typeof c==="number")s+=typeof s==="number"?c:BigInt(c);else if(typeof c==="bigint")s=(typeof s==="bigint"?s:BigInt(s))+c}let o=null;if(i>0)o=s/(typeof s==="number"?i:BigInt(i));let r=e.rowNode?.aggData?.[e.column?.getColId()];if(r?.count===i&&r.value===o)return r;let n=Object.create(mG);return n.count=i,n.value=o,n}var vG=class extends y{constructor(){super(...arguments);this.beanName="aggChildrenSvc"}getAggregatedChildren(e,t,s){if(!e?.group)return[];if(e.rowPinned){if(e=e.pinnedSibling,!e)return[]}let i=this.gos,o=DC(e,t,i);if(!s)return o;let r=[];return AC(o,t,i,r),r}},DC=(e,t,s)=>{let i=t?.colDef,o=i?.pivotKeys;if(o){if(e.leafGroup&&o.length&&!i.pivotTotalColumnIds)return aC(e.childrenMapped,o);return e.childrenAfterFilter??e.childrenAfterGroup??[]}if(qt(s)||s.get("suppressAggFilteredOnly"))return e.childrenAfterGroup??[];return e.childrenAfterFilter??e.childrenAfterGroup??[]},AC=(e,t,s,i)=>{for(let o=0,r=e.length;o<r;++o){let n=e[o];if(n.group)AC(DC(n,t,s),t,s,i);else i.push(n)}};function wG(e,t){if(e.aggFuncSvc)e.aggFuncSvc.addAggFuncs(t)}function bG(e){if(e.aggFuncSvc)e.aggFuncSvc.clear()}function SG(e,t,s){e.valueColsSvc?.setColumnAggFunc?.(t,s,"api")}var yG=class extends y{constructor(){super(...arguments);this.beanName="aggStage",this.step="aggregate",this.refreshProps=["getGroupRowAgg","alwaysAggregateAtRootLevel","suppressAggFilteredOnly","grandTotalRow"],this.hadAgg=!1}execute(e){let{gos:t,beans:s}=this,i=t.getCallback("getGroupRowAgg"),o=s.valueColsSvc?.columns;if(!o?.length&&!i){if(this.hadAgg&&!e){this.hadAgg=!1;let{colModel:S,rowModel:x}=s;Ae(x.rootNode,x.hierarchical,void 0,(R)=>{om(R,null,S)})}return}this.hadAgg=!0;let{colModel:r,aggFuncSvc:n}=s,a=t.get("alwaysAggregateAtRootLevel")||!!Xt(t)||r.pivotMode,l=!qt(t)&&!t.get("suppressAggFilteredOnly"),{valueSvc:c,gridApi:d}=s,u=s.gridOptions.context,h=o??[],g=h.length,p=e?.kind==="cells"?e:void 0,f,m=Array(g);for(let S=0;S<g;++S){let x=h[S],R=p?p.getSlot(x.colId):-1;if(R>=0)f=p;m[S]={column:x,colId:x.colId,colDef:x.colDef,aggFunc:IC(x.getAggFunc(),n,x),colSlot:R}}let C=FG(r,s.pivotResultCols,n),v=g>0?Array(g):null,w=s.rowModel;Ae(w.rootNode,w.hierarchical,e,(S)=>{if(S.level===-1&&!a){lo(S,null,r);return}let x;if(i)x=i({nodes:S.childrenAfterFilter});else if(!v)x=null;else if(C)x=RG(S,C,c,d,u);else x=xG(S,m,g,v,f,l,c,d,u);om(S,x,r)})}},xG=(e,t,s,i,o,r,n,a,l)=>{let c=(r?e.childrenAfterFilter:e.childrenAfterGroup)??[],d=c.length,u=e.data,h=Object.create(null),g=o?o.getSlot(e):-1,p=g>=0?e.aggData:void 0,f=0;for(let m=0;m<s;++m){let C=t[m];if(g>=0&&!o.hasCellBySlot(g,C.colSlot)){if(i[m]=null,p)h[C.colId]=p[C.colId]}else i[m]=Array(d),++f}if(f===0)return h;for(let m=0;m<d;++m){let C=c[m],v=C.aggData;if(v)for(let w=0;w<s;++w){let S=i[w];if(S!==null){let x=t[w],R=v[x.colId];S[m]=R!==void 0?R:n.getValue(x.column,C,"data")}}else for(let w=0;w<s;++w){let S=i[w];if(S!==null)S[m]=n.getValue(t[w].column,C,"data")}}for(let m=0;m<s;++m){let C=i[m];if(C===null)continue;let v=t[m],w=v.aggFunc;h[v.colId]=w?w({values:C,column:v.column,colDef:v.colDef,rowNode:e,data:u,aggregatedChildren:c,api:a,context:l}):null}return h},RG=(e,t,s,i,o)=>{let r=t.length,{leafGroup:n,data:a,childrenMapped:l}=e,c=e.childrenAfterFilter??[],d=Object.create(null),u,h;for(let g=0;g<r;++g){let p=t[g],{column:f,colId:m,totalColIds:C}=p,v,w;if(C!=null){let x=C.length;v=Array(x);for(let R=0;R<x;++R)v[R]=d[C[R]];w=c}else if(n){let x=p.pivotKeys;if(!h||x!==u)u=x,h=aC(l,x);w=h;let R=w.length;v=Array(R);for(let P=0;P<R;++P)v[P]=s.getValue(f,w[P],"data")}else{w=c;let x=w.length;v=Array(x);for(let R=0;R<x;++R){let P=w[R],D=P.aggData,O=D?D[m]:void 0;v[R]=O!==void 0?O:s.getValue(f,P,"data")}}let S=p.aggFunc;d[m]=S?S({values:v,column:f,colDef:f.colDef,pivotResultColumn:p.pivotResultCol,rowNode:e,data:a,aggregatedChildren:w,api:i,context:o}):null}return d},IC=(e,t,s)=>{if(typeof e==="function")return e;if(e==null)return null;let i=t.getAggFunc(e);if(typeof i!=="function")return F(109,{inputValue:e.toString(),allSuggestions:t.getFuncNames(s)}),null;return i},FG=(e,t,s)=>{if(!e.isPivotActive())return null;let i=t?.getAggregationOrderedList();if(!i||i.length===0)return null;let o=i.length,r=Array(o),n=0;for(let a=0;a<o;++a){let l=i[a],c=l.colDef,d=c.pivotValueColumn;if(!d)continue;r[n++]={column:d,colId:c.colId,aggFunc:IC(d.getAggFunc(),s,d),pivotResultCol:l,pivotKeys:c.pivotKeys,totalColIds:c.pivotTotalColumnIds}}if(n===0)return null;return r.length=n,r},EG=class extends y{constructor(){super(...arguments);this.beanName="filterAggStage",this.step="filter_aggregates",this.refreshProps=[],this.setAllChildrenCountTreeData=(e)=>{let t=e.childrenAfterAggFilter,s=0;if(t){let o=t.length;s=o;for(let r=0;r<o;++r)s+=t[r].allChildrenCount??0}let i=s===0&&e.level>=0?null:s;e.setAllChildrenCount(i),e.pinnedSibling?.setAllChildrenCount(i)},this.setAllChildrenCountGridGrouping=(e)=>{let t=e.childrenAfterAggFilter,s=0;for(let i=0,o=t.length;i<o;++i){let r=t[i];if(r.group)s+=r.allChildrenCount;else s++}e.setAllChildrenCount(s),e.pinnedSibling?.setAllChildrenCount(s)}}wireBeans(e){this.filterManager=e.filterManager}execute(e){let{rowModel:t,colModel:s,groupStage:i}=this.beans,{filterManager:o}=this,r=s.pivotMode,n=o?.isAggregateFilterPresent()||o?.isAggregateQuickFilterPresent(),a=!!i?.treeData,l=(p)=>!p.node.group,c=(p)=>p.node.leafGroup,d=qt(this.gos)||(r?c:l),u=a?this.setAllChildrenCountTreeData:this.setAllChildrenCountGridGrouping,h=(p,f=!1)=>{if(p.childrenAfterFilter){if(p.childrenAfterAggFilter=p.childrenAfterFilter,f){let m=p.childrenAfterAggFilter;for(let C=0,v=m.length;C<v;++C)h(m[C],f)}if(p.hasChildren())u(p);else p.setAllChildrenCount(null),p.pinnedSibling?.setAllChildrenCount(null)}if(p.sibling)p.sibling.childrenAfterAggFilter=p.childrenAfterAggFilter},g=(p)=>{if(p.childrenAfterAggFilter=p.childrenAfterFilter?.filter((f)=>{if(d({node:f})){if(o.doesRowPassAggregateFilters({rowNode:f}))return h(f,!0),!0}return f.childrenAfterAggFilter?.length})||null,p.hasChildren())u(p);else p.setAllChildrenCount(null),p.pinnedSibling?.setAllChildrenCount(null);if(p.sibling)p.sibling.childrenAfterAggFilter=p.childrenAfterAggFilter};Ae(t.rootNode,t.hierarchical,e,n?g:h)}};function fr(e,t,s){let i=e.sibling;if(i)return i;return i=Lg(e,t),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id=s??Bo+e.id,i.sibling=e,e.sibling=i,i}function PG(e){let t=e.sibling;if(!t)return;t._destroy(!1),e.sibling=void 0,t.sibling=void 0}var MG=class extends y{constructor(){super(...arguments);this.beanName="footerSvc"}addTotalRows(e,t,s,i,o,r){let n=e;if(o){let c=i&&Xt(this.gos);if(TG(r,c))s(fr(t,this.beans),n++);return n}let a=Pn(this.gos);if((i&&a({node:t}))===r)s(fr(t,this.beans),n++);return n}getTopDisplayIndex(e,t,s,i){let o=t;if(e[0].footer){if(t===0)return 0;o-=1}let r=e[e.length-1],n=o>=s.length;if(r.footer&&n)return r.rowIndex;return i(o)}doesCellShowTotalPrefix(e,t){if(!e.footer||!t?.getColDef().showRowGroup)return!1;if(this.gos.get("treeData"))return!0;if(e.level===-1)return this.beans.showRowGroupCols?.columns[0]===t;return!!e.rowGroupColumn&&t?.isRowGroupDisplayed(e.rowGroupColumn.getId())}applyTotalPrefix(e,t,s,i){let o=i.getColDef().cellRendererParams?.totalValueGetter;if(o){let r=I(this.gos,{column:i,node:s,value:e,formattedValue:t});if(typeof o==="function")return o(r);if(typeof o==="string")return this.beans.expressionSvc?.evaluate(o,r);F(179)}if(s.level===-1)return this.getLocaleTextFunc()("footerTotal","Total")+" ";return this.getTotalValue(t??e)??""}getTotalValue(e){return this.getLocaleTextFunc()("footerTotal","Total")+" "+(e??"")}};function TG(e,t){switch(t){case"top":case"pinnedTop":return e==="top";case"bottom":case"pinnedBottom":return e==="bottom";default:return!1}}var kC=class extends ro{constructor(){super(...arguments);this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(e,t,s)=>this.setValueActive(t,e,s),add:(e,t,s)=>this.setValueActive(!0,e,s),remove:(e,t,s)=>this.setValueActive(!1,e,s)},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColValueActive(e,t,s),getIndexFunc:()=>{return},getInitialIndexFunc:()=>{return},getValueFunc:(e)=>{let t=e.aggFunc;if(t===null||t==="")return null;if(t===void 0)return;return!!t},getInitialValueFunc:(e)=>e.initialAggFunc!=null&&e.initialAggFunc!=""},this.modifyColumnsNoEventsCallbacks={addCol:(e)=>this.columns.push(e),removeCol:(e)=>ae(this.columns,e)}}extractCols(e,t){this.columns=super.extractCols(e,t);for(let s of this.columns){let i=s.colDef;if(i.aggFunc!=null&&i.aggFunc!="")this.setColAggFunc(s,i.aggFunc);else if(!s.getAggFunc())this.setColAggFunc(s,i.initialAggFunc)}return this.columns}setColumnAggFunc(e,t,s){if(!e)return;let i=this.colModel.getColDefCol(e);if(!i)return;this.setColAggFunc(i,t),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[i],s)}syncColumnWithState(e,t,s){let i=s("aggFunc").value1;if(i!==void 0)if(typeof i==="string"){if(this.setColAggFunc(e,i),!e.isValueActive())this.setColValueActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)}else{if(M(i))F(33);if(e.isValueActive())this.setColValueActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)}}setValueActive(e,t,s){if(e===t.isValueActive())return;if(this.setColValueActive(t,e,s),e&&!t.getAggFunc()&&this.aggFuncSvc){let i=this.aggFuncSvc.getDefaultAggFunc(t);this.setColAggFunc(t,i)}}setColAggFunc(e,t){e.aggFunc=t,e.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(e,t,s){if(e.aggregationActive!==t)e.aggregationActive=t,e.dispatchColEvent("columnValueChanged",s)}},LC={moduleName:"SharedAggregation",version:ie,beans:[lG,nG,MG,kC],apiFunctions:{addAggFuncs:wG,clearAggFuncs:bG,setColumnAggFunc:SG},dependsOn:[_e]},DG={moduleName:"Aggregation",version:ie,beans:[yG,EG,vG],rowModels:["clientSide"],dependsOn:[LC]},GC=class extends ro{constructor(){super(...arguments);this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(e,t,s)=>this.setColPivotActive(e,t,s),add:(e,t,s)=>this.setColPivotActive(e,!0,s),remove:(e,t,s)=>this.setColPivotActive(e,!1,s)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColPivotActive(e,t,s),getIndexFunc:(e)=>e.pivotIndex,getInitialIndexFunc:(e)=>e.initialPivotIndex,getValueFunc:(e)=>e.pivot,getInitialValueFunc:(e)=>e.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:(e)=>{if(!this.columns.includes(e))this.columns.push(e)},removeCol:(e)=>ae(this.columns,e)}}syncColumnWithState(e,t,s,i){let{value1:o,value2:r}=s("pivot","pivotIndex");if(o!==void 0||r!==void 0){if(typeof r==="number"||o){if(!e.isPivotActive())this.setColPivotActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e);if(i&&typeof r==="number")i[e.getId()]=r}else if(e.isPivotActive())this.setColPivotActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)}}setColPivotActive(e,t,s){if(e.pivotActive!==t){if(e.pivotActive=t,t)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e)?.forEach((o)=>this.setColPivotActive(o,t,s));e.dispatchColEvent("columnPivotChanged",s)}e.dispatchStateUpdatedEvent("pivot")}},AG=class extends ro{constructor(){super(...arguments);this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(e,t,s)=>this.setActive(t,e,s),add:(e,t,s)=>this.setActive(!0,e,s),remove:(e,t,s)=>this.setActive(!1,e,s)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(e,t,s)=>this.setColRowGroupActive(e,t,s),getIndexFunc:(e)=>e.rowGroupIndex,getInitialIndexFunc:(e)=>e.initialRowGroupIndex,getValueFunc:(e)=>e.rowGroup,getInitialValueFunc:(e)=>e.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:(e)=>{if(!this.columns.includes(e))this.columns.push(e)},removeCol:(e)=>ae(this.columns,e)}}moveColumn(e,t,s){if(this.columns.length===0)return;let i=this.columns[e],o=this.columns.slice(e,t);this.columns.splice(e,1),this.columns.splice(t,0,i),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:o,column:o.length===1?o[0]:null,source:s})}syncColumnWithState(e,t,s,i){let{value1:o,value2:r}=s("rowGroup","rowGroupIndex");if(o!==void 0||r!==void 0){if(typeof r==="number"||o){if(!e.isRowGroupActive())this.setColRowGroupActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e);if(i&&typeof r==="number")i[e.getId()]=r}else if(e.isRowGroupActive())this.setColRowGroupActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)}}setActive(e,t,s){if(e===t.isRowGroupActive())return;this.setColRowGroupActive(t,e,s);let i=this.beans.groupHierarchyColSvc?.getColumn(t);if(Tn(this.gos,e)&&!i)this.colModel.setColsVisible([t],!e,s)}setColRowGroupActive(e,t,s){if(e.rowGroupActive!==t){if(e.rowGroupActive=t,t)this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e)?.forEach((o)=>this.setColRowGroupActive(o,t,s));e.dispatchColEvent("columnRowGroupChanged",s)}e.dispatchStateUpdatedEvent("rowGroup")}},IG=class extends y{constructor(){super(...arguments);this.beanName="autoColSvc"}postConstruct(){this.addManagedPropertyListener("autoGroupColumnDef",this.updateColumns.bind(this)),this.setupGroupHideColumnsUntilExpanded()}setupGroupHideColumnsUntilExpanded(){let e=()=>this.updateGroupColumnVisibility();this.addManagedEventListeners({modelUpdated:e}),this.addManagedPropertyListeners(["groupHideColumnsUntilExpanded","groupDisplayType","groupHideOpenParents"],e)}addColumns(e){let{columns:t}=this;if(t==null)return;e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Zo(e)}createColumns(e,t,s){let i=this.beans,{colModel:o,gos:r,rowGroupColsSvc:n,colGroupSvc:a}=i,l=o.pivotMode,c=Mn(r,l),d=l?r.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),u=n?.columns,g=!(u&&u.length>0||r.get("treeData"))||d||c,p=()=>{if(this.columns)gt(i,this.columns.tree),this.columns=null};if(g){p();return}let f=this.generateAutoCols(u),m=Xo(f,this.columns?.list||null),C=e.treeDepth,w=(this.columns?this.columns.treeDepth:-1)==C;if(m&&w){let P=new Map(f.map((D)=>[D.getId(),D]));for(let D of this.columns?.list??[]){let O=P.get(D.getId());if(O)D.setColDef(O.colDef,null,s)}return}p();let S=a?.findDepth(e.tree)??0,x=a?.balanceTreeForAutoCols(f,S)??[];this.columns={list:f,tree:x,treeDepth:S,map:{}},t((P)=>{if(!P)return null;let D=P.filter((O)=>!gi(O));return[...f,...D]})}updateColumns(e){let t=Ms(e.source);this.columns?.list.forEach((s,i)=>this.updateOneAutoCol(s,i,t))}getColumn(e){return this.columns?.list.find((t)=>jt(t,e))??null}getColumns(){return this.columns?.list??null}generateAutoCols(e=[]){let t=[],{gos:s}=this,i=s.get("treeData"),o=qo(s);if(i&&o)F(182),o=!1;if(o)e.forEach((r,n)=>{t.push(this.createOneAutoCol(r,n))});else t.push(this.createOneAutoCol());return t}isSuppressAutoCol(){let e=this.gos;if(e.get("groupDisplayType")==="custom")return!0;return e.get("treeDataDisplayType")==="custom"}createOneAutoCol(e,t){let s;if(e)s=`${hi}-${e.getId()}`;else s=hi;let i=this.createAutoColDef(s,e,t);i.colId=s;let o=new Ct(i,null,s,!0);return this.createBean(o),o}updateOneAutoCol(e,t,s){let i=e.colDef,o=typeof i.showRowGroup=="string"?i.showRowGroup:void 0,r=this.beans,n=o!=null?r.colModel.getColDefCol(o):void 0,a=e.getId(),l=this.createAutoColDef(a,n??void 0,t);e.setColDef(l,null,s),Je(r,{state:[ic(l,a)]},s)}createAutoColDef(e,t,s){let i=this.createBaseColDef(t),o=this.gos.get("autoGroupColumnDef");if(Se(i,o),i=ns(this.beans,i,e,!0),o?.groupRowEditable==null)i.groupRowEditable=void 0;if(o?.groupRowValueSetter==null)i.groupRowValueSetter=void 0;if(!this.gos.get("treeData")){if(q(i.field)&&q(i.valueGetter)&&q(i.filterValueGetter)&&i.filter!=="agGroupColumnFilter")i.filter=!1}if(s&&s>0)i.headerCheckboxSelection=!1;let r=zt(this.gos),n=i.valueGetter||i.field!=null;if(r&&!n)i.sortIndex=void 0,i.initialSort=void 0;return i}createBaseColDef(e){let t=this.gos.get("autoGroupColumnDef"),i={headerName:this.getLocaleTextFunc()("group","Group"),showRowGroup:e?.colId??!0};if(!(t&&(t.cellRenderer||t.cellRendererSelector)))i.cellRenderer="agGroupCellRenderer";if(e)i.headerName=this.beans.colNames.getDisplayNameForColumn(e,"header")??void 0,i.headerValueGetter=e.colDef.headerValueGetter;return i}getDeepestExpandedLevel(e,t){let s=-1;if(!e)return s;for(let i of e){if(!i.group||!i.expanded)continue;if(i.level>s)s=i.level;if(s>=t)return s;let o=this.getDeepestExpandedLevel(i.childrenAfterGroup,t);if(o>s)s=o;if(s>=t)return s}return s}updateGroupColumnVisibility(){let e=this.columns?.list;if(!e||e.length===0)return;let{gos:t,visibleCols:s,rowModel:i}=this.beans,o=Zl(t),r=!1,n=(l,c)=>{if(c!==l.isVisible())l.setVisible(c,"api"),r=!0},a=()=>{for(let l of e)n(l,!0)};if(!o)a();else if(e.length>1){let l=e.length-2,c=i?.rootNode?.childrenAfterGroup,d=this.getDeepestExpandedLevel(c,l);if(d>=l)a();else for(let u=0;u<e.length-1;u++)n(e[u+1],d>=u)}if(r)s.refresh("api")}destroy(){gt(this.beans,this.columns?.tree),super.destroy()}},Id=null,pm=(e)=>{let t=Id,s=new Uint32Array(1<<32-Math.clz32(e|63));if(t)s.set(t);return Id=s,s},kG=(e,t,s,i)=>{let o=t-i,r=s-1;if(o===1){let c=0;while(e[c].level===r)++c;if(c<t-1){let d=e[c];e.copyWithin(c,c+1),e[t-1]=d}return e}if(i===1){let c=0;while(e[c].level!==r)++c;if(c>0){let d=e[c];e.copyWithin(1,0,c),e[0]=d}return e}let n=Array(o),a=0,l=0;for(let c=0;c<t;++c){let d=e[c];if(d.level===r)e[a++]=d;else n[l++]=d}for(let c=0;c<o;++c)e[i+c]=n[c];return e},LG=(e,t)=>{let s=e[0].level+1,i=s,o=0,r=s,n=Id;if(!n||s>=n.length)n=pm(s);++n[s];for(let u=1;u<t;++u){let h=e[u].level+1;if(h>s){if(s=h,s>=n.length)n=pm(s)}else if(h<i)i=h;++n[h],o|=r-h,r=h}if(o>=0)return n.fill(0,i,s+1),e;let a=n[i],l=n[s];if(a+l===t)return n[i]=0,n[s]=0,kG(e,t,s,l);let c=0;for(let u=s;u>=i;--u){let h=n[u];n[u]=c,c+=h}let d=Array(t);for(let u=0;u<t;++u){let h=e[u];d[n[h.level+1]++]=h}return n.fill(0,i,s+1),d},OC=(e,t=e.length)=>{if(t===2){if(e[0].level<e[1].level){let s=e[0];e[0]=e[1],e[1]=s}return e}if(t>16)return LG(e,t);for(let s=1;s<t;s++){let i=e[s],o=i.level,r=s-1;if(e[r].level<o){let n=s;do e[n]=e[r],n=r--;while(r>=0&&e[r].level<o);e[n]=i}}return e},GG=class{constructor(){this.kind="cells",this.rows=[],this.unsorted=!1,this.slots=new Map,this.bits=[],this.extraBits=null,this.colCount=0}addRow(e){let t=e;if(t==null)return;let s=this.slots;if(s.get(t)!==void 0){while(t!=null&&s.get(t)>=0)s.set(t,-1),t=t.parent;return}let i=this.rows;do s.set(t,-1),i.push(t),t=t.parent;while(t!=null&&!s.has(t));this.unsorted=!0}addCell(e,t){if(t==null){this.addRow(e);return}if(e==null)return;let s=this.slots,i=this.bits,o=s.get(t)??this.ensureCol(t),r=s.get(e);if(r===void 0)r=this.ensureRow(e);else if(r<0)return;let n=o<32?i:this.extraBits[(o>>>5)-1],a=1<<(o&31),l=n[r];if((l&a)!==0)return;n[r]=l|a;let c=e.parent;while(c!=null){let d=s.get(c);if(d<0)break;let u=n[d];if((u&a)!==0)break;n[d]=u|a,c=c.parent}}hasRow(e){return this.slots.has(e)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let e=OC(this.rows);return this.rows=e,e}getSlot(e){return this.slots.get(e)??-1}hasCellBySlot(e,t){if(e<0)return!0;if(t<32)return t>=0&&(this.bits[e]&1<<t)!==0;return(this.extraBits[(t>>>5)-1][e]&1<<(t&31))!==0}ensureRow(e){let t=this.slots,s=this.rows,i=this.bits,o=this.extraBits,r=i.push(0),n=r-1;if(o!==null)for(let l=0,c=o.length;l<c;++l)o[l].push(0);t.set(e,n),s.push(e),this.unsorted=!0;let a=e.parent;while(a!=null&&!t.has(a)){if(t.set(a,r),s.push(a),r=i.push(0),o!==null)for(let l=0,c=o.length;l<c;++l)o[l].push(0);a=a.parent}return n}ensureCol(e){let t=this.colCount++;if(this.slots.set(e,t),t>=32){let s=(t>>>5)-1,i=this.extraBits;if(i===null)i=[],this.extraBits=i;if(s>=i.length)i.push(Array(this.bits.length).fill(0))}return t}},fm=class{constructor(){this.kind="rows",this.rows=[],this.unsorted=!1,this.rowSet=new Set}addRow(e){let t=e;if(t==null)return;let s=this.rowSet;if(s.has(t))return;let i=this.rows;do s.add(t),i.push(t),t=t.parent;while(t!=null&&!s.has(t));this.unsorted=!0}addCell(e,t){this.addRow(e)}hasRow(e){return this.rowSet.has(e)}getSortedRows(){if(!this.unsorted)return this.rows;this.unsorted=!1;let e=OC(this.rows);return this.rows=e,e}},OG=class extends y{constructor(){super(...arguments);this.beanName="changedPathFactory"}newPath(e){return e?new GG:new fm}ensureRowsPath(e){let t=e.changedPath;if(!t&&e.changedRowNodes&&!e.newData){let s=this.beans.rowModel;if(s.hierarchical)t=new fm,e.changedPath=t,t.addRow(s.rootNode)}return t}},BG=class extends y{addExpandedCss(e,t){if(t.isExpandable())e.push("ag-row-group"),e.push(t.expanded?"ag-row-group-expanded":"ag-row-group-contracted")}getRowExpandedListeners(e){let{rowNode:t}=e,s=this.updateExpandedCss.bind(this,e,t);return{expandedChanged:s,hasChildrenChanged:s}}setExpanded(e,t,s,i){if(e.expanded===t)return;if(!t&&e.sticky)this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop);e._expanded=t,e.dispatchRowEvent("expandedChanged");let o={...pc(e,this.gos,"rowGroupOpened"),expanded:t,event:s||null};this.dispatchExpandedEvent(o,i)}defaultExpanded(e){let s=this.beans.gos,i=e.level??0,o=e.group&&s.get("isGroupOpenByDefault");if(!o){let n=s.get("groupDefaultExpanded");return n===-1||i<n}let r=I(s,{rowNode:e,field:e.field,key:e.key,level:i,rowGroupColumn:e.rowGroupColumn});return!!o(r)}isExpandable(e){if(e.footer)return!1;if(this.beans.colModel.pivotMode)return e.hasChildren()&&!e.leafGroup;return e.hasChildren()||e.master}updateExpandedCss(e,t){let s=t.isExpandable(),i=t.expanded==!0;e.forEachGui(void 0,(o)=>{let r=o.rowComp;r.toggleCss("ag-row-group",s),r.toggleCss("ag-row-group-expanded",s&&i),r.toggleCss("ag-row-group-contracted",s&&!i),De(o.element,s&&i)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:"rowExpansionStateChanged"})}},VG=class extends BG{constructor(){super(...arguments);this.beanName="expansionSvc",this.events=null,this.dispatchExpandedDebounced=null}destroy(){super.destroy(),this.events=null,this.dispatchExpandedDebounced=null}setExpansionState(e){let t=new Set(e.expandedRowGroupIds);this.beans.rowModel.forEachNode((s)=>{let i=s.id;if(!i)return;s._expanded=t.has(i)}),this.onGroupExpandedOrCollapsed()}getInternalExpansionState(e=!1){let t=[],s=[];return this.beans.rowModel.forEachNode((i)=>{let o=i.id;if(!o)return;if(i.expanded)t.push(o);else if(e&&i.isExpandable())s.push(o)}),{expandedRowGroupIds:t,collapsedRowGroupIds:s}}getExpansionState(){return this.getInternalExpansionState()}isExpanded(e){if(e.footer)return!!e._expanded;if(!(e.group||e.master)||e.leafGroup&&this.beans.colModel.pivotMode)return!1;let t=e._expanded;if(t===null)t=this.defaultExpanded(e)??!1,e._expanded=t;return!!t}resetExpansion(){let{rowModel:e}=this.beans;e.forEachNode((t)=>{if(!t.group&&!t.master)return;t._expanded=null}),this.onGroupExpandedOrCollapsed()}expandAll(e){let{gos:t,rowModel:s,colModel:i,eventSvc:o}=this.beans,r=t.get("treeData"),n=i.isPivotActive(),a=(c)=>{if(!c)return;for(let d of c){let u=()=>{d._expanded=e,a(d.childrenAfterGroup)};if(d.master){u();continue}if(r){if(M(d.childrenAfterGroup))u();continue}if(n){if(!d.leafGroup)u();continue}if(d.group)u()}},l=s.rootNode;if(l)a(l.childrenAfterGroup);this.onGroupExpandedOrCollapsed(),o.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.reMapRows()}setDetailsExpansionState(e){let t=this.getInternalExpansionState(!0),s=t.collapsedRowGroupIds.length===0;if(t.expandedRowGroupIds.length===0===s)return;return s?e.expandAll():e.collapseAll()}dispatchExpandedEvent(e,t){if((this.events??(this.events=[])).push(e),t){this.dispatchExpandedEvents();return}let s=this.dispatchExpandedDebounced;if(!s){if(!this.isAlive())return;s=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=s}s()}dispatchExpandedEvents(){let{eventSvc:e,rowRenderer:t}=this.beans,s=this.events,i=s?.length;if(!i)return;this.events=null;let o=Array(i);for(let r=0;r<i;++r)o[r]=s[r].node,e.dispatchEvent(s[r]);this.dispatchStateUpdatedEvent(),t.refreshCells({rowNodes:o})}debounce(e){let t=this.beans.animationFrameSvc;if(!t)return()=>window.setTimeout(e,0);let s=!1;return()=>{if(!t.active){window.setTimeout(e,0);return}if(s)return;s=!0,t.addDestroyTask(()=>{s=!1,e()})}}};function NG(e){let t=e.get("groupHideParentOfSingleChild");if(!t){if(t=e.get("groupRemoveSingleChildren"),!t&&e.get("groupRemoveLowestSingleChildren"))t="leafGroupsOnly"}return{groupHideParentOfSingleChild:t,isGroupMultiAutoColumn:qo(e),hideOpenParents:e.get("groupHideOpenParents"),grandTotalRow:Xt(e),groupTotalRow:Pn(e)}}function _G(e,t,s){return e.groupHideParentOfSingleChild===!0&&s&&t.childrenAfterGroup.length===1}function HG(e,t,s){return e.groupHideParentOfSingleChild==="leafGroupsOnly"&&s&&t.leafGroup&&t.childrenAfterGroup.length===1}function zG(e,t,s,i,o,r){if(i&&!s)return!1;if(o||r)return!1;if(!e.hideOpenParents)return!0;if(t.master||t.level===-1)return!0;if(!(i&&t.leafGroup)&&t.expanded)return!1;return!0}var WG=class extends y{constructor(){super(...arguments);this.beanName="flattenStage",this.step="map",this.refreshProps=["groupHideParentOfSingleChild","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupTotalRow","masterDetail"]}execute(){let{beans:e,gos:t}=this,s=[],i=e.rowModel.rootNode;if(!i)return s;let o=e.colModel.pivotMode,r=o&&i.leafGroup&&i.aggData,n=r?[i]:i.childrenAfterSort,a=NG(t);this.recursivelyAddToRowsToDisplay(a,n,s,o,0);let l=s.length>0,c=a.grandTotalRow;if(!r&&l&&c){let u=fr(i,e),h=eg(c);if(h)this.beans.pinnedRowModel?.setGrandTotalPinned(h);else this.addRowNodeToRowsToDisplay(a,u,s,0,c==="top")}return s}recursivelyAddToRowsToDisplay(e,t,s,i,o){if(!t?.length)return;let r=this.beans.masterDetailSvc;for(let n=0;n<t.length;n++){let a=t[n],l=a.hasChildren(),c=_G(e,a,l),d=HG(e,a,l);if(zG(e,a,l,i,c,d))this.addRowNodeToRowsToDisplay(e,a,s,o);if(i&&a.leafGroup)continue;if(l){let h=c||d;if(a.expanded||h){let g=e.groupTotalRow({node:a});if(!g)PG(a);let p=h?o:o+1,f;if(g==="top")f=fr(a,this.beans),this.addRowNodeToRowsToDisplay(e,f,s,p);let m=r?.getDetail(a);if(m)this.addRowNodeToRowsToDisplay(e,m,s,o);if(this.recursivelyAddToRowsToDisplay(e,a.childrenAfterSort,s,i,p),g==="bottom")f=fr(a,this.beans),this.addRowNodeToRowsToDisplay(e,f,s,p)}}else{let h=r?.getDetail(a);if(h)this.addRowNodeToRowsToDisplay(e,h,s,o)}}}addRowNodeToRowsToDisplay(e,t,s,i,o){if(o)s.unshift(t);else s.push(t);t.setUiLevel(e.isGroupMultiAutoColumn?0:i)}},UG=class extends y{constructor(){super(...arguments);this.beanName="groupEditSvc",this.pendingEditRefresh=null,this.dropGroupTarget=null,this.dropGroupTimer=null,this.dropGroupThrottled=!1,this.draggingGroups=null}postConstruct(){if(J(this.gos))this.addManagedListeners(this.eventSvc,{cellValueChanged:(e)=>this.onCsrmCellChange(e),batchEditingStopped:()=>this.flushGroupEdits()})}destroy(){this.stopDragging(!0),super.destroy()}isGroupingDrop(e){if(!e.rowDragManaged||!e.sameGrid)return!1;if(!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length&&!this.beans.colModel.pivotMode}initDraggingGroups(e){let t=new Map,s=(i)=>{let o=i.childrenAfterGroup;if(o){if(t.has(i))return;let r=o.slice();t.set(i,r);for(let n of r)s(n)}};for(let i of e.rows)if(i.group)s(i);this.draggingGroups=t}canSetParent(e){if(!e.sameGrid)return!1;if(this.beans.groupStage?.treeData)return!0;if(e.rowDragManaged&&!this.gos.get("refreshAfterGroupEdit"))return!1;return!!this.beans.rowGroupColsSvc?.columns?.length}canDropRow(e,t){if(this.beans.groupStage?.treeData)return!KG(e,t.newParent);let{position:s,target:i,newParent:o,rootNode:r}=t,n=e.parent;if(e.group&&(Cm(e,i)||Cm(e,o)))return!1;if(s==="inside")return!0;if(o&&o!==n)return o!==r||n===r;let a=o??i?.parent??r;if(a!==n)return!1;let l=e.group?e.level:n.level??-1,c=-1;if(i)c=i.group?i.level:i.parent?.level??-1;else if(a)c=a.level;if(l>=0&&c>=0&&c!==l)return!1;return!0}fixRowsDrop(e,t,s,i){let o=!!this.beans.groupStage?.treeData;if(e.treeData=o,!(!!this.beans.rowGroupColsSvc?.columns?.length||this.gos.get("pivotMode"))&&!o)return;if(!this.draggingGroups&&this.isGroupingDrop(e)&&!e.suppressMoveWhenRowDragging)this.initDraggingGroups(e);let n=e.target,a=null,l=!1,c=e.rootNode,d=this.beans.rowModel,u=this.canStartGroup(n,o);this.updateDropTarget(e,s,u);let h=this.beans.pageBounds?.getLastRow?.()??d.getRowCount()-1;if(t){if(!n||i>=0.5&&n.rowIndex===h)a=c;else if(e.moved&&n&&this.dropGroupThrottled&&this.shouldDropTargetBeParent(e))a=n;if(!a)a=n?.parent??c}if(!s&&n&&u&&!(n.group&&n.expanded))this.startDropGroupDelay(n);if(a){if(n&&a===n&&a!==c){let g=a.expanded?Gg(d,1,n):null;if(g?.parent===a)n=g,i=-0.5;else l=!0}if(n&&!l){let g=n;while(g&&g!==c&&g!==a)n=g,g=g.parent}}e.target=n,e.newParent=a,e.yDelta=i,e.inside=l}clearNewSameParent(e,t){let s=e.newParent;if(s&&(!t||$G(e.rows,s)))e.newParent=null}updateDropTarget(e,t,s){let i=s?e.target:null;if(this.dropGroupTarget&&this.dropGroupTarget!==i)this.resetDragGroup();if(!i?.childrenAfterSort?.length)return;if(t&&this.dropGroupThrottled&&!i.expanded&&i.isExpandable?.())i.setExpanded(!0,void 0,!0);if(this.canDropInTarget(i,e))this.dropGroupThrottled=!0,this.dropGroupTarget=i}canDropInTarget(e,t){if(e.expanded)return!0;if(!e.group)return!1;if(t.pointerPos==="inside")return!0;if(t.treeData)return!1;let s=t.rows,i=e.level;for(let o=0,r=s.length;o<r;++o){let n=s[o];if(n!==e&&n.group&&n.level!==i)return!1}return!0}startDropGroupDelay(e){if(this.dropGroupTarget&&this.dropGroupTarget!==e)this.resetDragGroup();if(this.dropGroupTarget=e,this.dropGroupTimer!==null)return;let t=this.gos.get("rowDragInsertDelay");this.dropGroupTimer=window.setTimeout(()=>{this.dropGroupTimer=null,this.dropGroupThrottled=!0,this.beans.dragAndDrop?.nudge()},t)}resetDragGroup(){if(this.dropGroupTimer!==null)window.clearTimeout(this.dropGroupTimer),this.dropGroupTimer=null;this.dropGroupTarget=null,this.dropGroupThrottled=!1}stopDragging(e){if(e)this.draggingGroups=null;this.resetDragGroup()}shouldDropTargetBeParent({target:e,rows:t,pointerPos:s,treeData:i}){if(!e||s==="none")return!1;if(s==="inside")return!0;if(!i&&e.group&&!e.expanded)return!0;if(s==="above")return!1;let o=this.beans.rowModel,n=e.rowIndex+1,a;do a=o.getRow(n++);while(a?.footer);let l=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(a?.parent===e&&l?.length){let c=new Set(t);for(let d=0,u=l.length;d<u;++d){let h=l[d];if(h.rowIndex!==null&&!c.has(h))return!0}}return!1}dropGroupEdit(e){let{beans:t}=this,s=e.position,i=e.target??null,o=e.rootNode,r=e.newParent??i?.parent??o,n=t.focusSvc,a=n.getFocusedCell(),l=a&&lt(t,a),c=new Set,d=new Ni,u=d.updates,h,g=(v)=>{if(c.has(v))return;if(c.add(v),h??(h=this.newGroupValues(r)),this.setRowGroup(v,h))u.add(v)},p=(v)=>{let w=this.draggingGroups?.get(v)??v.childrenAfterGroup,S=w?.length;if(S)for(let x=0;x<S;++x){let R=w[x];if(R.sourceRowIndex>=0)g(R);else p(R)}};for(let v of e.rows)if(v.group)p(v);else{let w=v.sourceRowIndex>=0&&!v.destroyed?v:this.csrmFirstLeaf(v);if(w)g(w)}let f=s==="inside"?"above":s,m=s==="inside"?this.findFirstLeafForParent(r,c)??i:i,C=!1;if(c.size&&f!=="none")C=ap(o._leafs,c,m,f==="above");if(!u.size&&!C)return!1;d.reordered=C;for(let v of c)d.updates.add(v);if(this.csrmRefresh(d),l)l.focusCell();else n.clearFocusedCell();return!0}canStartGroup(e,t){if(!e||e.level<0||e.footer||e.detail)return!1;if(e.group)return!0;return t}flushGroupEdits(){let e=this.pendingEditRefresh;if(e)this.pendingEditRefresh=null,this.csrmRefresh(e)}csrmRefresh(e){let t=this.beans.rowModel;if(!t.rootNode)return;t.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e})}newGroupValues(e){let t=this.beans.rowGroupColsSvc?.columns??[],s=Array(t.length),i=-1,o=e;while(o&&o.level>=0){let r=t[o.level];if(r){let n=r.colId,a=o.level;if(s[a]=o.groupData?.[n]??o.key??void 0,a>i)i=a}o=o.parent}return{values:s,columns:t,maxLevel:i}}setRowGroup(e,{values:t,columns:s,maxLevel:i}){if(i<0)return!1;let{valueSvc:o,changeDetectionSvc:r}=this.beans,n=!1;r?.beginDeferred();try{for(let a=0;a<s.length;++a){let l=s[a];if(!l||a>i)continue;let c=t[a],d=o.getValue(l,e,"data");if(d===c||d==null&&c==null)continue;let u=c,h=o.parseValue(l,e,c,d);if(h!==void 0)u=h;if(e.setDataValue(l,u,"rowDrag"))n=!0}}finally{r?.endDeferred()}return n}onCsrmCellChange(e){let{column:t,node:s,source:i}=e;if(!this.gos.get("refreshAfterGroupEdit"))return;if(i==="rowDrag")return;if(!t?.isRowGroupActive())return;if(s.group||!s.data)return;if(this.beans.editSvc?.isBatchEditing()){let r=this.pendingEditRefresh;if(!r)r=mm(),this.pendingEditRefresh=r;r.updates.add(s)}else{let r=mm();r.updates.add(s),this.csrmRefresh(r)}}csrmFirstLeaf(e){if(!e)return null;let t=this.draggingGroups,s=t?.get(e)??e.childrenAfterGroup;while(s?.length){let i=s[0];if(i.sourceRowIndex>=0){if(!i.destroyed)return i;return this.firstAliveChildLeaf(i)}s=t?.get(i)??i.childrenAfterGroup}return fi(e)}firstAliveChildLeaf(e){let t=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(t){for(let s of t)if(s.sourceRowIndex>=0&&!s.destroyed)return s}return null}findFirstLeafForParent(e,t){if(!e)return null;let s=this.draggingGroups?.get(e)??e?.childrenAfterGroup;if(!s)return null;for(let i=0,o=s.length;i<o;++i){let r=s[i];if(r.sourceRowIndex>=0&&!t.has(r))return r;let n=this.findFirstLeafForParent(r,t);if(n!==null)return n}return null}};var mm=()=>{let e=new Ni;return e.reordered=!0,e},Cm=(e,t)=>{if(!e||!t)return!1;let s=t;while(s){if(s===e)return!0;s=s.parent}return!1},KG=(e,t)=>{if(!t||e.parent===t)return!1;let s=t,i=e.id;while(s){if(s===e)return!0;if(i!=null&&s.id===i)return!0;s=s.parent}return!1},$G=(e,t)=>{for(let s=0,i=e.length;s<i;++s)if(e[s].parent!==t)return!1;return!0},kd=(e)=>{let t=e.sibling;if(t)t.childrenAfterFilter=e.childrenAfterFilter},jG=(e)=>{e.childrenAfterFilter=e.childrenAfterGroup,kd(e)},BC=(e,t)=>{if(e.childrenAfterFilter&&e.childrenAfterFilter.length>0)return!0;return!!(e.data&&t.doesRowPassFilter(e))},vm=(e,t,s)=>{let i=e.length;t??(t=e);let o=t.length,r=0;for(let n=0;n<i;++n){let a=e[n];if(BC(a,s)){if(r>=o||t[r]!==a)return wm(e,i,n,t,r,s);++r}else if(r<o)return wm(e,i,n,t,r,s)}return r===o?t:e},wm=(e,t,s,i,o,r)=>{let n=o>0?i.slice(0,o):[];while(s<t){let a=e[s++];if(BC(a,r))n.push(a)}return n},qG=class extends y{constructor(){super(...arguments);this.beanName="groupFilterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){let t=this.filterManager;if(t?.isChildFilterPresent())if(this.doingTreeDataFiltering())this.treeDataFilter(t);else this.filterActive(t,e);else Ae(this.beans.rowModel.rootNode,!0,e,jG)}filterActive(e,t){let s=(i)=>{let o=i.childrenAfterGroup;if(o)i.childrenAfterFilter=vm(o,i.childrenAfterFilter,e);else i.childrenAfterFilter=o;kd(i)};Ae(this.beans.rowModel.rootNode,!0,t,s)}treeDataFilter(e){let t=(i,o)=>{let r=i.childrenAfterGroup;if(r&&!o)i.childrenAfterFilter=vm(r,i.childrenAfterFilter,e);else i.childrenAfterFilter=r;kd(i)},s=(i,o)=>{let r=i.childrenAfterGroup;if(r)for(let n=0,a=r.length;n<a;++n){let l=r[n],c=o||e.doesRowPassFilter(l);if(l.childrenAfterGroup)s(l,c);else t(l,c)}t(i,o)};s(this.beans.rowModel.rootNode,!1)}doingTreeDataFiltering(){return!!this.beans.groupStage?.treeData&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},YG=class extends y{constructor(){super(...arguments);this.beanName="groupSortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort","groupMaintainOrder"]}execute(e,t){let{gos:s,colModel:i,groupStage:o,rowGroupColsSvc:r,rowModel:n,rowNodeSorter:a,rowRenderer:l,sortSvc:c,showRowGroupCols:d}=this.beans,u=c?.getSortOptions()??[],h=u.length>0,g=s.getCallback("postSortRows"),p=h&&!g&&s.get("deltaSort")&&t,f=r?.columns,m=h&&f?.length&&!o?.treeData&&s.get("groupMaintainOrder")?XG(u,f):null,C=!m&&h?u:void 0,v=i.pivotMode,w=!1;function S(x){let R=v&&x.leafGroup,P;if(!R)P=m?m[x.level+1]:C;let{childrenAfterSort:D,childrenAfterAggFilter:O}=x,A=D?.[0],_;if(P)if(p)_=Nc(a,x,p,e,P);else _=a.doFullSortInPlace(O?.slice()??[],P);else _=Ll(D,O);x.childrenAfterSort=_,_c(x),g?.({nodes:_}),w||(w=A!==_[0])}if(Ae(n.rootNode,!0,e,S),w&&s.get("groupHideOpenParents")){let x=d?.columns;if(x?.length)l.refreshCells({columns:x,force:!0})}}},XG=(e,t)=>{let s=e.length,i=t.length,o=i,r=new Map;for(let a=0;a<i;++a){let l=t[a];r.set(l,a),r.set(l.colId,a)}let n=Array(i+1);for(let a=0;a<s;++a){let l=e[a],c=l.column,d=c.colDef,u=d.showRowGroup,h=d.field!=null||d.valueGetter!=null||d.comparator!=null;if(u===!0){for(let m=0;m<i;++m)(n[m]??(n[m]=[])).push(l);if(h)(n[o]??(n[o]=[])).push(l);continue}let g=typeof u==="string",p=g?u:c,f=r.get(p);if(f!==void 0){if((n[f]??(n[f]=[])).push(l),g&&h)(n[o]??(n[o]=[])).push(l)}else if(!g||h)(n[o]??(n[o]=[])).push(l)}return n},ZG=class extends y{constructor(){super(...arguments);this.beanName="groupStage",this.step="group",this.refreshProps=["groupAllowUnbalanced","groupDefaultExpanded","groupDisplayType","groupHideOpenParents","initialGroupOrderComparator","treeData","treeDataChildrenField","treeDataParentIdField"],this.treeData=!1,this.grouping=!1,this.gosTreeData=!1,this.pivotMode=!1,this.hasTreeData=!1,this.hasRowGrouping=!1,this.needReset=!1,this.nested=!1,this.strategy=void 0,this.strategyType=void 0,this.columnsInvalidated=!1}postConstruct(){let e=this.gos;if(this.hasRowGrouping=e.isModuleRegistered("RowGrouping"),e.isModuleRegistered("TreeData"))this.hasTreeData=!0,this.gosTreeData=e.get("treeData");this.addManagedEventListeners({showRowGroupColsSetChanged:()=>this.strategy?.onShowRowGroupColsSetChanged()})}invalidateGroupCols(){this.columnsInvalidated=!0,this.strategy?.invalidateGroupCols?.()}destroy(){this.strategy=this.destroyBean(this.strategy),super.destroy()}getNonLeaf(e){return this.strategy?.nonLeafsById?.get(e)}getNestedDataGetter(){return this.getStrategy()?.nestedDataGetter}onPropChange(e){let t=this.gos,s=this.strategy?.nestedDataGetter;if(e.has("treeData"))this.gosTreeData=t.get("treeData")&&this.hasTreeData,this.columnsInvalidated=!0;return this.strategy?.onPropChange?.(e),this.getNestedDataGetter()!==s}extractData(){let e=this.beans.rowModel.rootNode,t=this.nested?e?.childrenAfterGroup:e?._leafs;if(!t)return this.gos.get("rowData")??[];let s=t.length,i=Array(s),o=0;for(let r=0;r<s;++r){let n=t[r].data;if(n!=null)i[o++]=n}return i.length=o,i}execute(e){let t=this.beans,s=t.rowModel,i=s.rootNode;if(!i)return!1;let o=this.getStrategy(),r=!!o?.nestedDataGetter,n=this.needReset;if(this.nested=r,n)this.needReset=!1,t.rowDragSvc?.cancelRowDrag(),e.animate=!1,JG(i,!r,t);if(!o){s.hierarchical=!1;return}return s.hierarchical=!0,t.changedPathFactory?.ensureRowsPath(e,i),o.execute(i,e)||n}loadLeafs(e){return e.footer?QG(e):ga(e)}loadGroupData(e){let t=this.getStrategy();if(t)return t.loadGroupData(e);return e._groupData=null,null}clearNonLeafs(){this.strategy?.clearNonLeafs()}getWantedStrategyType(){if(this.isAlive()){if(this.gosTreeData)return"tree";if(this.hasRowGrouping&&(this.beans.rowGroupColsSvc?.columns?.length||this.pivotMode))return"group"}return"none"}getStrategy(){let e=this.strategy,t=this.beans.colModel.pivotMode;if(t!==this.pivotMode)this.pivotMode=t,this.columnsInvalidated=!0;if(e!==void 0&&!this.columnsInvalidated&&this.isAlive())return e;this.columnsInvalidated=!1;let s=this.getWantedStrategyType();if(s===this.strategyType){if(e!==void 0)return e;return this.strategy=null,null}if(e)this.strategy=this.destroyBean(e),this.needReset=!0;if(this.strategyType=s,this.treeData=s==="tree",this.grouping=s==="group",s==="none")return this.strategy=null,null;let i=s==="tree"?"treeGroupStrategy":"groupStrategy";return e=this.beans.registry.createDynamicBean(i,!1)??null,this.strategy=e&&this.createBean(e),e}},QG=(e)=>{let t=e.sibling;if(!t)return null;let s=t._leafs;if(s!==void 0)return s;return ga(t)},ga=(e)=>{let t=e.childrenAfterGroup,s=t?.length;if(e._leafs=null,!s)return null;let i,o=s===1?t[0]:null;if(o?.group&&o.sourceRowIndex<0){if(i=o._leafs,i===void 0)i=ga(o)}else if(e.leafGroup)i=t;else{i=[];for(let r=0;r<s;++r){let n=t[r];if(n.sourceRowIndex>=0)i.push(n);if(!n.group)continue;let a=n._leafs;if(a===void 0)a=ga(n);if(a)for(let l=0,c=a.length;l<c;++l)i.push(a[l])}}return e._leafs=i,i},JG=(e,t,s)=>{let{_leafs:i,sibling:o}=e;if(e.treeNodeFlags=0,e.childrenAfterGroup=i,e.childrenMapped=null,e._groupData=void 0,e.aggData=null,o)o.childrenAfterGroup=e.childrenAfterGroup,o.childrenAfterAggFilter=e.childrenAfterAggFilter,o.childrenAfterFilter=e.childrenAfterFilter,o.childrenAfterSort=e.childrenAfterSort,o.childrenMapped=null,o._groupData=void 0,o.aggData=null;for(let r=0,n=i.length??0;r<n;++r){let a=i[r],l=a.sibling;if(a._leafs=void 0,bm(a),l)bm(l);if(a.parent=e,t)a.treeParent=null;lC(a,s,!1)}e.updateHasChildren()},bm=(e)=>{e.key=null,e.treeNodeFlags=0,e.allChildrenCount=null,e.childrenAfterGroup=null,e.childrenAfterAggFilter=null,e.childrenAfterFilter=null,e.childrenAfterSort=null,e.childrenMapped=null,e.level=0,e._groupData=void 0};function Sm(e,t,s){let i=e,o=i.level-t.level;if(o<=0)return!1;if(!s.get("groupHideOpenParents"))return!1;for(let n=0;n<o;n++){if(i.parent?.getFirstChild()!==i)return!1;i=i.parent}return i===t}var VC=class extends y{constructor(){super(...arguments);this.indentClass=null}init(e,t,s,i,o,r,n){this.params=n,this.eGui=t,this.eCheckbox=s,this.eExpanded=i,this.eContracted=o,this.comp=e,this.compClass=r;let{node:a,column:l}=n;if(this.node=a,this.displayedNode=a,this.isEmbeddedRowMismatch())return;if(a.footer){this.initFooterCell();return}if(!l){this.initFullWidthCell();return}this.displayedNode=this.beans.showRowGroupColValueSvc?.getDisplayedNode(a,l)??this.node,this.setupExpand(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}initFooterCell(){let{node:e}=this.params;if(this.addGroupValue(),this.setupIndent(),e.level!==-1)this.comp.toggleCss("ag-row-group-leaf-indent",!0)}initFullWidthCell(){let e=()=>{let{rowDragSvc:t}=this.beans;if(!this.params.rowDrag||!t)return;let s=t.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(s),this.eGui.insertAdjacentElement("afterbegin",s.getGui())};this.setupExpand(),e(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}getCellAriaRole(){let e=this.params.colDef?.cellAriaRole,t=this.params.column?.getColDef().cellAriaRole;return e||t||"gridcell"}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;let{visibleCols:e}=this.beans,t=this.params.pinned==="left",s=this.params.pinned==="right",i=!t&&!s;if(this.gos.get("enableRtl")){if(e.isPinningLeft())return!s;return!i}if(e.isPinningLeft())return!t;return!i}addGroupValue(){let{params:{value:e,valueFormatted:t}}=this,s=this.getInnerCompDetails();this.comp.setInnerRenderer(s,t??e??null)}setupExpand(){let{colModel:e}=this.beans,{eGridCell:t,suppressDoubleClickExpand:s}=this.params,i=(l,c)=>{let d=N(l,this.beans,null);if(d)c.appendChild(d),this.addDestroyFunc(()=>d.remove())};i("groupExpanded",this.eExpanded),i("groupContracted",this.eContracted);let o=this.comp,r=()=>{if(!this.isExpandable())return;let c=!!this.displayedNode.expanded;o.setExpandedDisplayed(c),o.setContractedDisplayed(!c),De(t,c)},n=()=>{let l=this.isExpandable();o.toggleCss("ag-cell-expandable",l),o.toggleCss("ag-row-group",l);let c=!l&&e.pivotMode;o.toggleCss("ag-pivot-leaf-group",c);let d=!e.pivotMode&&(!this.displayedNode.footer||this.displayedNode.level!==-1);o.toggleCss("ag-row-group-leaf-indent",!l&&d);let u=this.getChildCount(),h=u>0?`(${u})`:"";if(o.setChildCount(h),!l)o.setExpandedDisplayed(!1),o.setContractedDisplayed(!1),Fh(t);else r()};(()=>{if(!s&&!this.isGroupCellEditable(this.displayedNode))this.addManagedListeners(t,{dblclick:this.onCellDblClicked.bind(this)});this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(this.displayedNode,{allChildrenCountChanged:n,masterChanged:n,groupChanged:n,hasChildrenChanged:n,expandedChanged:r})})(),n()}getInnerCompDetails(){let{userCompFactory:e,findSvc:t}=this.beans,s=this.params;if(s.fullWidth){let l=this.gos.get("groupRowRendererParams"),c=Qo(e,l,s);if(c)return c;if(t?.isMatch(s.node,null))return Qo(e,{...l,innerRenderer:"agFindCellRenderer"},s);return}let i=(l)=>l&&l.componentClass==this.compClass,o=Qo(e,s,s);if(o&&!i(o))return o;let{displayedNode:{rowGroupColumn:r}}=this,n=r?.colDef,a=r&&s.column?.isRowGroupDisplayed(r.getId());if(n&&a){let l=Ds(e,n,s);if(l)if(i(l)){if(n?.cellRendererParams?.innerRenderer)return Qo(e,n.cellRendererParams,s)}else return l}if(t?.isMatch(s.node,s.column))return Ds(e,{...n??s.colDef,cellRenderer:"agFindCellRenderer"},s)}getChildCount(){let{column:e,suppressCount:t}=this.params;if(t)return 0;let{allChildrenCount:s,rowGroupColumn:i}=this.displayedNode;if(!((s??0)>0&&(!i||!e||e?.isRowGroupDisplayed(i.getId()))))return 0;if(this.gos.get("showOpenedGroup")&&this.displayedNode!==this.node&&!Sm(this.node,this.displayedNode,this.gos))return 0;return s??0}isExpandable(){let{node:e,column:t,colDef:s}=this.params;if(!this.displayedNode.isExpandable())return!1;if(e.rowPinned)return!1;if(!t)return!0;if(e.hasChildren()&&s){let{showRowGroup:r}=s;if(!r)return!1;if(r===!0)return!0}if(e===this.displayedNode){if(e.rowGroupColumn){if(t?.isRowGroupDisplayed(e.rowGroupColumn.getId()))return!0}if(e.master)return s?.showRowGroup===!0||s?.showRowGroup==null;return!1}return Sm(this.node,this.displayedNode,this.gos)}setupIndent(){let{suppressPadding:e,node:t,colDef:s}=this.params;if(e)return;let i=()=>{let o=t.uiLevel;if(s&&s.showRowGroup!==!0)o=0;let r="ag-row-group-indent-"+o;if(r===this.indentClass)return;if(this.indentClass)this.comp.toggleCss(this.indentClass,!1);this.indentClass=r,this.comp.toggleCss(r,!0),this.eGui.style.setProperty("--ag-indentation-level",String(o))};this.addManagedListeners(t,{uiLevelChanged:i.bind(this)}),i()}setupCheckbox(){let{node:e}=this.params;if(!(!e.footer&&!e.rowPinned&&!e.detail))return;this.addManagedPropertyListener("rowSelection",({currentValue:s,previousValue:i})=>{let o=typeof s==="object"?s:void 0,r=typeof i==="object"?i:void 0;if(o?.checkboxLocation!==r?.checkboxLocation)this.destroyCheckbox(),this.addCheckbox()}),this.addCheckbox()}addCheckbox(){let{selectionSvc:e}=this.beans;if(!e||!ss(this.gos))return;let{node:t,column:s}=this.params,i=this.gos.get("rowSelection"),o=zi(i);if(o==="selectionColumn")return;if(o==="autoGroupColumn"){let c=s?.getColDef().showRowGroup!=null,d=!s&&t.group;if(!(c||d))return}let r=typeof i==="object"?Es(i):this.params.checkbox;if(!(typeof r==="function"||r===!0))return;if(typeof s?.getColDef().showRowGroup==="string"&&!this.isExpandable()){this.comp.setCheckboxSpacing(!0);return}let l=e.createCheckboxSelectionComponent();this.cbComp=l,this.createBean(l),l.init({rowNode:t,column:s,overrides:{isVisible:r,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(l.getGui()),this.comp.setCheckboxVisible(!0)}destroyCheckbox(){this.comp.setCheckboxSpacing(!1),this.comp.setCheckboxVisible(!1),this.cbComp?.getGui().remove(),this.cbComp=this.destroyBean(this.cbComp)}isGroupCellEditable(e){let t=this.params.column;return!!t&&(!!t.getColDef().groupRowEditable||this.gos.get("enableGroupEdit"))&&t.isCellEditable(e)}onExpandClicked(e){if(ut(e))return;Qe(e),this.onExpandOrContract(e)}onKeyDown(e){if(e.key!==b.ENTER||this.params.suppressEnterExpand)return;if(this.isGroupCellEditable(this.params.node))return;this.onExpandOrContract(e)}onCellDblClicked(e){if(ut(e))return;if(!(xn(this.eExpanded,e)||xn(this.eContracted,e)))this.onExpandOrContract(e)}onExpandOrContract(e){if(!this.isExpandable())return;let t=this.displayedNode;t.setExpanded(!t.expanded,e)}destroy(){super.destroy(),this.destroyCheckbox()}},e6={tag:"span",cls:"ag-cell-wrapper",children:[{tag:"span",ref:"eExpanded",cls:"ag-group-expanded ag-hidden"},{tag:"span",ref:"eContracted",cls:"ag-group-contracted ag-hidden"},{tag:"span",ref:"eCheckbox",cls:"ag-group-checkbox ag-invisible"},{tag:"span",ref:"eValue",cls:"ag-group-value"},{tag:"span",ref:"eChildCount",cls:"ag-group-child-count"}]},ym=class extends L{constructor(){super(e6);this.eExpanded=E,this.eContracted=E,this.eCheckbox=E,this.eValue=E,this.eChildCount=E}init(e){let t={setInnerRenderer:(r,n)=>this.setRenderDetails(r,n),setChildCount:(r)=>this.eChildCount.textContent=r,toggleCss:(r,n)=>this.toggleCss(r,n),setContractedDisplayed:(r)=>G(this.eContracted,r),setExpandedDisplayed:(r)=>G(this.eExpanded,r),setCheckboxVisible:(r)=>this.eCheckbox.classList.toggle("ag-invisible",!r),setCheckboxSpacing:(r)=>this.eCheckbox.classList.toggle("ag-group-checkbox-spacing",r)},s=this.createManagedBean(new VC),i=!e.colDef,o=this.getGui();if(s.init(t,o,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),i)ge(o,s.getCellAriaRole())}setRenderDetails(e,t){if(e)e.newAgStackInstance().then((s)=>{if(!s)return;let i=()=>this.destroyBean(s);if(this.isAlive())this.eValue.appendChild(s.getGui()),this.addDestroyFunc(i);else i()});else this.eValue.innerText=t}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},t6=".ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}",s6=class extends y{constructor(){super(...arguments);this.beanName="showRowGroupColValueSvc"}getGroupValue(e,t,s){if(!t){if(!e.group)return null;return{displayedNode:e,value:e.groupValue}}let i=this.beans.valueSvc,o=t.colDef.showRowGroup;if(!o)return null;if(e.level===-1&&e.footer)return{displayedNode:e,value:null};if(typeof o==="string"){if((this.beans.rowGroupColsSvc?.getColumnIndex(o)??-1)>e.level)return null;let a=this.getDisplayedNode(e,t,!0);if(a)return{displayedNode:a,value:i.getValue(t,a,"data",s)}}let r=i.getValue(t,e,"data",s);if(r==null){let n=this.getDisplayedNode(e,t);if(n)return{displayedNode:n,value:i.getValue(t,n,"data",s)}}return{displayedNode:e,value:r}}formatAndPrefixGroupColValue(e,t,s=!1){let i=this.formatGroupColValue(e,t,s),{value:o,displayedNode:r}=e,n=this.beans.footerSvc;if(n?.doesCellShowTotalPrefix(r,t))return n.applyTotalPrefix(o,i,r,t);if(r.footer&&r.level===-1)return null;return i}formatGroupColValue(e,t,s=!1){let i=this.beans.valueSvc,{displayedNode:o,value:r}=e,n=o.rowGroupColumn,a=o.group&&!t;if(n&&(a||t?.isRowGroupDisplayed(n.colId))){if(s&&n.colDef.useValueFormatterForExport===!1)return null;let c=i.formatValue(n,o,r);if(c==null&&o.key==="")return this.getLocaleTextFunc()("blanks","(Blanks)");return c}if(!t||o.group)return null;if(s&&t.colDef.useValueFormatterForExport===!1)return null;return i.formatValue(t,o,r)}getDisplayedNode(e,t,s=!1){let i=this.gos,o=i.get("groupHideOpenParents"),r=i.get("showOpenedGroup")&&!s;if(!o&&!r)return;let n=t.colDef.showRowGroup;if(n===!0){if(e.group)return;return e.parent??void 0}let a=e;while(a&&a.rowGroupColumn?.getId()!=n){let l=a===a.parent?.getFirstChild();if(!r&&!l)return;a=a.parent}if(a===e)return;return a??void 0}},i6=class extends y{constructor(){super(...arguments);this.beanName="showRowGroupCols",this.columns=[],this.colsSet=new Set,this.colsMap=new Map}destroy(){super.destroy(),this.columns.length=0,this.colsSet.clear(),this.colsMap.clear()}refresh(){let{colModel:e,rowGroupColsSvc:t}=this.beans,s=this.columns,i=this.colsSet,o=this.colsMap;o.clear();let r=s.length,n=0,a=!1,l=e.getCols();for(let c=0,d=l.length;c<d;++c){let u=l[c],g=u.colDef.showRowGroup;if(typeof g==="string")o.set(g,u);else if(g===!0){let p=t?.columns;if(p)for(let f=0,m=p.length;f<m;++f)o.set(p[f].getId(),u)}else continue;a||(a=n>=r||!i.has(u)),s[n++]=u}if(a||(a=n!==r),a){s.length=n,i.clear();for(let c=0;c<n;++c)i.add(s[c]);this.eventSvc.dispatchEvent({type:"showRowGroupColsSetChanged"})}}getShowRowGroupCol(e){return this.colsMap.get(e)}getSourceColumnsForGroupColumn(e){let t=e.colDef.showRowGroup;if(!t)return null;let{rowGroupColsSvc:s,colModel:i}=this.beans;if(t===!0&&s)return s.columns;let o=i.getColDefCol(t);return o?[o]:null}isRowGroupDisplayed(e,t){let s=e.colDef.showRowGroup;return s===!0||s!=null&&s===t}},o6=class extends y{constructor(e,t){super();this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.extraTopHeight=0,this.extraBottomHeight=0}postConstruct(){this.isClientSide=J(this.gos),this.beans.ctrlsSvc.whenReady(this,(e)=>{this.gridBodyCtrl=e.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(e){if(this.extraTopHeight===e)return;this.extraTopHeight=e,this.eventSvc.dispatchEvent({type:"stickyTopOffsetChanged",offset:e})}setOffsetBottom(e){if(this.extraBottomHeight===e)return;this.extraBottomHeight=e}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(e){return this.isClientSide?n6(e):r6(e)}getFirstPixelOfGroup(e){if(e.footer)return e.sibling.rowTop+e.sibling.rowHeight-1;if(e.hasChildren())return e.rowTop-1;return 0}updateStickyRows(e){let t=e==="top",s=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,s);let i=new Set,{rowModel:o,rowRenderer:r,pinnedRowModel:n,pageBounds:a,rowContainerHeight:l}=this.beans,{pageFirstPixel:c,pageLastPixel:d}=a.getCurrentPagePixelRange(),u=t?r.firstVisibleVPixel-this.extraTopHeight:r.lastVisibleVPixel-this.extraTopHeight,h=l.divStretchOffset??0,g=c+h,p=d+h,f=(w)=>{if(i.add(w),t){let S=this.getLastPixelOfGroup(w),x=u+s+w.rowHeight;if(S<x)w.stickyRowTop=s+(S-x);else w.stickyRowTop=s}else{let S=this.getFirstPixelOfGroup(w),x=u-(s+w.rowHeight);if(S>x)w.stickyRowTop=s-(S-x);else w.stickyRowTop=s}s=0,i.forEach((S)=>{let x=S.stickyRowTop+S.rowHeight;if(s<x)s=x})},m=this.areFooterRowsStickySuppressed(),C=this.gos.get("suppressGroupRowsSticky"),v=(w)=>{if(!w.displayed)return!1;if(w.footer){if(m===!0)return!1;if(m==="grand"&&w.level===-1)return!1;if(m==="group"&&w.level>-1)return!1;let S=w.sibling.rowIndex?w.sibling.rowIndex+1===w.rowIndex:!1;if(e==="bottom"&&S)return!1;if(w.level===-1&&n?.getGrandTotalPinned())return!1;return!i.has(w)}if(w.isExpandable()){if(C===!0)return!1;if(e==="bottom")return!1;return!i.has(w)&&!!w.expanded}return!1};for(let w=0;w<100;w++){let S=u+s;if(!t)S=u-s;if(t&&S<g)S=g;else if(!t&&S>p)S=p;let x=o.getRowIndexAtPixel(S),R=o.getRow(x);if(R==null)break;let D=this.getStickyAncestors(R).find((A)=>(t?A.rowIndex<x:A.rowIndex>x)&&v(A));if(D){f(D);continue}if((t?R.rowTop<S:R.rowTop+R.rowHeight>S)&&v(R)){f(R);continue}break}if(!t)i.forEach((w)=>{w.stickyRowTop=s-(w.stickyRowTop+w.rowHeight)});return this.refreshNodesAndContainerHeight(e,i,s)}areFooterRowsStickySuppressed(){let e=this.gos.get("suppressStickyTotalRow");if(e===!0)return!0;let t=e==="group",s=e==="grand";if(t&&s)return!0;if(s)return"grand";if(t)return"group";return!1}canRowsBeSticky(){let e=Qi(this.gos),t=this.areFooterRowsStickySuppressed(),s=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!s)}getStickyAncestors(e){let t=[],s=e.footer?e.sibling:e.parent;while(s){if(s.sibling)t.push(s.sibling);t.push(s),s=s.parent}return t.reverse()}checkStickyRows(){let e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){let t=new Set;if(this.stickyTopRowCtrls.some((s)=>s.rowNode===e)){for(let s=0;s<this.stickyTopRowCtrls.length;s++){let i=this.stickyTopRowCtrls[s].rowNode;if(i!==e)t.add(i)}if(this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight))this.checkStickyRows();return}for(let s=0;s<this.stickyBottomRowCtrls.length;s++){let i=this.stickyBottomRowCtrls[s].rowNode;if(i!==e)t.add(i)}if(this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight))this.checkStickyRows()}refreshNodesAndContainerHeight(e,t,s){let i=e==="top",o=i?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,r={},n=[];for(let g=0;g<o.length;g++){let p=o[g].rowNode;if(!t.has(p)){r[p.id]=o[g],p.sticky=!1;continue}n.push(o[g])}let a=new Set;for(let g=0;g<n.length;g++)a.add(n[g].rowNode);let l=[];t.forEach((g)=>{if(a.has(g))return;g.sticky=!0,l.push(this.createRowCon(g,!1,!1))});let c=!!l.length||n.length!==o.length;if(i){if(this.topContainerHeight!==s)this.topContainerHeight=s,this.gridBodyCtrl.setStickyTopHeight(s),c=!0}else if(this.bottomContainerHeight!==s)this.bottomContainerHeight=s,this.gridBodyCtrl.setStickyBottomHeight(s),c=!0;this.destroyRowCtrls(r,!1);let d=[...n,...l];if(d.sort((g,p)=>p.rowNode.rowIndex-g.rowNode.rowIndex),!i)d.reverse();for(let g of d)g.setRowTop(g.rowNode.stickyRowTop);let u=this.beans.pageBounds,h=0;if(i){for(let g of t)if(g.rowIndex<u.getFirstRow())h+=g.rowHeight;if(h>this.topContainerHeight)h=this.topContainerHeight;this.setOffsetTop(h)}else{for(let g of t)if(g.rowIndex>u.getLastRow())h+=g.rowHeight;if(h>this.bottomContainerHeight)h=this.bottomContainerHeight;this.setOffsetBottom(h)}if(!c)return!1;if(i)this.stickyTopRowCtrls=d;else this.stickyBottomRowCtrls=d;return!0}ensureRowHeightsValid(){let e=!1,t=(s)=>{let i=s.rowNode;if(i.rowHeightEstimated){let o=ko(this.beans,i);i.setRowHeight(o.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}};function r6(e){if(e.isExpandable()||e.footer){if(e.master&&e.detailNode)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let s=e.childStore?.getStoreBounds();if(e.footer)s=e.sibling.childStore?.getStoreBounds();return(s?.heightPx??0)+(s?.topPx??0)}if(e.footer)return e.rowTop+e.rowHeight;return e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}function n6(e){if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let i=e.footer?e.sibling:e;while(i.isExpandable()&&i.expanded)if(i.master&&i.detailNode)i=i.detailNode;else if(i.childrenAfterSort){if(i.childrenAfterSort.length===0)break;i=k(i.childrenAfterSort)}return i.rowTop+i.rowHeight}if(e.footer)return e.rowTop+e.rowHeight;return e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}var a6=class extends y{constructor(){super(...arguments);this.beanName="stickyRowSvc"}createStickyRowFeature(e,t,s){let i=this.gos;if(Qi(i)&&J(i)||Gs(i))return e.createManagedBean(new o6(t,s));return}},NC={moduleName:"GroupCellRenderer",version:ie,userComponents:{agGroupRowRenderer:ym,agGroupCellRenderer:ym},dynamicBeans:{groupCellRendererCtrl:VC},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},css:[t6],dependsOn:[_e]},l6={moduleName:"GroupColumn",version:ie,beans:[IG,i6,s6,AG,GC,kC],dependsOn:[_e,NC]},_C={moduleName:"ChangedPath",version:ie,beans:[OG],dependsOn:[_e]},yr={moduleName:"CsrmHierarchy",version:ie,rowModels:["clientSide"],beans:[WG,VG],dependsOn:[_C]},c6={moduleName:"CsrmGroupStages",version:ie,rowModels:["clientSide"],beans:[ZG,qG,YG],dependsOn:[yr]},HC={moduleName:"StickyRow",version:ie,beans:[a6]},d6={moduleName:"GroupEdit",version:ie,beans:[UG],dependsOn:[yr]},u6=({valueSvc:e,dataTypeSvc:t},s,i)=>{let o=e.getValue(s,i,"data"),r=null;if(o instanceof Date)r=o;else if(typeof o==="string")r=(t?.getDateParserFunction(s)??He)(o)??null;return r},zs=(e,t,s,i)=>(o)=>{let r=u6(e,t,o.node),n=Rs(r);if(!n)return null;return i?.(n[s])??n[s]},Ws=({colNames:e},t,s)=>(i)=>{let o=e.getDisplayNameForColumn(t,i.location);if(o)return`${o} (${s})`;return""},h6=Object.fromEntries(Vo.map((e)=>[e,e.toLowerCase()])),g6=(e)=>{let t=Vo[Number.parseInt(e,10)-1]??e,s=h6[t]??e;return{month:t,localeKey:s}};function xm(e){return e.groupHierarchy??e.rowGroupingHierarchy}var p6=class extends y{constructor(){super(...arguments);this.beanName="groupHierarchyColSvc",this.columns=null,this.sourceColumnMap=new WeakMap,this.inverseColumnMap=new WeakMap}addColumns(e){let t=this.columns;if(t==null)return;e.list=t.list.filter((s)=>!e.list.some((i)=>i.colId===s.colId)).concat(e.list),e.tree=t.tree.filter((s)=>!e.tree.some((i)=>i.getId()===s.getId())).concat(e.tree),Zo(e)}createColumns(e){let t=new WeakMap,s=new WeakMap,i=this.createGroupHierarchyColumns(e,t,s);if(Xo(i,this.columns?.list??[]))return;gt(this.beans,this.columns?.tree),this.columns=null;let{colGroupSvc:r}=this.beans,n=r?.findDepth(e.tree)??0,a=r?.balanceTreeForAutoCols(i,n)??[];this.columns={list:i,tree:a,treeDepth:n,map:{}},this.sourceColumnMap=t,this.inverseColumnMap=s}updateColumns(e){}getColumn(e){return this.columns?.list.find((t)=>jt(t,e))??null}getColumns(){return this.columns?.list??null}expandColumnInto(e,t){let s=this.getVirtualColumnsForColumn(t).concat(t);for(let i of s)if(!e.some((o)=>jt(o,i)||o.colId===i.colId))e.push(i)}compareVirtualColumns(e,t){let s=this.inverseColumnMap.get(e),i=this.inverseColumnMap.get(t);if(s&&s===i){let o=this.sourceColumnMap.get(s)??[];return o?.indexOf(e)-o?.indexOf(t)}if(this.sourceColumnMap.get(e)?.includes(t))return 1;if(this.sourceColumnMap.get(t)?.includes(e))return-1;return null}insertVirtualColumnsForCol(e,t){let s=this.getVirtualColumnsForColumn(t);if(!s)return[];let i=e.indexOf(t);if(i<0)i=e.length-1;return Ho(e,s),e.splice(i,0,...s),s}getVirtualColumnsForColumn(e){if(this.isGroupHierarchyColsEnabledForCol(e))return this.sourceColumnMap.get(e)??[];return[]}isGroupHierarchyColsEnabled(e){return e.list.some((t)=>this.isGroupHierarchyColsEnabledForCol(t))}isGroupHierarchyColsEnabledForCol(e){let t=e.colDef;return!!(xm(t)&&(t.rowGroup||t.enableRowGroup||t.rowGroupIndex!=null||t.pivot||t.enablePivot||t.pivotIndex!=null))}createGroupHierarchyColDefs(e){let t=[],s=e.colDef,i=xm(s);if(!i)return t;if(!this.isGroupHierarchyColsEnabledForCol(e))return t;for(let o of i){let r=typeof o==="string"?this.createColDefForPart(o,e,s):o;if(r)t.push(r)}return t}createGroupHierarchyColumns(e,t,s){if(!this.isGroupHierarchyColsEnabled(e))return[];let i=[];for(let o of e.list)for(let r of this.createGroupHierarchyColDefs(o)){let n=r.colId;this.gos.validateColDef(r,n,!0);let a=new Ct(r,null,n,!0);this.createBean(a),i.push(a),f6(t,o,a),s.set(a,o)}return i}createColDefForPart(e,t,s){let{beans:i,gos:o}=this,r=`${mg}-${t.colId}-${e}`,n={enableRowGroup:s.enableRowGroup,rowGroup:s.rowGroup,enablePivot:s.enablePivot,hide:!0,editable:!1},a=o.get("groupHierarchyConfig")??{};if(e in a){let u={...n,...a[e]};return u.colId??(u.colId=r),ns(i,u,u.colId,!0)}let l=ns(i,{colId:r,...n},r,!0),c=this.getLocaleTextFunc(),d=(u,h)=>c?.(u,h)??h;switch(e){case"year":return{...l,headerValueGetter:Ws(i,t,d(e,"Year")),valueGetter:zs(i,t,0)};case"quarter":return{...l,headerValueGetter:Ws(i,t,d(e,"Quarter")),valueGetter:zs(i,t,1,(u)=>(Math.floor(Number(u)/4)+1).toString())};case"month":return{...l,headerValueGetter:Ws(i,t,d(e,"Month")),valueGetter:zs(i,t,1)};case"formattedMonth":return{...l,headerValueGetter:Ws(i,t,d("month","Month")),valueGetter:zs(i,t,1,(u)=>{let h=g6(u);return d(h.localeKey,h.month)})};case"day":return{...l,headerValueGetter:Ws(i,t,d(e,"Day")),valueGetter:zs(i,t,2)};case"hour":return{...l,headerValueGetter:Ws(i,t,d(e,"Hour")),valueGetter:zs(i,t,3)};case"minute":return{...l,headerValueGetter:Ws(i,t,d(e,"Minute")),valueGetter:zs(i,t,4)};case"second":return{...l,headerValueGetter:Ws(i,t,d(e,"Second")),valueGetter:zs(i,t,5)};default:return null}}};function f6(e,t,s){let i=e.get(t);e.set(t,(i??[]).concat(s))}var m6={moduleName:"GroupHierarchy",version:ie,beans:[p6],dependsOn:[_C]};var C6=(e,t)=>{if(!e){t.length=0;return}let s=e.length;t.length=s;for(let i=0;i<s;i++){let o=e[i],r=o.colDef;t[i]={col:o,field:r.field,type:r.type,keyCreator:r.keyCreator,valueGetter:r.valueGetter}}},v6=(e,t)=>{let s=e.length;if(s!==t?.length)return!0;for(let i=0;i<s;i++){let o=e[i],r=t[i];if(o.col!==r)return!0;let n=r.colDef;if(o.field!==n.field||o.type!==n.type||o.valueGetter!==n.valueGetter||o.keyCreator!==n.keyCreator)return!0}return!1};function w6(e){if(!e)return!1;let t=e.length;if(t<2)return!1;let s=!1;for(let i=1;i<t;i++)if(Rm(e[i-1],e[i])>0){s=!0;break}if(!s)return!1;return e.sort(Rm),!0}function Rm(e,t){let s=e.sourceRowIndex,i=t.sourceRowIndex,o=s>=0,r=i>=0,n=o&&r,a=!o&&!r;if(n)return s-i;if(a)return e.__objectId-t.__objectId;if(o)return 1;return-1}var b6=class extends y{constructor(){super(...arguments);this.groupCols=[],this.nonLeafsById=new Map,this.checkGroupCols=!0,this.pivotMode=!1,this.groupEmpty=!1}invalidateGroupCols(){this.checkGroupCols=!0}destroy(){super.destroy(),this.groupCols.length=0,this.nonLeafsById.clear()}clearNonLeafs(){let e=this.nonLeafsById;for(let t of e.values())t._destroy(null);e.clear()}loadGroupData(e){if(!e.group)return e._groupData=null,null;let t=e.rowGroupColumn,{valueSvc:s,showRowGroupCols:i}=this.beans,o={};if(e._groupData=o,!t)return o;let r=fi(e),n=t.getId();if(!i)return o;let a=i.columns;for(let l=0,c=a.length;l<c;++l){let d=a[l];if(d.isRowGroupDisplayed(n))o[d.colId]=s.getValue(t,r,"data")}return o}execute(e,t){let s=t.changedPath;if(this.initRefresh(t)!=="skip"){let o=t.changedRowNodes;if(o)this.handleDeltaUpdate(e,s,o,!!t.animate);else this.shotgunResetEverything(e)}this.positionLeafsAndGroups(e,s),this.orderGroups(e),this.beans.selectionSvc?.updateSelectableAfterGrouping(s)}positionLeafsAndGroups(e,t){Ae(e,!0,t,(s)=>{let i=s.childrenAfterGroup,o=i?.length;if(!o)return;let r=Array(o),n=0,a=!1,l;for(let c=0;c<o;++c){let d=i[c];if(!d.childrenAfterGroup?.length)a||(a=n!==c),r[n++]=d;else if(!l&&d.key===""){l=d;let u=o-1;a||(a=c!==u),r[u]=d}}if(a){for(let d=0;d<o;++d){let u=i[d];if(u.childrenAfterGroup?.length&&u!==l)r[n++]=u}s.childrenAfterGroup=r;let c=s.sibling;if(c)c.childrenAfterGroup=r}})}initRefresh(e){let{rowGroupColsSvc:t,colModel:s,gos:i}=this.beans;this.pivotMode=s.pivotMode,this.groupEmpty=this.pivotMode||!i.get("groupAllowUnbalanced");let o=t?.columns,r=this.groupCols,n=e.afterColumnsChanged;if(n||!r||this.checkGroupCols)if(this.checkGroupCols=!1,r&&!v6(r,o)){if(n)return"skip"}else{e.animate=!1;let a=r[0]?.col.getId()!==o?.[0]?.getId();return C6(o,r),a?"refresh":"groupColsChanged"}return"refresh"}handleDeltaUpdate(e,t,{removals:s,updates:i,adds:o,reordered:r},n){let a=new Set;for(let l=0,c=s.length;l<c;++l){let d=s[l],u=this.removeFromParent(d);if(!a.has(u))a.add(u),t?.addRow(u)}for(let l of i){let c=l.parent;if(t?.addRow(c),this.moveNodeInWrongPath(e,l)){a.add(c);let d=l.parent;t?.addRow(d),r||(r=(d?.childrenAfterGroup?.length??0)>1)}}if(o.size)for(let l of o){this.insertOneNode(e,l);let c=l.parent;t?.addRow(c),r||(r=(c?.childrenAfterGroup?.length??0)>1)}if(a.size)Fm(a),this.removeEmptyGroups(a,n);if(r)this.sortChildren(e,t)}sortChildren(e,t){Ae(e,!0,void 0,(s)=>{if(w6(s.childrenAfterGroup))t?.addRow(s)})}orderGroups(e){let t=this.gos.getCallback("initialGroupOrderComparator");if(!t)return;let s=this.beans,i=s.gridApi,o=s.gridOptions.context,r=(a,l)=>t({api:i,context:o,nodeA:a,nodeB:l}),n=(a)=>{let l=a.childrenAfterGroup,c=l?.length;if(!c||a.leafGroup)return;if(c>1)l.sort(r);for(let d=0,u=c;d<u;++d)n(l[d])};n(e)}moveNodeInWrongPath(e,t){let{valueSvc:s}=this.beans,i=this.groupEmpty,o=t.parent,r=!1,n=this.groupCols;if(!n)return!1;for(let a=n.length-1;a>=0;--a){let{col:l}=n[a],c=s.getKeyForNode(l,t);if(c==null||c===""){if(!i)continue;c=""}if(!o?.parent||o.key!==c){r=!0;break}o=o.parent}if(r||(r=!!o?.parent),!r)return!1;return this.removeFromParent(t),this.insertOneNode(e,t),t.setData(t.data),!0}groupShouldBeRemoved(e){let t=this.getChildrenMappedKey(e.key,e.rowGroupColumn),s=e.parent?.childrenMapped;if(s?!s[t]:!0)return!1;return!!e.group&&(e.childrenAfterGroup?.length??0)===0}removeEmptyGroups(e,t){let s=this.beans.selectionSvc,i,o=Array.from(e),r=this.nonLeafsById;do{e.clear();for(let n=0;n<o.length;++n){let a=o[n];while(a){let l=a.parent;if(a.destroyed){o[n]=l,a=l;continue}if(!l)break;if(!this.groupShouldBeRemoved(a)){a=l;continue}if(e.add(l),this.removeFromParent(a),s&&a.isSelected())i??(i=[]),i.push(a);o[n]=l,r.delete(a.id),a._destroy(t),a=l}}Fm(e)}while(e.size);if(i)s.setNodesSelected({nodes:i,newValue:!1,source:"rowGroupChanged"})}removeFromParent(e){let t=e.parent;if(t){let s=this.getChildrenMappedKey(e.key,e.rowGroupColumn),i=t.childrenMapped;if(i)delete i[s]}return e.setRowTop(null),e.setRowIndex(null),t}addToParent(e,t){let s=t.childrenMapped??(t.childrenMapped={}),i=this.getChildrenMappedKey(e.key,e.rowGroupColumn);if(s[i]!==e){s[i]=e;let o=t.childrenAfterGroup;if(!o){t.childrenAfterGroup=o=[];let r=t.sibling;if(r)r.childrenAfterGroup=t.childrenAfterGroup}o.push(e),lC(t,this.beans,!0),ra(t)}}shotgunResetEverything(e){let t=this.nonLeafsById;for(let o of t.values())o.childrenAfterGroup=null,o.childrenMapped=null;e.leafGroup=!this.groupCols?.length,e.childrenAfterGroup=[],e.childrenMapped={},e.updateHasChildren();let s=e.sibling;if(s)s.childrenAfterGroup=e.childrenAfterGroup,s.childrenMapped=e.childrenMapped;let i=e._leafs;for(let o=0,r=i.length;o<r;++o)this.insertOneNode(e,i[o]);this.destroyStaleGroups(t)}destroyStaleGroups(e){let t=this.beans.selectionSvc,s;for(let[i,o]of e){if(o.childrenAfterGroup!==null)continue;if(t&&o.isSelected())(s??(s=[])).push(o);e.delete(i),o._destroy(!1)}if(s)t.setNodesSelected({nodes:s,newValue:!1,source:"rowGroupChanged"})}insertOneNode(e,t){let s=e,{beans:i,groupCols:o,groupEmpty:r}=this,n=i.valueSvc;if(!o)return;let a=o.length;for(let l=0;l<a;++l){let c=o[l],d=c.col,u=n.getKeyForNode(d,t);if(u==null||u===""){if(!r)continue;u=""}let h=s.childrenMapped?.[this.getChildrenMappedKey(u,d)];if(h){s=h;continue}let g=s.level+1,p=g>=a-1,f=this.createGroup(s,c,u,g,p,t);this.addToParent(f,s),s=f}if(!s.group)F(184,{parentGroupData:s.data,childNodeData:t.data});t.parent=s,t.level=s.level+1,s.childrenAfterGroup.push(t),s.updateHasChildren(),ra(s)}createGroup(e,t,s,i,o,r){let n=t.col,a=(e.level>=0?e.id+"-":"row-group-")+(n.colId+"-"+s),l=this.nonLeafsById,c=l.get(a),d=!0;if(c){if(c.childrenAfterGroup!==null)return c._expanded??(c._expanded=null),c;d=!1,ra(c)}else c=new Vs(this.beans),c.group=!0,c.key=s,c.id=a,c.aggData=null,l.set(a,c);let u=(f)=>{f.childrenAfterGroup=h,f.childrenMapped=g,f.parent=e,f.level=i,f.rowGroupIndex=i,f.leafGroup=o},h=[],g={};if(u(c),c.field=t.field??null,c.rowGroupColumn=n,c.groupValue=this.beans.valueSvc.getValue(n,r,"data"),c._expanded??(c._expanded=null),d)return c.setAllChildrenCount(0),c.updateHasChildren(),c;let p=c.sibling;if(p)u(p);return c.dispatchRowEvent("hasChildrenChanged"),c}getChildrenMappedKey(e,t){return t?t.getId()+"-"+e:e}onShowRowGroupColsSetChanged(){let{rowModel:e,valueSvc:t}=this.beans;for(let i of this.nonLeafsById.values()){i._groupData=void 0;let o=i.rowGroupColumn,r=o&&fi(i);i.groupValue=r&&t.getValue(o,r,"data")}let s=e.rootNode?._leafs;if(s)for(let i=0,o=s.length;i<o;++i){let r=s[i];r.parent._groupData=void 0}}},Fm=(e)=>{for(let t of e){let s=t?.childrenAfterGroup;if(!s)continue;let i=s.length,o=0;for(let r=0;r<i;++r){let n=s[r];if(n.parent===t&&!n.destroyed){if(o!==r)s[o]=n;++o}}if(i!==o)s.length=o,t.updateHasChildren(),ra(t)}},ra=(e)=>{while(e._leafs!==void 0){let t=e.parent;if(!t)break;e._leafs=void 0,e=t}};function S6(e,t){e.rowGroupColsSvc?.setColumns(t,"api")}function y6(e,t){e.rowGroupColsSvc?.removeColumns(t,"api")}function x6(e,t){e.rowGroupColsSvc?.addColumns(t,"api")}function R6(e,t,s){e.rowGroupColsSvc?.moveColumn?.(t,s,"api")}function F6(e){return e.rowGroupColsSvc?.columns??[]}var zC={moduleName:"SharedRowGrouping",version:ie,apiFunctions:{setRowGroupColumns:S6,removeRowGroupColumns:y6,addRowGroupColumns:x6,getRowGroupColumns:F6,moveRowGroupColumn:R6},dependsOn:[_e,LC,l6,HC,m6]},E6={moduleName:"RowGrouping",version:ie,dynamicBeans:{groupStrategy:b6},rowModels:["clientSide"],dependsOn:[zC,DG,yr,c6,d6]};function P6(e,t){e.clipboardSvc?.copyToClipboard(t)}function M6(e,t){e.clipboardSvc?.cutToClipboard(t)}function T6(e,t){e.clipboardSvc?.copySelectedRowsToClipboard(t)}function D6(e,t){e.clipboardSvc?.copySelectedRangeToClipboard(t)}function A6(e){e.clipboardSvc?.copyRangeDown()}function I6(e){e.clipboardSvc?.pasteFromClipboard()}var ea="paste",Rd="dragCopy",Fd="clipboard";function k6(e,t=","){let s=[],i=(r)=>r==="\r"||r===`
79
- `,o=!1;if(e==="")return[[""]];for(let r=0,n=0,a=0;a<e.length;a++){let l=e[a-1],c=e[a],d=e[a+1],u=()=>{if(!s[r])s[r]=[];if(!s[r][n])s[r][n]=""};if(u(),c==='"'){if(o)if(d==='"')s[r][n]+='"',a++;else o=!1;else if(l===void 0||l===t||i(l))o=!0}if(!o&&c!=='"'){if(c===t){n++,u();continue}else if(i(c)){if(n=0,r++,u(),c==="\r"&&d===`
80
- `)a++;continue}}s[r][n]+=c}return s}var L6=class extends y{constructor(){super(...arguments);this.beanName="clipboardSvc",this.clientSideRowModel=null,this.gridCtrl=null,this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}postConstruct(){let{gos:e,rowModel:t,ctrlsSvc:s}=this.beans;if(J(e,t))this.clientSideRowModel=t;s.whenReady(this,(i)=>{this.gridCtrl=i.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){if(!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard?.readText)navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((t)=>{F(40,{e:t,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()});else this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let e=!1,t=(s)=>{let i=Date.now();if(i-this.lastPasteOperationTime<50)e=!0,s.preventDefault();this.lastPasteOperationTime=i};this.executeOnTempElement((s)=>{s.addEventListener("paste",t),s.focus({preventScroll:!0})},(s)=>{let i=s.value;if(!e)this.processClipboardData(i);else this.refocusLastFocusedCell();s.removeEventListener("paste",t)})}refocusLastFocusedCell(){let{focusSvc:e}=this.beans,t=e.getFocusedCell();if(t)e.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){let e=this.gos.get("clipboardDelimiter");return M(e)?e:"\t"}processClipboardData(e){if(e==null)return;let t=k6(e,this.getClipboardDelimiter()),s=this.gos.getCallback("processDataFromClipboard");if(s)t=s({data:t});if(t==null)return;if(this.gos.get("suppressLastEmptyLineOnPaste"))this.removeLastLineIfBlank(t);let{rangeSvc:i,editSvc:o}=this.beans,r=(n,a,l,c)=>{if(i?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(t))this.pasteIntoActiveRange(t,n,a,c);else this.pasteStartingFromFocusedCell(t,n,a,l,c);o?.stopEditing(void 0,{source:ea})};this.doPasteOperation(r)}doPasteOperation(e){let{eventSvc:s,focusSvc:i,rowRenderer:o,gos:r}=this.beans;s.dispatchEvent({type:"pasteStart",source:"clipboard"});let{clientSideRowModel:n}=this,a=n?.rootNode,l=a&&this.beans.changedPathFactory?.newPath(r.get("aggregateOnlyChangedColumns")),c={},d=[],u=i.getFocusedCell();e(c,d,u,l);let h=d.slice();if(l)n.doAggregate(l),Ae(a,n.hierarchical,l,(g)=>{h.push(g)});o.refreshCells({rowNodes:h}),this.dispatchFlashCells(c),this.fireRowChanged(d),this.refocusLastFocusedCell(),s.dispatchEvent({type:"pasteEnd",source:"clipboard"})}getPreProcessRangeCallback(e){return(t)=>{let{rangeSvc:s}=this.beans;if(!s)return;let{rowDiff:i,colDiff:o}=this.getAdjustedRangeDimensionForPaste(t,e);if(i!==0)s.extendRangeRowCountBy(t,i);if(o!==0)s.extendRangeColumnCountBy(t,o)}}getAdjustedRangeDimensionForPaste(e,t){let s=this.beans.rangeSvc,i=t.length,o=s.getRangeRowCount(e),r=o>=i&&o%i===0,n=t[0].length,a=e.columns.length,l=a>=n&&a%n===0;return{rowDiff:r?0:i-o,colDiff:l?0:n-a}}pasteIntoActiveRange(e,t,s,i){let o=0,r=0,n=(a,l,c,d)=>{if(d-o>=e.length){if(d%e.length!==0)return;o+=r,r=0}let h=e[d-o];s.push(l);let g=this.gos.getCallback("processCellFromClipboard"),p=c.columns,f=p.findIndex(Zt);if(f!==-1)p.splice(f,1);for(let m=0;m<p.length;m++){let C=p[m];if(!C.isCellEditable(l)||C.isSuppressPaste(l))continue;let v=m;if(m>=h.length)v=m%h.length;let w=this.processCell(l,C,h[v],Rd,g,!0);l.setDataValue(C,w,ea),i?.addCell(l.parent,C.getId());let{rowIndex:S,rowPinned:x}=a,R=Qt({rowIndex:S,column:C,rowPinned:x});t[R]=!0}r++};this.iterateActiveRanges(n,!1,this.getPreProcessRangeCallback(e))}getDisplayedColumnsStartingAt(e){let t=e,s=[],{visibleCols:i}=this.beans;while(t&&Yo(t))t=i.getColAfter(t);while(t!=null)s.push(t),t=i.getColAfter(t);return s}pasteStartingFromFocusedCell(e,t,s,i,o){if(!i)return;let r={rowIndex:i.rowIndex,rowPinned:i.rowPinned},n=this.getDisplayedColumnsStartingAt(i.column);if(this.isPasteSingleValueIntoRange(e))this.pasteSingleValueIntoRange(e,s,t,o);else this.pasteMultipleValues(e,r,s,n,t,Fd,o)}isPasteSingleValueIntoRange(e){let t=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(e)&&!!t&&!t.isEmpty()}pasteSingleValueIntoRange(e,t,s,i){let o=e[0][0],r=(n,a,l)=>{t.push(a),l.columns.forEach((c)=>this.updateCellValue(a,c,o,s,Fd,i))};this.iterateActiveRanges(r)}hasOnlyOneValueToPaste(e){return e.length===1&&e[0].length===1}copyRangeDown(){let{rangeSvc:e,gos:t,formula:s,valueSvc:i}=this.beans;if(!e||e.isEmpty())return;let o=[],r=(n,a,l,c)=>{let d=t.getCallback("processCellForClipboard"),u=t.getCallback("processCellFromClipboard"),h=(g,p,f)=>{let{columns:m}=f;if(!o.length)m.forEach((C)=>{let v=this.processCell(p,C,i.getValue(C,p,"batch"),Rd,d,!1,!0);o.push(v)});else a.push(p),m.forEach((C,v)=>{if(!C.isCellEditable(p)||C.isSuppressPaste(p))return;if(C.colDef.allowFormula&&s?.isFormula(o[v]))o[v]=s?.updateFormulaByOffset({value:o[v],rowDelta:1});let S=this.processCell(p,C,o[v],Rd,u,!0);p.setDataValue(C,S,ea),c?.addCell(p.parent,C.getId());let{rowIndex:x,rowPinned:R}=g,P=Qt({rowIndex:x,column:C,rowPinned:R});n[P]=!0})};this.iterateActiveRanges(h,!0)};this.doPasteOperation(r)}removeLastLineIfBlank(e){let t=k(e);if(t?.length===1&&t[0]===""){if(e.length===1)return;ae(e,t)}}fireRowChanged(e){if(this.gos.get("editType")!=="fullRow")return;for(let t of e)this.eventSvc.dispatchEvent({type:"rowValueChanged",node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})}shouldSkipPasteRow(e,t,s){if(e.detail||e.footer)return!0;if(s&&e.group){for(let i of t)if(i.isCellEditable(e))return!1;return!0}return!1}pasteMultipleValues(e,t,s,i,o,r,n){let a=t,l=this.beans,{gos:c}=l,d=this.clientSideRowModel!=null&&!c.get("enableGroupEdit")&&!c.get("treeData"),u=()=>{while(a){let h=Ee(l,a);if(a=ye(l,{rowPinned:a.rowPinned,rowIndex:a.rowIndex}),h!=null&&!this.shouldSkipPasteRow(h,i,d))return h}return null};for(let h of e){let g=u();if(!g)continue;h.forEach((p,f)=>this.updateCellValue(g,i[f],p,o,r,n)),s.push(g)}}updateCellValue(e,t,s,i,o,r){if(!e||!t?.isCellEditable(e)||t?.isSuppressPaste(e))return;let n=this.processCell(e,t,s,o,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,n,ea);let{rowIndex:a,rowPinned:l}=e,c=Qt({rowIndex:a,column:t,rowPinned:l});i[c]=!0,r?.addCell(e.parent,t.getId())}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t="api"){if(this.gos.get("suppressCutToClipboard"))return;this.eventSvc.dispatchEvent({type:"cutStart",source:t}),this.copyOrCutToClipboard(e,!0),this.eventSvc.dispatchEvent({type:"cutEnd",source:t})}copyOrCutToClipboard(e,t){let{includeHeaders:s,includeGroupHeaders:i}=e,{gos:o,focusSvc:r}=this.beans;if(s==null)s=o.get("copyHeadersToClipboard");if(i==null)i=o.get("copyGroupHeadersToClipboard");let n={includeHeaders:s,includeGroupHeaders:i},a=o.get("rowSelection"),l=o.get("cellSelection"),c=null;if(this.shouldCopyCells(l,a))this.copySelectedRangeToClipboard(n),c=0;else if(this.shouldCopyRows(a))this.copySelectedRowsToClipboard(n),c=1;else if(r.isAnyCellFocused())this.copyFocusedCellToClipboard(n),c=2;if(t&&c!==null)this.clearCellsAfterCopy(c)}shouldCopyCells(e,t){let{rangeSvc:s,selectionSvc:i,gos:o}=this.beans;if(!s||s.isEmpty())return!1;if(e)return!(typeof t==="object"&&t.copySelectedRows&&!i?.isEmpty());else{let r=o.get("suppressCopySingleCellRanges");return!(!s.isMoreThanOneCell()&&r)}}shouldCopyRows(e){let{selectionSvc:t,gos:s}=this.beans;if(t?.isEmpty()??!0)return!1;if(e&&typeof e!=="string")return e.copySelectedRows??!1;else return!s.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(e){let t=this.beans,{rangeSvc:s,focusSvc:i,eventSvc:o}=t;if(o.dispatchEvent({type:"keyShortcutChangedCellStart"}),e===0)s.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(e===1)this.clearSelectedRows();else{let r=i.getFocusedCell();if(r==null)return;let n=Ee(t,r);if(n)this.clearCellValue(n,r.column)}o.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){let{selectionSvc:e,visibleCols:t}=this.beans,s=e?.getSelectedNodes()??[],i=t.allCols;for(let o of s)for(let r of i)this.clearCellValue(o,r)}clearCellValue(e,t){if(!t.isCellEditable(e))return;let s=this.beans.valueSvc.getDeleteValue(t,e);e.setDataValue(t,s,"clipboardSvc")}iterateActiveRanges(e,t,s){let i=this.beans.rangeSvc;if(!i||i.isEmpty())return;let o=i.getCellRanges(),r=t?[o[0]]:o;for(let n of r)this.iterateActiveRange({cellRange:n,rowCallback:e,preProcessRange:s})}iterateActiveRange(e){let{cellRange:t,preProcessRange:s,rowCallback:i}=e,{beans:o}=this,{rangeSvc:r}=o;if(!r)return;if(s)s(t);let n=r.getRangeStartRow(t),a=r.getRangeEndRow(t),l=0,c=!1;while(!c&&n!=null){let d=Ee(o,n);c=Q(n,a),i(n,d,t,l++),n=ye(o,n)}}copySelectedRangeToClipboard(e={}){let t=this.beans.rangeSvc;if(!t||t.isEmpty())return;let s=t.areAllRangesAbleToMerge(),{data:i,cellsToFlash:o}=s?this.buildDataFromMergedRanges(t,e):this.buildDataFromRanges(t,e);this.copyDataToClipboard(i),this.dispatchFlashCells(o)}buildDataFromMergedRanges(e,t){let s=new Set,i=e.getCellRanges(),o=new Map,r=[],n={},a=J(this.gos,this.beans.rowModel),l=new Set;if(!a)this.beans.rowModel.forEachNode((h)=>{l.add(h.rowIndex)});for(let h of i){h.columns.forEach((f)=>s.add(f));let{rowPositions:g,cellsToFlash:p}=this.getRangeRowPositionsAndCellsToFlash(e,h);for(let f of g){let m=l.has(f.rowIndex);if(!a&&!m)continue;let C=`${f.rowIndex}-${f.rowPinned||"null"}`;if(!o.get(C))o.set(C,!0),r.push(f)}Object.assign(n,p)}let c=this.beans.visibleCols.allCols,d=Array.from(s);return d.sort((h,g)=>{let p=c.indexOf(h),f=c.indexOf(g);return p-f}),{data:this.buildExportParams({columns:d,rowPositions:r,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:n}}buildDataFromRanges(e,t){let s=e.getCellRanges(),i=[],o={};for(let r of s){let{rowPositions:n,cellsToFlash:a}=this.getRangeRowPositionsAndCellsToFlash(e,r);Object.assign(o,a),i.push(this.buildExportParams({columns:r.columns,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}return{data:i.join(`
81
- `),cellsToFlash:o}}getRangeRowPositionsAndCellsToFlash(e,t){let s=[],i={},o=e.getRangeStartRow(t),r=e.getRangeEndRow(t),n=o;while(n){s.push(n);for(let a of t.columns){let{rowIndex:l,rowPinned:c}=n,d=Qt({rowIndex:l,column:a,rowPinned:c});i[d]=!0}if(Q(n,r))break;n=ye(this.beans,n)}return{rowPositions:s,cellsToFlash:i}}getCellsToFlashFromRowNodes(e){let t=this.beans.visibleCols.allCols,s={};for(let i=0;i<e.length;i++){let{level:o,rowIndex:r,rowPinned:n,sibling:a}=e[i],l=o===-1?a.rowIndex:r;if(l==null)continue;for(let c=0;c<t.length;c++){let d=t[c],u=Qt({rowIndex:l,column:d,rowPinned:n});s[u]=!0}}return s}copyFocusedCellToClipboard(e={}){let t=this.beans.focusSvc.getFocusedCell();if(t==null)return;t=this.beans.rowSpanSvc?.getCellStart(t)??t;let s=Qt(t),i={rowPinned:t.rowPinned,rowIndex:t.rowIndex},o=t.column,r=this.buildExportParams({columns:[o],rowPositions:[i],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(r),this.dispatchFlashCells({[s]:!0})}copySelectedRowsToClipboard(e={}){let{columnKeys:t,includeHeaders:s,includeGroupHeaders:i}=e,o=this.buildExportParams({columns:t,includeHeaders:s,includeGroupHeaders:i});this.copyDataToClipboard(o);let r=this.beans.selectionSvc?.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(r))}buildExportParams(e){let{columns:t,rowPositions:s,includeHeaders:i=!1,includeGroupHeaders:o=!1}=e,{gos:r,csvCreator:n}=this.beans,a=({node:c,column:d})=>{let{value:u,valueFormatted:h}=this.beans.valueSvc.getValueForDisplay({column:d,node:c,includeValueFormatted:!0,from:"batch"}),g=h??u??"",p=r.getCallback("processCellForClipboard");if(!p)return g;return p({column:d,node:c,value:g,type:Fd,formatValue:(f)=>this.beans.valueSvc.formatValue(d,c,f)??f,parseValue:(f)=>this.beans.valueSvc.parseValue(d,c,f,u)??f})},l={columnKeys:t,rowPositions:s,skipColumnHeaders:!i,skipColumnGroupHeaders:!o,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!s,valueFrom:"batch",processCellCallback:r.getCallback("processCellForClipboard"),processRowGroupCallback:a,processHeaderCallback:r.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:r.getCallback("processGroupHeaderForClipboard")};return n.getDataAsCsv(l,!0)}dispatchFlashCells(e){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:e})},0)}processCell(e,t,s,i,o,r,n){let{valueSvc:a,formula:l}=this.beans;if(o)return o({column:t,node:e,value:s,type:i,formatValue:(d)=>a.formatValue(t,e??null,d)??d,parseValue:(d)=>a.parseValue(t,e??null,d,a.getValue(t,e,"edit"))});if(r&&t.colDef.useValueParserForImport!==!1)return a.parseValue(t,e??null,s,a.getValue(t,e,"edit"));if(n&&t.colDef.useValueFormatterForExport!==!1){if(l?.isFormula(s))return s;return a.formatValue(t,e??null,s)??s}return s}copyDataToClipboard(e){let t=this.gos.getCallback("sendToClipboard");if(t){t({data:e});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(e).catch((i)=>{F(40,{e:i,method:"writeText"}),this.copyDataToClipboardLegacy(e)});return}this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement((t)=>{let s=ce(this.beans),i=j(this.beans);if(t.value=e||" ",t.select(),t.focus({preventScroll:!0}),!s.execCommand("copy"))F(41);if(i?.focus!=null)i.focus({preventScroll:!0})})}executeOnTempElement(e,t){if(!this.gridCtrl)return;let s=ce(this.beans),i=s.createElement("textarea"),o=i.style;o.width="1px",o.height="1px";let r=s.documentElement;o.top=r.scrollTop+"px",o.left=r.scrollLeft+"px",o.position="absolute",o.opacity="0",this.gridCtrl.getGui().appendChild(i);try{e(i)}catch{F(42)}if(t)window.setTimeout(()=>{t(i),i.remove()},100);else i.remove()}},WC={moduleName:"Clipboard",version:ie,beans:[L6],apiFunctions:{copyToClipboard:P6,cutToClipboard:M6,copySelectedRowsToClipboard:T6,copySelectedRangeToClipboard:D6,copySelectedRangeDown:A6,pasteFromClipboard:I6},dependsOn:[_e,Jp,mi,Bf]};var UC=class extends y{constructor(){super(...arguments);this.loadRowDataVersion=0}wireBeans(e){this.environment=e.environment}init(e,t){if(this.params=t,this.comp=e,t.pinned!=null)return;this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)})}onFullWidthRowFocused(e){let t=this.params,s={rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},i={rowIndex:e.rowIndex,rowPinned:e.rowPinned};if(!Q(s,i))return;pe(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){let e=this.gos.get("detailRowAutoHeight"),t=e?"ag-details-row-auto-height":"ag-details-row-fixed-height",s=e?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",i=this.comp;i.toggleCss(t,!0),i.toggleDetailGridCss(s,!0)}setupRefreshStrategy(){let e=this.params.refreshStrategy;if(e=="everything"||e=="nothing"||e=="rows"){this.refreshStrategy=e;return}if(e!=null)F(170,{providedStrategy:e});this.refreshStrategy="rows"}createDetailGrid(){let{params:e,gos:t}=this;if(q(e.detailGridOptions)){F(171);return}let s=t.get("theme"),i=e.detailGridOptions.theme;if(i&&i!==s)F(267);let o={themeStyleContainer:this.environment.eStyleContainer,...e.detailGridOptions,theme:s};if(t.get("detailRowAutoHeight"))o.domLayout="autoHeight";this.comp.setDetailGrid(o)}registerDetailWithMaster(e){let{params:t,beans:{selectionSvc:s,findSvc:i,expansionSvc:o}}=this,r=t.node.id,n=t.api,a={id:r,api:e},l=t.node;if(n.isDestroyed())return;n.addDetailGridInfo(r,a),l.detailGridInfo=a;let c=l.parent;i?.registerDetailGrid(l,e);function d(){if(c)s?.refreshMasterNodeState(c)}function u({source:g}){if(g==="expandAll")return e.expandAll();if(g==="collapseAll")return e.collapseAll()}function h({node:g,source:p}){if(g!==c||p==="masterDetail"||e.isDestroyed())return;s?.setDetailSelectionState(c,t.detailGridOptions,e)}e.addEventListener("firstDataRendered",()=>{if(e.isDestroyed()||n.isDestroyed())return;s?.setDetailSelectionState(c,t.detailGridOptions,e),e.addEventListener("selectionChanged",d),n.addEventListener("rowSelected",h);let p=`${"CsrmSsrmSharedApi"}Module`;if(e.isModuleRegistered(p))n.addEventListener("expandOrCollapseAll",u),o?.setDetailsExpansionState(e)}),this.addManagedListeners(c,{masterChanged:(g)=>{if(!g.node.master)this.onDestroy(a)}}),this.addDestroyFunc(()=>this.onDestroy(a))}onDestroy(e){let{params:t}=this,{node:s,api:i}=t;if(s.detailGridInfo!==e)return;if(!i.isDestroyed())i.removeDetailGridInfo(s.id);s.detailGridInfo=null}loadRowData(){this.loadRowDataVersion++;let e=this.loadRowDataVersion,t=this.params;if(t.detailGridOptions?.rowModelType==="serverSide"){t.node.detailGridInfo?.api?.refreshServerSide({purge:!0});return}let s=t.getDetailRowData;if(!s){F(172);return}let i=(r)=>{if(this.loadRowDataVersion===e)this.comp.setRowData(r)},o={node:t.node,data:t.node.data,successCallback:i,context:I(this.gos,{}).context};s(o)}refresh(){switch(this.refreshStrategy){case"nothing":return!0;case"everything":return!1}return this.loadRowData(),!0}},G6=class{constructor(e){this.parentWrapper=e}wrap(e,t,s,i){return this.parentWrapper.wrap(e,t,s,i)}},O6={tag:"div",cls:"ag-details-row"},B6={tag:"div",cls:"ag-details-row",role:"gridcell",children:[{tag:"div",ref:"eDetailGrid",cls:"ag-details-grid",role:"presentation"}]},V6=class extends L{constructor(){super(...arguments);this.eDetailGrid=E}wireBeans(e){this.context=e.context}init(e){this.params=e,this.selectAndSetTemplate();let t={toggleCss:(s,i)=>this.toggleCss(s,i),toggleDetailGridCss:(s,i)=>this.eDetailGrid.classList.toggle(s,i),setDetailGrid:(s)=>this.setDetailGrid(s),setRowData:(s)=>this.setRowData(s),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new UC),this.ctrl.init(t,e)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){let e=this.params;if(e.pinned){this.setTemplate(O6);return}let t=()=>{this.setTemplate(B6)};if(q(e.template))t();else if(typeof e.template==="string")this.setTemplate(e.template,[]);else if(typeof e.template==="function"){let s=e.template,i=s(e);this.setTemplate(i,[])}else F(168),t();if(this.eDetailGrid==null)F(169)}setDetailGrid(e){if(!this.eDetailGrid)return;let t=this.context.getBean("frameworkCompWrapper"),s=new G6(t),{frameworkOverrides:i}=this.beans,o=Un(this.eDetailGrid,e,{frameworkOverrides:i,providedBeanInstances:{frameworkCompWrapper:s},modules:Wh(this.params.api.getGridId(),e.rowModelType??"clientSide")});this.detailApi=o,this.ctrl?.registerDetailWithMaster(o),this.addDestroyFunc(()=>{o.destroy()})}setRowData(e){this.detailApi?.setGridOption("rowData",e)}};function ma(e,t){let s=e.masterDetailSvc?.store;return s?t(s):void 0}function N6(e,t,s){ma(e,(i)=>{i[t]=s})}function _6(e,t){ma(e,(s)=>{delete s[t]})}function H6(e,t){return ma(e,(s)=>s[t])}function z6(e,t){ma(e,(s)=>{let i=0;Object.values(s).forEach((o)=>{if(o)t(o,i++)})})}var W6=".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}",U6=class extends y{constructor(){super(...arguments);this.beanName="masterDetailSvc",this.store={}}isEnabled(){return this.gos.get("masterDetail")}postConstruct(){let e=this.gos;if(J(e))this.enabled=this.isEnabled();if(Gs(e))this.addEventListeners()}addEventListeners(){let e=(i)=>{this.setMaster(i.node,!1,!0)},t,s=()=>{if(t){for(let i of t)i();t=void 0}if(this.isEnabled())t=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged:e})};s(),this.gos.addPropertyEventListener("masterDetail",s)}refreshModel(e){if(e.changedProps){let t=this.isEnabled();if(this.enabled!==t){this.setMasters(null);return}}if(e.rowDataUpdated)this.setMasters(e.changedRowNodes)}setMaster(e,t,s){let i=e.master,o=this.isEnabled(),r=o,n=this.gos,a=n.get("isRowMaster"),l=n.get("treeData");if(o)if(t||s){if(a){let c=e.data;r=!!c&&!!a(c)}}else r=i;if(!l){if(r&&t||!r&&i)e._expanded??(e._expanded=null)}if(r!==i)e.master=r,e.dispatchRowEvent("masterChanged")}setMasters(e){if(this.enabled=this.isEnabled(),e){for(let t of e.updates)this.setMaster(t,!1,!0);for(let t of e.adds)this.setMaster(t,!0,!1)}else{let t=gc(this.beans)?.rootNode?._leafs;if(t)for(let s=0,i=t.length;s<i;++s)this.setMaster(t[s],!0,!1)}}getDetail(e){if(!e.master||!e.expanded)return null;let t=e.detailNode;if(t)return t;if(t=new Vs(this.beans),t.detail=!0,t.selectable=!1,t.parent=e,M(e.id))t.id=on+e.id;return t.data=e.data,t.level=e.level+1,e.detailNode=t,t}setupDetailRowAutoHeight(e,t){let{gos:s,beans:i}=this;if(!s.get("detailRowAutoHeight"))return;let o=()=>{let n=t.clientHeight;if(n!=null&&n>0){let a=()=>{let{rowModel:l}=this.beans,{rowNode:c}=e;if(c.setRowHeight(n),J(s,l)||Gs(s,l))l.onRowHeightChanged()};window.setTimeout(a,0)}},r=It(i,t,o);e.addDestroyFunc(r),o()}destroy(){this.store={},super.destroy()}},K6={moduleName:"SharedMasterDetail",version:ie,beans:[U6],userComponents:{agDetailCellRenderer:V6},dynamicBeans:{detailCellRendererCtrl:UC},apiFunctions:{addDetailGridInfo:N6,removeDetailGridInfo:_6,getDetailGridInfo:H6,forEachDetailGridInfo:z6},dependsOn:[_e,NC,HC],css:[W6]},KC={moduleName:"MasterDetail",version:ie,dependsOn:[K6,yr,Of]},$C=class extends L{constructor(){super(...arguments);this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){this.beans.dragSvc.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragging:(e)=>{let t=!1;if(!this.dragging)t=!0,this.dragging=!0,Ls(this.beans).classList?.add(this.getDraggingCssClass());if(this.updateValuesOnMove(e),t){this.changedCalculatedValues=!1;return}if(this.beans.rangeSvc.autoScrollService.check(e),this.changedCalculatedValues)this.onDrag(e),this.changedCalculatedValues=!1},onDragStop:(e)=>{this.dragging=!1,this.onDragEnd(e),this.clearDragProperties()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedEventListeners({cellSelectionChanged:this.updateLocalRangeIfNeeded.bind(this)}),this.addManagedElementListeners(this.getGui(),{pointerdown:Em,mousedown:Em})}getLastCellHovered(){return this.lastCellHovered}getDraggingCssClass(){return`ag-dragging-${this.type===0?"fill":"range"}-handle`}updateValuesOnMove(e){let t=Pc(this.gos,e);if(!t||this.shouldSkipCell(t)||this.lastCellHovered&&to(t,this.lastCellHovered))return;this.lastCellHovered=t,this.changedCalculatedValues=!0}clearDragProperties(){if(this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),Ls(this.beans).classList?.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging)this.destroy()}getType(){return this.type}refresh(e,t){let s=this.cellCtrl,i=this.getGui(),o=t??k(this.beans.rangeSvc.getCellRanges()),{startRow:r,endRow:n}=o;if(r&&n)if(Ce(n,r))this.rangeStartRow=n,this.rangeEndRow=r;else this.rangeStartRow=r,this.rangeEndRow=n;if(s!==e||!ve(i)){this.cellCtrl=e;let a=e.comp.getParentOfValue();if(a)a.appendChild(i)}this.cellRange=o}clearValues(){this.lastCellHovered=void 0}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging){G(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.getGui()?.remove()}updateLocalRangeIfNeeded(e){if(!this.cellRange)return;let{id:t,type:s}=this.cellRange;if(!t||t!==e.id)return;let i=this.beans.rangeSvc?.getCellRanges().find((o)=>o.id===t&&o.type===s);if(i&&i!==this.cellRange)this.cellRange=i}},Em=(e)=>{e.stopPropagation()};function $6(e){let t=e.length,s=0;if(t<=1)return e;for(let d=0;d<e.length;d++){let u=e[d],h=u.toString().split("e-");if(h.length>1){s=Math.max(s,parseInt(h[1],10));continue}if(Math.floor(u)===u)continue;s=Math.max(s,u.toString().split(".")[1].length)}let i=0,o=0,r=0,n=0;for(let d=0;d<t;d++){let u=e[d];i+=d,o+=u,n+=d*d,r+=d*u}let a=(t*r-i*o)/(t*n-i*i),l=o/t-a*i/t,c=[];for(let d=0;d<=t;d++)c.push(parseFloat((d*a+l).toFixed(s)));return c}var j6={tag:"div",cls:"ag-fill-handle"},q6=class extends $C{constructor(){super(j6);this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=0}postConstruct(){super.postConstruct(),this.addManagedElementListeners(this.getGui(),{dblclick:this.onDblClick.bind(this)})}onDblClick(e){Qe(e);let{cellRange:t,rangeStartRow:s,beans:i}=this,{rangeSvc:o,visibleCols:r}=i,n=As(i);if(!n)return;let a=this.getFillHandleDirection();this.dragAxis=a==="xy"?"y":a;let l=o?.createCellRangeFromCellRangeParams({rowStartIndex:s.rowIndex,rowStartPinned:s.rowPinned,columnStart:t.columns[0],rowEndIndex:this.dragAxis==="x"?t.endRow?.rowIndex??null:n.rowIndex,rowEndPinned:this.dragAxis==="x"?t.endRow?.rowPinned:n.rowPinned,columnEnd:this.dragAxis==="x"?k(r.allCols):k(t.columns)});if(this.isUp=!1,this.isLeft=!1,l)this.performFill({event:e,initialRange:t,finalRange:l});this.dragAxis=void 0}updateValuesOnMove(e){if(super.updateValuesOnMove(e),!this.initialXY)this.initialXY=Mc(this.beans,e);let{x:t,y:s}=this.initialXY,{x:i,y:o}=Mc(this.beans,e),r=Math.abs(t-i),n=Math.abs(s-o),a=this.getFillHandleDirection(),l;if(a==="xy")l=r>n?"x":"y";else l=a;if(l!==this.dragAxis)this.dragAxis=l,this.changedCalculatedValues=!0}shouldSkipCell(e){return Oe(e.column)}onDrag(e){if(!this.initialPosition){let s=this.cellCtrl;if(!s)return;this.initialPosition=s.cellPosition}let t=this.getLastCellHovered();if(t)this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;let t=this.dragAxis==="x",{cellRange:s,rangeStartRow:i,rangeEndRow:o,beans:{rangeSvc:r}}=this,n=s.columns.length,a;if(!this.isUp&&!this.isLeft)a=r.createCellRangeFromCellRangeParams({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,columnStart:s.columns[0],rowEndIndex:t?o.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?o.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:s.columns[n-1]});else{let l=t?i:this.lastCellMarked;a=r.createCellRangeFromCellRangeParams({rowStartIndex:l.rowIndex,rowStartPinned:l.rowPinned,columnStart:t?this.lastCellMarked.column:s.columns[0],rowEndIndex:o.rowIndex,rowEndPinned:o.rowPinned,columnEnd:s.columns[n-1]})}if(a)this.performFill({event:e,initialRange:s,finalRange:a,shouldUpdateRange:!0})}onDragCancel(){if(this.initialXY=null,!this.markedCells.length)return;this.clearMarkedPath()}performFill({event:e,initialRange:t,finalRange:s,shouldUpdateRange:i}){let{eventSvc:o,rangeSvc:r}=this.beans;if(o.dispatchEvent({type:"fillStart"}),this.handleValueChanged(t,s,e),i)r.setCellRanges([s]);o.dispatchEvent({type:"fillEnd",initialRange:t,finalRange:s})}getFillHandleDirection(){let e=Dn(this.gos)?.direction;if(!e)return"xy";if(e!=="x"&&e!=="y"&&e!=="xy")return F(177),"xy";return e}handleValueChanged(e,t,s){let{beans:i}=this,{rangeSvc:o,gos:r,valueSvc:n}=i,a=o.getRangeEndRow(e),l=o.getRangeStartRow(e),c=o.getRangeEndRow(t),d=o.getRangeStartRow(t),u=this.dragAxis==="y";if(this.isReduce&&!Dn(r)?.suppressClearOnFillReduction){let R=u?e.columns:e.columns.filter((D)=>t.columns.indexOf(D)<0),P=u?ye(i,c):d;if(P)this.clearCellsInRange(P,a,R);return}let h=[],g=[],p=[],f=[],m=!0,C=0,v=()=>{h.length=0,g.length=0,p.length=0,f.length=0,C=0},w=(R,P)=>{let D=this.isUp?a:l,O=!1;if(u)m=!0,v();while(!O&&D){let A=Ee(i,D);if(!A)break;if(u&&R)S(h,R,A,()=>!Q(D,this.isUp?l:a));else if(P){m=!0,v();for(let _ of P)S(h,_,A,()=>_!==(this.isLeft?e.columns[0]:k(e.columns)))}O=Q(D,this.isUp?d:c),D=this.isUp?Ye(this.beans,D):ye(i,D)}},S=(R,P,D,O)=>{let A,_=!1;if(m)A=n.getValue(P,D,"edit"),g.push(A),p.push(n.getValue(P,D,"edit",!0)),f.push(n.getValueForDisplay({column:P,node:D,from:"edit"}).valueFormatted),m=O();else{let{value:oe,fromUserFunction:Y,sourceCol:V,sourceRowNode:re}=this.processValues({event:s,values:R,initialValues:g,initialNonAggregatedValues:p,initialFormattedValues:f,col:P,rowNode:D,idx:C++});if(A=oe,P.isCellEditable(D)){let le=n.getValue(P,D,"edit");if(!Y){if(V){let U=V.colDef;if(U.useValueFormatterForExport!==!1&&U.valueFormatter){let W=n.getValueForDisplay({column:V,node:re,includeValueFormatted:!0,from:"edit"}).valueFormatted;if(W!=null)A=W}}if(P.colDef.useValueParserForImport!==!1)A=n.parseValue(P,D,V?A:je(A),le)}if(!Y||le!==A)D.setDataValue(P,A,"rangeSvc");else _=!0}}if(!_)R.push({value:A,column:P,rowNode:D})},{changeDetectionSvc:x}=this.beans;x?.beginDeferred();try{if(u)e.columns.forEach((R)=>{w(R)});else{let R=this.isLeft?[...t.columns].reverse():t.columns;w(void 0,R)}this.beans.editSvc?.stopEditing(void 0,{source:"fillHandle"})}finally{x?.endDeferred()}}clearCellsInRange(e,t,s){let i={startRow:e,endRow:t,columns:s,startColumn:s[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[i],restoreSourceInBatch:!0})}processValues(e){let{formula:t,valueSvc:s}=this.beans,{event:i,values:o,initialValues:r,initialNonAggregatedValues:n,initialFormattedValues:a,col:l,rowNode:c,idx:d}=e,u=Dn(this.gos)?.setFillValue,h=this.dragAxis==="y",g;if(h)g=this.isUp?"up":"down";else g=this.isLeft?"left":"right";if(u){let m=I(this.gos,{event:i,values:o.map(({value:v})=>v),initialValues:r,initialNonAggregatedValues:n,initialFormattedValues:a,currentIndex:d,currentCellValue:s.getValue(l,c,"edit"),direction:g,column:l,rowNode:c}),C=u(m);if(C!==!1)return{value:C,fromUserFunction:!0}}let p=(m)=>typeof m==="number"&&Number.isFinite(m)||typeof m==="string"&&/^[+-]?\d+(?:\.\d+)?$/.test(m.trim()),f=o.every(({value:m})=>p(m));if(i.altKey||!f){let m=String(k(o)?.value??"");if(f&&r.length===1){let R=this.isUp||this.isLeft?-1:1;return{value:parseFloat(m)+1*R,fromUserFunction:!1}}let{value:C,column:v,rowNode:w}=o[d%o.length],S,x=v.isAllowFormula()&&t?.isFormula(m);if(x){let R=g==="up"?-1:g==="down"?1:0,P=g==="left"?-1:g==="right"?1:0;S=t.updateFormulaByOffset({value:m,rowDelta:R,columnDelta:P})}else S=C;return{value:S,fromUserFunction:!1,sourceCol:x?void 0:v,sourceRowNode:w}}return{value:k($6(o.map(({value:m})=>Number(m)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){for(let e of this.markedCells){if(!e.isAlive())continue;let{comp:t}=e;t.toggleCss("ag-selection-fill-top",!1),t.toggleCss("ag-selection-fill-right",!1),t.toggleCss("ag-selection-fill-bottom",!1),t.toggleCss("ag-selection-fill-left",!1)}this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(Q(t,e))return;let s=Ce(t,e),{rangeStartRow:i,rangeEndRow:o}=this;if(s&&(t.rowPinned==i.rowPinned&&t.rowIndex>=i.rowIndex||i.rowPinned!=o.rowPinned&&t.rowPinned==o.rowPinned&&t.rowIndex<=o.rowIndex))this.reduceVertical(e,t),this.isReduce=!0;else this.extendVertical(e,t,s),this.isReduce=!1}else{let s=e.column,i=t.column;if(s===i)return;let o=this.beans.visibleCols.allCols,r=o.indexOf(s),n=o.indexOf(i);if(n<=r&&n>=o.indexOf(this.cellRange.columns[0]))this.reduceHorizontal(e,t),this.isReduce=!0;else this.extendHorizontal(e,t,n<r),this.isReduce=!1}this.lastCellMarked=t}extendVertical(e,t,s){let i=this.beans,{rangeSvc:o}=i,r=e;do{let n=this.cellRange,a=n.columns.length;for(let l=0;l<a;l++){let c=n.columns[l],u={...{rowIndex:r.rowIndex,rowPinned:r.rowPinned},column:c},h=o.isCellInSpecificRange(u,n),g=Q(r,e);if(s)this.isUp=!0;if(!g){let p=lt(i,u);if(p){this.markedCells.push(p);let f=p.comp;if(!h)f.toggleCss("ag-selection-fill-left",l===0),f.toggleCss("ag-selection-fill-right",l===a-1);f.toggleCss(s?"ag-selection-fill-top":"ag-selection-fill-bottom",Q(r,t))}}}if(Q(r,t))break}while(r=s?Ye(this.beans,r):ye(i,r))}reduceVertical(e,t){let s=e,i=this.beans;do{let o=this.cellRange,r=o.columns.length,n=Q(s,t);for(let a=0;a<r;a++){let c={...{rowIndex:s.rowIndex,rowPinned:s.rowPinned},column:o.columns[a]},d=lt(i,c);if(d)this.markedCells.push(d),d.comp.toggleCss("ag-selection-fill-bottom",Q(s,t))}if(n)break}while(s=Ye(i,s))}extendHorizontal(e,t,s){let i=this.beans,{visibleCols:o}=i,r=o.allCols,n=r.indexOf(s?t.column:e.column),a=r.indexOf(s?this.cellRange.columns[0]:t.column),l=s?0:1,c=r.slice(n+l,a+l),{rangeStartRow:d,rangeEndRow:u}=this;for(let h of c){let g=d,p;do{p=Q(g,u);let f=lt(i,{rowIndex:g.rowIndex,rowPinned:g.rowPinned,column:h});if(f){this.markedCells.push(f);let m=f.comp;if(m.toggleCss("ag-selection-fill-top",Q(g,d)),m.toggleCss("ag-selection-fill-bottom",Q(g,u)),s)this.isLeft=!0,m.toggleCss("ag-selection-fill-left",h===c[0]);else m.toggleCss("ag-selection-fill-right",h===k(c))}g=ye(i,g)}while(!p)}}reduceHorizontal(e,t){let s=this.beans,{visibleCols:i}=s,o=i.allCols,r=o.indexOf(t.column),n=o.indexOf(e.column),a=o.slice(r,n),{rangeStartRow:l,rangeEndRow:c}=this;for(let d of a){let u=l,h;do{h=Q(u,c);let g=lt(this.beans,{rowIndex:u.rowIndex,rowPinned:u.rowPinned,column:d});if(g)this.markedCells.push(g),g.comp.toggleCss("ag-selection-fill-right",d===a[0]);u=ye(s,u)}while(!h)}}refresh(e,t){let s=t??this.beans.rangeSvc.getCellRanges()[0];if(!s.startRow||!s.endRow){this.destroy();return}super.refresh(e,s)}},Y6=class extends $C{constructor(){super({tag:"div",cls:"ag-range-handle"});this.type=1,this.rangeFixed=!1}onDrag(e){let t=this.getLastCellHovered();if(!t)return;let s=this.beans.rangeSvc,i=this.cellRange??k(s.getCellRanges());if(!i)return;if(!this.rangeFixed)this.fixRangeStartEnd(i),this.rangeFixed=!0;if(this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},s.getCellRanges().length===2&&s.getCellRanges()[0].type===cs.DIMENSION&&i.type===cs.VALUE){if(!Q(this.endPosition,s.getRangeEndRow(i)))s.updateRangeRowBoundary({cellRange:s.getCellRanges()[0],boundary:"end",cellPosition:{...this.endPosition,column:s.getCellRanges()[0].columns[0]},silent:!0})}s.extendRangeToCell(i,this.endPosition)}shouldSkipCell(e){return!1}onDragEnd(e){let t=this.cellRange??k(this.beans.rangeSvc.getCellRanges());if(!t)return;this.fixRangeStartEnd(t),this.rangeFixed=!1}onDragCancel(){this.rangeFixed=!1}fixRangeStartEnd(e){let t=this.beans.rangeSvc,s=t.getRangeStartRow(e),i=t.getRangeEndRow(e),o=e.columns[0];e.startRow=s,e.endRow=i,e.startColumn=o}},X6=".ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing),.ag-cell-range-selected.ag-cell-range-chart,.ag-cell-range-selected:not(.ag-cell-focus){background-color:var(--ag-range-selection-background-color);&.ag-cell-range-chart{background-color:var(--ag-range-selection-chart-background-color)!important;&.ag-cell-range-chart-category{background-color:var(--ag-range-selection-chart-category-background-color)!important}}}.ag-cell-range-selected-1.ag-cell-range-chart,.ag-cell-range-selected-1.ag-formula-range,.ag-cell-range-selected-1:not(.ag-cell-focus),.ag-root:not(.ag-context-menu-open) .ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-1:not(.ag-cell-inline-editing){background-color:var(--ag-range-selection-background-color)}.ag-cell-range-selected-2.ag-cell-range-chart,.ag-cell-range-selected-2.ag-formula-range,.ag-cell-range-selected-2:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-3.ag-cell-range-chart,.ag-cell-range-selected-3.ag-formula-range,.ag-cell-range-selected-3:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell-range-selected-4.ag-cell-range-chart,.ag-cell-range-selected-4.ag-formula-range,.ag-cell-range-selected-4:not(.ag-cell-focus){background-image:linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color)),linear-gradient(var(--ag-range-selection-background-color),var(--ag-range-selection-background-color))}.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell){&.ag-cell-range-top{border-top-color:var(--ag-range-selection-border-color);border-top-style:var(--ag-range-selection-border-style)}&.ag-cell-range-right{border-right-color:var(--ag-range-selection-border-color);border-right-style:var(--ag-range-selection-border-style)}&.ag-cell-range-bottom{border-bottom-color:var(--ag-range-selection-border-color);border-bottom-style:var(--ag-range-selection-border-style)}&.ag-cell-range-left{border-left-color:var(--ag-range-selection-border-color);border-left-style:var(--ag-range-selection-border-style)}}.ag-cell.ag-selection-fill-top,.ag-cell.ag-selection-fill-top.ag-cell-range-selected{border-top:1px dashed;border-top-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-right,:where(.ag-ltr) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-right,:where(.ag-rtl) .ag-cell.ag-selection-fill-right.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}.ag-cell.ag-selection-fill-bottom,.ag-cell.ag-selection-fill-bottom.ag-cell-range-selected{border-bottom:1px dashed;border-bottom-color:var(--ag-range-selection-border-color)}:where(.ag-ltr) .ag-cell.ag-selection-fill-left,:where(.ag-ltr) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-left:1px dashed var(--ag-range-selection-border-color)!important}:where(.ag-rtl) .ag-cell.ag-selection-fill-left,:where(.ag-rtl) .ag-cell.ag-selection-fill-left.ag-cell-range-selected{border-right:1px dashed var(--ag-range-selection-border-color)!important}.ag-fill-handle,.ag-range-handle{background-color:var(--ag-range-selection-border-color);bottom:-1px;height:6px;position:absolute;width:6px}:where(.ag-ltr) .ag-fill-handle,:where(.ag-ltr) .ag-range-handle{right:-1px}:where(.ag-rtl) .ag-fill-handle,:where(.ag-rtl) .ag-range-handle{left:-1px}.ag-fill-handle{cursor:crosshair}:where(.ag-ltr) .ag-range-handle{cursor:nwse-resize}:where(.ag-rtl) .ag-range-handle{cursor:nesw-resize}";function Z6(e){return e.rangeSvc?.getCellRanges()??null}function Q6(e,t){e.rangeSvc?.addCellRange(t)}function Pm(e){e.rangeSvc?.removeAllCellRanges()}var cr="ag-cell-range-selected",J6="ag-cell-range-chart",e4="ag-cell-range-single-cell",Mm="ag-cell-range-chart-category",t4="ag-cell-range-handle",s4="ag-cell-range-top",i4="ag-cell-range-right",o4="ag-cell-range-bottom",r4="ag-cell-range-left";function n4(e){let t=e.get("cellSelection");if(t===void 0)return e.get("enableRangeHandle");return typeof t!=="boolean"?t.handle?.mode==="range":!1}function Tm(e){let t=e.get("cellSelection");if(t===void 0)return e.get("enableFillHandle");return typeof t!=="boolean"?t.handle?.mode==="fill":!1}var a4=class{constructor(e,t){this.beans=e,this.cellCtrl=t,this.rangeColorClass=null,this.handleColorClass=null,this.refreshScheduled=!1,this.rangeSvc=e.rangeSvc}setComp(e){this.cellComp=e,this.eGui=this.cellCtrl.eGui,this.onCellSelectionChanged()}unsetComp(){this.beans.context.destroyBean(this.selectionHandle)}onCellSelectionChanged(){let e=this.cellComp;if(!e)return;let{rangeSvc:t,cellCtrl:s,eGui:i}=this,o=t.getCellRangeCount(s.cellPosition);this.rangeCount=o;let r=this.getHasChartRange();this.hasChartRange=r,e.toggleCss(cr,o!==0),e.toggleCss(`${cr}-1`,o===1),e.toggleCss(`${cr}-2`,o===2),e.toggleCss(`${cr}-3`,o===3),e.toggleCss(`${cr}-4`,o>=4),e.toggleCss(J6,r),Sn(i,o>0?!0:void 0),e.toggleCss(e4,this.isSingleCell()),this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}updateRangeBorders(){let e=this.getRangeBorders(),t=this.isSingleCell(),s=!t&&e.top,i=!t&&e.right,o=!t&&e.bottom,r=!t&&e.left,n=this.cellComp;n.toggleCss(s4,s),n.toggleCss(i4,i),n.toggleCss(o4,o),n.toggleCss(r4,r)}isSingleCell(){let{rangeSvc:e}=this;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){let{rangeSvc:e}=this;if(!this.rangeCount||!e)return!1;let t=e.getCellRanges();return t.length>0&&t.every((s)=>[cs.DIMENSION,cs.VALUE].includes(s.type))}updateRangeBordersIfRangeCount(){if(this.rangeCount>0)this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}getRangeBorders(){let e=this.beans.gos.get("enableRtl"),t=!1,s=!1,i=!1,o=!1,{rangeSvc:r,beans:{visibleCols:n},cellCtrl:{cellPosition:a}}=this,l=a.column,c=r.getCellRanges().filter((h)=>r.isCellInSpecificRange(a,h));if(!c.length)return{top:t,right:s,bottom:i,left:o};let d,u;if(e)d=n.getColAfter(l),u=n.getColBefore(l);else d=n.getColBefore(l),u=n.getColAfter(l);if(!d)o=!0;if(!u)s=!0;for(let h=0;h<c.length;h++){if(t&&s&&i&&o)break;let g=c[h],p=r.getRangeStartRow(g),f=r.getRangeEndRow(g);if(!t&&Q(p,a))t=!0;if(!i&&Q(f,a))i=!0;if(!o&&d&&g.columns.indexOf(d)<0)o=!0;if(!s&&u&&g.columns.indexOf(u)<0)s=!0}return{top:t,right:s,bottom:i,left:o}}refreshRangeStyleAndHandle(){let{context:e}=this.beans;if(e.isDestroyed())return;this.styleCellForRangeType();let t=this.getRangeForHandle();if(this.selectionHandle&&!t)this.selectionHandle=e.destroyBean(this.selectionHandle);if(t)this.addSelectionHandle(t);this.refreshHandleColor(t),this.cellComp.toggleCss(t4,!!this.selectionHandle)}scheduleRefreshRangeStyleAndHandle(){if(this.refreshScheduled)return;this.refreshScheduled=!0,et(this.beans,()=>{this.refreshScheduled=!1,this.refreshRangeStyleAndHandle()})}styleCellForRangeType(){if(this.hasChartRange){let{rangeSvc:e}=this,t=e.getCellRanges()[0],i=t.type===cs.DIMENSION&&e.isCellInSpecificRange(this.cellCtrl.cellPosition,t);this.cellComp.toggleCss(Mm,i)}else this.cellComp.toggleCss(Mm,!1),this.applyRangeColor(this.getRangeColorClass())}applyRangeColor(e){if(this.rangeColorClass&&this.rangeColorClass!==e)this.cellComp.toggleCss(this.rangeColorClass,!1),this.cellComp.toggleCss("ag-formula-range",!1);if(e)this.cellComp.toggleCss(e,!0),this.cellComp.toggleCss("ag-formula-range",e.startsWith("ag-formula-range"));this.rangeColorClass=e??null}getRangeColorClass(){let{rangeSvc:e,rangeCount:t}=this;if(!e||!t)return null;let s=e.getCellRanges();for(let i=s.length-1;i>=0;i--){let o=s[i],r=o.colorClass;if(!r)continue;if(e.isCellInSpecificRange(this.cellCtrl.cellPosition,o))return r}return null}refreshHandleColor(e){let t=this.selectionHandle?.getGui?.(),s=e?.colorClass??null;if(!t){this.handleColorClass=null;return}if(this.handleColorClass&&this.handleColorClass!==s)t.classList.remove(this.handleColorClass);if(s)t.classList.add(s);else if(this.handleColorClass)t.classList.remove(this.handleColorClass);this.handleColorClass=s??null}getRangeForHandle(){let{gos:e,editSvc:t}=this.beans,s=this.rangeSvc,i=s.getCellRanges(),o=i.length;if(this.rangeCount<1||o<1)return null;let r=t?.isRangeSelectionEnabledWhileEditing(),n=r?i:[k(i)];for(let a of n){let{cellPosition:l,column:c}=this.cellCtrl,d=Tm(e)&&!c.isSuppressFillHandle(),u=n4(e),g=!t?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&(r||o===1&&(d||u));if(this.hasChartRange)g=a.type===cs.VALUE;if(g&&a.endRow!=null&&s.isContiguousRange(a)&&s.isBottomRightCell(a,l))return a}return null}addSelectionHandle(e){let{editSvc:t,gos:s,context:i,registry:o}=this.beans,r=t?.isRangeSelectionEnabledWhileEditing(),n=e.type,l=!r&&Tm(s)&&q(n)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==l)this.selectionHandle=i.destroyBean(this.selectionHandle);if(!this.selectionHandle){let c=o.createDynamicBean(l===0?"fillHandle":"rangeHandle",!1);if(c)this.selectionHandle=i.createBean(c)}this.selectionHandle?.refresh(this.cellCtrl,e)}destroy(){this.unsetComp()}},l4=class extends y{constructor(e){super();this.eContainer=e}postConstruct(){let{beans:e,gos:t,eContainer:s}=this,i=e.rangeSvc,o={eElement:s,onDragStart:i.onDragStart.bind(i),onDragStop:i.onDragStop.bind(i),onDragging:i.onDragging.bind(i)},r=e.dragSvc,n=r.addDragSource.bind(r,o),a=r.removeDragSource.bind(r,o);if(this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{if(qe(t))n();else a()}),this.addDestroyFunc(a),qe(t))n()}},c4=class extends y{constructor(e,t){super();this.column=e,this.eGui=t}postConstruct(){this.addManagedElementListeners(this.eGui,{click:(e)=>e&&this.onClick(e)})}onClick(e){this.beans.rangeSvc?.handleColumnSelection(this.column,e)}},d4=class extends y{constructor(e,t){super();this.column=e,this.comp=t,this.columnMap=new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){this.columnMap.clear();let e;if(this.column.isColumn)e=[this.column];else e=this.column.getDisplayedLeafColumns();for(let t of e)this.columnMap.set(t,!1)}refreshActive(){let{gos:e,rangeSvc:t}=this.beans,s=e.get("cellSelection");this.isActive=!!(s&&t&&typeof s==="object"&&s.enableHeaderHighlight)}setupRangeHeaderHighlight(){let e=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:e,columnPinned:e,columnMoved:e,columnGroupOpened:e}),e()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();let e=this.beans.rangeSvc.getCellRanges(),t=!1,s=!0;for(let i of e){if(t)break;for(let o of i.columns)if(this.columnMap.has(o))this.columnMap.set(o,!0),t||(t=!0)}for(let i of Array.from(this.columnMap.values()))if(i===!1){s=!1;break}this.comp.toggleCss("ag-header-range-highlight",t&&s)}destroy(){super.destroy(),this.comp=null,this.column=null}},u4=class extends y{constructor(){super(...arguments);this.beanName="rangeSvc",this.rangeSelectionExtensions=[],this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1,this.columnRangeSelectionCtx={}}wireBeans(e){this.rowModel=e.rowModel,this.dragSvc=e.dragSvc,this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.cellNavigation=e.cellNavigation,this.ctrlsSvc=e.ctrlsSvc}postConstruct(){let e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),s=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:s,columnMoved:s,columnPinned:s}),this.ctrlsSvc.whenReady(this,(i)=>{let o=i.gridBodyCtrl;this.autoScrollService=new Bn({scrollContainer:o.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>o.scrollFeature.getVScrollPosition().top,setVerticalPosition:(r)=>o.scrollFeature.setVerticalScrollPosition(r),getHorizontalPosition:()=>o.scrollFeature.getHScrollPosition().left,setHorizontalPosition:(r)=>o.scrollFeature.setHorizontalScrollPosition(r),shouldSkipVerticalScroll:()=>!Te(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!o.scrollFeature.isHorizontalScrollShowing()})})}registerRangeSelectionExtension(e){if(this.rangeSelectionExtensions.includes(e))return;this.rangeSelectionExtensions.push(e)}unregisterRangeSelectionExtension(e){ae(this.rangeSelectionExtensions,e)}shouldSuppressRangeSelection(e){return this.rangeSelectionExtensions.some((t)=>t.shouldSuppressRangeSelection?.(e))}shouldSkipColumn(e){return this.rangeSelectionExtensions.some((t)=>t.shouldSkipColumn?.(e))}isAllColumnsSelectionCell(e){return this.rangeSelectionExtensions.some((t)=>t.isAllColumnsSelectionCell?.(e))}isAllColumnsRange(e,t){return this.rangeSelectionExtensions.some((s)=>s.isAllColumnsRange?.(e,t))}updateSelectionModeForCell(e){this.setSelectionMode(this.isAllColumnsSelectionCell(e))}onDragStart(e){let t=this.gos,s=e.target;if(!qe(t)||Rc(t,s)?.isSuppressMouseEvent(e))return;if(this.shouldSuppressRangeSelection(s))return;let{shiftKey:i}=e,o=this.isMultiRange(e),r=i&&!!this.cellRanges?.length;if(!o&&(!r||M(k(this.cellRanges).type)))this.removeAllCellRanges(!0);let n=this.dragSvc.startTarget;if(n)this.updateValuesOnMove(n);if(!this.lastCellHovered)return;if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=o&&this.getCellRangeCount(this.lastCellHovered)>1,!r)this.setNewestRangeStartCell(this.lastCellHovered);if(this.cellRanges.length>0)this.draggingRange=k(this.cellRanges);else{let a={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},l=this.getColumnsFromModel([this.lastCellHovered.column]);if(!l?.length)return;this.draggingRange={startRow:a,endRow:a,columns:l,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll",this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}onDragging(e){let{dragging:t,lastCellHovered:s,newestRangeStartCell:i,autoScrollService:o,cellHasChanged:r}=this;if(!t||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;let n=(g)=>s?.rowPinned===g&&i.rowPinned===g,a=n("top")||n("bottom");if(o.check(e,a),!r||!s)return;let l=i?.column,c=s?.column,d=this.calculateColumnsBetween(l,c);if(!d)return;let{rowIndex:u,rowPinned:h}=s;this.draggingRange.endRow={rowIndex:u,rowPinned:h},this.draggingRange.columns=d,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;let{id:e}=this.draggingRange;if(this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll",this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange)this.intersectionRange=!1,this.intersectLastRange();this.dispatchChangedEvent(!1,!0,e)}onColumnsChanged(){this.refreshLastRangeStart();let e=this.visibleCols.allCols;for(let s of this.cellRanges){let i=s.columns;if(s.columns=s.columns.filter((r)=>r.isVisible()&&e.indexOf(r)!==-1),!se(i,s.columns))this.dispatchChangedEvent(!1,!0,s.id)}let t=this.cellRanges.length;if(this.cellRanges=this.cellRanges.filter((s)=>s.columns.length>0),t>this.cellRanges.length)this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){let e=k(this.cellRanges);if(!e)return;this.refreshRangeStart(e)}isContiguousRange(e){let t=e.columns;if(!t.length)return!1;let s=this.visibleCols.allCols,i=t.map((o)=>s.indexOf(o)).sort((o,r)=>o-r);return k(i)-i[0]+1===t.length}getRangeStartRow(e){if(e.startRow&&e.endRow)return Ce(e.startRow,e.endRow)?e.startRow:e.endRow;return{rowIndex:0,rowPinned:(this.beans.pinnedRowModel?.getPinnedTopRowCount()??0)>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return Ce(e.startRow,e.endRow)?e.endRow:e.startRow;let t=this.beans.pinnedRowModel?.getPinnedBottomRowCount()??0;if(t>0)return{rowIndex:t-1,rowPinned:"bottom"};return{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}getRangeRowCount(e){let t=this.beans,s=this.getRangeStartRow(e),i=this.getRangeEndRow(e),o=fc(t,s);return fc(t,i)-o+1}handleCellMouseDown(e,t){let s=e.ctrlKey||e.metaKey;this.handleCellSelectionInput(t,{target:e.target,shiftKey:e.shiftKey,isRightClick:Jl(this.beans,e),isMultiRange:this.isMultiRange(e),isMultiKey:s,preventDefault:()=>e.preventDefault()})}handleCellKeyboardSelect(e,t){let s=e.ctrlKey||e.metaKey;this.handleCellSelectionInput(t,{target:e.target,shiftKey:e.shiftKey,isRightClick:!1,isMultiRange:this.isMultiRangeForKeyState(s),isMultiKey:s,preventDefault:()=>e.preventDefault()})}handleCellSelectionInput(e,t){let{target:s,shiftKey:i,isRightClick:o,isMultiRange:r,isMultiKey:n,preventDefault:a}=t;if(this.shouldSuppressRangeSelection(s))return;let l=this.isAllColumnsSelectionCell(e);if(l)a();if(i)return this.extendLatestRangeToCell(e);if(l&&o)return;this.updateSelectionModeForCell(e);let c=this.calculateColumnsBetween(e.column,e.column);if(!c)return;let d=l?this.findContainingRange({columns:c,startRow:e,endRow:e}):void 0;if(l&&!!d&&r&&n&&d)this.removeRowFromAllColumnsRange(e,d);else this.setRangeToCell(e,r)}isMultiRange(e){return this.isMultiRangeForKeyState(e.ctrlKey||e.metaKey)}isMultiRangeForKeyState(e){let{editingWithRanges:t,allowMulti:s}=this.getMultiRangeContext();return t||(s?e:!1)}getMultiRangeContext(){let{gos:e,editSvc:t}=this.beans,s=!!t?.isEditing()&&!!t?.isRangeSelectionEnabledWhileEditing(),i=ig(e)&&!s;return{editingWithRanges:s,suppressMultiRanges:i,allowMulti:!i}}removeRowFromAllColumnsRange(e,t){let{beans:s,cellRanges:i}=this,o=Ui(s),r=As(s),n=this.getRangeStartRow(t),a=this.getRangeEndRow(t);if(!n&&Q(o,e))ta(t,ye(s,o),"top");else if(!a&&Q(r,e))ta(t,Ye(s,r),"bottom");else if(Q(n,a))ae(i,t);else if(Q(n,e))ta(t,ye(s,e),"top");else if(Q(a,e))ta(t,Ye(s,e),"bottom");else{let l=Ye(s,e),c=ye(s,e);t.startRow=n,t.endRow=l??void 0,i.push({...t,startRow:c??void 0,endRow:a})}this.dispatchChangedEvent(!0,!0)}setRangeToCell(e,t=!1){let{gos:s}=this;if(!qe(s))return;this.updateSelectionModeForCell(e);let i=this.calculateColumnsBetween(e.column,e.column);if(!i)return;let{suppressMultiRanges:o}=this.getMultiRangeContext();if(o||!t||q(this.cellRanges))this.removeAllCellRanges(!0);let r={rowIndex:e.rowIndex,rowPinned:e.rowPinned},n={startRow:r,endRow:r,columns:i,startColumn:e.column},a=this.ensureRangeStartColumn(n);if(!a)return;this.cellRanges.push(n),this.setNewestRangeStartCell({...e,column:a}),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}getRangeLastColumn(e){let t=e.columns[0],s=k(e.columns);return this.newestRangeStartCell?.column===t?s:t}extendRangeRowCountBy(e,t){let{beans:s}=this,{startRow:i,endRow:o}=e;if(!i||!o)return;let r=0,n,a=Ce(o,i);if(a)n=i;else n=o;let l=t>0?ye:Ye,c=Math.abs(t);while(r<c){let u=l(s,n);if(!u)break;n=u,r++}if(r!==c)return;let d={...n,column:this.getRangeLastColumn(e)};this.updateRangeRowBoundary({cellRange:e,boundary:a?"start":"end",cellPosition:d})}extendRangeColumnCountBy(e,t){let{columns:s}=e;if(t===0)return;let i=this.getColumnsFromModel();if(!i)return;let o=this.ensureRangeStartColumn(e);if(!o)return;let r=k(s),n=o===s[0]?r:s[0];if(!r||!n)return;let a=i.indexOf(o),l=i.indexOf(n),c=l<a;if(c)a=l;let u=s.length+t;if(u<=0)return;let h=[];for(let g=a;g<a+u;g++){let p=i[g];if(!p)break;h.push(p)}if(h.length===u){if(c){let g=k(h);e.startColumn=g,this.focusCellOnNewColumn(e,g)}e.columns=h,this.dispatchChangedEvent(!0,!0,e.id)}}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;let t=k(this.cellRanges);this.updateSelectionModeForCell(e),this.updateRangeRowBoundary({cellRange:t,boundary:"end",cellPosition:e})}extendRangeToCell(e,t){if(!e)return;this.updateSelectionModeForCell(t),this.updateRangeRowBoundary({cellRange:e,boundary:"end",cellPosition:t})}updateRangeRowBoundary(e){let{cellRange:t,boundary:s,cellPosition:i,silent:o=!1}=e,r=i.column,n=this.ensureRangeStartColumn(t);if(!n)return;let a=this.calculateColumnsBetween(n,r);if(!a||p4(t,i))return;if(s==="start")this.focusCellOnNewRow(t,i);if(t.columns=a,t[s==="start"?"startRow":"endRow"]={rowIndex:i.rowIndex,rowPinned:i.rowPinned},!o)this.dispatchChangedEvent(!0,!0,t.id)}getRangeEdgeColumns(e){let t=this.visibleCols.allCols,s=e.columns.map((i)=>t.indexOf(i)).filter((i)=>i>-1).sort((i,o)=>i-o);return{left:t[s[0]],right:t[k(s)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;let t=e.key,s=e.ctrlKey||e.metaKey,i=k(this.cellRanges),o=this.newestRangeStartCell,r=i.endRow.rowIndex,n=i.endRow.rowPinned,l={column:this.getRangeLastColumn(i),rowIndex:r,rowPinned:n},c=this.cellNavigation.getNextCellToFocus(t,l,s);if(!c)return;if(this.shouldSkipColumn(c.column))return;return this.setCellRange({rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:c.rowIndex,rowEndPinned:c.rowPinned,columnStart:o.column,columnEnd:c.column}),c}setCellRange(e){if(!qe(this.gos))return;this.removeAllCellRanges(!0),this.addCellRange(e)}setCellRanges(e){if(se(this.cellRanges,e))return;if(!this.verifyCellRanges(this.gos))return;this.setSelectionMode(!1),this.removeAllCellRanges(!0);let t=this.getColumnsFromModel(this.visibleCols.allCols)??[],s=!1;for(let i of e){if(i.columns&&i.startRow){let o=this.getColumnsFromModel(i.columns);if(!o||o.length===0)continue;i.columns=o;let{startRow:r}=i;this.setNewestRangeStartCell({rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:i.columns[0]})}if(!s&&t.length>0&&this.isAllColumnsRange(i,t))s=!0;this.cellRanges.push(i)}this.setSelectionMode(s),this.dispatchChangedEvent(!1,!0)}clearCellRangeCellValues(e){let{beans:t,eventSvc:s}=this,{cellEventSource:i="rangeSvc",dispatchWrapperEvents:o,wrapperEventSource:r="deleteKey",restoreSourceInBatch:n}=e,{cellRanges:a}=e;if(o)s.dispatchEvent({type:"cellSelectionDeleteStart",source:r}),s.dispatchEvent({type:"rangeDeleteStart",source:r});if(!a)a=this.cellRanges;let{valueSvc:l,editSvc:c}=t,d=!!c?.isBatchEditing(),{changeDetectionSvc:u}=t;u?.beginDeferred();try{this.forEachEditableCellInRanges(a,(h,g)=>{if(n&&d){c?.batchResetToSourceValue({rowNode:h,column:g});return}let p=l.getDeleteValue(g,h);h.setDataValue(g,p,i)})}finally{u?.endDeferred()}if(o)s.dispatchEvent({type:"cellSelectionDeleteEnd",source:r}),s.dispatchEvent({type:"rangeDeleteEnd",source:r})}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let{columns:s,columnStart:i,columnEnd:o,rowStartIndex:r,rowStartPinned:n,rowEndIndex:a,rowEndPinned:l}=e,c=this.getColumnsFromParams(s,i,o);if(!c||!t&&c.columns.length===0)return;let{columns:d,startsOnTheRight:u}=c,h=Dm(r,n),g=Dm(a,l);return{startRow:h,endRow:g,columns:d,startColumn:this.getColumnFromModel(i)??(u?k(d):d[0])}}addCellRange(e){let t=this.gos;if(!qe(t)||!this.verifyCellRanges(t))return;this.setSelectionMode(!1);let s=this.createCellRangeFromCellRangeParams(e);if(s){if(s.startRow)this.setNewestRangeStartCell({rowIndex:s.startRow.rowIndex,rowPinned:s.startRow.rowPinned,column:s.startColumn});return this.cellRanges.push(s),this.dispatchChangedEvent(!1,!0,s.id),s}}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){let e=this.cellRanges.length;if(e===0)return!1;if(e>1)return!0;let t=this.cellRanges[0],s=this.getRangeStartRow(t),i=this.getRangeEndRow(t);return s.rowPinned!==i.rowPinned||s.rowIndex!==i.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){let e=new Map;if(this.cellRanges.length<=1)return!0;for(let i of this.cellRanges)this.forEachRowInRange(i,(o)=>{let r=`${o.rowPinned||"normal"}_${o.rowIndex}`,n=e.get(r),a=i.columns.map((l)=>l.getId());if(n){let l=a.filter((c)=>n.indexOf(c)===-1);n.push(...l)}else e.set(r,a)});let s;for(let i of e.values()){let o=i.sort().join();if(s===void 0){s=o;continue}if(s!==o)return!1}return!0}removeAllCellRanges(e){if(this.isEmpty())return;if(this.onDragStop(),this.cellRanges.length=0,!e)this.dispatchChangedEvent(!1,!0)}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){let s=t.columns?.includes(e.column),i=this.isRowInRange(e,t);return s&&i}isColumnInAnyRange(e){let{beans:t}=this,s=Ui(t),i=As(t);if(!s||!i)return!1;let o=e.isColumn?[e]:e.getDisplayedLeafColumns();return this.findContainingRange({columns:o,startRow:s,endRow:i},!0)!=null}findContainingRange({columns:e,startRow:t,endRow:s},i=!1){let o=this.cellRanges;for(let r=o.length-1;r>=0;r--){let n=o[r],a=e.every((c)=>n.columns.includes(c)),l;if(i)l=Q(n.startRow,t)&&Q(n.endRow,s);else{let c=t&&this.isRowInRange(t,n),d=s&&this.isRowInRange(s,n);l=!!c&&!!d}if(a&&l)return n}}isBottomRightCell(e,t){let s=this.visibleCols.allCols,i=e.columns.map((c)=>s.indexOf(c)).sort((c,d)=>c-d),{startRow:o,endRow:r}=e,n=Ce(o,r)?r:o,a=s.indexOf(t.column)===k(i),l=t.rowIndex===n.rowIndex&&de(t.rowPinned)===de(n.rowPinned);return a&&l}getCellRangeCount(e){return this.cellRanges.filter((t)=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t){let s=this.getRangeStartRow(t),i=this.getRangeEndRow(t),o=Q(e,s),r=Q(e,i);if(o||r)return!0;let n=!Ce(e,s),a=Ce(e,i);return n&&a}intersectLastRange(e){let{editingWithRanges:t,suppressMultiRanges:s}=this.getMultiRangeContext();if(t||s||e&&this.dragging||this.isEmpty())return;let i=k(this.cellRanges),o=this.getRangeStartRow(i),r=this.getRangeEndRow(i),n=[];for(let a of this.cellRanges.slice(0,-1)){let l=this.getRangeStartRow(a),c=this.getRangeEndRow(a),d=a.columns,u=d.filter((g)=>i.columns.indexOf(g)===-1);if(u.length===d.length){n.push(a);continue}if(Ce(r,l)||Ce(c,o)){n.push(a);continue}let h=n.length;if(Ce(l,o)){let g={columns:[...d],startColumn:i.startColumn,startRow:{...l},endRow:Ye(this.beans,o)};n.push(g)}if(u.length>0){let g={columns:u,startColumn:u.includes(i.startColumn)?i.startColumn:u[0],startRow:h4([{...o},{...l}]),endRow:g4([{...r},{...c}])};n.push(g)}if(Ce(r,c))n.push({columns:[...d],startColumn:i.startColumn,startRow:ye(this.beans,r),endRow:{...c}});if(n.length-h===1)n[n.length-1].id=a.id}if(this.cellRanges=n,e)this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(e,t,s){e.createManagedBean(new d4(t,s))}setSelectionMode(e){this.selectionMode=e?1:0}refreshRangeStart(e){let{columns:t}=e,s=this.ensureRangeStartColumn(e);if(!s)return;let i=(l,c)=>{let d=e.columns.filter((u)=>u!==l);if(l)e.startColumn=l,e.columns=c?[l,...d]:[...d,l];else e.columns=d},{left:o,right:r}=this.getRangeEdgeColumns(e);if(s===t[0]&&s!==o){i(o,!0);return}if(s===k(t)&&s===r)i(r,!1)}setNewestRangeStartCell(e){this.newestRangeStartCell=e}getColumnsFromParams(e,t,s){let i=!e&&!t&&!s,o,r=!1;if(i||e)o=this.getColumnsFromModel(i?void 0:e);else if(t&&s){if(o=this.calculateColumnsBetween(t,s),o?.length)r=o[0]!==this.getColumnFromModel(t)}return o?{columns:o,startsOnTheRight:r}:void 0}verifyCellRanges(e){let{suppressMultiRanges:t}=this.getMultiRangeContext(),s=sg(e)&&t&&this.cellRanges.length>1;if(s)F(93);return!s}forEachRowInRange(e,t){let s=this.getRangeStartRow(e),i=this.getRangeEndRow(e),o=s;while(o){if(t(o),Q(o,i))break;o=ye(this.beans,o)}}forEachEditableCellInRanges(e,t){let{beans:s}=this;for(let i of e)this.forEachRowInRange(i,(o)=>{let r=Ee(s,o);if(!r)return;for(let n=0;n<i.columns.length;n++){let a=this.getColumnFromModel(i.columns[n]);if(!a?.isCellEditable(r))continue;t(r,a)}})}onBodyScroll(){if(this.dragging&&this.lastMouseEvent)this.onDragging(this.lastMouseEvent)}updateValuesOnMove(e){let t=tr(this.gos,e),s=t?.cellPosition;if(this.cellHasChanged=!1,!s||this.lastCellHovered&&to(s,this.lastCellHovered))return;let i=this.beans.editSvc;if(i?.isEditing(t,{withOpenEditor:!0})&&!i?.isRangeSelectionEnabledWhileEditing()){this.dragSvc.cancelDrag(e);return}if(this.lastCellHovered)this.cellHasChanged=!0;this.lastCellHovered=s}dispatchChangedEvent(e,t,s){this.eventSvc.dispatchEvent({type:"cellSelectionChanged",started:e,finished:t,id:s}),this.eventSvc.dispatchEvent({type:"rangeSelectionChanged",started:e,finished:t,id:s})}getColumnFromModel(e){return typeof e==="string"?this.colModel.getCol(e):e}getColumnsFromModel(e){let{visibleCols:t,selectionMode:s}=this;if(!e||s===1)e=t.allCols;let i=[];for(let o of e){let r=this.getColumnFromModel(o);if(!r||this.shouldSkipColumn(r))continue;i.push(r)}return i.length?i:void 0}ensureRangeStartColumn(e){let t=this.getRangeStartColumn(e.columns,e.startColumn);if(!t)return;return e.startColumn=t,t}getRangeStartColumn(e,t){let s=e[0],i=k(e);if(!s||!i)return;if(!t||e.includes(t))return t??s;let o=this.visibleCols.allCols,r=o.indexOf(t),n=o.indexOf(s),a=o.indexOf(i);if(r<0||n<0||a<0)return s;return r-n<=a-r?s:i}calculateColumnsBetween(e,t){let s=this.visibleCols.allCols,i=this.getColumnFromModel(e),o=this.getColumnFromModel(t),r=i===o,n=s.indexOf(i);if(n<0){F(178,{colId:i.getId()});return}let a=r?n:s.indexOf(o);if(a<0){F(178,{colId:o.getId()});return}if(r||this.selectionMode===1)return this.getColumnsFromModel([i]);let l=Math.min(n,a),c=l===n?a:n;return this.getColumnsFromModel(s.slice(l,c+1))}focusCellOnNewColumn(e,t){let{focusSvc:s}=this.beans,i=s.getFocusedCell();if(!i)return;if(this.isCellInSpecificRange(i,e))s.setFocusedCell({...i,column:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}focusCellOnNewRow(e,t){let{focusSvc:s}=this.beans,i=s.getFocusedCell();if(!i)return;if(this.isCellInSpecificRange(i,e))s.setFocusedCell({...t,column:i.column,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}createDragListenerFeature(e){return new l4(e)}createCellRangeFeature(e){return new a4(this.beans,e)}createHeaderGroupCellMouseListenerFeature(e,t){return new c4(e,t)}handleColumnSelection(e,t){let{gos:s,beans:i,columnRangeSelectionCtx:o,cellRanges:r}=this;if(!is(s))return;let{suppressMultiRanges:n,editingWithRanges:a}=this.getMultiRangeContext(),l=r.length>0,c=t.ctrlKey||t.metaKey,d=!a||c,u=Ui(i),h=As(i);if(!u||!h)return;if(t.key===b.ENTER)t.preventDefault();if(t.shiftKey){let p=o.root;if(!p)return;let f=e.isColumn?e:k(e.getLeafColumns()),m=this.findContainingRange({columns:[p],startRow:u,endRow:h},!0);if(!m){ae(r,o.lastCellRange),this.selectColumns(this.calculateColumnsBetween(p,f),u,h);return}this.updateRangeRowBoundary({cellRange:m,boundary:"end",cellPosition:{column:f,...h}});return}if(l&&(n||!c&&!a))this.removeAllCellRanges(!0);let g=(p,f)=>{let m=this.findContainingRange({columns:p,startRow:u,endRow:h},!0);if(m&&d)this.deselectColumnsFromRange(m,p);else{let C=this.selectColumns(p,u,h);if(C)o.lastCellRange=C}o.root=f};if(e.isColumn)g([e],e);else{let p=e.getDisplayedLeafColumns();g(p,p[0])}}deselectColumnsFromRange(e,t){if(Ho(e.columns,t),t.includes(e.startColumn))e.startColumn=e.columns[0];if(e.columns.length===0)ae(this.cellRanges,e);this.dispatchChangedEvent(!0,!0)}selectColumns(e,t,s){return this.addCellRange({columns:e,columnStart:e[0],columnEnd:k(e),rowStartIndex:t.rowIndex,rowStartPinned:t.rowPinned,rowEndIndex:s.rowIndex,rowEndPinned:s.rowPinned})}};function Dm(e,t){return e!=null?{rowIndex:e,rowPinned:t}:void 0}function h4(e){let t;for(let s of e)if(t===void 0||Ce(t,s))t=s;return t}function g4(e){let t;for(let s of e)if(t===void 0||Ce(s,t))t=s;return t}function p4(e,t){let{startRow:s,endRow:i}=e,o=Ce(s,i)?i:s,r=t.rowIndex===o.rowIndex&&t.rowPinned===o.rowPinned,n=e.columns[0],a=k(e.columns),l=e.startColumn===n?a:n;return t.column===l&&r}function ta(e,t,s){let i;if(s==="top")i=!e.startRow||!e.endRow||Ce(e.startRow,e.endRow)?"startRow":"endRow";else i=!e.startRow||!e.endRow||Ce(e.startRow,e.endRow)?"endRow":"startRow";e[i]=t??void 0}var jC={moduleName:"CellSelection",version:ie,beans:[u4],dynamicBeans:{fillHandle:q6,rangeHandle:Y6},apiFunctions:{getCellRanges:Z6,addCellRange:Q6,clearRangeSelection:Pm,clearCellSelection:Pm},dependsOn:[_e,mi,Vn],css:[X6]};function f4(e){return e.colModel.pivotMode}function m4(e,t,s){return e.pivotResultCols?.lookupPivotResultCol(t,s)??null}function C4(e,t){e.valueColsSvc?.setColumns(t,"api")}function v4(e){return e.valueColsSvc?.columns??[]}function w4(e,t){e.valueColsSvc?.removeColumns(t,"api")}function b4(e,t){e.valueColsSvc?.addColumns(t,"api")}function S4(e,t){e.pivotColsSvc?.setColumns(t,"api")}function y4(e,t){e.pivotColsSvc?.removeColumns(t,"api")}function x4(e,t){e.pivotColsSvc?.addColumns(t,"api")}function R4(e){return e.pivotColsSvc?.columns??[]}function F4(e,t){e.pivotResultCols?.setPivotResultCols(t,"api")}function E4(e){let t=e.pivotResultCols?.getPivotResultCols();return t?t.list:null}var Am="PivotRowTotal_",P4=({headerName:e},{headerName:t})=>{if(e&&!t)return 1;else if(!e&&t)return-1;else if(!e&&!t)return 0;if(e<t)return-1;else if(e>t)return 1;else return 0},M4=(e)=>(t,s)=>e(t.headerName,s.headerName),T4=class extends y{constructor(){super(...arguments);this.beanName="pivotColDefSvc"}wireBeans(e){this.colModel=e.colModel,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.colNames=e.colNames}postConstruct(){let e=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=e(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=e()});let t=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=t(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=t()})}createPivotColumnDefs(e){let t=this.createPivotColumnsFromUniqueValues(e);function s(o,r=[]){return o.forEach((n)=>{if(n.children!==void 0)s(n.children,r);else r.push(n)}),r}let i=s(t);return this.addRowGroupTotals(t,i),this.addExpandablePivotGroups(t,i),this.addPivotTotalsToGroups(t,i),t}createPivotColumnsFromUniqueValues(e){let t=this.pivotColsSvc?.columns??[],s=t.length;return this.recursivelyBuildGroup(0,e,[],s,t)}recursivelyBuildGroup(e,t,s,i,o){if(e>=i)return this.buildMeasureCols(s);let{pivotComparator:r}=o[e].colDef,n=r?M4(r):P4,a=this.valueColsSvc?.columns;if(a?.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&e===i-1){let c=[];for(let d of t.keys()){let u=[...s,d],h=this.createColDef(a[0],d,u);h.columnGroupShow="open",c.push(h)}return c.sort(n),c}let l=[];for(let c of t.keys()){let d=this.pivotDefaultExpanded===-1||e<this.pivotDefaultExpanded,u=[...s,c];l.push({children:this.recursivelyBuildGroup(e+1,t.get(c),u,i,o),headerName:c,pivotKeys:u,columnGroupShow:"open",openByDefault:d,groupId:this.generateColumnGroupId(u)})}return l.sort(n),l}buildMeasureCols(e){let t=this.valueColsSvc?.columns??[];if(t.length===0)return[this.createColDef(null,"-",e)];return t.map((s)=>{let i=this.colNames.getDisplayNameForColumn(s,"header"),o=this.createColDef(s,i,e);return o.columnGroupShow="open",o})}addExpandablePivotGroups(e,t){let s=this.gos.get("suppressExpandablePivotGroups");if(s||this.gos.get("pivotColumnGroupTotals"))return;let i=(o,r,n)=>{if("children"in o){let{valueColsSvc:c}=this,{columns:d=[]}=c??{},u=new Map;o.children.forEach((p)=>{i(p,r,u)});let h=!o.children.some((p)=>p.children),g=h&&d.length===1&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let p of d){let f=this.colNames.getDisplayNameForColumn(p,"header"),m=this.createColDef(p,f,o.pivotKeys);if(m.pivotTotalColumnIds=u.get(p.colId),m.columnGroupShow=!s?"closed":"open",m.aggFunc=p.getAggFunc(),!h||g)o.children.push(m),r.push(m)}this.merge(n,u);return}if(!o.pivotValueColumn)return;let a=o.pivotValueColumn.getColId();if(n.has(a))n.get(a).push(o.colId);else n.set(a,[o.colId])};e.forEach((o)=>{i(o,t,new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get("pivotColumnGroupTotals"))return;let s=this.gos.get("pivotColumnGroupTotals")==="after",i=this.valueColsSvc?.columns,o=i?.map((r)=>r.getAggFunc());if(!o||o.length<1||!this.sameAggFuncs(o))return;if(i){let r=i[0];e.forEach((n)=>{this.recursivelyAddPivotTotal(n,t,r,s)})}}recursivelyAddPivotTotal(e,t,s,i){let o=e;if(!o.children){let n=e;return n.colId?[n.colId]:null}let r=[];if(o.children.forEach((n)=>{let a=this.recursivelyAddPivotTotal(n,t,s,i);if(a)r=r.concat(a)}),o.children.length>1){let a=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),l=this.createColDef(s,a,e.pivotKeys,!0);l.pivotTotalColumnIds=r,l.aggFunc=s.getAggFunc(),l.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;let c=e.children;if(i)c.push(l);else c.unshift(l);t.push(l)}return r}addRowGroupTotals(e,t){if(!this.gos.get("pivotRowTotals"))return;let s=this.gos.get("pivotRowTotals")==="after",o=(this.valueColsSvc?.columns??[]).slice();if(!s)o.reverse();let r=o.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let n=0;n<o.length;n++){let a=o[n],l=this.colNames.getDisplayNameForColumn(a,"header"),c=this.createColDef(a,l,[]),d=[];for(let h=0;h<t.length;h++){let g=t[h];if(g.pivotValueColumn===a)d.push(g.colId)}c.pivotTotalColumnIds=d,c.colId=Am+c.colId;let u=r?{children:[c],pivotKeys:[],groupId:`${Am}_pivotGroup_${a.colId}`}:c;if(t.push(c),s)e.push(u);else e.unshift(u)}}recreateColDef(e){let{pivotValueColumn:t,headerName:s,pivotKeys:i,pivotTotalColumnIds:o,columnGroupShow:r,colId:n,field:a,valueGetter:l,aggFunc:c}=e;if(!t)return e;let d=this.createColDef(t,s,i,!!o);return d.columnGroupShow=r,d.colId=n,d.field=a,d.valueGetter=l,d.aggFunc=c,d.pivotTotalColumnIds=o,this.gos.get("processPivotResultColDef")?.(d),d}createColDef(e,t,s,i=!1){let o={};if(e){let r=e.colDef;Object.assign(o,r),o.hide=!1}if(o.headerName=t,o.colId=this.generateColumnId(s||[],e&&!i?e.colId:""),o.field=o.colId,o.valueGetter=(r)=>r.data?.[r.colDef.field],o.pivotKeys=s,o.pivotValueColumn=e,o.filter===!0)o.filter="agNumberColumnFilter";return o}sameAggFuncs(e){if(e.length==1)return!0;for(let t=1;t<e.length;t++)if(e[t]!==e[0])return!1;return!0}merge(e,t){t.forEach((s,i)=>{let r=[...e.has(i)?e.get(i):[],...s];e.set(i,r)})}generateColumnGroupId(e){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map((s)=>s.colId).join("-")}_${e.join("-")}`}generateColumnId(e,t){return`pivot_${(this.pivotColsSvc?.columns??[]).map((i)=>i.colId).join("-")}_${e.join("-")}_${t}`}createColDefsFromFields(e){let t=new Map;for(let o=0;o<e.length;o++){let n=e[o].split(this.fieldSeparator),a=t;for(let l=0;l<n.length;l++){let c=n[l],d=a.get(c);if(!d)d=new Map,a.set(c,d);a=d}}let s=(o,r,n,a)=>{let l=[];for(let[u,h]of n){let g=s(`${o}${this.fieldSeparator}${u}`,u,h,a+1);l.push(g)}if(l.length===0){let u=this.colModel.getColDefCol(r);if(u){let g=this.colNames.getDisplayNameForColumn(u,"header")??r,p=this.createColDef(u,g,void 0,!1);return p.colId=o,p.aggFunc=u.getAggFunc(),p.valueGetter=(f)=>f.data?.[o],p}return{colId:o,headerName:r,valueGetter:(g)=>g.data?.[o]}}if(this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&l.length===1&&"colId"in l[0])return l[0].headerName=r,l[0];return{openByDefault:this.pivotDefaultExpanded===-1||a<this.pivotDefaultExpanded,groupId:o,headerName:r,children:l}},i=[];for(let[o,r]of t){let n=s(o,o,r,0);i.push(n)}return i}},D4=class extends y{constructor(){super(...arguments);this.beanName="pivotResultCols"}wireBeans(e){this.colModel=e.colModel,this.visibleCols=e.visibleCols}destroy(){gt(this.beans,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return this.pivotResultCols!=null}lookupPivotResultCol(e,t){if(this.pivotResultCols==null)return null;let s=this.colModel.getColDefCol(t),i=null;for(let o of this.pivotResultCols.list){let r=o.colDef,{pivotKeys:n,pivotValueColumn:a}=r;if(se(n,e)&&a===s)i=o}return i}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){if(!this.pivotResultCols)return null;return this.colModel.getColFromCollection(e,this.pivotResultCols)}getAggregationOrderedList(){let e=this.aggOrderedList;if(e!==void 0)return e;let t=this.pivotResultCols?.list;if(!t||t.length===0)return this.aggOrderedList=null,null;let s=!1;for(let i=0;i<t.length;++i)if(t[i].colDef.pivotTotalColumnIds!=null){s=!0;break}if(!s)e=t;else{let i=[],o=[];for(let r=0;r<t.length;++r){let n=t[r];if(n.colDef.pivotTotalColumnIds!=null)o.push(n);else i.push(n)}e=i.concat(o)}return this.aggOrderedList=e,e}setPivotResultCols(e,t){if(this.aggOrderedList=void 0,!this.colModel.ready)return;if(e==null&&this.pivotResultCols==null)return;if(e){this.processPivotResultColDef(e);let i=(t==="api"?sc:lg)(this.beans,e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);gt(this.beans,this.pivotResultCols?.tree,i.columnTree);let{columnTree:o,treeDepth:r}=i,n=In(o),a={};this.pivotResultCols={tree:o,treeDepth:r,list:n,map:a};for(let c of this.pivotResultCols.list)this.pivotResultCols.map[c.getId()]=c;let l=!!this.previousPivotResultCols;this.previousPivotResultCols=null,this.colModel.refreshCols(!l,t)}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null,this.colModel.refreshCols(!1,t);this.visibleCols.refresh(t)}processPivotResultColDef(e){let t=this.gos.get("processPivotResultColDef"),s=this.gos.get("processPivotResultColGroupDef");if(!t&&!s)return;let i=(o)=>{o.forEach((r)=>{if(M(r.children)){let a=r;if(s)s(a);i(a.children)}else{let a=r;if(t)t(a)}})};if(e)i(e)}},Im="Exceeded maximum allowed pivot column count.",na=(e)=>{let t={};return e.forEach((s,i)=>t[i]=s instanceof Map?na(s):s),t},A4=class extends y{constructor(){super(...arguments);this.beanName="pivotStage",this.step="pivot",this.refreshProps=["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups","enableStrictPivotColumnOrder"],this.uniqueValues=new Map,this.pivotOrderLastTime=[],this.lastTimeFailed=!1,this.maxUniqueValues=-1,this.currentUniqueCount=0}wireBeans(e){this.pivotResultCols=e.pivotResultCols,this.pivotColDefSvc=e.pivotColDefSvc}execute(e,t){if(this.beans.colModel.isPivotActive())return this.executePivotOn(e,t);else return this.executePivotOff()}executePivotOff(){if(this.aggregationColumnsHashLastTime=null,this.pivotOrderLastTime=[],this.uniqueValues=new Map,this.pivotResultCols.isPivotResultColsPresent())return this.pivotResultCols.setPivotResultCols(null,"rowModelUpdated"),!0;return!1}executePivotOn(e,t){let{valueColsSvc:s,gos:i,rowGroupColsSvc:o,pivotColsSvc:r}=this.beans,n=s?.columns.length??1,a=i.get("pivotMaxGeneratedColumns");this.maxUniqueValues=a===-1?-1:a/n;let l;try{l=this.bucketUpRowNodes(e)}catch(R){if(R.message===Im)return this.pivotResultCols.setPivotResultCols([],"rowModelUpdated"),this.eventSvc.dispatchEvent({type:"pivotMaxColumnsExceeded",message:R.message}),this.lastTimeFailed=!0,!1;throw R}let c=this.setUniqueValues(l),d=s?.columns??[],u=d.map((R)=>`${R.getId()}-${R.colDef.headerName}`).join("#"),h=d.map((R)=>R.getAggFunc().toString()).join("#"),g=this.aggregationColumnsHashLastTime!==u,p=this.aggregationFuncsHashLastTime!==h;this.aggregationColumnsHashLastTime=u,this.aggregationFuncsHashLastTime=h;let f=(o?.columns??[]).map((R)=>R.getId()).join("#"),m=f!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=f;let C=r?.columns??[],w=i.get("enableStrictPivotColumnOrder")&&C.some((R)=>R.colDef.pivotComparator)?qC(this.uniqueValues,C,0):[],S=!se(w,this.pivotOrderLastTime);this.pivotOrderLastTime=w;let x=this.refreshProps.some((R)=>t?.has(R));if(this.lastTimeFailed||c||g||m||p||S||x){let R=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);return this.pivotResultCols.setPivotResultCols(R,"rowModelUpdated"),this.lastTimeFailed=!1,!0}return this.lastTimeFailed=!1,!1}setUniqueValues(e){if(!vn(na(this.uniqueValues),na(e)))return this.uniqueValues=e,!0;return!1}bucketUpRowNodes(e){let t=this.beans.rowModel;this.currentUniqueCount=0;let s=new Map;Ae(t.rootNode,t.hierarchical,e,(o)=>{if(o.leafGroup)o.childrenMapped=null});let i=(o)=>{if(o.leafGroup)this.bucketRowNode(o,s);else{let r=o.childrenAfterFilter;if(r)for(let n=0,a=r.length;n<a;++n)i(r[n])}};return i(t.rootNode),s}bucketRowNode(e,t){let s=this.beans.pivotColsSvc?.columns;if(s?.length===0)e.childrenMapped=null;else e.childrenMapped=na(this.bucketChildren(e.childrenAfterFilter,s,0,t));if(e.sibling)e.sibling.childrenMapped=e.childrenMapped}bucketChildren(e,t=[],s,i){let o=new Map,r=t[s],n=this.maxUniqueValues!==-1;for(let l=0,c=e.length;l<c;++l){let d=e[l],u=this.beans.valueSvc.getKeyForNode(r,d);if(q(u))u="";if(!i.get(u)){this.currentUniqueCount+=1,i.set(u,new Map);let h=this.currentUniqueCount>this.maxUniqueValues;if(n&&h)throw Error(Im)}if(!o.has(u))o.set(u,[]);o.get(u).push(d)}if(s===t.length-1)return o;let a=new Map;for(let l of o.keys())a.set(l,this.bucketChildren(o.get(l),t,s+1,i.get(l)));return a}};function qC(e,t,s){let i=t[s]?.colDef.pivotComparator,o=[...e.keys()];if(i)o.sort(i);if(s===t.length-1)return o;let r=[];for(let n=0;n<o.length;n++){let a=o[n];r.push(a);let l=e.get(a);if(l instanceof Map){let c=qC(l,t,s+1);for(let d=0;d<c.length;d++)r.push(c[d])}}return r}var I4={moduleName:"SharedPivot",version:ie,beans:[D4,T4,GC],apiFunctions:{isPivotMode:f4,getPivotResultColumn:m4,setValueColumns:C4,getValueColumns:v4,removeValueColumns:w4,addValueColumns:b4,setPivotColumns:S4,removePivotColumns:y4,addPivotColumns:x4,getPivotColumns:R4,setPivotResultColumns:F4,getPivotResultColumns:E4},dependsOn:[zC,Dc]},YC={moduleName:"Pivot",version:ie,rowModels:["clientSide"],beans:[A4],dependsOn:[I4,E6,yr]};var t_=String.fromCodePoint(31,41150,8291);var XC=[{symbol:"%",fixity:"postfix",precedence:100},{symbol:"-",fixity:"prefix",precedence:90},{symbol:"+",fixity:"prefix",precedence:90},{symbol:"^",fixity:"infix",precedence:80,associativity:"right"},{symbol:"*",fixity:"infix",precedence:70,associativity:"left",isAssociative:!0},{symbol:"/",fixity:"infix",precedence:70,associativity:"left"},{symbol:"+",fixity:"infix",precedence:60,associativity:"left",isAssociative:!0},{symbol:"-",fixity:"infix",precedence:60,associativity:"left"},{symbol:"&",fixity:"infix",precedence:55,associativity:"left",isAssociative:!0},{symbol:"=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<>",fixity:"infix",precedence:50,associativity:"left"},{symbol:">=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<=",fixity:"infix",precedence:50,associativity:"left"},{symbol:">",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<",fixity:"infix",precedence:50,associativity:"left"}],km=new Map;for(let e of XC){let t=km.get(e.symbol)??[];t.push(e),km.set(e.symbol,t)}var s_=[...new Set(XC.map((e)=>e.symbol))].sort((e,t)=>t.length-e.length);var k4="ABCDEFGHIJKLMNOPQRSTUVWXYZ",i_=k4.length;var L4={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",stackedLine:"line",normalizedLine:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall",funnel:"funnel",coneFunnel:"cone-funnel",pyramid:"pyramid"},G4=new Set(["columnLineCombo","areaColumnCombo","customCombo"]);function O4(e){return G4.has(e)}function B4(e){return e==="doughnut"?"donut":e}function V4(e){return L4[e]}var N4=["number","category","grouped-category","log","time"];var o_=N4.reduce((e,t)=>({...e,[t]:{title:{_enabledFromTheme:!0}}}),{});var Ca=(e)=>(t)=>{if(t==null)return!0;return e(t)};var _4=["doughnut"];function H4(e){return!!V4(e)||O4(e)}function z4(e){return _4.includes(e)}var n_=Ca((e)=>{if(H4(e))return!0;if(z4(e)){let t=B4(e);return Ht(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}return!1}),a_=Ca((e)=>typeof e==="object"),l_=Ca((e)=>typeof e==="object"),c_=Ca((e)=>typeof e==="string"||typeof e==="function");function ZC(e){return e.map((t,s,i)=>t.map((o,r)=>i.slice(0,s+1).reduce((n,a)=>n+a[r],0)))}function QC(e){let t=e.map((s,i)=>e.reduce((o,r)=>Math.max(o,r[i]),0));return e.map((s)=>s.map((i,o)=>i/t[o]*19))}var JC=[[1,3,5],[2,6,4],[5,3,1]];var W4=ZC(JC);var d_=QC(W4);var U4=JC;var K4=ZC(U4);var u_=QC(K4);var $4=["number","category","time","grouped-category"],j4=["angle-category","angle-number","radius-category","radius-number"],h_=[...$4,...j4];Uh.registerModules([Uf,Qp,Wf,Gf,zf,df,Xp,TC,jC,YC,KC,Vd,pC,CC,xC,FC,WC,kf,If,SC,Lf,vC]);var q4=["onFilterChanged","onModelUpdated","onGridSizeChanged","onFirstDataRendered","onRowValueChanged","onSelectionChanged","onCellClicked","onCellDoubleClicked","onCellValueChanged","onRowClicked","onSortChanged","onContextMenu","onColumnResized","onColumnMoved","onRowDataUpdated","onCellEditingStarted","onCellEditingStopped","onPaginationChanged","onBodyScroll"],ev=(e)=>e?Hn.withParams({headerFontSize:14,headerVerticalPaddingScale:0.4,rowVerticalPaddingScale:0.4,backgroundColor:"#1d1d1d",foregroundColor:"#ffffff",headerBackgroundColor:"#2a2a2a",headerForegroundColor:"#ffffff",oddRowBackgroundColor:"#262626",borderColor:"#404040",browserColorScheme:"dark"}):Hn.withParams({browserColorScheme:"light",headerFontSize:14,headerVerticalPaddingScale:0.4,rowVerticalPaddingScale:0.4}),j9=(e)=>{let{data:t,options:s,api:i,on:o,class:r,style:n="height: 100%; width: 100%",dark:a}=e,l=()=>a!==void 0?typeof a==="function"?a():a:document.documentElement.getAttribute("data-theme")==="dark"||window.matchMedia("(prefers-color-scheme: dark)").matches;return Rr("div",{class:r,style:n,ref:(d)=>{let u,h=es(()=>{let g=Pr(()=>typeof t==="function"?t():t),p=Pr(()=>typeof s==="function"?s():s),f=Pr(()=>ev(l())),m={};q4.forEach((S)=>{m[S]=(x)=>{let R=o?.[S];if(R)R(x)}});let C={...p,theme:f,rowData:g||[],onGridReady:(S)=>{if(i)i.current=S.api;if(o?.onGridReady)o.onGridReady(S);if(p?.autoSizeColumns)S.api.autoSizeAllColumns()},...m};if(u=Un(d,C),i)i.current=u;es(()=>{let S=typeof t==="function"?t():t;if(Array.isArray(S)){let x=u.getGridOption("rowData");if(S!==x)u.setGridOption("rowData",S)}});let v=null;es(()=>{let S=l();if(S===v)return;v=S,u.setGridOption("theme",ev(S))});let w=!0;return es(()=>{let S=typeof s==="function"?s():s;if(w){w=!1;return}if(S)Object.entries(S).forEach(([x,R])=>{try{u.setGridOption(x,R)}catch(P){}})}),()=>{if(u&&!u.isDestroyed())u.destroy();if(i)i.current=null}});return()=>{h()}}})};export{j9 as Grid};