@arbocollab/arbo-plugin-item-table 0.1.83 → 0.1.84
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.
- package/lib/es/index.es.js +40 -38
- package/lib/umd/index.umd.js +2 -2
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -153,7 +153,7 @@ This will fail in production.`);r=jl,r._s.has(e)||(o?Ub(e,t,s,r):kA(e,s,r),K.env
|
|
|
153
153
|
* @author owenm <owen23355@gmail.com>
|
|
154
154
|
* @license MIT
|
|
155
155
|
*/function tO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tO(Object(n),!0).forEach(function(s){FJ(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tO(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Wm(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Wm=function(t){return typeof t}:Wm=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wm(e)}function FJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jr(){return Jr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Jr.apply(this,arguments)}function PJ(e,t){if(e==null)return{};var n={},s=Object.keys(e),o,i;for(i=0;i<s.length;i++)o=s[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function AJ(e,t){if(e==null)return{};var n=PJ(e,t),s,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)s=i[o],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}var kJ="1.14.0";function Qr(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ea=Qr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),cf=Qr(/Edge/i),nO=Qr(/firefox/i),uf=Qr(/safari/i)&&!Qr(/chrome/i)&&!Qr(/android/i),sO=Qr(/iP(ad|od|hone)/i),OJ=Qr(/chrome/i)&&Qr(/android/i),oO={capture:!1,passive:!1};function vn(e,t,n){e.addEventListener(t,n,!ea&&oO)}function dn(e,t,n){e.removeEventListener(t,n,!ea&&oO)}function zm(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function MJ(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function lr(e,t,n,s){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&zm(e,t):zm(e,t))||s&&e===n)return e;if(e===n)break}while(e=MJ(e))}return null}var iO=/\s+/g;function Po(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(iO," ").replace(" "+t+" "," ");e.className=(s+(n?" "+t:"")).replace(iO," ")}}function Nt(e,t,n){var s=e&&e.style;if(s){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in s)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),s[t]=n+(typeof n=="string"?"":"px")}}function Lu(e,t){var n="";if(typeof e=="string")n=e;else do{var s=Nt(e,"transform");s&&s!=="none"&&(n=s+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function rO(e,t,n){if(e){var s=e.getElementsByTagName(t),o=0,i=s.length;if(n)for(;o<i;o++)n(s[o],o);return s}return[]}function cr(){var e=document.scrollingElement;return e||document.documentElement}function ws(e,t,n,s,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,r,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==cr()?(i=e.getBoundingClientRect(),r=i.top,a=i.left,l=i.bottom,c=i.right,u=i.height,d=i.width):(r=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!ea))do if(o&&o.getBoundingClientRect&&(Nt(o,"transform")!=="none"||n&&Nt(o,"position")!=="static")){var h=o.getBoundingClientRect();r-=h.top+parseInt(Nt(o,"border-top-width")),a-=h.left+parseInt(Nt(o,"border-left-width")),l=r+i.height,c=a+i.width;break}while(o=o.parentNode);if(s&&e!==window){var f=Lu(o||e),p=f&&f.a,g=f&&f.d;f&&(r/=g,a/=p,d/=p,u/=g,l=r+u,c=a+d)}return{top:r,left:a,bottom:l,right:c,width:d,height:u}}}function aO(e,t,n){for(var s=Wa(e,!0),o=ws(e)[t];s;){var i=ws(s)[n],r=void 0;if(r=o>=i,!r)return s;if(s===cr())break;s=Wa(s,!1)}return!1}function Vu(e,t,n,s){for(var o=0,i=0,r=e.children;i<r.length;){if(r[i].style.display!=="none"&&r[i]!==Lt.ghost&&(s||r[i]!==Lt.dragged)&&lr(r[i],n.draggable,e,!1)){if(o===t)return r[i];o++}i++}return null}function mS(e,t){for(var n=e.lastElementChild;n&&(n===Lt.ghost||Nt(n,"display")==="none"||t&&!zm(n,t));)n=n.previousElementSibling;return n||null}function ei(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Lt.clone&&(!t||zm(e,t))&&n++;return n}function lO(e){var t=0,n=0,s=cr();if(e)do{var o=Lu(e),i=o.a,r=o.d;t+=e.scrollLeft*i,n+=e.scrollTop*r}while(e!==s&&(e=e.parentNode));return[t,n]}function NJ(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var s in t)if(t.hasOwnProperty(s)&&t[s]===e[n][s])return Number(n)}return-1}function Wa(e,t){if(!e||!e.getBoundingClientRect)return cr();var n=e,s=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=Nt(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return cr();if(s||t)return n;s=!0}}while(n=n.parentNode);return cr()}function LJ(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function vS(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var df;function cO(e,t){return function(){if(!df){var n=arguments,s=this;n.length===1?e.call(s,n[0]):e.apply(s,n),df=setTimeout(function(){df=void 0},t)}}}function VJ(){clearTimeout(df),df=void 0}function uO(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function dO(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Ao="Sortable"+new Date().getTime();function BJ(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(o){if(!(Nt(o,"display")==="none"||o===Lt.ghost)){e.push({target:o,rect:ws(o)});var i=ar({},e[e.length-1].rect);if(o.thisAnimationDuration){var r=Lu(o,!0);r&&(i.top-=r.f,i.left-=r.e)}o.fromRect=i}})}},addAnimationState:function(s){e.push(s)},removeAnimationState:function(s){e.splice(NJ(e,{target:s}),1)},animateAll:function(s){var o=this;if(!this.options.animation){clearTimeout(t),typeof s=="function"&&s();return}var i=!1,r=0;e.forEach(function(a){var l=0,c=a.target,u=c.fromRect,d=ws(c),h=c.prevFromRect,f=c.prevToRect,p=a.rect,g=Lu(c,!0);g&&(d.top-=g.f,d.left-=g.e),c.toRect=d,c.thisAnimationDuration&&vS(h,d)&&!vS(u,d)&&(p.top-d.top)/(p.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=HJ(p,h,f,o.options)),vS(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=o.options.animation),o.animate(c,p,d,l)),l&&(i=!0,r=Math.max(r,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),i?t=setTimeout(function(){typeof s=="function"&&s()},r):typeof s=="function"&&s(),e=[]},animate:function(s,o,i,r){if(r){Nt(s,"transition",""),Nt(s,"transform","");var a=Lu(this.el),l=a&&a.a,c=a&&a.d,u=(o.left-i.left)/(l||1),d=(o.top-i.top)/(c||1);s.animatingX=!!u,s.animatingY=!!d,Nt(s,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=$J(s),Nt(s,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),Nt(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){Nt(s,"transition",""),Nt(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},r)}}}}function $J(e){return e.offsetWidth}function HJ(e,t,n,s){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*s.animation}var Bu=[],yS={initializeByDefault:!0},hf={mount:function(t){for(var n in yS)yS.hasOwnProperty(n)&&!(n in t)&&(t[n]=yS[n]);Bu.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Bu.push(t)},pluginEvent:function(t,n,s){var o=this;this.eventCanceled=!1,s.cancel=function(){o.eventCanceled=!0};var i=t+"Global";Bu.forEach(function(r){n[r.pluginName]&&(n[r.pluginName][i]&&n[r.pluginName][i](ar({sortable:n},s)),n.options[r.pluginName]&&n[r.pluginName][t]&&n[r.pluginName][t](ar({sortable:n},s)))})},initializePlugins:function(t,n,s,o){Bu.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,n,t.options);c.sortable=t,c.options=t.options,t[l]=c,Jr(s,c.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);typeof r<"u"&&(t.options[i]=r)}},getEventProperties:function(t,n){var s={};return Bu.forEach(function(o){typeof o.eventProperties=="function"&&Jr(s,o.eventProperties.call(n[o.pluginName],t))}),s},modifyOption:function(t,n,s){var o;return Bu.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],s))}),o}};function GJ(e){var t=e.sortable,n=e.rootEl,s=e.name,o=e.targetEl,i=e.cloneEl,r=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Ao],!!t){var g,v=t.options,w="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!ea&&!cf?g=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(s,!0,!0)),g.to=r||n,g.from=a||n,g.item=o||n,g.clone=i,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var b=ar(ar({},p),hf.getEventProperties(s,t));for(var S in b)g[S]=b[S];n&&n.dispatchEvent(g),v[w]&&v[w].call(t,g)}}var UJ=["evt"],uo=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.evt,i=AJ(s,UJ);hf.pluginEvent.bind(Lt)(t,n,ar({dragEl:ht,parentEl:Zn,ghostEl:jt,rootEl:$n,nextEl:ec,lastDownEl:jm,cloneEl:Xn,cloneHidden:za,dragStarted:pf,putSortable:xs,activeSortable:Lt.active,originalEvent:o,oldIndex:$u,oldDraggableIndex:ff,newIndex:ko,newDraggableIndex:ja,hideGhostForTarget:yO,unhideGhostForTarget:wO,cloneNowHidden:function(){za=!0},cloneNowShown:function(){za=!1},dispatchSortableEvent:function(a){Js({sortable:n,name:a,originalEvent:o})}},i))};function Js(e){GJ(ar({putSortable:xs,cloneEl:Xn,targetEl:ht,rootEl:$n,oldIndex:$u,oldDraggableIndex:ff,newIndex:ko,newDraggableIndex:ja},e))}var ht,Zn,jt,$n,ec,jm,Xn,za,$u,ko,ff,ja,Km,xs,Hu=!1,qm=!1,Ym=[],tc,Ai,wS,CS,hO,fO,pf,Gu,gf,mf=!1,Zm=!1,Xm,$s,bS=[],SS=!1,Jm=[],Qm=typeof document<"u",ev=sO,pO=cf||ea?"cssFloat":"float",WJ=Qm&&!OJ&&!sO&&"draggable"in document.createElement("div"),gO=function(){if(Qm){if(ea)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mO=function(t,n){var s=Nt(t),o=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),i=Vu(t,0,n),r=Vu(t,1,n),a=i&&Nt(i),l=r&&Nt(r),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ws(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ws(r).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=o&&s[pO]==="none"||r&&s[pO]==="none"&&c+u>o)?"vertical":"horizontal"},zJ=function(t,n,s){var o=s?t.left:t.top,i=s?t.right:t.bottom,r=s?t.width:t.height,a=s?n.left:n.top,l=s?n.right:n.bottom,c=s?n.width:n.height;return o===a||i===l||o+r/2===a+c/2},jJ=function(t,n){var s;return Ym.some(function(o){var i=o[Ao].options.emptyInsertThreshold;if(!(!i||mS(o))){var r=ws(o),a=t>=r.left-i&&t<=r.right+i,l=n>=r.top-i&&n<=r.bottom+i;if(a&&l)return s=o}}),s},vO=function(t){function n(i,r){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(i==null&&(r||d))return!0;if(i==null||i===!1)return!1;if(r&&i==="clone")return i;if(typeof i=="function")return n(i(a,l,c,u),r)(a,l,c,u);var h=(r?a:l).options.group.name;return i===!0||typeof i=="string"&&i===h||i.join&&i.indexOf(h)>-1}}var s={},o=t.group;(!o||Wm(o)!="object")&&(o={name:o}),s.name=o.name,s.checkPull=n(o.pull,!0),s.checkPut=n(o.put),s.revertClone=o.revertClone,t.group=s},yO=function(){!gO&&jt&&Nt(jt,"display","none")},wO=function(){!gO&&jt&&Nt(jt,"display","")};Qm&&document.addEventListener("click",function(e){if(qm)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),qm=!1,!1},!0);var nc=function(t){if(ht){t=t.touches?t.touches[0]:t;var n=jJ(t.clientX,t.clientY);if(n){var s={};for(var o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);s.target=s.rootEl=n,s.preventDefault=void 0,s.stopPropagation=void 0,n[Ao]._onDragOver(s)}}},KJ=function(t){ht&&ht.parentNode[Ao]._isOutsideThisEl(t.target)};function Lt(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Jr({},t),e[Ao]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mO(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Lt.supportPointer!==!1&&"PointerEvent"in window&&!uf,emptyInsertThreshold:5};hf.initializePlugins(this,e,n);for(var s in n)!(s in t)&&(t[s]=n[s]);vO(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:WJ,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?vn(e,"pointerdown",this._onTapStart):(vn(e,"mousedown",this._onTapStart),vn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(vn(e,"dragover",this),vn(e,"dragenter",this)),Ym.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Jr(this,BJ())}Lt.prototype={constructor:Lt,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Gu=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,ht):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,s=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=o.filter;if(tQ(s),!ht&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&uf&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=lr(l,o.draggable,s,!1),!(l&&l.animated)&&jm!==l)){if($u=ei(l),ff=ei(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){Js({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:s,fromEl:s}),uo("filter",n,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=lr(c,d.trim(),s,!1),d)return Js({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:s,toEl:s}),uo("filter",n,{evt:t}),!0}),u)){i&&t.cancelable&&t.preventDefault();return}o.handle&&!lr(c,o.handle,s,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,s){var o=this,i=o.el,r=o.options,a=i.ownerDocument,l;if(s&&!ht&&s.parentNode===i){var c=ws(s);if($n=i,ht=s,Zn=ht.parentNode,ec=ht.nextSibling,jm=s,Km=r.group,Lt.dragged=ht,tc={target:ht,clientX:(n||t).clientX,clientY:(n||t).clientY},hO=tc.clientX-c.left,fO=tc.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,ht.style["will-change"]="all",l=function(){if(uo("delayEnded",o,{evt:t}),Lt.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!nO&&o.nativeDraggable&&(ht.draggable=!0),o._triggerDragStart(t,n),Js({sortable:o,name:"choose",originalEvent:t}),Po(ht,r.chosenClass,!0)},r.ignore.split(",").forEach(function(u){rO(ht,u.trim(),ES)}),vn(a,"dragover",nc),vn(a,"mousemove",nc),vn(a,"touchmove",nc),vn(a,"mouseup",o._onDrop),vn(a,"touchend",o._onDrop),vn(a,"touchcancel",o._onDrop),nO&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ht.draggable=!0),uo("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(cf||ea))){if(Lt.eventCanceled){this._onDrop();return}vn(a,"mouseup",o._disableDelayedDrag),vn(a,"touchend",o._disableDelayedDrag),vn(a,"touchcancel",o._disableDelayedDrag),vn(a,"mousemove",o._delayedDragTouchMoveHandler),vn(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&vn(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ht&&ES(ht),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;dn(t,"mouseup",this._disableDelayedDrag),dn(t,"touchend",this._disableDelayedDrag),dn(t,"touchcancel",this._disableDelayedDrag),dn(t,"mousemove",this._delayedDragTouchMoveHandler),dn(t,"touchmove",this._delayedDragTouchMoveHandler),dn(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?vn(document,"pointermove",this._onTouchMove):n?vn(document,"touchmove",this._onTouchMove):vn(document,"mousemove",this._onTouchMove):(vn(ht,"dragend",this),vn($n,"dragstart",this._onDragStart));try{document.selection?nv(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Hu=!1,$n&&ht){uo("dragStarted",this,{evt:n}),this.nativeDraggable&&vn(document,"dragover",KJ);var s=this.options;!t&&Po(ht,s.dragClass,!1),Po(ht,s.ghostClass,!0),Lt.active=this,t&&this._appendGhost(),Js({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Ai){this._lastX=Ai.clientX,this._lastY=Ai.clientY,yO();for(var t=document.elementFromPoint(Ai.clientX,Ai.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ai.clientX,Ai.clientY),t!==n);)n=t;if(ht.parentNode[Ao]._isOutsideThisEl(t),n)do{if(n[Ao]){var s=void 0;if(s=n[Ao]._onDragOver({clientX:Ai.clientX,clientY:Ai.clientY,target:t,rootEl:n}),s&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);wO()}},_onTouchMove:function(t){if(tc){var n=this.options,s=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,r=jt&&Lu(jt,!0),a=jt&&r&&r.a,l=jt&&r&&r.d,c=ev&&$s&&lO($s),u=(i.clientX-tc.clientX+o.x)/(a||1)+(c?c[0]-bS[0]:0)/(a||1),d=(i.clientY-tc.clientY+o.y)/(l||1)+(c?c[1]-bS[1]:0)/(l||1);if(!Lt.active&&!Hu){if(s&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(jt){r?(r.e+=u-(wS||0),r.f+=d-(CS||0)):r={a:1,b:0,c:0,d:1,e:u,f:d};var h="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Nt(jt,"webkitTransform",h),Nt(jt,"mozTransform",h),Nt(jt,"msTransform",h),Nt(jt,"transform",h),wS=u,CS=d,Ai=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!jt){var t=this.options.fallbackOnBody?document.body:$n,n=ws(ht,!0,ev,!0,t),s=this.options;if(ev){for($s=t;Nt($s,"position")==="static"&&Nt($s,"transform")==="none"&&$s!==document;)$s=$s.parentNode;$s!==document.body&&$s!==document.documentElement?($s===document&&($s=cr()),n.top+=$s.scrollTop,n.left+=$s.scrollLeft):$s=cr(),bS=lO($s)}jt=ht.cloneNode(!0),Po(jt,s.ghostClass,!1),Po(jt,s.fallbackClass,!0),Po(jt,s.dragClass,!0),Nt(jt,"transition",""),Nt(jt,"transform",""),Nt(jt,"box-sizing","border-box"),Nt(jt,"margin",0),Nt(jt,"top",n.top),Nt(jt,"left",n.left),Nt(jt,"width",n.width),Nt(jt,"height",n.height),Nt(jt,"opacity","0.8"),Nt(jt,"position",ev?"absolute":"fixed"),Nt(jt,"zIndex","100000"),Nt(jt,"pointerEvents","none"),Lt.ghost=jt,t.appendChild(jt),Nt(jt,"transform-origin",hO/parseInt(jt.style.width)*100+"% "+fO/parseInt(jt.style.height)*100+"%")}},_onDragStart:function(t,n){var s=this,o=t.dataTransfer,i=s.options;if(uo("dragStart",this,{evt:t}),Lt.eventCanceled){this._onDrop();return}uo("setupClone",this),Lt.eventCanceled||(Xn=dO(ht),Xn.draggable=!1,Xn.style["will-change"]="",this._hideClone(),Po(Xn,this.options.chosenClass,!1),Lt.clone=Xn),s.cloneId=nv(function(){uo("clone",s),!Lt.eventCanceled&&(s.options.removeCloneOnHide||$n.insertBefore(Xn,ht),s._hideClone(),Js({sortable:s,name:"clone"}))}),!n&&Po(ht,i.dragClass,!0),n?(qm=!0,s._loopId=setInterval(s._emulateDragOver,50)):(dn(document,"mouseup",s._onDrop),dn(document,"touchend",s._onDrop),dn(document,"touchcancel",s._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(s,o,ht)),vn(document,"drop",s),Nt(ht,"transform","translateZ(0)")),Hu=!0,s._dragStartId=nv(s._dragStarted.bind(s,n,t)),vn(document,"selectstart",s),pf=!0,uf&&Nt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,s=t.target,o,i,r,a=this.options,l=a.group,c=Lt.active,u=Km===l,d=a.sort,h=xs||c,f,p=this,g=!1;if(SS)return;function v(ee,$){uo(ee,p,ar({evt:t,isOwner:u,axis:f?"vertical":"horizontal",revert:r,dragRect:o,targetRect:i,canSort:d,fromSortable:h,target:s,completed:b,onMove:function(q,P){return tv($n,n,ht,o,q,ws(q),t,P)},changed:S},$))}function w(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function b(ee){return v("dragOverCompleted",{insertion:ee}),ee&&(u?c._hideClone():c._showClone(p),p!==h&&(Po(ht,xs?xs.options.ghostClass:c.options.ghostClass,!1),Po(ht,a.ghostClass,!0)),xs!==p&&p!==Lt.active?xs=p:p===Lt.active&&xs&&(xs=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===ht&&!ht.animated||s===n&&!s.animated)&&(Gu=null),!a.dragoverBubble&&!t.rootEl&&s!==document&&(ht.parentNode[Ao]._isOutsideThisEl(t.target),!ee&&nc(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function S(){ko=ei(ht),ja=ei(ht,a.draggable),Js({sortable:p,name:"change",toEl:n,newIndex:ko,newDraggableIndex:ja,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=lr(s,a.draggable,n,!0),v("dragOver"),Lt.eventCanceled)return g;if(ht.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return b(!1);if(qm=!1,c&&!a.disabled&&(u?d||(r=Zn!==$n):xs===this||(this.lastPutMode=Km.checkPull(this,c,ht,t))&&l.checkPut(this,c,ht,t))){if(f=this._getDirection(t,s)==="vertical",o=ws(ht),v("dragOverValid"),Lt.eventCanceled)return g;if(r)return Zn=$n,w(),this._hideClone(),v("revert"),Lt.eventCanceled||(ec?$n.insertBefore(ht,ec):$n.appendChild(ht)),b(!0);var C=mS(n,a.draggable);if(!C||XJ(t,f,this)&&!C.animated){if(C===ht)return b(!1);if(C&&n===t.target&&(s=C),s&&(i=ws(s)),tv($n,n,ht,o,s,i,t,!!s)!==!1)return w(),n.appendChild(ht),Zn=n,S(),b(!0)}else if(C&&ZJ(t,f,this)){var E=Vu(n,0,a,!0);if(E===ht)return b(!1);if(s=E,i=ws(s),tv($n,n,ht,o,s,i,t,!1)!==!1)return w(),n.insertBefore(ht,E),Zn=n,S(),b(!0)}else if(s.parentNode===n){i=ws(s);var R=0,T,A=ht.parentNode!==n,k=!zJ(ht.animated&&ht.toRect||o,s.animated&&s.toRect||i,f),I=f?"top":"left",D=aO(s,"top","top")||aO(ht,"top","top"),x=D?D.scrollTop:void 0;Gu!==s&&(T=i[I],mf=!1,Zm=!k&&a.invertSwap||A),R=JJ(t,s,i,f,k?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Zm,Gu===s);var O;if(R!==0){var H=ei(ht);do H-=R,O=Zn.children[H];while(O&&(Nt(O,"display")==="none"||O===jt))}if(R===0||O===s)return b(!1);Gu=s,gf=R;var L=s.nextElementSibling,j=!1;j=R===1;var te=tv($n,n,ht,o,s,i,t,j);if(te!==!1)return(te===1||te===-1)&&(j=te===1),SS=!0,setTimeout(YJ,30),w(),j&&!L?n.appendChild(ht):s.parentNode.insertBefore(ht,j?L:s),D&&uO(D,0,x-D.scrollTop),Zn=ht.parentNode,T!==void 0&&!Zm&&(Xm=Math.abs(T-ws(s)[I])),S(),b(!0)}if(n.contains(ht))return b(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){dn(document,"mousemove",this._onTouchMove),dn(document,"touchmove",this._onTouchMove),dn(document,"pointermove",this._onTouchMove),dn(document,"dragover",nc),dn(document,"mousemove",nc),dn(document,"touchmove",nc)},_offUpEvents:function(){var t=this.el.ownerDocument;dn(t,"mouseup",this._onDrop),dn(t,"touchend",this._onDrop),dn(t,"pointerup",this._onDrop),dn(t,"touchcancel",this._onDrop),dn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,s=this.options;if(ko=ei(ht),ja=ei(ht,s.draggable),uo("drop",this,{evt:t}),Zn=ht&&ht.parentNode,ko=ei(ht),ja=ei(ht,s.draggable),Lt.eventCanceled){this._nulling();return}Hu=!1,Zm=!1,mf=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),_S(this.cloneId),_S(this._dragStartId),this.nativeDraggable&&(dn(document,"drop",this),dn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),uf&&Nt(document.body,"user-select",""),Nt(ht,"transform",""),t&&(pf&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),jt&&jt.parentNode&&jt.parentNode.removeChild(jt),($n===Zn||xs&&xs.lastPutMode!=="clone")&&Xn&&Xn.parentNode&&Xn.parentNode.removeChild(Xn),ht&&(this.nativeDraggable&&dn(ht,"dragend",this),ES(ht),ht.style["will-change"]="",pf&&!Hu&&Po(ht,xs?xs.options.ghostClass:this.options.ghostClass,!1),Po(ht,this.options.chosenClass,!1),Js({sortable:this,name:"unchoose",toEl:Zn,newIndex:null,newDraggableIndex:null,originalEvent:t}),$n!==Zn?(ko>=0&&(Js({rootEl:Zn,name:"add",toEl:Zn,fromEl:$n,originalEvent:t}),Js({sortable:this,name:"remove",toEl:Zn,originalEvent:t}),Js({rootEl:Zn,name:"sort",toEl:Zn,fromEl:$n,originalEvent:t}),Js({sortable:this,name:"sort",toEl:Zn,originalEvent:t})),xs&&xs.save()):ko!==$u&&ko>=0&&(Js({sortable:this,name:"update",toEl:Zn,originalEvent:t}),Js({sortable:this,name:"sort",toEl:Zn,originalEvent:t})),Lt.active&&((ko==null||ko===-1)&&(ko=$u,ja=ff),Js({sortable:this,name:"end",toEl:Zn,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){uo("nulling",this),$n=ht=Zn=jt=ec=Xn=jm=za=tc=Ai=pf=ko=ja=$u=ff=Gu=gf=xs=Km=Lt.dragged=Lt.ghost=Lt.clone=Lt.active=null,Jm.forEach(function(t){t.checked=!0}),Jm.length=wS=CS=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ht&&(this._onDragOver(t),qJ(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,s=this.el.children,o=0,i=s.length,r=this.options;o<i;o++)n=s[o],lr(n,r.draggable,this.el,!1)&&t.push(n.getAttribute(r.dataIdAttr)||eQ(n));return t},sort:function(t,n){var s={},o=this.el;this.toArray().forEach(function(i,r){var a=o.children[r];lr(a,this.options.draggable,o,!1)&&(s[i]=a)},this),n&&this.captureAnimationState(),t.forEach(function(i){s[i]&&(o.removeChild(s[i]),o.appendChild(s[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return lr(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var s=this.options;if(n===void 0)return s[t];var o=hf.modifyOption(this,t,n);typeof o<"u"?s[t]=o:s[t]=n,t==="group"&&vO(s)},destroy:function(){uo("destroy",this);var t=this.el;t[Ao]=null,dn(t,"mousedown",this._onTapStart),dn(t,"touchstart",this._onTapStart),dn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(dn(t,"dragover",this),dn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ym.splice(Ym.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!za){if(uo("hideClone",this),Lt.eventCanceled)return;Nt(Xn,"display","none"),this.options.removeCloneOnHide&&Xn.parentNode&&Xn.parentNode.removeChild(Xn),za=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(za){if(uo("showClone",this),Lt.eventCanceled)return;ht.parentNode==$n&&!this.options.group.revertClone?$n.insertBefore(Xn,ht):ec?$n.insertBefore(Xn,ec):$n.appendChild(Xn),this.options.group.revertClone&&this.animate(ht,Xn),Nt(Xn,"display",""),za=!1}}};function qJ(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function tv(e,t,n,s,o,i,r,a){var l,c=e[Ao],u=c.options.onMove,d;return window.CustomEvent&&!ea&&!cf?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=s,l.related=o||t,l.relatedRect=i||ws(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),u&&(d=u.call(c,l,r)),d}function ES(e){e.draggable=!1}function YJ(){SS=!1}function ZJ(e,t,n){var s=ws(Vu(n.el,0,n.options,!0)),o=10;return t?e.clientX<s.left-o||e.clientY<s.top&&e.clientX<s.right:e.clientY<s.top-o||e.clientY<s.bottom&&e.clientX<s.left}function XJ(e,t,n){var s=ws(mS(n.el,n.options.draggable)),o=10;return t?e.clientX>s.right+o||e.clientX<=s.right&&e.clientY>s.bottom&&e.clientX>=s.left:e.clientX>s.right&&e.clientY>s.top||e.clientX<=s.right&&e.clientY>s.bottom+o}function JJ(e,t,n,s,o,i,r,a){var l=s?e.clientY:e.clientX,c=s?n.height:n.width,u=s?n.top:n.left,d=s?n.bottom:n.right,h=!1;if(!r){if(a&&Xm<c*o){if(!mf&&(gf===1?l>u+c*i/2:l<d-c*i/2)&&(mf=!0),mf)h=!0;else if(gf===1?l<u+Xm:l>d-Xm)return-gf}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return QJ(t)}return h=h||r,h&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function QJ(e){return ei(ht)<ei(e)?1:-1}function eQ(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,s=0;n--;)s+=t.charCodeAt(n);return s.toString(36)}function tQ(e){Jm.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var s=t[n];s.checked&&Jm.push(s)}}function nv(e){return setTimeout(e,0)}function _S(e){return clearTimeout(e)}Qm&&vn(document,"touchmove",function(e){(Lt.active||Hu)&&e.cancelable&&e.preventDefault()}),Lt.utils={on:vn,off:dn,css:Nt,find:rO,is:function(t,n){return!!lr(t,n,t,!1)},extend:LJ,throttle:cO,closest:lr,toggleClass:Po,clone:dO,index:ei,nextTick:nv,cancelNextTick:_S,detectDirection:mO,getChild:Vu},Lt.get=function(e){return e[Ao]},Lt.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&(Lt.utils=ar(ar({},Lt.utils),s.utils)),hf.mount(s)})},Lt.create=function(e,t){return new Lt(e,t)},Lt.version=kJ;var ds=[],vf,RS,DS=!1,TS,xS,sv,yf;function nQ(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var s=n.originalEvent;this.sortable.nativeDraggable?vn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?vn(document,"pointermove",this._handleFallbackAutoScroll):s.touches?vn(document,"touchmove",this._handleFallbackAutoScroll):vn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var s=n.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?dn(document,"dragover",this._handleAutoScroll):(dn(document,"pointermove",this._handleFallbackAutoScroll),dn(document,"touchmove",this._handleFallbackAutoScroll),dn(document,"mousemove",this._handleFallbackAutoScroll)),CO(),ov(),VJ()},nulling:function(){sv=RS=vf=DS=yf=TS=xS=null,ds.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,s){var o=this,i=(n.touches?n.touches[0]:n).clientX,r=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(i,r);if(sv=n,s||this.options.forceAutoScrollFallback||cf||ea||uf){IS(n,this.options,a,s);var l=Wa(a,!0);DS&&(!yf||i!==TS||r!==xS)&&(yf&&CO(),yf=setInterval(function(){var c=Wa(document.elementFromPoint(i,r),!0);c!==l&&(l=c,ov()),IS(n,o.options,c,s)},10),TS=i,xS=r)}else{if(!this.options.bubbleScroll||Wa(a,!0)===cr()){ov();return}IS(n,this.options,Wa(a,!1),!1)}}},Jr(e,{pluginName:"scroll",initializeByDefault:!0})}function ov(){ds.forEach(function(e){clearInterval(e.pid)}),ds=[]}function CO(){clearInterval(yf)}var IS=cO(function(e,t,n,s){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,a=t.scrollSpeed,l=cr(),c=!1,u;RS!==n&&(RS=n,ov(),vf=t.scroll,u=t.scrollFn,vf===!0&&(vf=Wa(n,!0)));var d=0,h=vf;do{var f=h,p=ws(f),g=p.top,v=p.bottom,w=p.left,b=p.right,S=p.width,C=p.height,E=void 0,R=void 0,T=f.scrollWidth,A=f.scrollHeight,k=Nt(f),I=f.scrollLeft,D=f.scrollTop;f===l?(E=S<T&&(k.overflowX==="auto"||k.overflowX==="scroll"||k.overflowX==="visible"),R=C<A&&(k.overflowY==="auto"||k.overflowY==="scroll"||k.overflowY==="visible")):(E=S<T&&(k.overflowX==="auto"||k.overflowX==="scroll"),R=C<A&&(k.overflowY==="auto"||k.overflowY==="scroll"));var x=E&&(Math.abs(b-o)<=r&&I+S<T)-(Math.abs(w-o)<=r&&!!I),O=R&&(Math.abs(v-i)<=r&&D+C<A)-(Math.abs(g-i)<=r&&!!D);if(!ds[d])for(var H=0;H<=d;H++)ds[H]||(ds[H]={});(ds[d].vx!=x||ds[d].vy!=O||ds[d].el!==f)&&(ds[d].el=f,ds[d].vx=x,ds[d].vy=O,clearInterval(ds[d].pid),(x!=0||O!=0)&&(c=!0,ds[d].pid=setInterval((function(){s&&this.layer===0&&Lt.active._onTouchMove(sv);var L=ds[this.layer].vy?ds[this.layer].vy*a:0,j=ds[this.layer].vx?ds[this.layer].vx*a:0;typeof u=="function"&&u.call(Lt.dragged.parentNode[Ao],j,L,e,sv,ds[this.layer].el)!=="continue"||uO(ds[this.layer].el,j,L)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=Wa(h,!1)));DS=c}},30),bO=function(t){var n=t.originalEvent,s=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var c=s||i;a();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:s}))}};function FS(){}FS.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var o=Vu(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),s&&s.animateAll()},drop:bO},Jr(FS,{pluginName:"revertOnSpill"});function PS(){}PS.prototype={onSpill:function(t){var n=t.dragEl,s=t.putSortable,o=s||this.sortable;o.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),o.animateAll()},drop:bO},Jr(PS,{pluginName:"removeOnSpill"}),Lt.mount(new nQ),Lt.mount(PS,FS);function sQ(e,t){return Object.values(e).indexOf(t)}function oQ(e,t,n,s){if(!e)return[];const o=Object.values(e),i=t.length-s;return[...t].map((a,l)=>l>=i?o.length:o.indexOf(a))}function iQ(e){return["transition-group","TransitionGroup"].includes(e)}function SO(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?iQ(t.name):!1}function rQ(e,t){return t?{...t.props,...t.attrs}:e}const AS=["Start","Add","Remove","Update","End"],kS=["Choose","Unchoose","Sort","Filter","Clone"],aQ=["Move",...AS,...kS].map(e=>"on"+e);let OS=null;const lQ=it({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...AS.map(e=>e.toLowerCase()),...kS.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:s}){const o=V(!1),i=V(!1),r=V(0),a=V(0),l=V([]),c=V(null),u=V(null),d=Z(()=>e.list?e.list:e.modelValue),h=bs();function f(){return e.component?CH(e.component):e.tag}function p(N){if(u.value)for(const ne in N){const ce=Qk(ne);aQ.indexOf(ce)===-1&&u.value.option(ce,N[ne])}}function g(){var N;return((N=h==null?void 0:h.proxy)==null?void 0:N.$el.children)||[]}async function v(){var N;await Et(),l.value=oQ(g(),((N=h==null?void 0:h.proxy)==null?void 0:N.$el.children)||[],o.value,a.value)}function w(N){const ne=sQ(g()||[],N);if(ne===-1)return null;const ce=d.value?d.value[ne]:null;return{index:ne,element:ce}}function b(N){Et(()=>t("change",N))}function S(N){if(e.list){N(e.list);return}const ne=[...e.modelValue||[]];N(ne),t("update:modelValue",ne)}function C(...N){S(ce=>ce.splice(...N))}function E(N,ne){S(Ie=>Ie.splice(ne,0,Ie.splice(N,1)[0]))}function R(N){const ne=l.value,ce=ne.length;return N>ce-1?ce:ne[N]}function T(){var ne,ce;return n.default&&((ce=(ne=n.default()[0])==null?void 0:ne.component)==null?void 0:ce.proxy)||null}function A(N){if(!e.noTransitionOnDrag||!o.value)return;const ne=g();ne[N]&&(ne[N].data=null);const ce=T();ce&&(ce.children=[],ce.kept=void 0)}function k(N){v(),c.value=w(N.item),c.value&&(N.item._underlying_vm_=e.clone(c.value.element),OS=N.item)}function I(N){const ne=N.item._underlying_vm_;if(ne===void 0)return;gS(N.item);const ce=R(N.newIndex);C(ce,0,ne),v(),b({added:{element:ne,newIndex:ce}})}function D(N){var ce;if(eO((ce=h==null?void 0:h.proxy)==null?void 0:ce.$el,N.item,N.oldIndex),N.pullMode==="clone"){gS(N.clone);return}if(!c.value)return;const ne=c.value.index;C(ne,1),A(ne),b({removed:{element:c.value.element,oldIndex:ne}})}function x(N){var Ie,ge;gS(N.item),eO(N.from,N.item,N.oldIndex);const ne=(Ie=c.value)==null?void 0:Ie.index,ce=R(N.newIndex);E(ne,ce),b({moved:{element:(ge=c.value)==null?void 0:ge.element,oldIndex:ne,newIndex:ce}})}function O(N,ne){Object.prototype.hasOwnProperty.call(N,ne)&&(N[ne]+=r.value)}function H(N){return N.__draggable_component__}function L({to:N,related:ne}){const ce=H(N);if(!ce)return{component:ce};const Ie=ce.realList,ge={list:Ie,component:ce};if(N!==ne&&Ie&&ce.getUnderlyingVm){const ue=ce.getUnderlyingVm(ne);if(ue)return Object.assign(ue,ge)}return ge}function j(N,ne){const ce=[...ne.to.children].filter(X=>X.style.display!=="none");if(ce.length===0)return 0;const Ie=ce.indexOf(ne.related),ge=N.component.getVmIndex(Ie);return ce.indexOf(OS)!==-1||!ne.willInsertAfter?ge:ge+1}const te=()=>{var ge,ue;const N={};AS.forEach(X=>{N["on"+X]=$(X)}),kS.forEach(X=>{N["on"+X]=ee.bind(null,X)});const ne=Object.keys(s).reduce((X,_e)=>(X[Qk(_e)]=s[_e],X),{}),ce=Object.assign({},ne,N,{onMove:(X,_e)=>pe(X,_e)});"draggable"in ce||(ce.draggable=">*");const Ie=((ge=h==null?void 0:h.proxy)==null?void 0:ge.$el.nodeType)===1?h.proxy.$el:((ue=h==null?void 0:h.proxy)==null?void 0:ue.$el.parentElement)||null;Ie&&(u.value=new Lt(Ie,ce),Ie.__draggable_component__=h==null?void 0:h.proxy,v())};function ee(N,ne){Et(()=>t(N.toLowerCase(),ne))}function $(N){return ne=>{if(d.value!==null){const ce="onDrag"+N,Ie=P[ce];Ie&&Ie(ne)}ee(N,ne)}}function pe(N,ne){const ce=e.move;if(!ce||!d.value)return!0;const Ie=L(N),ge=c.value,ue=j(Ie,N);ge&&Object.assign(ge,{futureIndex:ue});const X=Object.assign({},N,{relatedContext:Ie,draggedContext:ge});return ce(X,ne)}function q(){v(),OS=null}const P={onDragStart:k,onDragAdd:I,onDragRemove:D,onDragUpdate:x,onDragMove:pe,onDragEnd:q};return Yt(()=>{te()}),e.list!==null&&e.modelValue!==null&&TJ.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:i,headerOffset:r,footerOffset:a,transitionMode:o,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:w,emitChanges:b,alterList:S,spliceList:C,updatePosition:E,getVmIndex:R,getComponent:T,resetTransitionData:A,onDragStart:k,onDragAdd:I,onDragRemove:D,onDragUpdate:x,updateProperty:O,onDragMove:pe,onDragEnd:q,mounted:te,context:c,sortableInstance:u,getRelatedContextFromMoveEvent:L,getTargetedComponent:H,computeFutureIndex:j}},render(){const e=this.getTag(),t=rQ(this.$attrs,this.componentData);if(typeof e=="string"){const s=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return s?(this.transitionMode=SO(s),Gc(e,t,s)):Gc(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const s=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=SO(s||[])}return Gc(e,t,n)}}),cQ=bt(it({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=V([]),s=e,o=t,i=V({}),r=()=>{n.value=s.modelValue.map(c=>({id:c.field,name:c.headerName,...c}))||[],s.modelValue.forEach(c=>{i.value[c.field]={...c}})};Je(()=>s.modelValue,c=>{r()},{immediate:!0,deep:!0}),Je(n,c=>{if(c.length===s.modelValue.length&&!c.every((d,h)=>d.id===s.modelValue[h].field)){const d=c.map(h=>i.value[h.id]);o("changed",d),o("update:modelValue",d)}});const a=()=>!(s.readOnly||s.disabled),l=c=>!(s.readOnly||s.disabled);return(c,u)=>(z(),Ke(W(lQ),{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=d=>n.value=d),tag:"transition-group",disabled:s.disabled||s.readOnly,onMove:l,onStart:a,"item-key":"id","component-data":{tag:"div",type:"transition",name:"fade"},animation:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)","ghost-class":"ghost","chosen-class":"chosen","drag-class":"drag"},{default:ye(()=>[(z(!0),re(xt,null,xn(n.value,(d,h)=>(z(),re("div",{key:d.id,class:"fade-item"},[Tt(c.$slots,"item",{item:d,index:h},()=>[nt(mt(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),uQ={key:0},dQ={key:1,style:{"font-style":"italic"}},hQ={key:2,style:{"font-style":"italic"}},fQ={key:3},iv=bt(it({__name:"DragDropItem",props:{item:{},isDisableNewCheck:{type:Boolean,default:!1},disableDrag:{type:Boolean,default:!1},disableCheckbox:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},columnStates:{},disableDragTooltip:{default:""},focusIndex:{}},emits:["toggle-column"],setup(e,{emit:t}){const n=Zt,s=e,o=V(s.columnStates[String(s.item.field)]||!1),i=t,r=h=>{o.value=h},a=Z(()=>{var h;return(h=s.item)==null?void 0:h.context}),l=Z(()=>{var f,p,g;return(f=a.value)!=null&&f.formula?"formular":((g=(p=a.value)==null?void 0:p.metric_type)==null?void 0:g.code)||"number"}),c=Z(()=>{var h,f;return(f=(h=s.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),u=Z(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=Z(()=>{var h;return c.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return Je(()=>o.value,()=>{i("toggle-column",s.item.field,s.item.required)}),(h,f)=>(z(),re("div",{key:e.item.field,class:Q([h.$style["column-config__item"],{[h.$style.disabled]:s.readOnly,[h.$style["is-metric"]]:c.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:u.value}])},[fe(Bk,{focusIndex:s.focusIndex,id:`col-${e.item.field}`,"model-value":o.value==!0?W($t).CHECKED:W($t).UNCHECK,"onUpdate:modelValue":r,disabled:s.disableCheckbox||e.isDisableNewCheck&&!o.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),We((z(),re("div",{class:"move-handler",style:ln({cursor:s.disableDrag?"not-allowed":"move"})},[fe(at,{color:s.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:Q(h.$style.handler)},null,8,["color","class"])],4)),[[W(n),s.disableDrag==!0?s.disableDragTooltip:""]]),c.value?(z(),re("div",{key:0,class:Q(h.$style["metric-type"])},[l.value=="rating"?(z(),re("span",uQ,"★")):l.value=="formular"?(z(),re("span",dQ," ƒx ")):l.value=="number"?(z(),re("span",hQ," # ")):(z(),re("span",fQ,mt(l.value),1))],2)):Ye("",!0),be("span",{class:Q(h.$style["column-config__item-label"])},[We((z(),re("div",null,[nt(mt(e.item.headerName),1)])),[[W(n),{content:e.item.headerName}]])],2),d.value?We((z(),re("div",{key:1,class:Q(h.$style["metric-icon"])},[fe(at,{src:"Bullseye",color:"#A6A6A6"})],2)),[[W(n),"Point metric"]]):Ye("",!0),u.value?We((z(),re("div",{key:2,class:Q(h.$style["metric-icon"])},[fe(at,{src:"ChartPie",color:"#A6A6A6"})],2)),[[W(n),"Woohoo metric"]]):Ye("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_7scp0_1","is-metric":"_is-metric_7scp0_8","is-woohoo-metric":"_is-woohoo-metric_7scp0_12","is-point-metric":"_is-point-metric_7scp0_15","column-config__item-label":"_column-config__item-label_7scp0_18",disabled:"_disabled_7scp0_34",readOnly:"_readOnly_7scp0_38","column-config__item--pinned":"_column-config__item--pinned_7scp0_41",handler:"_handler_7scp0_48",badge:"_badge_7scp0_52","metric-type":"_metric-type_7scp0_78","metric-icon":"_metric-icon_7scp0_106"}}]]),pQ={class:"reach-limit-icon"},gQ=bt(it({__name:"TableCustomization",props:{modelValue:{},readOnly:{type:Boolean},disabled:{type:Boolean},checkboxColumn:{},gridApi:{},tableHeight:{}},emits:["update:modelValue","input","change"],setup(e,{expose:t,emit:n}){const s=Zt,o=e,i=n,r=V(""),a=V(),l=Z(()=>r.value.trim().length>0),c=V([]),u=V({}),{triggerRef:d,popupRef:h,isVisible:f,hide:p}=us({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});Je(f,O=>{var H;O&&((H=a.value)==null||H.focus())});const g=Z(()=>o.disabled||r.value.length>0),v=Z(()=>c.value.filter(O=>O.pinned==="left"&&O.field&&O.headerName)),w=Z(()=>c.value.filter(O=>O.pinned==="right"&&O.field||O.field==="blank")),b=Z({get:()=>c.value.filter(O=>!O.pinned&&O.field&&O.field!=="blank"),set:O=>{c.value=[...v.value,...O,...w.value]}}),S=Z(()=>{if(!r.value)return{};const O=r.value.toLowerCase();return[...c.value,...b.value].reduce((H,L)=>{var j;return(j=L.headerName)!=null&&j.toLowerCase().includes(O)&&L.field&&(H[L.field]=!0),H},{})}),C=Z(()=>o.modelValue),E=()=>{const O={};c.value.forEach(H=>{H.field&&(O[H.field]=!H.hide)}),u.value=O},R=Z(()=>{if(!r.value)return c.value;const O=r.value.toLowerCase();return c.value.filter(H=>{var L;return(L=H.headerName)==null?void 0:L.toLowerCase().includes(O)})}),T=()=>{var L;const O=(L=o.gridApi)==null?void 0:L.getColumnState().reduce((j,te)=>(j[te.colId]=Number(te.width),j),{}),H=c.value.map(j=>({...j,hide:j.field?!u.value[j.field]:!1,width:j.field?O==null?void 0:O[j.field]:j.width}));i("update:modelValue",H),i("change",H),i("input",H)},A=O=>{const H=[...v.value,...O,...w.value];o.checkboxColumn&&H.unshift(o.checkboxColumn),c.value=H,T()},k=O=>{O&&(u.value[O]=!u.value[O],T())};Je(C,O=>{O&&O.length>0&&(c.value=[...O],E())},{immediate:!0}),t({updateColumnDefs(O){c.value=[...O],E()}});const I=Z(()=>x.value>=5),D=Z(()=>o.disabled||r.value.length>0),x=Z(()=>c.value.reduce((O,H)=>H.field&&H.field.includes("metric")&&u.value[H.field]===!0?O+1:O,0));return(O,H)=>{const L=oo("focusable");return z(),re("div",{class:Q(O.$style["table-customization"])},[be("div",{ref_key:"triggerRef",ref:d},[Tt(O.$slots,"trigger",{},()=>[We((z(),Ke(gt,{variant:["secondary"],disabled:o.disabled,actived:W(f),style:{width:"32px"},onEscape:W(p)},{prefix:ye(()=>[fe(at,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[L,"7"],[W(s),"Columns"]])])],512),be("div",{ref_key:"popupRef",ref:h,class:Q(O.$style["tippy-content-wrapper"])},[be("div",{class:Q([O.$style["column-config"],I.value?O.$style["has-warning"]:""]),style:ln({"--max-height":o.tableHeight?o.tableHeight:"max(500px, 60vh)"})},[fe(Zb,{tabIndex:"7.0",modelValue:r.value,"onUpdate:modelValue":H[0]||(H[0]=j=>r.value=j),ref_key:"searchBoxRef",ref:a},null,8,["modelValue"]),be("div",{class:Q(O.$style["column-config__header"])},[...H[2]||(H[2]=[be("span",null,"Manage columns",-1)])],2),I.value?(z(),re("div",{key:0,class:Q(O.$style["reach-limit"])},[be("div",pQ,[fe(at,{src:"InfoCircle",color:"#F7941D",size:14})]),be("div",{class:Q(O.$style["warning-limit-text"])},[...H[3]||(H[3]=[nt(" You’ve reached the maximum number of metric columns. ",-1),be("br",null,null,-1),nt(" Deselect one to show another. ",-1)])],2)],2)):Ye("",!0),l.value?(z(),re(xt,{key:1},[R.value.length===0&&l.value?(z(),re("div",{key:0,class:Q(O.$style["no-columns"])},[...H[4]||(H[4]=[nt(" No results. ",-1),be("br",null,null,-1),nt(" Try another search. ",-1)])],2)):Ye("",!0),l.value&&R.value.length>0?(z(),re("div",{key:1,class:Q(O.$style["column-config__pinned-section"])},[(z(!0),re(xt,null,xn(R.value,j=>{var te;return z(),Ke(iv,{key:j.colId,item:j,columnStates:u.value,disableDrag:D.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:o.readOnly,isDisableNewCheck:I.value&&((te=j.colId)==null?void 0:te.includes("metric")),onToggleColumn:k},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Ye("",!0)],64)):Ye("",!0),l.value?Ye("",!0):(z(),re("div",{key:2,class:Q(O.$style["column-config__list"])},[(z(!0),re(xt,null,xn(v.value,j=>We((z(),Ke(iv,{key:j.field,item:j,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:u.value},null,8,["item","columnStates"])),[[Ei,S.value[j.field]||!r.value]])),128)),fe(cQ,{modelValue:b.value,"onUpdate:modelValue":H[1]||(H[1]=j=>b.value=j),"group-name":"columns",onChanged:A,disabled:g.value,readOnly:o.readOnly},{item:ye(({item:j,index:te})=>[We((z(),Ke(iv,{focusIndex:`7.${te+1}`,key:j.id,item:j,columnStates:u.value,disableDrag:D.value,disableDragTooltip:D.value?"Reordering is disabled while search is active.":void 0,readOnly:o.readOnly,isDisableNewCheck:I.value&&j.id.includes("metric"),onToggleColumn:k},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[Ei,S.value[j.field]||!r.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(z(!0),re(xt,null,xn(w.value.filter(j=>{var te;return j.headerName&&((te=j.headerName)==null?void 0:te.length)>0}),j=>We((z(),Ke(iv,{key:j.field,item:j,disabled:o.disabled,readOnly:o.readOnly,columnStates:u.value},null,8,["item","disabled","readOnly","columnStates"])),[[Ei,S.value[j.field]||!r.value]])),128))],2))],6)],2)],2)}}}),[["__cssModules",{$style:{"reach-limit":"_reach-limit_1m3bt_1","reach-limit-icon":"_reach-limit-icon_1m3bt_11","warning-limit-text":"_warning-limit-text_1m3bt_18","table-customization":"_table-customization_1m3bt_24","table-customization__trigger":"_table-customization__trigger_1m3bt_30","column-config":"_column-config_1m3bt_46","has-warning":"_has-warning_1m3bt_61","column-config__header":"_column-config__header_1m3bt_64","icon-color":"_icon-color_1m3bt_73","column-config__list":"_column-config__list_1m3bt_76","column-config__section-label":"_column-config__section-label_1m3bt_80","column-config__footer":"_column-config__footer_1m3bt_89","column-config__add-button":"_column-config__add-button_1m3bt_92","cs-icon":"_cs-icon_1m3bt_110","no-columns":"_no-columns_1m3bt_114"}}]]),mQ=["aria-label"],vQ=["aria-disabled","onClick"],yQ=bt(it({__name:"MonthSelection",props:{monthLabels:{default:()=>["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},ariaLabel:{default:"Select month"},selectedYear:{default:null},selectedMonth:{default:null},displayYear:{default:null},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},isMonthSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{emit:t}){const n=e,s=t,o=a=>{n.disabled||n.readOnly||!n.isMonthSelectable(a)||s("select",a)},i=new Date().getFullYear(),r=new Date().getMonth()+1;return(a,l)=>(z(),re("div",{class:Q([a.$style["month-grid"],n.compact?a.$style.compact:""]),"aria-label":n.ariaLabel,"data-index":"month-selection"},[be("div",{class:Q(a.$style.months)},[(z(!0),re(xt,null,xn(n.monthLabels,(c,u)=>(z(),re("a",{key:c,tabindex:"0",class:Q([a.$style["month-cell"],{[a.$style.selected]:u+1===n.selectedMonth&&n.selectedYear===n.displayYear,[a.$style.current]:u+1===r&&W(i)===n.displayYear,[a.$style.disabled]:n.disabled||n.readOnly||!n.isMonthSelectable(u+1)}]),"aria-disabled":n.disabled||n.readOnly||!n.isMonthSelectable(u+1),onClick:d=>o(u+1),onKeydown:l[0]||(l[0]=d=>s("keydown",d))},mt(c),43,vQ))),128))],2)],10,mQ))}}),[["__cssModules",{$style:{"month-grid":"_month-grid_a776x_1",months:"_months_a776x_8","month-cell":"_month-cell_a776x_22",selected:"_selected_a776x_36",compact:"_compact_a776x_40",current:"_current_a776x_53",disabled:"_disabled_a776x_61"}}]]),wQ=["data-year","aria-disabled","onClick"],CQ=bt(it({__name:"YearSelection",props:{years:{},selectedYear:{default:null},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},isYearSelectable:{type:Function,default:()=>!0}},emits:["select","keydown"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=V(null),r=new Date().getFullYear(),a=l=>{s.disabled||!s.isYearSelectable(l)||o("select",l)};return t({rootEl:i}),Yt(()=>{if(i.value){const l=i.value.querySelector(`[data-year="${s.selectedYear}"]`);l&&l.scrollIntoView({block:"center"})}}),(l,c)=>(z(),re("div",{ref_key:"rootEl",ref:i,class:Q([l.$style["year-grid-body"],s.scrollable?l.$style.scrollable:"",s.compact?l.$style.compact:""]),role:"grid","data-index":"year-selection"},[(z(!0),re(xt,null,xn(s.years,u=>(z(),re("a",{key:u,"data-year":u,tabindex:"0",class:Q([l.$style["year-cell"],{[l.$style.selected]:u===s.selectedYear,[l.$style.current]:u===W(r),[l.$style.disabled]:s.disabled||!s.isYearSelectable(u)}]),"aria-disabled":s.disabled||!s.isYearSelectable(u),onClick:d=>a(u),onKeydown:c[0]||(c[0]=d=>o("keydown",d))},mt(u),43,wQ))),128))],2))}}),[["__cssModules",{$style:{"year-grid-body":"_year-grid-body_1us7k_1",scrollable:"_scrollable_1us7k_11","year-cell":"_year-cell_1us7k_16",selected:"_selected_1us7k_28",current:"_current_1us7k_31",compact:"_compact_1us7k_35",disabled:"_disabled_1us7k_47"}}]]),bQ={class:"navigation"},SQ={class:"picker"},EQ={key:0,class:"footer"},_Q=bt(it({__name:"MonthPickerLayout",props:{disableConfirm:{type:Boolean,default:!1}},setup(e){return(t,n)=>(z(),re("div",{class:Q(["month-picker-layout",{"disable-confirm":e.disableConfirm}])},[be("div",bQ,[Tt(t.$slots,"navigation",{},void 0,!0)]),be("div",SQ,[Tt(t.$slots,"picker",{},void 0,!0)]),fe(jD,{name:"fade",mode:"out-in"},{default:ye(()=>[e.disableConfirm?Ye("",!0):(z(),re("div",EQ,[Tt(t.$slots,"footer",{},void 0,!0)]))]),_:3})],2))}}),[["__scopeId","data-v-885d09b2"]]),RQ={style:{flex:"1"}},DQ=bt(it({__name:"CalendarFooter",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1}},emits:["cancel","confirm","goto-date"],setup(e,{emit:t}){const n=e,s=t,o=()=>{s("cancel")},i=()=>{s("confirm")},r=(l=new Date)=>{s("goto-date")},a=l=>{if(l.key==="Enter"||l.key===" "){l.preventDefault(),l.stopPropagation();const c=l.target;c.dataset.index==="today-btn"?r():c.dataset.index==="cancel-btn"?o():c.dataset.index==="save-btn"&&i()}};return(l,c)=>{const u=oo("tooltip");return n.readOnly?Ye("",!0):(z(),re("div",{key:0,class:Q(l.$style["arbo-calendar-actions"])},[be("div",RQ,[We((z(),Ke(W(gt),{variant:"secondary",size:"medium",onClick:c[0]||(c[0]=d=>r()),onKeydown:a,"data-index":"today-btn"},{prefix:ye(()=>[fe(W(at),{src:"CalendarDay"})]),_:1})),[[u,"Today"]])]),fe(W(gt),{disabled:n.disabled,readOnly:n.readOnly,onKeydown:a,variant:"secondary",size:"medium",onClick:o,"data-index":"cancel-btn"},{default:ye(()=>[nt(mt(n.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),fe(W(gt),{disabled:n.disabled||n.disableConfirm,readOnly:n.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:a,onClick:i},{default:ye(()=>[nt(mt(n.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))}}}),[["__cssModules",{$style:{"arbo-calendar-actions":"_arbo-calendar-actions_132g0_1"}}]]),TQ=bt(it({__name:"CalendarNavigation",props:{disabled:{type:Boolean},readOnly:{type:Boolean},cancelLabel:{default:"Cancel"},confirmLabel:{default:"Save"},disableConfirm:{type:Boolean,default:!1},minDate:{},maxDate:{},monthLabels:{},monthLabelStyle:{},locale:{},month:{},year:{},hideMonth:{type:Boolean,default:!1},mode:{}},emits:["cancel","confirm","goto-date","prev","next","toggle-months","toggle-years"],setup(e,{emit:t}){const n=e,s=wo({month:new Date().getMonth()+1,year:new Date().getFullYear()}),o=Z(()=>{if(n.minDate){const h=s.month===1?12:s.month-1,f=s.month===1?s.year-1:s.year;return new Date(f,h-1,1)<new Date(n.minDate.getFullYear(),n.minDate.getMonth(),1)}return!1}),i=Z(()=>{if(n.maxDate){const h=s.month===12?1:s.month+1,f=s.month===12?s.year+1:s.year;return new Date(f,h-1,1)>new Date(n.maxDate.getFullYear(),n.maxDate.getMonth(),1)}return!1}),r=t,a=()=>{o.value||(n.mode==="month"?s.month=s.month===0?11:s.month-1:n.mode==="year"&&(s.year-=1)),r("prev",{month:s.month,year:s.year})},l=()=>{i.value||(n.mode==="month"?s.month=s.month===11?0:s.month+1:n.mode==="year"&&(s.year+=1)),r("next",{month:s.month,year:s.year})},c=()=>{r("toggle-months")},u=()=>{r("toggle-years")},d=Z(()=>{if(n.monthLabels&&n.monthLabels.length===12)return n.monthLabels;const h=n.locale||"en-US",f=n.monthLabelStyle||"short",p=new Intl.DateTimeFormat(h,{month:f,timeZone:"UTC"});return Array.from({length:12},(v,w)=>p.format(new Date(Date.UTC(2020,w,1))))});return(h,f)=>(z(),re("div",{class:Q(h.$style["cal-nav-bar"])},[e.mode!="year"?(z(),Ke(W(gt),{key:0,variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.prev]),"aria-label":"Previous",disabled:o.value,label:"",onClick:a,"data-index":"prev-btn",onKeydownCapture:Un(Pt(a,["prevent","stop"]),["enter"])},{default:ye(({hovered:p})=>[fe(W(at),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Ye("",!0),be("div",{class:Q([h.$style["cal-nav-center"],e.hideMonth?h.$style.single:""])},[e.hideMonth?Ye("",!0):(z(),Ke(W(gt),{key:0,"data-index":"month-btn",variant:"secondary",onClick:c},{default:ye(()=>[nt(mt(d.value[n.month-1]),1)]),_:1})),fe(W(gt),{variant:"secondary",onClick:u,"data-index":"year-btn"},{default:ye(()=>[nt(mt(n.year),1)]),_:1})],2),e.mode!="year"?(z(),Ke(W(gt),{key:1,"data-index":"next-btn",variant:"tertiary",class:Q([h.$style["cal-nav-btn"],h.$style.next]),"aria-label":"Next",disabled:i.value,label:"",onClick:l,onKeydownCapture:Un(Pt(l,["prevent","stop"]),["enter"])},{default:ye(({hovered:p})=>[fe(W(at),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Ye("",!0)],2))}}),[["__cssModules",{$style:{"cal-nav-wrapper":"_cal-nav-wrapper_beyjg_1","cal-nav-bar":"_cal-nav-bar_beyjg_12","cal-nav-btn":"_cal-nav-btn_beyjg_19",prev:"_prev_beyjg_32","year-grid-header":"_year-grid-header_beyjg_36","cal-nav-center":"_cal-nav-center_beyjg_45",single:"_single_beyjg_52","cal-nav-label":"_cal-nav-label_beyjg_56","year-grid":"_year-grid_beyjg_36",months:"_months_beyjg_78","month-cell":"_month-cell_beyjg_85","year-cell":"_year-cell_beyjg_86","pg-btn":"_pg-btn_beyjg_108","year-grid-body":"_year-grid-body_beyjg_121",selected:"_selected_beyjg_125","days-slot":"_days-slot_beyjg_131","range-label":"_range-label_beyjg_135"}}]]),xQ=["aria-label"];new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const IQ={class:"wrapper-suffix"},FQ=bt(it({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{type:Function},workspaceId:{},id:{}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=Zt,o={PER_PAGE:20,INITIAL_PAGE:1},i=e,r=V(i.modelValue),a=n,l=Z(()=>f.value.find(D=>D.id===r.value)||null),c=D=>{r.value=D.id,a("update:modelValue",D.id)},u=Z(()=>{if(!r.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const D=f.value.find(O=>O.id===r.value),x=String((D==null?void 0:D.color)||"white");return{backgroundColor:x,border:Pg(x,"white")?"1px solid #ccc":"1px solid #fff"}}),d=V(null),h=()=>{var D;(D=d.value)==null||D.focus()},f=V([]),p=V(!1),g=V(!1),v=V(null),w=V(o.INITIAL_PAGE),b=V(!0),S=V(0),C=V(""),E=Z(()=>!!(i.id&&i.workspaceId)),R=D=>{const x=f.value.find(O=>O.id===D.value);x&&c(x)},T=D=>({label:D.name,value:D.id,selected:r.value===D.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:D,id:D.id,color:D.color}),A=async(D=o.INITIAL_PAGE,x="",O=!1)=>{var H;if(!E.value){console.error("Missing required props",i);return}O?g.value=!0:p.value=!0,v.value=null;try{const L={workspaceId:String(i.workspaceId),itemIds:i.id,page:D,perPage:o.PER_PAGE,name_like:x.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const j=await i.getStatusFunc(L);if(!j){O||(f.value=[]),b.value=!1;return}const te=j.data.map(T);f.value=O?[...f.value,...te]:te,S.value=((H=j.meta)==null?void 0:H.total)??j.data.length,b.value=f.value.length<S.value,w.value=D}catch(L){console.error("Error fetching statuses:",L),v.value="Failed to load statuses",O||(f.value=[]),b.value=!1,a("error",v.value)}finally{p.value=!1,g.value=!1}},k=async()=>{!b.value||g.value||await A(w.value+1,C.value,!0)};Je([()=>i.id,()=>i.workspaceId],()=>{A()},{deep:!0,immediate:!0});const I=async D=>{C.value=D,w.value=o.INITIAL_PAGE,await A(o.INITIAL_PAGE,D,!1)};return t({focus:h,clear:()=>{r.value=null,a("update:modelValue",null)}}),(D,x)=>(z(),Ke(Ak,{onOpen:h,placement:"bottom-start","max-width":500},{trigger:ye(({open:O})=>[fe(vs,{actived:O,class:Q(D.$style["status-wrapper"])},{suffix:ye(()=>[be("div",IQ,[fe(at,{src:"ChevronUp",source:"remote",class:Q([[D.$style["dropdown-icon"]],{[D.$style["dropdown-icon-show"]]:!O}])},null,8,["class"])])]),default:ye(()=>{var H;return[be("div",{class:Q(D.$style.status)},[be("div",{class:Q(D.$style["color-indicator"]),style:ln(u.value)},null,6),We((z(),re("span",{style:{"max-width":"400px"},class:Q({[D.$style.empty]:!l.value})},[nt(mt(l.value?l.value.label:"Select status"),1)],2)),[[W(s),{content:((H=l.value)==null?void 0:H.label)||void 0}]])],2)]}),_:2},1032,["actived","class"])]),content:ye(({closeDropdown:O})=>{var H;return[fe(Xr,{ref_key:"popupRef",ref:d,"selected-id":(H=l.value)==null?void 0:H.id,options:f.value,loading:p.value,"loading-more":g.value,"has-more":b.value,error:v.value,onSearch:I,onSelect:L=>{R(L),O()},onLoadMore:k,onCancel:x[0]||(x[0]=L=>a("cancel")),style:{width:"500px"}},null,8,["selected-id","options","loading","loading-more","has-more","error","onSelect"])]}),_:1}))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_1hlgx_1",status:"_status_1hlgx_1","color-indicator":"_color-indicator_1hlgx_12",empty:"_empty_1hlgx_21","dropdown-icon":"_dropdown-icon_1hlgx_25","dropdown-icon-show":"_dropdown-icon-show_1hlgx_30",options:"_options_1hlgx_34"}}]]),EO=e=>({updateCellData:({rowId:n,field:s,value:o})=>{if(!e)return;const i=e.getRowNode(n);i&&i.setDataValue(s,o),e.refreshCells({rowNodes:i?[i]:[],columns:[s],force:!0})}}),PQ={key:2},AQ=bt(it({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var b;const n=e,s=V(n.value),o=V(!0),i=V(""),r=()=>{var I,D,x;const S=(I=u.value)==null?void 0:I.restricted_type.trim(),C=((x=(D=u.value)==null?void 0:D.restricted_value)==null?void 0:x.split(",").map(Number))||[],[E,R]=C,A={range:`Enter a value between ${E} and ${R}`,not:`These values are not allowed: ${C.join(", ")}`,exact:"Value is not allowed"}[S];return o.value?"":A},a=S=>{if(u.value){if(S===null||S===""){o.value=!0;return}if(c.value!=="number"){o.value=!0;return}o.value=im(u.value,Number(S)),i.value=r()}};Z(()=>o.value?{content:"",showOnCreate:!1}:{content:i.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=V(null),c=Z(()=>IF(u.value)),u=Z(()=>{var C,E;return((E=(C=n.params)==null?void 0:C.colDef)==null?void 0:E.context)||null}),{apiServices:d}=Qn(!0,n),{updateCellData:h}=EO((b=n.params)==null?void 0:b.api),f=V(!1),p=wi(n,"id"),g=()=>{var S;(S=n.params)==null||S.api.stopEditing()},v=()=>{g()},w=async S=>{var E,R;if(g(),f.value=!0,s.value=S||null,S===n.value){f.value=!1;return}const C={itemIds:[String(p.value)],metricId:((E=u.value)==null?void 0:E.id)||"",workspaceId:String(n.workspaceId)};S==null?C.clear=1:C.value=S,h({rowId:String(p.value),field:`metric_${C.metricId}`,value:void 0});try{const T=await((R=d.value)==null?void 0:R.bulkUpdateMetric(C));(T==null?void 0:T.message)=="Done"?h({rowId:String(p.value),field:`metric_${C.metricId}`,value:S||null}):(h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value}),console.error("Failed to update metric value:",T),s.value=n.value)}catch(T){console.error("Error during bulk metric update:",T),h({rowId:String(p.value),field:`metric_${C.metricId}`,value:n.value})}finally{f.value=!1}};return(S,C)=>(z(),re("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[c.value=="dropdown"&&u.value?(z(),Ke(HA,{key:0,config:u.value,modelValue:s.value,"onUpdate:modelValue":C[0]||(C[0]=E=>s.value=E),onChange:w,onHandleCancel:v},null,8,["config","modelValue"])):c.value=="number"&&u.value?(z(),Ke(GA,{key:1,showInlineError:!1,autoEmit:!0,config:u.value,modelValue:s.value,"onUpdate:modelValue":C[1]||(C[1]=E=>s.value=E),style:{width:"100%"},onHandleChange:w,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(z(),re("div",PQ,"Metric type:"+mt(c.value),1))],512))}}),[["__scopeId","data-v-519d44e5"]]),kQ=bt(it({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."},s=Z(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate"),o=Z(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),i=V(!1);return Yt(()=>{i.value=!0}),(r,a)=>(z(),re("div",{class:Q(r.$style["no-data-item-table"])},[be("div",{class:Q(r.$style.visual)},[i.value?(z(),Ke(Rm,{key:0,source:"remote",src:s.value,ratio:"4/3",maxWidth:500,maxHeight:350},null,8,["src"])):Ye("",!0)],2),be("div",{class:Q(r.$style.description)},mt(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),_O=Yl("sortStore",()=>{const e=V({}),t={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},n={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}},s=Z(()=>{const a=e.value;return Object.values(a).filter(c=>c.sort!=="none"&&!!c.sort).map(c=>{let u;switch(c.colId){case"dateRange":u=n[c.sort];break;default:if(c.colId.includes("metric")){const[d,h]=c.colId.split("_");u={column:d,direction:c.sort,type:h}}else u={column:t[c.colId]||c.colId,direction:c.sort};break}return u})}),o=(a,l)=>{e.value={[a]:{colId:a,sort:l}}},i=()=>{e.value={}},r=V(!1);return{sortingAPIConfiguration:s,sorts:e,setSort:o,clearSorting:i,isSortingRunning:r}}),sc=it({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=_O(),{sorts:s}=Xs(n),o=Z(()=>{var l,c;return((c=(l=t.params)==null?void 0:l.column)==null?void 0:c.getColId())||"template_col_id"}),i=l=>{o.value&&n.setSort(o.value,l)},r=Z(()=>t.params.headerType||void 0),a=V("none");return Je(()=>s.value,Ri(()=>{if(o.value){const l=s.value[o.value];a.value=l?l.sort:"none"}},sr),{deep:!0,immediate:!0}),(l,c)=>o.value?(z(),Ke(jX,Jt({key:0},t,{"header-type":r.value,modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=u=>a.value=u),onSortChanged:i}),null,16,["header-type","modelValue"])):Ye("",!0)}});function OQ(){const e=wo({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const o=e.name.trim();e.status,o.length===0?e.error="Name cannot be empty":o.length>25?e.error="Name cannot exceed 25 characters":e.error=void 0},n=()=>{e.isCreating=!0,e.name="",e.error=void 0,e.assignees=null,e.status=null,e.start_date=null,e.due_date=null},s=()=>{e.isCreating=!1};return Je(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:s,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const rv=Yl("userStore",()=>{const e=V(null),t=V(null);return{user:e,setUser:o=>{e.value=o},setUserRoleId:o=>{t.value=o},workspaceUserRoleId:t}}),MQ=["innerHTML"],NQ=20,LQ=bt(it({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,{triggerRef:o,popupRef:i,isVisible:r,show:a,hide:l}=us({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),c=()=>{a()},u=V(null),d=()=>{I.value=[],ce.value=!1},h=Z(()=>r.value),f=Z(()=>{var X;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((X=I.value)==null?void 0:X.length)===0,wrapperRef:o,active:h,bordered:!0}}),{argsMain:p}=ms(f),g=Zt,v=n,w=Z(()=>{var X;return Math.max(0,(((X=I.value)==null?void 0:X.length)||0)-s.maxVisible)}),b=Z(()=>{var X;return w.value<=0?"":((X=I.value)==null?void 0:X.slice(s.maxVisible).map(_e=>_e.name).join(", "))||""}),S=V(!1),C=V(!1),E=V(null),R=V(1),T=V(!0),A=V(0),k=V(""),I=V([]),D=Z(()=>{var X;return((X=I.value)==null?void 0:X.map(_e=>_e.id))||[]}),{assigneeList:x,mergedOptions:O}=um({...s,value:[]}),{apiServices:H}=Qn(!1,s),L=Sn("entityId"),j=async(X=1,_e="",ae=!1)=>{var G,oe,ve,Ne,Pe;if(!H.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(ae?C.value=!0:S.value=!0,E.value=null,!((G=H.value)!=null&&G.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const Oe=En.getInstance().getItem("ws.code");try{const Y=await((oe=H.value)==null?void 0:oe.getAssignableAssignees(String(Oe),{entity_ids:(L==null?void 0:L.value)||"",page:X,per_page:NQ,display_name_like:_e})),B=((ve=gu(Y.data))==null?void 0:ve.map(cm))??[];x.value=ae?tu(x.value,B,"id"):B,A.value=Y.meta.total,T.value=(((Ne=Y==null?void 0:Y.meta)==null?void 0:Ne.current_page)||0)<(((Pe=Y==null?void 0:Y.meta)==null?void 0:Pe.last_page)||0),R.value=X}catch(Y){console.error("Error fetching assignable users:",Y),E.value="Failed to load assignable users"}finally{S.value=!1,C.value=!1}},te=X=>{var _e,ae,Oe;if((_e=I.value)!=null&&_e.some(G=>G.id===X.data.id)){I.value=(ae=I.value)==null?void 0:ae.filter(G=>G.id!==X.data.id);return}I.value=[...I.value||[],X.data],(Oe=u.value)==null||Oe.focus()},ee=()=>{I.value=[]},$=()=>{!C.value&&T.value&&j(R.value+1,k.value,!0)},pe=Ri(async X=>{k.value=X,await j(1,X,!1)},sr);Je(()=>r.value,X=>{var _e;X?(j(1,k.value,!1),(_e=u.value)==null||_e.focus(),v("show")):v("hide")});const q=Z(()=>{var X;return((X=I.value)==null?void 0:X.slice(0,3))||[]}),P=Z(()=>q.value.map(X=>({id:X.id,name:X.name,initial:X.initial,avatarId:X.id,profile_image:X.profile_image,color:X.color,size:24,user:X}))),N=rv(),{user:ne}=Xs(N),ce=V(!1);t({getData:()=>I.value,clear:d,setData:X=>{I.value=X},focus:()=>{a(),Et(()=>{var X;(X=u.value)==null||X.focus()})},hide:()=>{l()}}),Je([I,ce],()=>{v("updated",I.value)},{deep:!0});const Ie=X=>{var _e;I.value=(_e=I.value)==null?void 0:_e.filter(ae=>ae.id!==X)},ge=X=>{var ae;const _e=En.getInstance().getItem("ws.code");return((ae=H.value)==null?void 0:ae.getUserInformation(_e,X))||Promise.resolve(null)},ue=V();return(X,_e)=>(z(),re("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:ue},[fe(vs,Jt(W(p),{style:{"--icon-size":"18px"}}),{prefix:ye(()=>[P.value.length==0?(z(),re("div",{key:0,class:Q([X.$style["icon-wrapper"],"wrapper-prefix"]),onClick:Pt(c,["stop","prevent"])},[fe(at,{src:"UserPlus",color:"#A6A6A6"})],2)):Ye("",!0)]),default:ye(()=>[be("div",{class:Q([X.$style["assignee-row"],X.$style["assignee-selector"]]),ref_key:"triggerRef",ref:o},[be("div",{style:{flex:1},class:Q([X.$style["assignee-row"]])},[(z(!0),re(xt,null,xn(P.value,ae=>(z(),Ke(of,{onClear:Oe=>Ie(ae.id),key:ae.user.id,"disable-remove":!1},{default:ye(()=>[fe(Du,{user:ae.user,apiUpdateFunction:ge,appendTo:ue.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),w.value>0?We((z(),re("div",{key:0,class:Q(X.$style["extra-avatars"])},[nt(" +"+mt(w.value),1)],2)),[[W(g),b.value]]):Ye("",!0)],2)],2)]),_:1},16),be("div",{ref_key:"popupRef",ref:i},[fe(Xr,Jt({"selected-id":D.value},{...s},{options:W(O),loading:S.value,"loading-more":C.value,"has-more":T.value,ref_key:"searchListRef",ref:u,onTab:_e[0]||(_e[0]=ae=>v("tab",ae)),onSelect:_e[1]||(_e[1]=ae=>{te(ae),v("start-update")}),onSearch:W(pe),onClose:_e[2]||(_e[2]=()=>v("close")),onLoadMore:$}),{"extra-item":ye(()=>[fe(Xb,{onClick:ee,label:"Unassign all",borderLeft:!0},{icon:ye(()=>[fe(at,{src:"UserXMark",source:"remote"})]),_:1})]),item:ye(({item:ae,selectedIndex:Oe,isSelected:G,handleSelect:oe,handleItemHover:ve,getHighlightedLabel:Ne,query:Pe,idx:Y})=>[fe(Zl,Jt(ae,{hover:Y===Oe,selected:G(ae),type:ae.type,onClick:Pt(B=>oe(ae,B),["stop","prevent"]),onMouseover:B=>ve(Y),class:X.$style["item-assignee"]}),{prefix:ye(()=>[fe(Du,{user:ae.data,apiUpdateFunction:ge,appendTo:W(i)},null,8,["user","appendTo"])]),label:ye(({})=>[Pe?We((z(),re("span",{key:0,class:Q([X.$style["item-label"],X.$style.match]),style:{flex:"1"},innerHTML:Ne(ae.label)},null,10,MQ)),[[W(g),{content:ae.label}]]):We((z(),re("span",{key:1,class:Q(X.$style["item-label"]),style:{flex:"1"}},[nt(mt(ae.label),1)],2)),[[W(g),{content:ae.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{action:"_action_1xvno_1","item-assignee":"_item-assignee_1xvno_6","item-action":"_item-action_1xvno_6","item-label":"_item-label_1xvno_16","icon-wrapper":"_icon-wrapper_1xvno_25","error-message":"_error-message_1xvno_34","empty-state":"_empty-state_1xvno_44","assignee-row":"_assignee-row_1xvno_57","assignee-selector":"_assignee-selector_1xvno_65",seperator:"_seperator_1xvno_69","extra-avatars":"_extra-avatars_1xvno_77",list:"_list_1xvno_89"}}]]),VQ={key:0},BQ={key:1},$Q={key:0},HQ={key:1},GQ={key:0,class:"wrapper-suffix"},UQ={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},WQ=bt(it({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const s=Zt,{triggerRef:o,popupRef:i,isVisible:r,hide:a,show:l}=us({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),c=()=>{u.value=[null,null]},u=V([null,null]),d=C=>{const E=om();return C?vt.fromJSDate(C,{zone:E}).toFormat("MMM dd"):""},h=Z(()=>r.value),f=Z(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:u.value[0]===null&&u.value[1]===null,wrapperRef:o,active:h,bordered:!0})),{argsMain:p}=ms(f),g=V(!1),v=C=>{b("tab",C)},w=C=>{"start"in C&&C.start!==void 0&&(u.value[0]=C.start),"end"in C&&C.end!==void 0&&(u.value[1]=C.end)};t({getData:()=>u.value,clear:c,setData:C=>{u.value=C},focus:()=>{l(),Et(()=>{var C;(C=S.value)==null||C.focus()})},hide:()=>{a()}});const b=n;Je(()=>u.value,C=>{b("updated",C)},{deep:!0});const S=V(null);return Je(()=>r.value,C=>{C?(Et(()=>{var E;(E=S.value)==null||E.focus()}),b("show")):b("hide")}),(C,E)=>(z(),re(xt,null,[fe(vs,Jt({ref_key:"triggerRef",ref:o},W(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:ye(({focused:R})=>[be("div",{class:Q(C.$style["date-time"])},[be("div",{class:Q(C.$style.date)},[u.value[0]==null&&(R||W(r))?(z(),re("span",VQ,"MMMDD")):(z(),re("span",BQ,mt(d(u.value[0])),1))],2),u.value[0]!==null||u.value[1]!==null||R||W(r)?(z(),re("div",{key:0,class:Q(C.$style.separator)}," → ",2)):Ye("",!0),be("div",{class:Q(C.$style.date)},[u.value[1]==null&&(R||W(r))?(z(),re("span",$Q,"MMMDD")):(z(),re("span",HQ,mt(d(u.value[1])),1))],2)],2)]),suffix:ye(({hovered:R,focused:T})=>[(u.value[0]!==null||u.value[1]!==null)&&(R||T||W(r))?(z(),re("div",GQ,[We((z(),Ke(gt,{onClick:Pt(c,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[fe(at,{src:"XMarkSolid",size:"8"})]),_:1})),[[W(s),"Clear"]])])):Ye("",!0)]),prefix:ye(()=>[u.value[0]===null&&u.value[1]===null?(z(),re("div",UQ,[fe(at,{src:"Calendar",color:"#A6A6A6"})])):Ye("",!0)]),_:1},16),be("div",{ref_key:"popupRef",ref:i},[W(r)?(z(),Ke(Dm,{key:0,immediatelyUpdate:!1,value:u.value,onConfirmed:w,ref_key:"calendarRef",ref:S,onClosed:W(a),onStartUpdate:E[0]||(E[0]=R=>g.value=!0),onFinishUpdate:E[1]||(E[1]=R=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Ye("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_n9o5g_2","date-time":"_date-time_n9o5g_5",date:"_date_n9o5g_5",separator:"_separator_n9o5g_18"}}]]),zQ=bt(it({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,o={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:i,popupRef:r,isVisible:a,show:l,hide:c}=us({toggleOnClick:!0,appendTo:"parent"}),u=V(null),d=V([]),h=V(!1),f=V(!1),p=V(null),g=V(o.INITIAL_PAGE),v=V(!0),w=V(0),b=V(""),S=n,C=Z(()=>a.value),E=Z(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!u.value,wrapperRef:i,active:C,bordered:!0})),R=V(null),{argsMain:T}=ms(E),A=Z(()=>u.value?d.value.filter(q=>q.id===u.value):[]),k=Z(()=>!u.value||A.value.length===0?"":A.value[0].label),I=Z(()=>u.value?[u.value]:[]),D=Z(()=>{if(!u.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const q=A.value[0],P=String((q==null?void 0:q.color)||"white");return{backgroundColor:P,border:Pg(P,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),x=q=>({label:q.name,value:q.id,selected:u.value===q.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:q,id:q.id,color:q.color}),{apiServices:O}=Qn(!1,s),H=async(q=o.INITIAL_PAGE,P="",N=!1)=>{var ne,ce;N?f.value=!0:h.value=!0,p.value=null;try{const Ie=En.getInstance().getItem("ws.code"),ge=await((ne=O.value)==null?void 0:ne.getAssignableStatuses(Ie,{entity_id:s.entityId||"",name_like:P,page:q,per_page:o.PER_PAGE}));if(!ge){N||(d.value=[]),v.value=!1;return}const ue=ge.data.map(x);d.value=N?[...d.value,...ue]:ue,w.value=((ce=ge.meta)==null?void 0:ce.total)??ge.data.length,v.value=d.value.length<w.value,g.value=q}catch(Ie){console.error("Error fetching statuses:",Ie),p.value="Failed to load statuses",N||(d.value=[]),v.value=!1,S("error",p.value)}finally{h.value=!1,f.value=!1}},L=(q,P)=>{var ne;P.stopImmediatePropagation(),P.preventDefault(),P.stopPropagation();const N=q.id;u.value=N,(ne=R.value)==null||ne.focus(),S("update:modelValue",u.value),c()},j=async()=>{!v.value||f.value||await H(g.value+1,b.value,!0)},te=async q=>{b.value=q,g.value=o.INITIAL_PAGE,await H(o.INITIAL_PAGE,q,!1)},ee=()=>{u.value=null,S("update:modelValue",null)},$=()=>{l(),Et(()=>{var q;(q=R.value)==null||q.focus()})};return Je(()=>a.value,q=>{var P;q?(H(1,b.value,!1),(P=R.value)==null||P.focus(),S("show")):S("hide")}),Je(()=>u.value,q=>{S("updated",q)}),t({focus:$,clear:ee,getData:()=>u.value,setData:q=>{u.value=q},hide:c,autoFillDefault:async()=>{b.value="",await H(1,b.value,!1),d.value.length>0&&(u.value=d.value[0].id,S("update:modelValue",u.value))}}),(q,P)=>{const N=oo("tooltip");return z(),re(xt,null,[fe(vs,Jt({ref_key:"triggerRef",ref:i},W(T),{style:{"--icon-size":"18px"}}),{default:ye(()=>[be("div",{class:Q(q.$style.status)},[be("div",{class:Q(q.$style["color-indicator"]),style:ln(D.value)},null,6),We((z(),re("span",{class:Q({[q.$style.empty]:A.value.length===0,[q.$style["status-text"]]:!0})},[nt(mt(k.value),1)],2)),[[N,{content:k.value}]])],2)]),_:1},16),be("div",{ref_key:"popupRef",ref:r},[fe(Xr,{style:{width:"200px"},ref_key:"searchListRef",ref:R,"selected-id":I.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:te,onSelect:L,onLoadMore:j,onCancel:P[0]||(P[0]=ne=>S("cancel")),onTab:P[1]||(P[1]=ne=>S("tab",ne)),onClose:P[2]||(P[2]=()=>S("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1gv28_2",status:"_status_1gv28_6","color-indicator":"_color-indicator_1gv28_12","count-badge":"_count-badge_1gv28_25","status-text":"_status-text_1gv28_32",empty:"_empty_1gv28_41"}}],["__scopeId","data-v-6fccb209"]]),jQ=bt(it({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const s=["name","assignees","status","date","cancel","create-keep","create"],o=Zt,i=dH("target"),r=Sn("workspaceId"),a=Sn("entityId"),l=n,c=e,{newItemData:u,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=OQ(),{apiServices:p}=Qn(!1,c),{openSceneHub:g}=qh(),v=V(!1),w=V(!1),b=V(null),S=V({assignees:!1,status:!1,date:!1}),C={name:V(null),assignees:V(null),status:V(null),date:V(null),cancel:V(null),"create-keep":V(null),create:V(null)},E=C.name,R=C.assignees,T=C.status,A=C.date,k=C.cancel,I=C["create-keep"],D=C.create,x=V(new Map),O=Z(()=>!!u.error||!u.name.trim()||w.value),H=(B,J)=>{B&&x.value.set(J,B.$el||B)},L=(B,J)=>{if(B==="date"){const[ie,ke]=Array.isArray(J)?J:[void 0,void 0];u.start_date=ie,u.due_date=ke}else u[B]=J},j=()=>{u.isCreating=!0,b.value="name"},te=()=>{u.isCreating=!1,h()},ee=Sn("switchInstance"),{addNotification:$}=lf(),pe=B=>{l("focus-on-id",B)},q=(B,J,ie)=>{const ke=h7(void 0,"created");$({id:String(B),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${ke}</b>
|
|
156
|
-
<span>${J} </span></div>`,actions:[{label:"Find in table",variant:"secondary",btnIcon:"MagnifyingGlass",action:()=>{l("search-for-code",{code:ie,name:J}),pe(String(B))}},{label:"Full view",btnIcon:"CustomSceneHub",variant:"primary",action:Xe=>{if(Xe.ctrlKey||Xe.metaKey){const me=To({type:"scene_hub",config:{ws_code:r,baseDomain:En.getInstance().getItem("BASE_URL")||"",scene_id:String(B)}}).url;window.open(me,"_blank");return}else ee("scene_hub",{id:String(B)},{showLoading:!1})}}],type:"interactive"})},P=B=>{B&&Et(()=>{var ie;const J=(ie=C[B])==null?void 0:ie.value;J&&(typeof J.focus=="function"?J.focus():J.$el&&typeof J.$el.focus=="function"&&J.$el.focus())})},N=B=>{var J;(J=i.value)==null||J.focus()},ne=B=>{const J=ie=>{var ke;return(ke=ie==null?void 0:ie.hide)==null?void 0:ke.call(ie)};B!=="assignees"&&J(R.value),B!=="status"&&J(T.value),B!=="date"&&J(A.value)},ce=(B,J)=>{J instanceof KeyboardEvent&&J.key!=="Tab"&&J.preventDefault();const ie=b.value?s.indexOf(b.value):-1;if(ie===-1){P("name");return}let Xe=(ie+(B==="next"?1:-1)+s.length)%s.length,me=s[Xe];(me==="create"||me==="create-keep")&&O.value&&(Xe=0,me=s[0]),ne(me),P(me)},Ie=B=>{S.value[B]=!0,b.value=B},ge=B=>{S.value[B]=!1,N()},ue=B=>{S.value[B]||(b.value=null)},X=B=>{B.target===i.value&&P("name")},_e=B=>{var J,ie,ke;if(B.key==="Enter"){if(!b.value)return;switch(B.preventDefault(),B.stopPropagation(),b.value){case"create":O.value||ve("clear");break;case"create-keep":O.value||ve("keep");break;case"cancel":f();break;case"assignees":(J=R.value)==null||J.focus();break;case"status":(ie=T.value)==null||ie.focus();break;case"date":(ke=A.value)==null||ke.focus();break}return}if(B.key==="Tab"){B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation(),b.value!=="name"&&ae(B);return}if(B.key==="Escape"){b.value=null,te();return}},ae=B=>{B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation();const J=B.shiftKey?"prev":"next";ce(J,B)},Oe=()=>{var B;return(B=R.value)==null?void 0:B.focus()},G=()=>{var B;return(B=T.value)==null?void 0:B.focus()},oe=()=>{var B;return(B=A.value)==null?void 0:B.focus()},ve=async(B="clear")=>{var ie,ke,Xe,me,de,Ee,et,ft,Ft,sn,Kt;if(O.value||v.value||w.value)return;w.value=!0,v.value=!0;const J={name:u.name,template_flow_status_id:u.status??void 0,ws_user_role_ids:(ie=u.assignees)==null?void 0:ie.map(Gt=>Gt.id),start_date:u.start_date?lm(u.start_date):void 0,due_date:u.due_date?lm(u.due_date):void 0};if(!((ke=p.value)!=null&&ke.addNewItem)){console.warn("API service unavailable"),v.value=!1;return}try{const Gt=await p.value.addNewItem(r,a,J),on=u.name;if(q(Gt.id,Gt.name,Gt.code),!Gt.id)throw new Error("Invalid response from server: missing scene ID");switch(w.value=!1,v.value=!1,B){case"close":h(),(Xe=R.value)==null||Xe.setData([]),(me=T.value)==null||me.setData(null),(de=A.value)==null||de.setData([null,null]),f(),te();break;case"close-open":h(),(Ee=R.value)==null||Ee.setData([]),(et=T.value)==null||et.setData(null),(ft=A.value)==null||ft.setData([null,null]),f(),te(),g(Gt.id);break;case"clear":l("create-new-item",on),h(),(Ft=R.value)==null||Ft.setData([]),(sn=T.value)==null||sn.setData(null),(Kt=A.value)==null||Kt.setData([null,null]),P("name");break;case"keep":l("create-new-item",on),u.name="",u.error="",P("name");break}}catch(Gt){console.error("Error creating scene:",Gt),B=="close"&&(f(),te())}finally{v.value=!1,w.value=!1}},Ne=(B,J)=>{O.value||(J.metaKey||J.ctrlKey?ve("close-open"):J.shiftKey?ve("keep"):ve("clear"))},Pe=(B=!1)=>{u.isCreating&&(!O.value&&!u.error?ve(B?"close":"clear"):te())},Y=()=>{f(),u.name="",Et(()=>{var B;(B=E.value)==null||B.setValue(u.name)})};return qb(i,B=>{const J=B.target.closest(".notification-center"),ie=B.target.closest("#people-insight-container");if(J||ie)return!1;Pe(!0)}),Je(()=>u.isCreating,B=>{B&&P("name")}),t({show:j,hide:te}),(B,J)=>We((z(),re("div",{class:Q(B.$style.newRow),ref_key:"target",ref:i,onKeydown:_e,onClick:X,tabindex:"-1"},[be("div",{ref:ie=>H(ie,"name"),class:Q({[B.$style["field-wrapper"]]:!0,[B.$style.active]:b.value==="name"})},[fe(Yb,{ref_key:"nameInputRef",ref:E,disabled:v.value||w.value,modelValue:W(u).name,"onUpdate:modelValue":J[0]||(J[0]=ie=>W(u).name=ie),onChange:W(d),onEnter:Ne,onCancel:Y,onTab:J[1]||(J[1]=(ie,ke)=>ae(ke)),onFocus:J[2]||(J[2]=ie=>b.value="name"),placeholder:"Enter name",focused:!0,"max-length":
|
|
156
|
+
<span>${J} </span></div>`,actions:[{label:"Find in table",variant:"secondary",btnIcon:"MagnifyingGlass",action:()=>{l("search-for-code",{code:ie,name:J}),pe(String(B))}},{label:"Full view",btnIcon:"CustomSceneHub",variant:"primary",action:Xe=>{if(Xe.ctrlKey||Xe.metaKey){const me=To({type:"scene_hub",config:{ws_code:r,baseDomain:En.getInstance().getItem("BASE_URL")||"",scene_id:String(B)}}).url;window.open(me,"_blank");return}else ee("scene_hub",{id:String(B)},{showLoading:!1})}}],type:"interactive"})},P=B=>{B&&Et(()=>{var ie;const J=(ie=C[B])==null?void 0:ie.value;J&&(typeof J.focus=="function"?J.focus():J.$el&&typeof J.$el.focus=="function"&&J.$el.focus())})},N=B=>{var J;(J=i.value)==null||J.focus()},ne=B=>{const J=ie=>{var ke;return(ke=ie==null?void 0:ie.hide)==null?void 0:ke.call(ie)};B!=="assignees"&&J(R.value),B!=="status"&&J(T.value),B!=="date"&&J(A.value)},ce=(B,J)=>{J instanceof KeyboardEvent&&J.key!=="Tab"&&J.preventDefault();const ie=b.value?s.indexOf(b.value):-1;if(ie===-1){P("name");return}let Xe=(ie+(B==="next"?1:-1)+s.length)%s.length,me=s[Xe];(me==="create"||me==="create-keep")&&O.value&&(Xe=0,me=s[0]),ne(me),P(me)},Ie=B=>{S.value[B]=!0,b.value=B},ge=B=>{S.value[B]=!1,N()},ue=B=>{S.value[B]||(b.value=null)},X=B=>{B.target===i.value&&P("name")},_e=B=>{var J,ie,ke;if(B.key==="Enter"){if(!b.value)return;switch(B.preventDefault(),B.stopPropagation(),b.value){case"create":O.value||ve("clear");break;case"create-keep":O.value||ve("keep");break;case"cancel":f();break;case"assignees":(J=R.value)==null||J.focus();break;case"status":(ie=T.value)==null||ie.focus();break;case"date":(ke=A.value)==null||ke.focus();break}return}if(B.key==="Tab"){B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation(),b.value!=="name"&&ae(B);return}if(B.key==="Escape"){b.value=null,te();return}},ae=B=>{B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation();const J=B.shiftKey?"prev":"next";ce(J,B)},Oe=()=>{var B;return(B=R.value)==null?void 0:B.focus()},G=()=>{var B;return(B=T.value)==null?void 0:B.focus()},oe=()=>{var B;return(B=A.value)==null?void 0:B.focus()},ve=async(B="clear")=>{Et(async()=>{var ie,ke,Xe,me,de,Ee,et,ft,Ft,sn,Kt;if(O.value||v.value||w.value)return;w.value=!0,v.value=!0;const J={name:u.name,template_flow_status_id:u.status??void 0,ws_user_role_ids:(ie=u.assignees)==null?void 0:ie.map(Gt=>Gt.id),start_date:u.start_date?lm(u.start_date):void 0,due_date:u.due_date?lm(u.due_date):void 0};if(!((ke=p.value)!=null&&ke.addNewItem)){console.warn("API service unavailable"),v.value=!1;return}try{const Gt=await p.value.addNewItem(r,a,J),on=u.name;if(q(Gt.id,Gt.name,Gt.code),!Gt.id)throw new Error("Invalid response from server: missing scene ID");switch(w.value=!1,v.value=!1,B){case"close":h(),(Xe=R.value)==null||Xe.setData([]),(me=T.value)==null||me.setData(null),(de=A.value)==null||de.setData([null,null]),f(),te();break;case"close-open":h(),(Ee=R.value)==null||Ee.setData([]),(et=T.value)==null||et.setData(null),(ft=A.value)==null||ft.setData([null,null]),f(),te(),g(Gt.id);break;case"clear":l("create-new-item",on),h(),(Ft=R.value)==null||Ft.setData([]),(sn=T.value)==null||sn.setData(null),(Kt=A.value)==null||Kt.setData([null,null]),P("name");break;case"keep":l("create-new-item",on),u.name="",u.error="",P("name");break}}catch(Gt){console.error("Error creating scene:",Gt),B=="close"&&(f(),te())}finally{v.value=!1,w.value=!1}})},Ne=(B,J)=>{O.value||(J.metaKey||J.ctrlKey?ve("close-open"):J.shiftKey?ve("keep"):ve("clear"))},Pe=(B=!1)=>{u.isCreating&&(!O.value&&!u.error?ve(B?"close":"clear"):te())},Y=()=>{f(),u.name="",Et(()=>{var B;(B=E.value)==null||B.setValue(u.name)})};return qb(i,B=>{const J=B.target.closest(".notification-center"),ie=B.target.closest("#people-insight-container");if(J||ie)return!1;Pe(!0)}),Je(()=>u.isCreating,B=>{B&&P("name")}),t({show:j,hide:te}),(B,J)=>We((z(),re("div",{class:Q(B.$style.newRow),ref_key:"target",ref:i,onKeydown:_e,onClick:X,tabindex:"-1"},[be("div",{ref:ie=>H(ie,"name"),class:Q({[B.$style["field-wrapper"]]:!0,[B.$style.active]:b.value==="name"})},[fe(Yb,{ref_key:"nameInputRef",ref:E,disabled:v.value||w.value,modelValue:W(u).name,"onUpdate:modelValue":J[0]||(J[0]=ie=>W(u).name=ie),onChange:W(d),onEnter:Ne,onCancel:Y,onTab:J[1]||(J[1]=(ie,ke)=>ae(ke)),onFocus:J[2]||(J[2]=ie=>b.value="name"),placeholder:"Enter name",focused:!0,"max-length":255,type:"text","auto-emit":!0,style:{"--bg-input":"transparent","--border-color":"#f3f5f7"},bordered:!0,class:"border-f3f5f7"},null,8,["disabled","modelValue","onChange"])],2),be("div",{ref:ie=>H(ie,"assignees"),onEnter:Pt(Oe,["prevent","stop"]),class:Q({[B.$style["field-wrapper"]]:!0,[B.$style.active]:b.value==="assignees"})},[fe(LQ,{ref_key:"assigneeRef",ref:R,onUpdated:J[3]||(J[3]=ie=>L("assignees",ie)),onTab:J[4]||(J[4]=ie=>ae(ie)),onEnter:Oe,onFocus:J[5]||(J[5]=ie=>b.value="assignees"),onBlur:J[6]||(J[6]=ie=>ue("assignees")),onShow:J[7]||(J[7]=ie=>Ie("assignees")),onHide:J[8]||(J[8]=ie=>ge("assignees"))},null,512)],34),be("div",{ref:ie=>H(ie,"status"),class:Q({[B.$style["field-wrapper"]]:!0,[B.$style.active]:b.value==="status"})},[fe(zQ,{ref_key:"statusRef",ref:T,"entity-id":W(a),onUpdated:J[9]||(J[9]=ie=>L("status",ie)),onTab:J[10]||(J[10]=ie=>ae(ie)),onEnter:G,onFocus:J[11]||(J[11]=ie=>b.value="status"),onBlur:J[12]||(J[12]=ie=>ue("status")),onShow:J[13]||(J[13]=ie=>Ie("status")),onHide:J[14]||(J[14]=ie=>ge("status"))},null,8,["entity-id"])],2),be("div",{ref:ie=>H(ie,"date"),class:Q({[B.$style["field-wrapper"]]:!0,[B.$style.active]:b.value==="date"})},[fe(WQ,{ref_key:"dateRef",ref:A,onUpdated:J[15]||(J[15]=ie=>L("date",ie)),onTab:J[16]||(J[16]=ie=>ae(ie)),onEnter:oe,onFocus:J[17]||(J[17]=ie=>b.value="date"),onBlur:J[18]||(J[18]=ie=>ue("date")),onShow:J[19]||(J[19]=ie=>Ie("date")),onHide:J[20]||(J[20]=ie=>ge("date"))},null,512)],2),be("div",{class:Q(B.$style["field-actions"])},[be("div",{ref:ie=>H(ie,"cancel"),class:Q({[B.$style["field-wrapper"]]:!0,[B.$style.active]:b.value==="cancel",[B.$style["field-button"]]:!0})},[fe(gt,{ref_key:"cancelRef",ref:k,variant:["secondary"],onClick:W(f),onKeydown:[Un(W(f),["enter"]),J[22]||(J[22]=Un(ie=>ae(ie),["tab"]))],onFocus:J[21]||(J[21]=ie=>b.value="cancel"),tabindex:"0"},{default:ye(()=>[...J[31]||(J[31]=[nt(" Cancel ",-1)])]),_:1},8,["onClick","onKeydown"])],2),We((z(),re("div",{ref:ie=>H(ie,"create-keep"),class:Q({[B.$style["field-wrapper"]]:!0,[B.$style["field-button"]]:!0,[B.$style.active]:b.value==="create-keep"})},[fe(gt,{ref_key:"createKeepRef",ref:I,onClick:J[23]||(J[23]=()=>ve("keep")),onKeydown:[J[24]||(J[24]=Un(ie=>!O.value&&ve("keep"),["enter"])),J[26]||(J[26]=Un(ie=>ae(ie),["tab"]))],onFocus:J[25]||(J[25]=ie=>b.value="create-keep"),disabled:O.value,variant:["primary"],loading:v.value,tabindex:"0",style:ln([{padding:"4px 8px",width:"100%"},{"letter-spacing":"-0.5px"}])},{default:ye(()=>[...J[32]||(J[32]=[nt(" Create & Keep ",-1)])]),_:1},8,["disabled","loading"])],2)),[[W(o),O.value?"Enter a name and select a status to continue.":"Create and keep field values (⇧↵ Shift+Enter)"]]),We((z(),re("div",{ref:ie=>H(ie,"create"),class:Q({[B.$style["field-wrapper"]]:!0,[B.$style.active]:b.value==="create",[B.$style["field-button"]]:!0})},[fe(gt,{ref_key:"createRef",ref:D,onClick:J[27]||(J[27]=()=>ve("clear")),onKeydown:[J[28]||(J[28]=Un(ie=>!O.value&&ve("clear"),["enter"])),J[30]||(J[30]=Un(ie=>ae(ie),["tab"]))],onFocus:J[29]||(J[29]=ie=>b.value="create"),disabled:O.value,variant:["primary"],loading:v.value,tabindex:"0"},{default:ye(()=>[...J[33]||(J[33]=[nt(" Create ",-1)])]),_:1},8,["disabled","loading"])],2)),[[W(o),O.value?"Enter a name and select a status to continue.":"Create and clear the fields (↵ Enter)"]])],2)],34)),[[Ei,W(u).isCreating]])}}),[["__cssModules",{$style:{newRow:"_newRow_mf32t_1","field-actions":"_field-actions_mf32t_14","field-wrapper":"_field-wrapper_mf32t_43",active:"_active_mf32t_49","field-button":"_field-button_mf32t_52","warning-text":"_warning-text_mf32t_55","has-error":"_has-error_mf32t_60"}}]]),KQ=["innerHTML"],qQ=["accept"],RO=bt(it({__name:"FileUploader",props:{modelValue:{},acceptTypes:{default:()=>["xlsx","xls","csv"]}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const s=V(null),o=k=>`<svg xmlns="http://www.w3.org/2000/svg" width="49" height="49" viewBox="0 0 49 49" fill="none">
|
|
157
157
|
<g clip-path="url(#clip0)">
|
|
158
158
|
<path d="M9.86719 3.56641C9.86719 2.05448 11.1053 0.816406 12.6172 0.816406H33.5136L45.3672 12.67V45.5664C45.3672 47.0783 44.1291 48.3164 42.6172 48.3164H12.6172C11.1053 48.3164 9.86719 47.0783 9.86719 45.5664V3.56641Z" stroke="#232323" stroke-width="0.5"/>
|
|
159
159
|
<path d="M36.6172 12.5664H45.6172L33.6172 0.566406V9.56641C33.6172 11.2164 34.9672 12.5664 36.6172 12.5664Z" fill="#A6A6A6"/>
|
|
@@ -249,4 +249,4 @@ See ${xN(e,t)}`;return Array.isArray(s)?s.concat(i):[s,i]}var Vpe={1:"Charting A
|
|
|
249
249
|
If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),Bf(u)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);Bf(`to see all the valid ${s} properties please check: ${l}`)}}};function ige(e,t,n){const s={},o=e.filter(i=>!t.some(r=>r===i));if(o.length>0)for(const i of o)s[i]=X0({inputValue:i,allSuggestions:n}).values;return s}var rge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),age={moduleName:"Validation",version:lt,beans:[oge]};function T2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var lge=class extends Ge{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(i=>{const r=i.childrenAfterFilter&&i.childrenAfterFilter.length>0,a=i.data&&this.filterManager.doesRowPassFilter({rowNode:i});return r||a}):s.childrenAfterFilter=s.childrenAfterGroup,T2(s)};if(this.doingTreeDataFiltering()){const s=(i,r)=>{if(i.childrenAfterGroup)for(let a=0;a<i.childrenAfterGroup.length;a++){const l=i.childrenAfterGroup[a],c=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(i.childrenAfterGroup[a],c):n(l,c)}n(i,r)},o=i=>s(i,!1);t.executeFromRootNode(o)}else{const s=o=>n(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},cge=class extends TE{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,s,o){this.comp=e;const i=jf(this,this.beans.context,o);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=s,this.setGui(t,i),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(i),this.setupLeft(i),this.setupHover(i),this.setupFocus(i),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(i),this.setupUi(),i.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(i);const r=()=>this.onColDefChanged(i);i.addManagedListeners(this.column,{colDefChanged:r}),i.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&r()}}),i.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return It(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}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;const e=li("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new fd(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.getLocaleTextFunc();Ju(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var r;const{beans:t}=this;if(Hn(t)===this.eGui)return;const o=vc(t,this.eGui,null,e.shiftKey);if(o){(r=t.headerNavigation)==null||r.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Me.UP:case Me.DOWN:case Me.LEFT:case Me.RIGHT:if(t)return;Cc(e);case Me.ENTER:t&&mc(this.eGui)&&e.preventDefault();break;case Me.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&cc(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,i=!!(o&&o.key===Me.TAB);if(o&&i){const r=o.shiftKey;mc(this.eGui,r)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new DE(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!No(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:s}=this,o=i=>{if((i==null?void 0:i.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const r=this.comp.getFloatingFilterComp();r&&r.then(a=>{if(a){if(s.get("enableFilterHandlers")){const u=i;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(i==null?void 0:i.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=i?{...i,columns:i.columns??[],source:i.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:o}),t!=null&&t.isFilterActive(n)&&o(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,o=this.active?s==null?void 0:s.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,i=this.comp.getFloatingFilterComp();!i||!o?this.updateCompDetails(e,o,n):i.then(r=>{!r||s!=null&&s.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,n):this.updateFloatingFilterParams(o,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var s;if(!e)return;let n=e.params;(s=this.comp.getFloatingFilterComp())==null||s.then(o=>{var i;typeof(o==null?void 0:o.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:_s(((i=this.beans.colFilter)==null?void 0:i.model)??{},this.column.getColId()),source:t}),o.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function uge(e,t){var s;const n=e.colModel.getCol(t);if(!n){bn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function dge(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var hge={moduleName:"SharedMenu",version:lt,beans:[Ele],apiFunctions:{showColumnMenu:uge,hidePopupMenu:dge}},fge=class extends Wre{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:s}=e,o=t.getBoundingClientRect(),i=this.getParentRect();this.setAlignedTo(t,n);let r=!1;const a=()=>{const l=this.keepXYWithinBounds(n,o.top-i.top,0),c=n.clientWidth>0?n.clientWidth:200;r||(n.style.minWidth=`${c}px`,r=!0);const d=i.right-i.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return o.right-i.left-2}function p(){return o.left-i.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,s instanceof MouseEvent?s:void 0)})}callPostProcessPopup(e,t,n,s,o){const i=this.gos.getCallback("postProcessPopup");if(i){const{column:r,rowNode:a}=e;i({column:r,rowNode:a,ePopup:n,type:t,eventSource:s,mouseEvent:o})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return ha(e)}},gy={moduleName:"Popup",version:lt,beans:[fge]},pge=".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;>*{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,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-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%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{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(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;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:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}: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 gge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function mge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function vge(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function yge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function wge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function Cge(e,t,n){const{gos:s,colModel:o,colFilter:i}=e;n&&!s.get("enableFilterHandlers")&&(qe(288),n=!1);const r=o.getColDefCol(t);return r?(i==null?void 0:i.getModelForColumn(r,n))??null:null}function bge(e,t,n){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,n))??Promise.resolve()}function Sge(e,t){var s;const n=e.colModel.getCol(t);if(!n){bn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function Ege(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function _ge(e,t){var s;const n=e.colModel.getCol(t);if(!n){bn(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function Rge(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){qe(287);return}const{colId:i,action:r}=t;if(i){const a=n.getColById(i);a&&(s==null||s.updateModel(a,r))}else s==null||s.updateAllModels(r)}var Dge={filterHandler:()=>({doesFilterPass:()=>!0})},Tge=class extends Ge{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={...VL},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,s;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((s=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:s.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:s,dataTypeSvc:o,filterManager:i}=this.beans;if(o!=null&&o.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const r=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];r.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=s.getColDefCol(c)||s.getCol(c);if(!u){qe(62,{colId:c});return}if(!u.isFilterAllowed()){qe(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){qe(64,{colId:c});return}r.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});zn.all(r).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;xf(h,f)||c.push(u.column)}),c.length>0?i==null||i.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var i;const t={},{allColumnFilters:n,initialModel:s,beans:{colModel:o}}=this;if(n.forEach((r,a)=>{const l=this.getModelFromFilterWrapper(r);ut(l)&&(t[a]=l)}),!e)for(const r of Object.keys(s)){const a=s[r];ut(a)&&!n.has(r)&&((i=o.getCol(r))!=null&&i.isFilterAllowed())&&(t[r]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const o=t[s];this.state.set(s,{model:_s(this.model,s),state:o})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((s,o)=>{const i=s.state;i!=null&&(n=!0,t[o]=i)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return _s(this.model,n);const s=e.filter;return s?typeof s.getModel!="function"?(qe(66),null):s.getModel():_s(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(qe(67),!1):!1,{colModel:t,gos:n}=this.beans,s=!!P0(n),o=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:s},i=[],r=[],a=(c,u,d)=>{u&&(o(c)?i.push(d):r.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(zn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=il(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),zn.all(l).then(()=>{this.activeAggregateFilters=i,this.activeColumnFilters=r})}updateFilterFlagInColumns(e,t){var s;const n=[];return this.allColumnFilters.forEach(o=>{const i=o.column;if(o.isHandler)n.push(zn.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const r=il(o);r&&n.push(r.then(a=>{this.setColFilterActive(i,a.isFilterActive(),e,t)}))}}),(s=this.beans.groupFilter)==null||s.updateFilterFlags(e,t),zn.all(n)}doFiltersPass(e,t,n){const{data:s,aggData:o}=e,i=n?this.activeAggregateFilters:this.activeColumnFilters,r=n?o:s,a=this.model;for(let l=0;l<i.length;l++){const c=i[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:r,model:_s(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){bn(91);continue}if(!h.doesFilterPass({node:e,data:r}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,s=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,s=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(o=>{var a,l,c;const{column:i,isHandler:r}=o;s!==i.getColId()&&(r&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(c=il(o,r))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var i,r;const s=n.isHandler;s&&((r=(i=n.handler).onNewRowsLoaded)==null||r.call(i));const o=il(n,s);o&&t.push(o.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),zn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:s}=this.beans;return(o,i)=>{const r=i?s.getCol(i):e;return r?n.getValue(r,o,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():_s(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=ut(_s(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?il(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=il(t);return n?n.then(s=>({comp:s,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return Doe(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":pae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,i){const r=()=>{const c=this.createFilterCompParams(e,o,i),u=s(c,o);return Iie(this.beans.userCompFactory,t,u,n)},a=r();return a?{compDetails:a,createFilterUi:c=>(c?r():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,s){var d,h;const o=this.beans.selectableFilter;o!=null&&o.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:i,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,s,!!i,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:i,handlerGenerator:a,handlerParams:r};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||qe(281,{colId:e.getColId()})),{compDetails:c,handler:i,handlerGenerator:a,handlerParams:r,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:s}=this.beans;return It(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:o=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),o))??!0,rowModel:s})}createFilterCompParams(e,t,n,s){const o=this.filterChangedCallbackFactory(e),i=this.createBaseFilterParams(e,s);if(i.filterChangedCallback=o,i.filterModifiedCallback=s?()=>{}:r=>this.filterModified(e,r),t){const r=i,a=e.getColId(),l=_s(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{o({...u,source:"columnFilter"})})},r.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},r.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=c=>this.filterUiChanged(e,c),r.source=n}return i}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const s=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(n),o}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:s,handlerParams:o,createFilterUi:i}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),r=e.getColId();if(n)return delete this.initialModel[r],(a=n.init)==null||a.call(n,{...o,source:"init",model:_s(this.model,r)}),{column:e,isHandler:!0,handler:n,handlerGenerator:s,handlerParams:o,filterUi:this.createFilterUiForHandler(t,i)};if(i){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,i,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:s,frameworkOverrides:o,registry:i}=this.beans;let r;const a=p=>{const g=p.filter;if(oL(g)){const v=g.handler;return v||(r=g.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return typeof g=="string"?g:void 0},l=s.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(i.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:nae.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:w}=cL(o,t);g?p=g:v==null&&w==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=u(h))}return d?{filterHandler:d,handlerNameOrCallback:r??h}:l?(ts(s)&&qe(277,{colId:e.getColId()}),Dge):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=L0(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:i,filterHandler:r}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,o);return{handler:a,handlerParams:l,handlerGenerator:i??r}}createHandlerFromFunc(e,t,n){const s=e.getColDef(),o=t(It(this.gos,{column:e,colDef:s})),i=this.createHandlerParams(e,n);return{handler:o,handlerParams:i}}createHandlerParams(e,t){const n=e.getColDef(),s=e.getColId(),o=this.filterChangedCallbackFactory(e);return It(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:i=>{var r;return((r=this.beans.filterManager)==null?void 0:r.doesRowPassOtherFilters(s,i))??!0},onModelChange:(i,r)=>{this.updateStoredModel(s,i),this.refreshHandlerAndUi(e,i,"handler",!1,r).then(()=>{o({...r,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:s}=this.beans;this.allColumnFilters.forEach((i,r)=>{let a;i.column.isPrimary()?a=t.getColDefCol(r):a=t.getCol(r),!(a&&a===i.column)&&(e.push(i.column),this.disposeFilterWrapper(i,"columnChanged"),this.disposeColumnListener(r))});const o=s&&e.every(i=>s.isGroupFilter(i));e.length>0&&!o&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:s,selectableFilter:o}=this.beans,i=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(qf(p))})},r=e.getColDef(),a=o!=null&&o.isSelectable(r)?o.getFilterDef(e,r):r,l=wae(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=L0(n,a,this.createFilterCompParams(e,c,"init",!0)),d=It(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=_s(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return Oie(n,r,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,s){const o="paramsUpdated";if(e.isHandler){const i=t.getColId();delete this.initialModel[i],this.state.delete(i);const r=e.filterUi,a=this.createFilterUiForHandler(n,s);e.filterUi=a;const l=this.eventSvc;r!=null&&r.created?r.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const n=e.getColId(),s=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],s&&this.disposeFilterWrapper(s,t).then(o=>{var i;o&&this.isAlive()&&((i=this.beans.filterManager)==null||i.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:s,isHandler:o,filterUi:i}=e,r=s.getColId();o&&(n=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[r],this.state.delete(r));const a=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(r),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(i){if(i.created)return i.promise.then(l=>(n=o?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return zn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,w,b,S,C,E;const n=this.allColumnFilters.get(e);if(!n)return;const s=this.beans,o=n.column,i=o.getColDef(),r=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=s.selectableFilter,c=l!=null&&l.isSelectable(i)?l.getFilterDef(o,i):i,u=r?this.createHandlerFunc(o,c,this.getDefaultFilter(o)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(r?this.createFilterComp(o,c,a,R=>R,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??L0(s.userCompFactory,c,this.createFilterCompParams(o,d,"colDef"));if(h){const R=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),T=_s(this.model,e);if(n.handlerGenerator!=R){const A=n.handler,{handler:k,handlerParams:I}=this.createHandlerFromFunc(o,u.filterHandler,g);n.handler=k,n.handlerParams=I,n.handlerGenerator=R,delete this.model[e],(v=k.init)==null||v.call(k,{...I,source:"init",model:null}),this.destroyBean(A),T!=null&&((w=this.beans.filterManager)==null||w.onFilterChanged({columns:[o],source:t}))}else{const A=this.createHandlerParams(o,f==null?void 0:f.params);n.handlerParams=A,(S=(b=n.handler).refresh)==null||S.call(b,{...A,source:"colDef",model:T})}}if(this.areFilterCompsDifferent(((C=n.filterUi)==null?void 0:C.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,o,f,p);return}n.filterUi.filterParams=g,(E=il(n,h))==null||E.then(R=>{(R!=null&&R.refresh?R.refresh(g):!0)===!1?this.destroyFilterUi(n,o,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:g})})}refreshHandlerAndUi(e,t,n,s,o){const i=this.cachedFilter(e);if(!i)return s&&this.getOrCreateFilterWrapper(e,!0),zn.resolve();if(!i.isHandler)return zn.resolve();const{filterUi:r,handler:a,handlerParams:l}=i;return sae(()=>{if(r){const{created:c,filterParams:u}=r;if(c)return r.promise.then(d=>d?{filter:d,filterParams:u}:void 0);r.refreshed=!0}return zn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,o)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:s}=t;return!(n===s||(n==null?void 0:n.render)&&(s==null?void 0:s.render)&&n.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(s=>{n.then(o=>{s(qf(o))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:s,model:o}=this,i=e.getColId(),r=s.get(i);return r?r.model??null:_s(o,i)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let s=()=>{};const o=new Promise(i=>{s=i});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:_s(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),s=n?this.getOrCreateFilterWrapper(n,!0):null;return s?this.setModelOnFilterWrapper(s,t):zn.resolve()}setColDefPropsForDataType(e,t,n){var u;const s=e.filter,o=s===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if(typeof o!="string")return;let i,r;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;o==="agMultiColumnFilter"?{filterParams:i,filterValueGetter:r}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:i,filterValueGetter:r}=dae(o,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=i,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,n,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,s)}setModelOnFilterWrapper(e,t,n){return new zn(s=>{if(e.isHandler){const i=e.column,r=i.getColId(),a=this.model[r];if(this.updateStoredModel(r,t),n&&t===a){s();return}this.refreshHandlerAndUi(i,t,"api").then(()=>s());return}const o=il(e);if(o){o.then(i=>{if(typeof(i==null?void 0:i.setModel)!="function"){qe(65),s();return}(i.setModel(t)||zn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){ut(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),s={model:t,state:n==null?void 0:n.state};this.state.set(e,s)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var r;const s=e.getColId(),o=this.cachedFilter(e),i=()=>o==null?void 0:o.filterUi;HL(t,i,()=>_s(this.model,s),()=>this.state.get(s),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=i())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},o!=null&&o.isHandler?(r=o.handler.processModelToApply)==null?void 0:r.bind(o.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((s,o)=>{var r;const i=this.beans.colModel.getColDefCol(o);i&&HL(e,()=>s.filterUi,()=>_s(this.model,o),()=>this.state.get(o),a=>this.updateState(i,a),a=>{this.updateStoredModel(o,a),this.dispatchLocalEvent({type:"filterAction",column:i,action:e}),n.push(this.refreshHandlerAndUi(i,a,"ui"))},s!=null&&s.isHandler?(r=s.handler.processModelToApply)==null?void 0:r.bind(s.handler):void 0)}),n.length&&zn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();$L(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>_s(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(){const{state:e,model:t,activeFilterComps:n}=this;for(const o of n)if(o.source==="COLUMN_MENU")return!1;let s=!1;for(const o of e.keys()){const i=e.get(o);if(i.valid===!1)return!1;(i.model??null)!==_s(t,o)&&(s=!0)}return s}hasUnappliedModel(e){var s;const{model:t,state:n}=this;return(((s=n.get(e))==null?void 0:s.model)??null)!==_s(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function xge(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Ige(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var Fge=class extends Ge{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:s})=>this.onAdvFilterEnabledChanged(s),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"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var s;this.isAdvFilterEnabled()||(s=this.colFilter)==null||s.setState(e,t,n)}setFilterModel(e,t="api",n){var s;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(s=this.colFilter)==null||s.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.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){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){P0(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):zn.resolve()).then(()=>{var i;const o={source:t,type:"filterChanged",columns:s};n&&Qs(o,n),this.eventSvc.dispatchEvent(o),(i=this.colFilter)==null||i.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!P0(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){qe(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},Pge=class extends Ge{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,s){e&&!e.isColumn||this.showPopup(e,o=>{var i;(i=this.popupSvc)==null||i.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:o})},n,t.target,No(this.gos),s)}showMenuAfterButtonClick(e,t,n,s){if(e&&!e.isColumn)return;let o=-1,i="left";const r=No(this.gos);!r&&this.gos.get("enableRtl")&&(o=1,i="right");const a=r?void 0:4*o,l=r?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:i,keepWithinBounds:!0,position:"under",column:e})},n,t,r,s)}showPopup(e,t,n,s,o,i){var g;const r=e?this.createBean(new cae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!e){bn(57);return}const a=ss({tag:"div",cls:`ag-menu${o?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(r==null?void 0:r.getGui());let l;const c=()=>r==null?void 0:r.afterGuiDetached(),u=Toe(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{dV(e,!1,"contextMenu");const w=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),w&&s&&gr(s)){const b=mL(s);b==null||b.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),i==null||i()},h=this.getLocaleTextFunc(),f=o&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:n,hidePopup:l})}),dV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Me.TAB||e.defaultPrevented||vc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),mc(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},Age=class extends Ge{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const s=e.getColDef(),{selectableFilter:o,valueSvc:i}=this.beans,r=n??(o==null?void 0:o.getFilterValueGetter(e.getColId()))??s.filterValueGetter;return r?this.executeFilterValueGetter(r,t.data,e,t,s):i.getValue(e,t)}executeFilterValueGetter(e,t,n,s,o){const{expressionSvc:i,valueSvc:r}=this.beans,a=It(this.gos,{data:t,node:s,column:n,colDef:o,getValue:r.getValueCallback.bind(r,s)});return typeof e=="function"?e(a):i==null?void 0:i.evaluate(e,a)}},kge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Oge=class extends yn{constructor(){super(kge,[Gv]),this.eFloatingFilterText=ct}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,s=n.getHandler();if(s.getModelAsString){const o=s.getModelAsString(n.model);this.eFloatingFilterText.setValue(o)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},o_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],s=o=>o.some(i=>t[i]!=null)?!0:(qe(72,{keys:o}),!1);if(!n.every(s)){this.filterOptions=e.filter(o=>o===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;qe(73)}else qe(74)}getCustomOption(e){return this.customFilterOptions[e]}};function ap(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function my(e){return e==null||typeof e=="string"&&e.trim().length===0}function Mge(e){return e==="AND"||e==="OR"?e:"AND"}function Nge(e,t,n){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,n)}function Lge(e,t){let n=e.length;return n>t&&(e.splice(t),qe(78),n=t),n}function lp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:o}=n;return o??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var i_=class extends yae{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,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);const t=new o_;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=Mge(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const s=n===0?e:this.optionsFactory.defaultOption;t.setValue(s,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,s=!t.operator;if(!n&&s||n&&!s)return!1;let i;if(n){const r=e,a=t;i=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;i=r.operator===a.operator&&tl(r.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return i}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),zn.resolve();if(e.operator){const s=e;let o=s.conditions;o==null&&(o=[],qe(77));const i=Lge(o,this.maxNumConditions),r=this.getNumConditions();if(i<r)this.removeConditionsAndOperators(i);else if(i>r)for(let l=r;l<i;l++)this.createJoinOperatorPanel(),this.createOption();const a=s.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{const s=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(s.type,!0),this.setConditionIntoUi(s,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),zn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(qe(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(qe(80),n=1),n>t&&(qe(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new nE);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const s=this.getNumConditions()-1;this.forEachPositionInput(s,o=>this.resetInput(o)),this.addChangedListeners(t,s)}createJoinOperatorPanel(){const e=ss({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const s=this.eJoinPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(n,s,o),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const s=this.createManagedBean(new Yie);e.push(s);const o="ag-filter-condition-operator";return s.addCss(o),s.addCss(`${o}-${n}`),t.appendChild(s.getGui()),s}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const s=e+1,o=n-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const i=this.isConditionDisabled(o,e);s.setDisabled(i||this.filterListOptions.length<=1),o===1&&(Af(this.eJoinPanels[0],i),this.eJoinAnds[0].setDisabled(i),this.eJoinOrs[0].setDisabled(i))}),this.eConditionBodies.forEach((s,o)=>{Vn(s,this.isConditionBodyVisible(o))});const n=(t??this.getJoinOperator())==="OR";for(const s of this.eJoinAnds)s.setValue(!n,!0);for(const s of this.eJoinOrs)s.setValue(n,!0);this.forEachInput((s,o,i,r)=>{this.setElementDisplayed(s,o<r),this.setElementDisabled(s,this.isConditionDisabled(i,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:s,eJoinPanels:o,eJoinAnds:i,eJoinOrs:r}=this;this.removeComponents(n,e,t),this.removeElements(s,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(i,a,t),this.removeComponents(r,a,t)}removeElements(e,t,n){const s=ap(e,t,n);for(const o of s)Ni(o)}removeComponents(e,t,n){const s=ap(e,t,n);for(const o of s)Ni(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof yc&&this.isConditionBodyVisible(0)?n=s.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var r;super.afterGuiDetached();const e=this.params;if((r=this.beans.colFilter)!=null&&r.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,s=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),s=!0,c&&n--)}let i=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),i=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),i=!0),i&&this.updateConditionStatusesAndValues(n,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const s=this.eTypes[t].getValue(),o=this.translate(s);n=this.filterPlaceholder({filterOptionKey:s,filterOption:o,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,s,o)=>{if(!(t instanceof yc))return;const i=n===0&&o>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",r=n===0&&o>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(i,s)),t.setInputAriaLabel(r)})}setElementValue(e,t,n){e instanceof yc&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){nL(e)&&Vn(e.getGui(),t)}setElementDisabled(e,t){nL(e)&&Af(e.getGui(),t)}attachElementOnChange(e,t){e instanceof yc&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const s=lp(t,this.optionsFactory),o=this.getInputs(e);for(let i=0;i<o.length;i++){const r=o[i];r!=null&&n(r,i,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return lp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),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){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,s,o){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);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){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((s,o,i)=>{i===t&&this.setElementValue(s,n[o]!=null?n[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,s)=>{this.setElementValue(t,n===0&&s===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},x2=class{constructor(e,t,n,s,o,i){this.alive=!0,this.context=e,this.eParent=o;const r=Fie(t,n,s);r&&r.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),i==null||i(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Vn(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},r_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function I2(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&po(n,void 0,!0)||null,s&&po(s,void 0,!0)||null].slice(0,lp(o,t))}var F2=1e3,P2=1/0,Vge=class extends i_{constructor(){super("dateFilter",I2,r_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=F2,this.maxValidYear=P2,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const u=e[l];if(u!=null)if(isNaN(u))qe(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",F2),s=t("maxValidYear",P2);this.minValidYear=n,this.maxValidYear=s,n>s&&qe(83);const{minValidDate:o,maxValidDate:i}=e,r=o instanceof Date?o:po(o);this.minValidDate=r;const a=i instanceof Date?i:po(i);this.maxValidDate=a,r&&a&&r>a&&qe(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,i=new x2(n,t,o.colDef,It(s,{onDateChanged:()=>this.onUiChanged(),filterParams:o,location:"filter"}),e);return this.addDestroyFunc(()=>i.destroy()),i}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=ss({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,n,s){const o=ss({tag:"div",cls:`ag-filter-${s} ag-filter-date-${s}`});t.push(o),e.appendChild(o),n.push(this.createDateCompWrapper(o))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),ap(this.eConditionPanelsFrom,e,t),ap(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const s=ap(e,t,n);for(const o of s)o.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:s,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<s)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,s,o,i)=>{o!==e||!t||s>=i||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},s=this.getValues(e),o=this.params.useIsoSeparator?"T":" ";return s.length>0&&(n.dateFrom=Lo(s[0],!0,o)),s.length>1&&(n.dateTo=Lo(s[1],!0,o)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},A2=class extends Ge{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new o_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,s=[];if(n){const r=t;s.push(...r.conditions??[])}else s.push(t);const o=n&&n==="OR"?"some":"every",i=this.params.getValue(e.node);return s[o](r=>this.individualConditionPasses(e,r,i))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:s}}=e;if(t==null)return;let i=KL(t)?t.conditions:[t];const r=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!i||i.every(u=>r.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((i&&!i.every(u=>u.filterType===c)||t.filterType!==c)&&(i=i.map(u=>({...u,filterType:c})),l=!0),typeof s=="number"&&i&&i.length>s&&(i=i.slice(0,s),l=!0),l){const u=i.length>1?{...t,filterType:c,conditions:i}:{...i[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const s=this.optionsFactory,o=this.mapValuesFromModel(t,s),i=s.getCustomOption(t.type),r=Nge(i,o,n);return r??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},k2=class extends A2{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:s,includeBlanksInLessThan:o,includeBlanksInRange:i}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(s)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(i)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const s=n.type;if(!this.isValid(t))return s==="notEqual"||s==="notBlank";const o=this.comparator(),i=e[0]!=null?o(e[0],t):0;switch(s){case"equals":return i===0;case"notEqual":return i!==0;case"greaterThan":return i>0;case"greaterThanOrEqual":return i>=0;case"lessThan":return i<0;case"lessThanOrEqual":return i<=0;case"inRange":{const r=o(e[1],t);return this.params.filterParams.inRangeInclusive?i>=0&&r<=0:i>0&&r<0}case"blank":return my(t);case"notBlank":return!my(t);default:return qe(76,{filterModelType:s}),!0}}},O2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},Bge={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},a_=class extends Ge{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),s=t==="filterToolPanel";if(!e)return s?rl(this,"filterSummaryInactive"):null;if(e.operator!=null){const i=e,a=(i.conditions??[]).map(c=>this.getModelAsString(c,t)),l=i.operator==="AND"?"andCondition":"orCondition";return a.join(` ${rl(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return s?rl(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const i=e,r=this.optionsFactory.getCustomOption(i.type),{displayKey:a,displayName:l,numberOfInputs:c}=r||{};return a&&l&&c===0?n(a,l):this.conditionToString(i,s,i.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,s,o,i){let r;const a=this.getTypeKey(e);return a&&(r=rl(this,a)),o&&i&&(r=this.getLocaleTextFunc()(o,i)),r!=null?t?`${r} ${rl(this,"filterSummaryInRangeValues",[n(),s()])}`:`${r} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},M2=class extends a_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:s,valueSvc:o}=this.beans,i=t.column,r=s==null?void 0:s.getDateFormatterFunction(i),a=r?r(n??void 0):n;return o.formatValue(i,null,a)}),this.filterTypeKeys=O2}conditionToString(e,t,n,s,o){const{type:i}=e,r=po(e.dateFrom),a=po(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>Z0(h,l),u=()=>r!==null?c(r):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(i,n,u,d,s,o);if(h!=null)return h}return n?`${u()}-${d()}`:r!=null?c(r):`${i}`}};function $ge(e,t){const n=t;return n<e?-1:n>e?1:0}var Hge=class extends k2{constructor(){super(I2,r_),this.filterType="date",this.FilterModelFormatterClass=M2}comparator(){return this.params.filterParams.comparator??$ge}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},N2=class extends yn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new o_;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){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const s=this.isTypeEditable(n);this.setEditable(s)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:s,model:o}=t;if(s==="dataChanged"||s==="ui")return;this.onModelUpdated(o)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},Gge={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"}]},Uge=class extends N2{constructor(){super(Gge,[Gv]),this.eReadOnlyText=ct,this.eDateWrapper=ct,this.FilterModelFormatterClass=M2,this.filterType="date",this.defaultOptions=r_}setParams(e){super.setParams(e),this.createDateComponent();const 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){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?po(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Vn(this.eDateWrapper,e),Vn(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,s=Lo(e),o=s==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:s};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=dE(e,this.defaultDebounceMs);return It(this.gos,{onDateChanged:Fs(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:s}=this;this.dateComp=new x2(e,t,s.column.getColDef(),this.getDateComponentParams(),n,o=>{o.setInputAriaLabel(this.getAriaLabel(s))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},Wge={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},zge=class extends yn{constructor(){super(Wge,[Gv]),this.eDateInput=ct,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&nl();const{minValidYear:s,maxValidYear:o,minValidDate:i,maxValidDate:r,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",i&&s&&qe(85),r&&o&&qe(86),i&&r){const[f,p]=[i,r].map(g=>g instanceof Date?g:po(g));f&&p&&f.getTime()>p.getTime()&&qe(87)}i?i instanceof Date?t.min=Z0(i):t.min=i:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=Z0(r):t.max=r:o&&(t.max=`${o}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return po(this.eDateInput.getValue())}setDate(e){var s;const t=this.params.filterParams.colDef.cellDataType,n=((s=this.beans.dataTypeSvc)==null?void 0:s.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Lo(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},l_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function c_(e){const{allowedCharPattern:t}=e??{};return t??null}function u_(e){return e==null||isNaN(e)?null:e}function L2(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[u_(n),u_(s)].slice(0,lp(o,t))}var jge=class extends i_{constructor(){super("numberFilter",L2,l_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:s}=this.params,o=!n&&s?s(t??null):t;super.setElementValue(e,o)}createEValue(){const e=c_(this.params),t=ss({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,s){const o=this.createManagedBean(s?new wc({allowedCharPattern:s}):new tE);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=s=>this.removeComponents(s,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(u_(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=sa(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},V2=class extends a_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=O2}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(i),()=>l(r),s,o);if(c!=null)return c}return n?`${l(i)}-${l(r)}`:i!=null?l(i):`${a}`}},Kge=class extends k2{constructor(){super(L2,l_),this.filterType="number",this.FilterModelFormatterClass=V2}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},B2=class extends Ge{constructor(e){super(),this.params=e,this.eInput=ct,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new wc((s=this.params)==null?void 0:s.config));const t=this.eInput.getGui();e.appendChild(t);const n=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:n,keydown:n})}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}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function d_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function $2(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,lp(o,t))}var qge={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},H2=class extends N2{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ct,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(qge)}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){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:s,readOnly:o}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=Kv(e.filterParams),!o){const i=dE(e.filterParams,s),r=Fs(this,this.syncUpWithParentFilter.bind(this),i);n.setValueChangedListener(r)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();Is(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Me.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:s,params:o,lastType:i}=this;let r=s.getValue();if(o.filterParams.trimInput&&(r=d_(r),s.setValue(r,!0)),n){const a=o,l=a.model,c=this.convertValue(r),u=c==null?null:{...l??{filterType:this.filterType,type:i??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else o.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(i||null,r||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},Yge=class extends Ge{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new tE),this.eTextInput=this.createManagedBean(new wc),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,s=>this.onValueChanged(s)),this.setupListeners(n,s=>this.onValueChanged(s))}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(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},Zge=class extends H2{constructor(){super(...arguments),this.FilterModelFormatterClass=V2,this.filterType="number",this.defaultOptions=l_}updateParams(e){c_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=c_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new B2({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Yge)}convertValue(e){return e?Number(e):null}},h_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Xge=class extends i_{constructor(){super("textFilter",$2,h_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,i)=>{s<i&&t.push(sa(n.getValue()))}),t}createEValue(){const e=ss({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const s=this.createManagedBean(new wc);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=i=>this.removeComponents(i,e,t),{eValuesFrom:s,eValuesTo:o}=this;n(s),n(o)}},G2=class extends a_{constructor(){super(...arguments),this.filterTypeKeys=Bge}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e;if(t){const l=u=>()=>rl(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(i),l(r),s,o);if(c!=null)return c}return n?`${i}-${r}`:i!=null?`${i}`:`${a}`}},Jge=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const s=t.lastIndexOf(n);return s>=0&&s===t.length-n.length}default:return!1}},Qge=e=>e,eme=e=>e==null?null:e.toString().toLowerCase(),tme=class extends A2{constructor(){super($2,h_),this.filterType="text",this.FilterModelFormatterClass=G2}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??Jge,this.formatter=t.textFormatter??(t.caseSensitive?Qge:eme)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,s){const o=e.map(h=>this.formatter(h))||[],i=this.formatter(t),{api:r,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return my(t);if(n.type==="notBlank")return!my(t);const d={api:r,colDef:a,column:l,context:c,node:s.node,data:s.data,filterOption:n.type,value:i,textFormatter:u};return o.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const s={...n},{filter:o,filterTo:i}=n;return o&&(s.filter=d_(o)??null),i&&(s.filterTo=d_(i)??null),s};return KL(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},nme=class extends H2{constructor(){super(...arguments),this.FilterModelFormatterClass=G2,this.filterType="text",this.defaultOptions=h_}createFloatingFilterInputService(){return this.createManagedBean(new B2)}};function sme(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function ome(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function ime(e){var t;(t=e.quickFilter)==null||t.resetCache()}var rme=class extends Ge{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.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(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:s}=this.beans,o=t.isPivotMode(),i=e==null?void 0:e.getColumns(),r=t.getColDefCols();let a=(o&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=s==null?void 0:s.getPivotResultCols())==null?void 0:l.list:r)??[];i&&(a=a.concat(i)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return ut(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){qe(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const s=this.getTextForColumn(n,e);return ut(s)&&s.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const s=e.getColDef();if(s.getQuickFilterText){const o=It(this.gos,{value:n,node:t,data:t.data,column:e,colDef:s});n=s.getQuickFilterText(o)}return ut(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const s=this.getTextForColumn(n,e);ut(s)&&t.push(s)}return t.join(`
|
|
250
250
|
`)}},ame={moduleName:"ClientSideRowModelFilter",version:lt,rowModels:["clientSide"],beans:[lge]},f_={moduleName:"FilterCore",version:lt,beans:[Fge],apiFunctions:{isAnyFilterPresent:xge,onFilterChanged:Ige},css:[pge],dependsOn:[ame]},U2={moduleName:"FilterValue",version:lt,beans:[Age]},vy={moduleName:"ColumnFilter",version:lt,beans:[Tge,Pge],dynamicBeans:{headerFilterCellCtrl:cge},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:gge,getColumnFilterInstance:mge,destroyFilter:vge,setFilterModel:yge,getFilterModel:wge,getColumnFilterModel:Cge,setColumnFilterModel:bge,showColumnFilter:Sge,hideColumnFilter:Ege,getColumnFilterHandler:_ge,doFilterAction:Rge},dependsOn:[f_,gy,U2,hge]},lme={moduleName:"CustomFilter",version:lt,userComponents:{agReadOnlyFloatingFilter:Oge},dependsOn:[vy]},cme={moduleName:"TextFilter",version:lt,dependsOn:[vy],userComponents:{agTextColumnFilter:{classImp:Xge,params:{useForm:!0}},agTextColumnFloatingFilter:nme},dynamicBeans:{agTextColumnFilterHandler:tme}},ume={moduleName:"NumberFilter",version:lt,dependsOn:[vy],userComponents:{agNumberColumnFilter:{classImp:jge,params:{useForm:!0}},agNumberColumnFloatingFilter:Zge},dynamicBeans:{agNumberColumnFilterHandler:Kge}},dme={moduleName:"DateFilter",version:lt,dependsOn:[vy],userComponents:{agDateColumnFilter:{classImp:Vge,params:{useForm:!0}},agDateInput:zge,agDateColumnFloatingFilter:Uge},dynamicBeans:{agDateColumnFilterHandler:Hge}},hme={moduleName:"QuickFilterCore",version:lt,rowModels:["clientSide"],beans:[rme],dependsOn:[f_,U2]},fme={moduleName:"QuickFilter",version:lt,apiFunctions:{isQuickFilterPresent:sme,getQuickFilter:ome,resetQuickFilter:ime},dependsOn:[hme]},pme={moduleName:"ExternalFilter",version:lt,dependsOn:[f_]},gme=".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){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}}",p_=(e,t,n)=>{var a,l,c;const{editModelSvc:s}=e,o=(l=(a=s==null?void 0:s.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,i=(c=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,r=o||i;return r!=null&&r.length?r.join(n("tooltipValidationErrorSeparator",". ")):void 0},mme=class extends Ge{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=s_(o),{column:r,eGui:a}=t,l=r.getColDef();!s&&i&&!l.headerComponent&&(s=Sv(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,It(o,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=s_(o),{column:r,eGui:a}=t,l=r.getColGroupDef();!s&&i&&!(l!=null&&l.headerGroupComponent)&&(s=Sv(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,It(o,{location:c,colDef:l,column:r,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>{const g={column:r};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:s}=this,{gos:o,editSvc:i}=s,{column:r,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(i!=null&&i.isEditing(e))&&p_(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=r.getColDef(),g=a.data;if(p.tooltipField&&ut(g))return sp(g,p.tooltipField,r.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(It(o,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=s_(o);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(i!=null&&i.isEditing(e));if(!h&&p_(s,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const g=Sv(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(i!=null&&i.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:r,colDef:r.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,s)}setupFullWidthRowTooltip(e,t,n,s){const o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},i=this.beans,r=i.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(o,i);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:s}=n,o=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!o)return;const i={getGui:()=>o,getTooltipValue:()=>p_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},r=this.createTooltipFeature(i,n);if(r)return e.createBean(r,s)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=ut(t.tooltipField)||ut(t.tooltipValueGetter)||ut(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},vme=class extends Hre{createTooltipComp(e,t){const n=kie(this.beans.userCompFactory,e);n==null||n.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){var e;(e=this.onColumnMovedEventCallback)==null||e.call(this),this.onColumnMovedEventCallback=void 0}},W2={moduleName:"Tooltip",version:lt,beans:[mme],dynamicBeans:{tooltipFeature:FL,highlightTooltipFeature:Gre,tooltipStateManager:vme},userComponents:{agTooltipComponent:zre},dependsOn:[gy],css:[gme]},bd=class{constructor(e){this.cellValueChanges=e}},g_=class extends bd{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},yme=10,z2=class{constructor(e){this.actionStack=[],this.maxStackSize=e||yme,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},wme=class extends Ge{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&TV(this.activeCellEdit,t),s=this.activeRowEdit!==null&&Gce(this.activeRowEdit,t);if(!(n||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:i,rowIndex:r,column:a,oldValue:l,value:c}=e,u={rowPinned:i,rowIndex:r,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new z2(n),this.redoStack=new z2(n),this.addListeners();const s=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:o=>{o.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:s,newColumnsLoaded:s,columnGroupOpened:s,columnRowGroupChanged:s,columnMoved:s,columnPinned:s,columnVisible:s,rowDragEnd:s}),t.whenReady(this,o=>{this.gridBodyCtrl=o.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(n,s,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(s,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,n,s,o){if(!e)return!1;const i=e.pop();return i!=null&&i.cellValueChanges?(this.processAction(i,r=>r[s],o),i instanceof g_?this.processRange(i.ranges||[i[n]]):this.processCell(i.cellValueChanges),t.push(i),!0):!1}processAction(e,t,n){for(const s of e.cellValueChanges){const{rowIndex:o,rowPinned:i,columnId:r}=s,a={rowIndex:o,rowPinned:i},l=fa(this.beans,a);l.displayed&&l.setDataValue(r,t(s),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((s,o)=>{if(!s)return;const i=s.startRow,r=s.endRow;o===e.length-1&&(t={rowPinned:i.rowPinned,rowIndex:i.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:s.startColumn,columns:s.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:s}=t,o={rowIndex:n,rowPinned:s},i=fa(this.beans,o),r={rowPinned:t.rowPinned,rowIndex:i.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:s}=e,{colModel:o,focusSvc:i,rangeSvc:r}=this.beans,a=o.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:s};i.setFocusedCell({...c,forceBrowserFocus:!0}),r==null||r.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new bd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const n=new bd(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new bd(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new g_(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&ia(n)?e=new g_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new bd(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new bd(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},Cme=".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) textarea{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}",bme={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},Sme=class extends oy{constructor(){super(bme,[eE]),this.eEditor=ct}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:o=>this.setAriaLabel(o.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=yv(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${s} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},yy=class extends oy{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ct}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:s,eventKey:o,suppressPreventDefault:i}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let r,a=!0;s?(this.focusAfterAttached=!0,o===Me.BACKSPACE||o===Me.DELETE?r="":o&&o.length===1?i?a=!1:r=o:(r=t.getStartValue(),o!==Me.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&n.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Me.PAGE_UP||c===Me.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var s,o;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;nl()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(o=(s=this.cellEditorInput).setCaret)==null||o.call(s)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},Eme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},_me=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Eme}getAgComponents(){return[yL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:s,max:o,getValidationErrors:i}=n;let r=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(s){const l=s instanceof Date?s:new Date(s);if(t<l){const c=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const c=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return r.length||(r=null),i?i({value:t,cellEditorParams:n,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!ut(n)&&!ut(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Lo(e,this.includeTime??!1)}},Rme=class extends yy{constructor(){super(new _me(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Dme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Tme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Dme}getAgComponents(){return[yL]}init(e,t){var r,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:i}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(r=this.getDataTypeService())==null?void 0:r.getDateIncludesTimeFlag)==null?void 0:a.call(r,i.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,s=this.formatDate(this.parseDate(n??void 0)),{min:o,max:i,getValidationErrors:r}=t;let a=[];if(s){const l=new Date(s),c=this.getLocaleTextFunc();if(o){const u=new Date(o);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(i){const u=new Date(i);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),r?r({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!ut(n)&&!ut(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Lo(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):po(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Lo(e??null,this.includeTime??!1)??void 0}},xme=class extends yy{constructor(){super(new Tme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Ime={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},Fme=class extends oy{constructor(){super(Ime,[Xie]),this.eEditor=ct}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:s,maxLength:o,cols:i,rows:r}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(i||60).setRows(r||10);let a;n?(this.focusAfterAttached=!0,s===Me.BACKSPACE||s===Me.DELETE?a="":s&&s.length===1?a=s:(a=this.getStartValue(e),s!==Me.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Me.LEFT||t===Me.UP||t===Me.RIGHT||t===Me.DOWN||e.shiftKey&&t===Me.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,s=this.getLocaleTextFunc();e.setInputAriaLabel(s("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,s=e.getValue();return!ut(s)&&!ut(n)?n:t.parseValue(s)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getLocaleTextFunc(),o=this.getValue();let i=[];return typeof o=="string"&&t!=null&&o.length>t&&i.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:o,internalErrors:i,cellEditorParams:e}):i}},Pme={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Ame=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Pme}getAgComponents(){return[Jie]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:s,precision:o,step:i}=t;n!=null&&e.setMax(n),s!=null&&e.setMin(s),o!=null&&e.setPrecision(o),i!=null&&e.setStep(i);const r=e.getInputElement();t.preventStepping?e.addManagedElementListeners(r,{keydown:this.preventStepping}):t.showStepperButtons&&r.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:s}=e,i=this.eEditor.getInputElement().valueAsNumber,r=this.getLocaleTextFunc();let a=[];return typeof i=="number"&&(t!=null&&i<t&&a.push(r("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&i>n&&a.push(r("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),s?s({value:i,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Me.UP||e.key===Me.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!ut(n)&&!ut(t.value))return t.value;let s=t.parseValue(n);if(s==null)return s;if(typeof s=="string"){if(s==="")return null;s=Number(s)}return isNaN(s)?null:s}getStartValue(){return this.params.value}setCaret(){nl()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},kme=class extends yy{constructor(){super(new Ame(()=>this.getLocaleTextFunc()))}},Ome={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Mme=class extends oy{constructor(){super(Ome,[cre]),this.eEditor=ct,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:s}=this,{values:o,value:i,eventKey:r}=e;if(Ln(o)){qe(58);return}this.startedByEnter=r!=null?r===Me.ENTER:!1;let a=!1;o.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||i===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,s=this.getValue();let o=[];if(t&&!t.includes(s)){const i=this.getLocaleTextFunc();o.push(i("invalidSelectionValidation","Invalid selection."))}else o=null;return n?n({value:s,internalErrors:o,cellEditorParams:e}):o}},Nme={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Lme=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Nme}getAgComponents(){return[Gv]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getValue(),o=this.getLocaleTextFunc();let i=[];return t!=null&&typeof s=="string"&&s.length>t&&i.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),i.length||(i=null),n?n({value:s,cellEditorParams:e,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!ut(n)&&!ut(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){nl()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=ut(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},j2=class extends yy{constructor(){super(new Lme(()=>this.getLocaleTextFunc()))}};function Vme(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function Bme(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function K2(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function q2(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function $me(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function Hme(e){var t;(t=e.undoRedo)==null||t.undo("api")}function Gme(e){var t;(t=e.undoRedo)==null||t.redo("api")}function Ume(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function Wme(e){var s;const t=(s=e.editModelSvc)==null?void 0:s.getEditMap(),n=[];return t==null||t.forEach((o,i)=>{const{rowIndex:r,rowPinned:a}=i;o.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=pa(l);let g=u??d;g===ui&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:r,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function zme(e,t=!1){var s;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const o of((s=e.editModelSvc)==null?void 0:s.getEditPositions())??[])o.state==="editing"&&n.revertSingleCellEdit(o);else _c(e,{persist:!0});yd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function jme(e,t){var s;const n=Gn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function Kme(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:i}=t,{editSvc:r,colModel:a}=e,l=a.getCol(s);if(!l){qe(12,{colKey:s});return}const u=fa(e,{rowIndex:o,rowPinned:i||null});if(!u){qe(290,{rowIndex:o,rowPinned:i});return}if(!l.isCellEditable(u))return;i==null&&q2(e,o),K2(e,s),r==null||r.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function qme(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function Yme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function Zme(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Xme={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Jme=class extends V0{constructor(e){super(Xme),this.params=e}postConstruct(){fc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{wE(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function Qme(e,{column:t},n,s,o="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Me.TAB||n.key===Me.ENTER||n.key===Me.F2||n.key===Me.BACKSPACE&&s))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const r=t==null?void 0:t.getColDef(),a=eve(e.gos,r),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:o==="api"?s??!1:!1}function eve(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function m_(e,{rowNode:t,column:n},s="ui"){const o=n.getColDef().editable,i=e.editModelSvc;return n.isColumnFunc(t,o)||!!i&&i.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function tve(e,t,n="ui"){const s=m_(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(i=>m_(e,{rowNode:t.rowNode,column:i},n))}var wy=(e,t=!1)=>{if(e!==void 0)return pa(e)||t&&e.state==="editing"};function Y2(e,t,n=!1){var s;return wy((s=e.editModelSvc)==null?void 0:s.getEdit(t),n)}var Z2=(e,t,n)=>{if(e)for(let s=0,o=e.length;s<o;++s){const i=e[s];if(i.data&&(wy(t==null?void 0:t.getEdit({rowNode:i,column:n}))||wy(t==null?void 0:t.getEdit({rowNode:i.pinnedSibling,column:n})))||Z2(i.childrenAfterGroup,t,n))return!0}};function X2(e,t){const{column:n,rowNode:s}=t;return e.gos.get("groupTotalRow")&&!(s!=null&&s.footer)?!1:Z2(s==null?void 0:s.childrenAfterGroup,e.editModelSvc,n)}function J2(e,{rowNode:t,column:n}){var s;if(t=t.pinnedSibling,!!t)return wy((s=e.editModelSvc)==null?void 0:s.getEdit({rowNode:t,column:n}))}var nve=class extends Ge{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(){var o;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const i=Y2(n,e)||X2(n,e)||J2(n,e);this.applyBatchingStyle(i)}else this.applyBatchingStyle(!1);const s=!!((o=this.editModelSvc)!=null&&o.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",s)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},sve=class extends Ge{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var r;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let s=e.rowNode,o=t==null?void 0:t.getEditRow(s);const i=(r=this.editModelSvc)==null?void 0:r.getRowValidationModel().hasRowValidation({rowNode:s});if(!o&&s.pinnedSibling&&(s=s.pinnedSibling,o=t==null?void 0:t.getEditRow(s)),o){const a=Array.from(o.keys()).some(l=>{const c={rowNode:s,column:l};return Y2(n,c,!0)||X2(n,c)||J2(n,c)});this.applyStyle(i,a);return}this.applyStyle(i)}applyStyle(e=!1,t=!1){var o,i;const n=((o=this.editSvc)==null?void 0:o.isBatchEditing())??!1,s=this.gos.get("editType")==="fullRow";(i=this.rowCtrl)==null||i.forEachGui(void 0,({rowComp:r})=>{r.toggleCss("ag-row-editing",s&&t),r.toggleCss("ag-row-batch-edit",s&&t&&n),r.toggleCss("ag-row-inline-editing",t),r.toggleCss("ag-row-not-inline-editing",!t),r.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},ove=({rowModel:e,pinnedRowModel:t,editModelSvc:n},s)=>{const o=new Set;e.forEachNode(i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("top",i=>s.has(i)&&o.add(i)),t==null||t.forEachPinnedRow("bottom",i=>s.has(i)&&o.add(i));for(const i of s)o.has(i)||n.removeEdits({rowNode:i});return o},ive=({editModelSvc:e},t,n)=>{var s;for(const o of t)(s=e==null?void 0:e.getEditRow(o))==null||s.forEach((i,r)=>!n.has(r)&&e.removeEdits({rowNode:o,column:r}))},rve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());ive(e,ove(e,s),t)},ave=new Set(["undo","redo","paste","bulk","rangeSvc"]),lve=new Set(["ui","api"]),Q2={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},cve=new Set(Object.keys(Q2)),uve=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Cy={cancel:!0,source:"api"},dve={cancel:!1,source:"api"},Sd={checkSiblings:!0},cp={force:!0,suppressFlash:!0},hve=class extends Ge{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:s})=>{this.stopEditing(void 0,Cy),this.createStrategy(s)});const t=rve(e),n=()=>{const s=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return s||o?this.stopEditing(void 0,Cy):this.isEditing()&&(this.isBatchEditing()?yd(e,this.model.getEditPositions()):this.stopEditing(void 0,dve)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:n,filterChanged:n,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,Cy)):(this.stopEditing(void 0,Cy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:s}=this,o=eB(n,e);if(s){if(s.beanName===o)return s;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,s="ui"){const o=Qme(this.beans,e,t,n,s);return o&&(this.strategy??(this.strategy=this.createStrategy())),o}shouldStopEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldCancel(e,t,n))??null}validateEdit(){return Tfe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??Sd)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:s=null,source:o="ui",ignoreEventKey:i=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Gn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,s,n,o);if(l===!1&&o!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing&&this.stopEditing(void 0,{source:o}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:s,source:o,ignoreEventKey:i,startedEdit:n,silent:r})}stopEditing(e,t){var v,w,b;const{event:n,cancel:s,source:o="ui",forceCancel:i,forceStop:r}=t||{},{beans:a,model:l}=this;if(cve.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?Q2[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,Sd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Gn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!s&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(r??!1),g=s&&!!this.shouldCancelEditing(e,n,c)||(i??!1);if(p||g){_c(a,{persist:!0,isCancelling:g||s,isStopping:p});const S=l.getEditMap(),C=this.processEdits(S,s,o);(v=this.strategy)==null||v.stop(s,n);for(const E of C)l.clearEditValue(E);this.bulkRefresh(void 0,h);for(const E of l.getEditPositions(S)){const R=Gn(a,E),T=pa(E);R==null||R.refreshCell({force:!0,suppressFlash:!T})}h=S,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((w=this.strategy)!=null&&w.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:S}=n,C=S===Me.ENTER,E=S===Me.ESCAPE,R=S===Me.TAB;(C||R||E)&&(C||R?_c(a,{persist:!0}):E&&this.revertSingleCellEdit(d),this.isBatchEditing()?(b=this.strategy)==null||b.cleanupEditors():yd(a,l.getEditPositions(),{event:n,cancel:E}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else _c(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),YE(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:s}=e;if(!(n instanceof KeyboardEvent)||s)return;const{key:i,shiftKey:r}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(i!==Me.ENTER||!a)return;const l=r?Me.UP:Me.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const s=Array.from(e.keys()),o=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,i=[];for(const r of s){const a=e.get(r);for(const l of a.keys()){const c=a.get(l),u={rowNode:r,column:l},d=pa(c);!t&&d&&!o&&(this.setNodeDataValue(r,l,c.pendingValue,void 0,n)||i.push(u))}}return i}setNodeDataValue(e,t,n,s,o="edit"){const{beans:i}=this,r=Gn(i,{rowNode:e,column:t}),a=lve.has(o)?"edit":o;r&&(r.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return r&&(r.suppressRefreshCell=!1),s&&(r==null||r.refreshCell(cp)),l}setEditMap(e,t){var s;this.strategy??(this.strategy=this.createStrategy()),(s=this.strategy)==null||s.setEditMap(e,t),this.bulkRefresh();let n=cp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...fve(e),...cp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:s,sourceValue:o}=n,{rowIndex:i,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:i,rowPinned:r,column:t,source:"api",data:a,newValue:s,oldValue:o,value:s,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:s,gos:o}=this,{editModelSvc:i,rowModel:r}=s;ts(o)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=i==null?void 0:i.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,s={}){var d,h,f;const{beans:o,gos:i}=this,r=new Set([e]),a=new Set,l=e.pinnedSibling;l&&r.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&i.get("groupTotalRow")||!u.parent&&u.sibling&&i.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of r)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of r)(h=Gn(o,{rowNode:p,column:t}))==null||h.refreshCell(s);for(const p of a)(f=Gn(o,{rowNode:p,column:t}))==null||f.refreshCell(s)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:s,beans:o}=this;if(n.group){if(s.get("treeData")){if(!n.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}const i=eB(s)==="fullRow"?tve(o,e,t):m_(o,e,t);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var s,o,i,r;if(this.hasValidationErrors(e)){const a=Gn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((s=t==null?void 0:t.preventDefault)==null||s.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(r=(i=(o=a==null?void 0:a.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var s,o,i,r;const n=Gn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(yd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),vd(this.beans,e,{silent:!0}),Rc(this.beans),n==null||n.refreshCell(cp),t&&(n==null||n.focusCell(),(r=(i=(o=n==null?void 0:n.comp)==null?void 0:o.getCellEditor())==null?void 0:i.focusIn)==null||r.call(i)))}hasValidationErrors(e){var s;Rc(this.beans);const t=Gn(this.beans,e);t&&(t.refreshCell(cp),(s=t.rowCtrl.rowEditStyleFeature)==null||s.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,s="ui"){var a;let o;const i=this.isEditing(),r=i&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof wd&&i&&(o=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,s,r)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!r&&this.stopEditing()),o}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let s=this.model.getEdit({rowNode:e,column:t});const o=e.pinnedSibling;if(o){const r=this.model.getEdit({rowNode:o,column:t});r&&(s=r)}const i=n?(s==null?void 0:s.editorValue)??(s==null?void 0:s.pendingValue):s==null?void 0:s.pendingValue;return i===ui||!s?(s==null?void 0:s.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):i}addStopEditingWhenGridLosesFocus(e){bfe(this,this.beans,e)}createPopupEditorWrapper(e){return new Jme(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!uve.has(n))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const i=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||ave.has(n))return dy(o,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const r=this.model.getEdit(e);if(r){if(r.pendingValue===t)return!1;if(r.sourceValue!==t)return dy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0;if(r.sourceValue===t)return(s=o.editModelSvc)==null||s.removeEdits(e),this.dispatchEditValuesChanged(e,{...r,pendingValue:t}),!0}return dy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){_fe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,Sd))return;const{rowNode:s,column:o}=e,{compDetails:i,valueToDisplay:r}=t;if(i){const{params:l}=i;return l.data=this.model.getEditRowDataValue(s,Sd),{compDetails:i}}const a=this.model.getEditRow(e.rowNode,Sd);if(r!==void 0&&(a!=null&&a.has(o)))return{valueToDisplay:this.valueSvc.getValue(o,s)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,s){var o;(o=this.strategy)==null||o.dispatchCellEvent(e,t,n,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return It(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},n){var c,u;if(!n||n.length===0)return;const{beans:s,rangeSvc:o,valueSvc:i}=this;_c(s,{persist:!0});const r=this.model.getEditMap(!0),a=(u=(c=r.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(o==null||o.forEachRowInRange(d,h=>{const f=fa(s,h);if(f===void 0)return;const p=r.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=i.getValue(g,f,!0,"api");let w=i.parseValue(g,f??null,a,v);Number.isNaN(w)&&(w=null),p.set(g,{editorValue:void 0,pendingValue:w,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&r.set(f,p)}),this.setEditMap(r),this.batch){this.cleanupEditors(),YE(s),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(r)})}),this.bulkRefresh();const l=Gn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new nve(e,t)}createRowStyleFeature(e,t){return new sve(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:s,valueSvc:o}=n,i=new Map;for(let{colId:r,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=r?s.getCol(r):l?s.getCol(l):a;if(!f)continue;const p=fa(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!pa({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=i.get(p);v||(v=new Map,i.set(p,v)),d===void 0&&(d=ui),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(i,t)}onCellFocused(e){var i;const t=Gn(this.beans,e);if(!t||!this.isEditing(t,Sd))return;const n=this.model.getEdit(t);if(!n||!pa(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(i=this.beans.ariaAnnounce)==null||i.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Gn(this.beans,e)}};function fve(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 eB(e,t){return t??e.get("editType")??"singleCell"}var tB=class extends Ge{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:s,beans:o}=this,i=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Gn(o,n));const{gos:r,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:fa(o,{rowIndex:u,rowPinned:d})},f=r.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?s.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:i}):!0)||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var o,i;const n=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const r of n){s.all.push(r);const a=this.model.getCellValidationModel().getCellValidation(r);if((((o=a==null?void 0:a.errorMessages)==null?void 0:o.length)??0)>0){s.fail.push(r);continue}s.pass.push(r)}if(e)for(const r of n)hy(this.beans,r,{cancel:e}),this.model.stop(r);else{const r=this.processValidationResults(s);if(r.destroy.length>0)for(const a of r.destroy)hy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(r.keep.length>0)for(const a of r.keep){const l=Gn(this.beans,a);(i=this.editSvc)!=null&&i.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){_c(this.beans,{persist:!1});const n=this.model.getEditPositions(),s=[];if(e)for(const o of n)o.rowNode!==e&&s.push(o);else for(const o of n)s.push(o);yd(this.beans,s),YE(this.beans,t)}setFocusOutOnEditor(e){var t,n,s;(s=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||s.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const s=this.beans.gos.get("editType")==="fullRow";e.focusCell(s),e.onEditorAttachedFuncs.push(()=>{var o,i;return(i=(o=t==null?void 0:t.getCellEditor())==null?void 0:o.focusIn)==null?void 0:i.call(o)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:s,position:o,cells:i=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!n&&t.key||void 0;Efe(this.beans,i,o,r,t,s)}dispatchCellEvent(e,t,n,s){const o=Gn(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,n),...s})}dispatchRowEvent(e,t,n){if(n)return;const s=KE(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return s&&n==="api"?!0:s&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!s?t.key===Me.ENTER:null}shouldCancel(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!s&&t.key===Me.ESCAPE||s&&n==="api"||n==="api")}setEditMap(e,t){var s;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((o,i)=>{o.forEach((r,a)=>{r.state==="editing"&&n.push({...r,rowNode:i,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(s=this.model)==null||s.setEditMap(e),n.length>0){const o=n.at(-1),i=o.pendingValue===ui?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const r=Gn(this.beans,o);r&&this.setFocusInOnEditor(r)}}destroy(){this.cleanupEditors(),super.destroy()}},pve=class extends tB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!KE(this.beans,{rowNode:this.rowNode}))return!0;const i=super.shouldStop({rowNode:this.rowNode},t,n);return i!==null?i:this.rowNode?s!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:s,event:o,ignoreEventKey:i}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(r)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:r},"rowEditingStarted",n),this.startedRows.push(r);for(const u of c){const d={rowNode:r,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=r,this.setupEditors({cells:l,position:t,startedEdit:s,event:o,ignoreEventKey:i})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var o;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const s=[];if(e||this.model.getEditMap().forEach((i,r)=>{if(!(!i||i.size===0)){for(const a of i.values())if(pa(a)){s.push(r);break}}}),Rc(this.beans),!e&&((o=this.editSvc)==null?void 0:o.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const i of s)this.dispatchRowEvent({rowNode:i},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const s=Gn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&s&&(this.model.getCellValidationModel().getCellValidation(s)||this.model.getRowValidationModel().getRowValidation(s))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,s="ui",o=!1){var h,f,p,g;const i=e.cellPosition;let r;this.model.suspend(!0);try{r=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(i,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(r===!1)return null;if(r==null)return!1;const a=r.cellPosition,l=e.isCellEditable(),c=r.isCellEditable(),u=a&&i.rowIndex===a.rowIndex&&i.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!o?d?r.focusCell(!0,n):((f=r.comp)!=null&&f.getCellEditor()||vd(this.beans,r,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,n)):(c&&o&&this.setFocusInOnEditor(r),r.focusCell(!0,n)),!u&&!o&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(r,!0),d?r.focusCell(!0,n):this.editSvc.startEditing(r,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},s)=>{var i;if(n!=="editing")return;const o=Gn(this.beans,{rowNode:t,column:s});o&&!((i=o.comp)!=null&&i.getCellEditor())&&vd(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},gve=class extends tB{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const s=super.shouldStop(e,t,n);if(s!==null)return s;const{rowNode:o,column:i}=e||{};return(!this.rowNode||!this.column)&&o&&i?null:this.rowNode!==o||this.column!==i}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:s,ignoreEventKey:o}=e;(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:n,event:s,ignoreEventKey:o})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:s,column:o,rowPinned:i}=e,r=fa(this.beans,{rowIndex:s,rowPinned:i}),a=qE(o),l=t.getCol(a),c=e.previousParams;if(c){const u=qE(c.column);if((c==null?void 0:c.rowIndex)===s&&u===a&&(c==null?void 0:c.rowPinned)===i)return}n!=null&&n.isEditing({rowNode:r,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,s="ui",o=!1){var p,g,v,w,b,S;const i=this.beans.focusSvc.getFocusedCell();i&&(e=gd(this.beans,i)??e);const r=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),o||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&r.rowIndex===c.rowIndex&&r.rowPinned===c.rowPinned;u&&!o&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!o&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),d&&!o){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((w=a.comp)!=null&&w.getCellEditor())){const C=(b=this.editSvc)==null?void 0:b.isEditing(a,{withOpenEditor:!0});vd(this.beans,a,{event:n,cellStartedEdit:!0,silent:C}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&o&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(S=e.rowCtrl)==null||S.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},ul={moduleName:"EditCore",version:lt,beans:[Cfe,hve],apiFunctions:{getEditingCells:Wme,getEditRowValues:Ume,getCellEditorInstances:Sfe,startEditingCell:Kme,stopEditing:zme,isEditing:jme,validateEdit:qme},dynamicBeans:{singleCell:gve,fullRow:pve},dependsOn:[gy,W2],css:[Cme]},mve={moduleName:"UndoRedoEdit",version:lt,beans:[wme],apiFunctions:{undoCellEditing:Hme,redoCellEditing:Gme,getCurrentUndoSize:Yme,getCurrentRedoSize:Zme},dependsOn:[ul]},vve={moduleName:"TextEditor",version:lt,userComponents:{agCellEditor:j2,agTextCellEditor:j2},dependsOn:[ul]},yve={moduleName:"NumberEditor",version:lt,userComponents:{agNumberCellEditor:{classImp:kme}},dependsOn:[ul]},wve={moduleName:"DateEditor",version:lt,userComponents:{agDateCellEditor:Rme,agDateStringCellEditor:xme},dependsOn:[ul]},Cve={moduleName:"CheckboxEditor",version:lt,userComponents:{agCheckboxCellEditor:Sme},dependsOn:[ul]},bve={moduleName:"SelectEditor",version:lt,userComponents:{agSelectCellEditor:Mme},dependsOn:[ul]},Sve={moduleName:"LargeTextEditor",version:lt,userComponents:{agLargeTextCellEditor:Fme},dependsOn:[ul]},Eve={moduleName:"CustomEditor",version:lt,dependsOn:[ul]},_ve=class extends Ge{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,rd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Moe(e))}createColumns(e,t){var h,f;const n=()=>{var p;Mv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},s=e.treeDepth,i=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==s,r=this.generateSelectionCols();if(Ooe(r,((f=this.columns)==null?void 0:f.list)??[])&&i)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(r,c))??[];this.columns={list:r,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!aa(v));return[...r,...g]})}updateColumns(e){var n;const t=rd(e.source);for(const s of((n=this.columns)==null?void 0:n.list)??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),Vi(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>zf(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var r,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!dc(e))return!1;const s=(((a=(r=t.autoColSvc)==null?void 0:r.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&s)return!1;const o=!!id(n),i=Iv(n);return o||i}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:o,spanRows:i,...r}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...r,colId:UN,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new pc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const s=t&&typeof t!="string"?id(t):void 0,o=e&&typeof e!="string"?id(e):void 0,i=s!==o,r=t&&typeof t!="string"?Iv(t):void 0,a=e&&typeof e!="string"?Iv(e):void 0,l=r!==a,c=Fv(e),u=Fv(t);(i||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Mv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const s=e.length+t.length+n.length;if(s===0)return;const o=this.columns.list[0];if(!o.isVisible())return;const i=()=>{let u;switch(o.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&Li(u,o)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(WN))?2:1)===s&&i()}};function Rve(e,t){var r;if(!t.nodes.every(a=>a.rowPinned&&!ep(a)?(qe(59),!1):a.id===void 0?(qe(60),!1):!0))return;const{nodes:s,source:o,newValue:i}=t;(r=e.selectionSvc)==null||r.setNodesSelected({nodes:s,source:o??"api",newValue:i})}function Dve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function Tve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function xve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function Ive(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function Fve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function Pve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function Ave(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function kve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var Ove=class extends Kle{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=Pv(e),this.groupSelectsDescendants=Uf(e),this.groupSelectsFiltered=Av(e)==="filteredDescendants",this.masterSelectsDetail=VN(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Uf(e),n=Pv(e),s=Av(e)==="filteredDescendants";this.masterSelectsDetail=VN(e)==="detail",(t!==this.groupSelectsDescendants||s!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=s,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const s=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(s==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in s)return s.reset?this.resetNodes():this.selectRange(s.deselect,!1,n),this.selectRange(s.select,!0,n);{const o=s.checkFilteredNodes?sB(s.node):s.newValue;return this.setNodesSelected({nodes:[s.node],newValue:o,clearSelection:s.clearSelection,keepDescendants:s.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:s,event:o,source:i,keepDescendants:r=!1}){var c;if(s.length===0)return 0;const{gos:a}=this;if(!dc(a)&&e)return qe(132),0;if(s.length>1&&!this.isMultiSelect())return qe(130),0;let l=0;for(let u=0;u<s.length;u++){const d=s[u],h=Ed(d);if(h.rowPinned&&!ep(h)){qe(59);continue}if(h.id===void 0){qe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,i)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,i))}return n||(s.length===1&&i==="api"&&this.selectionCtx.setRoot(Ed(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Ed(s[0]),r,i)),l>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i))),l}selectRange(e,t,n){let s=0;return e.forEach(o=>{const i=Ed(o);if(i.group&&this.groupSelectsDescendants)return;this.selectRowNode(i,t,void 0,n)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),s}selectChildren(e,t,n){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:s}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,s)=>{e(n)&&t.set(s,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:s}=this.beans;if(!ts(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new np(!0,o),t.active=!1);let i=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==o){const a=this.calculateSelectedFromChildren(r);i=this.selectRowNode(r,a===null?!1:a,void 0,e)||i}}),i}clearOtherNodes(e,t,n){const s=new Map;let o=0;return this.selectedNodes.forEach(i=>{const r=i.id==e.id;if((t?!Nve(e,i):!0)&&!r){const l=this.selectedNodes.get(i.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&i.parent&&s.set(i.parent.id,i.parent)}}),s.forEach(i=>{const r=this.calculateSelectedFromChildren(i);this.selectRowNode(i,r===null?!1:r,void 0,n)}),o}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new ol(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!ts(e))return;const n=t.getTopLevelNodes();if(n===null)return;const s=[];function o(i){for(let r=0,a=i.length;r<a;r++){const l=i[r];l.isSelected()?s.push(l):l.group&&l.childrenAfterGroup&&o(l.childrenAfterGroup)}}return o(n),s}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=ts(this.gos);let s=!1;const o=i=>{const r=this.selectRowNode(Ed(i),!1,void 0,e);s||(s=r)};if(t==="currentPage"||t==="filtered"){if(!n){bn(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(e);s||(s=i)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(s=>{this.groupSelectsDescendants&&s.group||(s.isSelected()?t++:s.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return nB(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=o=>t.push(o);if(e==="currentPage")return this.forEachNodeOnPage(o=>{if(!o.group){n(o);return}if(!o.expanded&&!o.footer){const i=r=>{var a;n(r),(a=r.childrenAfterFilter)==null||a.forEach(i)};i(o);return}this.groupSelectsDescendants||n(o)}),t;const s=this.beans.rowModel;return e==="filtered"?(s.forEachNodeAfterFilter(n),t):(s.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,s=t.getFirstRow(),o=t.getLastRow();for(let i=s;i<=o;i++){const r=n.getRow(i);r&&e(r)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!dc(t)){qe(132);return}if(boe(t)&&!Gf(t)){qe(130);return}if(!this.canSelectAll())return;const{source:s,selectAll:o}=e;let i=!1;if(this.getNodesToSelect(o).forEach(r=>{const a=this.selectRowNode(Ed(r),!0,void 0,s);i||(i=a)}),n.selectAll=!0,ts(t)&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(s);i||(i=r)}i&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){bn(103);return}const s=new Set(e),o=[];this.beans.rowModel.forEachNode(i=>{s.has(i.id)&&o.push(i)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return ts(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!dc(t))return;const s="selectableChanged",o=e!==void 0,i=ts(t)&&this.groupSelectsDescendants,r=[],a=c=>{var d;if(o&&!c.group)return;if(i&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&r.push(c)};if(i){if(e===void 0){const c=n.rootNode;e=c?new np(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!o,!o)}else n.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:s}),!o&&i&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,s))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var i,r;if(!this.masterSelectsDetail)return;const n=(r=(i=e.detailNode)==null?void 0:i.detailGridInfo)==null?void 0:r.api;if(!n)return;const s=Mve(n);if(e.isSelected()!==s&&this.selectRowNode(e,s,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!s){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!Gf(t)){qe(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const s=this.detailSelection.get(e.id);if(s){const o=[];for(const i of s){const r=n.getRowNode(i);r&&o.push(r)}n.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Ed(e){return ep(e)?e.pinnedSibling:e.footer?e.sibling:e}function Mve(e){let t=0,n=0;return e.forEachNode(s=>{s.isSelected()?t++:s.selectable&&n++}),nB(t,n)}function nB(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function Nve(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function sB(e){var s;const t=e.isSelected()===!1,n=((s=e.childrenAfterFilter)==null?void 0:s.some(sB))??!1;return t||n}var Lve={moduleName:"SharedRowSelection",version:lt,beans:[_ve],apiFunctions:{setNodesSelected:Rve,selectAll:Dve,deselectAll:Tve,selectAllFiltered:xve,deselectAllFiltered:Ive,selectAllOnCurrentPage:Fve,deselectAllOnCurrentPage:Pve,getSelectedNodes:Ave,getSelectedRows:kve}},Vve={moduleName:"RowSelection",version:lt,rowModels:["clientSide","infinite","viewport"],beans:[Ove],dependsOn:[Lve]};function Bve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function $ve(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function oB(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function iB(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){qe(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function Hve(e,t,n){var o,i;const s=Gpe(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){bn(238);return}s.setRowCount(t,n);return}bn(28);return}(i=py(e))==null||i.setRowCount(t,n)}function Gve(e){var t;return nd(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function Uve(e){return e.rowModel.isLastRowIndexKnown()}var Wve={moduleName:"CsrmSsrmSharedApi",version:lt,apiFunctions:{expandAll:Bve,collapseAll:$ve}},zve={moduleName:"RowModelSharedApi",version:lt,apiFunctions:{onRowHeightChanged:oB,resetRowHeights:iB}},jve={moduleName:"SsrmInfiniteSharedApi",version:lt,apiFunctions:{setRowCount:Hve,getCacheBlockState:Gve,isLastRowIndexKnown:Uve}},Kve=class extends Ge{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(s=>{var i;if(!s){bn(18),t||bn(20);return}if(this.isGridApi(s))return s;const o=s;return"current"in o?(i=o.current)==null?void 0:i.api:(o.api||bn(19),o.api)}).filter(s=>!!s&&!s.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(s=>{n.push(t(s))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":qe(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let s=null;n&&(s=t.getProvidedColGroup(n.getGroupId())),!(n&&!s)&&t.setColumnGroupOpened(s,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const s=this.beans,{colResize:o,ctrlsSvc:i,colModel:r}=s;if(t&&(n=r.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Vi(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Vi(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Vi(s,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];o==null||o.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=i.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},qve={moduleName:"AlignedGrids",version:lt,beans:[Kve],dependsOn:[UV]},Yve=class extends Ge{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},rB(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:s}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const o=rB(this.rootNode),i=new Array(e.length);o._leafs=i;let r=0;const a=s==null?void 0:s.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=r,i[r++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const w=a(g);w&&c(v,w)}}};c(o,e),i.length=r}setImmutableRowData(e,t){var w;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=od(s),i=e.changedRowNodes,{adds:r,updates:a}=i,l=new Set,c=[],u=(w=this.beans.groupStage)==null?void 0:w.getNestedDataGetter();let d=s.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(b,S)=>{if(!d&&d!==void 0){const C=b.sourceRowIndex;d=C<=h,h=C}b.data!==S&&(b.updateData(S),r.has(b)||a.add(b),!b.selectable&&b.isSelected()&&c.push(b))},g=(b,S,C)=>{for(let E=0,R=S.length;E<R;++E){const T=S[E];if(!T)continue;let A=this.getRowNode(o({data:T,level:C}));if(A?(p(A,T),f||(f=!!u&&A.treeParent!==b)):(A=this.createRowNode(T,C),r.add(A)),!u||l.has(A)){l.add(A);continue}l.add(A),A.treeParent=b;const k=u(T);k&&g(A,k,C+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,i,c)||d||r.size>0;if(v){const b=n._leafs??(n._leafs=[]);d===void 0?eye(b,l,i):Qve(b,l)&&(i.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const s=this.rootNode._leafs;for(let o=0,i=s.length;o<i;o++){const r=s[o];e.has(r)||(t.add(r),r.isSelected()&&n.push(r),this.deleteNode(r))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return qe(268),{remove:[],update:[],add:[]};const n=[],s=od(this.gos),o=this.executeRemove(s,e,t,n),i=this.executeUpdate(s,e,t,n),r=this.executeAdd(e,t);return this.deselect(n),{remove:o,update:i,add:r}}executeRemove(e,{remove:t},{adds:n,updates:s,removals:o},i){const r=this.rootNode._leafs,a=r==null?void 0:r.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&i.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(s.delete(g),o.add(g)),f[c++]=g}return f.length=c,c&&Jve(r,u,d,o,h),f}executeUpdate(e,{update:t},{adds:n,updates:s},o){const i=t==null?void 0:t.length;if(!i)return[];const r=new Array(i);let a=0;for(let l=0;l<i;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&o.push(u),r[a++]=u,n.has(u)||s.add(u))}return r.length=a,r}executeAdd(e,t){var n;const s=(n=this.rootNode)._leafs??(n._leafs=[]),o=s.length,i=e.add,r=i==null?void 0:i.length;if(!r)return[];const a=o+r;let l=this.sanitizeAddIndex(s,e.addIndex);if(l<o){for(let d=o-1,h=a-1;d>=l;--d){const f=s[d];f.sourceRowIndex=h,s[h--]=f}t.reordered=!0}s.length=a;const c=new Array(r),u=t.adds;for(let d=0;d<r;d++){const h=this.createRowNode(i[d],0);u.add(h),h.sourceRowIndex=l,s[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var s;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(s=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||s.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new ol(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const s=n.id,o=this.allNodesMap;return o[s]&&qe(2,{nodeId:s}),o[s]=n,n}deleteNode(e){var o;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const s=e.pinnedSibling;s&&((o=this.beans.pinnedRowModel)==null||o.pinRow(s,null))}lookupNode(e,t){if(!e)return Xve(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(bn(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const s=this.gos;return t>0&&s.get("treeData")&&s.get("getDataPath")&&(t=Zve(e,t)),t}},Zve=(e,t)=>{for(let n=0,s=e.length;n<s;n++){const o=e[n];if((o==null?void 0:o.rowIndex)==t-1)return n+1}return t},rB=e=>{var r;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((r=e._leafs)==null?void 0:r.length)!==0&&(e._leafs=[]);const t=[],n=[],s=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=s,e.childrenAfterFilter=o;const i=e.sibling;return i&&(i.childrenAfterGroup=t,i.childrenAfterSort=n,i.childrenAfterAggFilter=s,i.childrenAfterFilter=o,i.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},Xve=(e,t)=>{if(e)for(let n=0,s=e.length;n<s;n++){const o=e[n];if(o.data===t)return o}return bn(5,{data:t}),null},Jve=(e,t,n,s,o)=>{t=Math.max(0,t);for(let i=t,r=e.length;i<r;++i){const a=e[i];i<=n&&(s.has(a)||o!=null&&o.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},Qve=(e,t)=>{const n=t.size;e.length=n;let s=0,o=!1,i=!1;for(const r of t){const a=r.sourceRowIndex;a===s?i||(i=o):(a>=0?i=!0:o=!0,r.sourceRowIndex=s,e[s]=r),++s}return i},eye=(e,t,{removals:n,adds:s})=>{const o=e.length;e.length=t.size;let i=0;for(let r=0;r<o;++r){const a=e[r];n.has(a)||(i!==r&&(a.sourceRowIndex=i,e[i]=a),++i)}for(const r of s)r.sourceRowIndex<0&&(r.sourceRowIndex=i,e[i++]=r);e.length=i},aB=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let s=0,o=t.length-1;s<=o;s++){const i=t[s],r=s===0,a=s===o;i.firstChild!==r&&(i.firstChild=r,i.dispatchRowEvent("firstChildChanged")),i.lastChild!==a&&(i.lastChild=a,i.dispatchRowEvent("lastChildChanged")),i.childIndex!==s&&(i.childIndex=s,i.dispatchRowEvent("childIndexChanged"))}},tye=class extends Ge{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,s){const{gos:o,colModel:i,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=o.get("groupMaintainOrder"),d=i.getCols().some(b=>b.isRowGroupActive()),h=r==null?void 0:r.columns,f=i.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const w=b=>{var R,T;const S=f&&b.leafGroup;let C=u&&d&&!b.leafGroup;C&&(v??(v=this.shouldSortContainsGroupCols(e)),C&&(C=!v));let E=null;if(C){let A=!1;if(h){const k=b.level+1;k<h.length&&(A=h[k].getSort()===null)}A||(E=oye(b))}else!e.length||S||(t&&n?E=nye(a,b,n,s,e):E=a.doFullSort(b.childrenAfterAggFilter,e));if(E||(E=((R=b.childrenAfterAggFilter)==null?void 0:R.slice(0))??[]),g||(g=((T=b.childrenAfterSort)==null?void 0:T[0])!==E[0]),b.childrenAfterSort=E,aB(b),p){const A={nodes:b.childrenAfterSort};p(A)}};if(s==null||s.forEachChangedNodeDepthFirst(w),g&&o.get("groupHideOpenParents")){const b=c==null?void 0:c.getShowRowGroupCols();b!=null&&b.length&&l.refreshCells({columns:b,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(wr(this.gos)){for(let n=0;n<t;++n){const s=e[n].column;if(s.isPrimary()&&s.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},nye=(e,t,n,s,o)=>{const i=t.childrenAfterAggFilter,r=t.childrenAfterSort;if(!r)return e.doFullSort(i,o);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=i.length;h<f;++h){const p=i[h];c.has(p)||u.has(p)||s&&!s.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=r.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(o,h,f)),sye(e,o,l,d)},sye=(e,t,n,s)=>{let o=0,i=0;const r=n.length,a=s.length,l=new Array(r+a);let c=0;for(;o<r&&i<a;){const u=n[o],d=s[i];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++o):(l[c++]=d.rowNode,++i)}for(;o<r;)l[c++]=n[o++].rowNode;for(;i<a;)l[c++]=s[i++].rowNode;return l},oye=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,s=t==null?void 0:t.length,o=n==null?void 0:n.length;if(!s||!o)return null;const i=new Array(o),r=new Set;for(let l=0;l<o;++l)r.add(n[l]);let a=0;for(let l=0;l<s;++l){const c=t[l];r.delete(c)&&(i[a++]=c)}if(r.size===0&&a===s)return t;for(const l of r)i[a++]=l;return i.length=a,i},iye=class extends Ge{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Fs(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new ol(e);this.rootNode=t,this.nodeManager=this.createBean(new Yve(t));const n=this.refreshModel.bind(this,{step:"group"}),s=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(s=>!!s);this.stages=n;for(let s=n.length-1;s>=0;--s)for(const o of n[s].refreshProps)t.set(o,s);this.addManagedPropertyListeners([...t.keys()],s=>{var i;const o=(i=s.changeSet)==null?void 0:i.properties;o&&this.onPropChange(o)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,s){let o,i=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,n),c=Math.min(a,s);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=Qa(this.beans,d);d.setRowHeight(h.height),o=!0,i=!0}}o&&this.setRowTopAndRowIndex()}while(o);return i}onPropChange(e){const{nodeManager:t,gos:n,beans:s}=this,o=s.groupStage;if(!t)return;const i=new Set(e),r=o==null?void 0:o.onPropChange(i);let a;i.has("rowData")?a=n.get("rowData"):r&&(a=o==null?void 0:o.extractData()),a&&!Array.isArray(a)&&(a=null,qe(1));const l={step:"nothing",changedProps:i};a&&(!r&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new ry,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,s=t.length;let o=s;for(let i=0,r=e.length;i<r&&o;++i)o=Math.min(o,n.get(e[i])??o);return o<s?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,s=t.environment.getDefaultRowHeight();let o=0;const i=Ps(this.gos,"normal");for(let r=0,a=n.length;r<a;++r){const l=n[r],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=Qa(t,l,i,s);l.setRowHeight(u.height,u.estimated)}l.setRowTop(o),l.setRowIndex(r),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,s=r=>{(r==null?void 0:r.id)!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{s(r),s(r.detailNode),s(r.sibling);const a=r.childrenAfterGroup;if(!r.hasChildren()||!a)return;const l=r.level==-1;if(!(n&&!l&&!r.expanded))for(let u=0,d=a.length;u<d;++u)o(a[u])},i=this.rootNode;i&&o(i)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var o,i;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const s=(o=e.sibling)!=null&&o.displayed?1:0;return(((i=e.childrenAfterSort)==null?void 0:i.length)??0)+s}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:s}=this;if(!n||!s.length||s[0]===n)return e;const i=n.childrenAfterSort,r=l=>{let c=i[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(s,e,i,r):r(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let o=this.getRow(e);o.footer&&(o=o.sibling);let i=o.parent;for(;i&&i!==t;)o=i,i=o.parent;const r=((a=t.childrenAfterSort)==null?void 0:a.indexOf(o))??-1;return r>=0?r:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:sd(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const s=t.length===0||t.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:sd(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:sd(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new np(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:s}=e;return!(!t||n||!s||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:s,started:o,refreshingModel:i}=this;if(!t)return;const r=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&r));if(o&&r&&s.dispatchEvent({type:"rowDataUpdated"}),!o||i||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=r);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),r&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,s=!1;const o=[],i=Uf(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(s)return;if(n&&(r===t||r===e)&&(s=!0,i&&r.group)){lB(o,r);return}if(!n){if(r!==t&&r!==e)return;n=!0,t===e&&(s=!0)}(!r.group||!i)&&o.push(r)}),o}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let s=0,o=n-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let r=-1,a=-1;for(;;){const l=Math.floor((s+o)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?s=l+1:c.rowTop>e&&(o=l-1),r===s&&a===o))return l;r=s,a=o}}isRowInPixel(e,t){const n=e.rowTop,s=n+e.rowHeight;return n<=t&&s>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,s=t.length;n<s;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:s,rowGroupColsSvc:o}=this.beans;if(!s.isPivotMode())return;if(!(o!=null&&o.columns.length)){e(this.rootNode,0);return}const i=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,r=>r.leafGroup?null:r[i])}depthFirstSearchRowNodes(e,t=!1,n=i=>i.childrenAfterGroup,s=this.rootNode,o=0){let i=o;if(!s)return i;const r=s===this.rootNode;if(r||e(s,i++),s.hasChildren()&&!s.footer){const a=n(s);if(a){const l=this.beans.footerSvc;i=(l==null?void 0:l.addTotalRows(i,s,e,t,r,"top"))??i;for(const c of a)i=this.depthFirstSearchRowNodes(e,t,n,c,i);return(l==null?void 0:l.addTotalRows(i,s,e,t,r,"bottom"))??i}}return i}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(s=>{s.childrenAfterSort=s.childrenAfterAggFilter.slice(0),aB(s)})}doGrouping(e){var o;const t=this.rootNode,n=this.beans.groupStage,s=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(s===void 0){const i=t._leafs;t.childrenAfterGroup=i,t.updateHasChildren();const r=t.sibling;r&&(r.childrenAfterGroup=i)}(s||e.rowDataUpdated)&&((o=this.beans.colFilter)==null||o.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,T2(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var s,o;const t=(s=this.nodeManager)==null?void 0:s.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(lE)===0?(o=this.beans.groupStage)==null?void 0:o.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:s}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const o=[],i=[],r=new ry;for(const{rowDataTransaction:l,callback:c}of s??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,r);o.push(u),c&&i.push(c.bind(null,u))}this.commitTransactions(r),i.length>0&&setTimeout(()=>{for(let l=0,c=i.length;l<c;l++)i[l]()},0),o.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var o;const t=this.nodeManager;if(!t)return null;(o=this.beans.valueCache)==null||o.onDataChanged(),this.rowNodesCountReady=!0;const n=new ry,s=t.updateRowData(e,n);return this.commitTransactions(n),s}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const s=this.rootNode.childrenAfterSort??[];for(const o of s)o.setUiLevel(0);this.rowsToDisplay=s}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const s=t.sibling;s==null||s.setRowHeight(s.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},lB=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let s=0,o=n.length;s<o;++s){const i=n[s];i.data&&e.push(i),i.group&&lB(e,i)}};function rye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function aye(e,t){const n=cl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function lye(e){var t;return((t=cl(e))==null?void 0:t.isEmpty())??!0}function cye(e,t){var n;(n=cl(e))==null||n.forEachLeafNode(t)}function uye(e,t){var n;(n=cl(e))==null||n.forEachNodeAfterFilter(t)}function dye(e,t){var n;(n=cl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function hye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=cl(e))==null?void 0:n.updateRowData(t)})}function fye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=cl(e))==null?void 0:s.batchUpdateRowData(t,n)})}function pye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=cl(e))==null?void 0:t.flushAsyncTransactions()})}function gye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var cB={moduleName:"ClientSideRowModel",version:lt,rowModels:["clientSide"],beans:[iye,tye],dependsOn:[y2]},mye={moduleName:"ClientSideRowModelApi",version:lt,apiFunctions:{onGroupExpandedOrCollapsed:rye,refreshClientSideRowModel:aye,isRowDataEmpty:lye,forEachLeafNode:cye,forEachNodeAfterFilter:uye,forEachNodeAfterFilterAndSort:dye,applyTransaction:hye,applyTransactionAsync:fye,flushAsyncTransactions:pye,getBestCostNodeSelection:gye,resetRowHeights:iB,onRowHeightChanged:oB},dependsOn:[Wve,zve]},vye=class extends Ge{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={}){const{allColumns:n,columnKeys:s,skipRowGroups:o,exportRowNumbers:i}=t,r=this.getColumnsToExport({allColumns:n,skipRowGroups:o,columnKeys:s,exportRowNumbers:i});return[this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,s){var p;const o=t.shouldRowBeSkipped||(()=>!1),r=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!r,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,c=!!s.footer,u=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&woe(this.gos,s);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!c||o(It(this.gos,{node:s})))return;const f=e.onNewBodyRow(s);if(n.forEach((g,v)=>{f.onColumn(g,v,s)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(It(this.gos,{node:s}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const s=new tL,{colGroupSvc:o}=this.beans,i=o?o.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(i,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const s=n.onNewHeaderRow();t.forEach((o,i)=>{s.onColumn(o,i,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="top").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("top",s),n}}processRows(e,t){return n=>{var c;const s=this.rowModel,o=ts(this.gos),i=nd(this.gos),r=!o&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>s.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?s.forEachPivotNode(a,!0,l==="filteredAndSorted"):i?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||r){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?s.forEachNode(a):o||i?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const s=t.getSortOptions(),o=(i,r)=>{var a,l;return i.rowIndex!=null&&r.rowIndex!=null?i.rowIndex-r.rowIndex:i.level===r.level?((a=i.parent)==null?void 0:a.id)===((l=r.parent)==null?void 0:l.id)?n.compareRowNodes(s,{rowNode:i,currentPos:i.rowIndex??-1},{rowNode:r,currentPos:r.rowIndex??-1}):o(i.parent,r.parent):i.level>r.level?o(i.parent,r):o(i,r.parent)};e.sort(o)}processPinnedBottomRows(e,t){return n=>{var o,i;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(r=>r.rowPinned==="bottom").sort((r,a)=>r.rowIndex-a.rowIndex).map(r=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(r.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(i=this.pinnedRowModel)==null||i.forEachPinnedRow("bottom",s),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:s=!1,columnKeys:o}=e,{colModel:i,gos:r,visibleCols:a}=this,l=i.isPivotMode(),c=h=>aa(h)?!1:!la(h)||s;if(o!=null&&o.length)return i.getColsForKeys(o).filter(c);const u=r.get("treeData");let d=[];return t&&!l?d=i.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!O0(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const s=[];for(const o of e){const i=o;if(i.getChildren)for(const r of i.getChildren()??[])s.push(r)}e.length>0&&ns(e[0])&&this.doAddHeaderHeader(t,e,n),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,n)}doAddHeaderHeader(e,t,n){const s=e.onNewHeaderGroupingRow();let o=0;for(const i of t){const r=i;let a;n?a=n(It(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const c=(r.isExpandable()?r.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Rn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);s.onColumn(r,a||"",o++,r.getLeafColumns().length-1,c)}}},yye={moduleName:"SharedExport",version:lt,beans:[vye]},uB=`\r
|
|
251
251
|
`,wye=class extends qpe{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,uB),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,s){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}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){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,n){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(qe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=uB),this.isFirstLine=!1}},Cye=class extends Kpe{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){qe(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(It(this.gos,{})):t.fileName;Ype(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:s,valueSvc:o,gos:i}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new wye({colModel:t,colNames:n,valueSvc:o,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function bye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function Sye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var Eye={moduleName:"CsvExport",version:lt,beans:[Cye],apiFunctions:{getDataAsCsv:bye,exportDataAsCsv:Sye},dependsOn:[yye]},_ye=class extends Ge{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:s,rowNodes:o}=this;for(let i=0;i<e;i++){const r=n+i,a=new ol(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(r),a.setRowTop(t*r),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){ut(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Ln(this.params.datasource.getRows)){qe(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:i}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:It(i,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((o,i)=>{const r=e.rowData?e.rowData[i]:void 0;!o.id&&o.alreadyRendered&&r&&(t[i]=new ol(n),t[i].setRowIndex(o.rowIndex),t[i].setRowTop(o.rowTop),t[i].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[i],r,this.startRow+i)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},Rye=2,Dye=class extends Ge{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let s=this.blocks[n];if(!s){if(t)return;s=this.createBlock(n)}return s.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new _ye(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(Ja(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),n=(r,a)=>a.lastAccessed-r.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,i=Rye-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,c=s?a>=o:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:s}=e;return t.rowIndex>=n&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:s}=this.params,i=(e.id+1)*n+s;this.rowCount<i&&(this.rowCount=i)}}setRowCount(e,t){this.rowCount=e,ut(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,s)=>n.id-s.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let s=-1,o=!1;const i={value:0};let r=!1;for(const l of this.getBlocksInOrder())if(!r){if(o&&s+1!==l.id){r=!0;continue}s=l.id,l.forEachNode(c=>{const u=c===e||c===t;(o||u)&&n.push(c),u&&(o=!o)},i,this.rowCount)}return r||o?[]:n}},Tye=class extends Ge{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new ol(e);this.rootNode=t,t.level=-1,this.rowHeight=hc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=hc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!xf(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;od(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:s,eventSvc:o,gos:i}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:i.get("infiniteInitialRowCount"),maxBlocksInCache:i.get("maxBlocksInCache"),rowHeight:hc(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new Dye(this.cacheParams)),o.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function xye(e){var t;(t=py(e))==null||t.refreshCache()}function Iye(e){var t;(t=py(e))==null||t.purgeCache()}function Fye(e){var t;return(t=py(e))==null?void 0:t.getRowCount()}var Pye=class extends Ge{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Coe(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Fs(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Li(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){Ja(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){Ja(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Aye={moduleName:"InfiniteRowModelCore",version:lt,rowModels:["infinite"],beans:[Tye,Pye]},kye={moduleName:"InfiniteRowModel",version:lt,apiFunctions:{refreshInfiniteCache:xye,purgeInfiniteCache:Iye,getInfiniteRowCount:Fye},dependsOn:[Aye,jve]},Oye="↑",Mye="↓",Nye={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},Lye=class extends yn{constructor(){super(Nye),this.eValue=ct,this.eDelta=ct,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=ut(s)?s:n,i=t>=0,r=this.eDelta;i?r.textContent=Oye+o:r.textContent=Mye+o,r.classList.toggle("ag-value-change-delta-up",i),r.classList.toggle("ag-value-change-delta-down",!i)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Is(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:i,beans:r}=this;if(n===i||(ut(s)?o.textContent=s:ut(n)?o.textContent=n:Is(o),(c=r.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=i&&typeof i=="object"&&"toNumber"in i?i.toNumber():i;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return i&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},Vye=".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}",Bye={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},$ye=class extends yn{constructor(){super(Bye),this.eCurrent=ct,this.refreshCount=0,this.registerCSS(Vye)}init(e){this.refresh(e,!0)}addSlideAnimation(){var o;this.refreshCount++;const e=this.refreshCount;(o=this.ePrevious)==null||o.remove();const{beans:t,eCurrent:n}=this,s=ss({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var i;e===this.refreshCount&&((i=this.ePrevious)==null||i.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Ln(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return ut(e.valueFormatted)?s.textContent=e.valueFormatted:ut(e.value)?s.textContent=n:Is(s),!0}},Hye=class extends Ge{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const i=Date.now(),r=i+n,a=i+n+s,l={phase:"flash",flashEndTime:r,fadeEndTime:a};o.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const s=this.animations[n],o=`ag-cell-${n}`,i=`${o}-animation`;for(const[r,a]of s){if(!r.isAlive()||!r.comp){s.delete(r);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=r;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(i,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(o,!1),f.toggleCss(i,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(r);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=$ce(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function Gye(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(s,t)})}var Uye={moduleName:"HighlightChanges",version:lt,beans:[Hye],userComponents:{agAnimateShowChangeCellRenderer:Lye,agAnimateSlideCellRenderer:$ye},apiFunctions:{flashCells:Gye}};function Wye(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function zye(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function dB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=jye(e)),e.version=lt,e}function jye(e){return e.cellSelection=Kye(e,"rangeSelection"),e}function Kye(e,t){if(e&&typeof e=="object")return e[t]}var qye=class extends Ge{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Fs(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Fs(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Fs(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=ts(e);const s=dB(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const i=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>i(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[r,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(r(),i(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),i(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),i(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=dB(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const s="api",o=t?new Set(t):void 0;this.setGridReadyState(n,s,o),this.setColumnsInitialisedState(n,s,!!o,o),this.setRowCountState(n,s,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,s,o),this.stopSuppressEvents(s)})}setGridReadyState(e,t,n){var s,o;t==="api"&&!(n!=null&&n.has("sideBar"))&&((o=(s=this.beans.sideBar)==null?void 0:s.comp)==null||o.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,s){this.setColumnState(e,t,n,s),this.setColumnGroupState(e,t,s),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=s=>()=>this.updateColumnState([s]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:s,rowGroupExpansion:o,ssrmRowGroupExpansion:i,rowSelection:r,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(i,o,t),l("rowSelection",r)&&this.setRowSelectionState(r,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:i}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&t("pagination",this.getPaginationState())}}),i&&this.addManagedListeners(i,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:i,columnOrder:r,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",i)&&this.setFocusedCellState(i),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(r!=null&&r.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return Wpe(Lv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(D,x)=>{const O=!(s!=null&&s.has(D))&&!!(x||t==="api");return h||(h=O),O},p={},g=D=>{let x=p[D];return x||(x={colId:D},p[D]=x,x)},v={},w=f("sort",o);w&&(o==null||o.sortModel.forEach(({colId:D,sort:x},O)=>{const H=g(D);H.sort=x,H.sortIndex=O})),(w||!n)&&(v.sort=null,v.sortIndex=null);const b=f("rowGroup",i);b&&(i==null||i.groupColIds.forEach((D,x)=>{const O=g(D);O.rowGroup=!0,O.rowGroupIndex=x})),(b||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const S=f("aggregation",r);S&&(r==null||r.aggregationModel.forEach(({colId:D,aggFunc:x})=>{g(D).aggFunc=x})),(S||!n)&&(v.aggFunc=null);const C=f("pivot",a);C&&(a==null||a.pivotColIds.forEach((D,x)=>{const O=g(D);O.pivot=!0,O.pivotIndex=x}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(C||!n)&&(v.pivot=null,v.pivotIndex=null);const E=f("columnPinning",l);if(E){for(const D of(l==null?void 0:l.leftColIds)??[])g(D).pinned="left";for(const D of(l==null?void 0:l.rightColIds)??[])g(D).pinned="right"}(E||!n)&&(v.pinned=null);const R=f("columnVisibility",c);if(R)for(const D of(c==null?void 0:c.hiddenColIds)??[])g(D).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",u);if(T)for(const{colId:D,flex:x,width:O}of(u==null?void 0:u.columnSizingModel)??[]){const H=g(D);H.flex=x??null,H.width=O}(T||!n)&&(v.flex=null);const A=d==null?void 0:d.orderedColIds,k=!!(A!=null&&A.length)&&!(s!=null&&s.has("columnOrder")),I=k?A.map(D=>g(D)):Object.values(p);(I.length||h)&&(this.columnStates=I,Vi(this.beans,{state:I,applyOrder:k,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:i,colGroupSvc:r}=o;if(i!=null&&i.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)i.getPivotResultCol(l.colId)&&a.push(l);Vi(o,{state:a,applyOrder:e},t)}s&&(r==null||r.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return zpe(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),r=s.getColumnGroupState().map(({groupId:l})=>{const c=o.has(l);return c&&o.delete(l),{groupId:l,open:c}});for(const l of o)r.push({groupId:l,open:!0});r.length&&(this.columnGroupStates=r),s.setColumnGroupState(r,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:i,endRow:r,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:i,endRow:r,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:s,visibleCols:o}=this.beans;if(!ia(t)||!n)return;const i=[];for(const r of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of r.colIds){const u=s.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=s.getCol(r.startColId);if(!l){const c=o.allCols,u=new Set(a);l=c.find(d=>u.has(d))}i.push({...r,columns:a,startColumn:l})}n.setCellRanges(i)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:s,rowRenderer:o,animationFrameSvc:i,ctrlsSvc:r}=this.beans;s.wrapIncoming(()=>{var a;r.get("center").setCenterViewportScrollLeft(n),(a=r.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),i==null||i.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:i}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:i}=e??{page:0,pageSize:s.get("paginationPageSize")},r=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,r?"initialState":"pageSizeSelector"),typeof i=="number"&&(r?n.setPage(i):n.goToPage(i))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const i=t[o];xf(i,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),xf(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},Yye={moduleName:"GridState",version:lt,beans:[qye],apiFunctions:{getState:Wye,setState:zye}};function Zye(e){return e.rowModel.isLastRowIndexKnown()}function Xye(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Jye(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Qye(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function ewe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function twe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function nwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function swe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function owe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function iwe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var rwe=class extends Ge{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const s=Math.max(hc(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Fs(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},up="paginationPageSizeSelector",awe={tag:"span",cls:"ag-paging-page-size"},lwe=class extends yn{constructor(){super(awe),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(up,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){Is(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(up)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),i=this.gos.get(up)!==!0;qe(94,{pageSizeSet:o,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||qe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:up}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(tl(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new nE).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(up);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},cwe={selector:"AG-PAGE-SIZE-SELECTOR",component:lwe},uwe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",dwe=class extends SV{constructor(){super(),this.btFirst=ct,this.btPrevious=ct,this.btNext=ct,this.btLast=ct,this.lbRecordCount=ct,this.lbFirstRowOnPage=ct,this.lbLastRowOnPage=ct,this.lbCurrent=ct,this.lbTotal=ct,this.pageSizeComp=ct,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(uwe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[cwe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",li(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",li(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",li(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",li(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(i):rle(this.beans,i),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:s=>{(s.key===Me.ENTER||s.key===Me.SPACE)&&(s.preventDefault(),n())}})}ile(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):jpe(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===n-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Cse(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),s=e?n:null,o=this.pagination.getCurrentPage(),i=this.pagination.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=i*o+1,a=r+i-1,e&&a>s&&(a=s));const l=r+i-1,c=!e&&n<l,u=this.formatNumber(r);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,w;if(e)v=this.formatNumber(t),w=this.formatNumber(s);else{const b=h("more","more");v=b,w=b}this.lbTotal.textContent=v,this.lbRecordCount.textContent=w,this.announceAriaStatus(u,d,w,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const i=this.getLocaleTextFunc(),r=i("page","Page"),a=i("to","to"),l=i("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${r} ${s} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},hwe={selector:"AG-PAGINATION",component:dwe},fwe=class extends Ge{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return hwe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,s;if(!this.active)return;let t=e;this.paginateChildRows||(t=((s=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:s.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return ut(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:ut(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:ut(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:ut(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,s=t-1;this.totalPages=Math.floor(s/n)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,i=n*o;let r=n*(o+1)-1;if(r>s&&(r=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(i),r===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(r+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},pwe={moduleName:"Pagination",version:lt,beans:[fwe,rwe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:Zye,paginationGetPageSize:Xye,paginationGetCurrentPage:Jye,paginationGetTotalPages:Qye,paginationGetRowCount:ewe,paginationGoToNextPage:twe,paginationGoToPreviousPage:nwe,paginationGoToFirstPage:swe,paginationGoToLastPage:owe,paginationGoToPage:iwe},dependsOn:[gy]};function gwe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function hB(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&hB(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function mwe(e,t){return e.rowModel.getRowNode(t)}function vwe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function ywe(e){return e.rowRenderer.getRenderedNodes()}function wwe(e,t,n){e.rowModel.forEachNode(t,n)}function Cwe(e){return e.rowRenderer.firstRenderedRow}function bwe(e){return e.rowRenderer.lastRenderedRow}function Swe(e,t){return e.rowModel.getRow(t)}function Ewe(e){return e.rowModel.getRowCount()}var _we={moduleName:"RowApi",version:lt,apiFunctions:{redrawRows:gwe,setRowNodeExpanded:hB,getRowNode:mwe,addRenderedRowListener:vwe,getRenderedNodes:ywe,forEachNode:wwe,getFirstDisplayedRowIndex:Cwe,getLastDisplayedRowIndex:bwe,getDisplayedRowAtIndex:Swe,getDisplayedRowCount:Ewe}},Rwe={moduleName:"ScrollApi",version:lt,apiFunctions:{getVerticalPixelRange:Vme,getHorizontalPixelRange:Bme,ensureColumnVisible:K2,ensureIndexVisible:q2,ensureNodeVisible:$me}};function Dwe(e,t,n){if(!t)return;const s=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;n===null?s.removeAttribute(o):s.setAttribute(o,n)}function Twe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function xwe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Iwe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function Fwe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function Pwe(e){return{rowHeight:hc(e),headerHeight:Xf(e)}}function Awe(e,t={}){var i;const n=[];for(const r of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=r.getCellRenderer();a!=null&&n.push(qf(a))}if((i=t.columns)!=null&&i.length)return n;const s=[],o=QE(t.rowNodes);for(const r of e.rowRenderer.getAllRowCtrls()){if(o&&!e_(r.rowNode,o)||!r.isFullWidth())continue;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&s.push(qf(c))}}return[...s,...n]}var kwe={moduleName:"RenderApi",version:lt,apiFunctions:{setGridAriaProperty:Dwe,refreshCells:Twe,refreshHeader:xwe,isAnimationFrameQueueEmpty:Iwe,flushAllAnimationFrames:Fwe,getSizesForCurrentTheme:Pwe,getCellRendererInstances:Awe}};function Owe(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function fB({colAutosize:e,visibleCols:t},n,s){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:s,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function Mwe(e,t){var n;t&&typeof t=="object"?fB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var Nwe=class extends Ge{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const i=e.get("rowData");s=i!=null&&i.length>0&&ts(e)}s&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(o))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(s=>{var c;const o=u=>ad(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const i=pB(this.beans),r=u=>n.leftCols.some(d=>zf(d,u)),a=u=>n.rightCols.some(d=>zf(d,u)),l=e.colKeys.filter(u=>!aa(u)&&!la(u)&&!r(u)&&!a(u));this.sizeColumnsToFit(i,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:i,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let w=-1;const b=Object.fromEntries(c.map(({colId:E,...R})=>[E,R])),S=o??this.gos.get("skipHeaderOnAutoSize"),C=i??S;for(;w!==0;){w=0;const E=[];for(const R of s){if(!R||koe(R))continue;const T=f.getCol(R);if(!T||v.has(T))continue;const A=p.getPreferredWidthForColumn(T,S);if(A>0){const k=b[T.colId]??{};k.minWidth??(k.minWidth=l),k.maxWidth??(k.maxWidth=a);const I=Lwe(T,A,k);T.setActualWidth(I,u),v.add(T),w++}E.push(T)}E.length&&g.refresh(u)}C||this.autoSizeColumnGroupsByColumns(s,u,r),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,i=new Set,r=s.getColsForKeys(e);for(const l of r){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||i.add(c),c=c.getParent()}let a;for(const l of i){for(const c of o.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||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){const n=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new Sc(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const i=[],r=t.getDisplayedLeafColumns();for(const a of r)a.getColDef().suppressAutoSize||i.push(a.getColId());i.length>0&&this.autoSizeCols({colKeys:i,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=pB(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):qe(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...w}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=w;const i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=ra(i);if(s!=null&&s.onlyScaleUp&&r>e||e===r&&i.every(w=>{if(w.colDef.suppressSizeToFit)return!0;const b=o==null?void 0:o[w.getId()],S=(b==null?void 0:b.minWidth)??(s==null?void 0:s.defaultMinWidth),C=(b==null?void 0:b.maxWidth)??(s==null?void 0:s.defaultMaxWidth),E=w.getActualWidth();return(S==null||E>=S)&&(C==null||E<=C)}))return;const l=[],c=[];for(const v of i){const w=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(b=>zf(v,b)))??!0;v.getColDef().suppressSizeToFit||!w?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{Li(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const w=o==null?void 0:o[v.getId()],b=(w==null?void 0:w.minWidth)??(s==null?void 0:s.defaultMinWidth),S=(w==null?void 0:w.maxWidth)??(s==null?void 0:s.defaultMaxWidth),C=v.getActualWidth();typeof b=="number"&&C<b?v.setActualWidth(b,t,!0):typeof S=="number"&&C>S&&v.setActualWidth(S,t,!0)}for(;!d;){d=!0;const v=e-ra(c);if(v<=0)for(const w of l){const b=((g=o==null?void 0:o[w.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??w.minWidth;w.setActualWidth(b,t,!0)}else{const w=v/ra(l);let b=v;for(let S=l.length-1;S>=0;S--){const C=l[S],E=o==null?void 0:o[C.getId()],R=(E==null?void 0:E.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(E==null?void 0:E.maxWidth)??(s==null?void 0:s.defaultMaxWidth),A=C.getMinWidth(),k=C.getMaxWidth(),I=typeof R=="number"&&R>A?R:A,D=typeof T=="number"&&T<k?T:k;let x=Math.round(C.getActualWidth()*w);x<I?(x=I,h(C),d=!1):x>D?(x=D,h(C),d=!1):S===0&&(x=b),C.setActualWidth(x,t,!0),b-=x}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&ad(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:i,defaultMaxWidth:r}=n,a=o==null?void 0:o.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:i,defaultMaxWidth:r,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function Lwe(e,t,n={}){const s=n.minWidth??e.getMinWidth();t<s&&(t=s);const o=n.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function pB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return kf(n.eGridBody)-o}var Vwe={moduleName:"ColumnAutoSize",version:lt,beans:[Nwe],apiFunctions:{sizeColumnsToFit:Owe,autoSizeColumns:fB,autoSizeAllColumns:Mwe},dependsOn:[BV]},Bwe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function $we(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function Hwe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function Gwe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function Uwe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function Wwe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var zwe={moduleName:"PinnedRow",version:lt,beans:[Gle],css:[Bwe],apiFunctions:{getPinnedTopRowCount:$we,getPinnedBottomRowCount:Hwe,getPinnedTopRow:Gwe,getPinnedBottomRow:Uwe,forEachPinnedRow:Wwe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},jwe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},Kwe=class extends Ge{constructor(e){super(),this.column=e}buildCache(e){var S;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:i,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const w=(C,E)=>{p=C,g=null,v=E},b=C=>{const E=!C.isExpandable()&&!C.group&&!C.detail&&(u?!u({rowNode:C}):!0);if(C.rowIndex==null||!E){w(null,null);return}if(p==null||C.level!==p.level||C.footer||g&&C.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){w(C,i.getValue(t,C));return}const R=i.getValue(t,C);if(f){const T=It(n,{valueA:v,nodeA:p,valueB:R,nodeB:C,column:t,colDef:a});if(!h(T)){w(C,R);return}}else if(d?!d(v,R):v!==R){w(C,R);return}if(!g){const T=l==null?void 0:l.get(p);(T==null?void 0:T.firstNode)===p?(T.reset(),g=T):g=new jwe(t,p),c.set(p,g)}g.addSpannedNode(C),c.set(C,g)};switch(e){case"center":(S=o.forEachDisplayedNode)==null||S.call(o,C=>{(!r||r.isRowInPage(C.rowIndex))&&b(C)}),this.centerValueNodeMap=c;break;case"top":s==null||s.forEachPinnedRow("top",b),this.topValueNodeMap=c;break;case"bottom":s==null||s.forEachPinnedRow("bottom",b),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},qwe=class extends Ge{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Fs(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Fs(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new Kwe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,s=e.column,o=e.rowIndex,i=this.spanningColumns.get(s);if(!i)return;let r;switch(e.rowPinned){case"top":r=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":r=t==null?void 0:t.getPinnedBottomRow(o);break;default:r=n.getRow(o)}if(r)return i.getCellSpan(r)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},Ywe=class extends wd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,s,o,i,r){this.eWrapper=n,super.setComp(e,t,n,s,o,i,r),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||vv(e,t.rowIndex)}setAriaRowSpan(){Rse(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(sy(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},Zwe=class extends fy{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new Ywe(t,this,this.beans)}isCorrectCtrlForSpan(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},Xwe=class extends Ge{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),s=n.size,o=this.getAllRelevantRowControls(e),i=new Map;let r=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(i.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){i.set(u.firstNode,d),n.delete(u.firstNode);return}r=!0;const h=new Zwe(u.firstNode,this.beans,!1,!1,!1);i.set(u.firstNode,h)}));this.setCtrlsMap(e,i);const a=i.size===s;if(!(!r&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},Jwe={moduleName:"CellSpan",version:lt,beans:[qwe,Xwe]},Qwe=class extends Ge{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(){const{column:e,cellComp:t}=this,n=e.colDef,s=n.cellClassRules,o=this.getCellClassParams(e,n);XE(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,i=>t.toggleCss(i,!0),i=>t.toggleCss(i,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const i of this.staticClasses)t.toggleCss(i,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const i of o)t.toggleCss(i,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return It(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},eCe=class extends Ge{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){XE(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,s),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let s;return typeof n=="function"?s=n(t):s=n,typeof s=="string"&&(s=[s]),s||[]}createCellCustomStyleFeature(e,t){return new Qwe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},tCe={moduleName:"CellStyle",version:lt,beans:[eCe]},nCe={moduleName:"RowStyle",version:lt,beans:[Gfe]};function sCe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var oCe=class extends Ge{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:i,columns:r}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(i,{mouseover:a.setMouseOver.bind(a,r),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},iCe="ag-column-hover",rCe=class extends Ge{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const s=()=>{const o=this.isHovered(n);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:s}),s()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(iCe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const i=this.isHovered(n);t.toggleCss("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new oCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},aCe={moduleName:"ColumnHover",version:lt,beans:[rCe],apiFunctions:{isColumnHovered:sCe}},lCe=class extends Ge{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var i;const n=((i=this.wrapSvc)==null?void 0:i.wrap(e,t))??t,s=!uy.has(e),o=s?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(n),this.eventSvc.addListener(e,n,s)}removeListener(e,t){var i,r;const n=((i=this.wrapSvc)==null?void 0:i.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(r=this.syncListeners.get(e))==null||r.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var i;const t=((i=this.wrapSvc)==null?void 0:i.wrapGlobal(e))??e,n=(r,a)=>{uy.has(r)&&t(r,a)},s=(r,a)=>{uy.has(r)||t(r,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:r,asyncListener:a}=s.get(o);t.removeGlobalListener(r,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function cCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function uCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function dCe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function hCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var fCe={moduleName:"EventApi",version:lt,apiFunctions:{addEventListener:cCe,addGlobalListener:dCe,removeEventListener:uCe,removeGlobalListener:hCe},beans:[lCe]},pCe={moduleName:"Locale",version:lt,beans:[Upe]},gCe=class extends Ge{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Fs(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let i=!1;const r=d=>{var p;const h=d.__autoHeights;let f=Qa(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const w=n==null?void 0:n.getCellSpan(g,d);if(w){if(w.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),i=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",r),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",r),(c=t.forEachDisplayedNode)==null||c.call(t,r),i&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let i=[];switch(e.getPinned()){case"left":i=o.getLeftColsForRow(t);break;case"right":i=o.getRightColsForRow(t);break;case null:i=s.getColsWithinViewport(t);break}return!i.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:i}=e,r=this.beans,a=u=>{var b;if((b=this.beans.editSvc)!=null&&b.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=uc(s),g=d+h+f+p,w=t.offsetHeight+g;if(u<5){const S=Es(r),C=!(S!=null&&S.contains(t)),E=w==0;if(C||E){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(o,w,i)},l=()=>a(0);l();const c=Za(r,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,void 0,i)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},mCe={moduleName:"RowAutoHeight",version:lt,beans:[gCe]},vCe={moduleName:"AllCommunity",version:lt,dependsOn:[cB,Eye,kye,age,vve,yve,wve,Cve,bve,Sve,Eve,mve,cme,ume,dme,lme,fme,pme,Yye,qve,pwe,UV,_we,Rwe,kwe,Vwe,nue,zwe,Vve,_pe,tCe,aCe,nCe,fCe,Tpe,Uye,W2,pCe,mCe,tue,mye,Jwe]};let gB=!1;gB||(coe.registerModules([vCe,cB]),gB=!0);class yCe{constructor(t,n){Jn(this,"gridApi",null);Jn(this,"container");Jn(this,"config");Jn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:s,onRowSelected:o,...i}=this.config,r={...i,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=Bpe(this.container,r),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const wCe=YV.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),CCe=it({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=V(null);qb(i,()=>{var v;const g=(v=r.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const r=V(null),a=Z(()=>({width:"100%",height:s.height||"500px"})),l=Z(()=>({...s,theme:wCe}));function c(){if(!i.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};r.value=new yCe(i.value,g),r.value.init(),u()}function u(){var v;const g=((v=r.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var w,b;if(!g)return;(w=r.value)==null||w.updateColumnDefs(g);const v=g.map(S=>S.field&&S.width&&!S.hide?{colId:S.field,width:S.width}:null).filter(S=>S!==null);(b=r.value)==null||b.setColumnWidth(v)}function h(){var g;(g=r.value)==null||g.destroy(),r.value=null}function f(){var g;return((g=r.value)==null?void 0:g.getApi())||void 0}function p(){return r.value||null}return Je(()=>s.columnDefs,(g,v)=>{const w=g==null?void 0:g.filter(S=>!S.hide).map(S=>S.field).join(","),b=v==null?void 0:v.filter(S=>!S.hide).map(S=>S.field).join(",");w!==b&&d(g)},{deep:!0}),as(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),Yt(()=>{c()}),as(()=>{h()}),(g,v)=>(z(),re("div",{ref_key:"gridContainerRef",ref:i,style:ln(a.value),class:Q(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function _d(e){return qM(e)}const bCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:_d(sc),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:_d(sc)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:_d(sc)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:_d(sc)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:_d(sc),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:i.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:_d(sc),cellRendererParams:n=>{var s,o,i;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((i=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:i.tooltip)||void 0,readOnly:!0}}}].map(n=>Tf.fromType(n))],by={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},SCe={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},ECe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:by.WIDTH,minWidth:by.WIDTH,maxWidth:by.WIDTH,cellClass:"ag-checkbox-cell",headerClass:by.HEADER_CLASS,headerComponent:mv(qX),suppressMovable:!0}),_Ce={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},RCe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=wh({dbName:"item_table_column_configs",storeName:"column_configs"}),i=async()=>{const u=await s(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=V([]),a=ECe(),l=async u=>{const d=await i(),h=new Map;d==null||d.forEach(x=>{x.width&&h.set(x.field,x.width)});const f=bCe(),p=Tf.fromType(_Ce),v=((u==null?void 0:u.map(x=>{var O;return{headerName:x.name,field:`metric_${x.id}`,editable:((O=x==null?void 0:x.auth_permission)==null?void 0:O.permission)==2,sortable:!0,filter:!1,flex:1,context:{...x},hide:!(x.is_primary||x.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:mv(sc),headerComponentParams:H=>({headerType:x.metric_type.code=="number"||x.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${x.id}`)}}))||[]).map(x=>Tf.fromType(x)),w=[a,...f,...v,SCe,p],b=w.filter(x=>x.pinned==="left"),S=w.filter(x=>x.pinned==="right"||x.field==="blank"),C=w.filter(x=>!x.pinned&&x.field!=="blank");if(!d||d.length===0){r.value=w;return}const E=new Map(d.map(x=>[x.field,x])),R=new Map(C.map(x=>[x.field,x])),T=[];for(const x of d)if(x.field&&R.has(x.field)){const O=R.get(x.field);T.push({...O,hide:x.hide,width:x.width}),R.delete(x.field)}const A=Array.from(R.values()),k=[...T,...A],I=b.map(x=>{const O=E.get(x.field);return O!=null&&O.width?{...x,width:O.width}:x}),D=S.map(x=>{const O=E.get(x.field);return O!=null&&O.width?{...x,width:O.width}:x});r.value=[...I,...k,...D]};Je(e,u=>l(u),{immediate:!0});const c=Ri((u,d)=>{var w,b;if(u.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(u.source)===-1){console.warn("Skipping saveColumnConfig for source:",u.source);return}else console.warn("Executing saveColumnConfig for source:",u.source);else console.warn("Executing saveColumnConfig for source:",u);const h=(w=n==null?void 0:n.value)==null?void 0:w.getColumnDefs(),f=(b=n==null?void 0:n.value)==null?void 0:b.getColumnState().reduce((S,C)=>(S[C.colId]=Number(C.width),S),{}),p=new Map;Object.entries(f||{}).forEach(([S,C])=>{p.set(S,C)}),r.value=h||r.value;const g=h==null?void 0:h.filter(S=>!S.pinned&&S.field!=="blank"),v=(g==null?void 0:g.map(S=>({field:S.field,hide:S.hide,width:p.get(S.field)||S.width,pinned:S.pinned})))||[];d&&o(t,JSON.stringify(v))},sr);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:c}},DCe=()=>{const e=En.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},TCe=e=>{var x,O,H;const{showMessage:t,showErrorNetMessage:n}=lf(),s=bs(),o={domainApi:DCe(),wsCode:En.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=(H=(O=(x=s==null?void 0:s.appContext)==null?void 0:x.config)==null?void 0:O.globalProperties)==null?void 0:H.apiConfig;if(!i||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new Pk(i,o);r.on("call-api",L=>{L.success?t(L.apiCode,"success"):n(L)});const a=wo({}),l=V([]),c=V(!1),u=V(null),d=V(null),h=V(1),f=V(20);let p=Promise.resolve();const{setCachedUsers:g}=C7(),v=L=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:L}),w=50,b=async(L,j,te)=>{if(!L.length)return[];const ee=k4(L,j);return(await Promise.all(ee.map(te))).flat()},S=async L=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:L})).data.map(te=>[te==null?void 0:te.id,te.permission])}catch(j){return console.error("Failed to fetch item permissions chunk:",j),[]}},C=async(L,j)=>{try{const te=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:L,per_page:L.length*j.length,metric_ids:j}),ee=te.data.map(pe=>{const q=new Map(pe.item_metrics.map(N=>[N.metric_id,{value:N.value,auth_permission:N==null?void 0:N.auth_permission}])),P=Object.fromEntries(j.map(N=>[N,q.get(N)??null]));return[pe==null?void 0:pe.id,P]}),$=new Set(te.data.map(pe=>pe==null?void 0:pe.id));for(const pe of L)if(!$.has(pe)){const q=Object.fromEntries(j.map(P=>[P,{value:null,auth_permission:void 0}]));ee.push([pe,q])}return ee}catch(te){return console.error("Failed to fetch a chunk of metric values:",te),L.map($=>[$,Object.fromEntries(j.map(pe=>[pe,void 0]))])}},E=async L=>{try{const j=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:L,per_page:L.length}),te=j.data.flatMap(ee=>ee.assignees);return g(te),j.data.map(ee=>[ee==null?void 0:ee.id,ee==null?void 0:ee.assignees])}catch(j){return console.error("Failed to fetch a chunk of assigned users:",j),[]}},R=async L=>{if(!L.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const j=await b(L,w,S);return Object.fromEntries(j)}catch(j){return console.error("Failed to fetch item permissions:",j),{}}},T=async(L,j)=>!L.length||!j.length?{}:(p=p.then(async()=>{try{const $=[];let pe=0;for(let P=0;P<j.length;P+=5){pe++;const N=j.slice(P,P+5),ne=[];for(let Ie=0;Ie<N.length;Ie++){const ge=N[Ie],ue=await b(L,w,X=>C(X,[ge]));ne.push(ue),await new Promise(X=>setTimeout(X,500))}$.push(...ne);const ce=P+5>=j.length}const q={};for(const P of $.flat()){const[N,ne]=P;q[N]||(q[N]={}),Object.assign(q[N],ne)}return q}catch(te){return console.error("Failed to fetch metric values:",te),{}}}),p),A=async L=>{if(!L.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const j=await b(L,w,E);return Object.fromEntries(j)}catch(j){return console.error("Failed to fetch assigned users:",j),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async L=>{const{cursor:j,offset:te,size:ee,searchQuery:$}=L;let pe=[];c.value=!0,u.value=null;try{const q=await r.getAllItem_cursor({...L,cursor:j||void 0,offset:te||void 0,pageSize:ee||f.value,...v($),sortBy:L.sort_by});return l.value=q.data,d.value=q.meta,h.value=q.meta.current_page||0,pe=q.data.map(P=>P==null?void 0:P.id),q}catch(q){throw u.value=q,console.error("Failed to fetch items (cursor):",q),q}finally{const q=async()=>{try{const[P,N]=await Promise.all([A(pe),R(pe)]);e.value.updateItemData({assignees:P,permission:N},pe);const ne=await T(pe,e.value.metricIds);e.value.setMetricValues(ne,new Set(pe),e.value.metricIds)}catch(P){console.error("Post-fetch processing failed:",P)}};c.value=!1,setTimeout(q)}},getAssignableStatus:async L=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:L})}catch(j){throw console.error("Failed to fetch assignable status:",j),j}},getMetricList:async L=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:L})}catch(j){throw console.error("Failed to fetch metric list:",j),j}},getMetricValues:T,getAssignedUsers:A}};function xCe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const i=[],r=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);o.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(i.push(u),s.assignees){const h=r7((s.assignees[c]||[]).map(_F));u.data.assignees=h,r.add("assignees")}s.permission&&(u.data.permissions=s.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),r.add("assignees"),r.add("status"),r.add("dateRange"),r.add("moreActions"),r.add("name"),e.value.refreshCells({rowNodes:i,columns:Array.from(r),force:!0})},setMetricValues:(s,o,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(o).map(c=>[c,new Map(i.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=r.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(c=>`metric_${c}`),force:!0})}}}function ICe(e,t,n,s,o){let i=!0;return{async getRows(r){try{s(!0),i&&(o(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,u),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),s(!1),o(!1)}}}}function FCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:i}=e,r=V(!0),a=V(!0),l=V(!1),c=()=>{n.value=!n.value},u=v=>{if(r.value=!1,o.value=v,!v)return null;const{addEventListener:w,setGridOption:b}=v;if(!i)return console.error("Fetcher function is undefined"),null;const S=ICe(i,e.perPage,()=>s.value,C=>{r.value=C},C=>{a.value=C});return b==null||b("datasource",S),w==null||w("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var w,b;if((w=o.value)==null||w.hideOverlay(),v!==void 0&&(s.value=v),(b=o.value)==null||b.deselectAll(),t.value=[],r.value=!0,!o.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Ri(v=>{d(v)},sr),p=()=>{o.value},g=V(!1);return{isLoading:r,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const PCe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},ACe=e=>{var t;return(t=Object.entries(PCe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},kCe={key:1},OCe=bt(it({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=V(null),o=e,i=()=>{s.value&&s.value.show()},r=V(""),a=V("idle"),l=V({file:null,format:null}),{apiServices:c}=Qn(!1,{}),u=V(!1),d=async()=>{u.value=!0;const T=o.workspaceId,A=o.entityId;if(!T||!A||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(T,A))throw new Error("No response from downloadTemplate API")}catch(k){console.error("Error downloading template:",k)}u.value=!1},h=n,f=()=>{h("import-success"),b()},p=async T=>{var I,D,x;const A=new FormData,k=((I=T.name.split(".").pop())==null?void 0:I.toString())||"";if(A.append("file",T),A.append("format",k),A.append("entity_id",o.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,A),g()}catch(O){throw console.error("Error uploading file:",O),v(((x=(D=O.response)==null?void 0:D.data)==null?void 0:x.message)||"An unknown error occurred during file upload."),O}},g=()=>{a.value="success"},v=T=>{r.value=T,a.value="error"},w=async()=>{!l.value||!l.value.file||await p(l.value.file)},b=()=>{var T;R(),(T=s.value)==null||T.hide()};t({close:b,open:i});const S=Z(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),C=Z(()=>l.value.file?!1:(console.error("No file selected"),!0)),E=V(null),R=()=>{var T;(T=E.value)==null||T.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(T,A)=>(z(),Ke(W($k),{"popup-name":S.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},Yd({default:ye(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(z(),Ke(GM,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(z(),re("div",kCe,[be("div",{class:Q(T.$style["step-section"])},[be("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),be("span",{class:Q(T.$style["step-description"])},[...A[1]||(A[1]=[nt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),be("br",null,null,-1),be("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),fe(W(gt),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:ye(()=>[fe(W(at),{src:"Download"})]),default:ye(()=>[A[2]||(A[2]=nt(" Download file ",-1))]),_:1},8,["class","disabled"])],2),be("div",{class:Q(T.$style["step-section"])},[be("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),fe(W(RO),{modelValue:l.value,"onUpdate:modelValue":A[0]||(A[0]=k=>l.value=k),ref_key:"filUploaderRef",ref:E},null,8,["modelValue"])],2),be("div",{class:Q(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[fe(UM)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ye(()=>[fe(W(gt),{style:{flex:"1"},variant:"secondary",onClick:b},{default:ye(()=>[...A[3]||(A[3]=[nt(" Cancel ",-1)])]),_:1}),fe(W(gt),{disabled:C.value,style:{flex:"1"},variant:"primary",onClick:w},{default:ye(()=>[...A[4]||(A[4]=[nt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ye(()=>[fe(W(gt),{style:{flex:"1"},variant:"primary",onClick:f},{default:ye(()=>[...A[5]||(A[5]=[nt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ye(()=>[fe(W(gt),{style:{flex:"1"},variant:"primary",onClick:R},{default:ye(()=>[...A[6]||(A[6]=[nt(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),MCe={style:{cursor:"help"}},NCe=bt(it({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=So,s=Wb(),{setUserPermissions:o,setEntityPermissions:i}=s,{entityPermissions:r}=Xs(s),a=Zt,l=V(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=V(""),d=Z(()=>{var ze;const Ae=((ze=r.value)==null?void 0:ze.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Ae},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ae,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ae,id:"overwrite_scenes_option"}]}),h=e;Tf.initialize({wrapVueCellRenderer:mv,wrapVueCellEditor:qM});const f=qh(),{switchInstanceFunc:p}=Xs(f);Yt(()=>{const Ae=bs();p.value=Ae==null?void 0:Ae.appContext.config.globalProperties.switchInstance;const ze=new BroadcastChannel("focusable_channel");Et(()=>{setTimeout(()=>{ze.postMessage("Focusable elements updated")},7e3)})});const g=V(null),v=V([]),w=Vm(),{rowCount:b}=Xs(w),S=V(!1),C=V(""),E=V(),R=BA(),{metricList:T}=Xs(R),A=V(""),k=V(!1),I=V(new Set),D=V(new Map),{apiServices:x}=Qn(!1,h),{columnDefs:O,checkboxColumn:H,saveColumnConfig:L}=RCe(T,h.entityId,g),j=V();Je(()=>O,()=>{var Ae;(Ae=j.value)==null||Ae.updateColumnDefs(O.value)},{deep:!0});const te=(Ae,ze)=>{L(Ae,ze)},{updateRowData:ee,setMetricValues:$}=xCe(g),pe=Z(()=>({isSearching:C.value.length>0,isFiltering:!(Object.keys(ve.value||{}).length==1&&Object.keys(ve.value)[0]=="preflight_status")&&Object.keys(ve.value||{}).length>0})),q=Z(om),P=Z(()=>O.value.filter(Ae=>{var ze;return((ze=Ae.field)==null?void 0:ze.startsWith("metric_"))&&!Ae.hide}).map(Ae=>{var ze;return((ze=Ae.field)==null?void 0:ze.replace("metric_",""))||""}));Ki("timezone",q);const N=Z(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:P.value,updateItemData:ee,setMetricValues:$})),{fetchItems:ne,getMetricList:ce,cusorMap:Ie,getMetricValues:ge}=TCe(N),ue=Z(()=>{if(!g.value)return!1;const Ae=g.value.getSelectedRows().length;return Ae>0&&Ae>=b.value.total}),X=Z(()=>{var Ae;return((Ae=l.value)==null?void 0:Ae.name)||"Items"}),_e=(Ae,ze)=>{var en,Ht,As;b.value.total=Ae.meta.total??0,(en=Ae.meta.next)!=null&&en.cursor&&(Ie[ze+1]=Ae.meta.next.cursor),A.value=Ae.meta["X-Tsr-signature"]||"",Ae.meta.total===0?(Ht=g.value)==null||Ht.showNoRowsOverlay():(As=g.value)==null||As.hideOverlay()},ae=_O(),Oe=V(null),{sortingAPIConfiguration:G,isSortingRunning:oe}=Xs(ae),ve=V({preflight_status:"1"}),Ne=Z(()=>({...ve.value,search:C.value}));Ki("filterParams",Ne);const Pe=V([]),Y=async({page:Ae,pageSize:ze,filterText:en})=>{var Vo;(Vo=g.value)==null||Vo.hideOverlay();const Ht=Ie[Ae],As=!Ht&&Ae>1?(Ae-1)*ze:void 0,ma=G.value;ma.length>0&&(oe.value=!0);try{const va={cursor:Ht,size:ze,searchQuery:en,offset:As,sort_by:ma,...ve.value},eo=await ne(va);if(!eo)return{rows:[],total:0};const dp=(jn=>{const Fr=jn.data.map(vo=>DF(vo,q.value));return Fr.forEach(vo=>{I.value.add(String(vo.id)),D.value.set(String(vo.id),{})}),Fr})(eo);return _e(eo,Ae),{rows:dp,total:b.value.total}}catch(va){return console.error("Failed to fetch items:",va),{rows:[],total:0}}finally{oe.value=!1}},{isLoading:B,toggleSidebar:J,onGridReady:ie,handleUnSelect:ke,handleSelectAll:Xe,onSearch:me,firstLoad:de}=FCe({selectRowData:V([]),isSidebarOpen:S,quickFilterText:C,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:Y}),Ee=V([]),et=()=>{var Ae;Ee.value=((Ae=g.value)==null?void 0:Ae.getSelectedRows())||[]},ft=wo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),Ft=Z(()=>({blockLoadDebounceMillis:1e3,columnDefs:O.value,rowModelType:"infinite",cacheBlockSize:c.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:c.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:c.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:sn,noRowsOverlayComponent:mv(kQ),noRowsOverlayComponentParams:()=>pe.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ae=>Ae.data.id,getRowClass:Ae=>{if(!Ae.data)return["row-empty"];const ze=["row-highlight"];return Ae.data.id||ze.push("row-inactive"),Ae.data.isDeleted&&ze.push("row-deleted"),Ae.data.disabled&&ze.push("row-deleted"),Ae.data.isArchived&&ze.push("row-archived"),Ae.data.isLocked&&ze.push("row-locked"),ze},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:x.value,sorting:oe.value},onCellEditRequest:Ae=>{console.log("Cell edit requested:",Ae)},onCellKeyDown:Ae=>{var ze,en,Ht;if(console.log("Cell key down:",Ae),Ae.data.isDeleted)return!1;if(((ze=Ae==null?void 0:Ae.event)==null?void 0:ze.key)==="Enter"){const{api:As,node:ma,column:Vo}=Ae,va=As.getCellRendererInstances({rowNodes:[ma],columns:[Vo]});if(va.length>0){const eo=va[0];eo&&typeof((en=eo.componsenExposed)==null?void 0:en.focus)=="function"&&((Ht=eo.componsenExposed)==null||Ht.focus())}}},isRowSelectable:Ae=>!Ae.group,suppressKeyboardEvent:Ae=>{var Ht;if(console.log("Keyboard event:",Ae),(Ht=Ae.data)!=null&&Ht.isDeleted)return!0;const ze=Ae.event.key,en=Ae.editing;return en&&ze==="Tab"?!0:en&&ze==="Enter"?(console.log("Enter key pressed in edit mode"),!1):ze==="Enter"?(console.log("Enter key pressed, preventing default behavior"),Ae.event.preventDefault(),Ae.event.stopPropagation(),!0):ze==="ArrowUp"||ze==="ArrowDown"||ze==="ArrowLeft"||ze==="ArrowRight"||ze==="Tab"||ze==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ae=>{const ze=Ae.api.getFirstDisplayedRowIndex(),en=Ae.api.getLastDisplayedRowIndex();ft.rowsDisplay.fromIndex=ze,ft.rowsDisplay.toIndex=en,ft.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(Ht=>Ht.getColId())},onViewportChanged:Ae=>{ft.columnsDisplay=Ae.api.getAllDisplayedVirtualColumns().map(ze=>ze.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(Ae){if(Ae.data.isDeleted&&Ae.api.stopEditing(),console.log("Cell editing started:",Ae),Ae.colDef.field=="options"){const ze=Ae.api.getCellRendererInstances({rowNodes:[Ae.node],columns:[Ae.column]});ze.length>0&&ze[0].focusUi()}},tabToNextCell:Ae=>{let ze=Ae.nextCellPosition;if(ze&&ze.column.getColId()==="ag-Grid-SelectionColumn"){const en=Ae.api.getAllDisplayedColumns(),Ht=en.indexOf(ze.column),As=Ae.backwards?-1:1,ma=en[Ht+As];if(ma)return{rowIndex:ze.rowIndex,column:ma,rowPinned:ze.rowPinned}}return ze}}));function sn(){if(!g.value)return;let Ae=0;g.value.forEachNode(ze=>{ze.data&&Ae++}),b.value.loaded=Math.min(Ae,b.value.total)}Je(()=>G,()=>{g.value&&(A.value="",I.value.clear(),g.value.deselectAll(),Object.keys(Ie).forEach(Ae=>delete Ie[Number(Ae)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Kt=V(),Gt=V(),on=()=>{var Ae;(Ae=Gt.value)==null||Ae.open()},Ve=()=>{var Ae;(Ae=Kt.value)==null||Ae.open()},Ue=async()=>{de.value=!0,g.value&&(A.value="",I.value.clear(),Object.keys(Ie).forEach(Ae=>delete Ie[Number(Ae)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},St=Z(()=>En.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),kt=V(),Ut=Z(()=>{var Ae;return(Ae=ACe(St.value))==null?void 0:Ae.map(ze=>`<div>• ${ze}</div>`).join(`
|
|
252
|
-
`)});function tt(Ae){var ze;Ae==="new_scene"?(ze=kt.value)==null||ze.show():Ae==="import_scenes"?Ve():Ae==="overwrite_scenes"&&on()}const Rs=Ae=>{v.value=Ae.api.getSelectedRows().map(ze=>ze.id)},$i=Ae=>{const ze=ie(Ae);return ze&&(ze.addEventListener("modelUpdated",sn),ze.addEventListener("bodyScroll",()=>ze.stopEditing()),ze.addEventListener("selectionChanged",et),ze.addEventListener("columnMoved",Ht=>te(Ht,!0)),ze.addEventListener("columnResized",Ht=>te(Ht,!0)),ze.addEventListener("firstDataRendered",()=>{de.value=!1}),!document.querySelector(".ag-body-viewport")),ze},Tr=()=>{var Ae;u.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Yt(()=>{Et(()=>{Tr()}),window.addEventListener("resize",Tr);function Ae(){requestAnimationFrame(Ae)}Ae()}),as(()=>{window.removeEventListener("resize",Tr)});const di=async({code:Ae,name:ze})=>{await me(Ae),setTimeout(()=>{var en;(en=E.value)==null||en.setValue(ze)},300)},ga=Ae=>{if(!g.value)return;const ze=g.value.getRowNode(Ae);ze?(g.value.ensureIndexVisible(Number(ze.rowIndex),"middle"),g.value.flashCells({rowNodes:[ze],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},dl=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await ce(h.entityId);T.value=Ae.data.map(ze=>({...ze,sortType:dl(ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},Ir=async()=>{if(x.value)try{const Ae=await x.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},hi=async()=>{if(x.value)try{const Ae=await x.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Hi=rv(),{setUser:Rd}=Hi,An=async()=>{if(x.value)try{const Ae=await x.value.getMe();return Rd(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},fs=async()=>{var Ae;if(x.value)try{const ze=await x.value.getWorkspaces(h.workspaceId),en=(Ae=ze.data[0])==null?void 0:Ae.ws_user_role_id;return en&&Hi.setUserRoleId(en),ze}catch(ze){console.error("Failed to fetch workspace details:",ze)}};Je(()=>[h.entityId,h.workspaceId],async([Ae,ze])=>{!Ae||!ze||(An(),fs(),xr(),Ir(),hi())},{immediate:!0,deep:!0}),Je(P,(Ae,ze)=>{const en=Ae.filter(Ht=>!(ze!=null&&ze.includes(Ht)));en.length>0&&ge(Array.from(I.value),en).then(Ht=>{$(Ht,I.value,en)})},{immediate:!0,deep:!0}),Je(A,(Ae,ze)=>{k.value=!!(ze&&Ae&&ze!==Ae)}),t({refreshTable:Ue});const y_=Ae=>{ve.value=Ae,Ue()},Dd=Ae=>{Pe.value=Ae,Ue()},Td=Ae=>{O.value=Ae||[],te({},!0)},xd=Z(()=>{var Ht;const Ae=En.getInstance().getItem("ws.terminology"),ze=Ae?JSON.parse(Ae):null;return`New ${((Ht=ze==null?void 0:ze.find(As=>As.code==="scene"))==null?void 0:Ht.name)||"Scene"}`});return(Ae,ze)=>{const en=oo("focusable");return z(),Ke(W(UX),{"is-sidebar-open":S.value,onCloseSidebar:W(J),onSidebarClear:W(J),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:W(J)},{"header-left":ye(()=>{var Ht;return[((Ht=W(r))==null?void 0:Ht.has_create_item_permission)==1?(z(),Ke(W(cS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:ze[1]||(ze[1]=As=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ye(()=>[We(fe(W(gt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:ze[0]||(ze[0]=As=>tt("new_scene")),label:xd.value},null,8,["label"]),[[en,1]])]),_:1},8,["options"])):Ye("",!0),be("div",{class:Q(Ae.$style["beta-tag"])},"Beta",2),We((z(),re("span",MCe,[nt(mt(St.value),1)])),[[W(a),Ut.value||""]])]}),"header-actions":ye(()=>[fe(W(mee),{"onUpdate:assignees":Dd,onApplyFilter:y_,loading:W(de),entityId:h.entityId},null,8,["loading","entityId"]),We(fe(W(Zb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":ze[2]||(ze[2]=Ht=>C.value=Ht),onSearch:W(me),class:Q(Ae.$style.itemSearchBox),onClear:ze[3]||(ze[3]=Ht=>W(me)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[W(n),{isLoading:W(de),fullwidth:!0}]]),We((z(),Ke(W(OA),{status:W(B)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":k.value},{default:ye(()=>[We((z(),Ke(W(gt),{variant:["secondary","icon"],disabled:W(B),onClick:Ue},{default:ye(()=>[fe(W(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[en,5],[W(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[W(n),{isLoading:W(de),fullwidth:!0}]]),We(fe(W(gQ),{"model-value":W(O),onChange:ze[4]||(ze[4]=Ht=>Td(Ht)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:j,"checkbox-column":W(H),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[W(n),{isLoading:W(de),fullwidth:!0}]])]),grid:ye(({availableHeight:Ht})=>[fe(W(CCe),Jt({id:"item_table_main",ref_key:"agGrid",ref:Oe},Ft.value,{height:Ht+"px",isSorting:W(oe),onOnGridReady:$i,onSelectionChanged:Rs}),null,16,["height","isSorting"])]),footer:ye(()=>[be("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[be("span",null,[ze[5]||(ze[5]=nt(" Showing ",-1)),be("b",null,mt(W(b).loaded)+" of "+mt(W(b).total),1)])],2)]),"new-row":ye(()=>[fe(W(jQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:di,onFocusOnId:ga},null,512)]),"bulk-update-actions":ye(()=>[We(fe(W(MX),{selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:W(ke),onSelectAll:W(Xe),"take-name":X.value,"selected-all":ue.value,"total-rows":W(b).total,"visible-rows":W(b).loaded,onUpdated:et,loading:W(B)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[Ei,!S.value&&v.value.length>0]])]),snackbar:ye(()=>[fe(W(RJ))]),popup:ye(()=>[fe(Qne,{ref_key:"popupCreateSceneRef",ref:Kt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"]),fe(OCe,{ref_key:"popupOverwriteScenesRef",ref:Gt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),mB="0.1.
|
|
252
|
+
`)});function tt(Ae){var ze;Ae==="new_scene"?(ze=kt.value)==null||ze.show():Ae==="import_scenes"?Ve():Ae==="overwrite_scenes"&&on()}const Rs=Ae=>{v.value=Ae.api.getSelectedRows().map(ze=>ze.id)},$i=Ae=>{const ze=ie(Ae);return ze&&(ze.addEventListener("modelUpdated",sn),ze.addEventListener("bodyScroll",()=>ze.stopEditing()),ze.addEventListener("selectionChanged",et),ze.addEventListener("columnMoved",Ht=>te(Ht,!0)),ze.addEventListener("columnResized",Ht=>te(Ht,!0)),ze.addEventListener("firstDataRendered",()=>{de.value=!1}),!document.querySelector(".ag-body-viewport")),ze},Tr=()=>{var Ae;u.value=(((Ae=document.getElementById("item-table-layout-id"))==null?void 0:Ae.clientHeight)??0)-78+"px"};Yt(()=>{Et(()=>{Tr()}),window.addEventListener("resize",Tr);function Ae(){requestAnimationFrame(Ae)}Ae()}),as(()=>{window.removeEventListener("resize",Tr)});const di=async({code:Ae,name:ze})=>{await me(Ae),setTimeout(()=>{var en;(en=E.value)==null||en.setValue(ze)},300)},ga=Ae=>{if(!g.value)return;const ze=g.value.getRowNode(Ae);ze?(g.value.ensureIndexVisible(Number(ze.rowIndex),"middle"),g.value.flashCells({rowNodes:[ze],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},dl=Ae=>Ae.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const Ae=await ce(h.entityId);T.value=Ae.data.map(ze=>({...ze,sortType:dl(ze)}))}catch(Ae){console.error("Failed to initialize metric list:",Ae),T.value=[]}},Ir=async()=>{if(x.value)try{const Ae=await x.value.getUserPermission(h.workspaceId);o(Ae)}catch(Ae){console.error("Failed to fetch user permissions:",Ae)}},hi=async()=>{if(x.value)try{const Ae=await x.value.getEntityDetail(h.workspaceId,h.entityId);i(Ae.permission),l.value=Ae}catch(Ae){console.error("Failed to fetch entity details:",Ae)}},Hi=rv(),{setUser:Rd}=Hi,An=async()=>{if(x.value)try{const Ae=await x.value.getMe();return Rd(Ae),Ae}catch(Ae){console.error("Failed to fetch user details:",Ae)}},fs=async()=>{var Ae;if(x.value)try{const ze=await x.value.getWorkspaces(h.workspaceId),en=(Ae=ze.data[0])==null?void 0:Ae.ws_user_role_id;return en&&Hi.setUserRoleId(en),ze}catch(ze){console.error("Failed to fetch workspace details:",ze)}};Je(()=>[h.entityId,h.workspaceId],async([Ae,ze])=>{!Ae||!ze||(An(),fs(),xr(),Ir(),hi())},{immediate:!0,deep:!0}),Je(P,(Ae,ze)=>{const en=Ae.filter(Ht=>!(ze!=null&&ze.includes(Ht)));en.length>0&&ge(Array.from(I.value),en).then(Ht=>{$(Ht,I.value,en)})},{immediate:!0,deep:!0}),Je(A,(Ae,ze)=>{k.value=!!(ze&&Ae&&ze!==Ae)}),t({refreshTable:Ue});const y_=Ae=>{ve.value=Ae,Ue()},Dd=Ae=>{Pe.value=Ae,Ue()},Td=Ae=>{O.value=Ae||[],te({},!0)},xd=Z(()=>{var Ht;const Ae=En.getInstance().getItem("ws.terminology"),ze=Ae?JSON.parse(Ae):null;return`New ${((Ht=ze==null?void 0:ze.find(As=>As.code==="scene"))==null?void 0:Ht.name)||"Scene"}`});return(Ae,ze)=>{const en=oo("focusable");return z(),Ke(W(UX),{"is-sidebar-open":S.value,onCloseSidebar:W(J),onSidebarClear:W(J),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:W(J)},{"header-left":ye(()=>{var Ht;return[((Ht=W(r))==null?void 0:Ht.has_create_item_permission)==1?(z(),Ke(W(cS),{key:0,variant:["primary"],options:d.value,onSelect:tt,onHandleClick:ze[1]||(ze[1]=As=>tt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ye(()=>[We(fe(W(gt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:ze[0]||(ze[0]=As=>tt("new_scene")),label:xd.value},null,8,["label"]),[[en,1]])]),_:1},8,["options"])):Ye("",!0),be("div",{class:Q(Ae.$style["beta-tag"])},"Beta",2),We((z(),re("span",MCe,[nt(mt(St.value),1)])),[[W(a),Ut.value||""]])]}),"header-actions":ye(()=>[fe(W(mee),{"onUpdate:assignees":Dd,onApplyFilter:y_,loading:W(de),entityId:h.entityId},null,8,["loading","entityId"]),We(fe(W(Zb),{focusIndex:"4",modelValue:C.value,"onUpdate:modelValue":ze[2]||(ze[2]=Ht=>C.value=Ht),onSearch:W(me),class:Q(Ae.$style.itemSearchBox),onClear:ze[3]||(ze[3]=Ht=>W(me)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:E},null,8,["modelValue","onSearch","class"]),[[W(n),{isLoading:W(de),fullwidth:!0}]]),We((z(),Ke(W(OA),{status:W(B)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":k.value},{default:ye(()=>[We((z(),Ke(W(gt),{variant:["secondary","icon"],disabled:W(B),onClick:Ue},{default:ye(()=>[fe(W(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[en,5],[W(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[W(n),{isLoading:W(de),fullwidth:!0}]]),We(fe(W(gQ),{"model-value":W(O),onChange:ze[4]||(ze[4]=Ht=>Td(Ht)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:j,"checkbox-column":W(H),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[W(n),{isLoading:W(de),fullwidth:!0}]])]),grid:ye(({availableHeight:Ht})=>[fe(W(CCe),Jt({id:"item_table_main",ref_key:"agGrid",ref:Oe},Ft.value,{height:Ht+"px",isSorting:W(oe),onOnGridReady:$i,onSelectionChanged:Rs}),null,16,["height","isSorting"])]),footer:ye(()=>[be("div",{class:Q(Ae.$style.tableFooter),id:"table_footer"},[be("span",null,[ze[5]||(ze[5]=nt(" Showing ",-1)),be("b",null,mt(W(b).loaded)+" of "+mt(W(b).total),1)])],2)]),"new-row":ye(()=>[fe(W(jQ),{ref_key:"createNewSceneRef",ref:kt,onSearchForCode:di,onFocusOnId:ga},null,512)]),"bulk-update-actions":ye(()=>[We(fe(W(MX),{selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:W(ke),onSelectAll:W(Xe),"take-name":X.value,"selected-all":ue.value,"total-rows":W(b).total,"visible-rows":W(b).loaded,onUpdated:et,loading:W(B)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[Ei,!S.value&&v.value.length>0]])]),snackbar:ye(()=>[fe(W(RJ))]),popup:ye(()=>[fe(Qne,{ref_key:"popupCreateSceneRef",ref:Kt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"]),fe(OCe,{ref_key:"popupOverwriteScenesRef",ref:Gt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ue},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),mB="0.1.84",LCe={key:0},VCe=bt(it({__name:"app",setup(e){const t=Z(()=>n.id.length===0||n.workspaceId.length===0),n=wo({id:"",workspaceId:"",apiConfig:{}}),s=lf(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=V(null),c=()=>{const h=En.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};Yp(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",mB);try{if(l.value=bs(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||En.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:En.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Pk(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),as(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=Z(()=>n.id),d=Z(()=>n.workspaceId);return Ki("workspaceId",d),Ki("entityId",u),(h,f)=>(z(),re("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(z(),re("span",LCe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(z(),Ke(W(NCe),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ye("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),v_=async(e={},t={})=>{const n=C1(VCe),s=zq();n.use(s);const o=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${mB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",Zt),n.directive("focusable",Gr);const r=await Zne();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=v_),kn.default=v_,kn.initDashboard=v_,Object.defineProperties(kn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|