@arbocollab/arbo-plugin-item-table 0.1.109 → 0.1.110
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/CHANGELOG.md +7 -0
- package/lib/es/index.es.js +30 -28
- package/lib/style.css +1 -1
- package/lib/umd/index.umd.js +3 -3
- package/package.json +1 -1
package/lib/umd/index.umd.js
CHANGED
|
@@ -100,7 +100,7 @@ Expected function or array of functions, received type ${typeof e}.`),gs)}functi
|
|
|
100
100
|
.tippy-box[data-placement^='right'] > .tippy-arrow::before {
|
|
101
101
|
border-right-color: var(--tooltip-background-color) !important;
|
|
102
102
|
}
|
|
103
|
-
`,document.head.appendChild(e)})();const Jt={mounted(e,t){const n=i=>{var r;return i.nodeType===Node.TEXT_NODE&&((r=i.textContent)!=null&&r.trim())?!0:i.nodeType===Node.ELEMENT_NODE?Array.from(i.childNodes).some(n):!1};if(!t.value)return;e.childNodes.length===1&&e.childNodes[0].nodeType===Node.TEXT_NODE||e.childNodes.length>=1&&n(e)?e.classList.add("arbo-tooltip-wrapper"):e.classList.add("arbo-tooltip-wrapper-component");const s=t.value;(typeof s=="string"?s:s!=null&&s.content)&&mt(()=>{C1(e,typeof s=="object"?s.bypassOverflowCheck:void 0,s)&&(e._tooltipInstance=b1(e,s))})},updated(e,t){mt(()=>{const n=t.value,s=C1(e,typeof n=="object"?n.bypassOverflowCheck:void 0,n);if(n==null||!s||typeof n=="string"&&!n||typeof n=="object"&&!n.content){Rg(e._tooltipInstance),delete e._tooltipInstance;return}t.value!==t.oldValue&&(typeof n=="string"?n:n!=null&&n.content)&&lz(e,n)})},beforeUnmount(e){Rg(e._tooltipInstance),delete e._tooltipInstance},unmounted(e){Rg(e._tooltipInstance),delete e._tooltipInstance}};function uz(e,t,n){const s=document.createElement("div");s.className=n;const o=CT(e,t);return o.mount(s),{container:s,app:o}}function Tg(e){if(!e)return;const t=e._vueApp;if(t)try{t.unmount(),delete e._vueApp}catch(n){console.warn("Error unmounting Vue app:",n)}}function cz(e,t){e._vueApp=t}const dz=e=>{const{container:t,app:n}=uz(fY,{user:e.user,status:e.status,timezone:e.timezone,userConfig:e.userConfig,showInsightButton:e.showInsightButton,showCopyLinkButton:e.showCopyLinkButton,apiUpdateFunction:e.apiUpdateFunction,refreshInterval:e.refreshInterval,enableAutoRefresh:e.enableAutoRefresh,onInsightClick:e.onInsightClick,onCopyLink:e.onCopyLink},"user-profile-tooltip-content");return cz(t,n),t},E1=e=>{e._userProfileContainer&&(Tg(e._userProfileContainer),delete e._userProfileContainer),e._userProfileInstance&&(Rg(e._userProfileInstance),delete e._userProfileInstance),e.style.cursor="",e.classList.remove("user-profile-trigger")},hz={mounted(e,t){var s,o;if(!((s=t.value)!=null&&s.user)){console.warn("[UserProfile] User data is required");return}const n=t.value;n.onInsightClick=()=>{var i;(i=e._userProfileInstance)==null||i.hide()},e._userProfileInstance=y1(e,{...hC,delay:[300,0],content:((o=n.user)==null?void 0:o.name)||"User",placement:n.placement||"bottom-start",trigger:"mouseenter focus",appendTo:n.appendTo||hC.appendTo,onShow(i){e._userProfileContainer&&Tg(e._userProfileContainer);const r=dz(n);e._userProfileContainer=r,i.setContent(r)},onHidden(){setTimeout(()=>{e._userProfileContainer&&(Tg(e._userProfileContainer),e._userProfileContainer=void 0)},200)},onDestroy(){e._userProfileContainer&&(Tg(e._userProfileContainer),e._userProfileContainer=void 0)}}),e._userProfileInstance.enable(),e.classList.add("user-profile-trigger")},updated(e,t){var n;if(!(!((n=t.value)!=null&&n.user)||!e._userProfileInstance)&&t.value!==t.oldValue)try{e._userProfileInstance.setProps({placement:t.value.placement||"bottom-start"}),e._userProfileInstance.hide()}catch(s){console.warn("Error updating tooltip props:",s)}},beforeUnmount(e){E1(e)},unmounted(e){E1(e)}},fz={key:0},pz=rt({__name:"Button",props:{label:{default:""},variant:{default:"primary"},size:{default:"default"},disabled:{type:Boolean,default:!1},type:{default:"button"},rounded:{type:Boolean},highlightOnHover:{type:Boolean},border:{type:Boolean},action:{},readOnly:{type:Boolean,default:!1},actived:{type:Boolean,default:!1},loading:{type:Boolean},tooltip:{},href:{default:void 0}},emits:["handleClick","escape","select"],setup(e,{expose:t,emit:n}){const s=Jt,o=e,i=T=>/^https?:\/\/[^\s$.?#].[^\s]*$/i.test(T),r=Y(()=>o.href&&o.href.length>0&&i(o.href)?"a":"button"),a=V(!1),l=V(null),u=()=>{o.disabled||(a.value=!0)},c=()=>{o.disabled||(a.value=!1)};rn(()=>{l.value&&(l.value.addEventListener("mouseenter",u),l.value.addEventListener("mouseleave",c))}),vs(()=>{l.value&&(l.value.removeEventListener("mouseenter",u),l.value.removeEventListener("mouseleave",c))});const d=n,h=new Set(["primary","secondary","tertiary","text","menu-item","control"]),f=Y(()=>Array.isArray(o.variant)?o.variant:[o.variant]),p=mg(),g=Y(()=>{const T=[p.customButton],I=f.value.find(x=>h.has(x))||"primary";return T.push(p[`is-${I}`]),f.value.includes("danger")&&T.push(p["is-danger"]),f.value.includes("icon")&&T.push(p["is-icon"]),f.value.includes("control")&&T.push(p["is-control"]),o.readOnly&&T.push(p["is-readonly"]),o.rounded&&T.push(p["is-rounded"]),o.border&&T.push(p["has-border"]),o.highlightOnHover&&T.push(p["highlight-on-hover"]),_.value&&T.push(p["has-prefix"]),D.value&&T.push(p["has-suffix"]),o.actived&&T.push(p["is-active"]),o.disabled&&T.push(p.disabled),o.loading&&T.push(p["is-loading"]),typeof o.size=="string"&&T.push(p[`size-${o.size}`]),T}),v=Y(()=>{var T;return o.variant=="primary"||((T=o.variant)==null?void 0:T.includes("primary"))}),C=Y(()=>o.readOnly===!0),S=Y(()=>typeof o.size=="number"?{"--button-size":`${o.size}px`}:{}),b=T=>{var I;o.disabled||o.readOnly||(d("handleClick",T),(I=o.action)==null||I.call(o))},w=ng(),_=Y(()=>!!w.prefix),D=Y(()=>!!w.suffix);return t({buttonRef:l,focus:()=>{var T;(T=l.value)==null||T.focus()},escape:T=>{d("escape",T)},select:()=>{var T;(T=l.value)==null||T.click()},blur:()=>{var T;(T=l.value)==null||T.blur()}}),(T,I)=>(j(),qe(ww(r.value),{class:te(g.value),type:o.type,disabled:o.disabled,"aria-readonly":C.value,style:dn(S.value),onClick:b,ref_key:"buttonRef",ref:l,"data-is-primary":v.value,href:r.value=="a"?o.href:void 0},{default:me(()=>[Tt(T.$slots,"prefix"),Tt(T.$slots,"default",{hovered:a.value},()=>[e.label?Ke((j(),ce("span",fz,[nt(Ct(e.label),1)])),[[U(s),{content:e.label}]]):Je("",!0)]),Tt(T.$slots,"suffix")]),_:3},8,["class","type","disabled","aria-readonly","style","data-is-primary","href"]))}}),gz={customButton:"
|
|
103
|
+
`,document.head.appendChild(e)})();const Jt={mounted(e,t){const n=i=>{var r;return i.nodeType===Node.TEXT_NODE&&((r=i.textContent)!=null&&r.trim())?!0:i.nodeType===Node.ELEMENT_NODE?Array.from(i.childNodes).some(n):!1};if(!t.value)return;e.childNodes.length===1&&e.childNodes[0].nodeType===Node.TEXT_NODE||e.childNodes.length>=1&&n(e)?e.classList.add("arbo-tooltip-wrapper"):e.classList.add("arbo-tooltip-wrapper-component");const s=t.value;(typeof s=="string"?s:s!=null&&s.content)&&mt(()=>{C1(e,typeof s=="object"?s.bypassOverflowCheck:void 0,s)&&(e._tooltipInstance=b1(e,s))})},updated(e,t){mt(()=>{const n=t.value,s=C1(e,typeof n=="object"?n.bypassOverflowCheck:void 0,n);if(n==null||!s||typeof n=="string"&&!n||typeof n=="object"&&!n.content){Rg(e._tooltipInstance),delete e._tooltipInstance;return}t.value!==t.oldValue&&(typeof n=="string"?n:n!=null&&n.content)&&lz(e,n)})},beforeUnmount(e){Rg(e._tooltipInstance),delete e._tooltipInstance},unmounted(e){Rg(e._tooltipInstance),delete e._tooltipInstance}};function uz(e,t,n){const s=document.createElement("div");s.className=n;const o=CT(e,t);return o.mount(s),{container:s,app:o}}function Tg(e){if(!e)return;const t=e._vueApp;if(t)try{t.unmount(),delete e._vueApp}catch(n){console.warn("Error unmounting Vue app:",n)}}function cz(e,t){e._vueApp=t}const dz=e=>{const{container:t,app:n}=uz(fY,{user:e.user,status:e.status,timezone:e.timezone,userConfig:e.userConfig,showInsightButton:e.showInsightButton,showCopyLinkButton:e.showCopyLinkButton,apiUpdateFunction:e.apiUpdateFunction,refreshInterval:e.refreshInterval,enableAutoRefresh:e.enableAutoRefresh,onInsightClick:e.onInsightClick,onCopyLink:e.onCopyLink},"user-profile-tooltip-content");return cz(t,n),t},E1=e=>{e._userProfileContainer&&(Tg(e._userProfileContainer),delete e._userProfileContainer),e._userProfileInstance&&(Rg(e._userProfileInstance),delete e._userProfileInstance),e.style.cursor="",e.classList.remove("user-profile-trigger")},hz={mounted(e,t){var s,o;if(!((s=t.value)!=null&&s.user)){console.warn("[UserProfile] User data is required");return}const n=t.value;n.onInsightClick=()=>{var i;(i=e._userProfileInstance)==null||i.hide()},e._userProfileInstance=y1(e,{...hC,delay:[300,0],content:((o=n.user)==null?void 0:o.name)||"User",placement:n.placement||"bottom-start",trigger:"mouseenter focus",appendTo:n.appendTo||hC.appendTo,onShow(i){e._userProfileContainer&&Tg(e._userProfileContainer);const r=dz(n);e._userProfileContainer=r,i.setContent(r)},onHidden(){setTimeout(()=>{e._userProfileContainer&&(Tg(e._userProfileContainer),e._userProfileContainer=void 0)},200)},onDestroy(){e._userProfileContainer&&(Tg(e._userProfileContainer),e._userProfileContainer=void 0)}}),e._userProfileInstance.enable(),e.classList.add("user-profile-trigger")},updated(e,t){var n;if(!(!((n=t.value)!=null&&n.user)||!e._userProfileInstance)&&t.value!==t.oldValue)try{e._userProfileInstance.setProps({placement:t.value.placement||"bottom-start"}),e._userProfileInstance.hide()}catch(s){console.warn("Error updating tooltip props:",s)}},beforeUnmount(e){E1(e)},unmounted(e){E1(e)}},fz={key:0},pz=rt({__name:"Button",props:{label:{default:""},variant:{default:"primary"},size:{default:"default"},disabled:{type:Boolean,default:!1},type:{default:"button"},rounded:{type:Boolean},highlightOnHover:{type:Boolean},border:{type:Boolean},action:{},readOnly:{type:Boolean,default:!1},actived:{type:Boolean,default:!1},loading:{type:Boolean},tooltip:{},href:{default:void 0},hovered:{type:Boolean,default:!1}},emits:["handleClick","escape","select"],setup(e,{expose:t,emit:n}){const s=Jt,o=e,i=T=>/^https?:\/\/[^\s$.?#].[^\s]*$/i.test(T),r=Y(()=>o.href&&o.href.length>0&&i(o.href)?"a":"button"),a=V(!1),l=V(null),u=()=>{o.disabled||(a.value=!0)},c=()=>{o.disabled||(a.value=!1)};rn(()=>{l.value&&(l.value.addEventListener("mouseenter",u),l.value.addEventListener("mouseleave",c))}),vs(()=>{l.value&&(l.value.removeEventListener("mouseenter",u),l.value.removeEventListener("mouseleave",c))});const d=n,h=new Set(["primary","secondary","tertiary","text","menu-item","control"]),f=Y(()=>Array.isArray(o.variant)?o.variant:[o.variant]),p=mg(),g=Y(()=>{const T=[p.customButton],I=f.value.find(x=>h.has(x))||"primary";return T.push(p[`is-${I}`]),f.value.includes("danger")&&T.push(p["is-danger"]),f.value.includes("icon")&&T.push(p["is-icon"]),f.value.includes("control")&&T.push(p["is-control"]),o.readOnly&&T.push(p["is-readonly"]),o.rounded&&T.push(p["is-rounded"]),o.border&&T.push(p["has-border"]),o.highlightOnHover&&T.push(p["highlight-on-hover"]),_.value&&T.push(p["has-prefix"]),D.value&&T.push(p["has-suffix"]),o.actived&&T.push(p["is-active"]),o.hovered&&T.push(p["is-hovered"]),o.disabled&&T.push(p.disabled),o.loading&&T.push(p["is-loading"]),typeof o.size=="string"&&T.push(p[`size-${o.size}`]),T}),v=Y(()=>{var T;return o.variant=="primary"||((T=o.variant)==null?void 0:T.includes("primary"))}),C=Y(()=>o.readOnly===!0),S=Y(()=>typeof o.size=="number"?{"--button-size":`${o.size}px`}:{}),b=T=>{var I;o.disabled||o.readOnly||(d("handleClick",T),(I=o.action)==null||I.call(o))},w=ng(),_=Y(()=>!!w.prefix),D=Y(()=>!!w.suffix);return t({buttonRef:l,focus:()=>{var T;(T=l.value)==null||T.focus()},escape:T=>{d("escape",T)},select:()=>{var T;(T=l.value)==null||T.click()},blur:()=>{var T;(T=l.value)==null||T.blur()}}),(T,I)=>(j(),qe(ww(r.value),{class:te(g.value),type:o.type,disabled:o.disabled,"aria-readonly":C.value,style:dn(S.value),onClick:b,ref_key:"buttonRef",ref:l,"data-is-primary":v.value,href:r.value=="a"?o.href:void 0},{default:me(()=>[Tt(T.$slots,"prefix"),Tt(T.$slots,"default",{hovered:a.value},()=>[e.label?Ke((j(),ce("span",fz,[nt(Ct(e.label),1)])),[[U(s),{content:e.label}]]):Je("",!0)]),Tt(T.$slots,"suffix")]),_:3},8,["class","type","disabled","aria-readonly","style","data-is-primary","href"]))}}),gz={customButton:"_customButton_sdove_1","size-extra-small":"_size-extra-small_sdove_31","size-small":"_size-small_sdove_37","size-medium":"_size-medium_sdove_43","size-large":"_size-large_sdove_49","size-default":"_size-default_sdove_55","is-primary":"_is-primary_sdove_58","is-active":"_is-active_sdove_67","is-secondary":"_is-secondary_sdove_70","is-tertiary":"_is-tertiary_sdove_88","is-text":"_is-text_sdove_101","is-danger":"_is-danger_sdove_109","is-menu-item":"_is-menu-item_sdove_118","is-text-btn":"_is-text-btn_sdove_187","is-control":"_is-control_sdove_209","is-hovered":"_is-hovered_sdove_215","is-readonly":"_is-readonly_sdove_242","is-rounded":"_is-rounded_sdove_245","has-border":"_has-border_sdove_248","highlight-on-hover":"_highlight-on-hover_sdove_251","icon-wrapper":"_icon-wrapper_sdove_251","is-loading":"_is-loading_sdove_254",disabled:"_disabled_sdove_269",spin:"_spin_sdove_1","is-icon":"_is-icon_sdove_293",tertiary:"_tertiary_sdove_309",active:"_active_sdove_315","read-only":"_read-only_sdove_315",danger:"_danger_sdove_322","arbo__icon-btn":"_arbo__icon-btn_sdove_329"},_t=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},vt=_t(pz,[["__cssModules",{$style:gz}]]);/*!
|
|
104
104
|
* Compressor.js v1.2.1
|
|
105
105
|
* https://fengyuanchen.github.io/compressorjs
|
|
106
106
|
*
|
|
@@ -152,7 +152,7 @@ This will fail in production.`);r=Yl,r._s.has(e)||(o?qb(e,t,s,r):kA(e,s,r),K.env
|
|
|
152
152
|
* @author RubaXa <trash@rubaxa.org>
|
|
153
153
|
* @author owenm <owen23355@gmail.com>
|
|
154
154
|
* @license MIT
|
|
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 cr(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){UJ(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 Ym(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ym=function(t){return typeof t}:Ym=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ym(e)}function UJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qr(){return Qr=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},Qr.apply(this,arguments)}function WJ(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 zJ(e,t){if(e==null)return{};var n=WJ(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 jJ="1.14.0";function ea(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ta=ea(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),mf=ea(/Edge/i),nO=ea(/firefox/i),vf=ea(/safari/i)&&!ea(/chrome/i)&&!ea(/android/i),sO=ea(/iP(ad|od|hone)/i),KJ=ea(/chrome/i)&&ea(/android/i),oO={capture:!1,passive:!1};function yn(e,t,n){e.addEventListener(t,n,!ta&&oO)}function fn(e,t,n){e.removeEventListener(t,n,!ta&&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 qJ(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function dr(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=qJ(e))}return null}var iO=/\s+/g;function Mo(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 Bt(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 zc(e,t){var n="";if(typeof e=="string")n=e;else do{var s=Bt(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 hr(){var e=document.scrollingElement;return e||document.documentElement}function Ss(e,t,n,s,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,r,a,l,u,c,d;if(e!==window&&e.parentNode&&e!==hr()?(i=e.getBoundingClientRect(),r=i.top,a=i.left,l=i.bottom,u=i.right,c=i.height,d=i.width):(r=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!ta))do if(o&&o.getBoundingClientRect&&(Bt(o,"transform")!=="none"||n&&Bt(o,"position")!=="static")){var h=o.getBoundingClientRect();r-=h.top+parseInt(Bt(o,"border-top-width")),a-=h.left+parseInt(Bt(o,"border-left-width")),l=r+i.height,u=a+i.width;break}while(o=o.parentNode);if(s&&e!==window){var f=zc(o||e),p=f&&f.a,g=f&&f.d;f&&(r/=g,a/=p,d/=p,c/=g,l=r+c,u=a+d)}return{top:r,left:a,bottom:l,right:u,width:d,height:c}}}function aO(e,t,n){for(var s=za(e,!0),o=Ss(e)[t];s;){var i=Ss(s)[n],r=void 0;if(r=o>=i,!r)return s;if(s===hr())break;s=za(s,!1)}return!1}function jc(e,t,n,s){for(var o=0,i=0,r=e.children;i<r.length;){if(r[i].style.display!=="none"&&r[i]!==$t.ghost&&(s||r[i]!==$t.dragged)&&dr(r[i],n.draggable,e,!1)){if(o===t)return r[i];o++}i++}return null}function bS(e,t){for(var n=e.lastElementChild;n&&(n===$t.ghost||Bt(n,"display")==="none"||t&&!Zm(n,t));)n=n.previousElementSibling;return n||null}function oi(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==$t.clone&&(!t||Zm(e,t))&&n++;return n}function lO(e){var t=0,n=0,s=hr();if(e)do{var o=zc(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 YJ(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 za(e,t){if(!e||!e.getBoundingClientRect)return hr();var n=e,s=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=Bt(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 hr();if(s||t)return n;s=!0}}while(n=n.parentNode);return hr()}function ZJ(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function SS(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 yf;function uO(e,t){return function(){if(!yf){var n=arguments,s=this;n.length===1?e.call(s,n[0]):e.apply(s,n),yf=setTimeout(function(){yf=void 0},t)}}}function XJ(){clearTimeout(yf),yf=void 0}function cO(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 No="Sortable"+new Date().getTime();function JJ(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(o){if(!(Bt(o,"display")==="none"||o===$t.ghost)){e.push({target:o,rect:Ss(o)});var i=cr({},e[e.length-1].rect);if(o.thisAnimationDuration){var r=zc(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(YJ(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,u=a.target,c=u.fromRect,d=Ss(u),h=u.prevFromRect,f=u.prevToRect,p=a.rect,g=zc(u,!0);g&&(d.top-=g.f,d.left-=g.e),u.toRect=d,u.thisAnimationDuration&&SS(h,d)&&!SS(c,d)&&(p.top-d.top)/(p.left-d.left)===(c.top-d.top)/(c.left-d.left)&&(l=eQ(p,h,f,o.options)),SS(d,c)||(u.prevFromRect=c,u.prevToRect=d,l||(l=o.options.animation),o.animate(u,p,d,l)),l&&(i=!0,r=Math.max(r,l),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},l),u.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){Bt(s,"transition",""),Bt(s,"transform","");var a=zc(this.el),l=a&&a.a,u=a&&a.d,c=(o.left-i.left)/(l||1),d=(o.top-i.top)/(u||1);s.animatingX=!!c,s.animatingY=!!d,Bt(s,"transform","translate3d("+c+"px,"+d+"px,0)"),this.forRepaintDummy=QJ(s),Bt(s,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),Bt(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){Bt(s,"transition",""),Bt(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},r)}}}}function QJ(e){return e.offsetWidth}function eQ(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 Kc=[],ES={initializeByDefault:!0},wf={mount:function(t){for(var n in ES)ES.hasOwnProperty(n)&&!(n in t)&&(t[n]=ES[n]);Kc.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Kc.push(t)},pluginEvent:function(t,n,s){var o=this;this.eventCanceled=!1,s.cancel=function(){o.eventCanceled=!0};var i=t+"Global";Kc.forEach(function(r){n[r.pluginName]&&(n[r.pluginName][i]&&n[r.pluginName][i](cr({sortable:n},s)),n.options[r.pluginName]&&n[r.pluginName][t]&&n[r.pluginName][t](cr({sortable:n},s)))})},initializePlugins:function(t,n,s,o){Kc.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var u=new a(t,n,t.options);u.sortable=t,u.options=t.options,t[l]=u,Qr(s,u.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 Kc.forEach(function(o){typeof o.eventProperties=="function"&&Qr(s,o.eventProperties.call(n[o.pluginName],t))}),s},modifyOption:function(t,n,s){var o;return Kc.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],s))}),o}};function tQ(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,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[No],!!t){var g,v=t.options,C="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!ta&&!mf?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=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=cr(cr({},p),wf.getEventProperties(s,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[C]&&v[C].call(t,g)}}var nQ=["evt"],po=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.evt,i=zJ(s,nQ);wf.pluginEvent.bind($t)(t,n,cr({dragEl:ft,parentEl:Xn,ghostEl:Zt,rootEl:Hn,nextEl:su,lastDownEl:Xm,cloneEl:Jn,cloneHidden:ja,dragStarted:bf,putSortable:Ps,activeSortable:$t.active,originalEvent:o,oldIndex:qc,oldDraggableIndex:Cf,newIndex:Lo,newDraggableIndex:Ka,hideGhostForTarget:yO,unhideGhostForTarget:wO,cloneNowHidden:function(){ja=!0},cloneNowShown:function(){ja=!1},dispatchSortableEvent:function(a){eo({sortable:n,name:a,originalEvent:o})}},i))};function eo(e){tQ(cr({putSortable:Ps,cloneEl:Jn,targetEl:ft,rootEl:Hn,oldIndex:qc,oldDraggableIndex:Cf,newIndex:Lo,newDraggableIndex:Ka},e))}var ft,Xn,Zt,Hn,su,Xm,Jn,ja,qc,Lo,Cf,Ka,Jm,Ps,Yc=!1,Qm=!1,ev=[],ou,ki,_S,RS,hO,fO,bf,Zc,Sf,Ef=!1,tv=!1,nv,Us,DS=[],TS=!1,sv=[],ov=typeof document<"u",iv=sO,pO=mf||ta?"cssFloat":"float",sQ=ov&&!KJ&&!sO&&"draggable"in document.createElement("div"),gO=function(){if(ov){if(ta)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mO=function(t,n){var s=Bt(t),o=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),i=jc(t,0,n),r=jc(t,1,n),a=i&&Bt(i),l=r&&Bt(r),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ss(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ss(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"||u>=o&&s[pO]==="none"||r&&s[pO]==="none"&&u+c>o)?"vertical":"horizontal"},oQ=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,u=s?n.width:n.height;return o===a||i===l||o+r/2===a+u/2},iQ=function(t,n){var s;return ev.some(function(o){var i=o[No].options.emptyInsertThreshold;if(!(!i||bS(o))){var r=Ss(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,u,c){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,u,c),r)(a,l,u,c);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||Ym(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&&Zt&&Bt(Zt,"display","none")},wO=function(){!gO&&Zt&&Bt(Zt,"display","")};ov&&document.addEventListener("click",function(e){if(Qm)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Qm=!1,!1},!0);var iu=function(t){if(ft){t=t.touches?t.touches[0]:t;var n=iQ(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[No]._onDragOver(s)}}},rQ=function(t){ft&&ft.parentNode[No]._isOutsideThisEl(t.target)};function $t(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=Qr({},t),e[No]=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:$t.supportPointer!==!1&&"PointerEvent"in window&&!vf,emptyInsertThreshold:5};wf.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:sQ,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?yn(e,"pointerdown",this._onTapStart):(yn(e,"mousedown",this._onTapStart),yn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(yn(e,"dragover",this),yn(e,"dragenter",this)),ev.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Qr(this,JJ())}$t.prototype={constructor:$t,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Zc=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,ft):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,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(pQ(s),!ft&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&vf&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=dr(l,o.draggable,s,!1),!(l&&l.animated)&&Xm!==l)){if(qc=oi(l),Cf=oi(l,o.draggable),typeof c=="function"){if(c.call(this,t,l,this)){eo({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:s,fromEl:s}),po("filter",n,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=dr(u,d.trim(),s,!1),d)return eo({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:s,toEl:s}),po("filter",n,{evt:t}),!0}),c)){i&&t.cancelable&&t.preventDefault();return}o.handle&&!dr(u,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&&!ft&&s.parentNode===i){var u=Ss(s);if(Hn=i,ft=s,Xn=ft.parentNode,su=ft.nextSibling,Xm=s,Jm=r.group,$t.dragged=ft,ou={target:ft,clientX:(n||t).clientX,clientY:(n||t).clientY},hO=ou.clientX-u.left,fO=ou.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,ft.style["will-change"]="all",l=function(){if(po("delayEnded",o,{evt:t}),$t.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!nO&&o.nativeDraggable&&(ft.draggable=!0),o._triggerDragStart(t,n),eo({sortable:o,name:"choose",originalEvent:t}),Mo(ft,r.chosenClass,!0)},r.ignore.split(",").forEach(function(c){rO(ft,c.trim(),IS)}),yn(a,"dragover",iu),yn(a,"mousemove",iu),yn(a,"touchmove",iu),yn(a,"mouseup",o._onDrop),yn(a,"touchend",o._onDrop),yn(a,"touchcancel",o._onDrop),nO&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ft.draggable=!0),po("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(mf||ta))){if($t.eventCanceled){this._onDrop();return}yn(a,"mouseup",o._disableDelayedDrag),yn(a,"touchend",o._disableDelayedDrag),yn(a,"touchcancel",o._disableDelayedDrag),yn(a,"mousemove",o._delayedDragTouchMoveHandler),yn(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&yn(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(){ft&&IS(ft),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;fn(t,"mouseup",this._disableDelayedDrag),fn(t,"touchend",this._disableDelayedDrag),fn(t,"touchcancel",this._disableDelayedDrag),fn(t,"mousemove",this._delayedDragTouchMoveHandler),fn(t,"touchmove",this._delayedDragTouchMoveHandler),fn(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?yn(document,"pointermove",this._onTouchMove):n?yn(document,"touchmove",this._onTouchMove):yn(document,"mousemove",this._onTouchMove):(yn(ft,"dragend",this),yn(Hn,"dragstart",this._onDragStart));try{document.selection?av(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Yc=!1,Hn&&ft){po("dragStarted",this,{evt:n}),this.nativeDraggable&&yn(document,"dragover",rQ);var s=this.options;!t&&Mo(ft,s.dragClass,!1),Mo(ft,s.ghostClass,!0),$t.active=this,t&&this._appendGhost(),eo({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(ki){this._lastX=ki.clientX,this._lastY=ki.clientY,yO();for(var t=document.elementFromPoint(ki.clientX,ki.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ki.clientX,ki.clientY),t!==n);)n=t;if(ft.parentNode[No]._isOutsideThisEl(t),n)do{if(n[No]){var s=void 0;if(s=n[No]._onDragOver({clientX:ki.clientX,clientY:ki.clientY,target:t,rootEl:n}),s&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);wO()}},_onTouchMove:function(t){if(ou){var n=this.options,s=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,r=Zt&&zc(Zt,!0),a=Zt&&r&&r.a,l=Zt&&r&&r.d,u=iv&&Us&&lO(Us),c=(i.clientX-ou.clientX+o.x)/(a||1)+(u?u[0]-DS[0]:0)/(a||1),d=(i.clientY-ou.clientY+o.y)/(l||1)+(u?u[1]-DS[1]:0)/(l||1);if(!$t.active&&!Yc){if(s&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Zt){r?(r.e+=c-(_S||0),r.f+=d-(RS||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Bt(Zt,"webkitTransform",h),Bt(Zt,"mozTransform",h),Bt(Zt,"msTransform",h),Bt(Zt,"transform",h),_S=c,RS=d,ki=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Zt){var t=this.options.fallbackOnBody?document.body:Hn,n=Ss(ft,!0,iv,!0,t),s=this.options;if(iv){for(Us=t;Bt(Us,"position")==="static"&&Bt(Us,"transform")==="none"&&Us!==document;)Us=Us.parentNode;Us!==document.body&&Us!==document.documentElement?(Us===document&&(Us=hr()),n.top+=Us.scrollTop,n.left+=Us.scrollLeft):Us=hr(),DS=lO(Us)}Zt=ft.cloneNode(!0),Mo(Zt,s.ghostClass,!1),Mo(Zt,s.fallbackClass,!0),Mo(Zt,s.dragClass,!0),Bt(Zt,"transition",""),Bt(Zt,"transform",""),Bt(Zt,"box-sizing","border-box"),Bt(Zt,"margin",0),Bt(Zt,"top",n.top),Bt(Zt,"left",n.left),Bt(Zt,"width",n.width),Bt(Zt,"height",n.height),Bt(Zt,"opacity","0.8"),Bt(Zt,"position",iv?"absolute":"fixed"),Bt(Zt,"zIndex","100000"),Bt(Zt,"pointerEvents","none"),$t.ghost=Zt,t.appendChild(Zt),Bt(Zt,"transform-origin",hO/parseInt(Zt.style.width)*100+"% "+fO/parseInt(Zt.style.height)*100+"%")}},_onDragStart:function(t,n){var s=this,o=t.dataTransfer,i=s.options;if(po("dragStart",this,{evt:t}),$t.eventCanceled){this._onDrop();return}po("setupClone",this),$t.eventCanceled||(Jn=dO(ft),Jn.draggable=!1,Jn.style["will-change"]="",this._hideClone(),Mo(Jn,this.options.chosenClass,!1),$t.clone=Jn),s.cloneId=av(function(){po("clone",s),!$t.eventCanceled&&(s.options.removeCloneOnHide||Hn.insertBefore(Jn,ft),s._hideClone(),eo({sortable:s,name:"clone"}))}),!n&&Mo(ft,i.dragClass,!0),n?(Qm=!0,s._loopId=setInterval(s._emulateDragOver,50)):(fn(document,"mouseup",s._onDrop),fn(document,"touchend",s._onDrop),fn(document,"touchcancel",s._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(s,o,ft)),yn(document,"drop",s),Bt(ft,"transform","translateZ(0)")),Yc=!0,s._dragStartId=av(s._dragStarted.bind(s,n,t)),yn(document,"selectstart",s),bf=!0,vf&&Bt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,s=t.target,o,i,r,a=this.options,l=a.group,u=$t.active,c=Jm===l,d=a.sort,h=Ps||u,f,p=this,g=!1;if(TS)return;function v(ee,re){po(ee,p,cr({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:r,dragRect:o,targetRect:i,canSort:d,fromSortable:h,target:s,completed:S,onMove:function(J,L){return rv(Hn,n,ft,o,J,Ss(J),t,L)},changed:b},re))}function C(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(ee){return v("dragOverCompleted",{insertion:ee}),ee&&(c?u._hideClone():u._showClone(p),p!==h&&(Mo(ft,Ps?Ps.options.ghostClass:u.options.ghostClass,!1),Mo(ft,a.ghostClass,!0)),Ps!==p&&p!==$t.active?Ps=p:p===$t.active&&Ps&&(Ps=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===ft&&!ft.animated||s===n&&!s.animated)&&(Zc=null),!a.dragoverBubble&&!t.rootEl&&s!==document&&(ft.parentNode[No]._isOutsideThisEl(t.target),!ee&&iu(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Lo=oi(ft),Ka=oi(ft,a.draggable),eo({sortable:p,name:"change",toEl:n,newIndex:Lo,newDraggableIndex:Ka,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=dr(s,a.draggable,n,!0),v("dragOver"),$t.eventCanceled)return g;if(ft.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return S(!1);if(Qm=!1,u&&!a.disabled&&(c?d||(r=Xn!==Hn):Ps===this||(this.lastPutMode=Jm.checkPull(this,u,ft,t))&&l.checkPut(this,u,ft,t))){if(f=this._getDirection(t,s)==="vertical",o=Ss(ft),v("dragOverValid"),$t.eventCanceled)return g;if(r)return Xn=Hn,C(),this._hideClone(),v("revert"),$t.eventCanceled||(su?Hn.insertBefore(ft,su):Hn.appendChild(ft)),S(!0);var w=bS(n,a.draggable);if(!w||cQ(t,f,this)&&!w.animated){if(w===ft)return S(!1);if(w&&n===t.target&&(s=w),s&&(i=Ss(s)),rv(Hn,n,ft,o,s,i,t,!!s)!==!1)return C(),n.appendChild(ft),Xn=n,b(),S(!0)}else if(w&&uQ(t,f,this)){var _=jc(n,0,a,!0);if(_===ft)return S(!1);if(s=_,i=Ss(s),rv(Hn,n,ft,o,s,i,t,!1)!==!1)return C(),n.insertBefore(ft,_),Xn=n,b(),S(!0)}else if(s.parentNode===n){i=Ss(s);var D=0,T,I=ft.parentNode!==n,x=!oQ(ft.animated&&ft.toRect||o,s.animated&&s.toRect||i,f),F=f?"top":"left",E=aO(s,"top","top")||aO(ft,"top","top"),A=E?E.scrollTop:void 0;Zc!==s&&(T=i[F],Ef=!1,tv=!x&&a.invertSwap||I),D=dQ(t,s,i,f,x?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,tv,Zc===s);var k;if(D!==0){var O=oi(ft);do O-=D,k=Xn.children[O];while(k&&(Bt(k,"display")==="none"||k===Zt))}if(D===0||k===s)return S(!1);Zc=s,Sf=D;var B=s.nextElementSibling,Z=!1;Z=D===1;var X=rv(Hn,n,ft,o,s,i,t,Z);if(X!==!1)return(X===1||X===-1)&&(Z=X===1),TS=!0,setTimeout(lQ,30),C(),Z&&!B?n.appendChild(ft):s.parentNode.insertBefore(ft,Z?B:s),E&&cO(E,0,A-E.scrollTop),Xn=ft.parentNode,T!==void 0&&!tv&&(nv=Math.abs(T-Ss(s)[F])),b(),S(!0)}if(n.contains(ft))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){fn(document,"mousemove",this._onTouchMove),fn(document,"touchmove",this._onTouchMove),fn(document,"pointermove",this._onTouchMove),fn(document,"dragover",iu),fn(document,"mousemove",iu),fn(document,"touchmove",iu)},_offUpEvents:function(){var t=this.el.ownerDocument;fn(t,"mouseup",this._onDrop),fn(t,"touchend",this._onDrop),fn(t,"pointerup",this._onDrop),fn(t,"touchcancel",this._onDrop),fn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,s=this.options;if(Lo=oi(ft),Ka=oi(ft,s.draggable),po("drop",this,{evt:t}),Xn=ft&&ft.parentNode,Lo=oi(ft),Ka=oi(ft,s.draggable),$t.eventCanceled){this._nulling();return}Yc=!1,tv=!1,Ef=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),xS(this.cloneId),xS(this._dragStartId),this.nativeDraggable&&(fn(document,"drop",this),fn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),vf&&Bt(document.body,"user-select",""),Bt(ft,"transform",""),t&&(bf&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Zt&&Zt.parentNode&&Zt.parentNode.removeChild(Zt),(Hn===Xn||Ps&&Ps.lastPutMode!=="clone")&&Jn&&Jn.parentNode&&Jn.parentNode.removeChild(Jn),ft&&(this.nativeDraggable&&fn(ft,"dragend",this),IS(ft),ft.style["will-change"]="",bf&&!Yc&&Mo(ft,Ps?Ps.options.ghostClass:this.options.ghostClass,!1),Mo(ft,this.options.chosenClass,!1),eo({sortable:this,name:"unchoose",toEl:Xn,newIndex:null,newDraggableIndex:null,originalEvent:t}),Hn!==Xn?(Lo>=0&&(eo({rootEl:Xn,name:"add",toEl:Xn,fromEl:Hn,originalEvent:t}),eo({sortable:this,name:"remove",toEl:Xn,originalEvent:t}),eo({rootEl:Xn,name:"sort",toEl:Xn,fromEl:Hn,originalEvent:t}),eo({sortable:this,name:"sort",toEl:Xn,originalEvent:t})),Ps&&Ps.save()):Lo!==qc&&Lo>=0&&(eo({sortable:this,name:"update",toEl:Xn,originalEvent:t}),eo({sortable:this,name:"sort",toEl:Xn,originalEvent:t})),$t.active&&((Lo==null||Lo===-1)&&(Lo=qc,Ka=Cf),eo({sortable:this,name:"end",toEl:Xn,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){po("nulling",this),Hn=ft=Xn=Zt=su=Jn=Xm=ja=ou=ki=bf=Lo=Ka=qc=Cf=Zc=Sf=Ps=Jm=$t.dragged=$t.ghost=$t.clone=$t.active=null,sv.forEach(function(t){t.checked=!0}),sv.length=_S=RS=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ft&&(this._onDragOver(t),aQ(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],dr(n,r.draggable,this.el,!1)&&t.push(n.getAttribute(r.dataIdAttr)||fQ(n));return t},sort:function(t,n){var s={},o=this.el;this.toArray().forEach(function(i,r){var a=o.children[r];dr(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 dr(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=wf.modifyOption(this,t,n);typeof o<"u"?s[t]=o:s[t]=n,t==="group"&&vO(s)},destroy:function(){po("destroy",this);var t=this.el;t[No]=null,fn(t,"mousedown",this._onTapStart),fn(t,"touchstart",this._onTapStart),fn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(fn(t,"dragover",this),fn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),ev.splice(ev.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!ja){if(po("hideClone",this),$t.eventCanceled)return;Bt(Jn,"display","none"),this.options.removeCloneOnHide&&Jn.parentNode&&Jn.parentNode.removeChild(Jn),ja=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(ja){if(po("showClone",this),$t.eventCanceled)return;ft.parentNode==Hn&&!this.options.group.revertClone?Hn.insertBefore(Jn,ft):su?Hn.insertBefore(Jn,su):Hn.appendChild(Jn),this.options.group.revertClone&&this.animate(ft,Jn),Bt(Jn,"display",""),ja=!1}}};function aQ(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function rv(e,t,n,s,o,i,r,a){var l,u=e[No],c=u.options.onMove,d;return window.CustomEvent&&!ta&&!mf?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||Ss(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),c&&(d=c.call(u,l,r)),d}function IS(e){e.draggable=!1}function lQ(){TS=!1}function uQ(e,t,n){var s=Ss(jc(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 cQ(e,t,n){var s=Ss(bS(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 dQ(e,t,n,s,o,i,r,a){var l=s?e.clientY:e.clientX,u=s?n.height:n.width,c=s?n.top:n.left,d=s?n.bottom:n.right,h=!1;if(!r){if(a&&nv<u*o){if(!Ef&&(Sf===1?l>c+u*i/2:l<d-u*i/2)&&(Ef=!0),Ef)h=!0;else if(Sf===1?l<c+nv:l>d-nv)return-Sf}else if(l>c+u*(1-o)/2&&l<d-u*(1-o)/2)return hQ(t)}return h=h||r,h&&(l<c+u*i/2||l>d-u*i/2)?l>c+u/2?1:-1:0}function hQ(e){return oi(ft)<oi(e)?1:-1}function fQ(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 pQ(e){sv.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var s=t[n];s.checked&&sv.push(s)}}function av(e){return setTimeout(e,0)}function xS(e){return clearTimeout(e)}ov&&yn(document,"touchmove",function(e){($t.active||Yc)&&e.cancelable&&e.preventDefault()}),$t.utils={on:yn,off:fn,css:Bt,find:rO,is:function(t,n){return!!dr(t,n,t,!1)},extend:ZJ,throttle:uO,closest:dr,toggleClass:Mo,clone:dO,index:oi,nextTick:av,cancelNextTick:xS,detectDirection:mO,getChild:jc},$t.get=function(e){return e[No]},$t.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&&($t.utils=cr(cr({},$t.utils),s.utils)),wf.mount(s)})},$t.create=function(e,t){return new $t(e,t)},$t.version=jJ;var ds=[],_f,FS,PS=!1,AS,kS,lv,Rf;function gQ(){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?yn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?yn(document,"pointermove",this._handleFallbackAutoScroll):s.touches?yn(document,"touchmove",this._handleFallbackAutoScroll):yn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var s=n.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?fn(document,"dragover",this._handleAutoScroll):(fn(document,"pointermove",this._handleFallbackAutoScroll),fn(document,"touchmove",this._handleFallbackAutoScroll),fn(document,"mousemove",this._handleFallbackAutoScroll)),CO(),uv(),XJ()},nulling:function(){lv=FS=_f=PS=Rf=AS=kS=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(lv=n,s||this.options.forceAutoScrollFallback||mf||ta||vf){OS(n,this.options,a,s);var l=za(a,!0);PS&&(!Rf||i!==AS||r!==kS)&&(Rf&&CO(),Rf=setInterval(function(){var u=za(document.elementFromPoint(i,r),!0);u!==l&&(l=u,uv()),OS(n,o.options,u,s)},10),AS=i,kS=r)}else{if(!this.options.bubbleScroll||za(a,!0)===hr()){uv();return}OS(n,this.options,za(a,!1),!1)}}},Qr(e,{pluginName:"scroll",initializeByDefault:!0})}function uv(){ds.forEach(function(e){clearInterval(e.pid)}),ds=[]}function CO(){clearInterval(Rf)}var OS=uO(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=hr(),u=!1,c;FS!==n&&(FS=n,uv(),_f=t.scroll,c=t.scrollFn,_f===!0&&(_f=za(n,!0)));var d=0,h=_f;do{var f=h,p=Ss(f),g=p.top,v=p.bottom,C=p.left,S=p.right,b=p.width,w=p.height,_=void 0,D=void 0,T=f.scrollWidth,I=f.scrollHeight,x=Bt(f),F=f.scrollLeft,E=f.scrollTop;f===l?(_=b<T&&(x.overflowX==="auto"||x.overflowX==="scroll"||x.overflowX==="visible"),D=w<I&&(x.overflowY==="auto"||x.overflowY==="scroll"||x.overflowY==="visible")):(_=b<T&&(x.overflowX==="auto"||x.overflowX==="scroll"),D=w<I&&(x.overflowY==="auto"||x.overflowY==="scroll"));var A=_&&(Math.abs(S-o)<=r&&F+b<T)-(Math.abs(C-o)<=r&&!!F),k=D&&(Math.abs(v-i)<=r&&E+w<I)-(Math.abs(g-i)<=r&&!!E);if(!ds[d])for(var O=0;O<=d;O++)ds[O]||(ds[O]={});(ds[d].vx!=A||ds[d].vy!=k||ds[d].el!==f)&&(ds[d].el=f,ds[d].vx=A,ds[d].vy=k,clearInterval(ds[d].pid),(A!=0||k!=0)&&(u=!0,ds[d].pid=setInterval((function(){s&&this.layer===0&&$t.active._onTouchMove(lv);var B=ds[this.layer].vy?ds[this.layer].vy*a:0,Z=ds[this.layer].vx?ds[this.layer].vx*a:0;typeof c=="function"&&c.call($t.dragged.parentNode[No],Z,B,e,lv,ds[this.layer].el)!=="continue"||cO(ds[this.layer].el,Z,B)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=za(h,!1)));PS=u}},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 u=s||i;a();var c=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(c.clientX,c.clientY);l(),u&&!u.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:s}))}};function MS(){}MS.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=jc(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},Qr(MS,{pluginName:"revertOnSpill"});function NS(){}NS.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},Qr(NS,{pluginName:"removeOnSpill"}),$t.mount(new gQ),$t.mount(NS,MS);function mQ(e,t){return Object.values(e).indexOf(t)}function vQ(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 yQ(e){return["transition-group","TransitionGroup"].includes(e)}function SO(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?yQ(t.name):!1}function wQ(e,t){return t?{...t.props,...t.attrs}:e}const LS=["Start","Add","Remove","Update","End"],VS=["Choose","Unchoose","Sort","Filter","Clone"],CQ=["Move",...LS,...VS].map(e=>"on"+e);let BS=null;const bQ=rt({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",...LS.map(e=>e.toLowerCase()),...VS.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([]),u=V(null),c=V(null),d=Y(()=>e.list?e.list:e.modelValue),h=es();function f(){return e.component?MH(e.component):e.tag}function p(H){if(c.value)for(const Q in H){const fe=Qk(Q);CQ.indexOf(fe)===-1&&c.value.option(fe,H[Q])}}function g(){var H;return((H=h==null?void 0:h.proxy)==null?void 0:H.$el.children)||[]}async function v(){var H;await mt(),l.value=vQ(g(),((H=h==null?void 0:h.proxy)==null?void 0:H.$el.children)||[],o.value,a.value)}function C(H){const Q=mQ(g()||[],H);if(Q===-1)return null;const fe=d.value?d.value[Q]:null;return{index:Q,element:fe}}function S(H){mt(()=>t("change",H))}function b(H){if(e.list){H(e.list);return}const Q=[...e.modelValue||[]];H(Q),t("update:modelValue",Q)}function w(...H){b(fe=>fe.splice(...H))}function _(H,Q){b(ve=>ve.splice(Q,0,ve.splice(H,1)[0]))}function D(H){const Q=l.value,fe=Q.length;return H>fe-1?fe:Q[H]}function T(){var Q,fe;return n.default&&((fe=(Q=n.default()[0])==null?void 0:Q.component)==null?void 0:fe.proxy)||null}function I(H){if(!e.noTransitionOnDrag||!o.value)return;const Q=g();Q[H]&&(Q[H].data=null);const fe=T();fe&&(fe.children=[],fe.kept=void 0)}function x(H){v(),u.value=C(H.item),u.value&&(H.item._underlying_vm_=e.clone(u.value.element),BS=H.item)}function F(H){const Q=H.item._underlying_vm_;if(Q===void 0)return;CS(H.item);const fe=D(H.newIndex);w(fe,0,Q),v(),S({added:{element:Q,newIndex:fe}})}function E(H){var fe;if(eO((fe=h==null?void 0:h.proxy)==null?void 0:fe.$el,H.item,H.oldIndex),H.pullMode==="clone"){CS(H.clone);return}if(!u.value)return;const Q=u.value.index;w(Q,1),I(Q),S({removed:{element:u.value.element,oldIndex:Q}})}function A(H){var ve,oe;CS(H.item),eO(H.from,H.item,H.oldIndex);const Q=(ve=u.value)==null?void 0:ve.index,fe=D(H.newIndex);_(Q,fe),S({moved:{element:(oe=u.value)==null?void 0:oe.element,oldIndex:Q,newIndex:fe}})}function k(H,Q){Object.prototype.hasOwnProperty.call(H,Q)&&(H[Q]+=r.value)}function O(H){return H.__draggable_component__}function B({to:H,related:Q}){const fe=O(H);if(!fe)return{component:fe};const ve=fe.realList,oe={list:ve,component:fe};if(H!==Q&&ve&&fe.getUnderlyingVm){const ie=fe.getUnderlyingVm(Q);if(ie)return Object.assign(ie,oe)}return oe}function Z(H,Q){const fe=[...Q.to.children].filter(z=>z.style.display!=="none");if(fe.length===0)return 0;const ve=fe.indexOf(Q.related),oe=H.component.getVmIndex(ve);return fe.indexOf(BS)!==-1||!Q.willInsertAfter?oe:oe+1}const X=()=>{var oe,ie;const H={};LS.forEach(z=>{H["on"+z]=re(z)}),VS.forEach(z=>{H["on"+z]=ee.bind(null,z)});const Q=Object.keys(s).reduce((z,ge)=>(z[Qk(ge)]=s[ge],z),{}),fe=Object.assign({},Q,H,{onMove:(z,ge)=>ae(z,ge)});"draggable"in fe||(fe.draggable=">*");const ve=((oe=h==null?void 0:h.proxy)==null?void 0:oe.$el.nodeType)===1?h.proxy.$el:((ie=h==null?void 0:h.proxy)==null?void 0:ie.$el.parentElement)||null;ve&&(c.value=new $t(ve,fe),ve.__draggable_component__=h==null?void 0:h.proxy,v())};function ee(H,Q){mt(()=>t(H.toLowerCase(),Q))}function re(H){return Q=>{if(d.value!==null){const fe="onDrag"+H,ve=L[fe];ve&&ve(Q)}ee(H,Q)}}function ae(H,Q){const fe=e.move;if(!fe||!d.value)return!0;const ve=B(H),oe=u.value,ie=Z(ve,H);oe&&Object.assign(oe,{futureIndex:ie});const z=Object.assign({},H,{relatedContext:ve,draggedContext:oe});return fe(z,Q)}function J(){v(),BS=null}const L={onDragStart:x,onDragAdd:F,onDragRemove:E,onDragUpdate:A,onDragMove:ae,onDragEnd:J};return rn(()=>{X()}),e.list!==null&&e.modelValue!==null&&$J.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:C,emitChanges:S,alterList:b,spliceList:w,updatePosition:_,getVmIndex:D,getComponent:T,resetTransitionData:I,onDragStart:x,onDragAdd:F,onDragRemove:E,onDragUpdate:A,updateProperty:k,onDragMove:ae,onDragEnd:J,mounted:X,context:u,sortableInstance:c,getRelatedContextFromMoveEvent:B,getTargetedComponent:O,computeFutureIndex:Z}},render(){const e=this.getTag(),t=wQ(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),Zu(e,t,s)):Zu(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 Zu(e,t,n)}}),SQ=_t(rt({__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(u=>({id:u.field,name:u.headerName,...u}))||[],s.modelValue.forEach(u=>{i.value[u.field]={...u}})};et(()=>s.modelValue,u=>{r()},{immediate:!0,deep:!0}),et(n,u=>{if(u.length===s.modelValue.length&&!u.every((d,h)=>d.id===s.modelValue[h].field)){const d=u.map(h=>i.value[h.id]);o("changed",d),o("update:modelValue",d)}});const a=()=>!(s.readOnly||s.disabled),l=u=>!(s.readOnly||s.disabled);return(u,c)=>(j(),qe(U(bQ),{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[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:me(()=>[(j(!0),ce(xt,null,xn(n.value,(d,h)=>(j(),ce("div",{key:d.id,class:"fade-item"},[Tt(u.$slots,"item",{item:d,index:h},()=>[nt(Ct(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),EQ={key:0},_Q={key:1,style:{"font-style":"italic"}},RQ={key:2,style:{"font-style":"italic"}},DQ={key:3},cv=_t(rt({__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=Jt,s=e,o=V(s.columnStates[String(s.item.field)]||!1),i=t,r=h=>{o.value=h},a=Y(()=>{var h;return(h=s.item)==null?void 0:h.context}),l=Y(()=>{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"}),u=Y(()=>{var h,f;return(f=(h=s.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),c=Y(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=Y(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return et(()=>o.value,()=>{i("toggle-column",s.item.field,s.item.required)}),(h,f)=>(j(),ce("div",{key:e.item.field,class:te([h.$style["column-config__item"],{[h.$style.disabled]:s.readOnly,[h.$style["is-metric"]]:u.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:c.value}])},[pe(Bk,{focusIndex:s.focusIndex,id:`col-${e.item.field}`,"model-value":o.value==!0?U(Mt).CHECKED:U(Mt).UNCHECK,"onUpdate:modelValue":r,disabled:s.disableCheckbox||e.isDisableNewCheck&&!o.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),Ke((j(),ce("div",{class:"move-handler",style:dn({cursor:s.disableDrag?"not-allowed":"move"})},[pe(lt,{color:s.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:te(h.$style.handler)},null,8,["color","class"])],4)),[[U(n),s.disableDrag==!0?s.disableDragTooltip:""]]),u.value?(j(),ce("div",{key:0,class:te(h.$style["metric-type"])},[l.value=="rating"?(j(),ce("span",EQ,"★")):l.value=="formular"?(j(),ce("span",_Q," ƒx ")):l.value=="number"?(j(),ce("span",RQ," # ")):(j(),ce("span",DQ,Ct(l.value),1))],2)):Je("",!0),Re("span",{class:te(h.$style["column-config__item-label"])},[Ke((j(),ce("div",null,[nt(Ct(e.item.headerName),1)])),[[U(n),{content:e.item.headerName}]])],2),d.value?Ke((j(),ce("div",{key:1,class:te(h.$style["metric-icon"])},[pe(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[U(n),"Point metric"]]):Je("",!0),c.value?Ke((j(),ce("div",{key:2,class:te(h.$style["metric-icon"])},[pe(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[U(n),"Woohoo metric"]]):Je("",!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"}}]]),TQ=_t(rt({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const s=e,o=n,{hide:i,triggerRef:r,popupRef:a,isVisible:l,toggle:u}=Fs({toggleOnClick:!0,placement:s.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:s.show,maxWidth:s.maxWidth}),c=Y(()=>l.value);et(l,f=>{o(f?"open":"close")});const d=()=>{i()};t({closeDropdown:d,isOpen:c});const h=f=>{f.key==="Escape"&&a.value&&i()};return rn(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),vs(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(j(),ce("div",{ref_key:"triggerRef",ref:r,class:te(f.$style["dropdown-wrapper"])},[Tt(f.$slots,"trigger",{open:U(l),toggle:U(u),closeDropdown:d},()=>[Re("button",{class:te(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),Re("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:te(f.$style["dropdown-content"]),style:dn({display:U(l)?"block":"none",maxWidth:s.maxWidth?s.maxWidth+"px":"unset"})},[Tt(f.$slots,"content",{closeDropdown:d,visible:U(l)},()=>[Re("div",{class:te(f.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),IQ={class:"reach-limit-icon"},xQ=_t(rt({__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=Jt,o=e,i=n,r=V(""),a=V(),l=Y(()=>r.value.trim().length>0),u=V([]),c=V({}),{triggerRef:d,popupRef:h,isVisible:f,hide:p}=Fs({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});et(f,k=>{var O;k&&((O=a.value)==null||O.focus())});const g=Y(()=>o.disabled||r.value.length>0),v=Y(()=>u.value.filter(k=>k.pinned==="left"&&k.field&&k.headerName)),C=Y(()=>u.value.filter(k=>k.pinned==="right"&&k.field||k.field==="blank")),S=Y({get:()=>u.value.filter(k=>!k.pinned&&k.field&&k.field!=="blank"),set:k=>{u.value=[...v.value,...k,...C.value]}}),b=Y(()=>{if(!r.value)return{};const k=r.value.toLowerCase();return[...u.value,...S.value].reduce((O,B)=>{var Z;return(Z=B.headerName)!=null&&Z.toLowerCase().includes(k)&&B.field&&(O[B.field]=!0),O},{})}),w=Y(()=>o.modelValue),_=()=>{const k={};u.value.forEach(O=>{O.field&&(k[O.field]=!O.hide)}),c.value=k},D=Y(()=>{if(!r.value)return u.value;const k=r.value.toLowerCase();return u.value.filter(O=>{var B;return(B=O.headerName)==null?void 0:B.toLowerCase().includes(k)})}),T=()=>{var B;const k=(B=o.gridApi)==null?void 0:B.getColumnState().reduce((Z,X)=>(Z[X.colId]=Number(X.width),Z),{}),O=u.value.map(Z=>({...Z,hide:Z.field?!c.value[Z.field]:!1,width:Z.field?k==null?void 0:k[Z.field]:Z.width}));i("update:modelValue",O),i("change",O),i("input",O)},I=k=>{const O=[...v.value,...k,...C.value];o.checkboxColumn&&O.unshift(o.checkboxColumn),u.value=O,T()},x=k=>{k&&(c.value[k]=!c.value[k],T())};et(w,k=>{k&&k.length>0&&(u.value=[...k],_())},{immediate:!0}),t({updateColumnDefs(k){u.value=[...k],_()}});const F=Y(()=>A.value>=5),E=Y(()=>o.disabled||r.value.length>0),A=Y(()=>u.value.reduce((k,O)=>O.field&&O.field.includes("metric")&&c.value[O.field]===!0?k+1:k,0));return(k,O)=>{const B=Eo("focusable");return j(),ce("div",{class:te(k.$style["table-customization"])},[Re("div",{ref_key:"triggerRef",ref:d},[Tt(k.$slots,"trigger",{},()=>[Ke((j(),qe(vt,{variant:["secondary"],disabled:o.disabled,actived:U(f),style:{width:"32px"},onEscape:U(p)},{prefix:me(()=>[pe(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[B,"7"],[U(s),"Columns"]])])],512),Re("div",{ref_key:"popupRef",ref:h,class:te(k.$style["tippy-content-wrapper"])},[Re("div",{class:te([k.$style["column-config"],F.value?k.$style["has-warning"]:""]),style:dn({"--max-height":o.tableHeight?o.tableHeight:"max(500px, 60vh)"})},[pe(tS,{tabIndex:"7.0",modelValue:r.value,"onUpdate:modelValue":O[0]||(O[0]=Z=>r.value=Z),ref_key:"searchBoxRef",ref:a},null,8,["modelValue"]),Re("div",{class:te(k.$style["column-config__header"])},[...O[2]||(O[2]=[Re("span",null,"Manage columns",-1)])],2),F.value?(j(),ce("div",{key:0,class:te(k.$style["reach-limit"])},[Re("div",IQ,[pe(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),Re("div",{class:te(k.$style["warning-limit-text"])},[...O[3]||(O[3]=[nt(" You’ve reached the maximum number of metric columns. ",-1),Re("br",null,null,-1),nt(" Deselect one to show another. ",-1)])],2)],2)):Je("",!0),l.value?(j(),ce(xt,{key:1},[D.value.length===0&&l.value?(j(),ce("div",{key:0,class:te(k.$style["no-columns"])},[...O[4]||(O[4]=[nt(" No results. ",-1),Re("br",null,null,-1),nt(" Try another search. ",-1)])],2)):Je("",!0),l.value&&D.value.length>0?(j(),ce("div",{key:1,class:te(k.$style["column-config__pinned-section"])},[(j(!0),ce(xt,null,xn(D.value,Z=>{var X;return j(),qe(cv,{key:Z.colId,item:Z,columnStates:c.value,disableDrag:E.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:o.readOnly,isDisableNewCheck:F.value&&((X=Z.colId)==null?void 0:X.includes("metric")),onToggleColumn:x},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Je("",!0)],64)):Je("",!0),l.value?Je("",!0):(j(),ce("div",{key:2,class:te(k.$style["column-config__list"])},[(j(!0),ce(xt,null,xn(v.value,Z=>Ke((j(),qe(cv,{key:Z.field,item:Z,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:c.value},null,8,["item","columnStates"])),[[jo,b.value[Z.field]||!r.value]])),128)),pe(SQ,{modelValue:S.value,"onUpdate:modelValue":O[1]||(O[1]=Z=>S.value=Z),"group-name":"columns",onChanged:I,disabled:g.value,readOnly:o.readOnly},{item:me(({item:Z,index:X})=>[Ke((j(),qe(cv,{focusIndex:`7.${X+1}`,key:Z.id,item:Z,columnStates:c.value,disableDrag:E.value,disableDragTooltip:E.value?"Reordering is disabled while search is active.":void 0,readOnly:o.readOnly,isDisableNewCheck:F.value&&Z.id.includes("metric"),onToggleColumn:x},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[jo,b.value[Z.field]||!r.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(j(!0),ce(xt,null,xn(C.value.filter(Z=>{var X;return Z.headerName&&((X=Z.headerName)==null?void 0:X.length)>0}),Z=>Ke((j(),qe(cv,{key:Z.field,item:Z,disabled:o.disabled,readOnly:o.readOnly,columnStates:c.value},null,8,["item","disabled","readOnly","columnStates"])),[[jo,b.value[Z.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"}}]]),FQ=["aria-label"],PQ=["aria-disabled","onClick"],AQ=_t(rt({__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)=>(j(),ce("div",{class:te([a.$style["month-grid"],n.compact?a.$style.compact:""]),"aria-label":n.ariaLabel,"data-index":"month-selection"},[Re("div",{class:te(a.$style.months)},[(j(!0),ce(xt,null,xn(n.monthLabels,(u,c)=>(j(),ce("a",{key:u,tabindex:"0",class:te([a.$style["month-cell"],{[a.$style.selected]:c+1===n.selectedMonth&&n.selectedYear===n.displayYear,[a.$style.current]:c+1===r&&U(i)===n.displayYear,[a.$style.disabled]:n.disabled||n.readOnly||!n.isMonthSelectable(c+1)}]),"aria-disabled":n.disabled||n.readOnly||!n.isMonthSelectable(c+1),onClick:d=>o(c+1),onKeydown:l[0]||(l[0]=d=>s("keydown",d))},Ct(u),43,PQ))),128))],2)],10,FQ))}}),[["__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"}}]]),kQ=["data-year","aria-disabled","onClick"],OQ=_t(rt({__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}),rn(()=>{if(i.value){const l=i.value.querySelector(`[data-year="${s.selectedYear}"]`);l&&l.scrollIntoView({block:"center"})}}),(l,u)=>(j(),ce("div",{ref_key:"rootEl",ref:i,class:te([l.$style["year-grid-body"],s.scrollable?l.$style.scrollable:"",s.compact?l.$style.compact:""]),role:"grid","data-index":"year-selection"},[(j(!0),ce(xt,null,xn(s.years,c=>(j(),ce("a",{key:c,"data-year":c,tabindex:"0",class:te([l.$style["year-cell"],{[l.$style.selected]:c===s.selectedYear,[l.$style.current]:c===U(r),[l.$style.disabled]:s.disabled||!s.isYearSelectable(c)}]),"aria-disabled":s.disabled||!s.isYearSelectable(c),onClick:d=>a(c),onKeydown:u[0]||(u[0]=d=>o("keydown",d))},Ct(c),43,kQ))),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"}}]]),MQ={class:"navigation"},NQ={class:"picker"},LQ={key:0,class:"footer"},VQ=_t(rt({__name:"MonthPickerLayout",props:{disableConfirm:{type:Boolean,default:!1}},setup(e){return(t,n)=>(j(),ce("div",{class:te(["month-picker-layout",{"disable-confirm":e.disableConfirm}])},[Re("div",MQ,[Tt(t.$slots,"navigation",{},void 0,!0)]),Re("div",NQ,[Tt(t.$slots,"picker",{},void 0,!0)]),pe(KD,{name:"fade",mode:"out-in"},{default:me(()=>[e.disableConfirm?Je("",!0):(j(),ce("div",LQ,[Tt(t.$slots,"footer",{},void 0,!0)]))]),_:3})],2))}}),[["__scopeId","data-v-885d09b2"]]),BQ={style:{flex:"1"}},$Q=_t(rt({__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 u=l.target;u.dataset.index==="today-btn"?r():u.dataset.index==="cancel-btn"?o():u.dataset.index==="save-btn"&&i()}};return(l,u)=>{const c=Eo("tooltip");return n.readOnly?Je("",!0):(j(),ce("div",{key:0,class:te(l.$style["arbo-calendar-actions"])},[Re("div",BQ,[Ke((j(),qe(U(vt),{variant:"secondary",size:"medium",onClick:u[0]||(u[0]=d=>r()),onKeydown:a,"data-index":"today-btn"},{prefix:me(()=>[pe(U(lt),{src:"CalendarDay"})]),_:1})),[[c,"Today"]])]),pe(U(vt),{disabled:n.disabled,readOnly:n.readOnly,onKeydown:a,variant:"secondary",size:"medium",onClick:o,"data-index":"cancel-btn"},{default:me(()=>[nt(Ct(n.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),pe(U(vt),{disabled:n.disabled||n.disableConfirm,readOnly:n.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:a,onClick:i},{default:me(()=>[nt(Ct(n.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))}}}),[["__cssModules",{$style:{"arbo-calendar-actions":"_arbo-calendar-actions_132g0_1"}}]]),HQ=_t(rt({__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=ao({month:new Date().getMonth()+1,year:new Date().getFullYear()}),o=Y(()=>{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=Y(()=>{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})},u=()=>{r("toggle-months")},c=()=>{r("toggle-years")},d=Y(()=>{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,C)=>p.format(new Date(Date.UTC(2020,C,1))))});return(h,f)=>(j(),ce("div",{class:te(h.$style["cal-nav-bar"])},[e.mode!="year"?(j(),qe(U(vt),{key:0,variant:"tertiary",class:te([h.$style["cal-nav-btn"],h.$style.prev]),"aria-label":"Previous",disabled:o.value,label:"",onClick:a,"data-index":"prev-btn",onKeydownCapture:zn(Pt(a,["prevent","stop"]),["enter"])},{default:me(({hovered:p})=>[pe(U(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Je("",!0),Re("div",{class:te([h.$style["cal-nav-center"],e.hideMonth?h.$style.single:""])},[e.hideMonth?Je("",!0):(j(),qe(U(vt),{key:0,"data-index":"month-btn",variant:"secondary",onClick:u},{default:me(()=>[nt(Ct(d.value[n.month-1]),1)]),_:1})),pe(U(vt),{variant:"secondary",onClick:c,"data-index":"year-btn"},{default:me(()=>[nt(Ct(n.year),1)]),_:1})],2),e.mode!="year"?(j(),qe(U(vt),{key:1,"data-index":"next-btn",variant:"tertiary",class:te([h.$style["cal-nav-btn"],h.$style.next]),"aria-label":"Next",disabled:i.value,label:"",onClick:l,onKeydownCapture:zn(Pt(l,["prevent","stop"]),["enter"])},{default:me(({hovered:p})=>[pe(U(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Je("",!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"}}]]),GQ=["aria-label"];new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const UQ={class:"wrapper-suffix"},WQ=_t(rt({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{type:Function},workspaceId:{},id:{}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=Jt,o={PER_PAGE:20,INITIAL_PAGE:1},i=e,r=V(i.modelValue),a=n,l=Y(()=>f.value.find(E=>E.id===r.value)||null),u=E=>{r.value=E.id,a("update:modelValue",E.id)},c=Y(()=>{if(!r.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const E=f.value.find(k=>k.id===r.value),A=String((E==null?void 0:E.color)||"white");return{backgroundColor:A,border:Ng(A,"white")?"1px solid #ccc":"1px solid #fff"}}),d=V(null),h=()=>{var E;(E=d.value)==null||E.focus()},f=V([]),p=V(!1),g=V(!1),v=V(null),C=V(o.INITIAL_PAGE),S=V(!0),b=V(0),w=V(""),_=Y(()=>!!(i.id&&i.workspaceId)),D=E=>{const A=f.value.find(k=>k.id===E.value);A&&u(A)},T=E=>({label:E.name,value:E.id,selected:r.value===E.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:E,id:E.id,color:E.color}),I=async(E=o.INITIAL_PAGE,A="",k=!1)=>{var O;if(!_.value){console.error("Missing required props",i);return}k?g.value=!0:p.value=!0,v.value=null;try{const B={workspaceId:String(i.workspaceId),itemIds:i.id,page:E,perPage:o.PER_PAGE,name_like:A.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const Z=await i.getStatusFunc(B);if(!Z){k||(f.value=[]),S.value=!1;return}const X=Z.data.map(T);f.value=k?[...f.value,...X]:X,b.value=((O=Z.meta)==null?void 0:O.total)??Z.data.length,S.value=f.value.length<b.value,C.value=E}catch(B){console.error("Error fetching statuses:",B),v.value="Failed to load statuses",k||(f.value=[]),S.value=!1,a("error",v.value)}finally{p.value=!1,g.value=!1}},x=async()=>{!S.value||g.value||await I(C.value+1,w.value,!0)};et([()=>i.id,()=>i.workspaceId],()=>{I()},{deep:!0,immediate:!0});const F=async E=>{w.value=E,C.value=o.INITIAL_PAGE,await I(o.INITIAL_PAGE,E,!1)};return t({focus:h,clear:()=>{r.value=null,a("update:modelValue",null)}}),(E,A)=>(j(),qe(TQ,{onOpen:h,placement:"bottom-start","max-width":500},{trigger:me(({open:k})=>[pe(Cs,{actived:k,class:te(E.$style["status-wrapper"])},{suffix:me(()=>[Re("div",UQ,[pe(lt,{src:"ChevronUp",source:"remote",class:te([[E.$style["dropdown-icon"]],{[E.$style["dropdown-icon-show"]]:!k}])},null,8,["class"])])]),default:me(()=>{var O;return[Re("div",{class:te(E.$style.status)},[Re("div",{class:te(E.$style["color-indicator"]),style:dn(c.value)},null,6),Ke((j(),ce("span",{style:{"max-width":"400px"},class:te({[E.$style.empty]:!l.value})},[nt(Ct(l.value?l.value.label:"Select status"),1)],2)),[[U(s),{content:((O=l.value)==null?void 0:O.label)||void 0}]])],2)]}),_:2},1032,["actived","class"])]),content:me(({closeDropdown:k})=>{var O;return[pe(Jr,{ref_key:"popupRef",ref:d,"selected-id":(O=l.value)==null?void 0:O.id,options:f.value,loading:p.value,"loading-more":g.value,"has-more":S.value,error:v.value,onSearch:F,onSelect:B=>{D(B),k()},onLoadMore:x,onCancel:A[0]||(A[0]=B=>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})}}),zQ={key:2},jQ=_t(rt({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 S;const n=e,s=V(n.value),o=V(!0),i=V(""),r=()=>{var F,E,A;const b=(F=c.value)==null?void 0:F.restricted_type.trim(),w=((A=(E=c.value)==null?void 0:E.restricted_value)==null?void 0:A.split(",").map(Number))||[],[_,D]=w,I={range:`Enter a value between ${_} and ${D}`,not:`These values are not allowed: ${w.join(", ")}`,exact:"Value is not allowed"}[b];return o.value?"":I},a=b=>{if(c.value){if(b===null||b===""){o.value=!0;return}if(u.value!=="number"){o.value=!0;return}o.value=cm(c.value,Number(b)),i.value=r()}};Y(()=>o.value?{content:"",showOnCreate:!1}:{content:i.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=V(null),u=Y(()=>xF(c.value)),c=Y(()=>{var w,_;return((_=(w=n.params)==null?void 0:w.colDef)==null?void 0:_.context)||null}),{apiServices:d}=ts(!0,n),{updateCellData:h}=EO((S=n.params)==null?void 0:S.api),f=V(!1),p=Ki(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},C=async b=>{var _,D;if(g(),f.value=!0,s.value=b||null,b===n.value){f.value=!1;return}const w={itemIds:[String(p.value)],metricId:((_=c.value)==null?void 0:_.id)||"",workspaceId:String(n.workspaceId)};b==null?w.clear=1:w.value=b,h({rowId:String(p.value),field:`metric_${w.metricId}`,value:void 0});try{const T=await((D=d.value)==null?void 0:D.bulkUpdateMetric(w));(T==null?void 0:T.message)=="Done"?h({rowId:String(p.value),field:`metric_${w.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${w.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_${w.metricId}`,value:n.value})}finally{f.value=!1}};return(b,w)=>(j(),ce("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[u.value=="dropdown"&&c.value?(j(),qe(GA,{key:0,config:c.value,modelValue:s.value,"onUpdate:modelValue":w[0]||(w[0]=_=>s.value=_),onChange:C,onHandleCancel:v},null,8,["config","modelValue"])):u.value=="number"&&c.value?(j(),qe(UA,{key:1,showInlineError:!1,autoEmit:!0,config:c.value,modelValue:s.value,"onUpdate:modelValue":w[1]||(w[1]=_=>s.value=_),style:{width:"100%"},onHandleChange:C,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(j(),ce("div",zQ,"Metric type:"+Ct(u.value),1))],512))}}),[["__scopeId","data-v-519d44e5"]]),KQ=_t(rt({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."};Y(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const s=Y(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),o=V(!1);return rn(()=>{o.value=!0}),(i,r)=>(j(),ce("div",{class:te(i.$style["no-data-item-table"])},[Re("div",{class:te(i.$style.visual)},[o.value?(j(),qe(Fm,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Je("",!0)],2),Re("div",{class:te(i.$style.description)},Ct(s.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),_O=Jl("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=Y(()=>{const a=e.value;return Object.values(a).filter(u=>u.sort!=="none"&&!!u.sort).map(u=>{let c;switch(u.colId){case"dateRange":c=n[u.sort];break;default:if(u.colId.includes("metric")){const[d,h]=u.colId.split("_");c={column:d,direction:u.sort,type:h}}else c={column:t[u.colId]||u.colId,direction:u.sort};break}return c})}),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}}),ru=rt({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=_O(),{sorts:s}=Qs(n),o=Y(()=>{var l,u;return((u=(l=t.params)==null?void 0:l.column)==null?void 0:u.getColId())||"template_col_id"}),i=l=>{o.value&&n.setSort(o.value,l)},r=Y(()=>t.params.headerType||void 0),a=V("none");return et(()=>s.value,Di(()=>{if(o.value){const l=s.value[o.value];a.value=l?l.sort:"none"}},rr),{deep:!0,immediate:!0}),(l,u)=>o.value?(j(),qe(rJ,qt({key:0},t,{"header-type":r.value,modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=c=>a.value=c),onSortChanged:i}),null,16,["header-type","modelValue"])):Je("",!0)}});function qQ(){const e=ao({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 et(()=>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 dv=Jl("userStore",()=>{const e=V(null),t=V(null);return{user:e,setUser:o=>{e.value=o},setUserRoleId:o=>{t.value=o},workspaceUserRoleId:t}}),YQ=["innerHTML"],ZQ=20,XQ=_t(rt({__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}=Fs({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),u=()=>{a()},c=V(null),d=()=>{F.value=[],fe.value=!1},h=Y(()=>r.value),f=Y(()=>{var z;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((z=F.value)==null?void 0:z.length)===0,wrapperRef:o,active:h,bordered:!0}}),{argsMain:p}=ws(f),g=Jt,v=n,C=Y(()=>{var z;return Math.max(0,(((z=F.value)==null?void 0:z.length)||0)-s.maxVisible)}),S=Y(()=>{var z;return C.value<=0?"":((z=F.value)==null?void 0:z.slice(s.maxVisible).map(ge=>ge.name).join(", "))||""}),b=V(!1),w=V(!1),_=V(null),D=V(1),T=V(!0),I=V(0),x=V(""),F=V([]),E=Y(()=>{var z;return((z=F.value)==null?void 0:z.map(ge=>ge.id))||[]}),{assigneeList:A,mergedOptions:k}=gm({...s,value:[]}),{apiServices:O}=ts(!1,s),B=_n("entityId"),Z=async(z=1,ge="",se=!1)=>{var G,q,de,Ae,Fe;if(!O.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(se?w.value=!0:b.value=!0,_.value=null,!((G=O.value)!=null&&G.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const be=En.getInstance().getItem("ws.code");try{const Le=await((q=O.value)==null?void 0:q.getAssignableAssignees(String(be),{entity_ids:(B==null?void 0:B.value)||"",page:z,per_page:ZQ,display_name_like:ge})),ye=((de=Ec(Le.data))==null?void 0:de.map(pm))??[];A.value=se?uc(A.value,ye,"id"):ye,I.value=Le.meta.total,T.value=(((Ae=Le==null?void 0:Le.meta)==null?void 0:Ae.current_page)||0)<(((Fe=Le==null?void 0:Le.meta)==null?void 0:Fe.last_page)||0),D.value=z}catch(Le){console.error("Error fetching assignable users:",Le),_.value="Failed to load assignable users"}finally{b.value=!1,w.value=!1}},X=z=>{var ge,se,be;if((ge=F.value)!=null&&ge.some(G=>G.id===z.data.id)){F.value=(se=F.value)==null?void 0:se.filter(G=>G.id!==z.data.id);return}F.value=[...F.value||[],z.data],(be=c.value)==null||be.focus()},ee=()=>{F.value=[]},re=()=>{!w.value&&T.value&&Z(D.value+1,x.value,!0)},ae=Di(async z=>{x.value=z,await Z(1,z,!1)},rr);et(()=>r.value,z=>{var ge;z?(Z(1,x.value,!1),(ge=c.value)==null||ge.focus(),v("show")):v("hide")});const J=Y(()=>{var z;return((z=F.value)==null?void 0:z.slice(0,3))||[]}),L=Y(()=>J.value.map(z=>({id:z.id,name:z.name,initial:z.initial,avatarId:z.id,profile_image:z.profile_image,color:z.color,size:24,user:z}))),H=dv(),{user:Q}=Qs(H),fe=V(!1);t({getData:()=>F.value,clear:d,setData:z=>{F.value=z},focus:()=>{a(),mt(()=>{var z;(z=c.value)==null||z.focus()})},hide:()=>{l()}}),et([F,fe],()=>{v("updated",F.value)},{deep:!0});const ve=z=>{var ge;F.value=(ge=F.value)==null?void 0:ge.filter(se=>se.id!==z)},oe=z=>{var se;const ge=En.getInstance().getItem("ws.code");return((se=O.value)==null?void 0:se.getUserInformation(ge,z))||Promise.resolve(null)},ie=V();return(z,ge)=>(j(),ce("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:ie},[pe(Cs,qt(U(p),{style:{"--icon-size":"18px"}}),{prefix:me(()=>[L.value.length==0?(j(),ce("div",{key:0,class:te([z.$style["icon-wrapper"],"wrapper-prefix"]),onClick:Pt(u,["stop","prevent"])},[pe(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Je("",!0)]),default:me(()=>[Re("div",{class:te([z.$style["assignee-row"],z.$style["assignee-selector"]]),ref_key:"triggerRef",ref:o},[Re("div",{style:{flex:1},class:te([z.$style["assignee-row"]])},[(j(!0),ce(xt,null,xn(L.value,se=>(j(),qe(hf,{onClear:be=>ve(se.id),key:se.user.id,"disable-remove":!1},{default:me(()=>[pe(Oc,{user:se.user,apiUpdateFunction:oe,appendTo:ie.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),C.value>0?Ke((j(),ce("div",{key:0,class:te(z.$style["extra-avatars"])},[nt(" +"+Ct(C.value),1)],2)),[[U(g),S.value]]):Je("",!0)],2)],2)]),_:1},16),Re("div",{ref_key:"popupRef",ref:i},[pe(Jr,qt({"selected-id":E.value},{...s},{options:U(k),loading:b.value,"loading-more":w.value,"has-more":T.value,ref_key:"searchListRef",ref:c,onTab:ge[0]||(ge[0]=se=>v("tab",se)),onSelect:ge[1]||(ge[1]=se=>{X(se),v("start-update")}),onSearch:U(ae),onClose:ge[2]||(ge[2]=()=>v("close")),onLoadMore:re}),{"extra-item":me(()=>[pe(nS,{onClick:ee,label:"Unassign",borderLeft:!0},{icon:me(()=>[pe(lt,{src:"UserXMark",source:"remote"})]),_:1})]),item:me(({item:se,selectedIndex:be,isSelected:G,handleSelect:q,handleItemHover:de,getHighlightedLabel:Ae,query:Fe,idx:Le})=>[pe(Ql,qt(se,{hover:Le===be,selected:G(se),type:se.type,onClick:Pt(ye=>q(se,ye),["stop","prevent"]),onMouseover:ye=>de(Le),class:z.$style["item-assignee"]}),{prefix:me(()=>[pe(Oc,{user:se.data,apiUpdateFunction:oe,appendTo:U(i)},null,8,["user","appendTo"])]),label:me(({})=>[Fe?Ke((j(),ce("span",{key:0,class:te([z.$style["item-label"],z.$style.match]),style:{flex:"1"},innerHTML:Ae(se.label)},null,10,YQ)),[[U(g),{content:se.label}]]):Ke((j(),ce("span",{key:1,class:te(z.$style["item-label"]),style:{flex:"1"}},[nt(Ct(se.label),1)],2)),[[U(g),{content:se.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"}}]]),JQ={key:0},QQ={key:1},eee={key:0},tee={key:1},nee={key:0,class:"wrapper-suffix"},see={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},oee=_t(rt({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const s=Jt,{triggerRef:o,popupRef:i,isVisible:r,hide:a,show:l}=Fs({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),u=()=>{c.value=[null,null]},c=V([null,null]),d=w=>{const _=um();return w?bt.fromJSDate(w,{zone:_}).toFormat("MMM dd"):""},h=Y(()=>r.value),f=Y(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:o,active:h,bordered:!0})),{argsMain:p}=ws(f),g=V(!1),v=w=>{S("tab",w)},C=w=>{"start"in w&&w.start!==void 0&&(c.value[0]=w.start),"end"in w&&w.end!==void 0&&(c.value[1]=w.end)};t({getData:()=>c.value,clear:u,setData:w=>{c.value=w},focus:()=>{l(),mt(()=>{var w;(w=b.value)==null||w.focus()})},hide:()=>{a()}});const S=n;et(()=>c.value,w=>{S("updated",w)},{deep:!0});const b=V(null);return et(()=>r.value,w=>{w?(mt(()=>{var _;(_=b.value)==null||_.focus()}),S("show")):S("hide")}),(w,_)=>(j(),ce(xt,null,[pe(Cs,qt({ref_key:"triggerRef",ref:o},U(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:me(({focused:D})=>[Re("div",{class:te(w.$style["date-time"])},[Re("div",{class:te(w.$style.date)},[c.value[0]==null&&(D||U(r))?(j(),ce("span",JQ,"MMMDD")):(j(),ce("span",QQ,Ct(d(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||D||U(r)?(j(),ce("div",{key:0,class:te(w.$style.separator)}," → ",2)):Je("",!0),Re("div",{class:te(w.$style.date)},[c.value[1]==null&&(D||U(r))?(j(),ce("span",eee,"MMMDD")):(j(),ce("span",tee,Ct(d(c.value[1])),1))],2)],2)]),suffix:me(({hovered:D,focused:T})=>[(c.value[0]!==null||c.value[1]!==null)&&(D||T||U(r))?(j(),ce("div",nee,[Ke((j(),qe(vt,{onClick:Pt(u,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:me(()=>[pe(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[U(s),"Clear"]])])):Je("",!0)]),prefix:me(()=>[c.value[0]===null&&c.value[1]===null?(j(),ce("div",see,[pe(lt,{src:"Calendar",color:"#A6A6A6"})])):Je("",!0)]),_:1},16),Re("div",{ref_key:"popupRef",ref:i},[U(r)?(j(),qe(Pm,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:C,ref_key:"calendarRef",ref:b,onClosed:U(a),onStartUpdate:_[0]||(_[0]=D=>g.value=!0),onFinishUpdate:_[1]||(_[1]=D=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Je("",!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"}}]]),iee=_t(rt({__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:u}=Fs({toggleOnClick:!0,appendTo:"parent"}),c=V(null),d=V([]),h=V(!1),f=V(!1),p=V(null),g=V(o.INITIAL_PAGE),v=V(!0),C=V(0),S=V(""),b=n,w=Y(()=>a.value),_=Y(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!c.value,wrapperRef:i,active:w,bordered:!0})),D=V(null),{argsMain:T}=ws(_),I=Y(()=>c.value?d.value.filter(J=>J.id===c.value):[]),x=Y(()=>!c.value||I.value.length===0?"":I.value[0].label),F=Y(()=>c.value?[c.value]:[]),E=Y(()=>{if(!c.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const J=I.value[0],L=String((J==null?void 0:J.color)||"white");return{backgroundColor:L,border:Ng(L,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),A=J=>({label:J.name,value:J.id,selected:c.value===J.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:J,id:J.id,color:J.color}),{apiServices:k}=ts(!1,s),O=async(J=o.INITIAL_PAGE,L="",H=!1)=>{var Q,fe;H?f.value=!0:h.value=!0,p.value=null;try{const ve=En.getInstance().getItem("ws.code"),oe=await((Q=k.value)==null?void 0:Q.getAssignableStatuses(ve,{entity_id:s.entityId||"",name_like:L,page:J,per_page:o.PER_PAGE}));if(!oe){H||(d.value=[]),v.value=!1;return}const ie=oe.data.map(A);d.value=H?[...d.value,...ie]:ie,C.value=((fe=oe.meta)==null?void 0:fe.total)??oe.data.length,v.value=d.value.length<C.value,g.value=J}catch(ve){console.error("Error fetching statuses:",ve),p.value="Failed to load statuses",H||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},B=(J,L)=>{var Q;L.stopImmediatePropagation(),L.preventDefault(),L.stopPropagation();const H=J.id;c.value=H,(Q=D.value)==null||Q.focus(),b("update:modelValue",c.value),u()},Z=async()=>{!v.value||f.value||await O(g.value+1,S.value,!0)},X=async J=>{S.value=J,g.value=o.INITIAL_PAGE,await O(o.INITIAL_PAGE,J,!1)},ee=()=>{c.value=null,b("update:modelValue",null)},re=()=>{l(),mt(()=>{var J;(J=D.value)==null||J.focus()})};return et(()=>a.value,J=>{var L;J?(O(1,S.value,!1),(L=D.value)==null||L.focus(),b("show")):b("hide")}),et(()=>c.value,J=>{b("updated",J)}),t({focus:re,clear:ee,getData:()=>c.value,setData:J=>{c.value=J},hide:u,autoFillDefault:async()=>{S.value="",await O(1,S.value,!1),d.value.length>0&&(c.value=d.value[0].id,b("update:modelValue",c.value))}}),(J,L)=>{const H=Eo("tooltip");return j(),ce(xt,null,[pe(Cs,qt({ref_key:"triggerRef",ref:i},U(T),{style:{"--icon-size":"18px"}}),{default:me(()=>[Re("div",{class:te(J.$style.status)},[Re("div",{class:te(J.$style["color-indicator"]),style:dn(E.value)},null,6),Ke((j(),ce("span",{class:te({[J.$style.empty]:I.value.length===0,[J.$style["status-text"]]:!0})},[nt(Ct(x.value),1)],2)),[[H,{content:x.value}]])],2)]),_:1},16),Re("div",{ref_key:"popupRef",ref:r},[pe(Jr,{style:{width:"200px"},ref_key:"searchListRef",ref:D,"selected-id":F.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:X,onSelect:B,onLoadMore:Z,onCancel:L[0]||(L[0]=Q=>b("cancel")),onTab:L[1]||(L[1]=Q=>b("tab",Q)),onClose:L[2]||(L[2]=()=>b("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"]]),ree=_t(rt({__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=Jt,i=RH("target"),r=_n("workspaceId"),a=_n("entityId"),l=n,u=e,{newItemData:c,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=qQ(),{apiServices:p}=ts(!1,u),{openSceneHub:g}=ef(),v=V(!1),C=V(!1),S=V(null),b=V({assignees:!1,status:!1,date:!1}),w={name:V(null),assignees:V(null),status:V(null),date:V(null),cancel:V(null),"create-keep":V(null),create:V(null)},_=w.name,D=w.assignees,T=w.status,I=w.date,x=w.cancel,F=w["create-keep"],E=w.create,A=V(new Map),k=Y(()=>!!c.error||!c.name.trim()||C.value),O=(ye,M)=>{ye&&A.value.set(M,ye.$el||ye)},B=(ye,M)=>{if(ye==="date"){const[$,le]=Array.isArray(M)?M:[void 0,void 0];c.start_date=$,c.due_date=le}else c[ye]=M},Z=()=>{c.isCreating=!0,S.value="name"},X=()=>{c.isCreating=!1,h()},ee=_n("switchInstance"),{addNotification:re}=gf(),ae=ye=>{l("focus-on-id",ye)},J=(ye,M,$)=>{const le=D7(void 0,"created");re({id:String(ye),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${le}</b>
|
|
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 cr(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){UJ(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 Ym(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ym=function(t){return typeof t}:Ym=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ym(e)}function UJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qr(){return Qr=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},Qr.apply(this,arguments)}function WJ(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 zJ(e,t){if(e==null)return{};var n=WJ(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 jJ="1.14.0";function ea(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var ta=ea(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),mf=ea(/Edge/i),nO=ea(/firefox/i),vf=ea(/safari/i)&&!ea(/chrome/i)&&!ea(/android/i),sO=ea(/iP(ad|od|hone)/i),KJ=ea(/chrome/i)&&ea(/android/i),oO={capture:!1,passive:!1};function yn(e,t,n){e.addEventListener(t,n,!ta&&oO)}function fn(e,t,n){e.removeEventListener(t,n,!ta&&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 qJ(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function dr(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=qJ(e))}return null}var iO=/\s+/g;function Mo(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 Bt(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 zc(e,t){var n="";if(typeof e=="string")n=e;else do{var s=Bt(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 hr(){var e=document.scrollingElement;return e||document.documentElement}function Ss(e,t,n,s,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,r,a,l,u,c,d;if(e!==window&&e.parentNode&&e!==hr()?(i=e.getBoundingClientRect(),r=i.top,a=i.left,l=i.bottom,u=i.right,c=i.height,d=i.width):(r=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!ta))do if(o&&o.getBoundingClientRect&&(Bt(o,"transform")!=="none"||n&&Bt(o,"position")!=="static")){var h=o.getBoundingClientRect();r-=h.top+parseInt(Bt(o,"border-top-width")),a-=h.left+parseInt(Bt(o,"border-left-width")),l=r+i.height,u=a+i.width;break}while(o=o.parentNode);if(s&&e!==window){var f=zc(o||e),p=f&&f.a,g=f&&f.d;f&&(r/=g,a/=p,d/=p,c/=g,l=r+c,u=a+d)}return{top:r,left:a,bottom:l,right:u,width:d,height:c}}}function aO(e,t,n){for(var s=za(e,!0),o=Ss(e)[t];s;){var i=Ss(s)[n],r=void 0;if(r=o>=i,!r)return s;if(s===hr())break;s=za(s,!1)}return!1}function jc(e,t,n,s){for(var o=0,i=0,r=e.children;i<r.length;){if(r[i].style.display!=="none"&&r[i]!==$t.ghost&&(s||r[i]!==$t.dragged)&&dr(r[i],n.draggable,e,!1)){if(o===t)return r[i];o++}i++}return null}function bS(e,t){for(var n=e.lastElementChild;n&&(n===$t.ghost||Bt(n,"display")==="none"||t&&!Zm(n,t));)n=n.previousElementSibling;return n||null}function oi(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==$t.clone&&(!t||Zm(e,t))&&n++;return n}function lO(e){var t=0,n=0,s=hr();if(e)do{var o=zc(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 YJ(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 za(e,t){if(!e||!e.getBoundingClientRect)return hr();var n=e,s=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=Bt(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 hr();if(s||t)return n;s=!0}}while(n=n.parentNode);return hr()}function ZJ(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function SS(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 yf;function uO(e,t){return function(){if(!yf){var n=arguments,s=this;n.length===1?e.call(s,n[0]):e.apply(s,n),yf=setTimeout(function(){yf=void 0},t)}}}function XJ(){clearTimeout(yf),yf=void 0}function cO(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 No="Sortable"+new Date().getTime();function JJ(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(o){if(!(Bt(o,"display")==="none"||o===$t.ghost)){e.push({target:o,rect:Ss(o)});var i=cr({},e[e.length-1].rect);if(o.thisAnimationDuration){var r=zc(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(YJ(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,u=a.target,c=u.fromRect,d=Ss(u),h=u.prevFromRect,f=u.prevToRect,p=a.rect,g=zc(u,!0);g&&(d.top-=g.f,d.left-=g.e),u.toRect=d,u.thisAnimationDuration&&SS(h,d)&&!SS(c,d)&&(p.top-d.top)/(p.left-d.left)===(c.top-d.top)/(c.left-d.left)&&(l=eQ(p,h,f,o.options)),SS(d,c)||(u.prevFromRect=c,u.prevToRect=d,l||(l=o.options.animation),o.animate(u,p,d,l)),l&&(i=!0,r=Math.max(r,l),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},l),u.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){Bt(s,"transition",""),Bt(s,"transform","");var a=zc(this.el),l=a&&a.a,u=a&&a.d,c=(o.left-i.left)/(l||1),d=(o.top-i.top)/(u||1);s.animatingX=!!c,s.animatingY=!!d,Bt(s,"transform","translate3d("+c+"px,"+d+"px,0)"),this.forRepaintDummy=QJ(s),Bt(s,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),Bt(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){Bt(s,"transition",""),Bt(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},r)}}}}function QJ(e){return e.offsetWidth}function eQ(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 Kc=[],ES={initializeByDefault:!0},wf={mount:function(t){for(var n in ES)ES.hasOwnProperty(n)&&!(n in t)&&(t[n]=ES[n]);Kc.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Kc.push(t)},pluginEvent:function(t,n,s){var o=this;this.eventCanceled=!1,s.cancel=function(){o.eventCanceled=!0};var i=t+"Global";Kc.forEach(function(r){n[r.pluginName]&&(n[r.pluginName][i]&&n[r.pluginName][i](cr({sortable:n},s)),n.options[r.pluginName]&&n[r.pluginName][t]&&n[r.pluginName][t](cr({sortable:n},s)))})},initializePlugins:function(t,n,s,o){Kc.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var u=new a(t,n,t.options);u.sortable=t,u.options=t.options,t[l]=u,Qr(s,u.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 Kc.forEach(function(o){typeof o.eventProperties=="function"&&Qr(s,o.eventProperties.call(n[o.pluginName],t))}),s},modifyOption:function(t,n,s){var o;return Kc.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],s))}),o}};function tQ(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,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[No],!!t){var g,v=t.options,C="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!ta&&!mf?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=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var S=cr(cr({},p),wf.getEventProperties(s,t));for(var b in S)g[b]=S[b];n&&n.dispatchEvent(g),v[C]&&v[C].call(t,g)}}var nQ=["evt"],po=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.evt,i=zJ(s,nQ);wf.pluginEvent.bind($t)(t,n,cr({dragEl:ft,parentEl:Xn,ghostEl:Zt,rootEl:Hn,nextEl:su,lastDownEl:Xm,cloneEl:Jn,cloneHidden:ja,dragStarted:bf,putSortable:Ps,activeSortable:$t.active,originalEvent:o,oldIndex:qc,oldDraggableIndex:Cf,newIndex:Lo,newDraggableIndex:Ka,hideGhostForTarget:yO,unhideGhostForTarget:wO,cloneNowHidden:function(){ja=!0},cloneNowShown:function(){ja=!1},dispatchSortableEvent:function(a){eo({sortable:n,name:a,originalEvent:o})}},i))};function eo(e){tQ(cr({putSortable:Ps,cloneEl:Jn,targetEl:ft,rootEl:Hn,oldIndex:qc,oldDraggableIndex:Cf,newIndex:Lo,newDraggableIndex:Ka},e))}var ft,Xn,Zt,Hn,su,Xm,Jn,ja,qc,Lo,Cf,Ka,Jm,Ps,Yc=!1,Qm=!1,ev=[],ou,ki,_S,RS,hO,fO,bf,Zc,Sf,Ef=!1,tv=!1,nv,Us,DS=[],TS=!1,sv=[],ov=typeof document<"u",iv=sO,pO=mf||ta?"cssFloat":"float",sQ=ov&&!KJ&&!sO&&"draggable"in document.createElement("div"),gO=function(){if(ov){if(ta)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mO=function(t,n){var s=Bt(t),o=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),i=jc(t,0,n),r=jc(t,1,n),a=i&&Bt(i),l=r&&Bt(r),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ss(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ss(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"||u>=o&&s[pO]==="none"||r&&s[pO]==="none"&&u+c>o)?"vertical":"horizontal"},oQ=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,u=s?n.width:n.height;return o===a||i===l||o+r/2===a+u/2},iQ=function(t,n){var s;return ev.some(function(o){var i=o[No].options.emptyInsertThreshold;if(!(!i||bS(o))){var r=Ss(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,u,c){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,u,c),r)(a,l,u,c);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||Ym(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&&Zt&&Bt(Zt,"display","none")},wO=function(){!gO&&Zt&&Bt(Zt,"display","")};ov&&document.addEventListener("click",function(e){if(Qm)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Qm=!1,!1},!0);var iu=function(t){if(ft){t=t.touches?t.touches[0]:t;var n=iQ(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[No]._onDragOver(s)}}},rQ=function(t){ft&&ft.parentNode[No]._isOutsideThisEl(t.target)};function $t(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=Qr({},t),e[No]=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:$t.supportPointer!==!1&&"PointerEvent"in window&&!vf,emptyInsertThreshold:5};wf.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:sQ,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?yn(e,"pointerdown",this._onTapStart):(yn(e,"mousedown",this._onTapStart),yn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(yn(e,"dragover",this),yn(e,"dragenter",this)),ev.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Qr(this,JJ())}$t.prototype={constructor:$t,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Zc=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,ft):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,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(pQ(s),!ft&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&vf&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=dr(l,o.draggable,s,!1),!(l&&l.animated)&&Xm!==l)){if(qc=oi(l),Cf=oi(l,o.draggable),typeof c=="function"){if(c.call(this,t,l,this)){eo({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:s,fromEl:s}),po("filter",n,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=dr(u,d.trim(),s,!1),d)return eo({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:s,toEl:s}),po("filter",n,{evt:t}),!0}),c)){i&&t.cancelable&&t.preventDefault();return}o.handle&&!dr(u,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&&!ft&&s.parentNode===i){var u=Ss(s);if(Hn=i,ft=s,Xn=ft.parentNode,su=ft.nextSibling,Xm=s,Jm=r.group,$t.dragged=ft,ou={target:ft,clientX:(n||t).clientX,clientY:(n||t).clientY},hO=ou.clientX-u.left,fO=ou.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,ft.style["will-change"]="all",l=function(){if(po("delayEnded",o,{evt:t}),$t.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!nO&&o.nativeDraggable&&(ft.draggable=!0),o._triggerDragStart(t,n),eo({sortable:o,name:"choose",originalEvent:t}),Mo(ft,r.chosenClass,!0)},r.ignore.split(",").forEach(function(c){rO(ft,c.trim(),IS)}),yn(a,"dragover",iu),yn(a,"mousemove",iu),yn(a,"touchmove",iu),yn(a,"mouseup",o._onDrop),yn(a,"touchend",o._onDrop),yn(a,"touchcancel",o._onDrop),nO&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ft.draggable=!0),po("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(mf||ta))){if($t.eventCanceled){this._onDrop();return}yn(a,"mouseup",o._disableDelayedDrag),yn(a,"touchend",o._disableDelayedDrag),yn(a,"touchcancel",o._disableDelayedDrag),yn(a,"mousemove",o._delayedDragTouchMoveHandler),yn(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&yn(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(){ft&&IS(ft),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;fn(t,"mouseup",this._disableDelayedDrag),fn(t,"touchend",this._disableDelayedDrag),fn(t,"touchcancel",this._disableDelayedDrag),fn(t,"mousemove",this._delayedDragTouchMoveHandler),fn(t,"touchmove",this._delayedDragTouchMoveHandler),fn(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?yn(document,"pointermove",this._onTouchMove):n?yn(document,"touchmove",this._onTouchMove):yn(document,"mousemove",this._onTouchMove):(yn(ft,"dragend",this),yn(Hn,"dragstart",this._onDragStart));try{document.selection?av(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Yc=!1,Hn&&ft){po("dragStarted",this,{evt:n}),this.nativeDraggable&&yn(document,"dragover",rQ);var s=this.options;!t&&Mo(ft,s.dragClass,!1),Mo(ft,s.ghostClass,!0),$t.active=this,t&&this._appendGhost(),eo({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(ki){this._lastX=ki.clientX,this._lastY=ki.clientY,yO();for(var t=document.elementFromPoint(ki.clientX,ki.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ki.clientX,ki.clientY),t!==n);)n=t;if(ft.parentNode[No]._isOutsideThisEl(t),n)do{if(n[No]){var s=void 0;if(s=n[No]._onDragOver({clientX:ki.clientX,clientY:ki.clientY,target:t,rootEl:n}),s&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);wO()}},_onTouchMove:function(t){if(ou){var n=this.options,s=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,r=Zt&&zc(Zt,!0),a=Zt&&r&&r.a,l=Zt&&r&&r.d,u=iv&&Us&&lO(Us),c=(i.clientX-ou.clientX+o.x)/(a||1)+(u?u[0]-DS[0]:0)/(a||1),d=(i.clientY-ou.clientY+o.y)/(l||1)+(u?u[1]-DS[1]:0)/(l||1);if(!$t.active&&!Yc){if(s&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Zt){r?(r.e+=c-(_S||0),r.f+=d-(RS||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Bt(Zt,"webkitTransform",h),Bt(Zt,"mozTransform",h),Bt(Zt,"msTransform",h),Bt(Zt,"transform",h),_S=c,RS=d,ki=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Zt){var t=this.options.fallbackOnBody?document.body:Hn,n=Ss(ft,!0,iv,!0,t),s=this.options;if(iv){for(Us=t;Bt(Us,"position")==="static"&&Bt(Us,"transform")==="none"&&Us!==document;)Us=Us.parentNode;Us!==document.body&&Us!==document.documentElement?(Us===document&&(Us=hr()),n.top+=Us.scrollTop,n.left+=Us.scrollLeft):Us=hr(),DS=lO(Us)}Zt=ft.cloneNode(!0),Mo(Zt,s.ghostClass,!1),Mo(Zt,s.fallbackClass,!0),Mo(Zt,s.dragClass,!0),Bt(Zt,"transition",""),Bt(Zt,"transform",""),Bt(Zt,"box-sizing","border-box"),Bt(Zt,"margin",0),Bt(Zt,"top",n.top),Bt(Zt,"left",n.left),Bt(Zt,"width",n.width),Bt(Zt,"height",n.height),Bt(Zt,"opacity","0.8"),Bt(Zt,"position",iv?"absolute":"fixed"),Bt(Zt,"zIndex","100000"),Bt(Zt,"pointerEvents","none"),$t.ghost=Zt,t.appendChild(Zt),Bt(Zt,"transform-origin",hO/parseInt(Zt.style.width)*100+"% "+fO/parseInt(Zt.style.height)*100+"%")}},_onDragStart:function(t,n){var s=this,o=t.dataTransfer,i=s.options;if(po("dragStart",this,{evt:t}),$t.eventCanceled){this._onDrop();return}po("setupClone",this),$t.eventCanceled||(Jn=dO(ft),Jn.draggable=!1,Jn.style["will-change"]="",this._hideClone(),Mo(Jn,this.options.chosenClass,!1),$t.clone=Jn),s.cloneId=av(function(){po("clone",s),!$t.eventCanceled&&(s.options.removeCloneOnHide||Hn.insertBefore(Jn,ft),s._hideClone(),eo({sortable:s,name:"clone"}))}),!n&&Mo(ft,i.dragClass,!0),n?(Qm=!0,s._loopId=setInterval(s._emulateDragOver,50)):(fn(document,"mouseup",s._onDrop),fn(document,"touchend",s._onDrop),fn(document,"touchcancel",s._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(s,o,ft)),yn(document,"drop",s),Bt(ft,"transform","translateZ(0)")),Yc=!0,s._dragStartId=av(s._dragStarted.bind(s,n,t)),yn(document,"selectstart",s),bf=!0,vf&&Bt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,s=t.target,o,i,r,a=this.options,l=a.group,u=$t.active,c=Jm===l,d=a.sort,h=Ps||u,f,p=this,g=!1;if(TS)return;function v(ee,re){po(ee,p,cr({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:r,dragRect:o,targetRect:i,canSort:d,fromSortable:h,target:s,completed:S,onMove:function(J,L){return rv(Hn,n,ft,o,J,Ss(J),t,L)},changed:b},re))}function C(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function S(ee){return v("dragOverCompleted",{insertion:ee}),ee&&(c?u._hideClone():u._showClone(p),p!==h&&(Mo(ft,Ps?Ps.options.ghostClass:u.options.ghostClass,!1),Mo(ft,a.ghostClass,!0)),Ps!==p&&p!==$t.active?Ps=p:p===$t.active&&Ps&&(Ps=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===ft&&!ft.animated||s===n&&!s.animated)&&(Zc=null),!a.dragoverBubble&&!t.rootEl&&s!==document&&(ft.parentNode[No]._isOutsideThisEl(t.target),!ee&&iu(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function b(){Lo=oi(ft),Ka=oi(ft,a.draggable),eo({sortable:p,name:"change",toEl:n,newIndex:Lo,newDraggableIndex:Ka,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=dr(s,a.draggable,n,!0),v("dragOver"),$t.eventCanceled)return g;if(ft.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return S(!1);if(Qm=!1,u&&!a.disabled&&(c?d||(r=Xn!==Hn):Ps===this||(this.lastPutMode=Jm.checkPull(this,u,ft,t))&&l.checkPut(this,u,ft,t))){if(f=this._getDirection(t,s)==="vertical",o=Ss(ft),v("dragOverValid"),$t.eventCanceled)return g;if(r)return Xn=Hn,C(),this._hideClone(),v("revert"),$t.eventCanceled||(su?Hn.insertBefore(ft,su):Hn.appendChild(ft)),S(!0);var w=bS(n,a.draggable);if(!w||cQ(t,f,this)&&!w.animated){if(w===ft)return S(!1);if(w&&n===t.target&&(s=w),s&&(i=Ss(s)),rv(Hn,n,ft,o,s,i,t,!!s)!==!1)return C(),n.appendChild(ft),Xn=n,b(),S(!0)}else if(w&&uQ(t,f,this)){var _=jc(n,0,a,!0);if(_===ft)return S(!1);if(s=_,i=Ss(s),rv(Hn,n,ft,o,s,i,t,!1)!==!1)return C(),n.insertBefore(ft,_),Xn=n,b(),S(!0)}else if(s.parentNode===n){i=Ss(s);var D=0,T,I=ft.parentNode!==n,x=!oQ(ft.animated&&ft.toRect||o,s.animated&&s.toRect||i,f),F=f?"top":"left",E=aO(s,"top","top")||aO(ft,"top","top"),A=E?E.scrollTop:void 0;Zc!==s&&(T=i[F],Ef=!1,tv=!x&&a.invertSwap||I),D=dQ(t,s,i,f,x?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,tv,Zc===s);var k;if(D!==0){var O=oi(ft);do O-=D,k=Xn.children[O];while(k&&(Bt(k,"display")==="none"||k===Zt))}if(D===0||k===s)return S(!1);Zc=s,Sf=D;var B=s.nextElementSibling,Z=!1;Z=D===1;var X=rv(Hn,n,ft,o,s,i,t,Z);if(X!==!1)return(X===1||X===-1)&&(Z=X===1),TS=!0,setTimeout(lQ,30),C(),Z&&!B?n.appendChild(ft):s.parentNode.insertBefore(ft,Z?B:s),E&&cO(E,0,A-E.scrollTop),Xn=ft.parentNode,T!==void 0&&!tv&&(nv=Math.abs(T-Ss(s)[F])),b(),S(!0)}if(n.contains(ft))return S(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){fn(document,"mousemove",this._onTouchMove),fn(document,"touchmove",this._onTouchMove),fn(document,"pointermove",this._onTouchMove),fn(document,"dragover",iu),fn(document,"mousemove",iu),fn(document,"touchmove",iu)},_offUpEvents:function(){var t=this.el.ownerDocument;fn(t,"mouseup",this._onDrop),fn(t,"touchend",this._onDrop),fn(t,"pointerup",this._onDrop),fn(t,"touchcancel",this._onDrop),fn(document,"selectstart",this)},_onDrop:function(t){var n=this.el,s=this.options;if(Lo=oi(ft),Ka=oi(ft,s.draggable),po("drop",this,{evt:t}),Xn=ft&&ft.parentNode,Lo=oi(ft),Ka=oi(ft,s.draggable),$t.eventCanceled){this._nulling();return}Yc=!1,tv=!1,Ef=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),xS(this.cloneId),xS(this._dragStartId),this.nativeDraggable&&(fn(document,"drop",this),fn(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),vf&&Bt(document.body,"user-select",""),Bt(ft,"transform",""),t&&(bf&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Zt&&Zt.parentNode&&Zt.parentNode.removeChild(Zt),(Hn===Xn||Ps&&Ps.lastPutMode!=="clone")&&Jn&&Jn.parentNode&&Jn.parentNode.removeChild(Jn),ft&&(this.nativeDraggable&&fn(ft,"dragend",this),IS(ft),ft.style["will-change"]="",bf&&!Yc&&Mo(ft,Ps?Ps.options.ghostClass:this.options.ghostClass,!1),Mo(ft,this.options.chosenClass,!1),eo({sortable:this,name:"unchoose",toEl:Xn,newIndex:null,newDraggableIndex:null,originalEvent:t}),Hn!==Xn?(Lo>=0&&(eo({rootEl:Xn,name:"add",toEl:Xn,fromEl:Hn,originalEvent:t}),eo({sortable:this,name:"remove",toEl:Xn,originalEvent:t}),eo({rootEl:Xn,name:"sort",toEl:Xn,fromEl:Hn,originalEvent:t}),eo({sortable:this,name:"sort",toEl:Xn,originalEvent:t})),Ps&&Ps.save()):Lo!==qc&&Lo>=0&&(eo({sortable:this,name:"update",toEl:Xn,originalEvent:t}),eo({sortable:this,name:"sort",toEl:Xn,originalEvent:t})),$t.active&&((Lo==null||Lo===-1)&&(Lo=qc,Ka=Cf),eo({sortable:this,name:"end",toEl:Xn,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){po("nulling",this),Hn=ft=Xn=Zt=su=Jn=Xm=ja=ou=ki=bf=Lo=Ka=qc=Cf=Zc=Sf=Ps=Jm=$t.dragged=$t.ghost=$t.clone=$t.active=null,sv.forEach(function(t){t.checked=!0}),sv.length=_S=RS=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ft&&(this._onDragOver(t),aQ(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],dr(n,r.draggable,this.el,!1)&&t.push(n.getAttribute(r.dataIdAttr)||fQ(n));return t},sort:function(t,n){var s={},o=this.el;this.toArray().forEach(function(i,r){var a=o.children[r];dr(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 dr(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=wf.modifyOption(this,t,n);typeof o<"u"?s[t]=o:s[t]=n,t==="group"&&vO(s)},destroy:function(){po("destroy",this);var t=this.el;t[No]=null,fn(t,"mousedown",this._onTapStart),fn(t,"touchstart",this._onTapStart),fn(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(fn(t,"dragover",this),fn(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),ev.splice(ev.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!ja){if(po("hideClone",this),$t.eventCanceled)return;Bt(Jn,"display","none"),this.options.removeCloneOnHide&&Jn.parentNode&&Jn.parentNode.removeChild(Jn),ja=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(ja){if(po("showClone",this),$t.eventCanceled)return;ft.parentNode==Hn&&!this.options.group.revertClone?Hn.insertBefore(Jn,ft):su?Hn.insertBefore(Jn,su):Hn.appendChild(Jn),this.options.group.revertClone&&this.animate(ft,Jn),Bt(Jn,"display",""),ja=!1}}};function aQ(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function rv(e,t,n,s,o,i,r,a){var l,u=e[No],c=u.options.onMove,d;return window.CustomEvent&&!ta&&!mf?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||Ss(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),c&&(d=c.call(u,l,r)),d}function IS(e){e.draggable=!1}function lQ(){TS=!1}function uQ(e,t,n){var s=Ss(jc(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 cQ(e,t,n){var s=Ss(bS(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 dQ(e,t,n,s,o,i,r,a){var l=s?e.clientY:e.clientX,u=s?n.height:n.width,c=s?n.top:n.left,d=s?n.bottom:n.right,h=!1;if(!r){if(a&&nv<u*o){if(!Ef&&(Sf===1?l>c+u*i/2:l<d-u*i/2)&&(Ef=!0),Ef)h=!0;else if(Sf===1?l<c+nv:l>d-nv)return-Sf}else if(l>c+u*(1-o)/2&&l<d-u*(1-o)/2)return hQ(t)}return h=h||r,h&&(l<c+u*i/2||l>d-u*i/2)?l>c+u/2?1:-1:0}function hQ(e){return oi(ft)<oi(e)?1:-1}function fQ(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 pQ(e){sv.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var s=t[n];s.checked&&sv.push(s)}}function av(e){return setTimeout(e,0)}function xS(e){return clearTimeout(e)}ov&&yn(document,"touchmove",function(e){($t.active||Yc)&&e.cancelable&&e.preventDefault()}),$t.utils={on:yn,off:fn,css:Bt,find:rO,is:function(t,n){return!!dr(t,n,t,!1)},extend:ZJ,throttle:uO,closest:dr,toggleClass:Mo,clone:dO,index:oi,nextTick:av,cancelNextTick:xS,detectDirection:mO,getChild:jc},$t.get=function(e){return e[No]},$t.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&&($t.utils=cr(cr({},$t.utils),s.utils)),wf.mount(s)})},$t.create=function(e,t){return new $t(e,t)},$t.version=jJ;var ds=[],_f,FS,PS=!1,AS,kS,lv,Rf;function gQ(){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?yn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?yn(document,"pointermove",this._handleFallbackAutoScroll):s.touches?yn(document,"touchmove",this._handleFallbackAutoScroll):yn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var s=n.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?fn(document,"dragover",this._handleAutoScroll):(fn(document,"pointermove",this._handleFallbackAutoScroll),fn(document,"touchmove",this._handleFallbackAutoScroll),fn(document,"mousemove",this._handleFallbackAutoScroll)),CO(),uv(),XJ()},nulling:function(){lv=FS=_f=PS=Rf=AS=kS=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(lv=n,s||this.options.forceAutoScrollFallback||mf||ta||vf){OS(n,this.options,a,s);var l=za(a,!0);PS&&(!Rf||i!==AS||r!==kS)&&(Rf&&CO(),Rf=setInterval(function(){var u=za(document.elementFromPoint(i,r),!0);u!==l&&(l=u,uv()),OS(n,o.options,u,s)},10),AS=i,kS=r)}else{if(!this.options.bubbleScroll||za(a,!0)===hr()){uv();return}OS(n,this.options,za(a,!1),!1)}}},Qr(e,{pluginName:"scroll",initializeByDefault:!0})}function uv(){ds.forEach(function(e){clearInterval(e.pid)}),ds=[]}function CO(){clearInterval(Rf)}var OS=uO(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=hr(),u=!1,c;FS!==n&&(FS=n,uv(),_f=t.scroll,c=t.scrollFn,_f===!0&&(_f=za(n,!0)));var d=0,h=_f;do{var f=h,p=Ss(f),g=p.top,v=p.bottom,C=p.left,S=p.right,b=p.width,w=p.height,_=void 0,D=void 0,T=f.scrollWidth,I=f.scrollHeight,x=Bt(f),F=f.scrollLeft,E=f.scrollTop;f===l?(_=b<T&&(x.overflowX==="auto"||x.overflowX==="scroll"||x.overflowX==="visible"),D=w<I&&(x.overflowY==="auto"||x.overflowY==="scroll"||x.overflowY==="visible")):(_=b<T&&(x.overflowX==="auto"||x.overflowX==="scroll"),D=w<I&&(x.overflowY==="auto"||x.overflowY==="scroll"));var A=_&&(Math.abs(S-o)<=r&&F+b<T)-(Math.abs(C-o)<=r&&!!F),k=D&&(Math.abs(v-i)<=r&&E+w<I)-(Math.abs(g-i)<=r&&!!E);if(!ds[d])for(var O=0;O<=d;O++)ds[O]||(ds[O]={});(ds[d].vx!=A||ds[d].vy!=k||ds[d].el!==f)&&(ds[d].el=f,ds[d].vx=A,ds[d].vy=k,clearInterval(ds[d].pid),(A!=0||k!=0)&&(u=!0,ds[d].pid=setInterval((function(){s&&this.layer===0&&$t.active._onTouchMove(lv);var B=ds[this.layer].vy?ds[this.layer].vy*a:0,Z=ds[this.layer].vx?ds[this.layer].vx*a:0;typeof c=="function"&&c.call($t.dragged.parentNode[No],Z,B,e,lv,ds[this.layer].el)!=="continue"||cO(ds[this.layer].el,Z,B)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=za(h,!1)));PS=u}},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 u=s||i;a();var c=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(c.clientX,c.clientY);l(),u&&!u.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:s}))}};function MS(){}MS.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=jc(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},Qr(MS,{pluginName:"revertOnSpill"});function NS(){}NS.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},Qr(NS,{pluginName:"removeOnSpill"}),$t.mount(new gQ),$t.mount(NS,MS);function mQ(e,t){return Object.values(e).indexOf(t)}function vQ(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 yQ(e){return["transition-group","TransitionGroup"].includes(e)}function SO(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?yQ(t.name):!1}function wQ(e,t){return t?{...t.props,...t.attrs}:e}const LS=["Start","Add","Remove","Update","End"],VS=["Choose","Unchoose","Sort","Filter","Clone"],CQ=["Move",...LS,...VS].map(e=>"on"+e);let BS=null;const bQ=rt({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",...LS.map(e=>e.toLowerCase()),...VS.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([]),u=V(null),c=V(null),d=Y(()=>e.list?e.list:e.modelValue),h=es();function f(){return e.component?MH(e.component):e.tag}function p(H){if(c.value)for(const Q in H){const fe=Qk(Q);CQ.indexOf(fe)===-1&&c.value.option(fe,H[Q])}}function g(){var H;return((H=h==null?void 0:h.proxy)==null?void 0:H.$el.children)||[]}async function v(){var H;await mt(),l.value=vQ(g(),((H=h==null?void 0:h.proxy)==null?void 0:H.$el.children)||[],o.value,a.value)}function C(H){const Q=mQ(g()||[],H);if(Q===-1)return null;const fe=d.value?d.value[Q]:null;return{index:Q,element:fe}}function S(H){mt(()=>t("change",H))}function b(H){if(e.list){H(e.list);return}const Q=[...e.modelValue||[]];H(Q),t("update:modelValue",Q)}function w(...H){b(fe=>fe.splice(...H))}function _(H,Q){b(ve=>ve.splice(Q,0,ve.splice(H,1)[0]))}function D(H){const Q=l.value,fe=Q.length;return H>fe-1?fe:Q[H]}function T(){var Q,fe;return n.default&&((fe=(Q=n.default()[0])==null?void 0:Q.component)==null?void 0:fe.proxy)||null}function I(H){if(!e.noTransitionOnDrag||!o.value)return;const Q=g();Q[H]&&(Q[H].data=null);const fe=T();fe&&(fe.children=[],fe.kept=void 0)}function x(H){v(),u.value=C(H.item),u.value&&(H.item._underlying_vm_=e.clone(u.value.element),BS=H.item)}function F(H){const Q=H.item._underlying_vm_;if(Q===void 0)return;CS(H.item);const fe=D(H.newIndex);w(fe,0,Q),v(),S({added:{element:Q,newIndex:fe}})}function E(H){var fe;if(eO((fe=h==null?void 0:h.proxy)==null?void 0:fe.$el,H.item,H.oldIndex),H.pullMode==="clone"){CS(H.clone);return}if(!u.value)return;const Q=u.value.index;w(Q,1),I(Q),S({removed:{element:u.value.element,oldIndex:Q}})}function A(H){var ve,oe;CS(H.item),eO(H.from,H.item,H.oldIndex);const Q=(ve=u.value)==null?void 0:ve.index,fe=D(H.newIndex);_(Q,fe),S({moved:{element:(oe=u.value)==null?void 0:oe.element,oldIndex:Q,newIndex:fe}})}function k(H,Q){Object.prototype.hasOwnProperty.call(H,Q)&&(H[Q]+=r.value)}function O(H){return H.__draggable_component__}function B({to:H,related:Q}){const fe=O(H);if(!fe)return{component:fe};const ve=fe.realList,oe={list:ve,component:fe};if(H!==Q&&ve&&fe.getUnderlyingVm){const ie=fe.getUnderlyingVm(Q);if(ie)return Object.assign(ie,oe)}return oe}function Z(H,Q){const fe=[...Q.to.children].filter(z=>z.style.display!=="none");if(fe.length===0)return 0;const ve=fe.indexOf(Q.related),oe=H.component.getVmIndex(ve);return fe.indexOf(BS)!==-1||!Q.willInsertAfter?oe:oe+1}const X=()=>{var oe,ie;const H={};LS.forEach(z=>{H["on"+z]=re(z)}),VS.forEach(z=>{H["on"+z]=ee.bind(null,z)});const Q=Object.keys(s).reduce((z,ge)=>(z[Qk(ge)]=s[ge],z),{}),fe=Object.assign({},Q,H,{onMove:(z,ge)=>ae(z,ge)});"draggable"in fe||(fe.draggable=">*");const ve=((oe=h==null?void 0:h.proxy)==null?void 0:oe.$el.nodeType)===1?h.proxy.$el:((ie=h==null?void 0:h.proxy)==null?void 0:ie.$el.parentElement)||null;ve&&(c.value=new $t(ve,fe),ve.__draggable_component__=h==null?void 0:h.proxy,v())};function ee(H,Q){mt(()=>t(H.toLowerCase(),Q))}function re(H){return Q=>{if(d.value!==null){const fe="onDrag"+H,ve=L[fe];ve&&ve(Q)}ee(H,Q)}}function ae(H,Q){const fe=e.move;if(!fe||!d.value)return!0;const ve=B(H),oe=u.value,ie=Z(ve,H);oe&&Object.assign(oe,{futureIndex:ie});const z=Object.assign({},H,{relatedContext:ve,draggedContext:oe});return fe(z,Q)}function J(){v(),BS=null}const L={onDragStart:x,onDragAdd:F,onDragRemove:E,onDragUpdate:A,onDragMove:ae,onDragEnd:J};return rn(()=>{X()}),e.list!==null&&e.modelValue!==null&&$J.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:C,emitChanges:S,alterList:b,spliceList:w,updatePosition:_,getVmIndex:D,getComponent:T,resetTransitionData:I,onDragStart:x,onDragAdd:F,onDragRemove:E,onDragUpdate:A,updateProperty:k,onDragMove:ae,onDragEnd:J,mounted:X,context:u,sortableInstance:c,getRelatedContextFromMoveEvent:B,getTargetedComponent:O,computeFutureIndex:Z}},render(){const e=this.getTag(),t=wQ(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),Zu(e,t,s)):Zu(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 Zu(e,t,n)}}),SQ=_t(rt({__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(u=>({id:u.field,name:u.headerName,...u}))||[],s.modelValue.forEach(u=>{i.value[u.field]={...u}})};et(()=>s.modelValue,u=>{r()},{immediate:!0,deep:!0}),et(n,u=>{if(u.length===s.modelValue.length&&!u.every((d,h)=>d.id===s.modelValue[h].field)){const d=u.map(h=>i.value[h.id]);o("changed",d),o("update:modelValue",d)}});const a=()=>!(s.readOnly||s.disabled),l=u=>!(s.readOnly||s.disabled);return(u,c)=>(j(),qe(U(bQ),{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[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:me(()=>[(j(!0),ce(xt,null,xn(n.value,(d,h)=>(j(),ce("div",{key:d.id,class:"fade-item"},[Tt(u.$slots,"item",{item:d,index:h},()=>[nt(Ct(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-2106e8ed"]]),EQ={key:0},_Q={key:1,style:{"font-style":"italic"}},RQ={key:2,style:{"font-style":"italic"}},DQ={key:3},cv=_t(rt({__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=Jt,s=e,o=V(s.columnStates[String(s.item.field)]||!1),i=t,r=h=>{o.value=h},a=Y(()=>{var h;return(h=s.item)==null?void 0:h.context}),l=Y(()=>{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"}),u=Y(()=>{var h,f;return(f=(h=s.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),c=Y(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=Y(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return et(()=>o.value,()=>{i("toggle-column",s.item.field,s.item.required)}),(h,f)=>(j(),ce("div",{key:e.item.field,class:te([h.$style["column-config__item"],{[h.$style.disabled]:s.readOnly,[h.$style["is-metric"]]:u.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:c.value}])},[pe(Bk,{focusIndex:s.focusIndex,id:`col-${e.item.field}`,"model-value":o.value==!0?U(Mt).CHECKED:U(Mt).UNCHECK,"onUpdate:modelValue":r,disabled:s.disableCheckbox||e.isDisableNewCheck&&!o.value,size:"16px"},null,8,["focusIndex","id","model-value","disabled"]),Ke((j(),ce("div",{class:"move-handler",style:dn({cursor:s.disableDrag?"not-allowed":"move"})},[pe(lt,{color:s.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:te(h.$style.handler)},null,8,["color","class"])],4)),[[U(n),s.disableDrag==!0?s.disableDragTooltip:""]]),u.value?(j(),ce("div",{key:0,class:te(h.$style["metric-type"])},[l.value=="rating"?(j(),ce("span",EQ,"★")):l.value=="formular"?(j(),ce("span",_Q," ƒx ")):l.value=="number"?(j(),ce("span",RQ," # ")):(j(),ce("span",DQ,Ct(l.value),1))],2)):Je("",!0),Re("span",{class:te(h.$style["column-config__item-label"])},[Ke((j(),ce("div",null,[nt(Ct(e.item.headerName),1)])),[[U(n),{content:e.item.headerName}]])],2),d.value?Ke((j(),ce("div",{key:1,class:te(h.$style["metric-icon"])},[pe(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[U(n),"Point metric"]]):Je("",!0),c.value?Ke((j(),ce("div",{key:2,class:te(h.$style["metric-icon"])},[pe(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[U(n),"Woohoo metric"]]):Je("",!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"}}]]),TQ=_t(rt({__name:"DropdownWrapper",props:{placement:{default:"bottom-start"},show:{type:Boolean,default:!1},maxWidth:{default:400}},emits:["open","close"],setup(e,{expose:t,emit:n}){const s=e,o=n,{hide:i,triggerRef:r,popupRef:a,isVisible:l,toggle:u}=Fs({toggleOnClick:!0,placement:s.placement,trigger:"click",interactive:!0,arrow:!1,offset:[0,4],showOnInit:s.show,maxWidth:s.maxWidth}),c=Y(()=>l.value);et(l,f=>{o(f?"open":"close")});const d=()=>{i()};t({closeDropdown:d,isOpen:c});const h=f=>{f.key==="Escape"&&a.value&&i()};return rn(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.addEventListener("keydown",h)}),vs(()=>{var p;const f=r.value instanceof HTMLElement?r.value:(p=r.value)==null?void 0:p.$el;f&&f.removeEventListener("keydown",h)}),(f,p)=>(j(),ce("div",{ref_key:"triggerRef",ref:r,class:te(f.$style["dropdown-wrapper"])},[Tt(f.$slots,"trigger",{open:U(l),toggle:U(u),closeDropdown:d},()=>[Re("button",{class:te(f.$style["editable-dropdown__trigger"]),"aria-label":"Select or type"}," ▼ ",2)]),Re("div",{ref_key:"popupRef",ref:a,tabindex:"0",class:te(f.$style["dropdown-content"]),style:dn({display:U(l)?"block":"none",maxWidth:s.maxWidth?s.maxWidth+"px":"unset"})},[Tt(f.$slots,"content",{closeDropdown:d,visible:U(l)},()=>[Re("div",{class:te(f.$style["dropdown-list"])},null,2)])],6)],2))}}),[["__cssModules",{$style:{"dropdown-wrapper":"_dropdown-wrapper_lghkw_1","dropdown-content":"_dropdown-content_lghkw_5","dropdown-list":"_dropdown-list_lghkw_11"}}]]),IQ={class:"reach-limit-icon"},xQ=_t(rt({__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=Jt,o=e,i=n,r=V(""),a=V(),l=Y(()=>r.value.trim().length>0),u=V([]),c=V({}),{triggerRef:d,popupRef:h,isVisible:f,hide:p}=Fs({toggleOnClick:!0,placement:"bottom-end",trigger:"click",offset:[0,0]});et(f,k=>{var O;k&&((O=a.value)==null||O.focus())});const g=Y(()=>o.disabled||r.value.length>0),v=Y(()=>u.value.filter(k=>k.pinned==="left"&&k.field&&k.headerName)),C=Y(()=>u.value.filter(k=>k.pinned==="right"&&k.field||k.field==="blank")),S=Y({get:()=>u.value.filter(k=>!k.pinned&&k.field&&k.field!=="blank"),set:k=>{u.value=[...v.value,...k,...C.value]}}),b=Y(()=>{if(!r.value)return{};const k=r.value.toLowerCase();return[...u.value,...S.value].reduce((O,B)=>{var Z;return(Z=B.headerName)!=null&&Z.toLowerCase().includes(k)&&B.field&&(O[B.field]=!0),O},{})}),w=Y(()=>o.modelValue),_=()=>{const k={};u.value.forEach(O=>{O.field&&(k[O.field]=!O.hide)}),c.value=k},D=Y(()=>{if(!r.value)return u.value;const k=r.value.toLowerCase();return u.value.filter(O=>{var B;return(B=O.headerName)==null?void 0:B.toLowerCase().includes(k)})}),T=()=>{var B;const k=(B=o.gridApi)==null?void 0:B.getColumnState().reduce((Z,X)=>(Z[X.colId]=Number(X.width),Z),{}),O=u.value.map(Z=>({...Z,hide:Z.field?!c.value[Z.field]:!1,width:Z.field?k==null?void 0:k[Z.field]:Z.width}));i("update:modelValue",O),i("change",O),i("input",O)},I=k=>{const O=[...v.value,...k,...C.value];o.checkboxColumn&&O.unshift(o.checkboxColumn),u.value=O,T()},x=k=>{k&&(c.value[k]=!c.value[k],T())};et(w,k=>{k&&k.length>0&&(u.value=[...k],_())},{immediate:!0}),t({updateColumnDefs(k){u.value=[...k],_()}});const F=Y(()=>A.value>=5),E=Y(()=>o.disabled||r.value.length>0),A=Y(()=>u.value.reduce((k,O)=>O.field&&O.field.includes("metric")&&c.value[O.field]===!0?k+1:k,0));return(k,O)=>{const B=Eo("focusable");return j(),ce("div",{class:te(k.$style["table-customization"])},[Re("div",{ref_key:"triggerRef",ref:d},[Tt(k.$slots,"trigger",{},()=>[Ke((j(),qe(vt,{variant:["secondary"],disabled:o.disabled,actived:U(f),style:{width:"32px"},onEscape:U(p)},{prefix:me(()=>[pe(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived","onEscape"])),[[B,"7"],[U(s),"Columns"]])])],512),Re("div",{ref_key:"popupRef",ref:h,class:te(k.$style["tippy-content-wrapper"])},[Re("div",{class:te([k.$style["column-config"],F.value?k.$style["has-warning"]:""]),style:dn({"--max-height":o.tableHeight?o.tableHeight:"max(500px, 60vh)"})},[pe(tS,{tabIndex:"7.0",modelValue:r.value,"onUpdate:modelValue":O[0]||(O[0]=Z=>r.value=Z),ref_key:"searchBoxRef",ref:a},null,8,["modelValue"]),Re("div",{class:te(k.$style["column-config__header"])},[...O[2]||(O[2]=[Re("span",null,"Manage columns",-1)])],2),F.value?(j(),ce("div",{key:0,class:te(k.$style["reach-limit"])},[Re("div",IQ,[pe(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),Re("div",{class:te(k.$style["warning-limit-text"])},[...O[3]||(O[3]=[nt(" You’ve reached the maximum number of metric columns. ",-1),Re("br",null,null,-1),nt(" Deselect one to show another. ",-1)])],2)],2)):Je("",!0),l.value?(j(),ce(xt,{key:1},[D.value.length===0&&l.value?(j(),ce("div",{key:0,class:te(k.$style["no-columns"])},[...O[4]||(O[4]=[nt(" No results. ",-1),Re("br",null,null,-1),nt(" Try another search. ",-1)])],2)):Je("",!0),l.value&&D.value.length>0?(j(),ce("div",{key:1,class:te(k.$style["column-config__pinned-section"])},[(j(!0),ce(xt,null,xn(D.value,Z=>{var X;return j(),qe(cv,{key:Z.colId,item:Z,columnStates:c.value,disableDrag:E.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:o.readOnly,isDisableNewCheck:F.value&&((X=Z.colId)==null?void 0:X.includes("metric")),onToggleColumn:x},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Je("",!0)],64)):Je("",!0),l.value?Je("",!0):(j(),ce("div",{key:2,class:te(k.$style["column-config__list"])},[(j(!0),ce(xt,null,xn(v.value,Z=>Ke((j(),qe(cv,{key:Z.field,item:Z,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:c.value},null,8,["item","columnStates"])),[[jo,b.value[Z.field]||!r.value]])),128)),pe(SQ,{modelValue:S.value,"onUpdate:modelValue":O[1]||(O[1]=Z=>S.value=Z),"group-name":"columns",onChanged:I,disabled:g.value,readOnly:o.readOnly},{item:me(({item:Z,index:X})=>[Ke((j(),qe(cv,{focusIndex:`7.${X+1}`,key:Z.id,item:Z,columnStates:c.value,disableDrag:E.value,disableDragTooltip:E.value?"Reordering is disabled while search is active.":void 0,readOnly:o.readOnly,isDisableNewCheck:F.value&&Z.id.includes("metric"),onToggleColumn:x},null,8,["focusIndex","item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[jo,b.value[Z.field]||!r.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(j(!0),ce(xt,null,xn(C.value.filter(Z=>{var X;return Z.headerName&&((X=Z.headerName)==null?void 0:X.length)>0}),Z=>Ke((j(),qe(cv,{key:Z.field,item:Z,disabled:o.disabled,readOnly:o.readOnly,columnStates:c.value},null,8,["item","disabled","readOnly","columnStates"])),[[jo,b.value[Z.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"}}]]),FQ=["aria-label"],PQ=["aria-disabled","onClick"],AQ=_t(rt({__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)=>(j(),ce("div",{class:te([a.$style["month-grid"],n.compact?a.$style.compact:""]),"aria-label":n.ariaLabel,"data-index":"month-selection"},[Re("div",{class:te(a.$style.months)},[(j(!0),ce(xt,null,xn(n.monthLabels,(u,c)=>(j(),ce("a",{key:u,tabindex:"0",class:te([a.$style["month-cell"],{[a.$style.selected]:c+1===n.selectedMonth&&n.selectedYear===n.displayYear,[a.$style.current]:c+1===r&&U(i)===n.displayYear,[a.$style.disabled]:n.disabled||n.readOnly||!n.isMonthSelectable(c+1)}]),"aria-disabled":n.disabled||n.readOnly||!n.isMonthSelectable(c+1),onClick:d=>o(c+1),onKeydown:l[0]||(l[0]=d=>s("keydown",d))},Ct(u),43,PQ))),128))],2)],10,FQ))}}),[["__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"}}]]),kQ=["data-year","aria-disabled","onClick"],OQ=_t(rt({__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}),rn(()=>{if(i.value){const l=i.value.querySelector(`[data-year="${s.selectedYear}"]`);l&&l.scrollIntoView({block:"center"})}}),(l,u)=>(j(),ce("div",{ref_key:"rootEl",ref:i,class:te([l.$style["year-grid-body"],s.scrollable?l.$style.scrollable:"",s.compact?l.$style.compact:""]),role:"grid","data-index":"year-selection"},[(j(!0),ce(xt,null,xn(s.years,c=>(j(),ce("a",{key:c,"data-year":c,tabindex:"0",class:te([l.$style["year-cell"],{[l.$style.selected]:c===s.selectedYear,[l.$style.current]:c===U(r),[l.$style.disabled]:s.disabled||!s.isYearSelectable(c)}]),"aria-disabled":s.disabled||!s.isYearSelectable(c),onClick:d=>a(c),onKeydown:u[0]||(u[0]=d=>o("keydown",d))},Ct(c),43,kQ))),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"}}]]),MQ={class:"navigation"},NQ={class:"picker"},LQ={key:0,class:"footer"},VQ=_t(rt({__name:"MonthPickerLayout",props:{disableConfirm:{type:Boolean,default:!1}},setup(e){return(t,n)=>(j(),ce("div",{class:te(["month-picker-layout",{"disable-confirm":e.disableConfirm}])},[Re("div",MQ,[Tt(t.$slots,"navigation",{},void 0,!0)]),Re("div",NQ,[Tt(t.$slots,"picker",{},void 0,!0)]),pe(KD,{name:"fade",mode:"out-in"},{default:me(()=>[e.disableConfirm?Je("",!0):(j(),ce("div",LQ,[Tt(t.$slots,"footer",{},void 0,!0)]))]),_:3})],2))}}),[["__scopeId","data-v-885d09b2"]]),BQ={style:{flex:"1"}},$Q=_t(rt({__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 u=l.target;u.dataset.index==="today-btn"?r():u.dataset.index==="cancel-btn"?o():u.dataset.index==="save-btn"&&i()}};return(l,u)=>{const c=Eo("tooltip");return n.readOnly?Je("",!0):(j(),ce("div",{key:0,class:te(l.$style["arbo-calendar-actions"])},[Re("div",BQ,[Ke((j(),qe(U(vt),{variant:"secondary",size:"medium",onClick:u[0]||(u[0]=d=>r()),onKeydown:a,"data-index":"today-btn"},{prefix:me(()=>[pe(U(lt),{src:"CalendarDay"})]),_:1})),[[c,"Today"]])]),pe(U(vt),{disabled:n.disabled,readOnly:n.readOnly,onKeydown:a,variant:"secondary",size:"medium",onClick:o,"data-index":"cancel-btn"},{default:me(()=>[nt(Ct(n.cancelLabel),1)]),_:1},8,["disabled","readOnly"]),pe(U(vt),{disabled:n.disabled||n.disableConfirm,readOnly:n.readOnly,variant:"primary",size:"medium","data-index":"save-btn",onKeydown:a,onClick:i},{default:me(()=>[nt(Ct(n.confirmLabel),1)]),_:1},8,["disabled","readOnly"])],2))}}}),[["__cssModules",{$style:{"arbo-calendar-actions":"_arbo-calendar-actions_132g0_1"}}]]),HQ=_t(rt({__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=ao({month:new Date().getMonth()+1,year:new Date().getFullYear()}),o=Y(()=>{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=Y(()=>{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})},u=()=>{r("toggle-months")},c=()=>{r("toggle-years")},d=Y(()=>{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,C)=>p.format(new Date(Date.UTC(2020,C,1))))});return(h,f)=>(j(),ce("div",{class:te(h.$style["cal-nav-bar"])},[e.mode!="year"?(j(),qe(U(vt),{key:0,variant:"tertiary",class:te([h.$style["cal-nav-btn"],h.$style.prev]),"aria-label":"Previous",disabled:o.value,label:"",onClick:a,"data-index":"prev-btn",onKeydownCapture:zn(Pt(a,["prevent","stop"]),["enter"])},{default:me(({hovered:p})=>[pe(U(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Je("",!0),Re("div",{class:te([h.$style["cal-nav-center"],e.hideMonth?h.$style.single:""])},[e.hideMonth?Je("",!0):(j(),qe(U(vt),{key:0,"data-index":"month-btn",variant:"secondary",onClick:u},{default:me(()=>[nt(Ct(d.value[n.month-1]),1)]),_:1})),pe(U(vt),{variant:"secondary",onClick:c,"data-index":"year-btn"},{default:me(()=>[nt(Ct(n.year),1)]),_:1})],2),e.mode!="year"?(j(),qe(U(vt),{key:1,"data-index":"next-btn",variant:"tertiary",class:te([h.$style["cal-nav-btn"],h.$style.next]),"aria-label":"Next",disabled:i.value,label:"",onClick:l,onKeydownCapture:zn(Pt(l,["prevent","stop"]),["enter"])},{default:me(({hovered:p})=>[pe(U(lt),{src:"AnglesRight",source:"remote",color:p?"#3C9BFA":"#6B6B6B"},null,8,["color"])]),_:1},8,["class","disabled","onKeydownCapture"])):Je("",!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"}}]]),GQ=["aria-label"];new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const UQ={class:"wrapper-suffix"},WQ=_t(rt({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{type:Function},workspaceId:{},id:{}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=Jt,o={PER_PAGE:20,INITIAL_PAGE:1},i=e,r=V(i.modelValue),a=n,l=Y(()=>f.value.find(E=>E.id===r.value)||null),u=E=>{r.value=E.id,a("update:modelValue",E.id)},c=Y(()=>{if(!r.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const E=f.value.find(k=>k.id===r.value),A=String((E==null?void 0:E.color)||"white");return{backgroundColor:A,border:Ng(A,"white")?"1px solid #ccc":"1px solid #fff"}}),d=V(null),h=()=>{var E;(E=d.value)==null||E.focus()},f=V([]),p=V(!1),g=V(!1),v=V(null),C=V(o.INITIAL_PAGE),S=V(!0),b=V(0),w=V(""),_=Y(()=>!!(i.id&&i.workspaceId)),D=E=>{const A=f.value.find(k=>k.id===E.value);A&&u(A)},T=E=>({label:E.name,value:E.id,selected:r.value===E.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:E,id:E.id,color:E.color}),I=async(E=o.INITIAL_PAGE,A="",k=!1)=>{var O;if(!_.value){console.error("Missing required props",i);return}k?g.value=!0:p.value=!0,v.value=null;try{const B={workspaceId:String(i.workspaceId),itemIds:i.id,page:E,perPage:o.PER_PAGE,name_like:A.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const Z=await i.getStatusFunc(B);if(!Z){k||(f.value=[]),S.value=!1;return}const X=Z.data.map(T);f.value=k?[...f.value,...X]:X,b.value=((O=Z.meta)==null?void 0:O.total)??Z.data.length,S.value=f.value.length<b.value,C.value=E}catch(B){console.error("Error fetching statuses:",B),v.value="Failed to load statuses",k||(f.value=[]),S.value=!1,a("error",v.value)}finally{p.value=!1,g.value=!1}},x=async()=>{!S.value||g.value||await I(C.value+1,w.value,!0)};et([()=>i.id,()=>i.workspaceId],()=>{I()},{deep:!0,immediate:!0});const F=async E=>{w.value=E,C.value=o.INITIAL_PAGE,await I(o.INITIAL_PAGE,E,!1)};return t({focus:h,clear:()=>{r.value=null,a("update:modelValue",null)}}),(E,A)=>(j(),qe(TQ,{onOpen:h,placement:"bottom-start","max-width":500},{trigger:me(({open:k})=>[pe(Cs,{actived:k,class:te(E.$style["status-wrapper"])},{suffix:me(()=>[Re("div",UQ,[pe(lt,{src:"ChevronUp",source:"remote",class:te([[E.$style["dropdown-icon"]],{[E.$style["dropdown-icon-show"]]:!k}])},null,8,["class"])])]),default:me(()=>{var O;return[Re("div",{class:te(E.$style.status)},[Re("div",{class:te(E.$style["color-indicator"]),style:dn(c.value)},null,6),Ke((j(),ce("span",{style:{"max-width":"400px"},class:te({[E.$style.empty]:!l.value})},[nt(Ct(l.value?l.value.label:"Select status"),1)],2)),[[U(s),{content:((O=l.value)==null?void 0:O.label)||void 0}]])],2)]}),_:2},1032,["actived","class"])]),content:me(({closeDropdown:k})=>{var O;return[pe(Jr,{ref_key:"popupRef",ref:d,"selected-id":(O=l.value)==null?void 0:O.id,options:f.value,loading:p.value,"loading-more":g.value,"has-more":S.value,error:v.value,onSearch:F,onSelect:B=>{D(B),k()},onLoadMore:x,onCancel:A[0]||(A[0]=B=>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})}}),zQ={key:2},jQ=_t(rt({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 S;const n=e,s=V(n.value),o=V(!0),i=V(""),r=()=>{var F,E,A;const b=(F=c.value)==null?void 0:F.restricted_type.trim(),w=((A=(E=c.value)==null?void 0:E.restricted_value)==null?void 0:A.split(",").map(Number))||[],[_,D]=w,I={range:`Enter a value between ${_} and ${D}`,not:`These values are not allowed: ${w.join(", ")}`,exact:"Value is not allowed"}[b];return o.value?"":I},a=b=>{if(c.value){if(b===null||b===""){o.value=!0;return}if(u.value!=="number"){o.value=!0;return}o.value=cm(c.value,Number(b)),i.value=r()}};Y(()=>o.value?{content:"",showOnCreate:!1}:{content:i.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=V(null),u=Y(()=>xF(c.value)),c=Y(()=>{var w,_;return((_=(w=n.params)==null?void 0:w.colDef)==null?void 0:_.context)||null}),{apiServices:d}=ts(!0,n),{updateCellData:h}=EO((S=n.params)==null?void 0:S.api),f=V(!1),p=Ki(n,"id"),g=()=>{var b;(b=n.params)==null||b.api.stopEditing()},v=()=>{g()},C=async b=>{var _,D;if(g(),f.value=!0,s.value=b||null,b===n.value){f.value=!1;return}const w={itemIds:[String(p.value)],metricId:((_=c.value)==null?void 0:_.id)||"",workspaceId:String(n.workspaceId)};b==null?w.clear=1:w.value=b,h({rowId:String(p.value),field:`metric_${w.metricId}`,value:void 0});try{const T=await((D=d.value)==null?void 0:D.bulkUpdateMetric(w));(T==null?void 0:T.message)=="Done"?h({rowId:String(p.value),field:`metric_${w.metricId}`,value:b||null}):(h({rowId:String(p.value),field:`metric_${w.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_${w.metricId}`,value:n.value})}finally{f.value=!1}};return(b,w)=>(j(),ce("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[u.value=="dropdown"&&c.value?(j(),qe(GA,{key:0,config:c.value,modelValue:s.value,"onUpdate:modelValue":w[0]||(w[0]=_=>s.value=_),onChange:C,onHandleCancel:v},null,8,["config","modelValue"])):u.value=="number"&&c.value?(j(),qe(UA,{key:1,showInlineError:!1,autoEmit:!0,config:c.value,modelValue:s.value,"onUpdate:modelValue":w[1]||(w[1]=_=>s.value=_),style:{width:"100%"},onHandleChange:C,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(j(),ce("div",zQ,"Metric type:"+Ct(u.value),1))],512))}}),[["__scopeId","data-v-519d44e5"]]),KQ=_t(rt({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."};Y(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate");const s=Y(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),o=V(!1);return rn(()=>{o.value=!0}),(i,r)=>(j(),ce("div",{class:te(i.$style["no-data-item-table"])},[Re("div",{class:te(i.$style.visual)},[o.value?(j(),qe(Fm,{key:0,source:"remote",src:"NoDataGeneral",ratio:"4/3",maxWidth:500,maxHeight:350})):Je("",!0)],2),Re("div",{class:te(i.$style.description)},Ct(s.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),_O=Jl("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=Y(()=>{const a=e.value;return Object.values(a).filter(u=>u.sort!=="none"&&!!u.sort).map(u=>{let c;switch(u.colId){case"dateRange":c=n[u.sort];break;default:if(u.colId.includes("metric")){const[d,h]=u.colId.split("_");c={column:d,direction:u.sort,type:h}}else c={column:t[u.colId]||u.colId,direction:u.sort};break}return c})}),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}}),ru=rt({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=_O(),{sorts:s}=Qs(n),o=Y(()=>{var l,u;return((u=(l=t.params)==null?void 0:l.column)==null?void 0:u.getColId())||"template_col_id"}),i=l=>{o.value&&n.setSort(o.value,l)},r=Y(()=>t.params.headerType||void 0),a=V("none");return et(()=>s.value,Di(()=>{if(o.value){const l=s.value[o.value];a.value=l?l.sort:"none"}},rr),{deep:!0,immediate:!0}),(l,u)=>o.value?(j(),qe(rJ,qt({key:0},t,{"header-type":r.value,modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=c=>a.value=c),onSortChanged:i}),null,16,["header-type","modelValue"])):Je("",!0)}});function qQ(){const e=ao({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>255?e.error="Name cannot exceed 255 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 et(()=>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 dv=Jl("userStore",()=>{const e=V(null),t=V(null);return{user:e,setUser:o=>{e.value=o},setUserRoleId:o=>{t.value=o},workspaceUserRoleId:t}}),YQ=["innerHTML"],ZQ=20,XQ=_t(rt({__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}=Fs({toggleOnClick:!0,appendTo:"parent",offset:[-15,8]}),u=()=>{a()},c=V(null),d=()=>{F.value=[],fe.value=!1},h=Y(()=>r.value),f=Y(()=>{var z;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((z=F.value)==null?void 0:z.length)===0,wrapperRef:o,active:h,bordered:!0}}),{argsMain:p}=ws(f),g=Jt,v=n,C=Y(()=>{var z;return Math.max(0,(((z=F.value)==null?void 0:z.length)||0)-s.maxVisible)}),S=Y(()=>{var z;return C.value<=0?"":((z=F.value)==null?void 0:z.slice(s.maxVisible).map(ge=>ge.name).join(", "))||""}),b=V(!1),w=V(!1),_=V(null),D=V(1),T=V(!0),I=V(0),x=V(""),F=V([]),E=Y(()=>{var z;return((z=F.value)==null?void 0:z.map(ge=>ge.id))||[]}),{assigneeList:A,mergedOptions:k}=gm({...s,value:[]}),{apiServices:O}=ts(!1,s),B=_n("entityId"),Z=async(z=1,ge="",se=!1)=>{var G,q,de,Ae,Fe;if(!O.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(se?w.value=!0:b.value=!0,_.value=null,!((G=O.value)!=null&&G.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const be=En.getInstance().getItem("ws.code");try{const Le=await((q=O.value)==null?void 0:q.getAssignableAssignees(String(be),{entity_ids:(B==null?void 0:B.value)||"",page:z,per_page:ZQ,display_name_like:ge})),ye=((de=Ec(Le.data))==null?void 0:de.map(pm))??[];A.value=se?uc(A.value,ye,"id"):ye,I.value=Le.meta.total,T.value=(((Ae=Le==null?void 0:Le.meta)==null?void 0:Ae.current_page)||0)<(((Fe=Le==null?void 0:Le.meta)==null?void 0:Fe.last_page)||0),D.value=z}catch(Le){console.error("Error fetching assignable users:",Le),_.value="Failed to load assignable users"}finally{b.value=!1,w.value=!1}},X=z=>{var ge,se,be;if((ge=F.value)!=null&&ge.some(G=>G.id===z.data.id)){F.value=(se=F.value)==null?void 0:se.filter(G=>G.id!==z.data.id);return}F.value=[...F.value||[],z.data],(be=c.value)==null||be.focus()},ee=()=>{F.value=[]},re=()=>{!w.value&&T.value&&Z(D.value+1,x.value,!0)},ae=Di(async z=>{x.value=z,await Z(1,z,!1)},rr);et(()=>r.value,z=>{var ge;z?(Z(1,x.value,!1),(ge=c.value)==null||ge.focus(),v("show")):v("hide")});const J=Y(()=>{var z;return((z=F.value)==null?void 0:z.slice(0,3))||[]}),L=Y(()=>J.value.map(z=>({id:z.id,name:z.name,initial:z.initial,avatarId:z.id,profile_image:z.profile_image,color:z.color,size:24,user:z}))),H=dv(),{user:Q}=Qs(H),fe=V(!1);t({getData:()=>F.value,clear:d,setData:z=>{F.value=z},focus:()=>{a(),mt(()=>{var z;(z=c.value)==null||z.focus()})},hide:()=>{l()}}),et([F,fe],()=>{v("updated",F.value)},{deep:!0});const ve=z=>{var ge;F.value=(ge=F.value)==null?void 0:ge.filter(se=>se.id!==z)},oe=z=>{var se;const ge=En.getInstance().getItem("ws.code");return((se=O.value)==null?void 0:se.getUserInformation(ge,z))||Promise.resolve(null)},ie=V();return(z,ge)=>(j(),ce("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:ie},[pe(Cs,qt(U(p),{style:{"--icon-size":"18px"}}),{prefix:me(()=>[L.value.length==0?(j(),ce("div",{key:0,class:te([z.$style["icon-wrapper"],"wrapper-prefix"]),onClick:Pt(u,["stop","prevent"])},[pe(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Je("",!0)]),default:me(()=>[Re("div",{class:te([z.$style["assignee-row"],z.$style["assignee-selector"]]),ref_key:"triggerRef",ref:o},[Re("div",{style:{flex:1},class:te([z.$style["assignee-row"]])},[(j(!0),ce(xt,null,xn(L.value,se=>(j(),qe(hf,{onClear:be=>ve(se.id),key:se.user.id,"disable-remove":!1},{default:me(()=>[pe(Oc,{user:se.user,apiUpdateFunction:oe,appendTo:ie.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),C.value>0?Ke((j(),ce("div",{key:0,class:te(z.$style["extra-avatars"])},[nt(" +"+Ct(C.value),1)],2)),[[U(g),S.value]]):Je("",!0)],2)],2)]),_:1},16),Re("div",{ref_key:"popupRef",ref:i},[pe(Jr,qt({"selected-id":E.value},{...s},{options:U(k),loading:b.value,"loading-more":w.value,"has-more":T.value,ref_key:"searchListRef",ref:c,onTab:ge[0]||(ge[0]=se=>v("tab",se)),onSelect:ge[1]||(ge[1]=se=>{X(se),v("start-update")}),onSearch:U(ae),onClose:ge[2]||(ge[2]=()=>v("close")),onLoadMore:re}),{"extra-item":me(()=>[pe(nS,{onClick:ee,label:"Unassign",borderLeft:!0},{icon:me(()=>[pe(lt,{src:"UserXMark",source:"remote"})]),_:1})]),item:me(({item:se,selectedIndex:be,isSelected:G,handleSelect:q,handleItemHover:de,getHighlightedLabel:Ae,query:Fe,idx:Le})=>[pe(Ql,qt(se,{hover:Le===be,selected:G(se),type:se.type,onClick:Pt(ye=>q(se,ye),["stop","prevent"]),onMouseover:ye=>de(Le),class:z.$style["item-assignee"]}),{prefix:me(()=>[pe(Oc,{user:se.data,apiUpdateFunction:oe,appendTo:U(i)},null,8,["user","appendTo"])]),label:me(({})=>[Fe?Ke((j(),ce("span",{key:0,class:te([z.$style["item-label"],z.$style.match]),style:{flex:"1"},innerHTML:Ae(se.label)},null,10,YQ)),[[U(g),{content:se.label}]]):Ke((j(),ce("span",{key:1,class:te(z.$style["item-label"]),style:{flex:"1"}},[nt(Ct(se.label),1)],2)),[[U(g),{content:se.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"}}]]),JQ={key:0},QQ={key:1},eee={key:0},tee={key:1},nee={key:0,class:"wrapper-suffix"},see={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},oee=_t(rt({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const s=Jt,{triggerRef:o,popupRef:i,isVisible:r,hide:a,show:l}=Fs({toggleOnClick:!0,appendTo:"parent",offset:[0,0]}),u=()=>{c.value=[null,null]},c=V([null,null]),d=w=>{const _=um();return w?bt.fromJSDate(w,{zone:_}).toFormat("MMM dd"):""},h=Y(()=>r.value),f=Y(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:o,active:h,bordered:!0})),{argsMain:p}=ws(f),g=V(!1),v=w=>{S("tab",w)},C=w=>{"start"in w&&w.start!==void 0&&(c.value[0]=w.start),"end"in w&&w.end!==void 0&&(c.value[1]=w.end)};t({getData:()=>c.value,clear:u,setData:w=>{c.value=w},focus:()=>{l(),mt(()=>{var w;(w=b.value)==null||w.focus()})},hide:()=>{a()}});const S=n;et(()=>c.value,w=>{S("updated",w)},{deep:!0});const b=V(null);return et(()=>r.value,w=>{w?(mt(()=>{var _;(_=b.value)==null||_.focus()}),S("show")):S("hide")}),(w,_)=>(j(),ce(xt,null,[pe(Cs,qt({ref_key:"triggerRef",ref:o},U(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:me(({focused:D})=>[Re("div",{class:te(w.$style["date-time"])},[Re("div",{class:te(w.$style.date)},[c.value[0]==null&&(D||U(r))?(j(),ce("span",JQ,"MMMDD")):(j(),ce("span",QQ,Ct(d(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||D||U(r)?(j(),ce("div",{key:0,class:te(w.$style.separator)}," → ",2)):Je("",!0),Re("div",{class:te(w.$style.date)},[c.value[1]==null&&(D||U(r))?(j(),ce("span",eee,"MMMDD")):(j(),ce("span",tee,Ct(d(c.value[1])),1))],2)],2)]),suffix:me(({hovered:D,focused:T})=>[(c.value[0]!==null||c.value[1]!==null)&&(D||T||U(r))?(j(),ce("div",nee,[Ke((j(),qe(vt,{onClick:Pt(u,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:me(()=>[pe(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[U(s),"Clear"]])])):Je("",!0)]),prefix:me(()=>[c.value[0]===null&&c.value[1]===null?(j(),ce("div",see,[pe(lt,{src:"Calendar",color:"#A6A6A6"})])):Je("",!0)]),_:1},16),Re("div",{ref_key:"popupRef",ref:i},[U(r)?(j(),qe(Pm,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:C,ref_key:"calendarRef",ref:b,onClosed:U(a),onStartUpdate:_[0]||(_[0]=D=>g.value=!0),onFinishUpdate:_[1]||(_[1]=D=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Je("",!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"}}]]),iee=_t(rt({__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:u}=Fs({toggleOnClick:!0,appendTo:"parent"}),c=V(null),d=V([]),h=V(!1),f=V(!1),p=V(null),g=V(o.INITIAL_PAGE),v=V(!0),C=V(0),S=V(""),b=n,w=Y(()=>a.value),_=Y(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!c.value,wrapperRef:i,active:w,bordered:!0})),D=V(null),{argsMain:T}=ws(_),I=Y(()=>c.value?d.value.filter(J=>J.id===c.value):[]),x=Y(()=>!c.value||I.value.length===0?"":I.value[0].label),F=Y(()=>c.value?[c.value]:[]),E=Y(()=>{if(!c.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const J=I.value[0],L=String((J==null?void 0:J.color)||"white");return{backgroundColor:L,border:Ng(L,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),A=J=>({label:J.name,value:J.id,selected:c.value===J.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:J,id:J.id,color:J.color}),{apiServices:k}=ts(!1,s),O=async(J=o.INITIAL_PAGE,L="",H=!1)=>{var Q,fe;H?f.value=!0:h.value=!0,p.value=null;try{const ve=En.getInstance().getItem("ws.code"),oe=await((Q=k.value)==null?void 0:Q.getAssignableStatuses(ve,{entity_id:s.entityId||"",name_like:L,page:J,per_page:o.PER_PAGE}));if(!oe){H||(d.value=[]),v.value=!1;return}const ie=oe.data.map(A);d.value=H?[...d.value,...ie]:ie,C.value=((fe=oe.meta)==null?void 0:fe.total)??oe.data.length,v.value=d.value.length<C.value,g.value=J}catch(ve){console.error("Error fetching statuses:",ve),p.value="Failed to load statuses",H||(d.value=[]),v.value=!1,b("error",p.value)}finally{h.value=!1,f.value=!1}},B=(J,L)=>{var Q;L.stopImmediatePropagation(),L.preventDefault(),L.stopPropagation();const H=J.id;c.value=H,(Q=D.value)==null||Q.focus(),b("update:modelValue",c.value),u()},Z=async()=>{!v.value||f.value||await O(g.value+1,S.value,!0)},X=async J=>{S.value=J,g.value=o.INITIAL_PAGE,await O(o.INITIAL_PAGE,J,!1)},ee=()=>{c.value=null,b("update:modelValue",null)},re=()=>{l(),mt(()=>{var J;(J=D.value)==null||J.focus()})};return et(()=>a.value,J=>{var L;J?(O(1,S.value,!1),(L=D.value)==null||L.focus(),b("show")):b("hide")}),et(()=>c.value,J=>{b("updated",J)}),t({focus:re,clear:ee,getData:()=>c.value,setData:J=>{c.value=J},hide:u,autoFillDefault:async()=>{S.value="",await O(1,S.value,!1),d.value.length>0&&(c.value=d.value[0].id,b("update:modelValue",c.value))}}),(J,L)=>{const H=Eo("tooltip");return j(),ce(xt,null,[pe(Cs,qt({ref_key:"triggerRef",ref:i},U(T),{style:{"--icon-size":"18px"}}),{default:me(()=>[Re("div",{class:te(J.$style.status)},[Re("div",{class:te(J.$style["color-indicator"]),style:dn(E.value)},null,6),Ke((j(),ce("span",{class:te({[J.$style.empty]:I.value.length===0,[J.$style["status-text"]]:!0})},[nt(Ct(x.value),1)],2)),[[H,{content:x.value}]])],2)]),_:1},16),Re("div",{ref_key:"popupRef",ref:r},[pe(Jr,{style:{width:"200px"},ref_key:"searchListRef",ref:D,"selected-id":F.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:X,onSelect:B,onLoadMore:Z,onCancel:L[0]||(L[0]=Q=>b("cancel")),onTab:L[1]||(L[1]=Q=>b("tab",Q)),onClose:L[2]||(L[2]=()=>b("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"]]),ree=_t(rt({__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=Jt,i=RH("target"),r=_n("workspaceId"),a=_n("entityId"),l=n,u=e,{newItemData:c,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=qQ(),{apiServices:p}=ts(!1,u),{openSceneHub:g}=ef(),v=V(!1),C=V(!1),S=V(null),b=V({assignees:!1,status:!1,date:!1}),w={name:V(null),assignees:V(null),status:V(null),date:V(null),cancel:V(null),"create-keep":V(null),create:V(null)},_=w.name,D=w.assignees,T=w.status,I=w.date,x=w.cancel,F=w["create-keep"],E=w.create,A=V(new Map),k=Y(()=>!!c.error||!c.name.trim()||C.value),O=(ye,M)=>{ye&&A.value.set(M,ye.$el||ye)},B=(ye,M)=>{if(ye==="date"){const[$,le]=Array.isArray(M)?M:[void 0,void 0];c.start_date=$,c.due_date=le}else c[ye]=M},Z=()=>{c.isCreating=!0,S.value="name"},X=()=>{c.isCreating=!1,h()},ee=_n("switchInstance"),{addNotification:re}=gf(),ae=ye=>{l("focus-on-id",ye)},J=(ye,M,$)=>{const le=D7(void 0,"created");re({id:String(ye),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${le}</b>
|
|
156
156
|
<span>${M} </span></div>`,actions:[{label:"Find in table",variant:"secondary",btnIcon:"MagnifyingGlass",action:()=>{l("search-for-code",{code:$,name:M}),ae(String(ye))}},{label:"Full view",btnIcon:"CustomSceneHub",variant:"primary",action:Ge=>{if(Ge.ctrlKey||Ge.metaKey){const we=co({type:"scene_hub",config:{ws_code:r,baseDomain:En.getInstance().getItem("BASE_URL")||"",scene_id:String(ye)}}).url;window.open(we,"_blank");return}else ee("scene_hub",{id:String(ye)},{showLoading:!1})}}],type:"interactive"})},L=ye=>{ye&&mt(()=>{var $;const M=($=w[ye])==null?void 0:$.value;M&&(typeof M.focus=="function"?M.focus():M.$el&&typeof M.$el.focus=="function"&&M.$el.focus())})},H=ye=>{var M;(M=i.value)==null||M.focus()},Q=ye=>{const M=$=>{var le;return(le=$==null?void 0:$.hide)==null?void 0:le.call($)};ye!=="assignees"&&M(D.value),ye!=="status"&&M(T.value),ye!=="date"&&M(I.value)},fe=(ye,M)=>{M instanceof KeyboardEvent&&M.key!=="Tab"&&M.preventDefault();const $=S.value?s.indexOf(S.value):-1;if($===-1){L("name");return}let Ge=($+(ye==="next"?1:-1)+s.length)%s.length,we=s[Ge];(we==="create"||we==="create-keep")&&k.value&&(Ge=0,we=s[0]),Q(we),L(we)},ve=ye=>{b.value[ye]=!0,S.value=ye},oe=ye=>{b.value[ye]=!1,H()},ie=ye=>{b.value[ye]||(S.value=null)},z=ye=>{ye.target===i.value&&L("name")},ge=ye=>{var M,$,le;if(ye.key==="Enter"){if(!S.value)return;switch(ye.preventDefault(),ye.stopPropagation(),S.value){case"create":k.value||de("clear");break;case"create-keep":k.value||de("keep");break;case"cancel":f();break;case"assignees":(M=D.value)==null||M.focus();break;case"status":($=T.value)==null||$.focus();break;case"date":(le=I.value)==null||le.focus();break}return}if(ye.key==="Tab"){ye.preventDefault(),ye.stopImmediatePropagation(),ye.stopPropagation(),S.value!=="name"&&se(ye);return}if(ye.key==="Escape"){S.value=null,X();return}},se=ye=>{ye.preventDefault(),ye.stopImmediatePropagation(),ye.stopPropagation();const M=ye.shiftKey?"prev":"next";fe(M,ye)},be=()=>{var ye;return(ye=D.value)==null?void 0:ye.focus()},G=()=>{var ye;return(ye=T.value)==null?void 0:ye.focus()},q=()=>{var ye;return(ye=I.value)==null?void 0:ye.focus()},de=async(ye="clear")=>{mt(async()=>{var $,le,Ge,we,ze,Ue,Ee,Ve,pt,At,Ut;if(k.value||v.value||C.value)return;C.value=!0,v.value=!0;const M={name:c.name,template_flow_status_id:c.status??void 0,ws_user_role_ids:($=c.assignees)==null?void 0:$.map(Qt=>Qt.id),start_date:c.start_date?fm(c.start_date):void 0,due_date:c.due_date?fm(c.due_date):void 0};if(!((le=p.value)!=null&&le.addNewItem)){console.warn("API service unavailable"),v.value=!1;return}try{const Qt=await p.value.addNewItem(r,a,M),zt=c.name;if(J(Qt.id,Qt.name,Qt.code),!Qt.id)throw new Error("Invalid response from server: missing scene ID");switch(C.value=!1,v.value=!1,ye){case"close":h(),(Ge=D.value)==null||Ge.setData([]),(we=T.value)==null||we.setData(null),(ze=I.value)==null||ze.setData([null,null]),f(),X();break;case"close-open":h(),(Ue=D.value)==null||Ue.setData([]),(Ee=T.value)==null||Ee.setData(null),(Ve=I.value)==null||Ve.setData([null,null]),f(),X(),g(Qt.id);break;case"clear":l("create-new-item",zt),h(),(pt=D.value)==null||pt.setData([]),(At=T.value)==null||At.setData(null),(Ut=I.value)==null||Ut.setData([null,null]),L("name");break;case"keep":l("create-new-item",zt),c.name="",c.error="",L("name");break}}catch(Qt){console.error("Error creating scene:",Qt),ye=="close"&&(f(),X())}finally{v.value=!1,C.value=!1}})},Ae=(ye,M)=>{k.value||(M.metaKey||M.ctrlKey?de("close-open"):M.shiftKey?de("keep"):de("clear"))},Fe=(ye=!1)=>{c.isCreating&&(!k.value&&!c.error?de(ye?"close":"clear"):X())},Le=()=>{f(),c.name="",mt(()=>{var ye;(ye=_.value)==null||ye.setValue(c.name)})};return Qb(i,ye=>{const M=ye.target.closest(".notification-center"),$=ye.target.closest("#people-insight-container");if(M||$)return!1;Fe(!0)}),et(()=>c.isCreating,ye=>{ye&&L("name")}),t({show:Z,hide:X}),(ye,M)=>Ke((j(),ce("div",{class:te(ye.$style.newRow),ref_key:"target",ref:i,onKeydown:ge,onClick:z,tabindex:"-1"},[Re("div",{ref:$=>O($,"name"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="name"})},[pe(eS,{ref_key:"nameInputRef",ref:_,disabled:v.value||C.value,modelValue:U(c).name,"onUpdate:modelValue":M[0]||(M[0]=$=>U(c).name=$),onChange:U(d),onEnter:Ae,onCancel:Le,onTab:M[1]||(M[1]=($,le)=>se(le)),onFocus:M[2]||(M[2]=$=>S.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),Re("div",{ref:$=>O($,"assignees"),onEnter:Pt(be,["prevent","stop"]),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="assignees"})},[pe(XQ,{ref_key:"assigneeRef",ref:D,onUpdated:M[3]||(M[3]=$=>B("assignees",$)),onTab:M[4]||(M[4]=$=>se($)),onEnter:be,onFocus:M[5]||(M[5]=$=>S.value="assignees"),onBlur:M[6]||(M[6]=$=>ie("assignees")),onShow:M[7]||(M[7]=$=>ve("assignees")),onHide:M[8]||(M[8]=$=>oe("assignees"))},null,512)],34),Re("div",{ref:$=>O($,"status"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="status"})},[pe(iee,{ref_key:"statusRef",ref:T,"entity-id":U(a),onUpdated:M[9]||(M[9]=$=>B("status",$)),onTab:M[10]||(M[10]=$=>se($)),onEnter:G,onFocus:M[11]||(M[11]=$=>S.value="status"),onBlur:M[12]||(M[12]=$=>ie("status")),onShow:M[13]||(M[13]=$=>ve("status")),onHide:M[14]||(M[14]=$=>oe("status"))},null,8,["entity-id"])],2),Re("div",{ref:$=>O($,"date"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="date"})},[pe(oee,{ref_key:"dateRef",ref:I,onUpdated:M[15]||(M[15]=$=>B("date",$)),onTab:M[16]||(M[16]=$=>se($)),onEnter:q,onFocus:M[17]||(M[17]=$=>S.value="date"),onBlur:M[18]||(M[18]=$=>ie("date")),onShow:M[19]||(M[19]=$=>ve("date")),onHide:M[20]||(M[20]=$=>oe("date"))},null,512)],2),Re("div",{class:te(ye.$style["field-actions"])},[Re("div",{ref:$=>O($,"cancel"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="cancel",[ye.$style["field-button"]]:!0})},[pe(vt,{ref_key:"cancelRef",ref:x,variant:["secondary"],onClick:U(f),onKeydown:[zn(U(f),["enter"]),M[22]||(M[22]=zn($=>se($),["tab"]))],onFocus:M[21]||(M[21]=$=>S.value="cancel"),tabindex:"0"},{default:me(()=>[...M[31]||(M[31]=[nt(" Cancel ",-1)])]),_:1},8,["onClick","onKeydown"])],2),Ke((j(),ce("div",{ref:$=>O($,"create-keep"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style["field-button"]]:!0,[ye.$style.active]:S.value==="create-keep"})},[pe(vt,{ref_key:"createKeepRef",ref:F,onClick:M[23]||(M[23]=()=>de("keep")),onKeydown:[M[24]||(M[24]=zn($=>!k.value&&de("keep"),["enter"])),M[26]||(M[26]=zn($=>se($),["tab"]))],onFocus:M[25]||(M[25]=$=>S.value="create-keep"),disabled:k.value,variant:["primary"],loading:v.value,tabindex:"0",style:dn([{padding:"4px 8px",width:"100%"},{"letter-spacing":"-0.5px"}])},{default:me(()=>[...M[32]||(M[32]=[nt(" Create & Keep ",-1)])]),_:1},8,["disabled","loading"])],2)),[[U(o),k.value?"Enter a name and select a status to continue.":"Create and keep field values (⇧↵ Shift+Enter)"]]),Ke((j(),ce("div",{ref:$=>O($,"create"),class:te({[ye.$style["field-wrapper"]]:!0,[ye.$style.active]:S.value==="create",[ye.$style["field-button"]]:!0})},[pe(vt,{ref_key:"createRef",ref:E,onClick:M[27]||(M[27]=()=>de("clear")),onKeydown:[M[28]||(M[28]=zn($=>!k.value&&de("clear"),["enter"])),M[30]||(M[30]=zn($=>se($),["tab"]))],onFocus:M[29]||(M[29]=$=>S.value="create"),disabled:k.value,variant:["primary"],loading:v.value,tabindex:"0"},{default:me(()=>[...M[33]||(M[33]=[nt(" Create ",-1)])]),_:1},8,["disabled","loading"])],2)),[[U(o),k.value?"Enter a name and select a status to continue.":"Create and clear the fields (↵ Enter)"]])],2)],34)),[[jo,U(c).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"}}]]),aee=["innerHTML"],lee=["accept"],RO=_t(rt({__name:"FileUploader",props:{modelValue:{},acceptTypes:{default:()=>["xlsx","xls","csv"]}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const s=V(null),o=x=>`<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"/>
|
|
@@ -250,4 +250,4 @@ See ${UN(e,t)}`;return Array.isArray(s)?s.concat(i):[s,i]}var nge={1:"Charting A
|
|
|
250
250
|
If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),zf(c)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);zf(`to see all the valid ${s} properties please check: ${l}`)}}};function Ege(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]=QE({inputValue:i,allSuggestions:n}).values;return s}var _ge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Rge={moduleName:"Validation",version:ut,beans:[Sge]};function G2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var Dge=class extends We{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,G2(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],u=r||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(i.childrenAfterGroup[a],u):n(l,u)}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")}},Tge=class extends x0{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 Ft(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=di("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new Cd(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();id(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var r;const{beans:t}=this;if(Un(t)===this.eGui)return;const o=bu(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 Oe.UP:case Oe.DOWN:case Oe.LEFT:case Oe.RIGHT:if(t)return;_u(e);case Oe.ENTER:t&&Cu(this.eGui)&&e.preventDefault();break;case Oe.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&&fu(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,i=!!(o&&o.key===Oe.TAB);if(o&&i){const r=o.shiftKey;Cu(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 I0(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=!$o(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 c=i;let d="filter";c!=null&&c.afterFloatingFilter?d="ui":c!=null&&c.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),u=i?{...i,columns:i.columns??[],source:i.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,u)}})};[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:Ts(((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 Ige(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function xge(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var Fge={moduleName:"SharedMenu",version:ut,beans:[Hle],apiFunctions:{showColumnMenu:Ige,hidePopupMenu:xge}},Pge=class extends lae{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),u=n.clientWidth>0?n.clientWidth:200;r||(n.style.minWidth=`${u}px`,r=!0);const d=i.right-i.left-u;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-u}};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 pa(e)}},Sy={moduleName:"Popup",version:ut,beans:[Pge]},Age=".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 kge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function Oge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function Mge(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function Nge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function Lge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function Vge(e,t,n){const{gos:s,colModel:o,colFilter:i}=e;n&&!s.get("enableFilterHandlers")&&(Xe(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 $ge(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function Hge(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function Gge(e,t){var s;const n=e.colModel.getCol(t);if(!n){Sn(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function Uge(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){Xe(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 Wge={filterHandler:()=>({doesFilterPass:()=>!0})},zge=class extends We{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={...QL},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((u,c)=>{const d=e[c];r.push(this.setModelOnFilterWrapper(u,d)),l.delete(c)}),l.forEach(u=>{const c=s.getColDefCol(u)||s.getCol(u);if(!c){Xe(62,{colId:u});return}if(!c.isFilterAllowed()){Xe(63,{colId:u});return}const d=this.getOrCreateFilterWrapper(c,!0);if(!d){Xe(64,{colId:u});return}r.push(this.setModelOnFilterWrapper(d,e[u],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{r.push(this.setModelOnFilterWrapper(l,null))});jn.all(r).then(()=>{const l=this.getModel(!0),u=[];this.allColumnFilters.forEach((c,d)=>{const h=a?a[d]:null,f=l?l[d]:null;Of(h,f)||u.push(c.column)}),u.length>0?i==null||i.onFilterChanged({columns:u,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);dt(l)&&(t[a]=l)}),!e)for(const r of Object.keys(s)){const a=s[r];dt(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:Ts(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 Ts(this.model,n);const s=e.filter;return s?typeof s.getModel!="function"?(Xe(66),null):s.getModel():Ts(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=u=>u?u.isFilterActive?u.isFilterActive():(Xe(67),!1):!1,{colModel:t,gos:n}=this.beans,s=!!kE(n),o=u=>{if(!u.isPrimary())return!0;const d=!t.isPivotActive();return!u.isValueActive()||!d?!1:t.isPivotMode()?!0:s},i=[],r=[],a=(u,c,d)=>{c&&(o(u)?i.push(d):r.push(d))},l=[];return this.allColumnFilters.forEach(u=>{const c=u.column,d=c.getColId();if(u.isHandler)l.push(jn.resolve().then(()=>{a(c,this.isHandlerActive(c),{colId:d,isHandler:!0,handler:u.handler,handlerParams:u.handlerParams})}));else{const h=ll(u);h&&l.push(h.then(f=>{a(c,e(f),{colId:d,isHandler:!1,comp:f})}))}}),jn.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(jn.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const r=ll(o);r&&n.push(r.then(a=>{this.setColFilterActive(i,a.isFilterActive(),e,t)}))}}),(s=this.beans.groupFilter)==null||s.updateFilterFlags(e,t),jn.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 u=i[l],{colId:c,isHandler:d}=u;if(c!==t)if(d){const{handler:h,handlerParams:f}=u;if(!h.doesFilterPass({node:e,data:r,model:Ts(a,c),handlerParams:f}))return!1}else{const h=u.comp;if(typeof h.doesFilterPass!="function"){Sn(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,u;const{column:i,isHandler:r}=o;s!==i.getColId()&&(r&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(u=ll(o,r))==null||u.then(c=>{typeof(c==null?void 0:c.onAnyFilterChanged)=="function"&&c.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=ll(n,s);o&&t.push(o.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),jn.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():Ts(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=dt(Ts(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?ll(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=ll(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 Woe(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":Aae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,i){const r=()=>{const u=this.createFilterCompParams(e,o,i),c=s(u,o);return Kie(this.beans.userCompFactory,t,c,n)},a=r();return a?{compDetails:a,createFilterUi:u=>(u?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:u,createFilterUi:c}=l;return this.isGlobalButtons&&((h=(d=u.params)==null?void 0:d.buttons)!=null&&h.length||Xe(281,{colId:e.getColId()})),{compDetails:u,handler:i,handlerGenerator:a,handlerParams:r,createFilterUi:c}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:s}=this.beans;return Ft(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=Ts(this.model,a);r.model=l,r.state=this.state.get(a)??{model:l},r.onModelChange=(u,c)=>{this.updateStoredModel(a,u),this.refreshHandlerAndUi(e,u,"ui",!1,c).then(()=>{o({...c,source:"columnFilter"})})},r.onStateChange=u=>{this.updateState(e,u),this.updateOrRefreshFilterUi(e)},r.onAction=(u,c,d)=>{this.updateModel(e,u,c),this.dispatchLocalEvent({type:"filterAction",column:e,action:u,event:d})},r.getHandler=()=>this.getHandler(e,!0),r.onUiChange=u=>this.filterUiChanged(e,u),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:Ts(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,u=>{l.filter=u??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(wL(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"),u=l?a(t):void 0,c=p=>()=>this.createBean(i.createDynamicBean(p,!0));let d,h;if(typeof u=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[u];p!=null?d=p:Cae.has(u)&&(d=c(u),h=u)}else d=u;if(!d){let p;const{compName:g,jsComp:v,fwComp:C}=_L(o,t);g?p=g:v==null&&C==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=c(h))}return d?{filterHandler:d,handlerNameOrCallback:r??h}:l?(os(s)&&Xe(277,{colId:e.getColId()}),Wge):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=BE(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(Ft(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 Ft(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(ep(p))})},r=e.getColDef(),a=o!=null&&o.isSelectable(r)?o.getFilterDef(e,r):r,l=Lae(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",u=this.gos.get("enableFilterHandlers"),c=BE(n,a,this.createFilterCompParams(e,u,"init",!0)),d=Ft(this.gos,{column:e,filterParams:c,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t});if(u){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=Ts(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 Jie(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(u=>{this.destroyBean(u),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 jn.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,C,S,b,w,_;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,u=l!=null&&l.isSelectable(i)?l.getFilterDef(o,i):i,c=r?this.createHandlerFunc(o,u,this.getDefaultFilter(o)):void 0,d=!!c,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(r?this.createFilterComp(o,u,a,D=>D,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??BE(s.userCompFactory,u,this.createFilterCompParams(o,d,"colDef"));if(h){const D=(c==null?void 0:c.handlerNameOrCallback)??(c==null?void 0:c.filterHandler),T=Ts(this.model,e);if(n.handlerGenerator!=D){const I=n.handler,{handler:x,handlerParams:F}=this.createHandlerFromFunc(o,c.filterHandler,g);n.handler=x,n.handlerParams=F,n.handlerGenerator=D,delete this.model[e],(v=x.init)==null||v.call(x,{...F,source:"init",model:null}),this.destroyBean(I),T!=null&&((C=this.beans.filterManager)==null||C.onFilterChanged({columns:[o],source:t}))}else{const I=this.createHandlerParams(o,f==null?void 0:f.params);n.handlerParams=I,(b=(S=n.handler).refresh)==null||b.call(S,{...I,source:"colDef",model:T})}}if(this.areFilterCompsDifferent(((w=n.filterUi)==null?void 0:w.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,o,f,p);return}n.filterUi.filterParams=g,(_=ll(n,h))==null||_.then(D=>{(D!=null&&D.refresh?D.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),jn.resolve();if(!i.isHandler)return jn.resolve();const{filterUi:r,handler:a,handlerParams:l}=i;return bae(()=>{if(r){const{created:u,filterParams:c}=r;if(u)return r.promise.then(d=>d?{filter:d,filterParams:c}:void 0);r.refreshed=!0}return jn.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(ep(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:Ts(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:Ts(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):jn.resolve()}setColDefPropsForDataType(e,t,n){var c;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:u}=e;o==="agMultiColumnFilter"?{filterParams:i,filterValueGetter:r}=((c=a.multiFilter)==null?void 0:c.getParamsForDataType(l,u,t,n))??{}:{filterParams:i,filterValueGetter:r}=xae(o,l,u,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 jn(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=ll(e);if(o){o.then(i=>{if(typeof(i==null?void 0:i.setModel)!="function"){Xe(65),s();return}(i.setModel(t)||jn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){dt(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;nV(t,i,()=>Ts(this.model,s),()=>this.state.get(s),a=>this.updateState(e,a),a=>{var l,u;return(u=(l=i())==null?void 0:l.filterParams)==null?void 0:u.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&&nV(e,()=>s.filterUi,()=>Ts(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&&jn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();tV(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>Ts(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)!==Ts(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)!==Ts(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 jge(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function Kge(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var qge=class extends We{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(){kE(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):jn.resolve()).then(()=>{var i;const o={source:t,type:"filterChanged",columns:s};n&&so(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=!!kE(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(){Xe(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()}},Yge=class extends We{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,$o(this.gos),s)}showMenuAfterButtonClick(e,t,n,s){if(e&&!e.isColumn)return;let o=-1,i="left";const r=$o(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,u=>{var c;(c=this.popupSvc)==null||c.positionPopupByComponent({type:n,eventSource:t,ePopup:u,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 Tae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!(r!=null&&r.hasFilter())||!e){Sn(57);return}const a=rs({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 u=()=>r==null?void 0:r.afterGuiDetached(),c=zoe(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{DV(e,!1,"contextMenu");const C=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),C&&s&&mr(s)){const S=PL(s);S==null||S.focus({preventScroll:!0})}u(),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:c,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!==Oe.TAB||e.defaultPrevented||bu(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),Cu(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()}},Zge=class extends We{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=Ft(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)}},Xge={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},Jge=class extends wn{constructor(){super(Xge,[Yv]),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)}},r_=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:(Xe(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;Xe(73)}else Xe(74)}getCustomOption(e){return this.customFilterOptions[e]}};function fp(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function Ey(e){return e==null||typeof e=="string"&&e.trim().length===0}function Qge(e){return e==="AND"||e==="OR"?e:"AND"}function eme(e,t,n){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,n)}function tme(e,t){let n=e.length;return n>t&&(e.splice(t),Xe(78),n=t),n}function pp(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 a_=class extends Nae{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 r_;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=Qge(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&&ol(r.conditions,a.conditions,(l,u)=>this.areSimpleModelsEqual(l,u))}return i}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),jn.resolve();if(e.operator){const s=e;let o=s.conditions;o==null&&(o=[],Xe(77));const i=tme(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,u)=>{this.eTypes[u].setValue(l.type,!0),this.setConditionIntoUi(l,u)})}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()),jn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(Xe(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Xe(80),n=1),n>t&&(Xe(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new o0);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=rs({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 fre);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&&(Vf(this.eJoinPanels[0],i),this.eJoinAnds[0].setDisabled(i),this.eJoinOrs[0].setDisabled(i))}),this.eConditionBodies.forEach((s,o)=>{Bn(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=fp(e,t,n);for(const o of s)Vi(o)}removeComponents(e,t,n){const s=fp(e,t,n);for(const o of s)Vi(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 Su&&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),u=a<t;(l||u)&&(this.removeConditionsAndOperators(a,1),s=!0,u&&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 Su))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 Su&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){vL(e)&&Bn(e.getGui(),t)}setElementDisabled(e,t){vL(e)&&Vf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Su&&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=pp(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 pp(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}},U2=class{constructor(e,t,n,s,o,i){this.alive=!0,this.context=e,this.eParent=o;const r=qie(t,n,s);r&&r.newAgStackInstance().then(a=>{var c,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(c=a==null?void 0:a.afterGuiAttached)==null||c.call(a);const{tempValue:l,disabled:u}=this;l&&a.setDate(l),u!=null&&((d=a.setDisabled)==null||d.call(a,u)),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){Bn(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)}},l_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function W2(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&vo(n,void 0,!0)||null,s&&vo(s,void 0,!0)||null].slice(0,pp(o,t))}var z2=1e3,j2=1/0,nme=class extends a_{constructor(){super("dateFilter",W2,l_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=z2,this.maxValidYear=j2,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,u)=>{const c=e[l];if(c!=null)if(isNaN(c))Xe(82,{param:l});else return c==null?u:Number(c);return u},n=t("minValidYear",z2),s=t("maxValidYear",j2);this.minValidYear=n,this.maxValidYear=s,n>s&&Xe(83);const{minValidDate:o,maxValidDate:i}=e,r=o instanceof Date?o:vo(o);this.minValidDate=r;const a=i instanceof Date?i:vo(i);this.maxValidDate=a,r&&a&&r>a&&Xe(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,i=new U2(n,t,o.colDef,Ft(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=rs({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=rs({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),fp(this.eConditionPanelsFrom,e,t),fp(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const s=fp(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=Ho(s[0],!0,o)),s.length>1&&(n.dateTo=Ho(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)}},K2=class extends We{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new r_;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=lV(t)?t.conditions:[t];const r=(n==null?void 0:n.map(c=>typeof c=="string"?c:c.displayKey))??this.defaultOptions;if(!(!i||i.every(c=>r.find(d=>d===c.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const u=this.filterType;if((i&&!i.every(c=>c.filterType===u)||t.filterType!==u)&&(i=i.map(c=>({...c,filterType:u})),l=!0),typeof s=="number"&&i&&i.length>s&&(i=i.slice(0,s),l=!0),l){const c=i.length>1?{...t,filterType:u,conditions:i}:{...i[0],filterType:u};this.params={...e,model:c},e.onModelChange(c)}}individualConditionPasses(e,t,n){const s=this.optionsFactory,o=this.mapValuesFromModel(t,s),i=s.getCustomOption(t.type),r=eme(i,o,n);return r??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},q2=class extends K2{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 Ey(t);case"notBlank":return!Ey(t);default:return Xe(76,{filterModelType:s}),!0}}},Y2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},sme={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},u_=class extends We{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?ul(this,"filterSummaryInactive"):null;if(e.operator!=null){const i=e,a=(i.conditions??[]).map(u=>this.getModelAsString(u,t)),l=i.operator==="AND"?"andCondition":"orCondition";return a.join(` ${ul(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return s?ul(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:u}=r||{};return a&&l&&u===0?n(a,l):this.conditionToString(i,s,i.type==="inRange"||u===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=ul(this,a)),o&&i&&(r=this.getLocaleTextFunc()(o,i)),r!=null?t?`${r} ${ul(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)}},Z2=class extends u_{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=Y2}conditionToString(e,t,n,s,o){const{type:i}=e,r=vo(e.dateFrom),a=vo(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,u=t?this.formatValue.bind(this):h=>JE(h,l),c=()=>r!==null?u(r):"null",d=()=>a!==null?u(a):"null";if(t){const h=this.conditionForToolPanel(i,n,c,d,s,o);if(h!=null)return h}return n?`${c()}-${d()}`:r!=null?u(r):`${i}`}};function ome(e,t){const n=t;return n<e?-1:n>e?1:0}var ime=class extends q2{constructor(){super(W2,l_),this.filterType="date",this.FilterModelFormatterClass=Z2}comparator(){return this.params.filterParams.comparator??ome}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},X2=class extends wn{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 r_;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")}`}},rme={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"}]},ame=class extends X2{constructor(){super(rme,[Yv]),this.eReadOnlyText=ct,this.eDateWrapper=ct,this.FilterModelFormatterClass=Z2,this.filterType="date",this.defaultOptions=l_}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?vo(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Bn(this.eDateWrapper,e),Bn(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=Ho(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=f0(e,this.defaultDebounceMs);return Ft(this.gos,{onDateChanged:Os(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 U2(e,t,s.column.getColDef(),this.getDateComponentParams(),n,o=>{o.setInputAriaLabel(this.getAriaLabel(s))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},lme={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},ume=class extends wn{constructor(){super(lme,[Yv]),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&&il();const{minValidYear:s,maxValidYear:o,minValidDate:i,maxValidDate:r,buttons:a,includeTime:l,colDef:u}=e.filterParams||{},c=this.beans.dataTypeSvc,d=l??((h=c==null?void 0:c.getDateIncludesTimeFlag)==null?void 0:h.call(c,u.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",i&&s&&Xe(85),r&&o&&Xe(86),i&&r){const[f,p]=[i,r].map(g=>g instanceof Date?g:vo(g));f&&p&&f.getTime()>p.getTime()&&Xe(87)}i?i instanceof Date?t.min=JE(i):t.min=i:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=JE(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 vo(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(Ho(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}},c_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function d_(e){const{allowedCharPattern:t}=e??{};return t??null}function h_(e){return e==null||isNaN(e)?null:e}function J2(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[h_(n),h_(s)].slice(0,pp(o,t))}var cme=class extends a_{constructor(){super("numberFilter",J2,c_),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=d_(this.params),t=rs({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 Eu({allowedCharPattern:s}):new s0);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(h_(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=ia(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}},Q2=class extends u_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=Y2}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e,l=this.formatValue.bind(this);if(t){const u=this.conditionForToolPanel(a,n,()=>l(i),()=>l(r),s,o);if(u!=null)return u}return n?`${l(i)}-${l(r)}`:i!=null?l(i):`${a}`}},dme=class extends q2{constructor(){super(J2,c_),this.filterType="number",this.FilterModelFormatterClass=Q2}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},eB=class extends We{constructor(e){super(),this.params=e,this.eInput=ct,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new Eu((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 f_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function tB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,pp(o,t))}var hme={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},nB=class extends X2{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ct,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(hme)}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=ey(e.filterParams),!o){const i=f0(e.filterParams,s),r=Os(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();ks(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Oe.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=f_(r),s.setValue(r,!0)),n){const a=o,l=a.model,u=this.convertValue(r),c=u==null?null:{...l??{filterType:this.filterType,type:i??this.optionsFactory.defaultOption},filter:u};a.onModelChange(c,{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)}},fme=class extends We{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new s0),this.eTextInput=this.createManagedBean(new Eu),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)}},pme=class extends nB{constructor(){super(...arguments),this.FilterModelFormatterClass=Q2,this.filterType="number",this.defaultOptions=c_}updateParams(e){d_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=d_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new eB({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new fme)}convertValue(e){return e?Number(e):null}},p_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],gme=class extends a_{constructor(){super("textFilter",tB,p_),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(ia(n.getValue()))}),t}createEValue(){const e=rs({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 Eu);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)}},sB=class extends u_{constructor(){super(...arguments),this.filterTypeKeys=sme}conditionToString(e,t,n,s,o){const{filter:i,filterTo:r,type:a}=e;if(t){const l=c=>()=>ul(this,"filterSummaryTextQuote",[c]),u=this.conditionForToolPanel(a,n,l(i),l(r),s,o);if(u!=null)return u}return n?`${i}-${r}`:i!=null?`${i}`:`${a}`}},mme=({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}},vme=e=>e,yme=e=>e==null?null:e.toString().toLowerCase(),wme=class extends K2{constructor(){super(tB,p_),this.filterType="text",this.FilterModelFormatterClass=sB}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??mme,this.formatter=t.textFormatter??(t.caseSensitive?vme:yme)}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:u,filterParams:{textFormatter:c}}=this.params;if(n.type==="blank")return Ey(t);if(n.type==="notBlank")return!Ey(t);const d={api:r,colDef:a,column:l,context:u,node:s.node,data:s.data,filterOption:n.type,value:i,textFormatter:c};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=f_(o)??null),i&&(s.filterTo=f_(i)??null),s};return lV(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},Cme=class extends nB{constructor(){super(...arguments),this.FilterModelFormatterClass=sB,this.filterType="text",this.defaultOptions=p_}createFloatingFilterInputService(){return this.createManagedBean(new eB)}};function bme(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function Sme(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function Eme(e){var t;(t=e.quickFilter)==null||t.resetCache()}var _me=class extends We{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(u=>u.isVisible()||u.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 dt(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Xe(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 dt(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=Ft(this.gos,{value:n,node:t,data:t.data,column:e,colDef:s});n=s.getQuickFilterText(o)}return dt(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const s=this.getTextForColumn(n,e);dt(s)&&t.push(s)}return t.join(`
|
|
251
251
|
`)}},Rme={moduleName:"ClientSideRowModelFilter",version:ut,rowModels:["clientSide"],beans:[Dge]},g_={moduleName:"FilterCore",version:ut,beans:[qge],apiFunctions:{isAnyFilterPresent:jge,onFilterChanged:Kge},css:[Age],dependsOn:[Rme]},oB={moduleName:"FilterValue",version:ut,beans:[Zge]},_y={moduleName:"ColumnFilter",version:ut,beans:[zge,Yge],dynamicBeans:{headerFilterCellCtrl:Tge},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:kge,getColumnFilterInstance:Oge,destroyFilter:Mge,setFilterModel:Nge,getFilterModel:Lge,getColumnFilterModel:Vge,setColumnFilterModel:Bge,showColumnFilter:$ge,hideColumnFilter:Hge,getColumnFilterHandler:Gge,doFilterAction:Uge},dependsOn:[g_,Sy,oB,Fge]},Dme={moduleName:"CustomFilter",version:ut,userComponents:{agReadOnlyFloatingFilter:Jge},dependsOn:[_y]},Tme={moduleName:"TextFilter",version:ut,dependsOn:[_y],userComponents:{agTextColumnFilter:{classImp:gme,params:{useForm:!0}},agTextColumnFloatingFilter:Cme},dynamicBeans:{agTextColumnFilterHandler:wme}},Ime={moduleName:"NumberFilter",version:ut,dependsOn:[_y],userComponents:{agNumberColumnFilter:{classImp:cme,params:{useForm:!0}},agNumberColumnFloatingFilter:pme},dynamicBeans:{agNumberColumnFilterHandler:dme}},xme={moduleName:"DateFilter",version:ut,dependsOn:[_y],userComponents:{agDateColumnFilter:{classImp:nme,params:{useForm:!0}},agDateInput:ume,agDateColumnFloatingFilter:ame},dynamicBeans:{agDateColumnFilterHandler:ime}},Fme={moduleName:"QuickFilterCore",version:ut,rowModels:["clientSide"],beans:[_me],dependsOn:[g_,oB]},Pme={moduleName:"QuickFilter",version:ut,apiFunctions:{isQuickFilterPresent:bme,getQuickFilter:Sme,resetQuickFilter:Eme},dependsOn:[Fme]},Ame={moduleName:"ExternalFilter",version:ut,dependsOn:[g_]},kme=".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}}",m_=(e,t,n)=>{var a,l,u;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=(u=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:u.errorMessages,r=o||i;return r!=null&&r.length?r.join(n("tooltipValidationErrorSeparator",". ")):void 0},Ome=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,i=i_(o),{column:r,eGui:a}=t,l=r.getColDef();!s&&i&&!l.headerComponent&&(s=xv(()=>a.querySelector(".ag-header-cell-text")));const u="header",d=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>u,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:u,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=i_(o),{column:r,eGui:a}=t,l=r.getColGroupDef();!s&&i&&!(l!=null&&l.headerGroupComponent)&&(s=xv(()=>a.querySelector(".ag-header-group-text")));const u="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>u,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:u,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 u=()=>{const f=!!!(i!=null&&i.isEditing(e))&&m_(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=r.getColDef(),g=a.data;if(p.tooltipField&&dt(g))return up(g,p.tooltipField,r.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Ft(o,{location:"cell",colDef:r.getColDef(),column:r,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},c=i_(o);n||(c&&!e.isCellRenderer()?n=()=>{const h=!!(i!=null&&i.isEditing(e));if(!h&&m_(s,e,this.getLocaleTextFunc()))return!0;if(!r.isTooltipEnabled())return!1;const g=xv(()=>{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:u,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:()=>m_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:u}=n,c=(p=u==null?void 0:u.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=u==null?void 0:u.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!c&&c.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=dt(t.tooltipField)||dt(t.tooltipValueGetter)||dt(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},Mme=class extends iae{createTooltipComp(e,t){const n=Xie(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}},iB={moduleName:"Tooltip",version:ut,beans:[Ome],dynamicBeans:{tooltipFeature:zL,highlightTooltipFeature:rae,tooltipStateManager:Mme},userComponents:{agTooltipComponent:uae},dependsOn:[Sy],css:[kme]},Id=class{constructor(e){this.cellValueChanges=e}},v_=class extends Id{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},Nme=10,rB=class{constructor(e){this.actionStack=[],this.maxStackSize=e||Nme,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}},Lme=class extends We{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&&GV(this.activeCellEdit,t),s=this.activeRowEdit!==null&&rce(this.activeRowEdit,t);if(!(n||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:i,rowIndex:r,column:a,oldValue:l,value:u}=e,c={rowPinned:i,rowIndex:r,columnId:a.getColId(),newValue:u,oldValue:l};this.cellValueChanges.push(c)},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 rB(n),this.redoStack=new rB(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 v_?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=ga(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=ga(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 u={rowIndex:t,column:a,rowPinned:s};i.setFocusedCell({...u,forceBrowserFocus:!0}),r==null||r.setRangeToCell(u)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Id(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 Id(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Id(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new v_(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&&aa(n)?e=new v_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Id(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 Id(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},Vme=".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"}]},$me=class extends dy{constructor(){super(Bme,[n0]),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=Rv(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}},Ry=class extends dy{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===Oe.BACKSPACE||o===Oe.DELETE?r="":o&&o.length===1?i?a=!1:r=o:(r=t.getStartValue(),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&r!=null&&n.setStartValue(r),this.addGuiEventListener("keydown",l=>{const{key:u}=l;(u===Oe.PAGE_UP||u===Oe.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;il()||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()}},Hme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Gme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Hme}getAgComponents(){return[kL]}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 u=l.toLocaleDateString();r.push(a("minDateValidation",`Date must be after ${u}`,[u]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const u=l.toLocaleDateString();r.push(a("maxDateValidation",`Date must be before ${u}`,[u]))}}}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!dt(n)&&!dt(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Ho(e,this.includeTime??!1)}},Ume=class extends Ry{constructor(){super(new Gme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Wme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},zme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Wme}getAgComponents(){return[kL]}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),u=this.getLocaleTextFunc();if(o){const c=new Date(o);if(l<c){const d=c.toLocaleDateString();a.push(u("minDateValidation",`Date must be after ${d}`,[d]))}}if(i){const c=new Date(i);if(l>c){const d=c.toLocaleDateString();a.push(u("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!dt(n)&&!dt(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Ho(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):vo(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Ho(e??null,this.includeTime??!1)??void 0}},jme=class extends Ry{constructor(){super(new zme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},Kme={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},qme=class extends dy{constructor(){super(Kme,[gre]),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===Oe.BACKSPACE||s===Oe.DELETE?a="":s&&s.length===1?a=s:(a=this.getStartValue(e),s!==Oe.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===Oe.LEFT||t===Oe.UP||t===Oe.RIGHT||t===Oe.DOWN||e.shiftKey&&t===Oe.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!dt(s)&&!dt(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}},Yme={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},Zme=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Yme}getAgComponents(){return[mre]}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===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!dt(n)&&!dt(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(){il()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},Xme=class extends Ry{constructor(){super(new Zme(()=>this.getLocaleTextFunc()))}},Jme={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},Qme=class extends dy{constructor(){super(Jme,[Tre]),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(Vn(o)){Xe(58);return}this.startedByEnter=r!=null?r===Oe.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:u,valueListMaxHeight:c}=e;l!=null&&t.setPickerGap(l),c!=null&&t.setPickerMaxHeight(c),u!=null&&t.setPickerMaxWidth(u),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}},eve={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},tve=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return eve}getAgComponents(){return[Yv]}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!dt(n)&&!dt(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(){il()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=dt(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},aB=class extends Ry{constructor(){super(new tve(()=>this.getLocaleTextFunc()))}};function nve(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function sve(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function lB(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function uB(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function ove(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function ive(e){var t;(t=e.undoRedo)==null||t.undo("api")}function rve(e){var t;(t=e.undoRedo)==null||t.redo("api")}function ave(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function lve(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,u)=>{const{editorValue:c,pendingValue:d,sourceValue:h,state:f}=l,p=ma(l);let g=c??d;g===fi&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:u,colId:u.getColId(),colKey:u.getColId(),rowIndex:r,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function uve(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 Iu(e,{persist:!0});Rd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function cve(e,t){var s;const n=Wn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function dve(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:i}=t,{editSvc:r,colModel:a}=e,l=a.getCol(s);if(!l){Xe(12,{colKey:s});return}const c=ga(e,{rowIndex:o,rowPinned:i||null});if(!c){Xe(290,{rowIndex:o,rowPinned:i});return}if(!l.isCellEditable(c))return;i==null&&uB(e,o),lB(e,s),r==null||r.startEditing({rowNode:c,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function hve(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function fve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function pve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var gve={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},mve=class extends $E{constructor(e){super(gve),this.params=e}postConstruct(){vu(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{b0(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function vve(e,{column:t},n,s,o="ui"){var u;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&s))return!0;if((n==null?void 0:n.shiftKey)&&((u=e.rangeSvc)==null?void 0:u.getCellRanges().length)!=0)return!1;const r=t==null?void 0:t.getColDef(),a=yve(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 yve(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function y_(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 wve(e,t,n="ui"){const s=y_(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(i=>y_(e,{rowNode:t.rowNode,column:i},n))}var Dy=(e,t=!1)=>{if(e!==void 0)return ma(e)||t&&e.state==="editing"};function cB(e,t,n=!1){var s;return Dy((s=e.editModelSvc)==null?void 0:s.getEdit(t),n)}var dB=(e,t,n)=>{if(e)for(let s=0,o=e.length;s<o;++s){const i=e[s];if(i.data&&(Dy(t==null?void 0:t.getEdit({rowNode:i,column:n}))||Dy(t==null?void 0:t.getEdit({rowNode:i.pinnedSibling,column:n})))||dB(i.childrenAfterGroup,t,n))return!0}};function hB(e,t){const{column:n,rowNode:s}=t;return e.gos.get("groupTotalRow")&&!(s!=null&&s.footer)?!1:dB(s==null?void 0:s.childrenAfterGroup,e.editModelSvc,n)}function fB(e,{rowNode:t,column:n}){var s;if(t=t.pinnedSibling,!!t)return Dy((s=e.editModelSvc)==null?void 0:s.getEdit({rowNode:t,column:n}))}var Cve=class extends We{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=cB(n,e)||hB(n,e)||fB(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)}},bve=class extends We{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 u={rowNode:s,column:l};return cB(n,u,!0)||hB(n,u)||fB(n,u)});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)})}},Sve=({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},Eve=({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}))},_ve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());Eve(e,Sve(e,s),t)},Rve=new Set(["undo","redo","paste","bulk","rangeSvc"]),Dve=new Set(["ui","api"]),pB={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},Tve=new Set(Object.keys(pB)),Ive=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Ty={cancel:!0,source:"api"},xve={cancel:!1,source:"api"},xd={checkSiblings:!0},gp={force:!0,suppressFlash:!0},Fve=class extends We{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,Ty),this.createStrategy(s)});const t=_ve(e),n=()=>{const s=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return s||o?this.stopEditing(void 0,Ty):this.isEditing()&&(this.isBatchEditing()?Rd(e,this.model.getEditPositions()):this.stopEditing(void 0,xve)),!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,Ty)):(this.stopEditing(void 0,Ty),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:s}=this,o=gB(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=vve(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 zfe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??xd)}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=Wn(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,C,S;const{event:n,cancel:s,source:o="ui",forceCancel:i,forceStop:r}=t||{},{beans:a,model:l}=this;if(Tve.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const u=this.committing?pB[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,xd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Wn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!s&&(!!this.shouldStopEditing(e,n,u)||this.committing&&!this.batch)||(r??!1),g=s&&!!this.shouldCancelEditing(e,n,u)||(i??!1);if(p||g){Iu(a,{persist:!0,isCancelling:g||s,isStopping:p});const b=l.getEditMap(),w=this.processEdits(b,s,o);(v=this.strategy)==null||v.stop(s,n);for(const _ of w)l.clearEditValue(_);this.bulkRefresh(void 0,h);for(const _ of l.getEditPositions(b)){const D=Wn(a,_),T=ma(_);D==null||D.refreshCell({force:!0,suppressFlash:!T})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((C=this.strategy)!=null&&C.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,w=b===Oe.ENTER,_=b===Oe.ESCAPE,D=b===Oe.TAB;(w||D||_)&&(w||D?Iu(a,{persist:!0}):_&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():Rd(a,l.getEditPositions(),{event:n,cancel:_}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else Iu(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),X0(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 u;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!==Oe.ENTER||!a)return;const l=r?Oe.UP:Oe.DOWN;(u=this.beans.navigation)==null||u.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 u=a.get(l),c={rowNode:r,column:l},d=ma(u);!t&&d&&!o&&(this.setNodeDataValue(r,l,u.pendingValue,void 0,n)||i.push(c))}}return i}setNodeDataValue(e,t,n,s,o="edit"){const{beans:i}=this,r=Wn(i,{rowNode:e,column:t}),a=Dve.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(gp)),l}setEditMap(e,t){var s;this.strategy??(this.strategy=this.createStrategy()),(s=this.strategy)==null||s.setEditMap(e,t),this.bulkRefresh();let n=gp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...Pve(e),...gp}),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;os(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,u)=>{for(const c of l.keys())this.refCell({rowNode:u,column:c},l.get(c),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 u=e.sibling;u&&a.add(u);let c=e.parent;for(;c;)(d=c.sibling)!=null&&d.footer&&i.get("groupTotalRow")||!c.parent&&c.sibling&&i.get("grandTotalRow")?a.add(c.sibling):a.add(c),c=c.parent;for(const p of r)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of r)(h=Wn(o,{rowNode:p,column:t}))==null||h.refreshCell(s);for(const p of a)(f=Wn(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=gB(s)==="fullRow"?wve(o,e,t):y_(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=Wn(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=Wn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(Rd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),_d(this.beans,e,{silent:!0}),xu(this.beans),n==null||n.refreshCell(gp),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;xu(this.beans);const t=Wn(this.beans,e);t&&(t.refreshCell(gp),(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 Dd&&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===fi||!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 mve(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!Ive.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||Rve.has(n))return yy(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 yy(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 yy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:i,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){Gfe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,xd))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,xd),{compDetails:i}}const a=this.model.getEditRow(e.rowNode,xd);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 Ft(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 u,c;if(!n||n.length===0)return;const{beans:s,rangeSvc:o,valueSvc:i}=this;Iu(s,{persist:!0});const r=this.model.getEditMap(!0),a=(c=(u=r.get(e))==null?void 0:u.get(t))==null?void 0:c.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(o==null||o.forEachRowInRange(d,h=>{const f=ga(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 C=i.parseValue(g,f??null,a,v);Number.isNaN(C)&&(C=null),p.set(g,{editorValue:void 0,pendingValue:C,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(),X0(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=Wn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new Cve(e,t)}createRowStyleFeature(e,t){return new bve(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:u,rowPinned:c,newValue:d,state:h}of e){const f=r?s.getCol(r):l?s.getCol(l):a;if(!f)continue;const p=ga(n,{rowIndex:u,rowPinned:c});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!ma({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=i.get(p);v||(v=new Map,i.set(p,v)),d===void 0&&(d=fi),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=Wn(this.beans,e);if(!t||!this.isEditing(t,xd))return;const n=this.model.getEdit(t);if(!n||!ma(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(i=this.beans.ariaAnnounce)==null||i.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Wn(this.beans,e)}};function Pve(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 gB(e,t){return t??e.get("editType")??"singleCell"}var mB=class extends We{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=Wn(o,n));const{gos:r,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:u,rowIndex:c,rowPinned:d}=e,h={column:u,rowNode:ga(o,{rowIndex:c,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)wy(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)wy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(r.keep.length>0)for(const a of r.keep){const l=Wn(this.beans,a);(i=this.editSvc)!=null&&i.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){Iu(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);Rd(this.beans,s),X0(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;Hfe(this.beans,i,o,r,t,s)}dispatchCellEvent(e,t,n,s){const o=Wn(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,n),...s})}dispatchRowEvent(e,t,n){if(n)return;const s=Y0(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===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!s&&t.key===Oe.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===fi?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:i}),source:"api"});const r=Wn(this.beans,o);r&&this.setFocusInOnEditor(r)}}destroy(){this.cleanupEditors(),super.destroy()}},Ave=class extends mB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!Y0(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=[],u=[];for(const c of a)c.isCellEditable(r)&&u.push(c);if(u.length!=0){this.dispatchRowEvent({rowNode:r},"rowEditingStarted",n),this.startedRows.push(r);for(const c of u){const d={rowNode:r,column:c};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(ma(a)){s.push(r);break}}}),xu(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=Wn(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(),u=r.isCellEditable(),c=a&&i.rowIndex===a.rowIndex&&i.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return u&&!o?d?r.focusCell(!0,n):((f=r.comp)!=null&&f.getCellEditor()||_d(this.beans,r,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,n)):(u&&o&&this.setFocusInOnEditor(r),r.focusCell(!0,n)),!c&&!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=Wn(this.beans,{rowNode:t,column:s});o&&!((i=o.comp)!=null&&i.getCellEditor())&&_d(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},kve=class extends mB{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=ga(this.beans,{rowIndex:s,rowPinned:i}),a=Z0(o),l=t.getCol(a),u=e.previousParams;if(u){const c=Z0(u.column);if((u==null?void 0:u.rowIndex)===s&&c===a&&(u==null?void 0:u.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,C,S,b;const i=this.beans.focusSvc.getFocusedCell();i&&(e=Sd(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 u=a.cellPosition,c=e.isCellEditable(),d=a.isCellEditable(),h=u&&r.rowIndex===u.rowIndex&&r.rowPinned===u.rowPinned;c&&!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(!((C=a.comp)!=null&&C.getCellEditor())){const w=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});_d(this.beans,a,{event:n,cellStartedEdit:!0,silent:w}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&o&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(b=e.rowCtrl)==null||b.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},fl={moduleName:"EditCore",version:ut,beans:[Vfe,Fve],apiFunctions:{getEditingCells:lve,getEditRowValues:ave,getCellEditorInstances:$fe,startEditingCell:dve,stopEditing:uve,isEditing:cve,validateEdit:hve},dynamicBeans:{singleCell:kve,fullRow:Ave},dependsOn:[Sy,iB],css:[Vme]},Ove={moduleName:"UndoRedoEdit",version:ut,beans:[Lme],apiFunctions:{undoCellEditing:ive,redoCellEditing:rve,getCurrentUndoSize:fve,getCurrentRedoSize:pve},dependsOn:[fl]},Mve={moduleName:"TextEditor",version:ut,userComponents:{agCellEditor:aB,agTextCellEditor:aB},dependsOn:[fl]},Nve={moduleName:"NumberEditor",version:ut,userComponents:{agNumberCellEditor:{classImp:Xme}},dependsOn:[fl]},Lve={moduleName:"DateEditor",version:ut,userComponents:{agDateCellEditor:Ume,agDateStringCellEditor:jme},dependsOn:[fl]},Vve={moduleName:"CheckboxEditor",version:ut,userComponents:{agCheckboxCellEditor:$me},dependsOn:[fl]},Bve={moduleName:"SelectEditor",version:ut,userComponents:{agSelectCellEditor:Qme},dependsOn:[fl]},$ve={moduleName:"LargeTextEditor",version:ut,userComponents:{agLargeTextCellEditor:qme},dependsOn:[fl]},Hve={moduleName:"CustomEditor",version:ut,dependsOn:[fl]},Gve=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,fd(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),Qoe(e))}createColumns(e,t){var h,f;const n=()=>{var p;Gv(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(Joe(r,((f=this.columns)==null?void 0:f.list)??[])&&i)return;n();const{colGroupSvc:l}=this.beans,u=(l==null?void 0:l.findDepth(e.tree))??0,c=(l==null?void 0:l.balanceTreeForAutoCols(r,u))??[];this.columns={list:r,tree:c,treeDepth:u,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!ua(v));return[...r,...g]})}updateColumns(e){var n;const t=fd(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),$i(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>Xf(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"||!gu(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=!!hd(n),i=Nv(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,u,c){const d=u.isSelected(),h=c.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...r,colId:oL,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new yu(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const s=t&&typeof t!="string"?hd(t):void 0,o=e&&typeof e!="string"?hd(e):void 0,i=s!==o,r=t&&typeof t!="string"?Nv(t):void 0,a=e&&typeof e!="string"?Nv(e):void 0,l=r!==a,u=Lv(e),c=Lv(t);(i||l||u!==c)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Gv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,u;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 c;switch(o.pinned){case"left":case!0:c=e;break;case"right":c=n;break;default:c=t}c&&Bi(c,o)};(((u=this.beans.rowNumbersSvc)==null?void 0:u.getColumn(iL))?2:1)===s&&i()}};function Uve(e,t){var r;if(!t.nodes.every(a=>a.rowPinned&&!rp(a)?(Xe(59),!1):a.id===void 0?(Xe(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 Wve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function zve(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function jve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function Kve(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function qve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function Yve(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function Zve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function Xve(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var Jve=class extends due{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=Vv(e),this.groupSelectsDescendants=Yf(e),this.groupSelectsFiltered=Bv(e)==="filteredDescendants",this.masterSelectsDetail=QN(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Yf(e),n=Vv(e),s=Bv(e)==="filteredDescendants";this.masterSelectsDetail=QN(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?yB(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 u;if(s.length===0)return 0;const{gos:a}=this;if(!gu(a)&&e)return Xe(132),0;if(s.length>1&&!this.isMultiSelect())return Xe(130),0;let l=0;for(let c=0;c<s.length;c++){const d=s[c],h=Fd(d);if(h.rowPinned&&!rp(h)){Xe(59);continue}if(h.id===void 0){Xe(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,i)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((u=h.childrenAfterGroup)!=null&&u.length)&&(l+=this.selectChildren(h,e,i))}return n||(s.length===1&&i==="api"&&this.selectionCtx.setRoot(Fd(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Fd(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=Fd(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(!os(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new lp(!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?!eye(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 al(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(!os(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=os(this.gos);let s=!1;const o=i=>{const r=this.selectRowNode(Fd(i),!1,void 0,e);s||(s=r)};if(t==="currentPage"||t==="filtered"){if(!n){Sn(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 vB(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(!gu(t)){Xe(132);return}if(Boe(t)&&!qf(t)){Xe(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(Fd(r),!0,void 0,s);i||(i=a)}),n.selectAll=!0,os(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)){Sn(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 os(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!gu(t))return;const s="selectableChanged",o=e!==void 0,i=os(t)&&this.groupSelectsDescendants,r=[],a=u=>{var d;if(o&&!u.group)return;if(i&&u.group){const h=((d=u.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(u,h,!0);return}!this.updateRowSelectable(u,!0)&&u.isSelected()&&r.push(u)};if(i){if(e===void 0){const u=n.rootNode;e=u?new lp(!1,u):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=Qve(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(!qf(t)){Xe(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 Fd(e){return rp(e)?e.pinnedSibling:e.footer?e.sibling:e}function Qve(e){let t=0,n=0;return e.forEachNode(s=>{s.isSelected()?t++:s.selectable&&n++}),vB(t,n)}function vB(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function eye(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function yB(e){var s;const t=e.isSelected()===!1,n=((s=e.childrenAfterFilter)==null?void 0:s.some(yB))??!1;return t||n}var tye={moduleName:"SharedRowSelection",version:ut,beans:[Gve],apiFunctions:{setNodesSelected:Uve,selectAll:Wve,deselectAll:zve,selectAllFiltered:jve,deselectAllFiltered:Kve,selectAllOnCurrentPage:qve,deselectAllOnCurrentPage:Yve,getSelectedNodes:Zve,getSelectedRows:Xve}},nye={moduleName:"RowSelection",version:ut,rowModels:["clientSide","infinite","viewport"],beans:[Jve],dependsOn:[tye]};function sye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function oye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function wB(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function CB(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Xe(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function iye(e,t,n){var o,i;const s=rge(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){Sn(238);return}s.setRowCount(t,n);return}Sn(28);return}(i=by(e))==null||i.setRowCount(t,n)}function rye(e){var t;return ud(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function aye(e){return e.rowModel.isLastRowIndexKnown()}var lye={moduleName:"CsrmSsrmSharedApi",version:ut,apiFunctions:{expandAll:sye,collapseAll:oye}},uye={moduleName:"RowModelSharedApi",version:ut,apiFunctions:{onRowHeightChanged:wB,resetRowHeights:CB}},cye={moduleName:"SsrmInfiniteSharedApi",version:ut,apiFunctions:{setRowCount:iye,getCacheBlockState:rye,isLastRowIndexKnown:aye}},dye=class extends We{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){Sn(18),t||Sn(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||Sn(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":Xe(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}));$i(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));$i(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));$i(s,{state:d},"alignedGridChanged")}break;case"columnResized":{const c=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of c.flexColumns??[])d[h.getId()]&&delete d[h.getId()];o==null||o.setColumnWidths(Object.values(d),!1,c.finished,"alignedGridChanged");break}}const u=i.getGridBodyCtrl().isVerticalScrollShowing();for(const c of this.getAlignedGridApis())c.setGridOption("alwaysShowVerticalScroll",u)}},hye={moduleName:"AlignedGrids",version:ut,beans:[dye],dependsOn:[o2]},fye=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},bB(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=bB(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,u=(c,d)=>{const h=c.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=c;const C=a(g);C&&u(v,C)}}};u(o,e),i.length=r}setImmutableRowData(e,t){var C;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=dd(s),i=e.changedRowNodes,{adds:r,updates:a}=i,l=new Set,u=[],c=(C=this.beans.groupStage)==null?void 0:C.getNestedDataGetter();let d=s.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const w=S.sourceRowIndex;d=w<=h,h=w}S.data!==b&&(S.updateData(b),r.has(S)||a.add(S),!S.selectable&&S.isSelected()&&u.push(S))},g=(S,b,w)=>{for(let _=0,D=b.length;_<D;++_){const T=b[_];if(!T)continue;let I=this.getRowNode(o({data:T,level:w}));if(I?(p(I,T),f||(f=!!c&&I.treeParent!==S)):(I=this.createRowNode(T,w),r.add(I)),!c||l.has(I)){l.add(I);continue}l.add(I),I.treeParent=S;const x=c(T);x&&g(I,x,w+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,i,u)||d||r.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?yye(S,l,i):vye(S,l)&&(i.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(u))}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 Xe(268),{remove:[],update:[],add:[]};const n=[],s=dd(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 u=0,c=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<c&&(c=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[u++]=g}return f.length=u,u&&mye(r,c,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 u=t[l],c=this.lookupNode(e,u);c&&(c.updateData(u),!c.selectable&&c.isSelected()&&o.push(c),r[a++]=c,n.has(c)||s.add(c))}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 u=new Array(r),c=t.adds;for(let d=0;d<r;d++){const h=this.createRowNode(i[d],0);c.add(h),h.sourceRowIndex=l,s[l]=h,u[d]=h,l++}return u}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 al(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]&&Xe(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 gye(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(Sn(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=pye(e,t)),t}},pye=(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},bB=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},gye=(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 Sn(5,{data:t}),null},mye=(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},vye=(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},yye=(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},SB=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"))}},wye=class extends We{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:u}=this.beans,c=o.get("groupMaintainOrder"),d=i.getCols().some(S=>S.isRowGroupActive()),h=r==null?void 0:r.columns,f=i.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const C=S=>{var D,T;const b=f&&S.leafGroup;let w=c&&d&&!S.leafGroup;w&&(v??(v=this.shouldSortContainsGroupCols(e)),w&&(w=!v));let _=null;if(w){let I=!1;if(h){const x=S.level+1;x<h.length&&(I=h[x].getSort()===null)}I||(_=Sye(S))}else!e.length||b||(t&&n?_=Cye(a,S,n,s,e):_=a.doFullSort(S.childrenAfterAggFilter,e));if(_||(_=((D=S.childrenAfterAggFilter)==null?void 0:D.slice(0))??[]),g||(g=((T=S.childrenAfterSort)==null?void 0:T[0])!==_[0]),S.childrenAfterSort=_,SB(S),p){const I={nodes:S.childrenAfterSort};p(I)}};if(s==null||s.forEachChangedNodeDepthFirst(C),g&&o.get("groupHideOpenParents")){const S=u==null?void 0:u.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Cr(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}},Cye=(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:u,adds:c}=n;for(let h=0,f=i.length;h<f;++h){const p=i[h];u.has(p)||c.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)),bye(e,o,l,d)},bye=(e,t,n,s)=>{let o=0,i=0;const r=n.length,a=s.length,l=new Array(r+a);let u=0;for(;o<r&&i<a;){const c=n[o],d=s[i];e.compareRowNodes(t,c,d)<0?(l[u++]=c.rowNode,++o):(l[u++]=d.rowNode,++i)}for(;o<r;)l[u++]=n[o++].rowNode;for(;i<a;)l[u++]=s[i++].rowNode;return l},Sye=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 u=t[l];r.delete(u)&&(i[a++]=u)}if(r.size===0&&a===s)return t;for(const l of r)i[a++]=l;return i.length=a,i},Eye=class extends We{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=Os(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new al(e);this.rootNode=t,this.nodeManager=this.createBean(new fye(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),u=Math.min(a,s);for(let c=l;c<=u;c++){const d=this.getRow(c);if(d.rowHeightEstimated){const h=nl(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,Xe(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 fy,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const u=l.rowDataUpdated?"group":this.getRefreshedStage(e);u&&(l.step=u,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=Ms(this.gos,"normal");for(let r=0,a=n.length;r<a;++r){const l=n[r],u=l.id;if(u!=null&&(e==null||e.add(u)),l.rowHeight==null){const c=nl(t,l,i,s);l.setRowHeight(c.height,c.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 c=0,d=a.length;c<d;++c)o(a[c])},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 u=i[l];if(this.gos.get("groupHideOpenParents"))for(;u.expanded&&u.childrenAfterSort&&u.childrenAfterSort.length>0;)u=u.childrenAfterSort[0];return u.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:cd(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:cd(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:cd(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new lp(!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 u,c;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,(u=n.masterDetailSvc)==null||u.refreshModel(e),r&&e.step!=="group"&&((c=n.colFilter)==null||c.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=Yf(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(s)return;if(n&&(r===t||r===e)&&(s=!0,i&&r.group)){EB(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),u=t[l];if(this.isRowInPixel(u,e)||(u.rowTop<e?s=l+1:u.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 u of a)i=this.depthFirstSearchRowNodes(e,t,n,u,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),SB(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,G2(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(c0)===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 fy;for(const{rowDataTransaction:l,callback:u}of s??[]){this.rowNodesCountReady=!0;const c=e.updateRowData(l,r);o.push(c),u&&i.push(u.bind(null,c))}this.commitTransactions(r),i.length>0&&setTimeout(()=>{for(let l=0,u=i.length;l<u;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 fy,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()}},EB=(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&&EB(e,i)}};function _ye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function Rye(e,t){const n=hl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function Dye(e){var t;return((t=hl(e))==null?void 0:t.isEmpty())??!0}function Tye(e,t){var n;(n=hl(e))==null||n.forEachLeafNode(t)}function Iye(e,t){var n;(n=hl(e))==null||n.forEachNodeAfterFilter(t)}function xye(e,t){var n;(n=hl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function Fye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=hl(e))==null?void 0:n.updateRowData(t)})}function Pye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=hl(e))==null?void 0:s.batchUpdateRowData(t,n)})}function Aye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=hl(e))==null?void 0:t.flushAsyncTransactions()})}function kye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var _B={moduleName:"ClientSideRowModel",version:ut,rowModels:["clientSide"],beans:[Eye,wye],dependsOn:[k2]},Oye={moduleName:"ClientSideRowModelApi",version:ut,apiFunctions:{onGroupExpandedOrCollapsed:_ye,refreshClientSideRowModel:Rye,isRowDataEmpty:Dye,forEachLeafNode:Tye,forEachNodeAfterFilter:Iye,forEachNodeAfterFilterAndSort:xye,applyTransaction:Fye,applyTransactionAsync:Pye,flushAsyncTransactions:Aye,getBestCostNodeSelection:kye,resetRowHeights:CB,onRowHeightChanged:wB},dependsOn:[lye,uye]},Mye=class extends We{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,u=!!s.footer,c=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&Loe(this.gos,s);if(!l&&!u&&(t.skipRowGroups||c||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!u||o(Ft(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(Ft(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 mL,{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 u;const s=this.rowModel,o=os(this.gos),i=ud(this.gos),r=!o&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(c=>c.rowPinned==null).sort((c,d)=>c.rowIndex-d.rowIndex).map(c=>s.getRow(c.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 c=((u=this.beans.selectionSvc)==null?void 0:u.getSelectedNodes())??[];this.replicateSortedOrder(c),c.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(),u=h=>ua(h)?!1:!ca(h)||s;if(o!=null&&o.length)return i.getColsForKeys(o).filter(u);const c=r.get("treeData");let d=[];return t&&!l?d=i.getCols():d=a.allCols,d=d.filter(h=>u(h)&&(n&&!c?!NE(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&&is(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(Ft(this.gos,{columnGroup:r})):a=this.beans.colNames.getDisplayNameForColumnGroup(r,"header");const u=(r.isExpandable()?r.getLeafColumns():[]).reduce((c,d,h,f)=>{let p=Tn(c);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],c.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),c},[]);s.onColumn(r,a||"",o++,r.getLeafColumns().length-1,u)}}},Nye={moduleName:"SharedExport",version:ut,beans:[Mye]},RB=`\r
|
|
252
252
|
`,Lye=class extends hge{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,RB),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():(Xe(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=RB),this.isFirstLine=!1}},Vye=class extends dge{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()){Xe(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(Ft(this.gos,{})):t.fileName;fge(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:u,suppressQuotes:c,columnSeparator:d}=e;return new Lye({colModel:t,colNames:n,valueSvc:o,gos:i,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:u||void 0,suppressQuotes:c||!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 $ye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var Hye={moduleName:"CsvExport",version:ut,beans:[Vye],apiFunctions:{getDataAsCsv:Bye,exportDataAsCsv:$ye},dependsOn:[Nye]},Gye=class extends We{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 al(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){dt(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Xe(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:Ft(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 al(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()}},Uye=2,Wye=class extends We{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 Gye(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()&&(tl(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=Uye-1;t.forEach((r,a)=>{const l=r.state==="needsLoading"&&a>=i,u=s?a>=o:!1;if(l||u){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,dt(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(u=>{const c=u===e||u===t;(o||c)&&n.push(u),c&&(o=!o)},i,this.rowCount)}return r||o?[]:n}},zye=class extends We{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 al(e);this.rootNode=t,t.level=-1,this.rowHeight=mu(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=mu(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Of(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;dd(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:mu(e),overflowSize:i.get("cacheOverflowSize"),blockSize:i.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new Wye(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 jye(e){var t;(t=by(e))==null||t.refreshCache()}function Kye(e){var t;(t=by(e))==null||t.purgeCache()}function qye(e){var t;return(t=by(e))==null?void 0:t.getRowCount()}var Yye=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Voe(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Os(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Bi(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){tl(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(){tl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},Zye={moduleName:"InfiniteRowModelCore",version:ut,rowModels:["infinite"],beans:[zye,Yye]},Xye={moduleName:"InfiniteRowModel",version:ut,apiFunctions:{refreshInfiniteCache:jye,purgeInfiniteCache:Kye,getInfiniteRowCount:qye},dependsOn:[Zye,cye]},Jye="↑",Qye="↓",ewe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},twe=class extends wn{constructor(){super(ewe),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=dt(s)?s:n,i=t>=0,r=this.eDelta;i?r.textContent=Jye+o:r.textContent=Qye+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"),ks(this.eDelta)}refresh(e,t=!1){var u;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:i,beans:r}=this;if(n===i||(dt(s)?o.textContent=s:dt(n)?o.textContent=n:ks(o),(u=r.filterManager)!=null&&u.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 c=a-l;this.showDelta(e,c)}return i&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},nwe=".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}",swe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},owe=class extends wn{constructor(){super(swe),this.eCurrent=ct,this.refreshCount=0,this.registerCSS(nwe)}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=rs({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(Vn(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 dt(e.valueFormatted)?s.textContent=e.valueFormatted:dt(e.value)?s.textContent=n:ks(s),!0}},iwe=class extends We{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 u=`ag-cell-${t}`,c=`${u}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(u,!0),d.toggleCss(c,!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:u,fadeEndTime:c}=a,d=l==="flash"?u:c;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 ${c-u}ms`,p.transitionDelay=`${u-e}ms`,t=Math.min(c,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=oce(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 rwe(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 awe={moduleName:"HighlightChanges",version:ut,beans:[iwe],userComponents:{agAnimateShowChangeCellRenderer:twe,agAnimateSlideCellRenderer:owe},apiFunctions:{flashCells:rwe}};function lwe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function uwe(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=cwe(e)),e.version=ut,e}function cwe(e){return e.cellSelection=dwe(e,"rangeSelection"),e}function dwe(e,t){if(e&&typeof e=="object")return e[t]}var hwe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Os(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Os(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=Os(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=os(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:u})=>{u==="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=(c,d)=>!(n!=null&&n.has(c))&&(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 u=this.updateCachedState.bind(this);u("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(u("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),u("rowGroupExpansion",void 0)):(u("rowGroupExpansion",this.getRowGroupExpansionState()),u("ssrmRowGroupExpansion",void 0)),u("rowSelection",this.getRowSelectionState()),u("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 u=this.updateCachedState.bind(this);u("sideBar",this.getSideBarState()),u("focusedCell",this.getFocusedCellState());const c=this.getRangeSelectionState();u("rangeSelection",c),u("cellSelection",c),u("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 lge(Wv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:i,aggregation:r,pivot:a,columnPinning:l,columnVisibility:u,columnSizing:c,columnOrder:d}=e;let h=!1;const f=(E,A)=>{const k=!(s!=null&&s.has(E))&&!!(A||t==="api");return h||(h=k),k},p={},g=E=>{let A=p[E];return A||(A={colId:E},p[E]=A,A)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:E,sort:A},k)=>{const O=g(E);O.sort=A,O.sortIndex=k})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",i);S&&(i==null||i.groupColIds.forEach((E,A)=>{const k=g(E);k.rowGroup=!0,k.rowGroupIndex=A})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",r);b&&(r==null||r.aggregationModel.forEach(({colId:E,aggFunc:A})=>{g(E).aggFunc=A})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((E,A)=>{const k=g(E);k.pivot=!0,k.pivotIndex=A}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const _=f("columnPinning",l);if(_){for(const E of(l==null?void 0:l.leftColIds)??[])g(E).pinned="left";for(const E of(l==null?void 0:l.rightColIds)??[])g(E).pinned="right"}(_||!n)&&(v.pinned=null);const D=f("columnVisibility",u);if(D)for(const E of(u==null?void 0:u.hiddenColIds)??[])g(E).hide=!0;(D||!n)&&(v.hide=null);const T=f("columnSizing",c);if(T)for(const{colId:E,flex:A,width:k}of(c==null?void 0:c.columnSizingModel)??[]){const O=g(E);O.flex=A??null,O.width=k}(T||!n)&&(v.flex=null);const I=d==null?void 0:d.orderedColIds,x=!!(I!=null&&I.length)&&!(s!=null&&s.has("columnOrder")),F=x?I.map(E=>g(E)):Object.values(p);(F.length||h)&&(this.columnStates=F,$i(this.beans,{state:F,applyOrder:x,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);$i(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 uge(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 u=o.has(l);return u&&o.delete(l),{groupId:l,open:u}});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(u=>u.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(!aa(t)||!n)return;const i=[];for(const r of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const u of r.colIds){const c=s.getCol(u);c&&a.push(c)}if(!a.length)continue;let l=s.getCol(r.startColId);if(!l){const u=o.allCols,c=new Set(a);l=u.find(d=>c.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];Of(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),Of(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")}},fwe={moduleName:"GridState",version:ut,beans:[hwe],apiFunctions:{getState:lwe,setState:uwe}};function pwe(e){return e.rowModel.isLastRowIndexKnown()}function gwe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function mwe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function vwe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function ywe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function wwe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Cwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function bwe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function Swe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Ewe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var _we=class extends We{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(mu(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Os(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},mp="paginationPageSizeSelector",Rwe={tag:"span",cls:"ag-paging-page-size"},Dwe=class extends wn{constructor(){super(Rwe),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(mp,()=>{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(){ks(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(mp)!==!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(mp)!==!0;Xe(94,{pageSizeSet:o,pageSizesSet:i,pageSizeOptions:e,paginationPageSizeOption:t}),i||Xe(95,{paginationPageSizeOption:t,paginationPageSizeSelector:mp}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(ol(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 o0).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(mp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Twe={selector:"AG-PAGE-SIZE-SELECTOR",component:Dwe},Iwe=".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}",xwe=class extends LV{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(Iwe)}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(),[Twe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",di(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",di(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",di(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",di(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):_le(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===Oe.ENTER||s.key===Oe.SPACE)&&(s.preventDefault(),n())}})}Ele(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}):cge(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){Vse(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,u=!e&&n<l,c=this.formatNumber(r);this.lbFirstRowOnPage.textContent=c;let d;const h=this.getLocaleTextFunc();u?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,C;if(e)v=this.formatNumber(t),C=this.formatNumber(s);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(c,d,C,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"),u=`${e} ${a} ${t} ${l} ${n}`,c=`${r} ${s} ${l} ${o}`;u!==this.ariaRowStatus&&(this.ariaRowStatus=u,(d=this.ariaAnnounce)==null||d.announceValue(u,"paginationRow")),c!==this.ariaPageStatus&&(this.ariaPageStatus=c,(h=this.ariaAnnounce)==null||h.announceValue(c,"paginationPage"))}},Fwe={selector:"AG-PAGINATION",component:xwe},Pwe=class extends We{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 Fwe}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 dt(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:dt(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:dt(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:dt(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})}},Awe={moduleName:"Pagination",version:ut,beans:[Pwe,_we],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:pwe,paginationGetPageSize:gwe,paginationGetCurrentPage:mwe,paginationGetTotalPages:vwe,paginationGetRowCount:ywe,paginationGoToNextPage:wwe,paginationGoToPreviousPage:Cwe,paginationGoToFirstPage:bwe,paginationGoToLastPage:Swe,paginationGoToPage:Ewe},dependsOn:[Sy]};function kwe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function TB(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&TB(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function Owe(e,t){return e.rowModel.getRowNode(t)}function Mwe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function Nwe(e){return e.rowRenderer.getRenderedNodes()}function Lwe(e,t,n){e.rowModel.forEachNode(t,n)}function Vwe(e){return e.rowRenderer.firstRenderedRow}function Bwe(e){return e.rowRenderer.lastRenderedRow}function $we(e,t){return e.rowModel.getRow(t)}function Hwe(e){return e.rowModel.getRowCount()}var Gwe={moduleName:"RowApi",version:ut,apiFunctions:{redrawRows:kwe,setRowNodeExpanded:TB,getRowNode:Owe,addRenderedRowListener:Mwe,getRenderedNodes:Nwe,forEachNode:Lwe,getFirstDisplayedRowIndex:Vwe,getLastDisplayedRowIndex:Bwe,getDisplayedRowAtIndex:$we,getDisplayedRowCount:Hwe}},Uwe={moduleName:"ScrollApi",version:ut,apiFunctions:{getVerticalPixelRange:nve,getHorizontalPixelRange:sve,ensureColumnVisible:lB,ensureIndexVisible:uB,ensureNodeVisible:ove}};function Wwe(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 zwe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function jwe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function Kwe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function qwe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function Ywe(e){return{rowHeight:mu(e),headerHeight:sp(e)}}function Zwe(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(ep(a))}if((i=t.columns)!=null&&i.length)return n;const s=[],o=t_(t.rowNodes);for(const r of e.rowRenderer.getAllRowCtrls()){if(o&&!n_(r.rowNode,o)||!r.isFullWidth())continue;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const u=a[l];u!=null&&s.push(ep(u))}}return[...s,...n]}var Xwe={moduleName:"RenderApi",version:ut,apiFunctions:{setGridAriaProperty:Wwe,refreshCells:zwe,refreshHeader:jwe,isAnimationFrameQueueEmpty:Kwe,flushAllAnimationFrames:qwe,getSizesForCurrentTheme:Ywe,getCellRendererInstances:Zwe}};function Jwe(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function IB({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 Qwe(e,t){var n;t&&typeof t=="object"?IB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var eCe=class extends We{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&&os(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 u;const o=c=>pd(t,Array.from(c),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const i=xB(this.beans),r=c=>n.leftCols.some(d=>Xf(d,c)),a=c=>n.rightCols.some(d=>Xf(d,c)),l=e.colKeys.filter(c=>!ua(c)&&!ca(c)&&!r(c)&&!a(c));this.sizeColumnsToFit(i,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(u=e.columnLimits)==null?void 0:u.map(c=>({...c,key:c.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:u=[],source:c="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 C=-1;const S=Object.fromEntries(u.map(({colId:_,...D})=>[_,D])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=i??b;for(;C!==0;){C=0;const _=[];for(const D of s){if(!D||Xoe(D))continue;const T=f.getCol(D);if(!T||v.has(T))continue;const I=p.getPreferredWidthForColumn(T,b);if(I>0){const x=S[T.colId]??{};x.minWidth??(x.minWidth=l),x.maxWidth??(x.maxWidth=a);const F=tCe(T,I,x);T.setActualWidth(F,c),v.add(T),C++}_.push(T)}_.length&&g.refresh(c)}w||this.autoSizeColumnGroupsByColumns(s,c,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 u=l.getParent();for(;u&&u!=n;)u.isPadding()||i.add(u),u=u.getParent()}let a;for(const l of i){for(const u of o.getHeaderRowContainerCtrls())if(a=u.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 Du(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=xB(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):Xe(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,...C}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=C;const i=this.beans.visibleCols.allCols;if(e<=0||!i.length)return;const r=la(i);if(s!=null&&s.onlyScaleUp&&r>e||e===r&&i.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=o==null?void 0:o[C.getId()],b=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),w=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),_=C.getActualWidth();return(b==null||_>=b)&&(w==null||_<=w)}))return;const l=[],u=[];for(const v of i){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Xf(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?u.push(v):l.push(v)}const c=l.slice(0);let d=!1;const h=v=>{Bi(l,v),u.push(v)};for(const v of l){v.resetActualWidth(t);const C=o==null?void 0:o[v.getId()],S=(C==null?void 0:C.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=v.getActualWidth();typeof S=="number"&&w<S?v.setActualWidth(S,t,!0):typeof b=="number"&&w>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-la(u);if(v<=0)for(const C of l){const S=((g=o==null?void 0:o[C.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/la(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],_=o==null?void 0:o[w.getId()],D=(_==null?void 0:_.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(_==null?void 0:_.maxWidth)??(s==null?void 0:s.defaultMaxWidth),I=w.getMinWidth(),x=w.getMaxWidth(),F=typeof D=="number"&&D>I?D:I,E=typeof T=="number"&&T<x?T:x;let A=Math.round(w.getActualWidth()*C);A<F?(A=F,h(w),d=!1):A>E?(A=E,h(w),d=!1):b===0&&(A=S),w.setActualWidth(A,t,!0),S-=A}}}for(const v of c)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&pd(this.eventSvc,c,!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:u,maxWidth:c})=>({key:l,minWidth:u,maxWidth:c}));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 tCe(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 xB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Bf(n.eGridBody)-o}var nCe={moduleName:"ColumnAutoSize",version:ut,beans:[eCe],apiFunctions:{sizeColumnsToFit:Jwe,autoSizeColumns:IB,autoSizeAllColumns:Qwe},dependsOn:[e2]},sCe=".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 oCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function iCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function rCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function aCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function lCe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var uCe={moduleName:"PinnedRow",version:ut,beans:[rue],css:[sCe],apiFunctions:{getPinnedTopRowCount:oCe,getPinnedBottomRowCount:iCe,getPinnedTopRow:rCe,getPinnedBottomRow:aCe,forEachPinnedRow:lCe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},cCe=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}},dCe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:i,pagination:r}}=this,{colDef:a}=t,l=this.getNodeMap(e),u=new Map,c=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(w,_)=>{p=w,g=null,v=_},S=w=>{const _=!w.isExpandable()&&!w.group&&!w.detail&&(c?!c({rowNode:w}):!0);if(w.rowIndex==null||!_){C(null,null);return}if(p==null||w.level!==p.level||w.footer||g&&w.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(w,i.getValue(t,w));return}const D=i.getValue(t,w);if(f){const T=Ft(n,{valueA:v,nodeA:p,valueB:D,nodeB:w,column:t,colDef:a});if(!h(T)){C(w,D);return}}else if(d?!d(v,D):v!==D){C(w,D);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 cCe(t,p),u.set(p,g)}g.addSpannedNode(w),u.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!r||r.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=u;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=u;break;case"bottom":s==null||s.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=u;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}}},hCe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Os(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Os(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 dCe(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()}},fCe=class extends Dd{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||_v(e,t.rowIndex)}setAriaRowSpan(){Use(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(cy(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}},pCe=class extends Cy{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 fCe(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(){}},gCe=class extends We{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,(u,c)=>{if(i.has(c.firstNode))return;const d=n.get(c.firstNode);if(d){i.set(c.firstNode,d),n.delete(c.firstNode);return}r=!0;const h=new pCe(c.firstNode,this.beans,!1,!1,!1);i.set(c.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")}},mCe={moduleName:"CellSpan",version:ut,beans:[hCe,gCe]},vCe=class extends We{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);Q0(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 Ft(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},yCe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){Q0(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 vCe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},wCe={moduleName:"CellStyle",version:ut,beans:[yCe]},CCe={moduleName:"RowStyle",version:ut,beans:[rpe]};function bCe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var SCe=class extends We{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 u of this.destroyManagedListeners)u();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},ECe="ag-column-hover",_Ce=class extends We{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(ECe,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 SCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},RCe={moduleName:"ColumnHover",version:ut,beans:[_Ce],apiFunctions:{isColumnHovered:bCe}},DCe=class extends We{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=!vy.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)=>{vy.has(r)&&t(r,a)},s=(r,a)=>{vy.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 TCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function ICe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function xCe(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function FCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var PCe={moduleName:"EventApi",version:ut,apiFunctions:{addEventListener:TCe,addGlobalListener:xCe,removeEventListener:ICe,removeGlobalListener:FCe},beans:[DCe]},ACe={moduleName:"Locale",version:ut,beans:[age]},kCe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Os(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,u,c;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=nl(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.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),(u=t.forEachDisplayedNode)==null||u.call(t,r),i&&((c=t.onRowHeightChanged)==null||c.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=c=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=pu(s),g=d+h+f+p,C=t.offsetHeight+g;if(c<5){const b=Ds(r),w=!(b!=null&&b.contains(t)),_=C==0;if(w||_){window.setTimeout(()=>a(c+1),0);return}}this.setRowAutoHeight(o,C,i)},l=()=>a(0);l();const u=Qa(r,t,l);return n.addDestroyFunc(()=>{u(),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}},OCe={moduleName:"RowAutoHeight",version:ut,beans:[kCe]},MCe={moduleName:"AllCommunity",version:ut,dependsOn:[_B,Hye,Xye,Rge,Mve,Nve,Lve,Vve,Bve,$ve,Hve,Ove,Tme,Ime,xme,Dme,Pme,Ame,fwe,hye,Awe,o2,Gwe,Uwe,Xwe,nCe,Cce,uCe,nye,Gpe,wCe,RCe,CCe,PCe,zpe,awe,iB,ACe,OCe,wce,Oye,mCe]};let FB=!1;FB||(Toe.registerModules([MCe,_B]),FB=!0);class NCe{constructor(t,n){Qn(this,"gridApi",null);Qn(this,"container");Qn(this,"config");Qn(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=sge(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 LCe=c2.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"),VCe=rt({__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=Y(()=>({width:"100%",height:s.height||"500px"})),l=Y(()=>({...s,theme:LCe}));function u(){if(!i.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};r.value=new NCe(i.value,g),r.value.init(),c()}function c(){var v;const g=((v=r.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=r.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width}:null).filter(b=>b!==null);(S=r.value)==null||S.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 et(()=>s.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),vs(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),rn(()=>{u()}),vs(()=>{h()}),(g,v)=>(j(),ce("div",{ref_key:"gridContainerRef",ref:i,style:dn(a.value),class:te(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function Pd(e){return uN(e)}const BCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Pd(ru),suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Pd(ru)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Pd(ru)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Pd(ru)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Pd(ru),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:Pd(ru),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=>kf.fromType(n))],Iy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},$Ce={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},HCe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:Iy.WIDTH,minWidth:Iy.WIDTH,maxWidth:Iy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:Iy.HEADER_CLASS,headerComponent:Ev(lJ),suppressMovable:!0}),GCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},UCe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=Rh({dbName:"item_table_column_configs",storeName:"column_configs"}),i=async()=>{const c=await s(t);if(c&&typeof c=="string")try{return JSON.parse(c)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=V([]),a=HCe(),l=async c=>{const d=await i(),h=new Map;d==null||d.forEach(A=>{A.width&&h.set(A.field,A.width)});const f=BCe(),p=kf.fromType(GCe),v=((c==null?void 0:c.map(A=>{var k;return{headerName:A.name,field:`metric_${A.id}`,editable:((k=A==null?void 0:A.auth_permission)==null?void 0:k.permission)==2,sortable:!0,filter:!1,flex:1,context:{...A},hide:!(A.is_primary||A.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:Ev(ru),headerComponentParams:O=>({headerType:A.metric_type.code=="number"||A.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${A.id}`)}}))||[]).map(A=>kf.fromType(A)),C=[a,...f,...v,$Ce,p],S=C.filter(A=>A.pinned==="left"),b=C.filter(A=>A.pinned==="right"||A.field==="blank"),w=C.filter(A=>!A.pinned&&A.field!=="blank");if(!d||d.length===0){r.value=C;return}const _=new Map(d.map(A=>[A.field,A])),D=new Map(w.map(A=>[A.field,A])),T=[];for(const A of d)if(A.field&&D.has(A.field)){const k=D.get(A.field);T.push({...k,hide:A.hide,width:A.width}),D.delete(A.field)}const I=Array.from(D.values()),x=[...T,...I],F=S.map(A=>{const k=_.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A}),E=b.map(A=>{const k=_.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A});r.value=[...F,...x,...E]};et(e,c=>l(c),{immediate:!0});const u=Di((c,d)=>{var C,S;if(c.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(c.source)===-1){console.warn("Skipping saveColumnConfig for source:",c.source);return}else console.warn("Executing saveColumnConfig for source:",c.source);else console.warn("Executing saveColumnConfig for source:",c);const h=(C=n==null?void 0:n.value)==null?void 0:C.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((b,w)=>(b[w.colId]=Number(w.width),b),{}),p=new Map;Object.entries(f||{}).forEach(([b,w])=>{p.set(b,w)}),r.value=h||r.value;const g=h==null?void 0:h.filter(b=>!b.pinned&&b.field!=="blank"),v=(g==null?void 0:g.map(b=>({field:b.field,hide:b.hide,width:p.get(b.field)||b.width,pinned:b.pinned})))||[];d&&o(t,JSON.stringify(v))},rr);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:u}},WCe=()=>{const e=En.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},zCe=e=>{var A,k,O;const{showMessage:t,showErrorNetMessage:n}=gf(),s=es(),o={domainApi:WCe(),wsCode:En.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=(O=(k=(A=s==null?void 0:s.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)==null?void 0:O.apiConfig;if(!i||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new Ak(i,o);r.on("call-api",B=>{B.success?t(B.apiCode,"success"):n(B)});const a=ao({}),l=V([]),u=V(!1),c=V(null),d=V(null),h=V(1),f=V(20);let p=Promise.resolve();const{setCachedUsers:g}=O7(),v=B=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:B}),C=50,S=async(B,Z,X)=>{if(!B.length)return[];const ee=K4(B,Z);return(await Promise.all(ee.map(X))).flat()},b=async B=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:B})).data.map(X=>[X==null?void 0:X.id,X.permission])}catch(Z){return console.error("Failed to fetch item permissions chunk:",Z),[]}},w=async(B,Z)=>{try{const X=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:B,per_page:B.length*Z.length,metric_ids:Z}),ee=X.data.map(ae=>{const J=new Map(ae.item_metrics.map(H=>[H.metric_id,{value:H.value,auth_permission:H==null?void 0:H.auth_permission}])),L=Object.fromEntries(Z.map(H=>[H,J.get(H)??null]));return[ae==null?void 0:ae.id,L]}),re=new Set(X.data.map(ae=>ae==null?void 0:ae.id));for(const ae of B)if(!re.has(ae)){const J=Object.fromEntries(Z.map(L=>[L,{value:null,auth_permission:void 0}]));ee.push([ae,J])}return ee}catch(X){return console.error("Failed to fetch a chunk of metric values:",X),B.map(re=>[re,Object.fromEntries(Z.map(ae=>[ae,void 0]))])}},_=async B=>{try{const Z=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:B,per_page:B.length}),X=Z.data.flatMap(ee=>ee.assignees);return g(X),Z.data.map(ee=>[ee==null?void 0:ee.id,ee==null?void 0:ee.assignees])}catch(Z){return console.error("Failed to fetch a chunk of assigned users:",Z),[]}},D=async B=>{if(!B.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const Z=await S(B,C,b);return Object.fromEntries(Z)}catch(Z){return console.error("Failed to fetch item permissions:",Z),{}}},T=async(B,Z)=>!B.length||!Z.length?{}:(p=p.then(async()=>{try{const re=[];let ae=0;for(let L=0;L<Z.length;L+=5){ae++;const H=Z.slice(L,L+5),Q=[];for(let ve=0;ve<H.length;ve++){const oe=H[ve],ie=await S(B,C,z=>w(z,[oe]));Q.push(ie),await new Promise(z=>setTimeout(z,500))}re.push(...Q);const fe=L+5>=Z.length}const J={};for(const L of re.flat()){const[H,Q]=L;J[H]||(J[H]={}),Object.assign(J[H],Q)}return J}catch(X){return console.error("Failed to fetch metric values:",X),{}}}),p),I=async B=>{if(!B.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const Z=await S(B,C,_);return Object.fromEntries(Z)}catch(Z){return console.error("Failed to fetch assigned users:",Z),{}}};return{items:l,loading:u,error:c,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async B=>{const{cursor:Z,offset:X,size:ee,searchQuery:re}=B;let ae=[];u.value=!0,c.value=null;try{const J=await r.getAllItem_cursor({...B,cursor:Z||void 0,offset:X||void 0,pageSize:ee||f.value,...v(re),sortBy:B.sort_by});return l.value=J.data,d.value=J.meta,h.value=J.meta.current_page||0,ae=J.data.map(L=>L==null?void 0:L.id),J}catch(J){throw c.value=J,console.error("Failed to fetch items (cursor):",J),J}finally{const J=async()=>{try{const[L,H]=await Promise.all([I(ae),D(ae)]);e.value.updateItemData({assignees:L,permission:H},ae);const Q=await T(ae,e.value.metricIds);e.value.setMetricValues(Q,new Set(ae),e.value.metricIds)}catch(L){console.error("Post-fetch processing failed:",L)}};u.value=!1,setTimeout(J)}},getAssignableStatus:async B=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:B})}catch(Z){throw console.error("Failed to fetch assignable status:",Z),Z}},getMetricList:async B=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:B})}catch(Z){throw console.error("Failed to fetch metric list:",Z),Z}},getMetricValues:T,getAssignedUsers:I}};function jCe(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(u=>{if(u.field&&u.field.startsWith("metric_")&&(u.hide===!1||u.hide===void 0))return u.field}).filter(Boolean);o.forEach(u=>{var d;const c=(d=e.value)==null?void 0:d.getRowNode(u);if(c){if(i.push(c),s.assignees){const h=C7((s.assignees[u]||[]).map(_F));c.data.assignees=h,r.add("assignees")}s.permission&&(c.data.permissions=s.permission[u]),l.forEach(h=>{c.data[h]=c.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(u=>[u,new Map(i.map(c=>[c,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([u,c])=>{Object.entries(c).forEach(([d,h])=>{var f;(f=a.get(u))==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(([u,c])=>{const d=r.getRowNode(u);return d!=null&&d.data?(c.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(u=>`metric_${u}`),force:!0})}}}function KCe(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:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,c),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),s(!1),o(!1)}}}}function qCe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:i}=e,r=V(!0),a=V(!0),l=V(!1),u=()=>{n.value=!n.value},c=v=>{if(r.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!i)return console.error("Fetcher function is undefined"),null;const b=KCe(i,e.perPage,()=>s.value,w=>{r.value=w},w=>{a.value=w});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(S=o.value)==null||S.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=Di(v=>{d(v)},rr),p=()=>{o.value},g=V(!1);return{isLoading:r,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const YCe={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."]}}},ZCe=e=>{var t;return(t=Object.entries(YCe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},XCe={key:1},JCe=_t(rt({__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:u}=ts(!1,{}),c=V(!1),d=async()=>{c.value=!0;const T=o.workspaceId,I=o.entityId;if(!T||!I||!u.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await u.value.downloadExportedItemsFile(T,I))throw new Error("No response from downloadTemplate API")}catch(x){console.error("Error downloading template:",x)}c.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var F,E,A;const I=new FormData,x=((F=T.name.split(".").pop())==null?void 0:F.toString())||"";if(I.append("file",T),I.append("format",x),I.append("entity_id",o.entityId||""),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I),g()}catch(k){throw console.error("Error uploading file:",k),v(((A=(E=k.response)==null?void 0:E.data)==null?void 0:A.message)||"An unknown error occurred during file upload."),k}},g=()=>{a.value="success"},v=T=>{r.value=T,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var T;D(),(T=s.value)==null||T.hide()};t({close:S,open:i});const b=Y(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=Y(()=>l.value.file?!1:(console.error("No file selected"),!0)),_=V(null),D=()=>{var T;(T=_.value)==null||T.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(T,I)=>(j(),qe(U($k),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:D},nh({default:me(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(j(),qe(sN,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(j(),ce("div",XCe,[Re("div",{class:te(T.$style["step-section"])},[Re("span",{class:te(T.$style["step-title"])},"Step 1: Download current data",2),Re("span",{class:te(T.$style["step-description"])},[...I[1]||(I[1]=[nt(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),Re("br",null,null,-1),Re("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),pe(U(vt),{class:te(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:c.value,onHandleClick:d},{prefix:me(()=>[pe(U(lt),{src:"Download"})]),default:me(()=>[I[2]||(I[2]=nt(" Download file ",-1))]),_:1},8,["class","disabled"])],2),Re("div",{class:te(T.$style["step-section"])},[Re("span",{class:te(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),pe(U(RO),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=x=>l.value=x),ref_key:"filUploaderRef",ref:_},null,8,["modelValue"])],2),Re("div",{class:te(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[pe(oN)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:me(()=>[pe(U(vt),{style:{flex:"1"},variant:"secondary",onClick:S},{default:me(()=>[...I[3]||(I[3]=[nt(" Cancel ",-1)])]),_:1}),pe(U(vt),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:me(()=>[...I[4]||(I[4]=[nt(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:me(()=>[pe(U(vt),{style:{flex:"1"},variant:"primary",onClick:f},{default:me(()=>[...I[5]||(I[5]=[nt(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:me(()=>[pe(U(vt),{style:{flex:"1"},variant:"primary",onClick:D},{default:me(()=>[...I[6]||(I[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"}}]]),QCe={style:{cursor:"help"}},ebe=_t(rt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=To,s=Yb(),{setUserPermissions:o,setEntityPermissions:i}=s,{entityPermissions:r}=Qs(s),a=Jt,l=V(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=V(""),d=Y(()=>{var Ye;const ke=((Ye=r.value)==null?void 0:Ye.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!ke},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!ke,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!ke,id:"overwrite_scenes_option"}]}),h=e;kf.initialize({wrapVueCellRenderer:Ev,wrapVueCellEditor:uN});const f=ef(),{switchInstanceFunc:p}=Qs(f);rn(()=>{const ke=es();p.value=ke==null?void 0:ke.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");mt(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=V(null),v=V([]),C=Um(),{rowCount:S}=Qs(C),b=V(!1),w=V(""),_=V(),D=$A(),{metricList:T}=Qs(D),I=V(""),x=V(!1),F=V(new Set),E=V(new Map),{apiServices:A}=ts(!1,h),{columnDefs:k,checkboxColumn:O,saveColumnConfig:B}=UCe(T,h.entityId,g),Z=V();et(()=>k,()=>{var ke;(ke=Z.value)==null||ke.updateColumnDefs(k.value)},{deep:!0});const X=(ke,Ye)=>{B(ke,Ye)},{updateRowData:ee,setMetricValues:re}=jCe(g),ae=Y(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(Ae.value||{}).length==1&&Object.keys(Ae.value)[0]=="preflight_status")&&Object.keys(Ae.value||{}).length>0})),J=Y(um),L=Y(()=>k.value.filter(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.startsWith("metric_"))&&!ke.hide}).map(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.replace("metric_",""))||""}));Zi("timezone",J);const H=Y(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:L.value,updateItemData:ee,setMetricValues:re})),{fetchItems:Q,getMetricList:fe,cusorMap:ve,getMetricValues:oe}=zCe(H),ie=Y(()=>{if(!g.value)return!1;const ke=g.value.getSelectedRows().length;return ke>0&&ke>=S.value.total}),z=Y(()=>{var ke;return((ke=l.value)==null?void 0:ke.name)||"Items"}),ge=ke=>{setTimeout(()=>{mt(()=>{var Ye,jt;g.value&&(ke?(Ye=g.value)==null||Ye.showNoRowsOverlay():(jt=g.value)==null||jt.hideOverlay())})},500)},se=(ke,Ye)=>{var jt;S.value.total=ke.meta.total??0,(jt=ke.meta.next)!=null&&jt.cursor&&(ve[Ye+1]=ke.meta.next.cursor),I.value=ke.meta["X-Tsr-signature"]||"",ke.meta.total===0?ge(!0):ge(!1)},be=_O(),G=V(null),{sortingAPIConfiguration:q,isSortingRunning:de}=Qs(be),Ae=V({preflight_status:"1"}),Fe=Y(()=>({...Ae.value,search:w.value}));Zi("filterParams",Fe);const Le=V([]),ye=async({page:ke,pageSize:Ye,filterText:jt})=>{var Au;(Au=g.value)==null||Au.hideOverlay();const nn=ve[ke],Ui=!nn&&ke>1?(ke-1)*Ye:void 0,js=q.value;js.length>0&&(de.value=!0);try{const bo={cursor:nn,size:Ye,searchQuery:jt,offset:Ui,sort_by:js,...Ae.value},Pr=await Q(bo);if(!Pr)return{rows:[],total:0};const Kn=(ya=>{const gi=ya.data.map(ku=>DF(ku,J.value));return gi.forEach(ku=>{F.value.add(String(ku.id)),E.value.set(String(ku.id),{})}),gi})(Pr);return se(Pr,ke),{rows:Kn,total:S.value.total}}catch(bo){return console.error("Failed to fetch items:",bo),{rows:[],total:0}}finally{de.value=!1}},{isLoading:M,toggleSidebar:$,onGridReady:le,handleUnSelect:Ge,handleSelectAll:we,onSearch:ze,firstLoad:Ue}=qCe({selectRowData:V([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:u.ROWS_PER_PAGE,fetcher:ye}),Ee=V([]),Ve=()=>{var ke;Ee.value=((ke=g.value)==null?void 0:ke.getSelectedRows())||[]},pt=ao({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),At=Y(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:u.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:u.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:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ut,noRowsOverlayComponent:Ev(KQ),noRowsOverlayComponentParams:()=>ae.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:ke=>ke.data.id,getRowClass:ke=>{if(!ke.data)return["row-empty"];const Ye=["row-highlight"];return ke.data.id||Ye.push("row-inactive"),ke.data.isDeleted&&Ye.push("row-deleted"),ke.data.disabled&&Ye.push("row-deleted"),ke.data.isArchived&&Ye.push("row-archived"),ke.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:A.value,sorting:de.value},onCellKeyDown:ke=>{var Ye,jt,nn;if(ke.data.isDeleted)return!1;if(((Ye=ke==null?void 0:ke.event)==null?void 0:Ye.key)==="Enter"){const{api:Ui,node:js,column:Au}=ke,bo=Ui.getCellRendererInstances({rowNodes:[js],columns:[Au]});if(bo.length>0){const Pr=bo[0];Pr&&typeof((jt=Pr.componsenExposed)==null?void 0:jt.focus)=="function"&&((nn=Pr.componsenExposed)==null||nn.focus())}}},isRowSelectable:ke=>!ke.group,suppressKeyboardEvent:ke=>{var nn;if((nn=ke.data)!=null&&nn.isDeleted)return!0;const Ye=ke.event.key,jt=ke.editing;return jt&&Ye==="Tab"?!0:jt&&Ye==="Enter"?!1:Ye==="Enter"?(ke.event.preventDefault(),ke.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:ke=>{const Ye=ke.api.getFirstDisplayedRowIndex(),jt=ke.api.getLastDisplayedRowIndex();pt.rowsDisplay.fromIndex=Ye,pt.rowsDisplay.toIndex=jt,pt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(nn=>nn.getColId())},onViewportChanged:ke=>{pt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(ke){if(ke.data.isDeleted&&ke.api.stopEditing(),ke.colDef.field=="options"){const Ye=ke.api.getCellRendererInstances({rowNodes:[ke.node],columns:[ke.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:ke=>{let Ye=ke.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const jt=ke.api.getAllDisplayedColumns(),nn=jt.indexOf(Ye.column),Ui=ke.backwards?-1:1,js=jt[nn+Ui];if(js)return{rowIndex:Ye.rowIndex,column:js,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let ke=0;g.value.forEachNode(Ye=>{Ye.data&&ke++}),S.value.loaded=Math.min(ke,S.value.total)}et(()=>q,()=>{g.value&&(I.value="",F.value.clear(),g.value.deselectAll(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Qt=V(),zt=V(),Ne=()=>{var ke;(ke=zt.value)==null||ke.open()},je=()=>{var ke;(ke=Qt.value)==null||ke.open()},wt=async()=>{Ue.value=!0,g.value&&(I.value="",F.value.clear(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Ot=Y(()=>En.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=V(),st=Y(()=>{var ke;return(ke=ZCe(Ot.value))==null?void 0:ke.map(Ye=>`<div>• ${Ye}</div>`).join(`
|
|
253
|
-
`)});function fs(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?je():ke==="overwrite_scenes"&&Ne()}const Gi=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},pl=ke=>{const Ye=le(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",nn=>X(nn,!0)),Ye.addEventListener("columnResized",nn=>X(nn,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},Co=()=>{var ke;c.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};rn(()=>{mt(()=>{Co()}),window.addEventListener("resize",Co);function ke(){requestAnimationFrame(ke)}ke()}),vs(()=>{window.removeEventListener("resize",Co)});const va=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var jt;(jt=_.value)==null||jt.setValue(Ye)},300)},gl=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},Ir=ke=>ke.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const ke=await fe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:Ir(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},pi=async()=>{if(A.value)try{const ke=await A.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},Fr=async()=>{if(A.value)try{const ke=await A.value.getEntityDetail(h.workspaceId,h.entityId);i(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Pu=dv(),{setUser:kn}=Pu,ps=async()=>{if(A.value)try{const ke=await A.value.getMe();return kn(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},C_=async()=>{var ke;if(A.value)try{const Ye=await A.value.getWorkspaces(h.workspaceId),jt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return jt&&Pu.setUserRoleId(jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(ps(),C_(),xr(),pi(),Fr())},{immediate:!0,deep:!0}),et(L,(ke,Ye)=>{const jt=ke.filter(nn=>!(Ye!=null&&Ye.includes(nn)));jt.length>0&&oe(Array.from(F.value),jt).then(nn=>{re(nn,F.value,jt)})},{immediate:!0,deep:!0}),et(I,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const Ad=ke=>{Ae.value=ke,wt()},kd=ke=>{Le.value=ke,wt()},Od=ke=>{k.value=ke||[],X({},!0)},b_=Y(()=>{var nn;const ke=En.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((nn=Ye==null?void 0:Ye.find(Ui=>Ui.code==="scene"))==null?void 0:nn.name)||"Scene"}`});return(ke,Ye)=>{const jt=Eo("focusable");return j(),qe(U(sJ),{"is-sidebar-open":b.value,onCloseSidebar:U($),onSidebarClear:U($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U($)},{"header-left":me(()=>{var nn;return[((nn=U(r))==null?void 0:nn.has_create_item_permission)==1?(j(),qe(U(pS),{key:0,variant:["primary"],options:d.value,onSelect:fs,onHandleClick:Ye[1]||(Ye[1]=Ui=>fs("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:me(()=>[Ke(pe(U(vt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Ui=>fs("new_scene")),label:b_.value},null,8,["label"]),[[jt,1]])]),_:1},8,["options"])):Je("",!0),Re("div",{class:te(ke.$style["beta-tag"])},"Beta",2),Ke((j(),ce("span",QCe,[nt(Ct(Ot.value),1)])),[[U(a),st.value||""]])]}),"header-actions":me(()=>[pe(U(Fee),{"onUpdate:assignees":kd,onApplyFilter:Ad,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(pe(U(tS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=nn=>w.value=nn),onSearch:U(ze),class:te(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=nn=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke((j(),qe(U(MA),{status:U(M)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:me(()=>[Ke((j(),qe(U(vt),{variant:["secondary","icon"],disabled:U(M),onClick:wt},{default:me(()=>[pe(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke(pe(U(xQ),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=nn=>Od(nn)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:Z,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:me(({availableHeight:nn})=>[pe(U(VCe),qt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:nn+"px",isSorting:U(de),onOnGridReady:pl,onSelectionChanged:Gi}),null,16,["height","isSorting"])]),footer:me(()=>[Re("div",{class:te(ke.$style.tableFooter),id:"table_footer"},[Re("span",null,[Ye[5]||(Ye[5]=nt(" Showing ",-1)),Re("b",null,Ct(U(S).loaded)+" of "+Ct(U(S).total),1)])],2)]),"new-row":me(()=>[pe(U(ree),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:va,onFocusOnId:gl},null,512)]),"bulk-update-actions":me(()=>[!b.value&&v.value.length>0?Ke((j(),qe(U(YX),{key:0,selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":z.value,"selected-all":ie.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[jo,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:me(()=>[pe(U(VJ))]),popup:me(()=>[pe(vse,{ref_key:"popupCreateSceneRef",ref:Qt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),pe(JCe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},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"}}]]),PB="0.1.
|
|
253
|
+
`)});function fs(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?je():ke==="overwrite_scenes"&&Ne()}const Gi=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},pl=ke=>{const Ye=le(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",nn=>X(nn,!0)),Ye.addEventListener("columnResized",nn=>X(nn,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},Co=()=>{var ke;c.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};rn(()=>{mt(()=>{Co()}),window.addEventListener("resize",Co);function ke(){requestAnimationFrame(ke)}ke()}),vs(()=>{window.removeEventListener("resize",Co)});const va=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var jt;(jt=_.value)==null||jt.setValue(Ye)},300)},gl=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},Ir=ke=>ke.metric_type.code==="number"?"number":"default",xr=async()=>{if(h.entityId)try{const ke=await fe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:Ir(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},pi=async()=>{if(A.value)try{const ke=await A.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},Fr=async()=>{if(A.value)try{const ke=await A.value.getEntityDetail(h.workspaceId,h.entityId);i(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Pu=dv(),{setUser:kn}=Pu,ps=async()=>{if(A.value)try{const ke=await A.value.getMe();return kn(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},C_=async()=>{var ke;if(A.value)try{const Ye=await A.value.getWorkspaces(h.workspaceId),jt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return jt&&Pu.setUserRoleId(jt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(ps(),C_(),xr(),pi(),Fr())},{immediate:!0,deep:!0}),et(L,(ke,Ye)=>{const jt=ke.filter(nn=>!(Ye!=null&&Ye.includes(nn)));jt.length>0&&oe(Array.from(F.value),jt).then(nn=>{re(nn,F.value,jt)})},{immediate:!0,deep:!0}),et(I,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const Ad=ke=>{Ae.value=ke,wt()},kd=ke=>{Le.value=ke,wt()},Od=ke=>{k.value=ke||[],X({},!0)},b_=Y(()=>{var nn;const ke=En.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((nn=Ye==null?void 0:Ye.find(Ui=>Ui.code==="scene"))==null?void 0:nn.name)||"Scene"}`});return(ke,Ye)=>{const jt=Eo("focusable");return j(),qe(U(sJ),{"is-sidebar-open":b.value,onCloseSidebar:U($),onSidebarClear:U($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U($)},{"header-left":me(()=>{var nn;return[((nn=U(r))==null?void 0:nn.has_create_item_permission)==1?(j(),qe(U(pS),{key:0,variant:["primary"],options:d.value,onSelect:fs,onHandleClick:Ye[1]||(Ye[1]=Ui=>fs("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:me(()=>[Ke(pe(U(vt),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Ui=>fs("new_scene")),label:b_.value},null,8,["label"]),[[jt,1]])]),_:1},8,["options"])):Je("",!0),Re("div",{class:te(ke.$style["beta-tag"])},"Beta",2),Ke((j(),ce("span",QCe,[nt(Ct(Ot.value),1)])),[[U(a),st.value||""]])]}),"header-actions":me(()=>[pe(U(Fee),{"onUpdate:assignees":kd,onApplyFilter:Ad,loading:U(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(pe(U(tS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=nn=>w.value=nn),onSearch:U(ze),class:te(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=nn=>U(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:_},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke((j(),qe(U(MA),{status:U(M)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:me(()=>[Ke((j(),qe(U(vt),{variant:["secondary","icon"],disabled:U(M),onClick:wt},{default:me(()=>[pe(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[jt,5],[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Ue),fullwidth:!0}]]),Ke(pe(U(xQ),{"model-value":U(k),onChange:Ye[4]||(Ye[4]=nn=>Od(nn)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:Z,"checkbox-column":U(O),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(Ue),fullwidth:!0}]])]),grid:me(({availableHeight:nn})=>[pe(U(VCe),qt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:nn+"px",isSorting:U(de),onOnGridReady:pl,onSelectionChanged:Gi}),null,16,["height","isSorting"])]),footer:me(()=>[Re("div",{class:te(ke.$style.tableFooter),id:"table_footer"},[Re("span",null,[Ye[5]||(Ye[5]=nt(" Showing ",-1)),Re("b",null,Ct(U(S).loaded)+" of "+Ct(U(S).total),1)])],2)]),"new-row":me(()=>[pe(U(ree),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:va,onFocusOnId:gl},null,512)]),"bulk-update-actions":me(()=>[!b.value&&v.value.length>0?Ke((j(),qe(U(YX),{key:0,selectRowData:Ee.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Ge),onSelectAll:U(we),"take-name":z.value,"selected-all":ie.value,"total-rows":U(S).total,"visible-rows":U(S).loaded,onUpdated:Ve,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[jo,!b.value&&v.value.length>0]]):Je("",!0)]),snackbar:me(()=>[pe(U(VJ))]),popup:me(()=>[pe(vse,{ref_key:"popupCreateSceneRef",ref:Qt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),pe(JCe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},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"}}]]),PB="0.1.110",tbe={key:0},nbe=_t(rt({__name:"app",setup(e){const t=Y(()=>n.id.length===0||n.workspaceId.length===0),n=ao({id:"",workspaceId:"",apiConfig:{}}),s=gf(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=V(null),u=()=>{const h=En.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};eh(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",PB);try{if(l.value=es(),!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:u(),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 Ak(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),vs(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=Y(()=>n.id),d=Y(()=>n.workspaceId);return Zi("workspaceId",d),Zi("entityId",c),(h,f)=>(j(),ce("div",{class:te(h.$style.dashboardPluginWrapper)},[t.value?(j(),ce("span",tbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(j(),qe(U(ebe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Je("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),w_=async(e={},t={})=>{const n=CT(nbe),s=iY();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,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${PB}`,"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",Jt),n.directive("focusable",Ur);const r=await pse();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=w_),On.default=w_,On.initDashboard=w_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|