From 58f6876261a5f0d29de2b9e32364afaca1ff7086 Mon Sep 17 00:00:00 2001 From: natxocc Date: Thu, 26 Mar 2026 00:39:30 +0100 Subject: [PATCH] New 1.1.3 --- UI/aggrid/aggrid-lib.js | 68 + UI/aggrid/aggrid.js | 1 + UI/aggrid/vite.config.js | 31 + UI/index.js | 2 + UI/sigpro-ui.js | 1240 +++++++++++++++++ UI/sigpro-ui.min.js | 1 + docs/404.html | 2 +- docs/api/$.html | 84 -- docs/api/effect.html | 58 + docs/api/html.html | 50 +- docs/api/ignore.html | 52 + docs/api/mount.html | 42 +- docs/api/quick.html | 75 +- docs/api/router.html | 63 +- docs/api/signal.html | 39 + docs/api/tags.html | 67 +- docs/api/view.html | 51 + docs/assets/api__.md.BV8uIOD5.js | 59 - docs/assets/api__.md.BV8uIOD5.lean.js | 1 - docs/assets/api_effect.md.jV8KzXq5.js | 33 + docs/assets/api_effect.md.jV8KzXq5.lean.js | 1 + docs/assets/api_html.md.-lEpgX-Z.js | 22 - docs/assets/api_html.md.-lEpgX-Z.lean.js | 1 - docs/assets/api_html.md.COPskx0H.js | 24 + docs/assets/api_html.md.COPskx0H.lean.js | 1 + docs/assets/api_ignore.md.CxKek-H-.js | 27 + docs/assets/api_ignore.md.CxKek-H-.lean.js | 1 + docs/assets/api_mount.md.B9mWME6o.js | 29 - docs/assets/api_mount.md.B9mWME6o.lean.js | 1 - docs/assets/api_mount.md.CRwLyxt8.js | 27 + docs/assets/api_mount.md.CRwLyxt8.lean.js | 1 + docs/assets/api_quick.md.4axUqmd3.js | 1 + docs/assets/api_quick.md.4axUqmd3.lean.js | 1 + docs/assets/api_quick.md.OAEBn6rS.js | 68 - docs/assets/api_quick.md.OAEBn6rS.lean.js | 1 - docs/assets/api_router.md.BV6vPWg-.js | 37 - docs/assets/api_router.md.BV6vPWg-.lean.js | 1 - docs/assets/api_router.md.Cn98LjXO.js | 22 + docs/assets/api_router.md.Cn98LjXO.lean.js | 1 + docs/assets/api_signal.md.BmorvARW.js | 14 + docs/assets/api_signal.md.BmorvARW.lean.js | 1 + docs/assets/api_tags.md.VliNqepa.js | 36 + docs/assets/api_tags.md.VliNqepa.lean.js | 1 + docs/assets/api_tags.md.YLRdMyid.js | 31 - docs/assets/api_tags.md.YLRdMyid.lean.js | 1 - docs/assets/api_view.md.Bv8Rlx9s.js | 26 + docs/assets/api_view.md.Bv8Rlx9s.lean.js | 1 + ....md.pJydCe65.js => install.md.DmlvO98W.js} | 33 +- docs/assets/install.md.DmlvO98W.lean.js | 1 + docs/assets/install.md.pJydCe65.lean.js | 1 - docs/assets/plugins_custom.md.BuhVOLjH.js | 48 - .../assets/plugins_custom.md.BuhVOLjH.lean.js | 1 - docs/assets/plugins_quick.md.DOyIUaNj.js | 27 - docs/assets/plugins_quick.md.DOyIUaNj.lean.js | 1 - docs/assets/ui_button.md.B087poC6.js | 34 - docs/assets/ui_button.md.B087poC6.lean.js | 1 - docs/assets/ui_form.md.CZVTxszG.js | 28 - docs/assets/ui_form.md.CZVTxszG.lean.js | 1 - docs/assets/ui_input.md.mJqBxkG3.js | 60 - docs/assets/ui_input.md.mJqBxkG3.lean.js | 1 - docs/assets/ui_installation.md.C7ubLVYa.js | 10 - .../ui_installation.md.C7ubLVYa.lean.js | 1 - docs/assets/ui_introduction.md.CpBz5t8n.js | 1 - .../ui_introduction.md.CpBz5t8n.lean.js | 1 - docs/assets/ui_layout.md.DLaYXca7.js | 29 - docs/assets/ui_layout.md.DLaYXca7.lean.js | 1 - docs/assets/ui_modal.md.Hjip_i1A.js | 29 - docs/assets/ui_modal.md.Hjip_i1A.lean.js | 1 - docs/assets/ui_navigation.md.CK3sbH-I.js | 51 - docs/assets/ui_navigation.md.CK3sbH-I.lean.js | 1 - docs/assets/ui_quick.md.Bzj-nQ2u.js | 44 + docs/assets/ui_quick.md.Bzj-nQ2u.lean.js | 1 + docs/examples.html | 6 +- docs/hashmap.json | 2 +- docs/index.html | 2 +- docs/install.html | 37 +- docs/plugins/custom.html | 73 - docs/plugins/quick.html | 52 - docs/ui/button.html | 59 - docs/ui/form.html | 53 - docs/ui/input.html | 85 -- docs/ui/installation.html | 35 - docs/ui/introduction.html | 26 - docs/ui/layout.html | 54 - docs/ui/modal.html | 54 - docs/ui/navigation.html | 76 - docs/ui/quick.html | 69 + docs/vite/plugin.html | 4 +- package.json | 12 +- plugins/debug.js | 41 - plugins/fetch.js | 39 - plugins/index.d.ts | 106 -- plugins/index.js | 4 - plugins/ui.js | 583 -------- sigpro/llms.txt | 355 ----- sigpro/sigpro.d.ts | 387 ----- sigpro/sigpro.js | 356 +++-- sigpro/sigpro.min.js | 1 + src/docs/.vitepress/config.js | 16 +- src/docs/api/$.md | 142 -- src/docs/api/effect.md | 90 ++ src/docs/api/html.md | 144 +- src/docs/api/ignore.md | 75 + src/docs/api/mount.md | 95 +- src/docs/api/quick.md | 186 +-- src/docs/api/router.md | 153 +- src/docs/api/signal.md | 68 + src/docs/api/tags.md | 156 ++- src/docs/api/view.md | 78 ++ src/docs/install.md | 78 +- src/docs/plugins/custom.md | 97 -- src/docs/plugins/quick.md | 94 -- src/docs/ui/button.md | 114 -- src/docs/ui/form.md | 112 -- src/docs/ui/input.md | 137 -- src/docs/ui/installation.md | 53 - src/docs/ui/introduction.md | 33 - src/docs/ui/layout.md | 117 -- src/docs/ui/modal.md | 90 -- src/docs/ui/navigation.md | 124 -- src/docs/ui/quick.md | 118 ++ 121 files changed, 3038 insertions(+), 4707 deletions(-) create mode 100644 UI/aggrid/aggrid-lib.js create mode 100644 UI/aggrid/aggrid.js create mode 100644 UI/aggrid/vite.config.js create mode 100644 UI/index.js create mode 100644 UI/sigpro-ui.js create mode 100644 UI/sigpro-ui.min.js delete mode 100644 docs/api/$.html create mode 100644 docs/api/effect.html create mode 100644 docs/api/ignore.html create mode 100644 docs/api/signal.html create mode 100644 docs/api/view.html delete mode 100644 docs/assets/api__.md.BV8uIOD5.js delete mode 100644 docs/assets/api__.md.BV8uIOD5.lean.js create mode 100644 docs/assets/api_effect.md.jV8KzXq5.js create mode 100644 docs/assets/api_effect.md.jV8KzXq5.lean.js delete mode 100644 docs/assets/api_html.md.-lEpgX-Z.js delete mode 100644 docs/assets/api_html.md.-lEpgX-Z.lean.js create mode 100644 docs/assets/api_html.md.COPskx0H.js create mode 100644 docs/assets/api_html.md.COPskx0H.lean.js create mode 100644 docs/assets/api_ignore.md.CxKek-H-.js create mode 100644 docs/assets/api_ignore.md.CxKek-H-.lean.js delete mode 100644 docs/assets/api_mount.md.B9mWME6o.js delete mode 100644 docs/assets/api_mount.md.B9mWME6o.lean.js create mode 100644 docs/assets/api_mount.md.CRwLyxt8.js create mode 100644 docs/assets/api_mount.md.CRwLyxt8.lean.js create mode 100644 docs/assets/api_quick.md.4axUqmd3.js create mode 100644 docs/assets/api_quick.md.4axUqmd3.lean.js delete mode 100644 docs/assets/api_quick.md.OAEBn6rS.js delete mode 100644 docs/assets/api_quick.md.OAEBn6rS.lean.js delete mode 100644 docs/assets/api_router.md.BV6vPWg-.js delete mode 100644 docs/assets/api_router.md.BV6vPWg-.lean.js create mode 100644 docs/assets/api_router.md.Cn98LjXO.js create mode 100644 docs/assets/api_router.md.Cn98LjXO.lean.js create mode 100644 docs/assets/api_signal.md.BmorvARW.js create mode 100644 docs/assets/api_signal.md.BmorvARW.lean.js create mode 100644 docs/assets/api_tags.md.VliNqepa.js create mode 100644 docs/assets/api_tags.md.VliNqepa.lean.js delete mode 100644 docs/assets/api_tags.md.YLRdMyid.js delete mode 100644 docs/assets/api_tags.md.YLRdMyid.lean.js create mode 100644 docs/assets/api_view.md.Bv8Rlx9s.js create mode 100644 docs/assets/api_view.md.Bv8Rlx9s.lean.js rename docs/assets/{install.md.pJydCe65.js => install.md.DmlvO98W.js} (57%) create mode 100644 docs/assets/install.md.DmlvO98W.lean.js delete mode 100644 docs/assets/install.md.pJydCe65.lean.js delete mode 100644 docs/assets/plugins_custom.md.BuhVOLjH.js delete mode 100644 docs/assets/plugins_custom.md.BuhVOLjH.lean.js delete mode 100644 docs/assets/plugins_quick.md.DOyIUaNj.js delete mode 100644 docs/assets/plugins_quick.md.DOyIUaNj.lean.js delete mode 100644 docs/assets/ui_button.md.B087poC6.js delete mode 100644 docs/assets/ui_button.md.B087poC6.lean.js delete mode 100644 docs/assets/ui_form.md.CZVTxszG.js delete mode 100644 docs/assets/ui_form.md.CZVTxszG.lean.js delete mode 100644 docs/assets/ui_input.md.mJqBxkG3.js delete mode 100644 docs/assets/ui_input.md.mJqBxkG3.lean.js delete mode 100644 docs/assets/ui_installation.md.C7ubLVYa.js delete mode 100644 docs/assets/ui_installation.md.C7ubLVYa.lean.js delete mode 100644 docs/assets/ui_introduction.md.CpBz5t8n.js delete mode 100644 docs/assets/ui_introduction.md.CpBz5t8n.lean.js delete mode 100644 docs/assets/ui_layout.md.DLaYXca7.js delete mode 100644 docs/assets/ui_layout.md.DLaYXca7.lean.js delete mode 100644 docs/assets/ui_modal.md.Hjip_i1A.js delete mode 100644 docs/assets/ui_modal.md.Hjip_i1A.lean.js delete mode 100644 docs/assets/ui_navigation.md.CK3sbH-I.js delete mode 100644 docs/assets/ui_navigation.md.CK3sbH-I.lean.js create mode 100644 docs/assets/ui_quick.md.Bzj-nQ2u.js create mode 100644 docs/assets/ui_quick.md.Bzj-nQ2u.lean.js delete mode 100644 docs/plugins/custom.html delete mode 100644 docs/plugins/quick.html delete mode 100644 docs/ui/button.html delete mode 100644 docs/ui/form.html delete mode 100644 docs/ui/input.html delete mode 100644 docs/ui/installation.html delete mode 100644 docs/ui/introduction.html delete mode 100644 docs/ui/layout.html delete mode 100644 docs/ui/modal.html delete mode 100644 docs/ui/navigation.html create mode 100644 docs/ui/quick.html delete mode 100644 plugins/debug.js delete mode 100644 plugins/fetch.js delete mode 100644 plugins/index.d.ts delete mode 100644 plugins/index.js delete mode 100644 plugins/ui.js delete mode 100644 sigpro/llms.txt delete mode 100644 sigpro/sigpro.d.ts create mode 100644 sigpro/sigpro.min.js delete mode 100644 src/docs/api/$.md create mode 100644 src/docs/api/effect.md create mode 100644 src/docs/api/ignore.md create mode 100644 src/docs/api/signal.md create mode 100644 src/docs/api/view.md delete mode 100644 src/docs/plugins/custom.md delete mode 100644 src/docs/plugins/quick.md delete mode 100644 src/docs/ui/button.md delete mode 100644 src/docs/ui/form.md delete mode 100644 src/docs/ui/input.md delete mode 100644 src/docs/ui/installation.md delete mode 100644 src/docs/ui/introduction.md delete mode 100644 src/docs/ui/layout.md delete mode 100644 src/docs/ui/modal.md delete mode 100644 src/docs/ui/navigation.md create mode 100644 src/docs/ui/quick.md diff --git a/UI/aggrid/aggrid-lib.js b/UI/aggrid/aggrid-lib.js new file mode 100644 index 0000000..94f01eb --- /dev/null +++ b/UI/aggrid/aggrid-lib.js @@ -0,0 +1,68 @@ +import { + createGrid, + ModuleRegistry, + ValidationModule, + ColumnAutoSizeModule, + CellStyleModule, + QuickFilterModule, + RowSelectionModule, + TextEditorModule, + ClientSideRowModelModule, + themeQuartz, + iconSetQuartzLight, +} from "ag-grid-community"; + +import { + MultiFilterModule, + CellSelectionModule, + PivotModule, + MasterDetailModule, + SideBarModule, + ColumnsToolPanelModule, + ColumnMenuModule, + StatusBarModule, + ExcelExportModule, + ClipboardModule, +} from "ag-grid-enterprise"; + +// Registro ΓΊnico de mΓ³dulos +ModuleRegistry.registerModules([ + ValidationModule, + ColumnAutoSizeModule, + CellStyleModule, + QuickFilterModule, + RowSelectionModule, + TextEditorModule, + ClientSideRowModelModule, + MultiFilterModule, + CellSelectionModule, + PivotModule, + MasterDetailModule, + SideBarModule, + ColumnsToolPanelModule, + ColumnMenuModule, + StatusBarModule, + ExcelExportModule, + ClipboardModule, +]); + +// Helper de tema exportado +export const getAgTheme = (isDark) => + themeQuartz.withPart(iconSetQuartzLight).withParams({ + browserColorScheme: isDark ? "dark" : "light", + backgroundColor: isDark ? "#121212" : "#FDFDFD", + foregroundColor: isDark ? "#E0E0E0" : "#181D1F", + accentColor: isDark ? "#4FAAFF" : "#004B9C", + headerBackgroundColor: isDark ? "#2A2A2A" : "#EEB111", + headerTextColor: isDark ? "#4FAAFF" : "#004B9C", + borderRadius: 4, + columnBorder: false, + headerFontSize: 14, + headerFontWeight: 600, + listItemHeight: 20, + iconSize: 14, + spacing: 3, + wrapperBorderRadius: 4, + }); + +export { createGrid }; \ No newline at end of file diff --git a/UI/aggrid/aggrid.js b/UI/aggrid/aggrid.js new file mode 100644 index 0000000..365e682 --- /dev/null +++ b/UI/aggrid/aggrid.js @@ -0,0 +1 @@ +Object.freeze([]);function e(e){if(e?.length)return e[e.length-1]}function t(e,t,o){if(e===t)return!0;if(!e||!t)return null==e&&null==t;const s=e.length;if(s!==t.length)return!1;for(let i=0;i=0&&e.splice(o,1)}function i(e,t){let o=0,s=0;for(;o=0;s--)e.splice(o,0,t[s])}var r=e=>null==e||""===e?null:e;function a(e){return null!=e&&""!==e}function l(e){return!a(e)}var d=e=>null!=e&&"function"==typeof e.toString?e.toString():null,c=(e,t)=>(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null),h=(e,t,o=!1)=>null==e?null==t?0:-1:null==t?1:("object"==typeof e&&e.toNumber&&(e=e.toNumber()),"object"==typeof t&&t.toNumber&&(t=t.toNumber()),o&&"string"==typeof e?e.localeCompare(t):e>t?1:e{const o=s?()=>s.wrapIncoming(e):e;t?this.dispatchAsync(o):o()},n=this.getListeners(o,t,!1);if((n?.size??0)>0){const t=new Set(n);for(const o of t)n?.has(o)&&i(()=>o(e))}const r=this.getGlobalListeners(t);if(r.size>0){const t=new Set(r);for(const s of t)i(()=>s(o,e))}}getGlobalListeners(e){return e?this.globalAsyncListeners:this.globalSyncListeners}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const e=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)},t=this.frameworkOverrides;t?t.wrapIncoming(e):e(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[];for(const t of e)t()}},g=/[&<>"']/g,p={"&":"&","<":"<",">":">",'"':""","'":"'"};function m(e){return e?.toString().toString()??null}function f(e){return m(e)?.replace(g,e=>p[e])??null}function C(e){return"string"==typeof e&&e.startsWith("=")&&e.length>1}function v(e){return e.eRootDiv.getRootNode()}function w(e){return v(e).activeElement}function b(e){const{gos:t,eRootDiv:o}=e;let s=null;const i=t.get("getDocument");return i&&a(i)?s=i():o&&(s=o.ownerDocument),s&&a(s)?s:document}function y(e){const t=w(e);return null===t||t===b(e).body}function S(e){return b(e).defaultView||window}function R(e){let t=null,o=null;try{t=b(e).fullscreenElement}catch(s){}finally{t||(t=v(e));const s=t.querySelector("body");o=s||(t instanceof ShadowRoot?t:t instanceof Document?t?.documentElement:t)}return o}function x(e,t,o){null==o||"string"==typeof o&&""==o?D(e,t):F(e,t,o)}function F(e,t,o){e.setAttribute(M(t),o.toString())}function D(e,t){e.removeAttribute(M(t))}function M(e){return`aria-${e}`}function P(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function E(e,t){x(e,"label",t)}function T(e,t){x(e,"labelledby",t)}function A(e,t){x(e,"describedby",t)}function I(e,t){x(e,"live",t)}function k(e,t){x(e,"invalid",t)}function L(e,t){x(e,"hidden",t)}function G(e,t){F(e,"expanded",t)}function N(e,t){F(e,"setsize",t)}function B(e,t){F(e,"posinset",t)}function H(e,t){F(e,"rowindex",t)}function O(e,t){F(e,"colindex",t)}function V(e,t){x(e,"selected",t)}function z(e,t){!function(e,t){x(e,"controls",t)}(e,t.id),T(t,e.id)}function W(e,t){x(e,"owns",t)}function U(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function $(e,t,o){const s=e.parentElement;let i=s&&s.firstChild;for(;i;)t&&i.classList.toggle(t,i===e),o&&i.classList.toggle(o,i!==e),i=i.nextSibling}var j="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function K(e){return!!e&&(!!e.matches("input, select, button, textarea")&&(!!e.matches(j)&&ae(e)))}function _(e,t,o={}){const{skipAriaHidden:s}=o;e.classList.toggle("ag-hidden",!t),s||L(e,!t)}function q(e,t){const o="disabled",s=t?e=>e.setAttribute(o,""):e=>e.removeAttribute(o);s(e);const i=e.querySelectorAll("input")??[];for(const n of i)s(n)}function Y(e,t,o){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof o){if(++s>o)break}else if(e===o)break}return!1}function Z(e){const{height:t,width:o,borderTopWidth:s,borderRightWidth:i,borderBottomWidth:n,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:d,paddingLeft:c,marginTop:h,marginRight:u,marginBottom:g,marginLeft:p,boxSizing:m}=window.getComputedStyle(e),f=Number.parseFloat;return{height:f(t||"0"),width:f(o||"0"),borderTopWidth:f(s||"0"),borderRightWidth:f(i||"0"),borderBottomWidth:f(n||"0"),borderLeftWidth:f(r||"0"),paddingTop:f(a||"0"),paddingRight:f(l||"0"),paddingBottom:f(d||"0"),paddingLeft:f(c||"0"),marginTop:f(h||"0"),marginRight:f(u||"0"),marginBottom:f(g||"0"),marginLeft:f(p||"0"),boxSizing:m}}function Q(e){const t=Z(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom-t.borderTopWidth-t.borderBottomWidth:t.height}function X(e){const t=Z(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight-t.borderLeftWidth-t.borderRightWidth:t.width}function J(e){const{height:t,marginBottom:o,marginTop:s}=Z(e);return Math.floor(t+o+s)}function ee(e){const{width:t,marginLeft:o,marginRight:s}=Z(e);return Math.floor(t+o+s)}function te(e){const t=e.getBoundingClientRect(),{borderTopWidth:o,borderLeftWidth:s,borderRightWidth:i,borderBottomWidth:n}=Z(e);return{top:t.top+(o||0),left:t.left+(s||0),right:t.right+(i||0),bottom:t.bottom+(n||0)}}function oe(e,t){let o=e.scrollLeft;return t&&(o=Math.abs(o)),o}function se(e,t,o){o&&(t*=-1),e.scrollLeft=t}function ie(e){for(;e?.firstChild;)e.firstChild.remove()}function ne(e){e?.parentNode&&e.remove()}function re(e){return!!e.offsetParent}function ae(e){return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!re(e)||"visible"!==window.getComputedStyle(e).visibility)}function le(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function de(e,t,o){o&&o.nextSibling===t||(e.firstChild?o?o.nextSibling?e.insertBefore(t,o.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.prepend(t):e.appendChild(t))}function ce(e,t){for(let o=0;o`-${e.toLocaleLowerCase()}`)}function ue(e,t){if(t)for(const o of Object.keys(t)){const s=t[o];if(!o?.length||null==s)continue;const i=he(o),n=s.toString(),r=n.replace(/\s*!important/g,""),a=r.length!=n.length?"important":void 0;e.style.setProperty(i,r,a)}}function ge(e){return()=>{const t=e();return!t||(function(e){return e.clientWidthi?.disconnect()}function ye(e,t){const o=S(e);o.requestAnimationFrame?o.requestAnimationFrame(t):o.webkitRequestAnimationFrame?o.webkitRequestAnimationFrame(t):o.setTimeout(t,0)}var Se,Re="data-ref";function xe(){return Se??(Se=document.createTextNode(" ")),Se.cloneNode()}function Fe(e){const{attrs:t,children:o,cls:s,ref:i,role:n,tag:r}=e,a=document.createElement(r);if(s&&(a.className=s),i&&a.setAttribute(Re,i),n&&a.setAttribute("role",n),t)for(const l of Object.keys(t))a.setAttribute(l,t[l]);if(o)if("string"==typeof o)a.textContent=o;else{let e=!0;for(const t of o)t&&("string"==typeof t?(a.appendChild(document.createTextNode(t)),e=!1):"function"==typeof t?a.appendChild(t()):(e&&(a.appendChild(xe()),e=!1),a.append(Fe(t)),a.appendChild(xe())))}return a}var De=["touchstart","touchend","touchmove","touchcancel","scroll"],Me=["wheel"],Pe={},Ee=/* @__PURE__ */(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof Pe[t])return Pe[t];const o=document.createElement(e[t]||"div");return Pe[t="on"+t]=t in o}})();function Te(e,t){return!(!t||!e)&&function(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():function(e){const t=[];let o=e.target;for(;o;)t.push(o),o=o.parentElement;return t}(t)}(t).indexOf(e)>=0}var Ae=e=>{const t=De.includes(e),o=Me.includes(e);return!!t||!o&&void 0};function Ie(e,t,o){if(0===o)return!1;const s=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY);return Math.max(s,i)<=o}var ke=(e,t)=>{const o=e.identifier;for(let s=0,i=t.length;s0&&c+e.clientWidth>i+p&&(c=i+p-e.clientWidth),c<0&&(c=0),n>0&&d+e.clientHeight>n+g&&(d=n+g-e.clientHeight),d<0&&(d=0),e.style.left=`${c}px`,e.style.top=`${d}px`}var Ne=(e,...t)=>{for(const o of t){const[t,s,i,n]=o;t.addEventListener(s,i,n),e.push(o)}},Be=e=>{if(e){for(const[t,o,s,i]of e)t.removeEventListener(o,s,i);e.length=0}},He=e=>{e.cancelable&&e.preventDefault()};function Oe(e,t){return t}function Ve(e){return e?.getLocaleTextFunc()??Oe}var ze=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.beans=e,this.stubContext=e.context,this.eventSvc=e.eventSvc,this.gos=e.gos}destroy(){const{destroyFunctions:e}=this;for(let t=0;tnull;let s;if(function(e){return void 0!==e.__addEventListener}(e))e.__addEventListener(t,o),s=()=>(e.__removeEventListener(t,o),null);else{const i=function(e){return"global"===e.eventServiceType}(e);e instanceof HTMLElement?function(e,t,o){const s=Ae(t);let i;null!=s&&(i={passive:s}),e.addEventListener(t,o,i)}(e,t,o):i?e.addListener(t,o):e.addEventListener(t,o),s=i?()=>(e.removeListener(t,o),null):()=>(e.removeEventListener(t,o),null)}return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==s),null)}setupPropertyListener(e,t){const{gos:o}=this;o.addPropertyEventListener(e,t);const s=()=>(o.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==s),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupPropertyListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const o=e.join("-")+this.propertyListenerId++,s=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[o])return;this.lastChangeSetIdLookup[o]=e.changeSet.id}t({type:"propertyChanged",changeSet:e.changeSet,source:e.source})};for(const i of e)this.setupPropertyListener(i,s)}getLocaleTextFunc(){return Ve(this.beans.localeSvc)}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createOptionalManagedBean(e,t){return e?this.createManagedBean(e,t):void 0}createManagedBean(e,t){const o=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),o}createBean(e,t,o){return(t||this.stubContext).createBean(e,o)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};var We=class extends ze{},Ue=/* @__PURE__ */new Set,$e=(e,t)=>{Ue.has(t)||(Ue.add(t),e())};$e._set=Ue;var je={pending:!1,funcs:[]},Ke={pending:!1,funcs:[]};function _e(e,t="setTimeout",o){const s="raf"===t?Ke:je;if(s.funcs.push(e),s.pending)return;s.pending=!0;const i=()=>{const e=s.funcs.slice();s.funcs.length=0,s.pending=!1;for(const t of e)t()};"raf"===t?ye(o,i):window.setTimeout(i,0)}function qe(e,t,o){let s;return function(...i){const n=this;return window.clearTimeout(s),s=window.setTimeout(function(){e.isAlive()&&t.apply(n,i)},o),s}}function Ye(e,t){let o=0;return function(...s){const i=Date.now();i-o{null!=n&&(window.clearInterval(n),n=null)};e.addDestroyFunc(a);const l=()=>{const e=Date.now()-i>s;(t()||e)&&(o(),r=!0,a())};l(),r||(n=window.setInterval(l,10))}var Qe=/* @__PURE__ */new Set(["__proto__","constructor","prototype"]);function Xe(e,t,o=!0,s=!1){a(t)&&function(e,t){if(null!=e)if(Array.isArray(e))for(let o=0;o!Qe.has(e)))t(o,e[o])}(t,(t,i)=>{let n=e[t];n!==i&&(s&&null==n&&null!=i&&"object"==typeof i&&i.constructor===Object&&(n={},e[t]=n),Je(i)&&Je(n)&&!Array.isArray(n)?Xe(n,i,o,s):(o||void 0!==i)&&(e[t]=i))})}function Je(e){return"object"==typeof e&&null!==e}var et=class e{static applyGlobalGridOptions(t){if(!e.gridOptions)return{...t};let o={};return Xe(o,e.gridOptions,!0,!0),"deep"===e.mergeStrategy?Xe(o,t,!0,!0):o={...o,...t},e.gridOptions.context&&(o.context=e.gridOptions.context),t.context&&("deep"===e.mergeStrategy&&o.context&&Xe(t.context,o.context,!0,!0),o.context=t.context),o}static applyGlobalGridOption(t,o){if("deep"===e.mergeStrategy){const i=(s=t,tt.gridOptions?.[s]);if(i&&"object"==typeof i&&"object"==typeof o)return e.applyGlobalGridOptions({[t]:o})[t]}var s;return o}};et.gridOptions=void 0,et.mergeStrategy="shallow";var tt=et;var ot={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipSwitchShowDelay:200,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,cellFlashDuration:500,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,refreshAfterGroupEdit:!1,rowDragInsertDelay:500,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1,enableFilterHandlers:!1},st="https://www.ag-grid.com";function it(e,t,...o){e.get("debug")&&console.log("AG Grid: "+t,...o)}function nt(e,...t){$e(()=>console.warn("AG Grid: "+e,...t),e+t?.join(""))}function rt(e,...t){$e(()=>console.error("AG Grid: "+e,...t),e+t?.join(""))}var at,lt=/* @__PURE__ */new Set,dt={},ct={},ht=!1,ut=!1;function gt(e){at||(at=e.version);const t=e=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${e} Please update all modules to the same version.`;e.version?function(e){const[t,o]=e.version.split(".")||[],[s,i]=at.split(".")||[];return t===s&&o===i}(e)||rt(t(`'${e.moduleName}' is version ${e.version} but the other modules are version ${at}.`)):rt(t(`'${e.moduleName}' is incompatible.`));const o=e.validate?.();o&&!o.isValid&&rt(`${o.message}`)}function pt(e,t,o=!1){o||(ht=!0),gt(e);const s=e.rowModels??["all"];let i;lt.add(e),void 0!==t?(ut=!0,void 0===ct[t]&&(ct[t]={}),i=ct[t]):i=dt;for(const n of s)void 0===i[n]&&(i[n]={}),i[n][e.moduleName]=e;if(e.dependsOn)for(const n of e.dependsOn)pt(n,t,o)}function mt(e,t,o){const s=o=>!!dt[o]?.[e]||!!ct[t]?.[o]?.[e];return s(o)||s("all")}function ft(){return ut}function Ct(e,t){const o=ct[e]??{};return[...Object.values(o.all??{}),...Object.values(o[t]??{})]}var vt="35.1.0",wt="_version_",bt=null,yt=`${st}/javascript-data-grid`;function St(e,t,o){return bt?.(e,t)??[Pt(e,t,o)]}function Rt(e,t,o,s,i){e(`${s?"warning":"error"} #${t}`,...St(t,o,i))}function xt(e){let t=e;return e instanceof Error?t=e.toString():"object"==typeof e&&(t=function(e){if(!e)return String(e);const t={};for(const o of Object.keys(e))"object"!=typeof e[o]&&"function"!=typeof e[o]&&(t[o]=e[o]);return JSON.stringify(t)}(e)),t}function Ft(e){return void 0===e?"undefined":null===e?"null":e}function Dt(e,t){return`${e}?${t.toString()}`}function Mt(e,t){const o=new URLSearchParams;if(o.append(wt,vt),t)for(const n of Object.keys(t))o.append(n,xt(t[n]));const s=`${yt}/errors/${e}`,i=Dt(s,o);return i.length<=2e3?i:function(e,t,o){const s=Array.from(t.entries()).sort((e,t)=>t[1].length-e[1].length);let i=Dt(e,t);for(const[n,r]of s){if(n===wt)continue;const s=i.length-o;if(s<=0)break;const a="...",l=s+3,d=r.length-l>100?r.slice(0,r.length-l)+a:r.slice(0,100)+a;t.set(n,d),i=Dt(e,t)}return i}(s,o,2e3)}var Pt=(e,t,o)=>{const s=`${o?o+" \n":""}Visit ${Mt(e,t)}`;return`${s}${o?"":" \n Alternatively register the ValidationModule to see the full message in the console."}`};function Et(...e){Rt(nt,e[0],e[1],!0)}function Tt(...e){Rt(rt,e[0],e[1],!1)}function At(e,t,o){Rt(rt,e,t,!1,o)}function It(...e){return function(e,t){const o=t[0];return`error #${o} `+St(o,t[1],e).join(" ")}(void 0,e)}function kt(e,t){return e.get("rowModelType")===t}function Lt(e,t){return kt(e,"clientSide")}function Gt(e,t){return kt(e,"serverSide")}function Nt(e,t){return e.get("domLayout")===t}function Bt(e){return void 0!==ho(e)}function Ht(e){return"function"==typeof e.get("getRowHeight")}function Ot(e,t,o=!1,s){const{gos:i,environment:n}=e;if(null==s&&(s=n.getDefaultRowHeight()),Ht(i)){if(o)return{height:s,estimated:!0};const e={node:t,data:t.data},n=i.getCallback("getRowHeight")(e);if(zt(n))return 0===n&&Et(23),{height:Math.max(1,n),estimated:!1}}if(t.detail&&i.get("masterDetail"))return function(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return zt(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}(i);const r=i.get("rowHeight");return{height:r&&zt(r)?r:s,estimated:!1}}function Vt(e){const{environment:t,gos:o}=e,s=o.get("rowHeight");if(!s||l(s))return t.getDefaultRowHeight();const i=t.refreshRowHeightVariable();return-1!==i?i:(Et(24),t.getDefaultRowHeight())}function zt(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}function Wt(e,t,o){const s=t[e.getDomDataKey()];return s?s[o]:void 0}function Ut(e,t,o,s){const i=e.getDomDataKey();let n=t[i];l(n)&&(n={},t[i]=n),n[o]=s}function $t(e){return!e.get("ensureDomOrder")&&e.get("animateRows")}function jt(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||Nt(e,"print"))}function Kt(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function _t(e){const t=e.get("groupAggFiltering");return"function"==typeof t?e.getCallback("groupAggFiltering"):!0===t?()=>!0:void 0}function qt(e){return e.get("grandTotalRow")}function Yt(e){const t=e.get("groupTotalRow");return"function"==typeof t?e.getCallback("groupTotalRow"):()=>t??void 0}function Zt(e){return!!e.get("groupHideOpenParents")||"multipleColumns"===e.get("groupDisplayType")}function Qt(e,t){return!t&&"groupRows"===e.get("groupDisplayType")}function Xt(e,t,o){return!!t.group&&!t.footer&&Qt(e,o)}function Jt(e){const t=e.getCallback("getRowId");return void 0===t?t:e=>{let o=t(e);return"string"!=typeof o&&($e(()=>Et(25,{id:o}),"getRowIdString"),o=String(o)),o}}function eo(e,t){const o=e.get("suppressGroupChangesColumnVisibility");if(!0===o)return!1;if(t&&"suppressHideOnGroup"===o)return!1;if(!t&&"suppressShowOnUngroup"===o)return!1;const s=e.get("suppressRowGroupHidesColumns");if(t&&!0===s)return!1;const i=e.get("suppressMakeColumnVisibleAfterUnGroup");return!(!t&&!0===i)}function to(e){return e?.checkboxes??!0}function oo(e){return"multiRow"===e?.mode&&(e.headerCheckbox??!0)}function so(e){if("object"==typeof e)return e.checkboxLocation??"selectionColumn"}function io(e){return e?.hideDisabledCheckboxes??!1}function no(e){const t=e.get("cellSelection");return void 0!==t?!!t:e.get("enableRangeSelection")}function ro(e){const t=e.get("cellSelection");return void 0===t?{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}:"boolean"!=typeof t&&"fill"===t.handle?.mode?t.handle:void 0}function ao(e){const t=e.get("cellSelection")??!1;return("object"==typeof t&&t.enableColumnSelection)??!1}function lo(e){const t=e.get("rowSelection")??"single";if("string"==typeof t){const t=e.get("suppressRowClickSelection"),o=e.get("suppressRowDeselection");return(!t||!o)&&(t?"enableDeselection":!o||"enableSelection")}return("singleRow"===t.mode||"multiRow"===t.mode)&&(t.enableClickSelection??!1)}function co(e){const t=e.get("rowSelection");return"string"==typeof t?e.get("isRowSelectable"):t?.isRowSelectable}function ho(e){const t="beanName"in e&&"gos"===e.beanName?e.get("rowSelection"):e.rowSelection;if("string"==typeof t)switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}switch(t?.mode){case"multiRow":case"singleRow":return t.mode;default:return}}function uo(e){return"multiRow"===ho(e)}function go(e){const t=e.get("rowSelection");if("string"==typeof t){const t=e.get("groupSelectsChildren"),o=e.get("groupSelectsFiltered");return t&&o?"filteredDescendants":t?"descendants":"self"}return"multiRow"===t?.mode?t.groupSelects:void 0}function po(e,t=!0){const o=e.get("rowSelection");return"object"!=typeof o?t?"all":void 0:"multiRow"===o.mode?o.selectAll:"all"}function mo(e){const t=go(e);return"descendants"===t||"filteredDescendants"===t}function fo(e){const t=e.get("rowSelection");return"object"==typeof t&&t.masterSelects||"self"}function Co(e){return"legacy"===e.get("columnMenu")}function vo(e){return!Co(e)}function wo(e,t){return e.addCommon(t)}function bo({gos:e},t){return 2===t.button||t.ctrlKey&&e.get("allowContextMenuWithControlKey")}var yo={resizable:!0,sortable:!0},So=0;function Ro(){return So++}function xo(e){return e instanceof Mo}var Fo=["asc","desc",null],Do=[{type:"absolute",direction:"asc"},{type:"absolute",direction:"desc"},null],Mo=class extends We{constructor(e,t,o,s){super(),this.colDef=e,this.userProvidedColDef=t,this.colId=o,this.primary=s,this.isColumn=!0,this.instanceId=Ro(),this.autoHeaderHeight=null,this.sortDef=Po(),this._wasSortExplicitlyRemoved=!1,this.moving=!1,this.resizing=!1,this.menuVisible=!1,this.formulaRef=null,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.colEventSvc=new u,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.flex=null,this.colIdSanitised=f(o)}destroy(){super.destroy(),this.beans.rowSpanSvc?.deregister(this)}getInstanceId(){return this.instanceId}initState(){const{colDef:e,beans:{sortSvc:t,pinnedCols:o,colFlex:s}}=this;t?.initCol(this);const i=e.hide;this.visible=void 0!==i?!i:!e.initialHide,o?.initCol(this),s?.initCol(this)}setColDef(e,t,o){const s=e.spanRows!==this.colDef.spanRows;this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),s&&(this.beans.rowSpanSvc?.deregister(this),this.initRowSpan()),this.dispatchColEvent("colDefChanged",o)}getUserProvidedColDef(){return this.userProvidedColDef}getParent(){return this.parent}getOriginalParent(){return this.originalParent}postConstruct(){this.initState(),this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.initRowSpan(),this.addPivotListener()}initDotNotation(){const{gos:e,colDef:{field:t,tooltipField:o}}=this,s=e.get("suppressFieldDotNotation");this.fieldContainsDots=a(t)&&t.includes(".")&&!s,this.tooltipFieldContainsDots=a(o)&&o.includes(".")&&!s}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.beans.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.beans.tooltipSvc?.initCol(this)}initRowSpan(){this.colDef.spanRows&&this.beans.rowSpanSvc?.register(this)}addPivotListener(){const e=this.beans.pivotColDefSvc,t=this.colDef.pivotValueColumn;e&&t&&this.addManagedListeners(t,{colDefChanged:t=>{const o=e.recreateColDef(this.colDef);this.setColDef(o,o,t.source)}})}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){const t=e.width??e.initialWidth??200;return Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){return this.beans.showRowGroupCols?.isRowGroupDisplayed(this,e)??!1}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}getHighlighted(){return this.highlighted}__addEventListener(e,t){this.colEventSvc.addEventListener(e,t)}__removeEventListener(e,t){this.colEventSvc.removeEventListener(e,t)}addEventListener(e,t){this.frameworkEventListenerService=this.beans.frameworkOverrides.createLocalEventListenerWrapper?.(this.frameworkEventListenerService,this.colEventSvc);const o=this.frameworkEventListenerService?.wrap(e,t)??t;this.colEventSvc.addEventListener(e,o)}removeEventListener(e,t){const o=this.frameworkEventListenerService?.unwrap(e,t)??t;this.colEventSvc.removeEventListener(e,o)}createColumnFunctionCallbackParams(e){return wo(this.gos,{node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){return this.beans.cellNavigation?.isSuppressNavigable(this,e)??!1}isCellEditable(e){return this.beans.editSvc?.isCellEditable({rowNode:e,column:this})??!1}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.beans.selectionSvc?.isCellCheckboxSelection(this,e)??!1}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?.suppressPaste??null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??yo[e]}isColumnFunc(e,t){return"boolean"==typeof t?t:"function"==typeof t&&t(this.createColumnFunctionCallbackParams(e))}createColumnEvent(e,t){return wo(this.gos,{type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sortDef.direction}getSortDef(){return this.sortDef.direction?this.sortDef:null}getColDefAllowedSortTypes(){const e=[],{sort:t,initialSort:o}=this.colDef,s=null===t?t:Lo(t?.type),i=null===o?o:Lo(o?.type);return s&&e.push(s),i&&e.push(i),e}getSortingOrder(){const e=this.getColDefAllowedSortTypes().includes("absolute")?Do:Fo;return(this.colDef.sortingOrder??this.gos.get("sortingOrder")??e).map(e=>Po(e))}getAvailableSortTypes(){const e=this.getSortingOrder().reduce((e,t)=>(t.direction&&e.push(t.type),e),this.getColDefAllowedSortTypes());return new Set(e)}get wasSortExplicitlyRemoved(){return this._wasSortExplicitlyRemoved}setSortDef(e,t=!1){t||(this._wasSortExplicitlyRemoved=!e.direction),this.sortDef=e}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return"asc"===this.getSort()}isSortDescending(){return"desc"===this.getSort()}isSortNone(){return l(this.getSort())}isSorting(){return a(this.getSort())}getSortIndex(){return this.sortIndex}isMenuVisible(){return this.menuVisible}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchColEvent("leftChanged",t))}isFilterActive(){return this.filterActive}isHovered(){return Et(261),!!this.beans.colHover?.isHovered(this)}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.dispatchColEvent("firstRightPinnedChanged",t))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.dispatchColEvent("lastLeftPinnedChanged",t))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const o=!0===e;this.visible!==o&&(this.visible=o,this.dispatchColEvent("visibleChanged",t)),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}getFirstRealParent(){let e=this.getOriginalParent();for(;e?.isPadding();)e=e.getOriginalParent();return e}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e?.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let o=!0;for(;e;){if(!e.isPadding()){o=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:o}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return wo(this.gos,{node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(l(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),o=this.colDef.colSpan(t);return Math.max(o,1)}getRowSpan(e){if(l(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),o=this.colDef.rowSpan(t);return Math.max(o,1)}setActualWidth(e,t,o=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,null!=this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),o||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.dispatchColEvent("widthChanged",e)}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex}isRowGroupActive(){return this.rowGroupActive}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}isAllowFormula(){return!0===this.colDef.allowFormula}dispatchColEvent(e,t,o){const s=this.createColumnEvent(e,t);o&&Xe(s,o),this.colEventSvc.dispatchEvent(s)}dispatchStateUpdatedEvent(e){this.colEventSvc.dispatchEvent({type:"columnStateUpdated",key:e})}};function Po(e){return Ao(e)?{direction:e.direction,type:e.type}:{direction:ko(e),type:Lo(e)}}function Eo(e){return"asc"===e||"desc"===e||null===e}function To(e){return"default"===e||"absolute"===e}function Ao(e){if(!e||"object"!=typeof e)return!1;const t=e;return To(t.type)&&Eo(t.direction)}function Io(e,t){return e?t?e.type===t.type&&e.direction===t.direction:!e||null===e.direction:!t||null===t.direction}function ko(e){return Eo(e)?e:null}function Lo(e){return To(e)?e:"default"}function Go(e,t){const o=t.sortSvc.getDisplaySortForColumn(e),s=Lo(o?.type),i=ko(o?.direction),n=e.getAvailableSortTypes();return{isDefaultSortAllowed:n.has("default"),isAbsoluteSortAllowed:n.has("absolute"),isAbsoluteSort:"absolute"===s,isDefaultSort:"default"===s,isAscending:"asc"===i,isDescending:"desc"===i,direction:i}}function No(e){return e instanceof Bo}var Bo=class extends We{constructor(e,t,o,s){super(),this.colGroupDef=e,this.groupId=t,this.padding=o,this.level=s,this.isColumn=!1,this.expandable=!1,this.instanceId=Ro(),this.expandableListenerRemoveCallback=null,this.expanded=!!e?.openByDefault}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return!!this.children&&this.children.some(e=>e.isVisible())}isPadding(){return this.padding}setExpanded(e){this.expanded=void 0!==e&&e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}forEachLeafColumn(e){if(this.children)for(const t of this.children)xo(t)?e(t):No(t)&&t.forEachLeafColumn(e)}addLeafColumns(e){if(this.children)for(const t of this.children)xo(t)?e.push(t):No(t)&&t.addLeafColumns(e)}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);for(const t of this.getLeafColumns())t.__addEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=()=>{for(const t of this.getLeafColumns())t.__removeEventListener("visibleChanged",e);this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,o=!1;const s=this.findChildrenRemovingPadding();for(let n=0,r=s.length;n{for(const s of o)No(s)&&s.isPadding()?t(s.children):e.push(s)};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},Ho={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function Oo(e,t,o){const s={},i=e.gos;return Object.assign(s,i.get("defaultColGroupDef")),Object.assign(s,t),i.validateColDef(s,o),s}var Vo=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t0&&Et(273,{providedId:e,usedId:t}),this.existingKeys[t]=!0,t}o++}}},zo="ag-Grid-AutoColumn";function Wo(e){const t=[],o=e=>{for(let s=0;se+t.getActualWidth(),0)}function $o(e,t,o){const s={};if(!t)return;us(null,t,e=>{s[e.getInstanceId()]=e}),o&&us(null,o,e=>{s[e.getInstanceId()]=null});const i=Object.values(s).filter(e=>null!=e);e.context.destroyBeans(i)}function jo(e){return e.getId().startsWith(zo)}function Ko(e){return("string"==typeof e?e:"getColId"in e?e.getColId():e.colId)?.startsWith("ag-Grid-SelectionColumn")??!1}function _o(e){return("string"==typeof e?e:"getColId"in e?e.getColId():e.colId)?.startsWith("ag-Grid-RowNumbersColumn")??!1}function qo(e){return Ko(e)||_o(e)}function Yo(e){let t=[];return e instanceof Array?t=e:"string"==typeof e&&(t=e.split(",")),t}function Zo(e,o){return t(e,o,(e,t)=>e.getColId()===t.getColId())}function Qo(e){e.map={};for(const t of e.list)e.map[t.getId()]=t}function Xo(e){return"optionsUpdated"===e?"gridOptionsChanged":e}function Jo(e,t){return e===t||e.colId==t||e.getColDef()===t}function es(e,t){const o={...e,sort:void 0,colId:t},s=ts(e);return s&&(o.sort=s.direction,o.sortType=s.type),o}function ts(e){const{sort:t,initialSort:o}=e,s=Ao(t)||Eo(t),i=Ao(o)||Eo(o);return s?Po(t):i?Po(o):null}var os=(e,t)=>{No(e)&&e.setupExpandable(),e.originalParent=t};function ss(e,t=null,o,s,i){const{existingCols:n,existingGroups:r}=ns(s),a=new Map(n.map(e=>[e.getId(),e])),l=new Map(r.map(e=>[e.getId(),e]));let d=0;const c=(t,s)=>{if(d=Math.max(d,s),hs(t)){if(!e.colGroupSvc)return null;const o=t.groupId,i=l.get(o),n=new Bo(Oo(e,t,o),o,!1,s);return e.context.createBean(n),i&&n.setExpanded(i.isExpanded()),n.setChildren(t.children.map(e=>c(e,s+1))),n}const n=t.colId;let r=a.get(n);const h=cs(e,t,r?.getColId()??n);return r?(r.setColDef(h,t,i),ds(e,r,h,i)):(r=new Mo(h,t,n,o),e.context.createBean(r)),e.dataTypeSvc?.addColumnListeners(r),r},h=t?.map(e=>c(e,0))??[];let u=0;const g=e.colGroupSvc?e.colGroupSvc.balanceColumnTree(h,0,d,{getUniqueKey:(e,t)=>String(++u)}):h;return us(null,g,os),{columnTree:g,treeDepth:d}}function is(e,t=null,o,s,i){const n=new Vo,{existingCols:r,existingGroups:a,existingColKeys:l}=ns(s);n.addExistingKeys(l);const d=rs(e,t,0,o,r,n,a,i),{colGroupSvc:c}=e,h=c?.findMaxDepth(d,0)??0,u=c?c.balanceColumnTree(d,0,h,n):d;return us(null,u,os),{columnTree:u,treeDepth:h}}function ns(e){const t=[],o=[],s=[];return e&&us(null,e,e=>{if(No(e)){const t=e;o.push(t)}else{const o=e;s.push(o.getId()),t.push(o)}}),{existingCols:t,existingGroups:o,existingColKeys:s}}function rs(e,t,o,s,i,n,r,a){if(!t)return[];const{colGroupSvc:l}=e,d=new Array(t.length);for(let c=0;c0))if(null!=o.width)t.setActualWidth(o.width,s);else{const e=t.getActualWidth();t.setActualWidth(e,s)}}function cs(e,t,o,s){const{gos:i,dataTypeSvc:n}=e,r={};Xe(r,i.get("defaultColDef"),!1,!0);const a=function(e,t,o,s){const i=e.dataTypeSvc?.updateColDefAndGetColumnType(t,o,s),n=o.type??i??t.type;return t.type=n,n?Yo(n):void 0}(e,r,t,o);a&&function(e,t,o){if(!t.length)return;const s=Object.assign({},Ho),i=e.gos.get("columnTypes")||{};for(const n of Object.keys(i)){const e=i[n];n in s?Et(34,{key:n}):(e.type&&Et(35),s[n]=e)}for(const n of t){const e=s[n.trim()];e?Xe(o,e,!1,!0):Et(36,{t:n})}}(e,a,r);const l=r.cellDataType;Xe(r,t,!1,!0),void 0!==l&&(r.cellDataType=l);const d=i.get("autoGroupColumnDef"),c=Kt(i);return t.rowGroup&&d&&c&&Xe(r,{sort:d.sort,initialSort:d.initialSort},!1,!0),n?.postProcess(r),n?.validateColDef(r),i.validateColDef(r,o,s),r}function hs(e){return void 0!==e.children}function us(e,t,o){if(t)for(let s=0;s{const t=e.getColDef().lockPosition;"right"===t?i.push(e):"left"===t||!0===t?o.push(e):s.push(e)}),t.get("enableRtl")?[...i,...s,...o]:[...o,...s,...i]}function ps(e,t){let o=!0;return us(null,t,t=>{if(!No(t))return;const s=t;if(!s.getColGroupDef()?.marryChildren)return;const i=[];for(const o of s.getLeafColumns()){const t=e.indexOf(o);i.push(t)}Math.max.apply(Math,i)-Math.min.apply(Math,i)>s.getLeafColumns().length-1&&(o=!1)}),o}function ms(e,t){if(!e||0==e.length)return;const o=t(e[0]);for(let s=1;se.getPinned());e.dispatchEvent({type:"columnPinned",pinned:null!=i?i:null,columns:t,column:s,source:o})}function Cs(e,t,o,s){e.dispatchEvent({type:t,columns:o,column:o&&1==o.length?o[0]:null,source:s})}function vs(e,t,o,s,i=null){t?.length&&e.dispatchEvent({type:"columnResized",columns:t,column:1===t.length?t[0]:null,flexColumns:i,finished:o,source:s})}function ws(e,t,o){const{colModel:i,rowGroupColsSvc:n,pivotColsSvc:r,autoColSvc:l,selectionColSvc:d,colAnimation:c,visibleCols:h,pivotResultCols:u,environment:g,valueColsSvc:p,eventSvc:m,gos:f}=e,C=i.getColDefCols()??[],v=d?.getColumns();if(!C.length&&!v?.length)return!1;if(t?.state&&!t.state.forEach)return Et(32),!1;const w=(s,i,l,d,c)=>{if(!s)return;const h=((e,t)=>(o,s)=>{const i={value1:void 0,value2:void 0};let n=!1;return e&&(void 0!==e[o]&&(i.value1=e[o],n=!0),a(s)&&void 0!==e[s]&&(i.value2=e[s],n=!0)),!n&&t&&(void 0!==t[o]&&(i.value1=t[o]),a(s)&&void 0!==t[s]&&(i.value2=t[s])),i})(i,t.defaultState),u=h("flex").value1,m=h("sort").value1,f=h("sortType").value1,C=Eo(m)||To(f),v=Lo(f),w=ko(m),b=C?{type:v,direction:w}:void 0;if(ls(e,s,h("hide").value1,b,h("sortIndex").value1,h("pinned").value1,u,o),null==u){const e=h("width").value1;if(null!=e){const t=s.getColDef().minWidth??g.getDefaultColumnMinWidth();null!=t&&e>=t&&s.setActualWidth(e,o)}}!c&&s.isPrimary()&&(p?.syncColumnWithState(s,o,h),n?.syncColumnWithState(s,o,h,l),r?.syncColumnWithState(s,o,h,d))},b=(a,c,u)=>{const g=bs(e,o),p=c.slice(),C={},v={},b=[],y=[],S=[];let R=0;const x=n?.columns.slice()??[],F=r?.columns.slice()??[];for(const e of a){const t=e.colId;if(t.startsWith("ag-Grid-AutoColumn")){b.push(e),S.push(e);continue}if(Ko(t)){y.push(e),S.push(e);continue}const o=u(t);o?(w(o,e,C,v,!1),s(p,o)):(S.push(e),R+=1)}const D=e=>w(e,null,C,v,!1);p.forEach(D),n?.sortColumns(Rs.bind(n,C,x)),r?.sortColumns(Rs.bind(r,v,F)),i.refreshCols(!1,o);const M=(e,t,o=[])=>{for(const i of t){const t=e(i.colId);s(o,t),w(t,i,null,null,!0)}o.forEach(D)};return M(e=>l?.getColumn(e)??null,b,l?.getColumns()?.slice()),M(e=>d?.getColumn(e)??null,y,d?.getColumns()?.slice()),function(e,t,o){if(!e.applyOrder||!e.state)return;const s=[];for(const i of e.state)null!=i.colId&&s.push(i.colId);!function(e,t,o,s){if(null==e)return;let i=[];const n={};for(const a of t){if(n[a])continue;const t=e.map[a];t&&(i.push(t),n[a]=!0)}let r=0;for(const a of e.list){const e=a.getColId();null==n[e]&&(e.startsWith("ag-Grid-AutoColumn")?i.splice(r++,0,a):i.push(a))}if(i=gs(i,s),!ps(i,o.getColTree()))return void Et(39);e.list=i}(t.cols,s,t,o)}(t,i,f),h.refresh(o),m.dispatchEvent({type:"columnEverythingChanged",source:o}),g(),{unmatchedAndAutoStates:S,unmatchedCount:R}};c?.start();let{unmatchedAndAutoStates:y,unmatchedCount:S}=b(t.state||[],C,e=>i.getColDefCol(e));return(y.length>0||a(t.defaultState))&&(S=b(y,u?.getPivotResultCols()?.list??[],e=>u?.getPivotResultCol(e)??null).unmatchedCount),c?.finish(),0===S}function bs(e,o){const{rowGroupColsSvc:s,pivotColsSvc:i,valueColsSvc:n,colModel:r,sortSvc:a,eventSvc:l}=e,d={rowGroupColumns:s?.columns.slice()??[],pivotColumns:i?.columns.slice()??[],valueColumns:n?.columns.slice()??[]},c=ys(e),h={};for(const t of c)h[t.colId]=t;return()=>{const n=(e,s,i,n)=>{if(t(s.map(n),i.map(n)))return;const r=new Set(s);for(const t of i)r.delete(t)||r.add(t);const a=[...r];l.dispatchEvent({type:e,columns:a,column:1===a.length?a[0]:null,source:o})},u=e=>{const t=[];return r.forAllCols(o=>{const s=h[o.getColId()];s&&e(s,o)&&t.push(o)}),t},g=e=>e.getColId();n("columnRowGroupChanged",d.rowGroupColumns,s?.columns??[],g),n("columnPivotChanged",d.pivotColumns,i?.columns??[],g);const p=u((e,t)=>{const o=null!=e.aggFunc,s=o!=t.isValueActive(),i=o&&e.aggFunc!=t.getAggFunc();return s||i});p.length>0&&Cs(l,"columnValueChanged",p,o);vs(l,u((e,t)=>e.width!=t.getActualWidth()),!0,o);fs(l,u((e,t)=>e.pinned!=t.getPinned()),o);!function(e,t,o){if(!t.length)return;const s=1===t.length?t[0]:null,i=ms(t,e=>e.isVisible());e.dispatchEvent({type:"columnVisible",visible:i,columns:t,column:s,source:o})}(l,u((e,t)=>e.hide==t.isVisible()),o);const m=u((e,t)=>!Io(t.getSortDef(),{type:Lo(e.sortType),direction:ko(e.sort)})||e.sortIndex!=t.getSortIndex());m.length>0&&a?.dispatchSortChangedEvents(o,m),function(e,t,o,s,i){const n={};for(const c of t)n[c.colId]=c;const r={};for(const c of e)n[c.colId]&&(r[c.colId]=!0);const a=e.filter(e=>r[e.colId]),l=t.filter(e=>r[e.colId]),d=[];if(l.forEach((e,t)=>{const o=a?.[t];if(o&&o.colId!==e.colId){const e=s.getCol(o.colId);e&&d.push(e)}}),!d.length)return;i.dispatchEvent({type:"columnMoved",columns:d,column:1===d.length?d[0]:null,finished:!0,source:o})}(c,ys(e),o,r,l)}}function ys(e){const{colModel:t,rowGroupColsSvc:o,pivotColsSvc:s}=e;if(l(t.getColDefCols())||!t.isAlive())return[];const i=o?.columns,n=s?.columns,r=[];t.forAllCols(e=>(e=>{const t=e.isRowGroupActive()&&i?i.indexOf(e):null,o=e.isPivotActive()&&n?n.indexOf(e):null,s=e.isValueActive()?e.getAggFunc():null,a=null!=e.getSortIndex()?e.getSortIndex():null;r.push({colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:e.getSort(),sortType:e.getSortDef()?.type,sortIndex:a,aggFunc:s,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:o,flex:e.getFlex()??null})})(e));const a=new Map(t.getCols().map((e,t)=>[e.getColId(),t]));return r.sort((e,t)=>(a.has(e.colId)?a.get(e.colId):-1)-(a.has(t.colId)?a.get(t.colId):-1)),r}function Ss(e){const t=(e,t)=>null!=e?e:null!=t?t:null,o=e.getColDef(),s=Po(t(o.sort,o.initialSort)),i=s.direction,n=s.type,r=t(o.sortIndex,o.initialSortIndex),a=t(o.hide,o.initialHide),l=t(o.pinned,o.initialPinned),d=t(o.width,o.initialWidth),c=t(o.flex,o.initialFlex);let h=t(o.rowGroupIndex,o.initialRowGroupIndex),u=t(o.rowGroup,o.initialRowGroup);null!=h||u||(h=null,u=null);let g=t(o.pivotIndex,o.initialPivotIndex),p=t(o.pivot,o.initialPivot);null!=g||p||(g=null,p=null);const m=t(o.aggFunc,o.initialAggFunc);return{colId:e.getColId(),sort:i,sortType:n,sortIndex:r,hide:a,pinned:l,width:d,flex:c,rowGroup:u,rowGroupIndex:h,pivot:p,pivotIndex:g,aggFunc:m}}var Rs=(e,t,o,s)=>{const i=e[o.getId()],n=e[s.getId()],r=null!=i,a=null!=n;if(r&&a)return i-n;if(r)return-1;if(a)return 1;const l=t.indexOf(o),d=t.indexOf(s),c=l>=0;return c&&d>=0?l-d:c?-1:1};function xs(e,t){return e+"_"+t}function Fs(e){return e instanceof Ds}var Ds=class extends We{constructor(e,t,o,s){super(),this.providedColumnGroup=e,this.groupId=t,this.partId=o,this.pinned=s,this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.colIdSanitised=f(this.getUniqueId())}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}getUniqueId(){return xs(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every(e=>e.isMoving())}checkLeft(){for(const e of this.displayedChildren)Fs(e)&&e.checkLeft();if(this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=e(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;for(const t of this.displayedChildren??[])e+=t.getActualWidth();return e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;for(const t of this.displayedChildren)t.isResizable()&&(e=!0);return e}getMinWidth(){let e=0;for(const t of this.displayedChildren)e+=t.getMinWidth();return e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}isAutoHeaderHeight(){return!!this.getColGroupDef()?.autoHeaderHeight}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){for(const t of this.displayedChildren??[])xo(t)?e.push(t):Fs(t)&&t.addDisplayedLeafColumns(e)}addLeafColumns(e){for(const t of this.children??[])xo(t)?e.push(t):Fs(t)&&t.addLeafColumns(e)}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e?.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e?.isPadding();)e=e.getParent();if(!e||!e.getProvidedColumnGroup().isExpandable())return this.displayedChildren=this.children,void this.dispatchLocalEvent({type:"displayedChildrenChanged"});for(const t of this.children??[])if(!Fs(t)||t.displayedChildren?.length)switch(t.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(t);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(t);break;default:this.displayedChildren.push(t)}this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},Ms="Backspace",Ps="Tab",Es="Enter",Ts="Escape",As=" ",Is="ArrowLeft",ks="ArrowUp",Ls="ArrowRight",Gs="ArrowDown",Ns="Delete",Bs="F2",Hs="PageUp",Os="PageDown",Vs="Home",zs="End",Ws="KeyA",Us="KeyC",$s="KeyD",js="KeyV",Ks="KeyX",_s="KeyY",qs="KeyZ";function Ys(e){const{keyCode:t}=e;let o;switch(t){case 65:o=Ws;break;case 67:o=Us;break;case 86:o=js;break;case 68:o=$s;break;case 90:o=qs;break;case 89:o=_s;break;default:o=e.code}return o}var Zs=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e(e=>this.onDone(e),e=>this.onReject(e))}static all(t){return t.length?new e(e=>{let o=t.length;const s=new Array(o);t.forEach((t,i)=>{t.then(t=>{s[i]=t,o--,0===o&&e(s)})})}):e.resolve()}static resolve(t=null){return new e(e=>e(t))}then(t){return new e(e=>{1===this.status?e(t(this.resolution)):this.waiters.push(o=>e(t(o)))})}onDone(e){this.status=1,this.resolution=e;for(const t of this.waiters)t(e)}onReject(e){}};function Qs(e){return"function"==typeof e?.getGui}function Xs(e){return Fe(e)}function Js(e,t,o){const s=ei(e,t,o);if(s){const{className:e}=s;if("string"==typeof e&&e.includes("ag-icon")||"object"==typeof e&&e["ag-icon"])return s}const i=Xs({tag:"span"});return i.appendChild(s),i}function ei(e,t,o){let s=null;"smallDown"===e?Et(262):"smallLeft"===e?Et(263):"smallRight"===e&&Et(264);const i=o?.getColDef().icons;if(i&&(s=i[e]),t.gos&&!s){const o=t.gos.get("icons");o&&(s=o[e])}if(s){let t;if("function"==typeof s)t=s();else{if("string"!=typeof s)return void Et(38,{iconName:e});t=s}return"string"==typeof t?le(t):ve(t)?t:void Et(133,{iconName:e})}{const o=t.registry.getIcon(e);return o||t.validation?.validateIcon(e),Xs({tag:"span",cls:`ag-icon ag-icon-${o??e}`,role:"presentation",attrs:{unselectable:"on"}})}}var ti=class{constructor(e){this.cssClassStates={},this.getGui=e}toggleCss(e,t){if(e){if(e.includes(" ")){const o=(e||"").split(" ");if(o.length>1){for(const e of o)this.toggleCss(e,t);return}}this.cssClassStates[e]!==t&&e.length&&(this.getGui()?.classList.toggle(e,t),this.cssClassStates[e]=t)}}},oi=0,si=class extends ze{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=oi++,this.cssManager=new ti(()=>this.eGui),this.componentSelectors=new Map((t??[]).map(e=>[e.selector,e])),e&&this.setTemplate(e)}preConstruct(){this.wireTemplate(this.getGui()),this.addGlobalCss()}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getDataRefAttribute(e){return e.getAttribute?e.getAttribute(Re):null}applyElementsToComponent(e,t,o,s=null){if(void 0===t&&(t=this.getDataRefAttribute(e)),t){const i=this[t];if(null===i)this[t]=s??e;else{const e=o?.[t];if(!this.suppressDataRefValidation&&!e)throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${i}`)}}}createChildComponentsFromTags(e,t){const o=[];for(const s of e.childNodes??[])o.push(s);for(const s of o){if(!(s instanceof HTMLElement))continue;const o=this.createComponentFromElement(s,e=>{const t=e.getGui();if(t)for(const o of s.attributes??[])t.setAttribute(o.name,o.value)},t);if(o){if(o.addItems&&s.children.length){this.createChildComponentsFromTags(s,t);const e=Array.prototype.slice.call(s.children);o.addItems(e)}this.swapComponentForNode(o,e,s)}else s.childNodes&&this.createChildComponentsFromTags(s,t)}}createComponentFromElement(e,t,o){const s=e.nodeName,i=this.getDataRefAttribute(e),n=0===s.indexOf("AG-"),r=n?this.componentSelectors.get(s):null;let a=null;if(r){const e=o&&i?o[i]:void 0;a=new r.component(e),a.setParentComponent(this),this.createBean(a,null,t)}else if(n)throw new Error(`selector: ${s}`);return this.applyElementsToComponent(e,i,o,a),a}swapComponentForNode(e,t,o){const s=e.getGui();t.replaceChild(s,o),t.insertBefore(document.createComment(o.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e,t){const o=t??this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui());for(const s of e)s.setAttribute("tabindex",o.toString())}setTemplate(e,t,o){let s;s="string"==typeof e||null==e?le(e):Fe(e),this.setTemplateFromElement(s,t,o)}setTemplateFromElement(e,t,o,s=!1){if(this.eGui=e,this.suppressDataRefValidation=s,t)for(let i=0;ithis.eGui.removeEventListener(e,t))}addCss(e){this.cssManager.toggleCss(e,!0)}removeCss(e){this.cssManager.toggleCss(e,!1)}toggleCss(e,t){this.cssManager.toggleCss(e,t)}registerCSS(e){this.css===ii?(this.css=[e],this.addGlobalCss()):(this.css||(this.css=[]),this.css.push(e))}addGlobalCss(){if(Array.isArray(this.css)){const e="component-"+Object.getPrototypeOf(this)?.constructor?.name;for(const t of this.css??[])this.beans.environment.addGlobalCSS(t,e)}this.css=ii}},ii=Symbol(),ni=class extends si{},ri={tag:"div",children:[{tag:"div",ref:"eGhost",cls:"ag-dnd-ghost ag-unselectable",children:[{tag:"span",ref:"eIcon",cls:"ag-dnd-ghost-icon ag-shake-left-to-right"},{tag:"div",ref:"eLabel",cls:"ag-dnd-ghost-label"}]}]},ai=class extends ze{constructor(){super(...arguments),this.beanName="dragAndDrop",this.dragSourceAndParamsList=[],this.dragItem=null,this.dragInitialSourcePointerOffsetX=0,this.dragInitialSourcePointerOffsetY=0,this.lastMouseEvent=null,this.lastDraggingEvent=null,this.dragSource=null,this.dragImageCompPromise=null,this.dragImageComp=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0,this.dropTargets=[],this.externalDropZoneCount=0,this.lastDropTarget=null}addDragSource(e,t=!1){const o={capturePointer:!0,dragSource:e,eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:t=>this.onDragStart(e,t),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push(o),this.beans.dragSvc.addDragSource(o)}setDragImageCompIcon(e,t=!1){const o=this.dragImageComp;o&&(t||this.dragImageLastIcon!==e)&&(this.dragImageLastIcon=e,o.setIcon(e,t))}removeDragSource(e){const{dragSourceAndParamsList:t,beans:o}=this;for(let s=0,i=t.length;s{for(const o of t){const{width:t,height:s,left:i,right:n,top:r,bottom:a}=o.getBoundingClientRect();if(0===t||0===s)return!1;const l=e.clientX>=i&&e.clientX=r&&e.clientY0}findExternalZone(e){const t=this.dropTargets;for(let o=0,s=t.length;o0?"down":p<0?"up":null,hDirection:g<0?"left":g>0?"right":null,initialSourcePointerOffsetX:a,initialSourcePointerOffsetY:l,dragSource:s,fromNudge:o,dragItem:i,dropZoneTarget:d,dropTarget:n?.dropTarget??null,changed:!!n?.changed});return this.lastDraggingEvent=m,m}positionDragImageComp(e){const t=this.dragImageComp?.getGui();t&&Ge(t,e,this.beans)}removeDragImageComp(e){this.dragImageComp===e&&(this.dragImageComp=null),e&&(e.getGui()?.remove(),this.destroyBean(e))}createAndUpdateDragImageComp(e){const t=this.createDragImageComp(e)??null;this.dragImageCompPromise=t,t?.then(e=>{const o=this.lastMouseEvent;if(t!==this.dragImageCompPromise||!o||!this.isAlive())return void this.destroyBean(e);this.dragImageCompPromise=null,this.dragImageLastIcon=void 0,this.dragImageLastLabel=void 0;const s=this.dragImageComp;s!==e&&(this.dragImageComp=e,this.removeDragImageComp(s)),e&&(this.appendDragImageComp(e),this.updateDragImageComp(),this.positionDragImageComp(o))})}appendDragImageComp(e){const t=e.getGui(),o=t.style;o.position="absolute",o.zIndex="9999",this.beans.dragSvc?.hasPointerCapture()&&(o.pointerEvents="none"),this.gos.setInstanceDomData(t),this.beans.environment.applyThemeClasses(t),o.top="20px",o.left="20px";const s=R(this.beans);s?s.appendChild(t):this.warnNoBody()}updateDragImageComp(){const{dragImageComp:e,dragSource:t,lastDropTarget:o,lastDraggingEvent:s,dragImageLastLabel:i}=this;if(!e)return;this.setDragImageCompIcon(o?.getIconName?.(s)??null);let n=t?.dragItemName;"function"==typeof n&&(n=n(s)),n||(n=""),i!==n&&(this.dragImageLastLabel=n,e.setLabel(n))}};function li(e){return"object"==typeof e&&!!e.component}function di(e,t,o,s){const{name:i}=o;let n,r,a,l,d,c;if(t){const o=t,h=o[i+"Selector"],u=h?h(s):null,g=t=>{"string"==typeof t?n=t:null!=t&&!0!==t&&(e.isFrameworkComponent(t)?a=t:r=t)};u?(g(u.component),l=u.params,d=u.popup,c=u.popupPosition):g(o[i])}return{compName:n,jsComp:r,fwComp:a,paramsFromSelector:l,popupFromSelector:d,popupPositionFromSelector:c}}var ci={name:"dragAndDropImageComponent",mandatoryMethods:["setIcon","setLabel"]},hi={name:"headerComponent",optionalMethods:["refresh"]},ui={name:"innerHeaderComponent"},gi={name:"innerHeaderGroupComponent"},pi={name:"headerGroupComponent"},mi={name:"innerRenderer",cellRenderer:!0,optionalMethods:["afterGuiAttached"]},fi={name:"cellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Ci={name:"loadingCellRenderer",cellRenderer:!0},vi={name:"cellEditor",mandatoryMethods:["getValue"],optionalMethods:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},wi={name:"tooltipComponent"},bi={name:"filter",mandatoryMethods:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethods:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},yi={name:"floatingFilterComponent",mandatoryMethods:["onParentModelChanged"],optionalMethods:["afterGuiAttached","refresh"]},Si={name:"fullWidthCellRenderer",optionalMethods:["refresh","afterGuiAttached"],cellRenderer:!0},Ri={name:"loadingCellRenderer",cellRenderer:!0},xi={name:"groupRowRenderer",optionalMethods:["afterGuiAttached"],cellRenderer:!0},Fi={name:"detailCellRenderer",optionalMethods:["refresh"],cellRenderer:!0};function Di(e,t,o){return e.getCompDetails(t,mi,void 0,o)}function Mi(e,t,o){return e.getCompDetails(t,fi,void 0,o)}function Pi(e,t,o){return e.getCompDetails(t,Ci,"agSkeletonCellRenderer",o,!0)}function Ei(e,t,o){return e.getCompDetails(t,vi,"agCellEditor",o,!0)}function Ti(e,t,o,s){const i=t.filter;return li(i)&&(t={filter:i.component,filterParams:t.filterParams}),e.getCompDetails(t,bi,s,o,!0)}function Ai(e,t,o,s){return e.getCompDetails(t,yi,s,o)}function Ii(e,t){return di(e,t,bi)}function ki(e,t,o){return e.mergeParams(t,bi,o)}var Li=/* @__PURE__ */(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(Li||{});var Gi=class extends ni{constructor(e){const{className:t="ag-filter-apply-panel"}=e??{};super(function(e){return{tag:"div",cls:e}}(t)),this.listeners=[],this.validationMessage=null,this.className=t}updateButtons(e,t){const o=this.buttons;if(this.buttons=e,o===e)return;const s=this.getGui();let i;ie(s),this.destroyListeners();const n=document.createDocumentFragment(),r=this.className,a=({type:e,label:o})=>{const s=t=>{this.dispatchLocalEvent({type:e,event:t})};["apply","clear","reset","cancel"].includes(e)||Et(75);const a="apply"===e,l=Xs({tag:"button",attrs:{type:a&&t?"submit":"button"},ref:`${e}FilterButton`,cls:`ag-button ag-standard-button ${r}-button${a?" "+r+"-apply-button":""}`,children:o});this.activateTabIndex([l]),a&&(i=l);const d=e=>{e.key===Es&&(e.preventDefault(),s(e))},c=this.listeners;l.addEventListener("click",s),c.push(()=>l.removeEventListener("click",s)),l.addEventListener("keydown",d),c.push(()=>l.removeEventListener("keydown",d)),n.append(l)};for(const d of e)a(d);this.eApply=i;const l=this.validationTooltipFeature;i&&!l?this.validationTooltipFeature=this.createOptionalManagedBean(this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.eApply,getLocation:()=>"advancedFilter",getTooltipShowDelayOverride:()=>1e3})):!i&&l&&(this.validationTooltipFeature=this.destroyBean(l)),s.append(n)}getApplyButton(){return this.eApply}updateValidity(e,t=null){const o=this.eApply;o&&(q(o,!e),this.validationMessage=t,this.validationTooltipFeature?.setTooltipAndRefresh(this.validationMessage))}destroyListeners(){for(const e of this.listeners)e();this.listeners=[]}destroy(){this.destroyListeners(),super.destroy()}},Ni={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",bigintFilter:"BigInt Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd",filterSummaryInactive:"is (All)",filterSummaryContains:"contains",filterSummaryNotContains:"does not contain",filterSummaryTextEquals:"equals",filterSummaryTextNotEqual:"does not equal",filterSummaryStartsWith:"begins with",filterSummaryEndsWith:"ends with",filterSummaryBlank:"is blank",filterSummaryNotBlank:"is not blank",filterSummaryEquals:"=",filterSummaryNotEqual:"!=",filterSummaryGreaterThan:">",filterSummaryGreaterThanOrEqual:">=",filterSummaryLessThan:"<",filterSummaryLessThanOrEqual:"<=",filterSummaryInRange:"between",yesterday:"Yesterday",today:"Today",tomorrow:"Tomorrow",last7Days:"Last 7 Days",lastWeek:"Last Week",thisWeek:"This Week",nextWeek:"Next Week",last30Days:"Last 30 Days",lastMonth:"Last Month",thisMonth:"This Month",nextMonth:"Next Month",last90Days:"Last 90 Days",lastQuarter:"Last Quarter",thisQuarter:"This Quarter",nextQuarter:"Next Quarter",lastYear:"Last Year",thisYear:"This Year",yearToDate:"Year To Date",nextYear:"Next Year",last6Months:"Last 6 Months",last12Months:"Last 12 Months",last24Months:"Last 24 Months",filterSummaryInRangeValues:e=>`(${e[0]}, ${e[1]})`,filterSummaryTextQuote:e=>`"${e[0]}"`,minDateValidation:e=>`Date must be after ${e[0]}`,maxDateValidation:e=>`Date must be before ${e[0]}`,strictMinValueValidation:e=>`Must be greater than ${e[0]}`,strictMaxValueValidation:e=>`Must be less than ${e[0]}`};function Bi(e,t,o){return function(e,t,o,s){const i=t[o];return e.getLocaleTextFunc()(o,"function"==typeof i?i(s):i,s)}(e,Ni,t,o)}function Hi(e){return(e.buttons?.indexOf("apply")??-1)>=0}var Oi,Vi,zi,Wi,Ui,$i,ji,Ki=class extends ni{constructor(e,t,o,s,i,n){super(),this.column=e,this.wrapper=t,this.eventParent=o,this.updateModel=s,this.isGlobalButtons=i,this.enableGlobalButtonCheck=n,this.hidePopup=null,this.applyActive=!1}postConstruct(){const{comp:e,params:t}=this.wrapper,o=t,s=o.useForm,i=s?"form":"div";this.setTemplate({tag:i,cls:"ag-filter-wrapper"}),s&&this.addManagedElementListeners(this.getGui(),{submit:e=>{e?.preventDefault()},keydown:this.handleKeyDown.bind(this)}),this.appendChild(e.getGui()),this.params=o,this.resetButtonsPanel(o),this.addManagedListeners(this.eventParent,{filterParamsChanged:({column:e,params:t})=>{e===this.column&&this.resetButtonsPanel(t,this.params)},filterStateChanged:({column:e,state:t})=>{e===this.column&&this.eButtons?.updateValidity(!1!==t.valid)},filterAction:({column:e,action:t,event:o})=>{e===this.column&&this.afterAction(t,o)},...this.enableGlobalButtonCheck?{filterGlobalButtons:({isGlobal:e})=>{if(e!==this.isGlobalButtons){this.isGlobalButtons=e;const t=this.params;this.resetButtonsPanel(t,t,!0)}}}:void 0})}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup)}resetButtonsPanel(e,t,o){const{buttons:s,readOnly:i}=t??{},{buttons:n,readOnly:r,useForm:a}=e;if(!o&&i===r&&c(s,n))return;const l=n&&n.length>0&&!e.readOnly&&!this.isGlobalButtons;let d=this.eButtons;if(l){const e=n.map(e=>({type:e,label:Bi(this,`${e}Filter`)}));if(this.applyActive=Hi(this.params),!d){d=this.createBean(new Gi),this.appendChild(d.getGui());const e=this.column,t=t=>({event:o})=>{this.updateModel(e,t,{fromButtons:!0}),this.afterAction(t,o)};d?.addManagedListeners(d,{apply:t("apply"),clear:t("clear"),reset:t("reset"),cancel:t("cancel")}),this.eButtons=d}d.updateButtons(e,a)}else this.applyActive=!1,d&&(ne(d.getGui()),this.eButtons=this.destroyBean(d))}close(e){const t=this.hidePopup;if(!t)return;const o=e,s=o?.key;let i;s!==Es&&s!==As||(i={keyboardEvent:o}),t(i),this.hidePopup=null}afterAction(e,t){const{params:o,applyActive:s}=this,i=o?.closeOnApply;switch(e){case"apply":t?.preventDefault(),i&&s&&this.close(t);break;case"reset":i&&s&&this.close();break;case"cancel":i&&this.close(t)}}handleKeyDown(e){!e.defaultPrevented&&e.key===Es&&this.applyActive&&(this.updateModel(this.column,"apply",{fromButtons:!0}),this.afterAction("apply",e))}destroy(){this.hidePopup=null,this.eButtons=this.destroyBean(this.eButtons)}},_i={tag:"div",cls:"ag-filter"},qi=class extends ni{constructor(e,t,o){super(_i),this.column=e,this.source=t,this.enableGlobalButtonCheck=o,this.wrapper=null}postConstruct(){this.beans.colFilter?.activeFilterComps.add(this),this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return null!=this.wrapper}getFilter(){return this.wrapper?.then(e=>e.comp)??null}afterInit(){return this.wrapper?.then(()=>{})??Zs.resolve()}afterGuiAttached(e){this.afterGuiAttachedParams=e,this.wrapper?.then(t=>{this.comp?.afterGuiAttached(e),t?.comp?.afterGuiAttached?.(e)})}afterGuiDetached(){this.wrapper?.then(e=>{e?.comp?.afterGuiDetached?.()})}createFilter(e){const{column:t,source:o,beans:{colFilter:s}}=this,i=s.getFilterUiForDisplay(t)??null;this.wrapper=i,i?.then(i=>{if(!i)return;const{isHandler:n,comp:r}=i;let l;if(n){const e=!!this.enableGlobalButtonCheck,o=this.createBean(new Ki(t,i,s,s.updateModel.bind(s),e&&s.isGlobalButtons,e));this.comp=o,l=o.getGui()}else this.registerCSS(":where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}"),l=r.getGui(),a(l)||Et(69,{guiFromFilter:l});this.appendChild(l),e?this.eventSvc.dispatchEvent({type:"filterOpened",column:t,source:o,eGui:this.getGui()}):r.afterGuiAttached?.(this.afterGuiAttachedParams)})}onFilterDestroyed(e){const{source:t,column:o}=e;"api"!==t&&"paramsUpdated"!==t||o.getId()!==this.column.getId()||!this.beans.colModel.getColDefCol(this.column)||(ie(this.getGui()),this.comp=this.destroyBean(this.comp),this.createFilter())}destroy(){this.beans.colFilter?.activeFilterComps.delete(this),this.eventSvc.dispatchEvent({type:"filterClosed",column:this.column}),this.wrapper=null,this.comp=this.destroyBean(this.comp),this.afterGuiAttachedParams=void 0,super.destroy()}},Yi="ag-resizer-wrapper",Zi=(e,t)=>({tag:"div",ref:`${e}Resizer`,cls:`ag-resizer ag-resizer-${t}`}),Qi={tag:"div",cls:Yi,children:[Zi("eTopLeft","topLeft"),Zi("eTop","top"),Zi("eTopRight","topRight"),Zi("eRight","right"),Zi("eBottomRight","bottomRight"),Zi("eBottom","bottom"),Zi("eBottomLeft","bottomLeft"),Zi("eLeft","left")]},Xi=class extends ze{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config={popup:!1,...t}}wireBeans(e){this.popupSvc=e.popupSvc,this.dragSvc=e.dragSvc}center(e){const{clientHeight:t,clientWidth:o}=this.offsetParent,s=o/2-this.getWidth()/2,i=t/2-this.getHeight()/2;this.offsetElement(s,i,e)}initialisePosition(e){if(this.positioned)return;const{centered:t,forcePopupParentAsOffsetParent:o,minWidth:s,width:i,minHeight:n,height:r,x:a,y:l}=this.config;this.offsetParent||this.setOffsetParent();let d=0,c=0;const h=ae(this.element);if(h){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const o=e.offsetWidth-this.element.offsetWidth;c=Number.parseInt(t.minWidth,10)-o}if(null!=t.minHeight){const o=e.offsetHeight-this.element.offsetHeight;d=Number.parseInt(t.minHeight,10)-o}}if(this.minHeight=n||d,this.minWidth=s||c,i&&this.setWidth(i),r&&this.setHeight(r),i&&r||this.refreshSize(),t)this.center(e);else if(a||l)this.offsetElement(a,l,e);else if(h&&o){let t=this.boundaryEl,o=!0;if(t||(t=this.findBoundaryElement(),o=!1),t){const s=Number.parseFloat(t.style.top),i=Number.parseFloat(t.style.left);o?this.offsetElement(Number.isNaN(i)?0:i,Number.isNaN(s)?0:s,e):this.setPosition(i,s)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const o=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragSvc?.addDragSource(o),this.moveElementDragListener=o):(this.dragSvc?.removeDragSource(o),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}for(const t of Object.keys(e)){const o=!!e[t],s=this.getResizerElement(t),i={dragStartPixels:0,eElement:s,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(o||!this.isAlive()&&!o)&&(o?(this.dragSvc?.addDragSource(i),this.resizeListeners.push(i),s.style.pointerEvents="all"):s.style.pointerEvents="none",this.resizable[t]=o)}}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,o=this.element;let s=!1;if("string"==typeof e&&e.includes("%"))fe(o,e),e=J(o),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(s?(o.style.maxHeight="unset",o.style.minHeight="unset"):t?fe(o,e):(o.style.height=`${e}px`,o.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:Number.parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:o}=this.offsetParent;if(!o)return null;const s=this.element.getBoundingClientRect(),i=this.offsetParent.getBoundingClientRect(),n=e?this.position.y:s.top,r=e?0:i.top;let a=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();a=t-s.bottom}}return o+r-n-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:o}=this.config;let s=!1;if("string"==typeof e&&e.includes("%"))me(t,e),e=ee(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,s=o?this.position.x:this.element.getBoundingClientRect().left;t&&e+s>t&&(e=t-s)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?me(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:Number.parseFloat(e)))}offsetElement(e=0,t=0,o){const{forcePopupParentAsOffsetParent:s}=this.config,i=s?this.boundaryEl:this.element;i&&(this.popupSvc?.positionPopup({ePopup:i,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t}),postProcessCallback:o}),this.setPosition(Number.parseFloat(i.style.left),Number.parseFloat(i.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)};e&&this.popupSvc?(this.resizeObserverSubscriber?.(),this.resizeObserverSubscriber=be(this.beans,this.popupSvc?.getPopupParent(),t)):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:o,isTop:s,anywhereWithin:i,topBuffer:n}=e,r=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!o,!!i,r)?0:r,movementY:this.shouldSkipY(t,!!s,n,a)?0:a}}shouldSkipX(e,t,o,s){const i=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:i.left;let l=a<=0&&n.left>=e.clientX||n.right<=e.clientX&&n.right<=r.right;return!!l||(l=t?s<0&&e.clientX>a+n.left||s>0&&e.clientXr.right||s>0&&e.clientXr.right||s>0&&e.clientX=e.clientY||n.bottom<=e.clientY&&n.bottom<=r.bottom;return!!l||(l=t?s<0&&e.clientY>a+n.top+o||s>0&&e.clientYr.bottom||s>0&&e.clientY({element:this.element.querySelector(`[data-ref=${e}Resizer]`)});this.resizerMap={topLeft:e("eTopLeft"),top:e("eTop"),topRight:e("eTopRight"),right:e("eRight"),bottomRight:e("eBottomRight"),bottom:e("eBottom"),bottomLeft:e("eBottomLeft"),left:e("eLeft")}}addResizers(){if(this.resizersAdded)return;const e=this.element;e&&(e.appendChild(Fe(Qi)),this.createResizeMap(),this.resizersAdded=!0)}removeResizers(){this.resizerMap=void 0,this.element.querySelector(`.${Yi}`)?.remove(),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:o,forcePopupParentAsOffsetParent:s}=this.config;o||s||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter(e=>!e.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,o=0;for(const s of e){const e=!!s.style.flex&&"0 0 auto"!==s.style.flex;if(s===this.element)continue;let i=this.minHeight||0,n=this.minWidth||0;if(e){const e=window.getComputedStyle(s);e.minHeight&&(i=Number.parseInt(e.minHeight,10)),e.minWidth&&(n=Number.parseInt(e.minWidth,10))}else i=s.offsetHeight,n=s.offsetWidth;t+=i,o+=n}return{height:t,width:o}}applySizeToSiblings(e){let t=null;const o=this.getSiblings();if(o){for(let s=0;se)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:o}=this.config,{isTop:s,isRight:i,isBottom:n,isLeft:r}=this.currentResizer,a=i||r,l=n||s,{movementX:d,movementY:c}=this.calculateMouseMovement({e:e,isLeft:r,isTop:s}),h=this.position.x,u=this.position.y;let g=0,p=0;if(a&&d){const e=r?-1:1,t=this.getWidth(),o=t+d*e;let s=!1;r&&(g=t-o,(h+g<=0||o<=this.minWidth)&&(s=!0,g=0)),s||this.setWidth(o)}if(l&&c){const e=s?-1:1,t=this.getHeight(),o=t+c*e;let i=!1;s?(p=t-o,(u+p<=0||o<=this.minHeight)&&(i=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&tthis.element.parentElement.offsetHeight&&(i=!0),i||this.setHeight(o)}this.updateDragStartPosition(e.clientX,e.clientY),((t||o)&&g||p)&&this.offsetElement(h+g,u+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:o}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:i,movementY:n}=this.calculateMouseMovement({e:e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+i,o+n),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent&&this.popupSvc?this.offsetParent=this.popupSvc.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragSvc?.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragSvc?.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},Ji=class extends Xi{};function en(){return void 0===Oi&&(Oi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Oi}function tn(){return void 0===Vi&&(Vi=/(firefox)/i.test(navigator.userAgent)),Vi}function on(){return void 0===zi&&(zi=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),zi}function sn(){return void 0===Wi&&(Wi=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),Wi}function nn(e){if(!e)return null;const t=e.tabIndex,o=e.getAttribute("tabIndex");return-1!==t||null!==o&&(""!==o||tn())?t.toString():null}function rn(){return null==$i&&an(),$i}function an(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let o=t.offsetWidth-t.clientWidth;0===o&&0===t.clientWidth&&(o=null),t.parentNode&&t.remove(),null!=o&&($i=o,Ui=0===o)}function ln(){return null==Ui&&an(),Ui}var dn=!1,cn=0;function hn(e){const t=dn,o="keydown"===e.type;o&&(e.ctrlKey||e.metaKey||e.altKey)||t!==o&&(dn=o)}function un(e){const t=b(e);var o;return o=t,cn>0||(o.addEventListener("keydown",hn),o.addEventListener("mousedown",hn)),cn++,()=>{cn--,function(e){cn>0||(e.removeEventListener("keydown",hn),e.removeEventListener("mousedown",hn))}(t)}}function gn(){return dn}function pn(e,t,o=!1){let s=j;t&&(s+=", "+t),o&&(s+=', [tabindex="-1"]');const i=Array.prototype.slice.apply(e.querySelectorAll("[tabindex], input, select, button, textarea, [href]")).filter(e=>ae(e)),n=Array.prototype.slice.apply(e.querySelectorAll(s));if(!n.length)return i;return r=n,i.filter(e=>-1===r.indexOf(e));var r}function mn(t,o=!1,s=!1,i=!1){const n=pn(t,i?".ag-tab-guard":null,s),r=o?e(n):n[0];return!!r&&(r.focus({preventScroll:!0}),!0)}function fn(e,t,o,s){const i=pn(t,o?':not([tabindex="-1"])':null),n=w(e);let r;r=o?i.findIndex(e=>e.contains(n)):i.indexOf(n);const a=r+(s?-1:1);return a<0||a>=i.length?null:i[a]}function Cn(e,t=5){let o=0;for(;e&&null===nn(e)&&++o<=t;)e=e.parentElement;return null===nn(e)?null:e}var vn="ag-focus-managed",wn=class extends ze{constructor(e,t={isStopPropagation:()=>!1,stopPropagation:()=>{}},o={}){super(),this.eFocusable=e,this.stopPropagationCallbacks=t,this.callbacks=o,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=fn(this.beans,this.eFocusable,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())},...o}}postConstruct(){const{eFocusable:e,callbacks:{onFocusIn:t,onFocusOut:o}}=this;e.classList.add(vn),this.addKeyDownListeners(e),t&&this.addManagedElementListeners(e,{focusin:t}),o&&this.addManagedElementListeners(e,{focusout:o})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:e=>{if(e.defaultPrevented||this.stopPropagationCallbacks.isStopPropagation(e))return;const{callbacks:t}=this;t.shouldStopEventPropagation(e)?this.stopPropagationCallbacks.stopPropagation(e):e.key===Ps?t.onTabKeyDown(e):t.handleKeyDown&&t.handleKeyDown(e)}})}},bn="__ag_Grid_Stop_Propagation";function yn(e){e[bn]=!0}function Sn(e){return!0===e[bn]}var Rn={isStopPropagation:Sn,stopPropagation:yn},xn=class extends wn{constructor(e,t){super(e,Rn,t)}},Fn=class extends ni{constructor(e,t){super(),this.filterNameKey=e,this.cssIdentifier=t,this.applyActive=!1,this.debouncePending=!1,this.defaultDebounceMs=0}postConstruct(){const e={tag:"div",cls:`ag-filter-body-wrapper ag-${this.cssIdentifier}-body-wrapper`,children:[this.createBodyTemplate()]};this.setTemplate(e,this.getAgComponents()),this.createManagedBean(new xn(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=this.createBean(new Ji(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}))}handleKeyDown(e){}init(e){const t=e;this.setParams(t),this.setModelIntoUi(t.state.model,!0).then(()=>this.updateUiVisibility())}areStatesEqual(e,t){return e===t}refresh(e){const t=e,o=this.params;this.params=t;const{source:s,state:i,additionalEventAttributes:n}=t;"colDef"===s&&this.updateParams(t,o);const r=this.state;this.state=i;const a=n?.fromAction;return(a&&"apply"!==a||i.model!==r.model||!this.areStatesEqual(i.state,r.state))&&this.setModelIntoUi(i.model),!0}setParams(e){this.params=e,this.state=e.state,this.commonUpdateParams(e)}updateParams(e,t){this.commonUpdateParams(e,t)}commonUpdateParams(e,t){this.applyActive=Hi(e),this.setupApplyDebounced()}doesFilterPass(e){Et(283);const{getHandler:t,model:o,column:s}=this.params;return t().doesFilterPass({...e,model:o,handlerParams:this.beans.colFilter.getHandlerParams(s)})}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return Et(284),null!=this.params.model}setupApplyDebounced(){const e=function(e,t){const{debounceMs:o}=e;return Hi(e)?(null!=o&&Et(71),0):o??t}(this.params,this.defaultDebounceMs),t=qe(this,this.checkApplyDebounce.bind(this),e);this.applyDebounced=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.doApplyModel())}getModel(){return Et(285),this.params.model}setModel(e){Et(286);const{beans:t,params:o}=this;return t.colFilter.setModelForColumnLegacy(o.column,e)}applyModel(e="api"){return this.doApplyModel()}canApply(e){return!0}doApplyModel(e){const{params:t,state:{valid:o=!0,model:s}}=this;if(!o)return!1;const i=!this.areModelsEqual(t.model,s);return i&&t.onAction("apply",e),i}onNewRowsLoaded(){}onUiChanged(e,t=!1){this.updateUiVisibility();const o=this.getModelFromUi(),s={model:o,state:this.getState(),valid:this.canApply(o)};this.state=s;const{params:i,gos:n,eventSvc:r,applyActive:a}=this;i.onStateChange(s),i.onUiChange(this.getUiChangeEventParams()),n.get("enableFilterHandlers")||r.dispatchEvent({type:"filterModified",column:i.column,filterInstance:this}),s.valid&&(e??(e=a?void 0:"debounce"),"immediately"===e?this.doApplyModel({afterFloatingFilter:t,afterDataChange:!1}):"debounce"===e&&this.applyDebounced())}getState(){}getUiChangeEventParams(){}afterGuiAttached(e){this.lastContainerType=e?.container,this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){const{positionableFeature:t,gos:o}=this;if(!t)return;const s="floatingFilter"===e||"columnFilter"===e;s?(t.restoreLastSize(),t.setResizable(o.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(t.removeSizeFromEl(),t.setResizable(!1)),t.constrainSizeToAvailableHeight(s)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature?.constrainSizeToAvailableHeight(!1)}destroy(){this.positionableFeature=this.destroyBean(this.positionableFeature),super.destroy()}translate(e,t){return Bi(this,e,t)}getPositionableElement(){return this.getGui()}areModelsEqual(e,t){return e===t||null==e&&null==t||null!=e&&null!=t&&this.areNonNullModelsEqual(e,t)}};function Dn(e){const{rowIndex:t,rowPinned:o,column:s}=e;return`${t}.${null==o?"null":o}.${s.getId()}`}function Mn(e,t){const o=e.column===t.column,s=e.rowPinned===t.rowPinned,i=e.rowIndex===t.rowIndex;return o&&s&&i}function Pn(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(a(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndexe.rowNode.rowIndex===t.rowIndex),l=a?n:r,d=(o?-1:1)*(a?-1:1);let c;for(let h=0;hn)&&(t[i]=s)}}}return t}function $n(e,t){let o=e.colModel.isPivotMode()?function(e){return e.gos.get("pivotGroupHeaderHeight")??qn(e)}(e):qn(e);const s=t.getHeaderCellCtrls();for(const i of s){const{column:e}=i,t=e.getAutoHeaderHeight();null!=t&&t>o&&e.isAutoHeaderHeight()&&(o=t)}return o}function jn(e){let t=e.colModel.isPivotMode()?function(e){return e.gos.get("pivotHeaderHeight")??Kn(e)}(e):Kn(e);return e.colModel.forAllCols(e=>{const o=e.getAutoHeaderHeight();null!=o&&o>t&&e.isAutoHeaderHeight()&&(t=o)}),t}function Kn(e){return e.gos.get("headerHeight")??e.environment.getDefaultHeaderHeight()}function _n(e){return e.gos.get("floatingFiltersHeight")??Kn(e)}function qn(e){return e.gos.get("groupHeaderHeight")??Kn(e)}var Yn=class extends We{setComp(e,t,o){this.comp=e,this.eGui=t;const{beans:s}=this,{headerNavigation:i,touchSvc:n,ctrlsSvc:r}=s;i&&this.createManagedBean(new xn(o,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this,s),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this,s)}),this.onPivotModeChanged(s),this.setupHeaderHeight();const a=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:a}),n?.mockHeaderContextMenu(this,a),r.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({headerRowsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>ye(this.beans,()=>e()),stylesChanged:e,advancedFilterEnabledChanged:e})}setHeaderHeight(){const{beans:e}=this;let t=0;const o=Un(e).reduce((e,t)=>e+t,0),s=jn(e);e.filterManager?.hasFloatingFilters()&&(t+=_n(e)),t+=o,t+=s;const i=t+e.environment.getHeaderRowBorderWidth();if(this.headerHeightWithBorder!==i){this.headerHeightWithBorder=i;const e=`${i}px`;this.comp.setHeightAndMinHeight(e)}this.headerHeight!==t&&(this.headerHeight=t,this.eventSvc.dispatchEvent({type:"headerHeightChanged"}))}onPivotModeChanged(e){const t=e.colModel.isPivotMode();this.comp.toggleCss("ag-pivot-on",t),this.comp.toggleCss("ag-pivot-off",!t)}onDisplayedColumnsChanged(e){const t=e.visibleCols.allCols.some(e=>e.isSpanHeaderHeight());this.comp.toggleCss("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),o=e.shiftKey,s=o!==t?"LEFT":"RIGHT",{beans:i}=this,{headerNavigation:n,focusSvc:r}=i;(n.navigateHorizontally(s,!0,e)||!o&&r.focusOverlay(!1)||Vn(i,o,!0))&&e.preventDefault()}handleKeyDown(e){let t=null;const{headerNavigation:o}=this.beans;switch(e.key){case Is:t="LEFT";case Ls:a(t)||(t="RIGHT"),o.navigateHorizontally(t,!1,e)&&e.preventDefault();break;case ks:t="UP";case Gs:a(t)||(t="DOWN"),o.navigateVertically(t,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e,{eGui:o,beans:s}=this;!t&&o.contains(w(s))||o.contains(t)||(s.focusSvc.focusedHeader=null)}onHeaderContextMenu(e,t,o){const{menuSvc:s,ctrlsSvc:i}=this.beans;if(!e&&!o||!s?.isHeaderContextMenuEnabled())return;const{target:n}=e??t;n!==this.eGui&&n!==i.getHeaderRowContainerCtrl()?.eViewport||s.showHeaderContextMenu(void 0,e,o)}},Zn=class extends ni{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},Qn={tag:"div",cls:"ag-header-cell",role:"columnheader",children:[{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"},{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"}]},Xn=class extends Zn{constructor(e){super(Qn,e),this.eResize=null,this.eHeaderCompWrapper=null,this.headerCompVersion=0}postConstruct(){const e=this.getGui(),t=()=>{const e=this.ctrl.getSelectAllGui();e&&(this.eResize.insertAdjacentElement("afterend",e),this.addDestroyFunc(()=>e.remove()))},o={setWidth:t=>e.style.width=t,toggleCss:(e,t)=>this.toggleCss(e,t),setUserStyles:t=>ue(e,t),setAriaSort:t=>t?function(e,t){F(e,"sort",t)}(e,t):void D(e,"sort"),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp,refreshSelectAllGui:t,removeSelectAllGui:()=>this.ctrl.getSelectAllGui()?.remove()};this.ctrl.setComp(o,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0),t()}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.headerCompGui?.remove(),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(e=>this.afterCompCreated(t,e))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}},Jn={tag:"div",cls:"ag-header-group-cell",role:"columnheader",children:[{tag:"div",ref:"eHeaderCompWrapper",cls:"ag-header-cell-comp-wrapper",role:"presentation"},{tag:"div",ref:"eResize",cls:"ag-header-cell-resize",role:"presentation"}]},er=class extends Zn{constructor(e){super(Jn,e),this.eResize=null,this.eHeaderCompWrapper=null}postConstruct(){const e=this.getGui();this.ctrl.setComp({toggleCss:(e,t)=>this.toggleCss(e,t),setUserStyles:t=>ue(e,t),setHeaderWrapperHidden:e=>{e?this.eHeaderCompWrapper.style.setProperty("display","none"):this.eHeaderCompWrapper.style.removeProperty("display")},setHeaderWrapperMaxHeight:e=>{null!=e?this.eHeaderCompWrapper.style.setProperty("max-height",`${e}px`):this.eHeaderCompWrapper.style.removeProperty("max-height"),this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height",null!=e)},setResizableDisplayed:e=>_(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return o="aria-expanded",null!=(s=t)?e.setAttribute(o,s):e.removeAttribute(o);var o,s},setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp},e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(e=>this.afterHeaderCompCreated(e))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const o=this.getGui(),s=e.getGui();this.eHeaderCompWrapper.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(o)}},tr={tag:"div",cls:"ag-header-cell ag-floating-filter",role:"gridcell",children:[{tag:"div",ref:"eFloatingFilterBody",role:"presentation"},{tag:"div",ref:"eButtonWrapper",cls:"ag-floating-filter-button ag-hidden",role:"presentation",children:[{tag:"button",ref:"eButtonShowMainFilter",cls:"ag-button ag-floating-filter-button-button",attrs:{type:"button",tabindex:"-1"}}]}]},or=class extends Zn{constructor(e){super(tr,e),this.eFloatingFilterBody=null,this.eButtonWrapper=null,this.eButtonShowMainFilter=null}postConstruct(){const e=this.getGui();this.ctrl.setComp({toggleCss:(e,t)=>this.toggleCss(e,t),setUserStyles:t=>ue(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>_(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)},e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then(e=>this.afterCompCreated(e))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp?.getGui().remove(),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp)}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached?.()):this.destroyBean(e))}},sr=class extends ni{constructor(e){super({tag:"div",cls:e.headerRowClass,role:"row"}),this.ctrl=e,this.headerComps={}}postConstruct(){this.getGui().setAttribute("tabindex",String(this.gos.get("tabIndex"))),H(this.getGui(),this.ctrl.getAriaRowIndex()),this.ctrl.setComp({setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e,setRowIndex:e=>H(this.getGui(),e)},void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const o=this.headerComps;this.headerComps={};for(const s of e){const e=s.instanceId;let t=o[e];delete o[e],null==t&&(t=this.createHeaderComp(s),this.getGui().appendChild(t.getGui())),this.headerComps[e]=t}if(Object.values(o).forEach(e=>{e.getGui().remove(),this.destroyBean(e)}),t){const e=Object.values(this.headerComps);e.sort((e,t)=>e.getCtrl().column.getLeft()-t.getCtrl().column.getLeft());const t=e.map(e=>e.getGui());ce(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.type){case"group":t=new er(e);break;case"filter":t=new or(e);break;default:t=new Xn(e)}return this.createBean(t),t.setParentComponent(this),t}},ir=class extends We{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=Nt(this.gos,"print"),{visibleCols:t,scrollVisibleSvc:o}=this.beans,s=t.bodyWidth,i=t.getColsLeftWidth(),n=t.getDisplayedColumnsRightWidth();let r;e?r=s+i+n:(r=s,this.addSpacer&&0===(this.gos.get("enableRtl")?i:n)&&o.verticalScrollShowing&&(r+=o.getScrollbarWidth())),this.callback(r)}};function nr(e,t,o){return o&&e.addDestroyFunc(()=>t.destroyBean(o)),o??e}var rr=class extends We{constructor(e,t,o,s){super(),this.columnOrGroup=e,this.eCell=t,this.colsSpanning=s,this.columnOrGroup=e,this.ariaEl=t.querySelector("[role=columnheader]")||t,this.beans=o}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){const{beans:t,colsSpanning:o}=this;return t.gos.get("enableRtl")&&o?e(o):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const{gos:e,colAnimation:t}=this.beans,o=e.get("suppressColumnMoveAnimation"),s=a(this.columnOrGroup.getOldLeft());t?.isActive()&&s&&!o?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=this.modifyLeftForPrintLayout(e,e.getOldLeft()),o=this.modifyLeftForPrintLayout(e,e.getLeft());this.setLeft(t),this.actualLeft=o,this.beans.colAnimation.executeNextVMTurn(()=>{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){const{gos:o,visibleCols:s}=this.beans;if(!Nt(o,"print"))return t;if("left"===e.getPinned())return t;const i=s.getColsLeftWidth();return"right"===e.getPinned()?i+s.bodyWidth+t:i+t}setLeft(e){if(a(e)&&(this.eCell.style.left=`${e}px`),Fs(this.columnOrGroup)){const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&(t=this.ariaEl,o=e.length,F(t,"colspan",o))}var t,o}};function ar(e,t,o,s){return l(e)?[]:cr(e.headerClass,e,t,o,s)}function lr(e,t,o,s){return l(e)?[]:cr(e.toolPanelClass,e,t,o,s)}function dr(e,t,o){e.toggleCss("ag-column-first",o.isColAtEdge(t,"first")),e.toggleCss("ag-column-last",o.isColAtEdge(t,"last"))}function cr(e,t,o,s,i){if(l(e))return[];let n;return n="function"==typeof e?e(function(e,t,o,s){return wo(t,{colDef:e,column:o,columnGroup:s})}(t,o,s,i)):e,"string"==typeof n?[n]:Array.isArray(n)?[...n]:[]}var hr=0,ur="headerCtrl",gr=class extends We{constructor(e,t){super(),this.column=e,this.rowCtrl=t,this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.reAttemptToFocus=!1,this.instanceId=e.getUniqueId()+"-"+hr++}postConstruct(){const e=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],e),this.addManagedEventListeners({overlayExclusiveChanged:e})}setComp(e,t,o,s,i){t.setAttribute("col-id",this.column.colIdSanitised),this.wireComp(e,t,o,s,i),this.reAttemptToFocus&&(this.reAttemptToFocus=!1,this.focus(this.lastFocusEvent??void 0))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:o}=this.beans.focusSvc.focusedHeader,s=o.getDefinition(),i=s?.suppressHeaderKeyboardEvent;return!!a(i)&&!!i(wo(this.gos,{colDef:s,column:o,headerRowIndex:t,event:e}))}getWrapperHasFocus(){return w(this.beans)===this.eGui}setGui(e,t){this.eGui=e,this.addDomData(t),t.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),t.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}refreshHeaderStyles(){const e=this.column.getDefinition();if(!e)return;const{headerStyle:t}=e;let o;o="function"==typeof t?t(this.getHeaderClassParams()):t,o&&this.comp.setUserStyles(o)}onGuiFocus(){this.eventSvc.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(e){const{wrapperElement:t,checkMeasuringCallback:o,compBean:s}=e,{beans:i}=this,n=e=>{if(!this.isAlive()||!s.isAlive())return;const{paddingTop:o,paddingBottom:r,borderBottomWidth:a,borderTopWidth:l}=Z(this.eGui),d=o+r+a+l,c=t.offsetHeight+d;!(e<5)||b(i)?.contains(t)&&0!=c?this.setColHeaderHeight(this.column,c):_e(()=>n(e+1),"raf",i)};let r,a=!1;const l=()=>{const e=this.column.isAutoHeaderHeight();e&&!a&&d(),!e&&a&&c()},d=()=>{a=!0,this.comp.toggleCss("ag-header-cell-auto-height",!0),n(0),r=be(this.beans,t,()=>n(0))},c=()=>{a=!1,r&&r(),this.comp.toggleCss("ag-header-cell-auto-height",!1),r=void 0};l(),s.addDestroyFunc(()=>c()),s.addManagedListeners(this.column,{widthChanged:()=>a&&n(0)}),s.addManagedEventListeners({sortChanged:()=>{a&&window.setTimeout(()=>n(0))}}),o&&o(l)}onDisplayedColumnsChanged(){const{comp:e,column:t,beans:o,eGui:s}=this;e&&t&&s&&(dr(e,t,o.visibleCols),O(s,o.visibleCols.getAriaColIndex(t)))}addResizeAndMoveKeyboardListeners(e){e.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const e=Hn(this.beans);this.eGui&&we(this.eGui,"tabindex",e?null:"-1")}onGuiKeyDown(e){const t=w(this.beans),o=e.key===Is||e.key===Ls;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey)return;if((this.isResizing||o)&&(e.preventDefault(),e.stopImmediatePropagation()),(e.ctrlKey||e.metaKey)&&Ys(e)===Us)return this.beans.clipboardSvc?.copyToClipboard();if(!o)return;const s=e.key===Is!==this.gos.get("enableRtl")?"left":"right";if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const t=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(t,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(s)}moveHeader(e){this.beans.colMoves?.moveHeader(e,this.eGui,this.column,this.rowCtrl.pinned,this)}getViewportAdjustedResizeDiff(e){const t=this.getResizeDiff(e),{pinnedCols:o}=this.beans;return o?o.getHeaderResizeDiff(t,this.column):t}getResizeDiff(e){const{gos:t,column:o}=this;let s=e.key===Is!==t.get("enableRtl");const i=o.getPinned(),n=t.get("enableRtl");return i&&n!==("right"===i)&&(s=!s),(s?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case Os:case Hs:case Vs:case zs:t&&e.preventDefault()}}addDomData(e){const t=ur,{eGui:o,gos:s}=this;Ut(s,o,t,this),e.addDestroyFunc(()=>Ut(s,o,t,null))}focus(e){if(!this.isAlive())return!1;const{eGui:t}=this;return t?(this.lastFocusEvent=e||null,t.focus()):this.reAttemptToFocus=!0,!0}focusThis(){this.beans.focusSvc.focusedHeader={headerRowIndex:this.rowCtrl.rowIndex,column:this.column}}removeDragSource(){this.dragSource&&(this.beans.dragAndDrop?.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,o){const s=e??t,{menuSvc:i,gos:n}=this.beans;n.get("preventDefaultOnContextMenu")&&s.preventDefault(),i?.isHeaderContextMenuEnabled(o)&&i.showHeaderContextMenu(o,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",o)}dispatchColumnMouseEvent(e,t){this.eventSvc.dispatchEvent({type:e,column:t})}setColHeaderHeight(e,t){if(!e.setAutoHeaderHeight(t))return;const{eventSvc:o}=this;e.isColumn?o.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"}):o.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,source:"autosizeColumnGroupHeaderHeight"})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.rowCtrl=null}},pr=class extends gr{constructor(){super(...arguments),this.refreshFunctions={},this.userHeaderClasses=/* @__PURE__ */new Set,this.ariaDescriptionProperties=/* @__PURE__ */new Map}wireComp(e,t,o,s,i){this.comp=e;const{rowCtrl:n,column:r,beans:a}=this,{colResize:l,context:d,colHover:c,rangeSvc:h}=a,u=nr(this,d,i);this.setGui(t,u),this.updateState(),this.setupWidth(u),this.setupMovingCss(u),this.setupMenuClass(u),this.setupSortableClass(u),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:s,checkMeasuringCallback:e=>this.setRefreshFunction("measuring",e),compBean:u}),this.addColumnHoverListener(u),this.setupFilterClass(u),this.setupStylesFromColDef(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(u),this.setupSelectAll(u),this.setupUserComp(),this.refreshAria(),l?this.resizeFeature=u.createManagedBean(l.createResizeFeature(n.pinned,r,o,e,this)):_(o,!1),c?.createHoverFeature(u,[r],t),h?.createRangeHighlightFeature(u,r,e),u.createManagedBean(new rr(r,t,a)),u.createManagedBean(new xn(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(u),u.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader","enableAdvancedFilter"],()=>this.refresh()),u.addManagedListeners(r,{colDefChanged:()=>this.refresh(),formulaRefChanged:()=>this.refresh(),headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const g=()=>this.checkDisplayName();u.addManagedEventListeners({columnValueChanged:g,columnRowGroupChanged:g,columnPivotChanged:g,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),u.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(e,t){this.beans.colResize?.resizeHeader(this.column,e,t)}getHeaderClassParams(){const{column:e,beans:t}=this,o=e.colDef;return wo(t.gos,{colDef:o,column:e,floatingFilter:!1})}setupUserComp(){const e=this.lookupUserCompDetails();e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return function(e,t,o){return e.getCompDetails(t,hi,"agColumnHeader",o)}(this.beans.userCompFactory,t,e)}createParams(){const{menuSvc:e,sortSvc:t,colFilter:o,gos:s}=this.beans;return wo(s,{column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&!!e?.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!!o&&(!this.openFilterEnabled||Co(this.gos)),showColumnMenu:(t,o)=>{e?.showColumnMenu({column:this.column,buttonElement:t,positionBy:"button",onClosedCallback:o})},showColumnMenuAfterMouseClick:(t,o)=>{e?.showColumnMenu({column:this.column,mouseEvent:t,positionBy:"mouse",onClosedCallback:o})},showFilter:t=>{e?.showFilterMenu({column:this.column,buttonElement:t,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{t?.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,o)=>{t?.setSortForColumn(this.column,Po(e),!!o,"uiColumnSorted")},eGridHeader:this.eGui,setTooltip:(e,t)=>{s.assertModuleRegistered("Tooltip",3),this.setupTooltip(e,t)}})}setupSelectAll(e){const{selectionSvc:t}=this.beans;t&&(this.selectAllFeature=e.createOptionalManagedBean(t.createSelectAllFeature(this.column)),this.selectAllFeature?.setComp(this),e.addManagedPropertyListener("rowSelection",()=>{const o=t.createSelectAllFeature(this.column);o&&!this.selectAllFeature?(this.selectAllFeature=e.createManagedBean(o),this.selectAllFeature?.setComp(this),this.comp.refreshSelectAllGui()):this.selectAllFeature&&!o&&(this.comp.removeSelectAllGui(),this.selectAllFeature=this.destroyBean(this.selectAllFeature))}))}getSelectAllGui(){return this.selectAllFeature?.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===As?this.selectAllFeature?.onSpaceKeyDown(e):e.key===Es?this.onEnterKeyDown(e):e.key===Gs&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){const{column:t,gos:o,sortable:s,beans:i}=this;let n=!1;(e.ctrlKey||e.metaKey)&&(n=this.showMenuOnKeyPress(e,!0)),n||(!e.altKey&&ao(o)?i.rangeSvc?.handleColumnSelection(t,e):s&&i.sortSvc?.progressSort(t,e.shiftKey,"uiColumnSorted"))}showMenuOnKeyPress(e,t){const o=this.comp.getUserCompInstance();return!!mr(o)&&(!!o.onMenuKeyboardShortcut(t)&&(e.preventDefault(),!0))}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription()),gn()&&this.setActiveHeader(!0)}onFocusOut(e){this.eGui.contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderTooltip(this.tooltipFeature,this,e,t)}setupStylesFromColDef(){this.setRefreshFunction("headerStyles",this.refreshHeaderStyles.bind(this)),this.refreshHeaderStyles()}setupClassesFromColDef(){const e=()=>{const e=ar(this.column.getColDef(),this.gos,this.column,null),t=this.userHeaderClasses;this.userHeaderClasses=new Set(e);for(const o of e)t.has(o)?t.delete(o):this.comp.toggleCss(o,!0);for(const o of t)this.comp.toggleCss(o,!1)};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){this.dragSourceElement=e,this.removeDragSource(),e&&this.draggable&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null)}updateState(){const{menuSvc:e}=this.beans;this.menuEnabled=!!e?.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=!!e?.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria();for(const e of Object.values(this.refreshFunctions))e()}refreshHeaderComp(){const e=this.lookupUserCompDetails();e&&(null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e))}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!!t&&(!!t.refresh&&t.refresh(e))}calculateDisplayName(){return this.beans.colNames.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!(this.gos.get("suppressMovableColumns")||e.suppressMovable||e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.toggleCss("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp?.toggleCss("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.toggleCss("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const e=this.column.isFilterActive();this.comp.toggleCss("ag-header-cell-filtered",e),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.toggleCss("ag-header-cell-wrap-text",e)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=0===e,o=1===e;this.comp.toggleCss("ag-header-highlight-before",t),this.comp.toggleCss("ag-header-highlight-after",o)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:o,beans:s}=this,i=Un(this.beans),n=0===i.reduce((e,t)=>e+t,0);if(o.toggleCss("ag-header-parent-hidden",n),!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),o.toggleCss("ag-header-span-height",!1),void o.toggleCss("ag-header-span-total",!1);const{numberOfParents:r,isSpanningTotal:a}=this.column.getColumnGroupPaddingInfo();o.toggleCss("ag-header-span-height",r>0);const l=jn(s);if(0===r)return o.toggleCss("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${l}px`);o.toggleCss("ag-header-span-total",a);const d=(this.column.getFirstRealParent()?.getLevel()??-1)+1,c=i.length-d;let h=0;for(let u=0;u"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0)).map(e=>o.get(e)).join(". ");e.ariaAnnounce?.announceValue(s,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered(),this.refreshAriaCellSelection()}addColumnHoverListener(e){this.beans.colHover?.addHeaderColumnHoverListener(e,this.comp,this.column)}addActiveHeaderMouseListeners(e){const t=e=>this.handleMouseOverChange("mouseenter"===e.type);e.addManagedListeners(this.eGui,{mouseenter:t,mouseleave:t,click:()=>{this.setActiveHeader(!0),this.dispatchColumnMouseEvent("columnHeaderClicked",this.column)},contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,this.column)})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.toggleCss("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return mr(t)?t.getAnchorElementForMenu(e):this.eGui}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}};function mr(e){return"function"==typeof e?.getAnchorElementForMenu&&"function"==typeof e.onMenuKeyboardShortcut}var fr=0,Cr=class extends We{constructor(e,t,o){super(),this.rowIndex=e,this.pinned=t,this.type=o,this.instanceId=fr++,this.comp=null,this.allCtrls=[];let s="ag-header-row-column";"group"===o?s="ag-header-row-group":"filter"===o&&(s="ag-header-row-filter"),this.headerRowClass=`ag-header-row ${s}`}setRowIndex(e){this.rowIndex=e,this.comp?.setRowIndex(this.getAriaRowIndex()),this.onRowHeightChanged()}postConstruct(){this.isPrintLayout=Nt(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return!!this.comp&&this.allCtrls.every(e=>null!=e.eGui)}setComp(e,t,o=!0){this.comp=e,t=nr(this,this.beans.context,t),o&&(this.setRowIndex(this.rowIndex),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this),o=this.onDisplayedColumnsChanged.bind(this);e.addManagedEventListeners({columnResized:this.setWidth.bind(this),displayedColumnsChanged:o,virtualColumnsChanged:e=>this.onVirtualColumnsChanged(e.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,stylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",o),e.addManagedPropertyListener("ensureDomOrder",e=>this.isEnsureDomOrder=e.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}onDisplayedColumnsChanged(){this.isPrintLayout=Nt(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}setWidth(){if(!this.comp)return;const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleCols:e}=this.beans;return this.isPrintLayout?null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){if(!this.comp)return;const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){let e=0;const t=Un(this.beans);for(let s=0;s{const{focusSvc:t,visibleCols:o}=this.beans;return!!t.isHeaderWrapperFocused(e)&&o.isVisible(e.column)};if(e)for(const[s,i]of e)o(i)?this.ctrlsById.set(s,i):this.destroyBean(i);return this.allCtrls=Array.from(this.ctrlsById.values()),this.allCtrls}getHeaderCellCtrls(){return this.allCtrls}recycleAndCreateHeaderCtrls(e,t,o){if(e.isEmptyGroup())return;const s=e.getUniqueId();let i;if(o&&(i=o.get(s),o.delete(s)),i&&i.column!=e&&(this.destroyBean(i),i=void 0),null==i)switch(this.type){case"filter":i=this.createBean(this.beans.registry.createDynamicBean("headerFilterCellCtrl",!0,e,this));break;case"group":i=this.createBean(this.beans.registry.createDynamicBean("headerGroupCellCtrl",!0,e,this));break;default:i=this.createBean(new pr(e,this))}t.set(s,i)}getColumnsInViewport(){if(!this.isPrintLayout)return this.getComponentsToRender();if(this.pinned)return[];const e=[];for(const t of["left",null,"right"])e.push(...this.getComponentsToRender(t));return e}getComponentsToRender(e=this.pinned){return"group"===this.type?this.beans.colViewport.getHeadersToRender(e,this.rowIndex):this.beans.colViewport.getColumnHeadersToRender(e)}focusHeader(e,t){const o=this.allCtrls.find(t=>t.column==e);return!!o&&o.focus(t)}destroy(){this.allCtrls=this.destroyBeans(this.allCtrls),this.ctrlsById=void 0,this.comp=null,super.destroy()}},vr=class extends We{constructor(e){super(),this.pinned=e,this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[]}setComp(e,t){this.comp=e,this.eViewport=t;const{pinnedCols:o,ctrlsSvc:s,colModel:i,colMoves:n}=this.beans;this.setupCenterWidth(),o?.setupHeaderPinnedWidth(this),this.setupDragAndDrop(n,this.eViewport);const r=this.refresh.bind(this,!0);this.addManagedEventListeners({displayedColumnsChanged:r,advancedFilterEnabledChanged:r});const a=`${"string"==typeof this.pinned?this.pinned:"center"}Header`;s.register(a,this),i.ready&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const{focusSvc:t,filterManager:o,visibleCols:s}=this.beans;let i=0;const n=t.getFocusHeaderToUseAfterRefresh(),r=this.getAllCtrls();(()=>{const t=s.headerGroupRowCount;i=t,e||(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls));const o=this.groupsRowCtrls.length;if(o!==t)if(o>t){for(let e=t;e{const t=i++;this.hidden?this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl):null!=this.columnsRowCtrl&&e?this.columnsRowCtrl.rowIndex!==t&&this.columnsRowCtrl.setRowIndex(t):(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl),this.columnsRowCtrl=this.createBean(new Cr(t,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=!!o?.hasFloatingFilters()&&!this.hidden;const t=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void t();e||t();const s=i++;this.filtersRowCtrl?this.filtersRowCtrl.rowIndex!==s&&this.filtersRowCtrl.setRowIndex(s):this.filtersRowCtrl=this.createBean(new Cr(s,this.pinned,"filter"))})();const a=this.getAllCtrls();this.comp.setCtrls(a),this.restoreFocusOnHeader(t,n),r.length!==a.length&&this.beans.eventSvc.dispatchEvent({type:"headerRowsChanged"})}getHeaderCtrlForColumn(e){const t=t=>t?.getHeaderCellCtrls().find(t=>t.column===e);if(xo(e))return t(this.columnsRowCtrl);if(0!==this.groupsRowCtrls.length)for(let o=0;othis.comp.setCenterWidth(`${e}px`),!0))}},wr=class extends si{isPopup(){return!0}setParentComponent(e){e.addCss("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e?.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},br=class extends wr{constructor(){super(...arguments),this.errorMessages=null}init(e){this.params=e,this.initialiseEditor(e),this.eEditor.onValueChange(()=>e.validate())}destroy(){this.eEditor.destroy(),this.errorMessages=null,super.destroy()}},yr=class extends ni{constructor(){super()}},Sr={tag:"div",cls:"ag-overlay-exporting-center",children:[{tag:"span",ref:"eExportingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eExportingText",cls:"ag-exporting-text"}]},Rr={tag:"div",cls:"ag-overlay-loading-center",children:[{tag:"span",ref:"eLoadingIcon",cls:"ag-loading-icon"},{tag:"span",ref:"eLoadingText",cls:"ag-loading-text"}]},xr={tag:"span",cls:"ag-overlay-no-matching-rows-center"},Fr={tag:"span",cls:"ag-overlay-no-rows-center"},Dr=class extends si{constructor(e,t,o){super(t,o),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{},this.registerCSS(".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-label-align-right){.ag-label,.ag-wrapper{flex:none}}.ag-label-align-top{align-items:flex-start;flex-direction:column}:where(.ag-label-align-top){.ag-label,.ag-wrapper{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}")}postConstruct(){this.addCss("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:o,labelAlignment:s,disabled:i,labelEllipsis:n}=this.config;null!=i&&this.setDisabled(i),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=o&&this.setLabelWidth(o),null!=n&&this.setLabelEllipsis(n),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){const{label:e,eLabel:t}=this;ie(t),"string"==typeof e?t.innerText=e+this.labelSeparator:e&&t.appendChild(e),""===e?(_(t,!1),P(t,"presentation")):(_(t,!0),P(t,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){const e=this.eLabel;return e.id=e.id||`ag-${this.getCompId()}-label`,e.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||pe(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return q(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},Mr=class extends Dr{constructor(e,t,o,s){super(e,t,o),this.className=s}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:o,ariaLabel:s}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=o&&this.onValueChange(o),null!=s&&this.setAriaLabel(s),this.className&&this.addCss(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),o=this.getLabel();null==o||""==o||null!==e.getAttribute("aria-label")?T(e,""):T(e,t??"")}setAriaLabel(e){return E(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return me(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"})),this}};var Pr=class extends Mr{constructor(e,t,o="text",s="input"){super(e,e?.template??function(e){return{tag:"div",role:"presentation",children:[{tag:"div",ref:"eLabel",cls:"ag-input-field-label"},{tag:"div",ref:"eWrapper",cls:"ag-wrapper ag-input-wrapper",role:"presentation",children:[{tag:e,ref:"eInput",cls:"ag-input-field-input"}]}]}}(s),[],t),this.inputType=o,this.displayFieldTag=s,this.eLabel=null,this.eWrapper=null,this.eInput=null}postConstruct(){super.postConstruct(),this.setInputType(this.inputType);const{eLabel:e,eWrapper:t,eInput:o,className:s}=this;e.classList.add(`${s}-label`),t.classList.add(`${s}-input-wrapper`),o.classList.add(`${s}-input`),this.addCss("ag-input-field"),o.id=o.id||`ag-${this.getCompId()}-input`;const{inputName:i,inputWidth:n,inputPlaceholder:r,autoComplete:a,tabIndex:l}=this.config;null!=i&&this.setInputName(i),null!=n&&this.setInputWidth(n),null!=r&&this.setInputPlaceholder(r),null!=a&&this.setAutoComplete(a),this.addInputListeners(),this.activateTabIndex([o],l)}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(e){"input"===this.displayFieldTag&&(this.inputType=e,we(this.eInput,"type",e))}getInputElement(){return this.eInput}getWrapperElement(){return this.eWrapper}setInputWidth(e){return pe(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return we(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return E(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return q(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)we(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";we(this.eInput,"autocomplete",t)}return this}},Er=class extends Pr{constructor(e,t="ag-checkbox",o="checkbox"){super(e,t,o),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t,name:o}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t),null!=o&&this.setName(o)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){if(this.isSelected()===e)return;this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0;const o=this.eInput;o.checked=e,o.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue)}dispatchChange(e,t,o){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:o});const s=this.getInputElement();this.eventSvc.dispatchEvent({type:"checkboxChanged",id:s.id,name:s.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),o=this.selected=e.target.checked;this.refreshSelectedClass(o),this.dispatchChange(o,t,e)}refreshSelectedClass(e){const t=this.eWrapper.classList;t.toggle("ag-checked",!0===e),t.toggle("ag-indeterminate",null==e)}},Tr={selector:"AG-CHECKBOX",component:Er},Ar={tag:"div",cls:"ag-cell-wrapper ag-checkbox-cell",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]};var Ir=0,kr=class{constructor(e){this.id=void 0,this.destroyed=!1,this._groupData=void 0,this.master=!1,this.detail=void 0,this.rowIndex=null,this.field=null,this.rowGroupColumn=null,this.key=null,this.sourceRowIndex=-1,this._leafs=void 0,this.childrenMapped=null,this.treeParent=null,this.treeNodeFlags=0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=Ir++,this.alreadyRendered=!1,this.formulaRowIndex=null,this.hovered=!1,this.__selected=!1,this.beans=e}get groupData(){const e=this._groupData;return void 0!==e?e:this.footer?this.sibling?.groupData:this.beans.groupStage?.loadGroupData(this)??null}set groupData(e){this._groupData=e}get allLeafChildren(){const e=this._leafs;return void 0===e?this.beans.groupStage?.loadLeafs?.(this)??null:e}set allLeafChildren(e){this._leafs=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const{valueCache:o,eventSvc:s}=this.beans,i=this.data;this.data=e,o?.onDataChanged(),this.updateDataOnDetailNode(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(e,i,t);if(this.__localEventService?.dispatchEvent(n),this.sibling){this.sibling.data=e;const o=this.sibling.createDataChangedEvent(e,i,t);this.sibling.__localEventService?.dispatchEvent(o)}s.dispatchEvent({type:"rowNodeDataChanged",node:this});const r=this.pinnedSibling;r&&(r.data=e,r.__localEventService?.dispatchEvent(r.createDataChangedEvent(e,i,t)),s.dispatchEvent({type:"rowNodeDataChanged",node:r}))}updateDataOnDetailNode(){const e=this.detailNode;e&&(e.data=this.data)}createDataChangedEvent(e,t,o){return{type:"dataChanged",node:this,oldData:t,newData:e,update:o}}getRowIndexString(){return null==this.rowIndex?(Tt(13),null):"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}setDataAndId(e,t){const{selectionSvc:o}=this.beans,s=o?.createDaemonNode?.(this),i=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),o&&(o.updateRowSelectable(this),o.syncInRowNode(this,s));const n=this.createDataChangedEvent(e,i,!1);this.__localEventService?.dispatchEvent(n)}setId(e){const t=Jt(this.beans.gos);if(t)if(this.data){const e=this.parent?.getRoute()??[];this.id=t({data:this.data,parentKeys:e.length>0?e:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith("row-group-")&&Tt(14,{groupPrefix:"row-group-"})}else this.id=void 0;else this.id=e}setRowTop(e){if(this.oldRowTop=this.rowTop,this.rowTop===e)return;this.rowTop=e,this.dispatchRowEvent("topChanged");const t=null!==e;this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(e){this.hovered=e}isHovered(){return this.hovered}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setExpanded(e,t,o){this.beans.expansionSvc?.setExpanded(this,e,t,o)}setDataValue(e,t,o){const{colModel:s,valueSvc:i,gos:n,editSvc:r}=this.beans;if(null==e)return!1;let a=s.getCol(e)??s.getColDefCol(e);if(!a)return!1;if(!this.group){const e=a.getColDef();e.pivotValueColumn&&(a=e.pivotValueColumn)}const l=i.getValueForDisplay({column:a,node:this,from:"data"}).value;if(n.get("readOnlyEdit")){const{beans:{eventSvc:e},data:s,rowIndex:i,rowPinned:n}=this;return e.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:i,rowPinned:n,column:a,colDef:a.colDef,data:s,node:this,oldValue:l,newValue:t,value:t,source:o}),!1}if(r&&!r.committing){const e=r.setDataValue({rowNode:this,column:a},t,o);if(null!=e)return e}const d=i.setValue(this,a,t,o);return this.dispatchCellChangedEvent(a,t,l),d&&this.pinnedSibling?.dispatchCellChangedEvent(a,t,l),d}getDataValue(e){const{colModel:t,valueSvc:o,formula:s}=this.beans;if(null==e)return;const i=t.getCol(e)??t.getColDefCol(e);if(!i)return;let n=o.getValue(i,this,"data");return s&&i.isAllowFormula()&&s.isFormula(n)&&(n=s.resolveValue(i,this)),n}updateHasChildren(){let e=this.group&&!this.footer||!!this.childrenAfterGroup?.length;const{rowChildrenSvc:t}=this.beans;t&&(e=t.getHasChildrenValue(this)),e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(e,t,o){const s={type:"cellChanged",node:this,column:e,newValue:t,oldValue:o};this.__localEventService?.dispatchEvent(s)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.beans.expansionSvc?.isExpandable(this)??!1}isSelected(){if(this.footer)return this.sibling.isSelected();const e=this.rowPinned&&this.pinnedSibling;return e?e.isSelected():this.__selected}depthFirstSearch(e){const t=this.childrenAfterGroup;if(t)for(let o=0,s=t.length;o{if(Gr){if(Gr.has(e))return!1}else Gr=/* @__PURE__ */new WeakSet;return Gr.add(e),!0})(e))return;const t=e.touches[0];this.touchStart=t;const o=this.handlers;if(!o.length){const e=this.eElement,t=e.ownerDocument,s=this.onTouchMove.bind(this),i=this.onTouchEnd.bind(this),n=this.onTouchCancel.bind(this),r={passive:!0},a={passive:!1};Ne(o,[e,"touchmove",s,r],[t,"touchcancel",n,r],[t,"touchend",i,a],[t,"contextmenu",He,a])}this.clearLongPress(),this.longPressTimer=window.setTimeout(()=>{this.longPressTimer=0,this.touchStart!==t||this.moved||(this.moved=!0,this.eventSvc?.dispatchEvent({type:"longTap",touchStart:t,touchEvent:e}))},550)}onTouchMove(e){const{moved:t,touchStart:o}=this;if(!t&&o){const t=ke(o,e.touches);t&&!Ie(t,o,4)&&(this.clearLongPress(),this.moved=!0)}}onTouchEnd(e){const t=this.touchStart;t&&ke(t,e.changedTouches)&&(this.moved||(this.eventSvc?.dispatchEvent({type:"tap",touchStart:t}),this.checkDoubleTap(t)),this.preventClick&&He(e),this.cancel())}onTouchCancel(e){const t=this.touchStart;t&&ke(t,e.changedTouches)&&(this.lastTapTime=null,this.cancel())}checkDoubleTap(e){let t=Date.now();const o=this.lastTapTime;o&&t-o>500&&(this.eventSvc?.dispatchEvent({type:"doubleTap",touchStart:e}),t=null),this.lastTapTime=t}cancel(){this.clearLongPress(),Be(this.handlers),this.touchStart=null}clearLongPress(){window.clearTimeout(this.longPressTimer),this.longPressTimer=0,this.moved=!1}destroy(){const e=this.startListener;e&&(this.startListener=null,this.eElement.removeEventListener("touchstart",e)),this.cancel(),this.eElement=null,this.eventSvc=null}},Hr=/* @__PURE__ */(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(Hr||{}),Or=1,Vr=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,this.instanceId=Or++,e?.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){this.id=e.id,this.beans.context=this,this.destroyCallback=e.destroyCallback;for(const t of Object.keys(e.providedBeanInstances))this.beans[t]=e.providedBeanInstances[t];for(const t of e.beanClasses){const e=new t;e.beanName?this.beans[e.beanName]=e:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(e)}for(const t of e.derivedBeans??[]){const{beanName:e,bean:o}=t(this);this.beans[e]=o,this.createdBeans.push(o)}e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){return this.initBeans([e],t),e}initBeans(e,t){const o=this.beans;for(const s of e)s.preWireBeans?.(o),s.wireBeans?.(o);for(const s of e)s.preConstruct?.();t&&e.forEach(t);for(const s of e)s.postConstruct?.()}getBeans(){return this.beans}getBean(e){return this.beans[e]}getId(){return this.id}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[],this.destroyCallback?.()}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t[e,t]));function Ur(e,t){return((e.beanName?Wr[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER)-((t.beanName?Wr[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER)}function $r(e,t){return"gridDestroySvc"===e?.beanName?-1:"gridDestroySvc"===t?.beanName?1:0}var jr={tag:"div",cls:"ag-pinned-left-header",role:"rowgroup"},Kr={tag:"div",cls:"ag-pinned-right-header",role:"rowgroup"},_r={tag:"div",cls:"ag-header-viewport",role:"rowgroup",attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eCenterContainer",cls:"ag-header-container",role:"presentation"}]},qr=class extends ni{constructor(e){super(),this.eCenterContainer=null,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate(),this.createManagedBean(new vr(this.pinned)).setComp({setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}},this.getGui())}selectAndSetTemplate(){const e="left"==this.pinned,t="right"==this.pinned,o=e?jr:t?Kr:_r;this.setTemplate(o),this.eRowContainer=null!==this.eCenterContainer?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),e.getGui().remove()}setCtrls(e){const t=this.headerRowComps;let o;this.headerRowComps={},this.rowCompsList=[];const s=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),o&&de(this.eRowContainer,t,o),o=t};for(const i of e){const e=i.instanceId,o=t[e];delete t[e];const n=o||this.createBean(new sr(i));this.headerRowComps[e]=n,this.rowCompsList.push(n),s(n)}for(const i of Object.values(t))this.destroyRowComp(i)}},Yr={tag:"div",cls:"ag-header",role:"presentation"},Zr={selector:"AG-HEADER-ROOT",component:class extends ni{constructor(){super(Yr)}postConstruct(){this.createManagedBean(new Yn).setComp({toggleCss:(e,t)=>this.toggleCss(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}},this.getGui(),this.getFocusableElement());const e=e=>{this.createManagedBean(e),this.appendChild(e)};e(new qr("left")),e(new qr(null)),e(new qr("right"))}}},Qr={AUTO_HEIGHT:"ag-layout-auto-height",NORMAL:"ag-layout-normal",PRINT:"ag-layout-print"},Xr=class extends We{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.gos.get("domLayout"),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},o=t.autoHeight?Qr.AUTO_HEIGHT:t.print?Qr.PRINT:Qr.NORMAL;this.view.updateLayoutClasses(o,t)}},Jr=class extends ni{constructor(e,t){super(),this.direction=t,this.eViewport=null,this.eContainer=null,this.hideTimeout=0,this.setTemplate(e)}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.toggleCss("ag-apple-scrollbar",on()||sn())}destroy(){super.destroy(),window.clearTimeout(this.hideTimeout)}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=ln(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.toggleCss("ag-scrollbar-active",!0),o=()=>this.toggleCss("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:o,touchend:o})}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),ye(this.beans,()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=0),this.toggleCss("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.toggleCss("ag-scrollbar-scrolling",!1),this.hideTimeout=0},400)}})}attemptSettingScrollPosition(e){const t=this.eViewport;Ze(this,()=>ae(t),()=>this.setScrollPosition(e),100)}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}},ea={tag:"div",cls:"ag-body-horizontal-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eLeftSpacer",cls:"ag-horizontal-left-spacer"},{tag:"div",ref:"eViewport",cls:"ag-body-horizontal-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-horizontal-scroll-container"}]},{tag:"div",ref:"eRightSpacer",cls:"ag-horizontal-right-spacer"}]},ta={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:class extends Jr{constructor(){super(ea,"horizontal"),this.eLeftSpacer=null,this.eRightSpacer=null,this.setScrollVisibleDebounce=0}wireBeans(e){this.visibleCols=e.visibleCols,this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.refreshCompBottom.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.beans.ctrlsSvc.register("fakeHScrollComp",this),this.createManagedBean(new ir(e=>this.eContainer.style.width=`${e}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}destroy(){window.clearTimeout(this.setScrollVisibleDebounce),super.destroy()}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.beans.pinnedRowModel?.getPinnedBottomTotalHeight()??0;this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleSvc.verticalScrollShowing;let t=this.visibleCols.getDisplayedColumnsRightWidth();const o=!this.enableRtl&&e,s=this.scrollVisibleSvc.getScrollbarWidth();o&&(t+=s),me(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let i=this.visibleCols.getColsLeftWidth();this.enableRtl&&e&&(i+=s),me(this.eLeftSpacer,i),this.eLeftSpacer.classList.toggle("ag-scroller-corner",i<=s)}setScrollVisible(){const e=this.scrollVisibleSvc.horizontalScrollShowing,t=this.invisibleScrollbar,o=this.gos.get("suppressHorizontalScroll"),s=e&&this.scrollVisibleSvc.getScrollbarWidth()||0,i=o?0:0===s&&t?16:s,n=()=>{this.setScrollVisibleDebounce=0,this.toggleCss("ag-scrollbar-invisible",t),fe(this.getGui(),i),fe(this.eViewport,i),fe(this.eContainer,i),i||this.eContainer.style.setProperty("min-height","1px"),this.setVisible(e,{skipAriaHidden:!0})};window.clearTimeout(this.setScrollVisibleDebounce),e?this.setScrollVisibleDebounce=window.setTimeout(n,100):n()}getScrollPosition(){return oe(this.eViewport,this.enableRtl)}setScrollPosition(e){ae(this.eViewport)||this.attemptSettingScrollPosition(e),se(this.eViewport,e,this.enableRtl)}}},oa=class extends We{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this,this.beans.rowContainerHeight)})}onHeightChanged(e){const t=e.uiContainerHeight,o=null!=t?`${t}px`:"";this.eContainer.style.height=o,this.eViewport&&(this.eViewport.style.height=o)}},sa={tag:"div",cls:"ag-body-vertical-scroll",attrs:{"aria-hidden":"true"},children:[{tag:"div",ref:"eViewport",cls:"ag-body-vertical-scroll-viewport",children:[{tag:"div",ref:"eContainer",cls:"ag-body-vertical-scroll-container"}]}]},ia={selector:"AG-FAKE-VERTICAL-SCROLL",component:class extends Jr{constructor(){super(sa,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new oa(this.eContainer));const{ctrlsSvc:e}=this.beans;e.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this,e)})}setScrollVisible(){const{scrollVisibleSvc:e}=this.beans,t=e.verticalScrollShowing,o=this.invisibleScrollbar,s=t&&e.getScrollbarWidth()||0,i=0===s&&o?16:s;this.toggleCss("ag-scrollbar-invisible",o),me(this.getGui(),i),me(this.eViewport,i),me(this.eContainer,i),this.setDisplayed(t,{skipAriaHidden:!0})}onRowContainerHeightChanged(e){const t=e.getGridBodyCtrl().eBodyViewport,o=this.getScrollPosition(),s=t.scrollTop;o!=s&&this.setScrollPosition(s,!0)}getScrollPosition(){return this.eViewport.scrollTop}setScrollPosition(e,t){t||ae(this.eViewport)||this.attemptSettingScrollPosition(e),this.eViewport.scrollTop=e}}},na="Viewport",ra="fakeVScrollComp",aa=["fakeHScrollComp","centerHeader","topCenter","bottomCenter","stickyTopCenter","stickyBottomCenter"],la=class extends We{constructor(e){super(),this.clearRetryListenerFncs=[],this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.lastIsHorizontalScrollShowing=!1,this.scrollTimer=0,this.isScrollActive=!1,this.isVerticalPositionInvalidated=!0,this.isHorizontalPositionInvalidated=!0,this.eBodyViewport=e,this.resetLastHScrollDebounced=qe(this,()=>this.lastScrollSource[1]=null,150),this.resetLastVScrollDebounced=qe(this,()=>this.lastScrollSource[0]=null,150)}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.animationFrameSvc=e.animationFrameSvc,this.visibleCols=e.visibleCols}destroy(){super.destroy(),this.clearRetryListenerFncs=[],window.clearTimeout(this.scrollTimer)}postConstruct(){this.enableRtl=this.gos.get("enableRtl");const e=this.invalidateVerticalScroll.bind(this),t=this.invalidateHorizontalScroll.bind(this);this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),bodyHeightChanged:e,scrollGapChanged:t}),this.addManagedElementListeners(this.eBodyViewport,{scroll:e}),this.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}invalidateHorizontalScroll(){this.isHorizontalPositionInvalidated=!0}invalidateVerticalScroll(){this.isVerticalPositionInvalidated=!0}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.eViewport,{scroll:this.onHScroll.bind(this,na)});for(const e of aa){const t=this.ctrlsSvc.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.ctrlsSvc.get("fakeVScrollComp"),t=this.gos.get("debounceVerticalScrollbar"),o=t?qe(this,this.onVScroll.bind(this,na),100):this.onVScroll.bind(this,na),s=t?qe(this,this.onVScroll.bind(this,ra),100):this.onVScroll.bind(this,ra);this.addManagedElementListeners(this.eBodyViewport,{scroll:o}),this.registerScrollPartner(e,s)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){null!=this.centerRowsCtrl&&(void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...aa,na])this.lastScrollSource[1]!==t&&se(this.getViewportForSource(t),e,this.enableRtl)}getViewportForSource(e){return e===na?this.centerRowsCtrl.eViewport:this.ctrlsSvc.get(e).eViewport}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(0===t?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const{scrollLeft:t}=this.centerRowsCtrl.eViewport;if(this.shouldBlockScrollUpdate(1,t,!0))return;const o=oe(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(o),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;let t;if(t=e===na?this.eBodyViewport.scrollTop:this.ctrlsSvc.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0))return;const{animationFrameSvc:o}=this;o?.setScrollTop(t),this.nextScrollTop=t,e===na?this.ctrlsSvc.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,o?.active?o.schedule():this.scrollGridIfNeeded(!0),this.resetLastVScrollDebounced()}doHorizontalScroll(e){const t=this.ctrlsSvc.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}isScrolling(){return this.isScrollActive}fireScrollEvent(e){const t={type:"bodyScroll",direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.isScrollActive=!0,this.eventSvc.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=window.setTimeout(()=>{this.scrollTimer=0,this.isScrollActive=!1,this.eventSvc.dispatchEvent({...t,type:"bodyScrollEnd"})},150)}shouldBlockScrollUpdate(e,t,o=!1){return!(o&&!sn())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=Q(this.eBodyViewport),{scrollHeight:o}=this.eBodyViewport;return!!(e<0||e+t>o)}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:o}=this.centerRowsCtrl.eViewport;if(this.enableRtl){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>o}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){const e=this.scrollLeft;let t=!1;for(const o of aa)if(this.getViewportForSource(o).scrollLeft!==e){t=!0;break}t&&this.onHScroll(na)}scrollGridIfNeeded(e=!1){const t=this.scrollTop!=this.nextScrollTop;return t&&(this.scrollTop=this.nextScrollTop,e&&this.invalidateVerticalScroll(),this.redrawRowsAfterScroll()),t}setHorizontalScrollPosition(e,t=!1){const o=this.centerRowsCtrl.eViewport.scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl?e>0?0:o:Math.min(Math.max(e,0),o)),se(this.centerRowsCtrl.eViewport,Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.invalidateVerticalScroll(),this.eBodyViewport.scrollTop=e}getVScrollPosition(){if(!this.isVerticalPositionInvalidated){const{lastOffsetHeight:e,lastScrollTop:t}=this;return{top:t,bottom:t+e}}this.isVerticalPositionInvalidated=!1;const{scrollTop:e,offsetHeight:t}=this.eBodyViewport;return this.lastScrollTop=e,this.lastOffsetHeight=t,{top:e,bottom:e+t}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.isHorizontalPositionInvalidated&&(this.lastIsHorizontalScrollShowing=this.centerRowsCtrl.isHorizontalScrollShowing(),this.isHorizontalPositionInvalidated=!1),this.lastIsHorizontalScrollShowing}scrollHorizontally(e){const t=this.centerRowsCtrl.eViewport.scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.eViewport.scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const{rowModel:o}=this.beans,s=o.getRowCount();let i=-1;for(let n=0;n=0&&this.ensureIndexVisible(i,t)}ensureIndexVisible(e,t,o=0){if(Nt(this.gos,"print"))return;const{rowModel:s}=this.beans,i=s.getRowCount();if("number"!=typeof e||e<0||e>=i)return void Et(88,{index:e});this.clearRetryListeners();const{frameworkOverrides:n,pageBounds:r,rowContainerHeight:a,rowRenderer:l}=this.beans;n.wrapIncoming(()=>{const i=this.ctrlsSvc.getGridBodyCtrl(),n=s.getRow(e);let d,c,h=0;this.invalidateVerticalScroll();do{const{stickyTopHeight:e,stickyBottomHeight:o}=i,s=n.rowTop,u=n.rowHeight,g=r.getPixelOffset(),p=n.rowTop-g,m=p+n.rowHeight,f=this.getVScrollPosition(),C=a.divStretchOffset,v=f.top+C,w=f.bottom+C,b=w-v,y=a.getScrollPositionForPixel(p),S=a.getScrollPositionForPixel(m-b),R=Math.min((y+S)/2,p);let x=null;"top"===t?x=y-e:"bottom"===t?x=S+o:"middle"===t?x=R:v+e>p?x=y-e:w-ob?y-e:S+o),null!==x&&(this.setVerticalScrollPosition(x),l.redraw({afterScroll:!0})),d=s!==n.rowTop||u!==n.rowHeight,c=e!==i.stickyTopHeight||o!==i.stickyBottomHeight,h++}while((d||c)&&h<10);if(this.animationFrameSvc?.flushAllFrames(),o<10&&(n?.stub||!this.beans.rowAutoHeight?.areRowsMeasured())){const i=this.getVScrollPosition().top;this.clearRetryListenerFncs=this.addManagedEventListeners({bodyScroll:()=>{i!==this.getVScrollPosition().top&&this.clearRetryListeners()},modelUpdated:()=>{this.clearRetryListeners(),e>=s.getRowCount()||this.ensureIndexVisible(e,t,o+1)}})}})}clearRetryListeners(){for(const e of this.clearRetryListenerFncs)e();this.clearRetryListenerFncs=[]}ensureColumnVisible(e,t="auto"){const{colModel:o,frameworkOverrides:s}=this.beans,i=o.getCol(e);if(!i)return;if(i.isPinned())return;if(!this.visibleCols.isColDisplayed(i))return;const n=this.getPositionedHorizontalScroll(i,t);s.wrapIncoming(()=>{null!==n&&this.centerRowsCtrl.setCenterViewportScrollLeft(n),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameSvc?.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:o,columnAfterEnd:s}=this.isColumnOutsideViewport(e),i=this.centerRowsCtrl.getCenterWidth()i:os}}getColumnBounds(e){const t=this.enableRtl,o=this.visibleCols.bodyWidth,s=e.getActualWidth(),i=e.getLeft(),n=t?-1:1,r=t?o-i:i;return{colLeft:r,colMiddle:r+s/2*n,colRight:r+s*n}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}},da={horizontal:{overflow:e=>e.scrollWidth-e.clientWidth,scrollSize:e=>e.scrollWidth,clientSize:e=>e.clientWidth,opposite:"vertical"},vertical:{overflow:e=>e.scrollHeight-e.clientHeight,scrollSize:e=>e.scrollHeight,clientSize:e=>e.clientHeight,opposite:"horizontal"}};function ca(e,t,o,s,i,n){const r=da[o],a=da[r.opposite],l=!i||ae(i),d=!n||ae(n),c=r.overflow(e);if(c<=0)return!1;if(!t||0===s)return!0;const h=a.overflow(t);if(h<=0)return!0;if(c<=s){if(l&&d&&function({candidateOverflow:e,candidateScrollSize:t,candidateClientSize:o,scrollbarWidth:s}){if(e<=0||e>s)return!1;const i=o+s;return t>o&&t<=i}({candidateOverflow:h,candidateScrollSize:a.scrollSize(t),candidateClientSize:a.clientSize(t),scrollbarWidth:s}))return!1;const o=r.clientSize(e)+s;return r.scrollSize(e)<=o}return!0}var ha=class extends We{constructor(e){super(),this.centerContainerCtrl=e}wireBeans(e){this.scrollVisibleSvc=e.scrollVisibleSvc}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const{beans:e,centerContainerCtrl:t,gridBodyCtrl:o}=this,s=()=>{ye(e,()=>{this.onCenterViewportResized()})};t.registerViewportResizeListener(s),o.registerBodyViewportResizeListener(s)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleSvc.updateScrollGap(),this.centerContainerCtrl.isViewportInTheDOMTree()){const{pinnedCols:e,colFlex:t}=this.beans;e?.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const o=this.centerContainerCtrl.getCenterWidth();o!==this.centerWidth&&(this.centerWidth=o,t?.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.scrollFeature.checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=Q(this.gridBodyCtrl.eBodyViewport);this.bodyHeight!==e&&(this.bodyHeight=e,this.eventSvc.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){if(!this.isAlive())return;const e={horizontalScrollShowing:this.centerContainerCtrl.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleSvc.setScrollsVisible(e)}onHorizontalViewportChanged(){const{centerContainerCtrl:e,beans:t}=this,o=e.getCenterWidth(),s=e.getViewportScrollLeft();t.colViewport.setScrollPosition(o,s)}};function ua(e){return!(e.altKey||e.ctrlKey||e.metaKey)&&1===e.key?.length}function ga(e,t,o,s){const i=t.getColDef().cellRendererParams?.suppressMouseEventHandling;return pa(e,t,o,s,i)}function pa(e,t,o,s,i){return!!i&&i(wo(e,{column:t,node:o,event:s}))}function ma(e,t,o){let s=t;for(;s;){const t=Wt(e,s,o);if(t)return t;s=s.parentElement}return null}var fa="cellCtrl";function Ca(e,t){return ma(e,t,fa)}var va="renderedRow";function wa(e,t){return ma(e,t,va)}function ba(e,t,o,s,i){const n=s?s.getColDef().suppressKeyboardEvent:void 0;if(!n)return!1;const r=wo(e,{event:t,editing:i,column:s,node:o,data:o.data,colDef:s.getColDef()});return!(!n||!n(r))}var ya=class extends We{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.beans.touchSvc?.mockRowContextMenu(this),this.editSvc=this.beans.editSvc}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){let e="mousedown";Ee("pointerdown")?e="pointerdown":Ee("touchstart")&&(e="touchstart");const t=["dblclick","contextmenu","mouseover","mouseout","click",e];for(const o of t){const e=this.processMouseEvent.bind(this,o);this.addManagedElementListeners(this.element,{[o]:e})}}processMouseEvent(e,t){if(!Le(this.beans,t)||Sn(t))return;const{cellCtrl:o,rowCtrl:s}=this.getControlsForEventTarget(t.target);"contextmenu"===e?(o?.column&&o.dispatchCellContextMenuEvent(t),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t,void 0,s,o)):(o&&o.onMouseEvent(e,t),s&&s.onMouseEvent(e,t))}getControlsForEventTarget(e){const{gos:t}=this;return{cellCtrl:Ca(t,e),rowCtrl:wa(t,e)}}processKeyboardEvent(e,t){const{cellCtrl:o,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(o?this.processCellKeyboardEvent(o,e,t):s?.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,o){const s=this.editSvc?.isEditing(e,{withOpenEditor:!0})??!1;ba(this.gos,o,e.rowNode,e.column,s)||"keydown"===t&&(!s&&this.beans.navigation?.handlePageScrollingKey(o)||e.onKeyDown(o),this.doGridOperations(o,s),ua(o)&&e.processCharacter(o)),"keydown"===t&&this.eventSvc.dispatchEvent(e.createEvent(o,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,o){const{rowNode:s}=e,{focusSvc:i,navigation:n}=this.beans,r=i.getFocusedCell()?.column;if(!ba(this.gos,o,s,r,!1)){const s=o.key;if("keydown"===t)switch(s){case Vs:case zs:case Hs:case Os:n?.handlePageScrollingKey(o,!0);break;case Is:case Ls:if(!this.gos.get("embedFullWidthRows"))break;case ks:case Gs:e.onKeyboardNavigate(o);break;case Ps:e.onTabKeyDown(o)}}"keydown"===t&&this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown",o))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!Le(this.beans,e))return;const o=Ys(e),{clipboardSvc:s,undoRedo:i}=this.beans;return o===Ws?this.onCtrlAndA(e):o===Us?this.onCtrlAndC(s,e):o===$s?this.onCtrlAndD(s,e):o===js?this.onCtrlAndV(s,e):o===Ks?this.onCtrlAndX(s,e):o===_s?this.onCtrlAndY(i):o===qs?this.onCtrlAndZ(i,e):void 0}onCtrlAndA(e){const{beans:{rowModel:t,rangeSvc:o,selectionSvc:s},gos:i}=this;o&&no(i)&&!function(e){const t=e.get("rowSelection");return"string"!=typeof t&&"multiRow"===t?.mode&&(t.ctrlASelectsRows??!1)}(i)&&t.isRowsToRender()?function(e){const{pinnedRowModel:t,rowModel:o,rangeSvc:s,visibleCols:i}=e;if(!s||0===i.allCols.length)return;const n=t?.isEmpty("top")??1?null:"top";let r,a;t?.isEmpty("bottom")??1?(r=null,a=o.getRowCount()-1):(r="bottom",a=t?.getPinnedBottomRowCount()??-1),s.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:a,rowEndPinned:r})}(this.beans):s&&s.selectAllRowNodes({source:"keyboardSelectAll",selectAll:po(i)}),e.preventDefault()}onCtrlAndC(e,t){if(!e||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:o}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(o,{withOpenEditor:!0})||(t.preventDefault(),e.copyToClipboard())}onCtrlAndX(e,t){if(!e||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:o}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(o,{withOpenEditor:!0})||(t.preventDefault(),e.cutToClipboard(void 0,"ui"))}onCtrlAndV(e,t){const{cellCtrl:o}=this.getControlsForEventTarget(t.target);this.editSvc?.isEditing(o,{withOpenEditor:!0})||e&&!this.gos.get("suppressClipboardPaste")&&e.pasteFromClipboard()}onCtrlAndD(e,t){e&&!this.gos.get("suppressClipboardPaste")&&e.copyRangeDown(),t.preventDefault()}onCtrlAndZ(e,t){this.gos.get("undoRedoCellEditing")&&e&&(t.preventDefault(),t.shiftKey?e.redo("ui"):e.undo("ui"))}onCtrlAndY(e){e?.redo("ui")}},Sa=e=>e.topRowCtrls,Ra=e=>e.getStickyTopRowCtrls(),xa=e=>e.getStickyBottomRowCtrls(),Fa=e=>e.bottomRowCtrls,Da=e=>e.allRowCtrls,Ma=e=>e.getCtrls("top"),Pa=e=>e.getCtrls("center"),Ea=e=>e.getCtrls("bottom"),Ta={center:{type:"center",name:"center-cols",getRowCtrls:Da,getSpannedRowCtrls:Pa},left:{type:"left",name:"pinned-left-cols",pinnedType:"left",getRowCtrls:Da,getSpannedRowCtrls:Pa},right:{type:"right",name:"pinned-right-cols",pinnedType:"right",getRowCtrls:Da,getSpannedRowCtrls:Pa},fullWidth:{type:"fullWidth",name:"full-width",fullWidth:!0,getRowCtrls:Da},topCenter:{type:"center",name:"floating-top",getRowCtrls:Sa,getSpannedRowCtrls:Ma},topLeft:{type:"left",name:"pinned-left-floating",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Sa,getSpannedRowCtrls:Ma},topRight:{type:"right",name:"pinned-right-floating",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Sa,getSpannedRowCtrls:Ma},topFullWidth:{type:"fullWidth",name:"floating-top-full-width",fullWidth:!0,getRowCtrls:Sa},stickyTopCenter:{type:"center",name:"sticky-top",getRowCtrls:Ra},stickyTopLeft:{type:"left",name:"pinned-left-sticky-top",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Ra},stickyTopRight:{type:"right",name:"pinned-right-sticky-top",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Ra},stickyTopFullWidth:{type:"fullWidth",name:"sticky-top-full-width",fullWidth:!0,getRowCtrls:Ra},stickyBottomCenter:{type:"center",name:"sticky-bottom",getRowCtrls:xa},stickyBottomLeft:{type:"left",name:"pinned-left-sticky-bottom",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:xa},stickyBottomRight:{type:"right",name:"pinned-right-sticky-bottom",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:xa},stickyBottomFullWidth:{type:"fullWidth",name:"sticky-bottom-full-width",fullWidth:!0,getRowCtrls:xa},bottomCenter:{type:"center",name:"floating-bottom",getRowCtrls:Fa,getSpannedRowCtrls:Ea},bottomLeft:{type:"left",name:"pinned-left-floating-bottom",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Fa,getSpannedRowCtrls:Ea},bottomRight:{type:"right",name:"pinned-right-floating-bottom",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Fa,getSpannedRowCtrls:Ea},bottomFullWidth:{type:"fullWidth",name:"floating-bottom-full-width",fullWidth:!0,getRowCtrls:Fa}};function Aa(e){return`ag-${La(e).name}-viewport`}function Ia(e){const t=La(e);return t.container??`ag-${t.name}-container`}function ka(e){return`ag-${La(e).name}-spanned-cells-container`}function La(e){return Ta[e]}var Ga=["center","left","right","fullWidth"],Na=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],Ba=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],Ha=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Oa=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Va=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],za=[...Oa,"stickyTopFullWidth",...Va,"stickyBottomFullWidth"],Wa=["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right",...Oa,...Va],Ua=class extends We{constructor(e){super(),this.name=e,this.visible=!0,this.EMPTY_CTRLS=[],this.options=La(e)}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new ha(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.beans.ctrlsSvc.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}setComp(e,t,o,s){this.comp=e,this.eContainer=t,this.eSpannedContainer=o,this.eViewport=s,this.createManagedBean(new ya(this.eViewport??this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const{pinnedCols:i,rangeSvc:n}=this.beans,r=()=>this.onPinnedWidthChanged();this.forContainers(Ba,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(i?.createPinnedWidthFeature(!0,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:r})}),this.forContainers(Ha,()=>{this.pinnedWidthFeature=this.createOptionalManagedBean(i?.createPinnedWidthFeature(!1,this.eContainer,this.eSpannedContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:r})}),this.forContainers(Ga,()=>this.createManagedBean(new oa(this.eContainer,"center"===this.name?s:void 0))),n&&this.forContainers(Wa,()=>this.createManagedBean(n.createDragListenerFeature(this.eContainer))),this.forContainers(Na,()=>this.createManagedBean(new ir(e=>this.comp.setContainerWidth(`${e}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.eViewport,{scroll:e})}addListeners(){const{spannedRowRenderer:e,gos:t}=this.beans,o=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({displayedColumnsChanged:o,displayedColumnsWidthChanged:o,displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),o(),this.onDisplayedRowsChanged(),e&&this.options.getSpannedRowCtrls&&t.get("enableCellSpan")&&this.addManagedListeners(e,{spannedRowsUpdated:()=>{const t=this.options.getSpannedRowCtrls(e);t&&this.comp.setSpannedRowCtrls(t,!1)}})}listenOnDomOrder(){if(za.indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=Nt(this.gos,"print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const{dragSvc:e}=this.beans;if(!e)return;const t=t=>{e.dragging&&t.cancelable&&t.preventDefault()};this.eContainer.addEventListener("touchmove",t,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",t))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),o=this.getCenterViewportScrollLeft();this.beans.colViewport.setScrollPosition(t,o,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return X(this.eViewport)}getCenterViewportScrollLeft(){return oe(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=be(this.beans,this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return re(this.eViewport)}getViewportScrollLeft(){return oe(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){const{beans:e,gos:t,eViewport:o}=this,s=t.get("alwaysShowHorizontalScroll"),{ctrlsSvc:i}=e,n=i.getGridBodyCtrl()?.eBodyViewport,r=i.get("fakeHScrollComp")?.getGui(),a=i.get("fakeVScrollComp")?.getGui();return s||function(e,t,o=rn()||0,s,i){return ca(e,t,"horizontal",o,s,i)}(o,n,void 0,r,a)}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){se(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(null!=this.options.pinnedType)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.beans.rowRenderer);if(!this.visible||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const o=Nt(this.gos,"print"),s=this.gos.get("embedFullWidthRows")||o,i=t.filter(e=>{const t=e.isFullWidth();return this.options.fullWidth?!s&&t:s||!t});this.comp.setRowCtrls({rowCtrls:i,useFlushSync:e})}},$a="ag-force-vertical-scroll",ja=class extends We{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colModel=e.colModel,this.scrollVisibleSvc=e.scrollVisibleSvc,this.pinnedRowModel=e.pinnedRowModel,this.filterManager=e.filterManager,this.rowGroupColsSvc=e.rowGroupColsSvc}setComp(e,t,o,s,i,n,r){this.comp=e,this.eGridBody=t,this.eBodyViewport=o,this.eTop=s,this.eBottom=i,this.eStickyTop=n,this.eStickyBottom=r,this.eCenterColsViewport=o.querySelector(`.${Aa("center")}`),this.eFullWidthContainer=o.querySelector(`.${Ia("fullWidth")}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",e=>this.setCellTextSelection(e.currentValue)),this.createManagedBean(new Xr(this.comp)),this.scrollFeature=this.createManagedBean(new la(o)),this.beans.rowDragSvc?.setupRowDrag(o,this),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,o,i,n,r]),this.setGridRootRole(),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),this.filterManager?.setupAdvFilterHeaderComp(s),this.ctrlsSvc.register("gridBodyCtrl",this)}addEventListeners(){const e=this.setFloatingHeights.bind(this),t=this.setGridRootRole.bind(this),o=this.toggleRowResizeStyles.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.updateScrollingClasses.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,pinnedRowsChanged:e,headerHeightChanged:this.setStickyTopOffsetTop.bind(this),columnRowGroupChanged:t,columnPivotChanged:t,rowResizeStarted:o,rowResizeEnded:o}),this.addManagedPropertyListener("treeData",t)}toggleRowResizeStyles(e){const t="rowResizeStarted"===e.type;this.eBodyViewport.classList.toggle("ag-prevent-animation",t)}onGridColumnsChanged(){const e=this.beans.colModel.getCols();this.comp.setColumnCount(e.length)}onScrollVisibilityChanged(){const{scrollVisibleSvc:e}=this,t=e.verticalScrollShowing;this.setVerticalScrollPaddingVisible(t),this.setStickyWidth(t),this.setStickyBottomOffsetBottom();const o=`calc(100% + ${(t&&e.getScrollbarWidth()||0)+(ln()?16:0)}px)`;ye(this.beans,()=>this.comp.setBodyViewportWidth(o)),this.updateScrollingClasses()}setGridRootRole(){const{rowGroupColsSvc:e,colModel:t,gos:o}=this;let s=o.get("treeData");if(!s){const o=t.isPivotMode();s=(e?e.columns.length:0)>=(o?2:1)}this.comp.setGridRootRole(s?"treegrid":"grid")}addFocusListeners(e){for(const t of e)this.addManagedElementListeners(t,{focusin:e=>{const{target:o}=e,s=Y(o,"ag-root",t);t.classList.toggle("ag-has-focus",!s)},focusout:e=>{const{target:o,relatedTarget:s}=e,i=t.contains(s),n=Y(s,"ag-root",t);Y(o,"ag-root",t)||i&&!n||t.classList.remove("ag-has-focus")}})}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}updateScrollingClasses(){const{eGridBody:{classList:e},scrollVisibleSvc:t}=this;e.toggle("ag-body-vertical-content-no-gap",!t.verticalScrollGap),e.toggle("ag-body-horizontal-content-no-gap",!t.horizontalScrollGap)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){this.beans.editSvc?.addStopEditingWhenGridLosesFocus([this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom])}updateRowCount(){const e=(this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.filterManager?.getHeaderRowCount()??0),{rowModel:t}=this.beans,o=t.isLastRowIndexKnown()?t.getRowCount():-1,s=-1===o?-1:e+o;this.comp.setRowCount(s)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const{gos:e,comp:t,ctrlsSvc:o}=this,s=e.get("alwaysShowVerticalScroll"),i=s?$a:null,n=Nt(e,"normal");t.setAlwaysVerticalScrollClass(i,s);const r=o.get("center")?.eViewport,a=o.get("fakeHScrollComp")?.getGui(),l=o.get("fakeVScrollComp")?.getGui();return s||n&&function(e,t,o=rn()||0,s,i){return ca(e,t,"vertical",o,s,i)}(this.eBodyViewport,r,void 0,l,a)}setupRowAnimationCssClass(){const{rowContainerHeight:e,environment:t}=this.beans;let o=t.sizesMeasured;const s=()=>{const t=o&&$t(this.gos)&&!e.stretching,s=t?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(s,t)};s(),this.addManagedEventListeners({heightScaleChanged:s}),this.addManagedPropertyListener("animateRows",s),this.addManagedEventListeners({stylesChanged:()=>{!o&&t.sizesMeasured&&(o=!0,s())}})}addBodyViewportListener(){const{eBodyViewport:e,eStickyTop:t,eStickyBottom:o,eTop:s,eBottom:i,beans:{popupSvc:n,touchSvc:r}}=this,a=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(e,{contextmenu:a}),r?.mockBodyContextMenu(this,a),this.addManagedElementListeners(e,{wheel:this.onBodyViewportWheel.bind(this,n)});const l=this.onStickyWheel.bind(this);for(const c of[t,o,s,i])this.addManagedElementListeners(c,{wheel:l});const d=this.onHorizontalWheel.bind(this);for(const c of["left","right","topLeft","topRight","bottomLeft","bottomRight"])this.addManagedElementListeners(this.ctrlsSvc.get(c).eContainer,{wheel:d});this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:o,shiftKey:s}=e;(s||Math.abs(t)>Math.abs(o))&&Le(this.beans,e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaY:t}=e;this.scrollVertically(t)>0&&e.preventDefault()}onHorizontalWheel(e){const{deltaX:t,deltaY:o,shiftKey:s}=e;(s||Math.abs(t)>Math.abs(o))&&this.scrollGridBodyToMatchEvent(e)}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:o}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||o})}onBodyViewportContextMenu(e,t,o){if(!e&&!o)return;this.gos.get("preventDefaultOnContextMenu")&&(e||o).preventDefault();const{target:s}=e||t;s!==this.eBodyViewport&&s!==this.ctrlsSvc.get("center").eViewport||this.beans.contextMenuSvc?.showContextMenu({mouseEvent:e,touchEvent:o,value:null,anchorToElement:this.eGridBody,source:"ui"})}onBodyViewportWheel(e,t){this.gos.get("suppressScrollWhenPopupsAreOpen")&&e?.hasAnchoredPopup()&&t.preventDefault()}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.scrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}setFloatingHeights(){const{pinnedRowModel:e,beans:{environment:t}}=this,o=e?.getPinnedTopTotalHeight(),s=e?.getPinnedBottomTotalHeight(),i=t.getPinnedRowBorderWidth()-t.getRowBorderWidth(),n=o?i+o:0,r=s?i+s:0;this.comp.setTopHeight(n),this.comp.setBottomHeight(r),this.comp.setTopInvisible(n<=0),this.comp.setBottomInvisible(r<=0),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}setStickyWidth(e){if(e){const e=this.scrollVisibleSvc.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}setStickyTopOffsetTop(){const e=this.ctrlsSvc.get("gridHeaderCtrl").headerHeight+(this.filterManager?.getHeaderHeight()??0),t=this.pinnedRowModel?.getPinnedTopTotalHeight()??0;let o=0;e>0&&(o+=e),t>0&&(o+=t),o>0&&(o+=1),this.comp.setStickyTopTop(`${o}px`)}setStickyBottomOffsetBottom(){const{pinnedRowModel:e,scrollVisibleSvc:t,comp:o}=this,s=(e?.getPinnedBottomTotalHeight()??0)+(t.horizontalScrollShowing&&t.getScrollbarWidth()||0);o.setStickyBottomBottom(`${s}px`)}},Ka=class extends ni{constructor(e,t,o,s,i){super(),this.cellCtrl=t,this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.gos=e.gos,this.column=t.column,this.rowNode=t.rowNode,this.eRow=s;const n=Xs({tag:"div",role:t.getCellAriaRole(),attrs:{"comp-id":`${this.getCompId()}`,"col-id":t.column.colIdSanitised}});let r;this.eCell=n,t.isCellSpanning()?(r=Xs({tag:"div",cls:"ag-spanned-cell-wrapper",role:"presentation"}),r.appendChild(n),this.setTemplateFromElement(r)):this.setTemplateFromElement(n),this.cellCssManager=new ti(()=>n),this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1),t.setComp({toggleCss:(e,t)=>this.cellCssManager.toggleCss(e,t),setUserStyles:e=>ue(n,e),getFocusableElement:()=>n,setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,o)=>this.setRenderDetails(e,t,o),setEditDetails:(e,t,o)=>this.setEditDetails(e,t,o),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue(),refreshEditStyles:(e,t)=>this.refreshEditStyles(e,t)},n,r,this.eCellWrapper,o,i,void 0)}getParentOfValue(){return this.eCellValue??this.eCellWrapper??this.eCell}setRenderDetails(e,t,o){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const s=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?(o||s||!this.refreshCellRenderer(e))&&(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t)),this.rowDraggingComp?.refreshVisibility()}setEditDetails(e,t,o){e?this.createCellEditorInstance(e,t,o):this.destroyEditor()}removeControls(){const e=this.beans.context;this.checkboxSelectionComp=e.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=e.destroyBean(this.dndSourceComp),this.rowDraggingComp=e.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,o=t||this.forceWrapper,s=o&&null==this.eCellWrapper;s&&(this.eCellWrapper=Xs({tag:"div",cls:"ag-cell-wrapper",role:"presentation"}),this.eCell.appendChild(this.eCellWrapper));const i=!o&&null!=this.eCellWrapper;i&&(ne(this.eCellWrapper),this.eCellWrapper=void 0),this.cellCssManager.toggleCss("ag-cell-value",!o);const n=!e&&o,r=n&&null==this.eCellValue;r&&(this.eCellValue=Xs({tag:"span",cls:this.cellCtrl.getCellValueClass(),role:"presentation"}),this.eCellWrapper.appendChild(this.eCellValue));const a=!n&&null!=this.eCellValue;a&&(ne(this.eCellValue),this.eCellValue=void 0);const l=s||i||r||a;return l&&this.removeControls(),!e&&t&&this.addControls(),l}addControls(){const{cellCtrl:e,eCellWrapper:t,eCellValue:o,includeRowDrag:s,includeDndSource:i,includeSelection:n}=this,r=e=>{e&&t.insertBefore(e.getGui(),o)};s&&null==this.rowDraggingComp&&(this.rowDraggingComp=e.createRowDragComp(),r(this.rowDraggingComp)),i&&null==this.dndSourceComp&&(this.dndSourceComp=e.createDndSource(),r(this.dndSourceComp)),n&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=e.createSelectionCheckbox(),r(this.checkboxSelectionComp))}createCellEditorInstance(e,t,o){const s=this.editorVersion,i=e.newAgStackInstance(),{params:n}=e;i.then(e=>this.afterCellEditorCreated(s,e,n,t,o)),l(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();ie(t);const o=m(e);null!=o&&(t.textContent=o)}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),ne(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;(this.cellEditorPopupWrapper?.getGui().contains(w(this.beans))||this.cellCtrl.hasBrowserFocus())&&this.eCell.focus({preventScroll:!0}),this.hideEditorPopup?.(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),ne(this.cellEditorGui),this.cellCtrl.disableEditorTooltipFeature(),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer?.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=this.rendererVersion,o=e=>o=>{if(this.rendererVersion!==t||!this.isAlive())return;const s=e.newAgStackInstance(),i=this.afterCellRendererCreated.bind(this,t,e.componentClass);s?.then(i)},{animationFrameSvc:s}=this.beans;let i;if(i=s?.active&&this.firstRender?(e,t=!1)=>{s.createTask(o(e),this.rowNode.rowIndex,"p2",e.componentFromFramework,t)}:e=>o(e)(),e.params?.deferRender&&!this.cellCtrl.rowNode.group){const{loadingComp:t,onReady:o}=this.cellCtrl.getDeferLoadingCellRenderer();t&&(i(t),o.then(()=>i(e,!0)))}else i(e)}afterCellRendererCreated(e,t,o){if(!this.isAlive()||e!==this.rendererVersion)return void this.beans.context.destroyBean(o);this.cellRenderer=o,this.cellRendererClass=t;const s=o.getGui();if(this.cellRendererGui=s,null!=s){const e=this.getParentOfValue();ie(e),e.appendChild(s)}}afterCellEditorCreated(e,t,o,s,i){const n=e!==this.editorVersion,{context:r}=this.beans;if(n)return void r.destroyBean(t);if(t.isCancelBeforeStart?.())return r.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return Et(97,{colId:this.column.getId()}),void r.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const a=s||t.isPopup?.();a?this.addPopupCellEditor(o,i):this.addInCellEditor(),this.refreshEditStyles(!0,a),t.afterGuiAttached?.(),this.cellCtrl.enableEditorTooltipFeature(t),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){const{cellCssManager:o}=this;o.toggleCss("ag-cell-inline-editing",e&&!t),o.toggleCss("ag-cell-popup-editing",e&&!!t),o.toggleCss("ag-cell-not-inline-editing",!e||!!t)}addInCellEditor(){const{eCell:e}=this;e.contains(w(this.beans))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),ie(this.getParentOfValue()),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){const{gos:o,context:s,popupSvc:i,editSvc:n}=this.beans;"fullRow"===o.get("editType")&&Et(98);const r=this.cellEditorPopupWrapper=s.createBean(n.createPopupEditorWrapper(e)),{cellEditor:a,cellEditorGui:l,eCell:d,rowNode:c,column:h,cellCtrl:u}=this,g=r.getGui();l&&g.appendChild(l);const p=o.get("stopEditingWhenCellsLoseFocus"),m={ePopup:g,additionalParams:{column:h,rowNode:c},type:"popupCellEditor",eventSource:d,position:null!=t?t:a.getPopupPosition?.()??"over",alignSide:o.get("enableRtl")?"right":"left",keepWithinBounds:!0},f=i.positionPopupByComponent.bind(i,m),C=i.addPopup({modal:p,eChild:g,closeOnEsc:!0,closedCallback:()=>{u.onPopupEditorClosed()},anchorToElement:d,positionCallback:f,ariaOwns:d});C&&(this.hideEditorPopup=C.hideFunc)}detach(){this.getGui().remove()}destroy(){this.destroyRenderer(),this.destroyEditor(),this.removeControls(),super.destroy()}},_a=class extends ni{constructor(e,t,o){super(),this.cellComps=/* @__PURE__ */new Map,this.beans=t,this.rowCtrl=e;const s=Xs({tag:"div",role:"row",attrs:{"comp-id":`${this.getCompId()}`}});this.setInitialStyle(s,o),this.setTemplateFromElement(s);const i=s.style;this.domOrder=this.rowCtrl.getDomOrder(),e.setComp({setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,getFullWidthCellRendererParams:()=>this.fullWidthCellRendererParams,toggleCss:(e,t)=>this.toggleCss(e,t),setUserStyles:e=>ue(s,e),setTop:e=>i.top=e,setTransform:e=>i.transform=e,setRowIndex:e=>s.setAttribute("row-index",e),setRowId:e=>s.setAttribute("row-id",e),setRowBusinessKey:e=>s.setAttribute("row-business-key",e),refreshFullWidth:e=>{const t=e();return this.fullWidthCellRendererParams=t,this.fullWidthCellRenderer?.refresh?.(t)??!1}},this.getGui(),o,void 0),this.addDestroyFunc(()=>{e.unsetComp(o)})}setInitialStyle(e,t){const o=this.rowCtrl.getInitialTransform(t);if(o)e.style.setProperty("transform",o);else{const o=this.rowCtrl.getInitialRowTop(t);o&&e.style.setProperty("top",o)}}showFullWidth(e){e.newAgStackInstance().then(t=>{if(this.isAlive()){const o=t.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(t,e.params)}else this.beans.context.destroyBean(t)})}setCellCtrls(e){const t=new Map(this.cellComps);for(const o of e){const e=o.instanceId;this.cellComps.has(e)?t.delete(e):this.newCellComp(o)}this.destroyCells(t),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];for(const o of e){const e=this.cellComps.get(o.instanceId);e&&t.push(e.getGui())}ce(this.getGui(),t)}newCellComp(e){const t=this.beans.editSvc?.isEditing(e,{withOpenEditor:!0})??!1,o=new Ka(this.beans,e,this.rowCtrl.printLayout,this.getGui(),t);this.cellComps.set(e.instanceId,o),this.getGui().appendChild(o.getGui())}destroy(){super.destroy(),this.destroyCells(this.cellComps)}setFullWidthRowComp(e,t){this.fullWidthCellRenderer=e,this.fullWidthCellRendererParams=t,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer),this.fullWidthCellRendererParams=void 0})}destroyCells(e){for(const t of e.values()){if(!t)continue;const e=t.cellCtrl.instanceId;this.cellComps.get(e)===t&&(t.detach(),t.destroy(),this.cellComps.delete(e))}}};var qa={selector:"AG-ROW-CONTAINER",component:class extends ni{constructor(e){super(),this.eViewport=null,this.eContainer=null,this.eSpannedContainer=null,this.rowCompsNoSpan={},this.rowCompsWithSpan={},this.name=e?.name,this.options=La(this.name)}postConstruct(){this.setTemplate(function(e,t,o){const s=!!o.gos.get("enableCellSpan")&&!!t.getSpannedRowCtrls,i={tag:"div",ref:"eContainer",cls:Ia(e),role:"rowgroup"};if("center"===t.type||s){const t={tag:"div",ref:"eSpannedContainer",cls:`ag-spanning-container ${ka(e)}`,role:"presentation"};return i.role="presentation",{tag:"div",ref:"eViewport",cls:`ag-viewport ${Aa(e)}`,role:"rowgroup",children:[i,s?t:null]}}return i}(this.name,this.options,this.beans)),this.createManagedBean(new Ua(this.name)).setComp({setHorizontalScroll:e=>this.eViewport.scrollLeft=e,setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setSpannedRowCtrls:e=>this.setRowCtrls(e,!0),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>{this.eContainer.style.width=e,this.eSpannedContainer&&(this.eSpannedContainer.style.width=e)},setOffsetTop:e=>{const t=`translateY(${e})`;this.eContainer.style.transform=t,this.eSpannedContainer&&(this.eSpannedContainer.style.transform=t)}},this.eContainer,this.eSpannedContainer,this.eViewport)}destroy(){this.setRowCtrls([]),this.setRowCtrls([],!0),super.destroy(),this.lastPlacedElement=null}setRowCtrls(e,t){const{beans:o,options:s}=this,i=t?this.eSpannedContainer:this.eContainer,n=t?{...this.rowCompsWithSpan}:{...this.rowCompsNoSpan},r={};t?this.rowCompsWithSpan=r:this.rowCompsNoSpan=r,this.lastPlacedElement=null;const a=[];for(const l of e){const e=l.instanceId,t=n[e];let i;if(t)i=t,delete n[e];else{if(!l.rowNode.displayed)continue;i=new _a(l,o,s.type)}r[e]=i,a.push([i,!t])}this.removeOldRows(Object.values(n)),this.addRowNodes(a,i)}addRowNodes(e,t){const{domOrder:o}=this;for(const[s,i]of e){const e=s.getGui();o?this.ensureDomOrder(e,t):i&&t.appendChild(e)}}removeOldRows(e){for(const t of e)t.getGui().remove(),t.destroy()}ensureDomOrder(e,t){de(t,e,this.lastPlacedElement),this.lastPlacedElement=e}}};function Ya(e,t){return t.map(t=>{const o=`e${t[0].toUpperCase()+t.substring(1)}RowContainer`;return e[o]={name:t},{tag:"ag-row-container",ref:o,attrs:{name:t}}})}var Za={selector:"AG-GRID-BODY",component:class extends ni{constructor(){super(...arguments),this.eGridRoot=null,this.eBodyViewport=null,this.eStickyTop=null,this.eStickyBottom=null,this.eTop=null,this.eBottom=null,this.eBody=null}postConstruct(){const{overlays:e,rangeSvc:t}=this.beans,o=e?.getOverlayWrapperSelector(),{paramsMap:s,elementParams:i}=function(e){const t={};return{paramsMap:t,elementParams:{tag:"div",ref:"eGridRoot",cls:"ag-root ag-unselectable",children:[{tag:"ag-header-root"},{tag:"div",ref:"eTop",cls:"ag-floating-top",role:"presentation",children:Ya(t,["topLeft","topCenter","topRight","topFullWidth"])},{tag:"div",ref:"eBody",cls:"ag-body",role:"presentation",children:[{tag:"div",ref:"eBodyViewport",cls:"ag-body-viewport",role:"presentation",children:Ya(t,["left","center","right","fullWidth"])},{tag:"ag-fake-vertical-scroll"}]},{tag:"div",ref:"eStickyTop",cls:"ag-sticky-top",role:"presentation",children:Ya(t,["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])},{tag:"div",ref:"eStickyBottom",cls:"ag-sticky-bottom",role:"presentation",children:Ya(t,["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])},{tag:"div",ref:"eBottom",cls:"ag-floating-bottom",role:"presentation",children:Ya(t,["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])},{tag:"ag-fake-horizontal-scroll"},e?{tag:"ag-overlay-wrapper"}:null]}}}(!!o);this.setTemplate(i,[...o?[o]:[],ta,ia,Zr,qa],s);const n=(e,t)=>{const o=`${e}px`;t.style.minHeight=o,t.style.height=o},r={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>{F(this.getGui(),"colcount",e)},setRowCount:e=>{F(this.getGui(),"rowcount",e)},setTopHeight:e=>n(e,this.eTop),setBottomHeight:e=>n(e,this.eBottom),setTopInvisible:e=>this.eTop.classList.toggle("ag-invisible",e),setBottomInvisible:e=>this.eBottom.classList.toggle("ag-invisible",e),setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>{this.eStickyBottom.style.height=e,this.eStickyBottom.classList.toggle("ag-invisible","0px"===e)},setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.toggleCss(e,t),updateLayoutClasses:(e,t)=>{const o=[this.eBodyViewport.classList,this.eBody.classList];for(const s of o)s.toggle(Qr.AUTO_HEIGHT,t.autoHeight),s.toggle(Qr.NORMAL,t.normal),s.toggle(Qr.PRINT,t.print);this.toggleCss(Qr.AUTO_HEIGHT,t.autoHeight),this.toggleCss(Qr.NORMAL,t.normal),this.toggleCss(Qr.PRINT,t.print)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle($a,t),registerBodyViewportResizeListener:e=>{const t=be(this.beans,this.eBodyViewport,e);this.addDestroyFunc(()=>t())},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{for(const o of[this.eTop,this.eBodyViewport,this.eBottom])o.classList.toggle(e,t)},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e,setGridRootRole:e=>P(this.eGridRoot,e)};this.ctrl=this.createManagedBean(new ja),this.ctrl.setComp(r,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(t&&no(this.gos)||uo(this.gos))&&F(this.getGui(),"multiselectable",!0)}setRowAnimationCssOnBodyViewport(e,t){const o=this.eBodyViewport.classList;o.toggle("ag-row-animation",t),o.toggle("ag-row-no-animation",!t)}}},Qa="ag-tab-guard",Xa="ag-tab-guard-top",Ja="ag-tab-guard-bottom",el=class extends ze{constructor(e,t){super(),this.stopPropagationCallbacks=t,this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:o,eTopGuard:s,eBottomGuard:i,focusTrapActive:n,forceFocusOutWhenTabGuardsAreEmpty:r,isFocusableContainer:a,focusInnerElement:l,onFocusIn:d,onFocusOut:c,shouldStopEventPropagation:h,onTabKeyDown:u,handleKeyDown:g,isEmpty:p,eFocusableElement:m}=e;this.comp=o,this.eTopGuard=s,this.eBottomGuard=i,this.providedFocusInnerElement=l,this.eFocusableElement=m,this.focusTrapActive=!!n,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.isFocusableContainer=!!a,this.providedFocusIn=d,this.providedFocusOut=c,this.providedShouldStopEventPropagation=h,this.providedOnTabKeyDown=u,this.providedHandleKeyDown=g,this.providedIsEmpty=p}postConstruct(){this.createManagedBean(new wn(this.eFocusableElement,this.stopPropagationCallbacks,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards();for(const e of[this.eTopGuard,this.eBottomGuard])this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty&&(this.providedIsEmpty?this.providedIsEmpty():0===pn(this.eFocusableElement,".ag-tab-guard").length))return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;!(this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t))&&this.forceFocusOutWhenTabGuardsAreEmpty&&this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}findNextElementOutsideAndFocus(e){const t=pn(b(this.beans).body,null,!0),o=t.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===o)return;let s,i;e?(s=0,i=o):(s=o+1,i=t.length);const n=t.slice(s,i),r=this.gos.get("tabIndex");n.sort((e,t)=>{const o=Number.parseInt(e.getAttribute("tabindex")||"0"),s=Number.parseInt(t.getAttribute("tabindex")||"0");return s===r?1:o===r?-1:0===o?1:0===s?-1:o-s}),n[e?n.length-1:0]?.focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const o=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),o&&(o.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=pn(this.eFocusableElement);return this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(-1,1)),!!t.length&&(t[e?t.length-1:0].focus({preventScroll:!0}),!0)}getNextFocusableElement(e){return fn(this.beans,this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},tl=class extends ze{constructor(e,t){super(),this.comp=e,this.stopPropagationCallbacks=t}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:o,eFocusableElement:s,stopPropagationCallbacks:i}=this,n=[t,o],r={setTabIndex:e=>{for(const t of n)null==e?t.removeAttribute("tabindex"):t.setAttribute("tabindex",e)}};this.addTabGuards(t,o);const{focusTrapActive:a=!1,onFocusIn:l,onFocusOut:d,focusInnerElement:c,handleKeyDown:h,onTabKeyDown:u,shouldStopEventPropagation:g,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:m,isFocusableContainer:f}=e;this.tabGuardCtrl=this.createManagedBean(new el({comp:r,focusTrapActive:a,eTopGuard:t,eBottomGuard:o,eFocusableElement:s,onFocusIn:l,onFocusOut:d,focusInnerElement:c,handleKeyDown:h,onTabKeyDown:u,shouldStopEventPropagation:g,isEmpty:p,forceFocusOutWhenTabGuardsAreEmpty:m,isFocusableContainer:f},i))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=b(this.beans).createElement("div"),o="top"===e?Xa:Ja;return t.classList.add(Qa,o),P(t,"presentation"),t}addTabGuards(e,t){const o=this.eFocusableElement;o.prepend(e),o.append(t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];ie(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,o){ve(t)||(t=t.getGui());const{eBottomGuard:s}=this;s?s.before(t):e(t,o)}destroy(){const{eTopGuard:e,eBottomGuard:t}=this;ne(e),ne(t),super.destroy()}},ol=class extends si{initialiseTabGuard(e,t){this.tabGuardFeature=this.createManagedBean(new tl(this,t)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},sl=class extends ol{initialiseTabGuard(e){super.initialiseTabGuard(e,Rn)}},il=class extends We{constructor(){super(...arguments),this.additionalFocusableContainers=/* @__PURE__ */new Set}setComp(e,t,o){this.view=e,this.eGridHostDiv=t,this.eGui=o,this.eGui.setAttribute("grid-id",this.beans.context.getId());const{dragAndDrop:s,ctrlsSvc:i}=this.beans;s?.registerGridDropTarget(()=>this.eGui,this),this.createManagedBean(new Xr(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr");const n=be(this.beans,this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>n()),i.register("gridCtrl",this)}isDetailGrid(){return Cn(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.pagination?.getPaginationSelector(),gridHeaderDropZonesSelector:e.registry?.getSelector("AG-GRID-HEADER-DROP-ZONES"),sideBarSelector:e.sideBar?.getSelector(),statusBarSelector:e.registry?.getSelector("AG-STATUS-BAR"),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){this.eventSvc.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){const{view:t}=this;if(!1===e)t.setCursor(null);else{const o=1===e?"ew-resize":"ns-resize";t.setCursor(o)}}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(t){const o=this.getFocusableContainers(),{indexWithFocus:s,nextIndex:i}=this.getNextFocusableIndex(o,t);if(i<0||i>=o.length)return!1;if(0===i){if(s>0){const{visibleCols:t,focusSvc:o}=this.beans,s=e(t.allCols);if(o.focusGridView({column:s,backwards:!0}))return!0}return!1}return this.focusContainer(o[i],t)}focusInnerElement(t){if(this.gos.getCallback("focusGridInnerElement")?.({fromBottom:!!t}))return!0;const o=this.getFocusableContainers(),{focusSvc:s,visibleCols:i}=this.beans,n=i.allCols;if(t){if(o.length>1)return this.focusContainer(e(o),t);const i=e(n);if(s.focusGridView({column:i,backwards:t}))return!0}if(0===this.gos.get("headerHeight")||Hn(this.beans)){if(s.focusGridView({column:n[0],backwards:t}))return!0;for(let e=1;ee.getGui().contains(o));return{indexWithFocus:s,nextIndex:s+(t?-1:1)}}focusContainer(e,t){e.setAllowFocus?.(!0);const o=mn(e.getGui(),t,!1,!0);return e.setAllowFocus?.(!1),o}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},nl=class extends sl{constructor(e){super(),this.gridBody=null,this.sideBar=null,this.pagination=null,this.rootWrapperBody=null,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCss(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}},t=this.createManagedBean(new il),o=t.getOptionalSelectors(),s=this.createTemplate(o),i=[Za,...Object.values(o).filter(e=>!!e)];this.setTemplate(s,i),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>t.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0,isEmpty:()=>!t.isFocusable()})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{e.remove(),it(this.gos,"Grid removed from DOM")})}updateLayoutClasses(e,t){const o=this.rootWrapperBody.classList,{AUTO_HEIGHT:s,NORMAL:i,PRINT:n}=Qr,{autoHeight:r,normal:a,print:l}=t;o.toggle(s,r),o.toggle(i,a),o.toggle(n,l),this.toggleCss(s,r),this.toggleCss(i,a),this.toggleCss(n,l)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?{tag:"ag-grid-header-drop-zones"}:null,o=e.sideBarSelector?{tag:"ag-side-bar",ref:"sideBar"}:null,s=e.statusBarSelector?{tag:"ag-status-bar"}:null,i=e.watermarkSelector?{tag:"ag-watermark"}:null;return{tag:"div",cls:"ag-root-wrapper",role:"presentation",children:[t,{tag:"div",ref:"rootWrapperBody",cls:"ag-root-wrapper-body",role:"presentation",children:[{tag:"ag-grid-body",ref:"gridBody"},o]},s,e.paginationSelector?{tag:"ag-pagination",ref:"pagination"}:null,i]}}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){e||!this.pagination?.isDisplayed()?super.forceFocusOutOfContainer(e):this.pagination.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[this.gridBody];for(const t of[this.sideBar,this.pagination])t&&e.push(t);return e.filter(e=>ae(e.getGui()))}},rl=(e,t)=>{for(const o of Object.keys(t))t[o]=e;return t},al={dispatchEvent:"CommunityCore",...rl("CommunityCore",{destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,isModuleRegistered:0}),...rl("GridState",{getState:0,setState:0}),...rl("SharedRowSelection",{setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0}),...rl("RowApi",{redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRowIndex:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0}),...rl("ScrollApi",{getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0}),...rl("KeyboardNavigation",{getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0}),...rl("EventApi",{addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0}),...rl("ValueCache",{expireValueCache:0}),...rl("CellApi",{getCellValue:0}),...rl("SharedMenu",{showColumnMenu:0,hidePopupMenu:0}),...rl("Sort",{onSortChanged:0}),...rl("PinnedRow",{getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,forEachPinnedRow:0}),...rl("Overlay",{showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0}),...rl("RenderApi",{setGridAriaProperty:0,refreshCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0}),...rl("HighlightChanges",{flashCells:0}),...rl("RowDrag",{addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getRowDropPositionIndicator:0,setRowDropPositionIndicator:0}),...rl("ColumnApi",{getColumnDefs:0,getColumnDef:0,getDisplayNameForColumn:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnsVisible:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0}),...rl("ColumnAutoSize",{sizeColumnsToFit:0,autoSizeColumns:0,autoSizeAllColumns:0}),...rl("ColumnGroup",{setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumnGroup:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0}),...rl("ColumnMove",{moveColumnByIndex:0,moveColumns:0}),...rl("ColumnResize",{setColumnWidths:0}),...rl("ColumnHover",{isColumnHovered:0}),...rl("EditCore",{getCellEditorInstances:0,getEditingCells:0,getEditRowValues:0,stopEditing:0,startEditingCell:0,isEditing:0,validateEdit:0}),...rl("BatchEdit",{startBatchEdit:0,cancelBatchEdit:0,commitBatchEdit:0,isBatchEditing:0}),...rl("UndoRedoEdit",{undoCellEditing:0,redoCellEditing:0,getCurrentUndoSize:0,getCurrentRedoSize:0}),...rl("FilterCore",{isAnyFilterPresent:0,onFilterChanged:0}),...rl("ColumnFilter",{isColumnFilterPresent:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,hideColumnFilter:0,getColumnFilterHandler:0,doFilterAction:0}),...rl("QuickFilter",{isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0}),...rl("Find",{findGetActiveMatch:0,findGetTotalMatches:0,findGoTo:0,findNext:0,findPrevious:0,findGetNumMatches:0,findGetParts:0,findClearActive:0,findRefresh:0}),...rl("Pagination",{paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0}),...rl("CsrmSsrmSharedApi",{expandAll:0,collapseAll:0}),...rl("SsrmInfiniteSharedApi",{setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...rl("ClientSideRowModelApi",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0,onRowHeightChanged:0,resetRowHeights:0}),...rl("CsvExport",{getDataAsCsv:0,exportDataAsCsv:0}),...rl("InfiniteRowModel",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...rl("AdvancedFilter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...rl("IntegratedCharts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...rl("Clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...rl("ExcelExport",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...rl("SharedMasterDetail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...rl("ContextMenu",{showContextMenu:0}),...rl("ColumnMenu",{showColumnChooser:0,hideColumnChooser:0}),...rl("CellSelection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...rl("SharedRowGrouping",{setRowGroupColumns:0,removeRowGroupColumns:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0}),...rl("SharedAggregation",{addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0}),...rl("SharedPivot",{isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumns:0,addValueColumns:0,setPivotColumns:0,removePivotColumns:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...rl("ServerSideRowModelApi",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0,onRowHeightChanged:0,resetRowHeights:0}),...rl("SideBar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...rl("StatusBar",{getStatusPanel:0}),...rl("AiToolkit",{getStructuredSchema:0})},ll={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},dl=(e,t)=>e.eventSvc.dispatchEvent(t),cl=class{};Reflect.defineProperty(cl,"name",{value:"GridApi"});function hl(e,t){e.gos.updateGridOptions({options:t})}var ul,gl,pl=(e,t)=>{if(null!=t&&e?.setPointerCapture)try{return e.setPointerCapture(t),e.hasPointerCapture(t)}catch{}return!1},ml=e=>{const{eElement:t,onLost:o}=e;t&&o&&(t.removeEventListener("lostpointercapture",o),e.onLost=null)},fl=(e,t)=>{ml(e);const{eElement:o,pointerId:s}=e;o&&t.pointerId===s&&pl(o,s)},Cl={passive:!0},vl={passive:!1},wl=e=>{if(gl){if(gl.has(e))return!1}else gl=/* @__PURE__ */new WeakSet;return gl.add(e),!0},bl=class extends ze{constructor(){super(...arguments),this.beanName="dragSvc",this.dragging=!1,this.drag=null,this.dragSources=[]}get startTarget(){return this.drag?.start.target??null}isPointer(){return!!ul?.has(v(this.beans))}hasPointerCapture(){const e=this.drag?.pointerCapture;return!(!e||!this.beans.eRootDiv.hasPointerCapture?.(e.pointerId))}destroy(){this.drag&&this.cancelDrag();const e=this.dragSources;for(const t of e)yl(t);e.length=0,super.destroy()}removeDragSource(e){const t=this.dragSources;for(let o=0,s=t.length;othis.onPointerDown(e,t),vl],[t,"mousedown",t=>this.onMouseDown(e,t)]);const r=this.gos.get("suppressTouch");if(o&&!r){Ne(s,[t,"touchstart",t=>this.onTouchStart(e,t),vl])}}cancelDrag(e){const t=this.drag;e??(e=t?.eElement),e&&this.eventSvc.dispatchEvent({type:"dragCancelled",target:e}),t?.params.onDragCancel?.(),this.destroyDrag()}shouldPreventMouseEvent(e){const t=e.type;return("mousemove"===t||"pointermove"===t)&&e.cancelable&&Le(this.beans,e)&&!K(Rl(e))}initDrag(e,...t){this.drag=e;const o=this.beans,s=e=>this.onScroll(e),i=v(o),n=b(o);Ne(e.handlers,[i,"contextmenu",He],[i,"keydown",e=>this.onKeyDown(e)],[n,"scroll",s,{capture:!0}],[n.defaultView||window,"scroll",s],...t)}destroyDrag(){this.dragging=!1;const e=this.drag;if(e){const t=e.rootEl;ul?.get(t)===e&&ul.delete(t),this.drag=null,(e=>{if(!e)return;ml(e);const{eElement:t,pointerId:o}=e;if(t){try{t.releasePointerCapture(o)}catch{}e.eElement=null}})(e.pointerCapture),Be(e.handlers)}}onPointerDown(e,t){if(this.isPointer())return;const o=this.beans;if(gl?.has(t))return;const s=t.pointerType;if("touch"===s){if(o.gos.get("suppressTouch")||!e.includeTouch)return;if(e.stopPropagationForTouch&&t.stopPropagation(),K(Rl(t)))return}if(!t.isPrimary)return;if("mouse"===s&&0!==t.button)return;this.destroyDrag();const i=v(o),n=e.eElement,r=t.pointerId,a=new Sl(i,e,t,r);ul??(ul=/* @__PURE__ */new WeakMap),ul.set(i,a);const l=e=>this.draggingPreventDefault(e);this.initDrag(a,[i,"pointerup",e=>{e.pointerId===r&&this.onMouseOrPointerUp(e)}],[i,"pointercancel",e=>{e.pointerId===r&&wl(e)&&this.cancelDrag()}],[i,"pointermove",e=>{e.pointerId===r&&this.onMouseOrPointerMove(e)},vl],[i,"touchmove",l,vl],[n,"mousemove",l,vl]),0===e.dragStartPixels?this.onMouseOrPointerMove(t):wl(t)}onTouchStart(e,t){if(this.gos.get("suppressTouch")||!e.includeTouch)return;if(!wl(t))return;if(K(Rl(t)))return;if(e.stopPropagationForTouch&&t.stopPropagation(),this.isPointer())return void(this.dragging&&He(t));this.destroyDrag();const o=this.beans,s=new Sl(v(o),e,t.touches[0]),i=e=>this.onTouchUp(e),n=e=>this.onTouchCancel(e),r=v(o),a=t.target??e.eElement;this.initDrag(s,[a,"touchmove",e=>this.onTouchMove(e),Cl],[a,"touchend",i,Cl],[a,"touchcancel",n,Cl],[r,"touchmove",e=>this.draggingPreventDefault(e),vl],[r,"touchend",i,vl],[r,"touchcancel",n,vl]),0===e.dragStartPixels&&this.onMove(s.start)}draggingPreventDefault(e){this.dragging&&He(e)}onMouseDown(e,t){if(0!==t.button)return;if(gl?.has(t))return;if(this.isPointer())return;const o=this.beans;this.destroyDrag();const s=new Sl(v(o),e,t),i=v(o);this.initDrag(s,[i,"mousemove",e=>this.onMouseOrPointerMove(e)],[i,"mouseup",e=>this.onMouseOrPointerUp(e)]),0===e.dragStartPixels?this.onMouseOrPointerMove(t):wl(t)}onScroll(e){if(!wl(e))return;const t=this.drag,o=t?.lastDrag;o&&this.dragging&&t.params?.onDragging?.(o)}onMouseOrPointerMove(e){wl(e)&&(en()&&b(this.beans).getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&He(e),this.onMove(e))}onTouchCancel(e){const t=this.drag;t&&wl(e)&&ke(t.start,e.changedTouches)&&this.cancelDrag()}onTouchMove(e){const t=this.drag;if(!t||!wl(e))return;const o=ke(t.start,e.touches);o&&(this.onMove(o),this.draggingPreventDefault(e))}onMove(e){const t=this.drag;if(!t)return;t.lastDrag=e;const o=t.params;if(!this.dragging){const s=t.start;if(Ie(e,s,o.dragStartPixels??4))return;if(this.dragging=!0,o.capturePointer&&(t.pointerCapture=((e,t)=>{if("undefined"==typeof PointerEvent||!(t instanceof PointerEvent))return null;const o=t.pointerId;if(!pl(e,o))return null;const s={eElement:e,pointerId:o,onLost(e){fl(s,e)}};return e.addEventListener("lostpointercapture",s.onLost),s})(this.beans.eRootDiv,e)),this.eventSvc.dispatchEvent({type:"dragStarted",target:o.eElement}),o.onDragStart?.(s),this.drag!==t)return;if(o.onDragging?.(s),this.drag!==t)return}o.onDragging?.(e)}onTouchUp(e){const t=this.drag;t&&wl(e)&&this.onUp(ke(t.start,e.changedTouches))}onMouseOrPointerUp(e){wl(e)&&this.onUp(e)}onUp(e){const t=this.drag;t&&(e||(e=t.lastDrag),e&&this.dragging&&(this.dragging=!1,t.params.onDragStop?.(e),this.eventSvc.dispatchEvent({type:"dragStopped",target:t.params.eElement})),this.destroyDrag())}onKeyDown(e){e.key===Ts&&this.cancelDrag()}},yl=e=>{Be(e.handlers);const t=e.oldTouchAction;if(null!=t){const o=e.params.eElement.style;o&&(o.touchAction=t)}},Sl=class{constructor(e,t,o,s=null){this.rootEl=e,this.params=t,this.start=o,this.pointerId=s,this.handlers=[],this.lastDrag=null,this.pointerCapture=null,this.eElement=t.eElement}},Rl=e=>{const t=e.target;return t instanceof Element?t:null},xl=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.includes("x"),this.scrollVertically=e.scrollAxis.includes("y"),this.scrollByTick=e.scrollByTick??20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}get scrolling(){return null!==this.tickingInterval}check(e,t=!1){const o=t||this.shouldSkipVerticalScroll();if(o&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),i=this.scrollByTick;this.tickLeft=e.clientXs.right-i,this.tickUp=e.clientYs.bottom-i&&!o,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Fl=class{constructor(){this.reordered=!1,this.removals=[],this.updates=/* @__PURE__ */new Set,this.adds=/* @__PURE__ */new Set}},Dl=e=>{let t=e.childrenAfterGroup;for(;t?.length;){const e=t[0];if(e.sourceRowIndex>=0)return e;t=e.childrenAfterGroup}};function Ml(e,t){return Ca(e,t.target)?.getFocusedCellPosition()??null}function Pl(e,t){const o=Nt(e.gos,"normal"),s=t;let i,n;null!=s.clientX||null!=s.clientY?(i=s.clientX,n=s.clientY):(i=s.x,n=s.y);const{pageFirstPixel:r}=e.pageBounds.getCurrentPagePixelRange();if(n+=r,o){const t=e.ctrlsSvc.getScrollFeature(),o=t.getVScrollPosition();i+=t.getHScrollPosition().left,n+=o.top}return{x:i,y:n}}var El=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}depthFirstSearchChangedPath(e,t){const{rowNode:o,children:s}=e;if(s)for(let i=0;io[e.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const o=this.nodeIdsToColumns[e.id];return t.filter(e=>!o[e.getId()])}},Tl={moduleName:"Drag",version:vt,beans:[class extends bl{shouldPreventMouseEvent(e){return this.gos.get("enableCellTextSelection")&&super.shouldPreventMouseEvent(e)}}]},Al={moduleName:"SharedDragAndDrop",version:vt,beans:[class extends ai{createEvent(e){return wo(this.gos,e)}createDragImageComp(e){const{gos:t,beans:o}=this;return(s=o.userCompFactory,i=wo(t,{dragSource:e}),s.getCompDetailsFromGridOptions(ci,"agDragAndDropImage",i,!0))?.newAgStackInstance();var s,i}handleEnter(e,t){e?.onGridEnter?.(t)}handleExit(e,t){e?.onGridExit?.(t)}warnNoBody(){Et(54)}isDropZoneWithinThisGrid(e){return this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody.contains(e.dropZoneTarget)}registerGridDropTarget(e,t){const o={getContainer:e,isInterestedIn:e=>1===e||0===e,getIconName:()=>"notAllowed"};this.addDropTarget(o),t.addDestroyFunc(()=>this.removeDropTarget(o))}}],dependsOn:[Tl],userComponents:{agDragAndDropImage:class extends ni{constructor(){super(),this.dragSource=null,this.eIcon=null,this.eLabel=null,this.eGhost=null,this.registerCSS(".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}.ag-dnd-ghost-not-allowed{border:var(--ag-drag-and-drop-image-not-allowed-border)}")}postConstruct(){const e=e=>Js(e,this.beans,null);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(ri),this.beans.environment.applyThemeClasses(this.eGhost)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t){const{eGhost:o,eIcon:s,dragSource:i,dropIconMap:n,gos:r}=this;ie(s);let a=null;e||(e=i?.getDefaultIconName?i.getDefaultIconName():"notAllowed"),a=n[e],o.classList.toggle("ag-dnd-ghost-not-allowed","notAllowed"===e),s.classList.toggle("ag-shake-left-to-right",t),a===n.hide&&r.get("suppressDragLeaveHidesColumns")||a&&s.appendChild(a)}setLabel(e){this.eLabel.textContent=e}}},icons:{columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",rowDrag:"grip"}},Il={moduleName:"HorizontalResize",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="horizontalResizeSvc"}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),onDragCancel:this.onDragStop.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0},{dragSvc:o}=this.beans;o.addDragSource(t);return()=>o.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const o=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(o)}setResizeIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(1),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.beans.ctrlsSvc.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}}],dependsOn:[Tl]};var kl=class extends We{constructor(e){super(),this.pinned=e,this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[]}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;if(t)for(const o of t)o.isPrimary()&&(o.isAnyFunctionActive()||(o.isAllowValue()?this.columnsToAggregate.push(o):o.isAllowRowGroup()?this.columnsToGroup.push(o):o.isAllowPivot()&&this.columnsToPivot.push(o)))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){const{valueColsSvc:t,rowGroupColsSvc:o,pivotColsSvc:s}=this.beans;this.columnsToAggregate.length>0&&t?.addColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&o?.addColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&s?.addColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function Ll(o){const{isFromHeader:s,fromLeft:i,xPosition:n,fromEnter:r,fakeEvent:a,pinned:l,gos:d,colModel:c,colMoves:h,visibleCols:u}=o;let{allMovingColumns:g}=o;s&&(g=function(e){const t=[...e];for(const o of e){let e=null,s=o.getParent();for(;null!=s&&1===s.getDisplayedLeafColumns().length;)e=s,s=s.getParent();if(null!=e){const o=e.getColGroupDef()?.marryChildren?e.getProvidedColumnGroup().getLeafColumns():e.getLeafColumns();for(const e of o)t.includes(e)||t.push(e)}}return t}(g));const p=g.slice();var m,f;m=c.getCols(),!(f=p)||f.length<=1||f.filter(e=>m.indexOf(e)<0).length>0||f.sort((e,t)=>m.indexOf(e)-m.indexOf(t));const C=function(e){const{movingCols:t,draggingRight:o,xPosition:s,pinned:i,gos:n,colModel:r,visibleCols:a}=e;if(n.get("suppressMovableColumns")||t.some(e=>e.getColDef().suppressMovable))return[];const l=function(e,t){switch(t){case"left":return e.leftCols;case"right":return e.rightCols;default:return e.centerCols}}(a,i),d=r.getCols(),c=l.filter(e=>t.includes(e)),h=l.filter(e=>!t.includes(e)),u=d.filter(e=>!t.includes(e));let g,p=0,m=s;if(o){let e=0;for(const t of c)e+=t.getActualWidth();m-=e}if(m>0){for(let e=0;e0){const e=h[p-1];g=u.indexOf(e)+1}else g=u.indexOf(h[0]),-1===g&&(g=0);const f=[g],C=(e,t)=>e-t;if(o){let e=g+1;const t=d.length-1;for(;e<=t;)f.push(e),e++;f.sort(C)}else{let e=g;const t=d.length-1;let o=d[e];for(;e<=t&&l.indexOf(o)<0;)e++,f.push(e),o=d[e];e=g-1;const s=0;for(;e>=s;)f.push(e),e--;f.sort(C).reverse()}return f}({movingCols:p,draggingRight:i,xPosition:n,pinned:l,gos:d,colModel:c,visibleCols:u}),v=function(t,o){const s=o.getCols(),i=t.map(e=>s.indexOf(e)).sort((e,t)=>e-t),n=i[0];return e(i)-n!==i.length-1?null:n}(p,c);if(0===C.length)return;const w=C[0];if(null!==v&&(s||!r)&&!a){if(!i&&w>=v)return;if(i&&w<=v)return}const b=function(e,o,s,i){const n=i.allCols;let r=null,a=null;for(let l=0;ln.includes(e));if(null===a)a=c;else if(!t(c,a))break;const h=Nl(d);(null===r||hc.getCols().length-p.length?void 0:{columns:p,toIndex:y}}function Gl(e){const{columns:t,toIndex:o}=Ll(e)||{},{finished:s,colMoves:i}=e;return t&&null!=o?(i.moveColumns(t,o,"uiColumnMoved",s),s?null:{columns:t,toIndex:o}):null}function Nl(e){function t(e){const t=[];let o=e.getOriginalParent();for(;null!=o;)t.push(o),o=o.getOriginalParent();return t}let o=0;for(let s=0;sn.length?[i,n]:[n,i];for(const e of i)-1===n.indexOf(e)&&o++}return o}function Bl(e){const{pinned:t,fromKeyboard:o,gos:s,ctrlsSvc:i,useHeaderRow:n,skipScrollPadding:r}=e;let a=i.getHeaderRowContainerCtrl(t)?.eViewport,{x:l}=e;return a?(o&&(l-=a.getBoundingClientRect().left),s.get("enableRtl")&&(n&&(a=a.querySelector(".ag-header-row")),l=a.clientWidth-l),null!=t||r||(l+=i.get("center").getCenterViewportScrollLeft()),l):0}function Hl(e,t){for(const o of e)o.moving=t,o.dispatchColEvent("movingChanged","uiColumnMoved")}var Ol=class extends We{constructor(e){super(),this.pinned=e,this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.isCenterContainer=!a(e)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){const{pinned:e,lastDraggingEvent:t}=this,{dragItem:o}=t||{},s=o?.columns??[];for(const i of s){const t=i.getPinned();if(i.getColDef().lockPinned){if(t==e)return"move";continue}const s=o?.containerType;if(s===e||!e)return"move";if(e&&(!t||s!==e))return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem,o=t.columns;if(0===e.dragSource.type)this.setColumnsVisible(o,!0,"uiColumnDragged");else{const e=t.visibleState,s=(o||[]).filter(t=>e[t.getId()]&&!t.isVisible());this.setColumnsVisible(s,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(o,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,o=!1,s=!1){const{gos:i,ctrlsSvc:n}=this.beans,r=i.get("suppressMoveWhenColumnDragging");if(s&&!r)return void this.finishColumnMoving();if(this.lastDraggingEvent=e,!e||!s&&l(e.hDirection))return;const a=Bl({x:e.x,pinned:this.pinned,gos:i,ctrlsSvc:n});t||this.checkCenterForScrolling(a),r?this.handleColumnDragWhileSuppressingMovement(e,t,o,a,s):this.handleColumnDragWhileAllowingMovement(e,t,o,a,s)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),this.updateDragItemContainerType(),this.lastMovedInfo=null}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}onDragCancel(){this.clearHighlighted(),this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,o){if(!e?.length)return;const s=e.filter(e=>!e.getColDef().lockVisible);s.length&&this.beans.colModel.setColsVisible(s,t,o)}finishColumnMoving(){this.clearHighlighted();const e=this.lastMovedInfo;if(!e)return;const{columns:t,toIndex:o}=e;this.beans.colMoves.moveColumns(t,o,"uiColumnMoved",!0)}updateDragItemContainerType(){const{lastDraggingEvent:e}=this;if(this.gos.get("suppressMoveWhenColumnDragging")||!e)return;const t=e.dragItem;t&&(t.containerType=this.pinned)}handleColumnDragWhileSuppressingMovement(e,t,o,s,i){const n=this.getAllMovingColumns(e,!0);if(i){const e=this.isAttemptingToPin(n);e&&this.attemptToPinColumns(n,void 0,!0);const{fromLeft:s,xPosition:i}=this.getNormalisedXPositionInfo(n,e)||{};if(null==s||null==i)return void this.finishColumnMoving();this.moveColumnsAfterHighlight({allMovingColumns:n,xPosition:i,fromEnter:t,fakeEvent:o,fromLeft:s})}else{if(!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(n,s)}}handleColumnDragWhileAllowingMovement(e,t,o,s,i){const n=this.getAllMovingColumns(e),r="right"===this.normaliseDirection(e.hDirection),a=1===e.dragSource.type,l=Gl({...this.getMoveColumnParams({allMovingColumns:n,isFromHeader:a,xPosition:s,fromLeft:r,fromEnter:t,fakeEvent:o}),finished:i});l&&(this.lastMovedInfo=l)}getAllMovingColumns(e,t=!1){const o=e.dragSource.getDragItem();let s=null;t?(s=o.columnsInSplit,s||(s=o.columns)):s=o.columns;return s?s.filter(e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:o,xPosition:s,fromLeft:i,fromEnter:n,fakeEvent:r}=e,{gos:a,colModel:l,colMoves:d,visibleCols:c}=this.beans;return{allMovingColumns:t,isFromHeader:o,fromLeft:i,xPosition:s,pinned:this.pinned,fromEnter:n,fakeEvent:r,gos:a,colModel:l,colMoves:d,visibleCols:c}}highlightHoveredColumn(t,o){const{gos:s,colModel:i}=this.beans,n=s.get("enableRtl"),r=i.getCols().filter(e=>e.isVisible()&&e.getPinned()===this.pinned);let a,l=null,d=null,c=null;for(const e of r){if(d=e.getActualWidth(),l=this.getNormalisedColumnLeft(e,0,n),null!=l){if(l<=o&&l+d>=o){c=e;break}}l=null,d=null}if(c)-1!==t.indexOf(c)&&(c=null);else{for(let t=r.length-1;t>=0;t--){const o=r[t],s=r[t].getParent();if(!s){c=o;break}const i=s?.getDisplayedLeafColumns();if(i.length){c=e(i);break}}if(!c)return;l=this.getNormalisedColumnLeft(c,0,n),d=c.getActualWidth()}if(null!=c&&null!=l&&null!=d){if(o-l7;return t&&o||e.some(e=>e.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:o,fromEnter:s,fakeEvent:i,fromLeft:n}=e,{columns:r,toIndex:a}=Ll(this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:o,fromLeft:n,fromEnter:s,fakeEvent:i}))||{};r&&null!=a&&(this.lastMovedInfo={columns:r,toIndex:a}),this.finishColumnMoving()}clearHighlighted(){const{lastHighlightedColumn:e}=this;e&&(Vl(e.column,null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.beans.ctrlsSvc.get("center"),o=t.getCenterViewportScrollLeft(),s=o+t.getCenterWidth();let i,n;this.gos.get("enableRtl")?(i=es-50):(n=es-50),this.needToMoveRight=i,this.needToMoveLeft=n,n||i?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.beans.dragAndDrop.setDragImageCompIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,this.beans.dragAndDrop.setDragImageCompIcon(this.getIconName()))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const o=this.gridBodyCon.scrollFeature;if(this.needToMoveLeft?t=o.scrollHorizontally(-e):this.needToMoveRight&&(t=o.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const{pinnedCols:e,dragAndDrop:t,gos:o}=this.beans;if(this.failedMoveAttempts<=8||!e)return;if(t.setDragImageCompIcon("pinned"),!o.get("suppressMoveWhenColumnDragging")){const e=this.lastDraggingEvent?.dragItem.columns;this.attemptToPinColumns(e,void 0,!0)}}}getPinDirection(){return this.needToMoveLeft||"left"===this.pinned?"left":this.needToMoveRight||"right"===this.pinned?"right":void 0}attemptToPinColumns(e,t,o=!1){const s=(e||[]).filter(e=>!e.getColDef().lockPinned);if(!s.length)return 0;o&&(t=this.getPinDirection());const{pinnedCols:i,dragAndDrop:n}=this.beans;return i?.setColsPinned(s,t,"uiColumnDragged"),o&&n.nudge(),s.length}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}};function Vl(e,t){e.highlighted!==t&&(e.highlighted=t,e.dispatchColEvent("headerHighlightChanged","uiColumnMoved"))}var zl=class extends We{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){const{ctrlsSvc:e,dragAndDrop:t}=this.beans,o=this.pinned;e.whenReady(this,e=>{let t;const s=e.gridBodyCtrl.eBodyViewport;switch(o){case"left":t=[[s,e.left.eContainer],[e.bottomLeft.eContainer],[e.topLeft.eContainer]];break;case"right":t=[[s,e.right.eContainer],[e.bottomRight.eContainer],[e.topRight.eContainer]];break;default:t=[[s,e.center.eViewport],[e.bottomCenter.eViewport],[e.topCenter.eViewport]]}this.eSecondaryContainers=t}),this.moveColumnFeature=this.createManagedBean(new Ol(o)),this.bodyDropPivotTarget=this.createManagedBean(new kl(o)),t.addDropTarget(this),this.addDestroyFunc(()=>t.removeDropTarget(this))}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.beans.colModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}onDragCancel(){this.currentDropListener.onDragCancel()}};var Wl={moduleName:"ColumnMove",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="colMoves"}moveColumnByIndex(e,t,o){const s=this.beans.colModel.getCols();if(!s)return;const i=s[e];this.moveColumns([i],t,o)}moveColumns(e,t,o,s=!0){const{colModel:i,colAnimation:r,visibleCols:a,eventSvc:l}=this.beans,d=i.getCols();if(!d)return;if(t>d.length-e.length)return void Et(30,{toIndex:t});r?.start();const c=i.getColsForKeys(e);this.doesMovePassRules(c,t)&&(n(i.getCols(),c,t),a.refresh(o),l.dispatchEvent({type:"columnMoved",columns:c,column:1===c.length?c[0]:null,toIndex:t,finished:s,source:o})),r?.finish()}doesMovePassRules(e,t){const o=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(o)}doesOrderPassRules(e){const{colModel:t,gos:o}=this.beans;if(!ps(e,t.getColTree()))return!1;return!!(e=>{const t=e=>e?"left"===e||!0===e?-1:1:0,s=o.get("enableRtl");let i=s?1:-1,n=!0;for(const o of e){const e=t(o.getColDef().lockPosition);s?e>i&&(n=!1):el?"hide":"notAllowed",getDragItem:d?()=>function(e,t){const o=e.getProvidedColumnGroup().getLeafColumns(),i={};for(const s of o)i[s.getId()]=s.isVisible();const n=[];for(const l of t)o.indexOf(l)>=0&&(n.push(l),s(o,l));for(const s of o)n.push(s);const r=[],a=e.getLeafColumns();for(const s of n)-1!==a.indexOf(s)&&r.push(s);return{columns:n,columnsInSplit:r,visibleState:i,containerType:r[0]?.pinned}}(t,a.allCols):()=>function(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t,containerType:e.pinned}}(t),dragItemName:o,onDragStarted:()=>{l=!i.get("suppressDragLeaveHidesColumns"),Hl(c,!0)},onDragStopped:()=>Hl(c,!1),onDragCancelled:()=>Hl(c,!1),onGridEnter:e=>{if(l){const{columns:t=[],visibleState:o}=e??{},s=d?e=>!o||o[e.getColId()]:()=>!0,i=t.filter(e=>!e.getColDef().lockVisible&&s(e));n.setColsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{if(l){const t=e?.columns?.filter(e=>!e.getColDef().lockVisible)||[];n.setColsVisible(t,!1,"uiColumnMoved")}}};return r.addDragSource(h,!0),h}},class extends We{constructor(){super(...arguments),this.beanName="colAnimation",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){if(this.active)return;const{gos:e}=this;e.get("suppressColumnMoveAnimation")||e.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0,this.activeNext=!0)}finish(){this.active&&this.flush(()=>this.activeNext=!1,()=>this.active=!1)}executeNextVMTurn(e){this.activeNext?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount,{gridBodyCtrl:t}=this;t.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&t.setColumnMovingCss(!1)})}flush(e,t){const{executeNextFuncs:o,executeLaterFuncs:s}=this;if(0===o.length&&0===s.length)return e(),void t();const i=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e(),i(o)},0),window.setTimeout(()=>{t(),i(s)},200)})}}],apiFunctions:{moveColumnByIndex:function(e,t,o){e.colMoves?.moveColumnByIndex(t,o,"api")},moveColumns:function(e,t,o){e.colMoves?.moveColumns(t,o,"api")}},dependsOn:[Al],css:[":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell,.ag-spanned-cell-wrapper{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}"]},Ul={moduleName:"AutoWidth",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="autoWidthCalc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const o=this.getHeaderCellForColumn(e);if(!o)return-1;const s=this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e);return t||s.push(o),this.getPreferredWidthForElements(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.getPreferredWidthForElements([t]):-1}getPreferredWidthForElements(e,t){const o=document.createElement("form");o.style.position="fixed";const s=this.centerRowContainerCtrl.eContainer;for(const n of e)this.cloneItemIntoDummy(n,o);s.appendChild(o);const i=Math.ceil(o.getBoundingClientRect().width);return o.remove(),i+(t=t??this.gos.get("autoSizePadding"))}getHeaderCellForColumn(e){let t=null;for(const o of this.beans.ctrlsSvc.getHeaderRowContainerCtrls()){const s=o.getHtmlElementForColumnHeader(e);null!=s&&(t=s)}return t}cloneItemIntoDummy(e,t){const o=e.cloneNode(!0);o.style.width="",o.style.position="static",o.style.left="";const s=document.createElement("div"),i=s.classList;["ag-header-cell","ag-header-group-cell"].some(e=>o.classList.contains(e))?(i.add("ag-header","ag-header-row"),s.style.position="static"):i.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(e=>n.classList.contains(e))){for(let e=0;ethis.resizeLeafColumnsToFit("uiColumnResized")))}onResizeStart(e){const{columnsToResize:t,resizeStartWidth:o,resizeRatios:s,groupAfterColumns:i,groupAfterStartWidth:n,groupAfterRatios:r}=this.getInitialValues(e);this.resizeCols=t,this.resizeStartWidth=o,this.resizeRatios=s,this.resizeTakeFromCols=i,this.resizeTakeFromStartWidth=n,this.resizeTakeFromRatios=r,this.toggleColumnResizing(!0)}onResizing(e,t,o="uiColumnResized"){const s=this.normaliseDragChange(t),i=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(i,o,e)}getInitialValues(e){const t=e=>e.reduce((e,t)=>e+t.getActualWidth(),0),o=(e,t)=>e.map(e=>e.getActualWidth()/t),s=this.getColumnsToResize(),i=t(s),n={columnsToResize:s,resizeStartWidth:i,resizeRatios:o(s,i)};let r=null;if(e&&(r=this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup,"After")??null),r){const e=n.groupAfterColumns=r.getDisplayedLeafColumns().filter(e=>e.isResizable());n.groupAfterRatios=o(e,n.groupAfterStartWidth=t(e))}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}resizeLeafColumnsToFit(e){const t=this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup),o=this.getInitialValues();t>o.resizeStartWidth&&this.resizeColumns(o,t,e,!0)}resizeColumnsFromLocalValues(e,t,o=!0){if(!this.resizeCols||!this.resizeRatios)return;const s={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols,groupAfterStartWidth:this.resizeTakeFromStartWidth,groupAfterRatios:this.resizeTakeFromRatios};this.resizeColumns(s,e,t,o)}resizeColumns(e,t,o,s=!0){const{columnsToResize:i,resizeStartWidth:n,resizeRatios:r,groupAfterColumns:a,groupAfterStartWidth:l,groupAfterRatios:d}=e,c=[];if(c.push({columns:i,ratios:r,width:t}),a){const e=t-n;c.push({columns:a,ratios:d,width:l-e})}this.beans.colResize?.resizeColumnSets({resizeSets:c,finished:s,source:o}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.toggleCss("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(e=>e.isResizable())}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}},jl=class extends We{constructor(e,t,o,s,i){super(),this.pinned=e,this.column=t,this.eResize=o,this.comp=s,this.ctrl=i}postConstruct(){const e=[];let t,o;const s=()=>{if(_(this.eResize,t),!t)return;const{horizontalResizeSvc:s,colAutosize:i}=this.beans,n=s.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});e.push(n),o&&i&&e.push(i.addColumnAutosizeListeners(this.eResize,this.column))},i=()=>{for(const t of e)t();e.length=0},n=()=>{const e=this.column.isResizable(),n=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;e===t&&n===o||(t=e,o=n,i(),s())};n(),this.addDestroyFunc(i),this.ctrl.setRefreshFunction("resize",n)}onResizing(e,t){const{column:o,lastResizeAmount:s,resizeStartWidth:i,beans:n}=this,r=this.normaliseResizeAmount(t),a=[{key:o,newWidth:i+r}],{pinnedCols:l,ctrlsSvc:d,colResize:c}=n;if(this.column.getPinned()){if((l?.leftWidth??0)+(l?.rightWidth??0)+(r-s)>X(d.getGridBodyCtrl().eBodyViewport)-50)return}this.lastResizeAmount=r,c?.setColumnWidths(a,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.column.resizing=e,this.comp.toggleCss("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const o="left"!==this.pinned,s="right"===this.pinned;return this.gos.get("enableRtl")?o&&(t*=-1):s&&(t*=-1),t}};var Kl={moduleName:"ColumnResize",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="colResize"}setColumnWidths(e,t,o,s){const i=[],{colModel:n,gos:r,visibleCols:a}=this.beans;for(const l of e){const e=n.getColDefCol(l.key)||n.getCol(l.key);if(e&&(i.push({width:l.newWidth,ratios:[1],columns:[e]}),"shift"===r.get("colResizeDefault")&&(t=!t),t)){const t=a.getColAfter(e);if(!t)continue;const o=e.getActualWidth()-l.newWidth,s=t.getActualWidth()+o;i.push({width:s,ratios:[1],columns:[t]})}}0!==i.length&&this.resizeColumnSets({resizeSets:i,finished:o,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:o,source:s}=e;if(t&&!t.every(e=>function(e){const{columns:t,width:o}=e;let s=0,i=0,n=!0;for(const r of t){s+=r.getMinWidth()||0;const e=r.getMaxWidth();e>0?i+=e:n=!1}return o>=s&&(!n||o<=i)}(e))){if(o){const e=t&&t.length>0?t[0].columns:null;vs(this.eventSvc,e,o,s)}return}const i=[],n=[];for(const d of t){const{width:e,columns:t,ratios:o}=d,r={},a={};for(const s of t)n.push(s);let l=!0,c=0;for(;l;){if(c++,c>1e3){Tt(31);break}l=!1;const s=[];let i=0,n=e;t.forEach((e,t)=>{if(a[e.getId()])n-=r[e.getId()];else{s.push(e);const n=o[t];i+=n}});const d=1/i;s.forEach((t,i)=>{let c;i===s.length-1?c=n:(c=Math.round(o[i]*e*d),n-=c);const h=t.getMinWidth(),u=t.getMaxWidth();c0&&c>u&&(c=u,a[t.getId()]=!0,l=!0),r[t.getId()]=c})}for(const n of t){const e=r[n.getId()];n.getActualWidth()!==e&&(n.setActualWidth(e,s),i.push(n))}}const r=i.length>0;let a=[];if(r){const{colFlex:e,visibleCols:t,colViewport:o}=this.beans;a=e?.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0})??[],t.setLeftValues(s),t.updateBodyWidths(),o.checkViewportColumns()}const l=n.concat(a);(r||o)&&vs(this.eventSvc,l,o,s,a)}resizeHeader(e,t,o){if(!e.isResizable())return;const s=e.getActualWidth(),i=e.getMinWidth(),n=e.getMaxWidth(),r=Math.min(Math.max(s+t,i),n);this.setColumnWidths([{key:e,newWidth:r}],o,!0,"uiColumnResized")}createResizeFeature(e,t,o,s,i){return new jl(e,t,o,s,i)}createGroupResizeFeature(e,t,o,s){return new $l(e,t,o,s)}}],apiFunctions:{setColumnWidths:function(e,t,o=!0,s="api"){e.colResize?.setColumnWidths(t,!1,o,s)}},dependsOn:[Il,Ul]},_l=class extends We{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())t.__addEventListener("widthChanged",e),t.__addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.__removeEventListener("widthChanged",e),t.__removeEventListener("visibleChanged",e)})}removeListenersOnChildrenColumns(){for(const e of this.removeChildListenersFuncs)e();this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.toggleCss("ag-hidden",0===e)}};var ql=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let o;return o="number"!=typeof t?0:t+1,this.existingIds[e]=o,o}};function Yl(e,t){for(let o=0;o=0&&(e[s]=e[e.length-1],e.pop())}}function Zl(e,t,o){if(e)for(let s=0;s{xo(e)&&t.push(e)}),t}var Xl={moduleName:"ColumnGroup",version:vt,dynamicBeans:{headerGroupCellCtrl:class extends gr{constructor(){super(...arguments),this.onSuppressColMoveChange=()=>{!this.isAlive()||this.isSuppressMoving()?this.removeDragSource():this.dragSource||this.setDragSource(this.eGui)}}wireComp(e,t,o,s,i){const{column:n,beans:r}=this,{context:a,colNames:l,colHover:d,rangeSvc:c,colResize:h}=r;this.comp=e,i=nr(this,a,i),this.setGui(t,i),this.displayName=l.getDisplayNameForColumnGroup(n,"header"),this.refreshHeaderStyles(),this.addClasses(),this.setupMovingCss(i),this.setupExpandable(i),this.setupTooltip(),this.refreshAnnouncement(),this.setupAutoHeight({wrapperElement:s,compBean:i}),this.setupUserComp(),this.addHeaderMouseListeners(i,s),this.addManagedPropertyListener("groupHeaderHeight",this.refreshMaxHeaderHeight.bind(this)),this.refreshMaxHeaderHeight();const u=this.rowCtrl.pinned,g=n.getProvidedColumnGroup().getLeafColumns();d?.createHoverFeature(i,g,t),c?.createRangeHighlightFeature(i,n,e),i.createManagedBean(new rr(n,t,r)),i.createManagedBean(new _l(e,n)),h?this.resizeFeature=i.createManagedBean(h.createGroupResizeFeature(e,o,u,n)):e.setResizableDisplayed(!1),i.createManagedBean(new xn(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(i,g),this.addManagedEventListeners({cellSelectionChanged:()=>this.refreshAnnouncement()}),i.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(i),i.addDestroyFunc(()=>this.clearComponent())}getHeaderClassParams(){const{column:e,beans:t}=this,o=e.getDefinition();return wo(t.gos,{colDef:o,columnGroup:e,floatingFilter:!1})}refreshMaxHeaderHeight(){const{gos:e,comp:t}=this,o=e.get("groupHeaderHeight");null!=o?0===o?t.setHeaderWrapperHidden(!0):t.setHeaderWrapperMaxHeight(o):(t.setHeaderWrapperHidden(!1),t.setHeaderWrapperMaxHeight(null))}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const o of t)e.addManagedListeners(o,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,o)})}onLeafColumnHighlightChanged(t){const o=this.column.getDisplayedLeafColumns(),s=o[0]===t,i=e(o)===t;if(!s&&!i)return;const n=t.getHighlighted();let r=!1,a=!1;if(!!this.rowCtrl.getHeaderCellCtrls().find(e=>e.column.isMoving())){const e=this.beans.gos.get("enableRtl"),t=1===n,o=0===n;s&&(e?a=t:r=o),i&&(e?r=o:a=t)}this.comp.toggleCss("ag-header-highlight-before",r),this.comp.toggleCss("ag-header-highlight-after",a)}resizeHeader(e,t){const{resizeFeature:o}=this;if(!o)return;const s=o.getInitialValues(t);o.resizeColumns(s,s.resizeStartWidth+e,"uiColumnResized",!0)}resizeLeafColumnsToFit(e){this.resizeFeature?.resizeLeafColumnsToFit(e)}setupUserComp(){const{colGroupSvc:e,userCompFactory:t,gos:o,enterpriseMenuFactory:s}=this.beans,i=this.column,n=i.getProvidedColumnGroup(),r=function(e,t){const o=t.columnGroup.getColGroupDef();return e.getCompDetails(o,pi,"agColumnGroupHeader",t)}(t,wo(o,{displayName:this.displayName,columnGroup:i,setExpanded:t=>{e.setColumnGroupOpened(n,t,"gridInitializing")},setTooltip:(e,t)=>{o.assertModuleRegistered("Tooltip",3),this.setupTooltip(e,t)},showColumnMenu:(e,t)=>s?.showMenuAfterButtonClick(n,e,"columnMenu",t),showColumnMenuAfterMouseClick:(e,t)=>s?.showMenuAfterMouseEvent(n,e,"columnMenu",t),eGridHeader:this.eGui}));r&&this.comp.setUserCompDetails(r)}addHeaderMouseListeners(e,t){const{column:o,comp:s,beans:{rangeSvc:i},gos:n}=this,r=e=>this.handleMouseOverChange("mouseenter"===e.type);e.addManagedListeners(this.eGui,{mouseenter:r,mouseleave:r,click:()=>this.dispatchColumnMouseEvent("columnHeaderClicked",o.getProvidedColumnGroup()),contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,o.getProvidedColumnGroup())}),s.toggleCss("ag-header-group-cell-selectable",ao(n));const a=i?.createHeaderGroupCellMouseListenerFeature(this.column,t);a&&this.createManagedBean(a)}handleMouseOverChange(e){this.eventSvc.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(e,t){this.tooltipFeature=this.beans.tooltipSvc?.setupHeaderGroupTooltip(this.tooltipFeature,this,e,t)}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const o=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:o,expandableChanged:o})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0),this.refreshHeaderStyles()}addClasses(){const{column:e}=this,t=e.getColGroupDef(),o=ar(t,this.gos,null,e);e.isPadding()?(o.push("ag-header-group-cell-no-group"),e.getLeafColumns().every(e=>e.isSpanHeaderHeight())&&o.push("ag-header-span-height")):(o.push("ag-header-group-cell-with-group"),t?.wrapHeaderText&&o.push("ag-header-cell-wrap-text"));for(const s of o)this.comp.toggleCss(s,!0)}setupMovingCss(e){const{column:t}=this,o=t.getProvidedColumnGroup().getLeafColumns(),s=()=>this.comp.toggleCss("ag-header-cell-moving",t.isMoving());for(const i of o)e.addManagedListeners(i,{movingChanged:s});s()}onFocusIn(e){this.eGui.contains(e.relatedTarget)||(this.focusThis(),this.announceAriaDescription())}handleKeyDown(e){if(super.handleKeyDown(e),!this.getWrapperHasFocus())return;const{column:t,expandable:o,gos:s,beans:i}=this,n=ao(s);if(e.key==Es)if(n&&!e.altKey)i.rangeSvc?.handleColumnSelection(t,e);else if(o){const e=!t.isExpanded();i.colGroupSvc.setColumnGroupOpened(t.getProvidedColumnGroup(),e,"uiColumnExpanded")}}refreshAnnouncement(){let e;const{gos:t,column:o,beans:s}=this;if(ao(t)){const t=this.getLocaleTextFunc(),i=s.rangeSvc?.isColumnInAnyRange(o);e=t("ariaColumnCellSelection",`Press CTRL+SPACE to ${i?"de":""}select all visible cells in this column group`)}this.ariaAnnouncement=e}announceAriaDescription(){const{beans:e,eGui:t,ariaAnnouncement:o}=this;o&&t.contains(w(e))&&e.ariaAnnounce?.announceValue(o,"columnHeader")}setDragSource(e){this.isAlive()&&!this.isSuppressMoving()&&(this.removeDragSource(),e&&(this.dragSource=this.beans.colMoves?.setDragSourceForHeader(e,this.column,this.displayName)??null))}isSuppressMoving(){return this.gos.get("suppressMovableColumns")||this.column.getLeafColumns().some(e=>e.getColDef().suppressMovable||e.getColDef().lockPosition)}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),super.destroy()}}},beans:[class extends We{constructor(){super(...arguments),this.beanName="colGroupSvc"}getColumnGroupState(){const e=[];return us(null,this.beans.colModel.getColTree(),t=>{No(t)&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}resetColumnGroupState(e){const t=this.beans.colModel.getColDefColTree();if(!t)return;const o=[];us(null,t,e=>{if(No(e)){const t=e.getColGroupDef(),s={groupId:e.getGroupId(),open:t?t.openByDefault:void 0};o.push(s)}}),this.setColumnGroupState(o,e)}setColumnGroupState(e,t){const{colModel:o,colAnimation:s,visibleCols:i,eventSvc:n}=this.beans;if(!o.getColTree().length)return;s?.start();const r=[];for(const a of e){const e=a.groupId,t=a.open,o=this.getProvidedColGroup(e);o&&(o.isExpanded()!==t&&(o.setExpanded(t),r.push(o)))}i.refresh(t,!0),r.length&&n.dispatchEvent({type:"columnGroupOpened",columnGroup:1===r.length?r[0]:void 0,columnGroups:r}),s?.finish()}setColumnGroupOpened(e,t,o){let s;s=No(e)?e.getId():e||"",this.setColumnGroupState([{groupId:s,open:t}],o)}getProvidedColGroup(e){let t=null;return us(null,this.beans.colModel.getColTree(),o=>{No(o)&&o.getId()===e&&(t=o)}),t}getGroupAtDirection(t,o){const s=t.getProvidedColumnGroup().getLevel()+t.getPaddingLevel(),i=t.getDisplayedLeafColumns(),n="After"===o?e(i):i[0],r=`getCol${o}`;for(;;){const e=this.beans.visibleCols[r](n);if(!e)return null;const o=this.getColGroupAtLevel(e,s);if(o!==t)return o}}getColGroupAtLevel(e,t){let o,s,i=e.getParent();for(;o=i.getProvidedColumnGroup().getLevel(),s=i.getPaddingLevel(),!(o+s<=t);)i=i.getParent();return i}updateOpenClosedVisibility(){Zl(this.beans.visibleCols.getAllTrees(),!1,e=>{Fs(e)&&e.calculateDisplayedColumns()})}getColumnGroup(e,t){if(!e)return null;if(Fs(e))return e;const o=this.beans.visibleCols.getAllTrees(),s="number"==typeof t;let i=null;return Zl(o,!1,o=>{if(Fs(o)){const n=o;let r;r=s?e===n.getGroupId()&&t===n.getPartId():e===n.getGroupId(),r&&(i=n)}}),i}createColumnGroups(e){const{columns:t,idCreator:o,pinned:s,oldDisplayedGroups:i,isStandaloneStructure:n}=e,r=this.mapOldGroupsById(i),a=[];let l=t;for(;l.length;){const e=l;l=[];let t=0;const i=i=>{const d=t;t=i;const c=e[d],h=(Fs(c)?c.getProvidedColumnGroup():c).getOriginalParent();if(null==h){for(let t=d;tNo(e))){a.setChildren([r]);continue}a.setChildren(e);break}i.push(r)}}return i}findDepth(e){let t=0,o=e;for(;o?.[0]&&No(o[0]);)t++,o=o[0].getChildren();return t}findMaxDepth(e,t){let o=t;for(let s=0;s=0;o--){const t=new Bo(null,`FAKE_PATH_${s.getId()}_${o}`,!0,o);this.createBean(t),t.setChildren([e]),e.originalParent=t,e=t}0===t&&(s.originalParent=null),o.push(e)}return o}findExistingGroup(e,t){if(null!=e.groupId)for(let o=0;o{for(const s of e)if(Fs(s)){const e=s;t[s.getUniqueId()]=e,o(e.getChildren())}};return e&&o(e),t}setupParentsIntoCols(e,t){for(const o of e??[])if(o.parent!==t&&(this.beans.colViewport.colsWithinViewportHash=""),o.parent=t,Fs(o)){const e=o;this.setupParentsIntoCols(e.getChildren(),e)}}}],apiFunctions:{getAllDisplayedColumnGroups:function(e){return e.visibleCols.getAllTrees()},getCenterDisplayedColumnGroups:function(e){return e.visibleCols.treeCenter},getColumnGroup:function(e,t,o){return e.colGroupSvc?.getColumnGroup(t,o)??null},getColumnGroupState:function(e){return e.colGroupSvc?.getColumnGroupState()??[]},getDisplayNameForColumnGroup:function(e,t,o){return e.colNames.getDisplayNameForColumnGroup(t,o)||""},getLeftDisplayedColumnGroups:function(e){return e.visibleCols.treeLeft},getProvidedColumnGroup:function(e,t){return e.colGroupSvc?.getProvidedColGroup(t)??null},getRightDisplayedColumnGroups:function(e){return e.visibleCols.treeRight},resetColumnGroupState:function(e){e.colGroupSvc?.resetColumnGroupState("api")},setColumnGroupOpened:function(e,t,o){e.colGroupSvc?.setColumnGroupOpened(t,o,"api")},setColumnGroupState:function(e,t){e.colGroupSvc?.setColumnGroupState(t,"api")}}},Jl={tag:"div",cls:"ag-skeleton-container"},ed={moduleName:"CheckboxCellRenderer",version:vt,userComponents:{agCheckboxCellRenderer:class extends ni{constructor(){super(Ar,[Tr]),this.eCheckbox=null,this.registerCSS(".ag-checkbox-cell{height:100%}")}init(e){this.refresh(e);const{eCheckbox:t,beans:o}=this,s=t.getInputElement();s.setAttribute("tabindex","-1"),I(s,"polite"),this.addManagedListeners(s,{click:e=>{if(yn(e),t.isDisabled())return;const o=t.getValue();this.onCheckboxChanged(o)},dblclick:e=>{yn(e)}}),this.addManagedElementListeners(e.eGridCell,{keydown:s=>{if(s.key===As&&!t.isDisabled()){e.eGridCell===w(o)&&t.toggle();const i=t.getValue();this.onCheckboxChanged(i),s.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,o=!0;const{value:s,column:i,node:n}=e;if(n.group&&i)if("boolean"==typeof s)t=s;else{const e=i.getColId();e.startsWith("ag-Grid-AutoColumn")?t=null==s||""===s?void 0:"true"===s:n.aggData&&void 0!==n.aggData[e]||n.sourceRowIndex>=0?t=s??void 0:o=!1}else t=s??void 0;const{eCheckbox:r}=this;if(!o)return void r.setDisplayed(!1);r.setValue(t);const a=e.disabled??!i?.isCellEditable(n);r.setDisabled(a);const l=this.getLocaleTextFunc(),d=U(l,t),c=a?d:`${l("ariaToggleCellValue","Press SPACE to toggle cell value")} (${d})`;r.setInputAriaLabel(c)}onCheckboxChanged(e){const{params:t}=this,{column:o,node:s,value:i}=t,{editSvc:n}=this.beans;if(!o)return;const r={rowNode:s,column:o};n?.dispatchCellEvent(r,null,"cellEditingStarted",{value:i});const a=s.setDataValue(o,e,"ui");n?.dispatchCellEvent(r,null,"cellEditingStopped",{oldValue:i,newValue:e,valueChanged:a}),a||this.updateCheckbox(t)}}}},td={moduleName:"SkeletonCellRenderer",version:vt,userComponents:{agSkeletonCellRenderer:class extends ni{constructor(){super(Jl)}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>T(e.eParentOfValue)),T(e.eParentOfValue,t),e.deferRender?this.setupLoading(e):e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.getLocaleTextFunc();this.getGui().textContent=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");E(this.getGui(),t)}setupLoading(e){const t=Xs({tag:"div",cls:"ag-skeleton-effect"}),o=e.node.rowIndex;if(null!=o){const e=75+25*(o%2==0?Math.sin(o):Math.cos(o));t.style.width=`${e}%`}this.getGui().appendChild(t);const s=this.getLocaleTextFunc(),i=e.deferRender?s("ariaDeferSkeletonCellLoading","Cell is loading"):s("ariaSkeletonCellLoading","Row data is loading");E(this.getGui(),i)}refresh(e){return!1}}}},od=e=>{if("bigint"==typeof e)return e;let t;if("number"==typeof e)t=e;else if("string"==typeof e){if(t=e.trim(),""===t)return null;if(t.endsWith("n")&&(t=t.slice(0,-1)),!/^[+-]?\d+$/.test(t))return null}if(null==t)return null;try{return BigInt(t)}catch{return null}},sd=new RegExp("[T ]"),id=new RegExp("^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}\\D?)?");function nd(e,t){return e.toString().padStart(t,"0")}function rd(e,t=!0,o="T"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(e=>nd(e,2)).join("-");return t&&(s+=o+[e.getHours(),e.getMinutes(),e.getSeconds()].map(e=>nd(e,2)).join(":")),s}function ad(e,t=!0){return e?t?[String(e.getFullYear()),String(e.getMonth()+1),nd(e.getDate(),2),nd(e.getHours(),2),`:${nd(e.getMinutes(),2)}`,`:${nd(e.getSeconds(),2)}`]:[e.getFullYear(),e.getMonth()+1,nd(e.getDate(),2)].map(String):null}var ld=["January","February","March","April","May","June","July","August","September","October","November","December"];function dd(e,t=!1){return!!cd(e,t)}function cd(e,t=!1,o){if(!e)return null;if(!o&&!id.test(e))return null;const[s,i]=e.split(sd);if(!s)return null;const n=s.split("-").map(e=>Number.parseInt(e,10));if(3!==n.filter(e=>!isNaN(e)).length)return null;const[r,a,l]=n,d=new Date(r,a-1,l);if(d.getFullYear()!==r||d.getMonth()!==a-1||d.getDate()!==l)return null;if(!i&&t)return null;if(!i||"00:00:00"===i)return d;const[c,h,u]=i.split(":").map(e=>Number.parseInt(e,10));if(c>=0&&c<24)d.setHours(c);else if(t)return null;if(h>=0&&h<60)d.setMinutes(h);else if(t)return null;if(u>=0&&u<60)d.setSeconds(u);else if(t)return null;return d}function hd(e,t,o){if(!t||!e)return;if(!o)return e[t];const s=t.split(".");let i=e;for(let n=0;n"bigint"==typeof e||"number"==typeof e,fd=e=>"number"===e||"bigint"===e;function Cd(e,t){if(e.valueFormatter)return o=>{const{node:s,colDef:i,column:n,value:r}=o;if(s?.group){const t=(i.pivotValueColumn??n).getAggFunc();if(t){if("first"===t||"last"===t)return e.valueFormatter(o);const{baseDataType:s}=e;if(fd(s)&&"count"!==t){if(md(r))return e.valueFormatter(o);if(null==r)return;if("object"==typeof r){if("function"==typeof r.toNumber)return e.valueFormatter({...o,value:r.toNumber()});if("value"in r)return e.valueFormatter({...o,value:r.value})}}return}}else if(t.get("groupHideOpenParents")&&o.column.isRowGroupActive()&&"string"==typeof o.value&&!e.dataTypeMatcher?.(o.value))return;return e.valueFormatter(o)}}function vd(e,t){if(null==e)return null==t?0:-1;if(null==t)return 1;const o=od(e),s=od(t);return null!=o&&null!=s?o===s?0:o>s?1:-1:0}function wd(e,t){if(null==e)return null==t?0:-1;if(null==t)return 1;const o=bd(e),s=bd(t);return null!=o&&null!=s?o===s?0:o>s?1:-1:0}function bd(e){const t=od(e);return null==t?null:t<0n?-t:t}function yd(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([o,s])=>function(e,t,o,s){if(!t[o])return!1;const i=e[o];return null===i?(t[o]=!1,!1):void 0===s?!!i:i===s}(e,t,o,s))}function Sd(e,t){const o=Ss(e);for(const s of t)delete o[s],"rowGroup"===s?delete o.rowGroupIndex:"pivot"===s&&delete o.pivotIndex;return o}var Rd={moduleName:"DataType",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="dataTypeSvc",this.dataTypeDefinitions={},this.isPendingInference=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[],this.columnDefinitionPropsPerDataType={number:()=>({cellEditor:"agNumberCellEditor"}),bigint:({filterModuleBean:e})=>e?{cellEditor:"agTextCellEditor"}:{cellEditor:"agTextCellEditor",comparator:{default:vd,absolute:wd}},boolean:()=>({cellEditor:"agCheckboxCellEditor",cellRenderer:"agCheckboxCellRenderer",getFindText:()=>null,suppressKeyboardEvent:({node:e,event:t,column:o})=>t.key===As&&o.isCellEditable(e)}),date:({formatValue:e})=>({cellEditor:"agDateCellEditor",keyCreator:e}),dateString:({formatValue:e})=>({cellEditor:"agDateStringCellEditor",keyCreator:e}),dateTime(e){return this.date(e)},dateTimeString(e){return this.dateString(e)},object:({formatValue:e,colModel:t,colId:o})=>({cellEditorParams:{useFormatter:!0},comparator:(s,i)=>{const n=t.getColDefCol(o),r=n?.getColDef();if(!n||!r)return 0;const a=null==s?"":e({column:n,node:null,value:s}),l=null==i?"":e({column:n,node:null,value:i});return a===l?0:a>l?1:-1},keyCreator:e}),text:()=>({})}}wireBeans(e){this.colModel=e.colModel}postConstruct(){this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.colModel.recreateColumnDefs(e)})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes(),t={},o={},s=e=>t=>{const{column:o,node:s,value:i}=t;let n=o.getColDef().valueFormatter;return n===e.groupSafeValueFormatter&&(n=e.valueFormatter),this.beans.valueSvc.formatValue(o,s,i,n)};for(const c of Object.keys(e)){const i=e[c],n={...i,groupSafeValueFormatter:Cd(i,this.gos)};t[c]=n,o[c]=s(n)}const i=this.gos.get("dataTypeDefinitions")??{},n={};for(const c of Object.keys(i)){const r=i[c],a=this.processDataTypeDefinition(r,i,[c],e);a&&(t[c]=a,r.dataTypeMatcher&&(n[c]=r.dataTypeMatcher),o[c]=s(a))}const{valueParser:r,valueFormatter:a}=e.object,{valueParser:l,valueFormatter:d}=t.object;this.hasObjectValueParser=l!==r,this.hasObjectValueFormatter=d!==a,this.formatValueFuncs=o,this.dataTypeDefinitions=t,this.dataTypeMatchers=this.sortKeysInMatchers(n,e)}sortKeysInMatchers(e,t){const o={...e};for(const s of ud)delete o[s],o[s]=e[s]??t[s].dataTypeMatcher;return o}processDataTypeDefinition(e,t,o,s){let i;const n=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let o=s[n];const r=t[n];if(o&&r&&(o=r),!pd(e,o,n))return;i=gd(o,e)}else{if(o.includes(n))return void Et(44);const r=t[n];if(!pd(e,r,n))return;const a=this.processDataTypeDefinition(r,t,[...o,n],s);if(!a)return;i=gd(a,e)}return{...i,groupSafeValueFormatter:Cd(i,this.gos)}}updateColDefAndGetColumnType(e,t,o){let{cellDataType:s}=t;void 0===s&&(s=e.cellDataType);const{field:i}=t;if(null!=s&&!0!==s||(s=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(i,o)),this.addFormulaCellEditorToColDef(e,t),!s)return void(e.cellDataType=!1);const n=this.dataTypeDefinitions[s];if(n)return e.cellDataType=s,n.groupSafeValueFormatter&&(e.valueFormatter=n.groupSafeValueFormatter),n.valueParser&&(e.valueParser=n.valueParser),n.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,s,n,o),n.columnTypes;Et(47,{cellDataType:s})}addFormulaCellEditorToColDef(e,t){(t.allowFormula??e.allowFormula)&&!t.cellEditor&&(e.cellEditor="agFormulaCellEditor")}addColumnListeners(e){if(!this.isPendingInference)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const o=e=>{t.add(e.key)};e.__addEventListener("columnStateUpdated",o),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.__removeEventListener("columnStateUpdated",o))}canInferCellDataType(e,t){const{gos:o}=this;if(!Lt(o))return!1;const s={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(yd(t,s))return!1;const i=null===t.type?e.type:t.type;if(i){const e=o.get("columnTypes")??{};if(Yo(i).some(t=>{const o=e[t.trim()];return o&&yd(o,s)}))return!1}return!yd(e,s)}inferCellDataType(e,t){if(!e)return;let o;const s=this.getInitialData();return s?o=hd(s,e,e.includes(".")&&!this.gos.get("suppressFieldDotNotation")):this.initWaitForRowData(t),null!=o?Object.keys(this.dataTypeMatchers).find(e=>this.dataTypeMatchers[e](o))??"object":void 0}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const e=this.beans.rowModel.rootNode?._leafs;if(e?.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=/* @__PURE__ */new Set,this.isPendingInference)return;this.isPendingInference=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions,{colAutosize:o,eventSvc:s}=this.beans;t&&o&&(o.shouldQueueResizeOperations=!0);const[i]=this.addManagedEventListeners({rowDataUpdateStarted:e=>{const{firstRowData:n}=e;n&&(i?.(),this.isPendingInference=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&o?.processResizeOperations(),s.dispatchEvent({type:"dataTypesInferred"}))}})}processColumnsPendingInference(e,t){this.initialData=e;const o=[];this.destroyColumnStateUpdateListeners();const s={},i={};for(const n of Object.keys(this.columnStateUpdatesPendingInference)){const e=this.columnStateUpdatesPendingInference[n],r=this.colModel.getCol(n);if(!r)continue;const a=r.getColDef();if(!this.resetColDefIntoCol(r,"cellDataTypeInferred"))continue;const l=r.getColDef();if(t&&l.type&&l.type!==a.type){const t=Sd(r,e);t.rowGroup&&null==t.rowGroupIndex&&(s[n]=t),t.pivot&&null==t.pivotIndex&&(i[n]=t),o.push(t)}}t&&o.push(...this.generateColumnStateForRowGroupAndPivotIndexes(s,i)),o.length&&ws(this.beans,{state:o},"cellDataTypeInferred"),this.initialData=null}generateColumnStateForRowGroupAndPivotIndexes(e,t){const o={},{rowGroupColsSvc:s,pivotColsSvc:i}=this.beans;return s?.restoreColumnOrder(o,e),i?.restoreColumnOrder(o,t),Object.values(o)}resetColDefIntoCol(e,t){const o=e.getUserProvidedColDef();if(!o)return!1;const s=cs(this.beans,o,e.getColId());return e.setColDef(s,o,t),!0}getDateStringTypeDefinition(e){const{dateString:t}=this.dataTypeDefinitions;return e?this.getDataTypeDefinition(e)??t:t}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDateIncludesTimeFlag(e){return"dateTime"===e||"dateTimeString"===e}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(null==t)return!0;const o=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!o||(!(!e.getColDef().allowFormula||!this.beans.formula?.isFormula(t))||o(t))}validateColDef(e){const t=e=>Et(48,{property:e});if("object"===e.cellDataType){const{object:o}=this.dataTypeDefinitions;e.valueFormatter!==o.groupSafeValueFormatter||this.hasObjectValueFormatter||t("Formatter"),e.editable&&e.valueParser===o.valueParser&&!this.hasObjectValueParser&&t("Parser")}}postProcess(e){const t=e.cellDataType;if(!t||"string"!=typeof t)return;const{dataTypeDefinitions:o,beans:s,formatValueFuncs:i}=this,n=o[t];n&&s.colFilter?.setColDefPropsForDataType(e,n,i[t])}getFormatValue(e){return this.formatValueFuncs[e]}isColPendingInference(e){return this.isPendingInference&&!!this.columnStateUpdatesPendingInference[e]}setColDefPropertiesForBaseDataType(e,t,o,s){const i=this.formatValueFuncs[t],n=this.columnDefinitionPropsPerDataType[o.baseDataType]({colDef:e,cellDataType:t,colModel:this.colModel,dataTypeDefinition:o,colId:s,formatValue:i,filterModuleBean:this.beans.filterManager});"agFormulaCellEditor"===e.cellEditor&&n.cellEditor!==e.cellEditor&&(n.cellEditor=e.cellEditor),Object.assign(e,n)}getDateObjectTypeDef(e){const t=this.getLocaleTextFunc(),o=this.getDateIncludesTimeFlag(e);return{baseDataType:e,valueParser:e=>cd(e.newValue&&String(e.newValue)),valueFormatter:e=>null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?rd(e.value,o)??"":t("invalidDate","Invalid Date"),dataTypeMatcher:e=>e instanceof Date}}getDateStringTypeDef(e){const t=this.getDateIncludesTimeFlag(e);return{baseDataType:e,dateParser:e=>cd(e)??void 0,dateFormatter:e=>rd(e??null,t)??void 0,valueParser:e=>dd(String(e.newValue))?e.newValue:null,valueFormatter:e=>dd(String(e.value))?String(e.value):"",dataTypeMatcher:e=>"string"==typeof e&&dd(e)}}getDefaultDataTypes(){const e=this.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>""===e.newValue?.trim?.()?null:Number(e.newValue),valueFormatter:t=>null==t.value?"":"number"!=typeof t.value||isNaN(t.value)?e("invalidNumber","Invalid Number"):String(t.value),dataTypeMatcher:e=>"number"==typeof e},bigint:{baseDataType:"bigint",valueParser:e=>{const{newValue:t}=e;return null==t||"string"==typeof t&&""===t.trim()?null:od(t)},valueFormatter:t=>null==t.value?"":"bigint"!=typeof t.value?e("invalidBigInt","Invalid BigInt"):String(t.value),dataTypeMatcher:e=>"bigint"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:d(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>null==e.newValue?e.newValue:""===e.newValue?.trim?.()?null:"true"===String(e.newValue).toLowerCase(),valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:this.getDateObjectTypeDef("date"),dateString:this.getDateStringTypeDef("dateString"),dateTime:this.getDateObjectTypeDef("dateTime"),dateTimeString:{...this.getDateStringTypeDef("dateTimeString"),dataTypeMatcher:e=>"string"==typeof e&&function(e){return dd(e,!0)}(e)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>d(e.value)??""}}}destroyColumnStateUpdateListeners(){for(const e of this.columnStateUpdateListenerDestroyFuncs)e();this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}}],dependsOn:[ed]},xd={moduleName:"ColumnFlex",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="colFlex",this.columnsHidden=!1}refreshFlexedColumns(e={}){const t=e.source??"flex";null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth);const o=this.flexViewportWidth,{visibleCols:s,colDelayRenderSvc:i}=this.beans,n=s.centerCols;let r=-1;if(e.resizingCols){const t=new Set(e.resizingCols);for(let e=n.length-1;e>=0;e--)if(t.has(n[e])){r=e;break}}let a=!1;const l=n.map((e,t)=>{const o=e.getFlex(),s=null!=o&&o>0&&t>r;return a||(a=s),{col:e,isFlex:s,flex:Math.max(0,o??0),initialSize:e.getActualWidth(),min:e.getMinWidth(),max:e.getMaxWidth(),targetSize:0}});if(a?(i?.hideColumns("colFlex"),this.columnsHidden=!0):this.columnsHidden&&this.revealColumns(i),!o||!a)return[];let d=l.length,c=l.reduce((e,t)=>e+t.flex,0),h=o;const u=(e,o)=>{e.frozenSize=o,e.col.setActualWidth(o,t),h-=o,c-=e.flex,d-=1},g=e=>null!=e.frozenSize;for(const m of l)m.isFlex||u(m,m.initialSize);for(;d>0;){const e=Math.round(c<1?h*c:h);let t,o=0,s=0;for(const r of l){if(g(r))continue;t=r,s+=e*(r.flex/c);const i=s-o,n=Math.round(i);r.targetSize=n,o+=n}t&&(t.targetSize+=e-o);let i=0;for(const r of l){if(g(r))continue;const e=r.targetSize,t=Math.min(Math.max(e,r.min),r.max);i+=t-e,r.violationType=t===e?void 0:t0?"min":"max";for(const r of l)g(r)||"all"!==n&&r.violationType!==n||u(r,r.targetSize)}e.skipSetLeft||s.setLeftValues(t),e.updateBodyWidths&&s.updateBodyWidths();const p=l.filter(e=>e.isFlex&&!e.violationType).map(e=>e.col);if(e.fireResizedEvent){const e=l.filter(e=>e.initialSize!==e.frozenSize).map(e=>e.col),o=l.filter(e=>e.flex).map(e=>e.col);vs(this.eventSvc,e,!0,t,o)}return this.revealColumns(i),p}revealColumns(e){this.columnsHidden&&(e?.revealColumns("colFlex"),this.columnsHidden=!1)}initCol(e){const{flex:t,initialFlex:o}=e.colDef;void 0!==t?e.flex=t:void 0!==o&&(e.flex=o)}setColFlex(e,t){e.flex=t??null,e.dispatchStateUpdatedEvent("flex")}}]};var Fd={moduleName:"CellRendererFunction",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="agCompUtils"}adaptFunction(e,t){if(!e.cellRenderer)return null;return class{refresh(){return!1}getGui(){return this.eGui}init(e){const o=t(e),s=typeof o;this.eGui="string"!==s&&"number"!==s&&"boolean"!==s?null!=o?o:Xs({tag:"span"}):le(""+o+"")}}}}]},Dd=class extends ze{constructor(){super(...arguments),this.beanName="registry"}registerDynamicBeans(e){if(e){this.dynamicBeans??(this.dynamicBeans={});for(const t of Object.keys(e))this.dynamicBeans[t]=e[t]}}createDynamicBean(e,t,...o){if(!this.dynamicBeans)throw new Error(this.getDynamicError(e,!0));const s=this.dynamicBeans[e];if(null!=s)return new s(...o);if(t)throw new Error(this.getDynamicError(e,!1))}};function Md(e){return"object"==typeof e&&!!e.getComp}var Pd,Ed,Td="object"!=typeof window||!window?.document?.fonts?.forEach,Ad=(e,t,o,s,i,n,r=!1)=>{if(Td)return;s&&(e=`@layer ${CSS.escape(s).replaceAll("\\.",".")} { ${e} }`);let a=Ld.map.get(t);if(a||(a=[],Ld.map.set(t,a)),a.some(t=>t.css===e))return;const l=document.createElement("style");n&&l.setAttribute("nonce",n),l.dataset.agGlobalCss=o,l.textContent=e;const d={css:e,el:l,priority:i,isParams:r};let c;for(const h of a){if(h.priority>i)break;c=h}if(c){c.el.after(l);const e=a.indexOf(c);a.splice(e+1,0,d)}else"STYLE"===t.nodeName?t.after(l):t.insertBefore(l,t.querySelector(":not(title, meta)")),a.push(d)},Id=(e,t,o,s)=>{Ad(':where([class^=ag-]),:where([class^=ag-]):after,:where([class^=ag-]):before{box-sizing:border-box}:where([class^=ag-]):where(button){color:inherit}:where([class^=ag-]):where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none;&:where(.invalid){box-shadow:inset var(--ag-focus-error-shadow)}}:where([class^=ag-]) ::-ms-clear{display:none}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-tab-guard{display:block;height:0;position:absolute;width:0}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block}.ag-measurement-element-border:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}.ag-popup-child{top:0;z-index:5}.ag-popup-child:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-chart,.ag-dnd-ghost,.ag-external,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);--ag-indentation-level:0}:where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;color:var(--ag-icon-color);display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}.ag-disabled .ag-icon,[disabled] .ag-icon{opacity:.5}.ag-icon-grip.ag-disabled,.ag-icon-grip[disabled]{opacity:.35}.ag-resizer{pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize;height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{cursor:nesw-resize;height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;cursor:nwse-resize;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;cursor:nesw-resize;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}',e,"shared",t,0,o),s?.forEach((s,i)=>s.forEach(s=>Ad(s,e,i,t,0,o)))},kd=(e,t=!1)=>{const o=/* @__PURE__ */new Set;for(const i of Ld.grids.values())i.styleContainer===e&&o.add(i.paramsCss);const s=Ld.map.get(e)??[];for(let i=s.length-1;i>=0;i--)(t||s[i].isParams&&!o.has(s[i].css))&&(s[i].el.remove(),s.splice(i,1))},Ld=(Pd="object"==typeof window?window:{}).agStyleInjectionState??(Pd.agStyleInjectionState={map:/* @__PURE__ */new WeakMap,grids:/* @__PURE__ */new Map}),Gd=e=>new Hd(e),Nd="$default",Bd=0,Hd=class{constructor({feature:e,params:t,modeParams:o={},css:s,cssImports:i}){this.feature=e,this.css=s,this.cssImports=i,this.modeParams={[Nd]:{...o[Nd]??{},...t??{}},...o}}use(e,t,o){let s=this._inject;if(null==s){let{css:e}=this;if(e){const t=`ag-theme-${this.feature??"part"}-${++Bd}`;"function"==typeof e&&(e=e()),e=`:where(.${t}) {\n${e}\n}\n`;for(const o of this.cssImports??[])e=`@import url(${JSON.stringify(o)});\n${e}`;s={css:e,class:t}}else s=!1;this._inject=s}return s&&e&&Ad(s.css,e,s.class,t,1,o),!!s&&s.class}},Od=e=>{return`--ag-${t=e,t.replace(/[A-Z]|\d+/g,e=>`-${e}`).toLowerCase()}`;var t},Vd=e=>`var(${Od(e)})`,zd=e=>({ref:"accentColor",mix:e}),Wd=e=>({ref:"foregroundColor",mix:e}),Ud=e=>({ref:"foregroundColor",mix:e,onto:"backgroundColor"}),$d={ref:"backgroundColor"},jd={ref:"foregroundColor"},Kd={ref:"accentColor"},_d={backgroundColor:"#fff",foregroundColor:"#181d1f",borderColor:Wd(.15),chromeBackgroundColor:Ud(.02),browserColorScheme:"light"},qd={..._d,textColor:jd,accentColor:"#2196f3",invalidColor:"#e02525",fontFamily:["-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue","sans-serif"],subtleTextColor:{ref:"textColor",mix:.5},borderWidth:1,borderRadius:4,spacing:8,fontSize:14,focusShadow:{spread:3,color:zd(.5)},focusErrorShadow:{spread:3,color:{ref:"invalidColor",onto:"backgroundColor",mix:.5}},popupShadow:"0 0 16px #00000026",cardShadow:"0 1px 4px 1px #00000018",dropdownShadow:{ref:"cardShadow"},listItemHeight:{calc:"max(iconSize, dataFontSize) + widgetVerticalSpacing"},dragAndDropImageBackgroundColor:$d,dragAndDropImageBorder:!0,dragAndDropImageNotAllowedBorder:{color:{ref:"invalidColor",onto:"dragAndDropImageBackgroundColor",mix:.5}},dragAndDropImageShadow:{ref:"popupShadow"},iconSize:16,iconColor:"inherit",toggleButtonWidth:28,toggleButtonHeight:18,toggleButtonOnBackgroundColor:Kd,toggleButtonOffBackgroundColor:Ud(.3),toggleButtonSwitchBackgroundColor:$d,toggleButtonSwitchInset:2,tooltipBackgroundColor:{ref:"chromeBackgroundColor"},tooltipErrorBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:.1},tooltipTextColor:{ref:"textColor"},tooltipErrorTextColor:{ref:"invalidColor"},tooltipBorder:!0,tooltipErrorBorder:{color:{ref:"invalidColor",onto:"backgroundColor",mix:.25}},panelBackgroundColor:$d,panelTitleBarHeight:{ref:"headerHeight"},panelTitleBarBackgroundColor:{ref:"headerBackgroundColor"},panelTitleBarIconColor:{ref:"headerTextColor"},panelTitleBarTextColor:{ref:"headerTextColor"},panelTitleBarFontFamily:{ref:"headerFontFamily"},panelTitleBarFontSize:{ref:"headerFontSize"},panelTitleBarFontWeight:{ref:"headerFontWeight"},panelTitleBarBorder:!0,dialogShadow:{ref:"popupShadow"},dialogBorder:{color:Wd(.2)},widgetContainerHorizontalPadding:{calc:"spacing * 1.5"},widgetContainerVerticalPadding:{calc:"spacing * 1.5"},widgetHorizontalSpacing:{calc:"spacing * 1.5"},widgetVerticalSpacing:{ref:"spacing"},dataFontSize:{ref:"fontSize"},headerBackgroundColor:{ref:"chromeBackgroundColor"},headerFontFamily:{ref:"fontFamily"},headerFontSize:{ref:"fontSize"},headerFontWeight:500,headerTextColor:{ref:"textColor"},headerHeight:{calc:"max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale"},headerVerticalPaddingScale:1,menuBorder:{color:Wd(.2)},menuBackgroundColor:Ud(.03),menuTextColor:Ud(.95),menuShadow:{ref:"popupShadow"},menuSeparatorColor:{ref:"borderColor"}},Yd=["colorScheme","color","length","scale","borderStyle","border","shadow","image","fontFamily","fontWeight","duration"],Zd=(e=>{const t=/* @__PURE__ */new Map;return o=>{const s=o;return t.has(s)||t.set(s,e(o)),t.get(s)}})(e=>(e=e.toLowerCase(),Yd.find(t=>e.endsWith(t.toLowerCase()))??"length")),Qd=e=>"object"==typeof e&&e?.ref?Vd(e.ref):"string"==typeof e?e:"number"==typeof e&&String(e),Xd=e=>{if("string"==typeof e)return e;if("object"==typeof e&&e&&"ref"in e){const t=Vd(e.ref);return null==e.mix?t:`color-mix(in srgb, ${e.onto?Vd(e.onto):"transparent"}, ${t} ${((e,t,o)=>Math.max(t,Math.min(o,e)))(100*e.mix,0,100)}%)`}return!1},Jd=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"object"==typeof e&&e&&"calc"in e?`calc(${e.calc.replace(/ ?[*/+] ?/g," $& ").replace(/-?\b[a-z][a-z0-9]*\b(?![-(])/gi,e=>"-"===e[0]?e:" "+Vd(e)+" ")})`:!("object"!=typeof e||!e||!("ref"in e))&&Vd(e.ref),ec=(e,t)=>"string"==typeof e?e:!0===e?ec({},t):!1===e?"columnBorder"===t?ec({color:"transparent"},t):"none":"object"==typeof e&&e&&"ref"in e?Vd(e.ref):oc(e.style??"solid")+" "+Jd(e.width??{ref:"borderWidth"})+" "+Xd(e.color??{ref:"borderColor"}),tc=e=>[Jd(e.offsetX??0),Jd(e.offsetY??0),Jd(e.radius??0),Jd(e.spread??0),Xd(e.color??{ref:"foregroundColor"}),...e.inset?["inset"]:[]].join(" "),oc=Qd,sc=e=>"string"==typeof e?e.includes(",")?e:ic(e):"object"==typeof e&&e&&"googleFont"in e?sc(e.googleFont):"object"==typeof e&&e&&"ref"in e?Vd(e.ref):!!Array.isArray(e)&&e.map(e=>("object"==typeof e&&"googleFont"in e&&(e=e.googleFont),ic(e))).join(", "),ic=e=>/^[\w-]+$|\w\(/.test(e)?e:JSON.stringify(e),nc=e=>"string"==typeof e?e:"object"==typeof e&&e&&"url"in e?`url(${JSON.stringify(e.url)})`:"object"==typeof e&&e&&"svg"in e?nc({url:`data:image/svg+xml,${encodeURIComponent(e.svg)}`}):!("object"!=typeof e||!e||!("ref"in e))&&Vd(e.ref),rc={color:Xd,colorScheme:Qd,length:Jd,scale:Qd,border:ec,borderStyle:oc,shadow:e=>"string"==typeof e?e:!1===e?"none":"object"==typeof e&&e&&"ref"in e?Vd(e.ref):Array.isArray(e)?e.map(tc).join(", "):tc(e),image:nc,fontFamily:sc,fontWeight:Qd,duration:(e,t,o)=>"string"==typeof e?e:"number"==typeof e?(e>=10&&o.warn(104,{value:e,param:t}),`${e}s`):!("object"!=typeof e||!e||!("ref"in e))&&Vd(e.ref)},ac=(e,t,o)=>rc[Zd(e)](t,e,o),lc=0,dc=class e{constructor(e,t=[]){this.params=e,this.parts=t}withPart(t){return"function"==typeof t&&(t=t()),t instanceof Hd?new e(this.params,[...this.parts,t]):(this.params.themeLogger.preInitErr(259,"Invalid part",{part:t}),this)}withoutPart(e){return this.withPart(Gd({feature:e}))}withParams(e,t=Nd){return this.withPart(Gd({modeParams:{[t]:e}}))}_startUse({styleContainer:e,cssLayer:t,nonce:o,loadThemeGoogleFonts:s,moduleCss:i}){if(Td)return;gc(),Id(e,t,o,i);const n=hc(this);if(n.length>0)for(const r of n)s&&pc(r,o);for(const r of this.parts)r.use(e,t,o)}_getCssClass(){return this._cssClassCache??(this._cssClassCache=cc(this.parts).map(e=>e.use(void 0,void 0,void 0)).filter(Boolean).concat(this._getParamsClassName()).join(" "))}_getParamsClassName(){return this._paramsClassName??(this._paramsClassName="ag-theme-params-"+ ++lc)}_getModeParams(){let e=this._paramsCache;if(!e){const t={[Nd]:{...qd}};for(const e of cc(this.parts))for(const o of Object.keys(e.modeParams)){const s=e.modeParams[o];if(s){const e=t[o]??(t[o]={}),i=/* @__PURE__ */new Set;for(const t of Object.keys(s)){const o=s[t];void 0!==o&&(e[t]=o,i.add(t))}if(o===Nd)for(const o of Object.keys(t)){const e=t[o];if(o!==Nd)for(const t of i)delete e[t]}}}this._paramsCache=e=t}return e}_getParamsCss(){if(!this._paramsCssCache){let e="",t="";const o=this._getModeParams(),{overridePrefix:s,themeLogger:i}=this.params,n=s?`--ag-${s}-`:void 0;for(const l of Object.keys(o)){const s=o[l];if(l!==Nd){const o=`:where([data-ag-theme-mode="${"object"==typeof CSS?CSS.escape(l):l}"]) & {\n`;e+=o,t+=o}for(const o of Object.keys(s).sort()){const r=s[o],a=ac(o,r,i);if(!1===a)i.error(107,{key:o,value:r});else{const s=Od(o),i=n?s.replace("--ag-",n):s,r=s.replace("--ag-","--ag-inherited-");e+=`\t${s}: var(${r}, ${a});\n`,t+=`\t${r}: var(${i});\n`}}l!==Nd&&(e+="}\n",t+="}\n")}const r=`:where(.${this._getParamsClassName()})`;let a=`${r} {\n${e}}\n`;a+=`:has(> ${r}):not(${r}) {\n${t}}\n`,this._paramsCssCache=a}return this._paramsCssCache}},cc=e=>{const t=/* @__PURE__ */new Map;for(const s of e)t.set(s.feature,s);const o=[];for(const s of e)s.feature&&t.get(s.feature)!==s||o.push(s);return o},hc=e=>{const t=/* @__PURE__ */new Set,o=e=>{if(Array.isArray(e))e.forEach(o);else{const o=e?.googleFont;"string"==typeof o&&t.add(o)}};return Object.values(e._getModeParams()).flatMap(e=>Object.values(e)).forEach(o),Array.from(t).sort()},uc=!1,gc=()=>{if(!uc){uc=!0;for(const e of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]')))e.remove()}},pc=async(e,t)=>{Ad(`@import url('https://${mc}/css2?family=${encodeURIComponent(e)}:wght@100;200;300;400;500;600;700;800;900&display=swap');\n`,document.head,`googleFont:${e}`,void 0,0,t)},mc="fonts.googleapis.com",fc={changeKey:"listItemHeight",type:"length",defaultValue:24},Cc=class extends ze{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=/* @__PURE__ */new Map,this.lastKnownValues=/* @__PURE__ */new Map,this.sizesMeasured=!1,this.globalCSS=[]}wireBeans(e){this.eRootDiv=e.eRootDiv}postConstruct(){const{gos:e,eRootDiv:t}=this;e.setInstanceDomData(t);const o=e.get("themeStyleContainer"),s="undefined"!=typeof ShadowRoot,i=s&&t.getRootNode()instanceof ShadowRoot;this.eStyleContainer=("function"==typeof o?o():o)??(i?t:document.head),o||i||!s||wc(t,this.shadowRootError.bind(this),this.addDestroyFunc.bind(this)),this.cssLayer=e.get("themeCssLayer"),this.styleNonce=e.get("styleNonce"),this.addManagedPropertyListener("theme",()=>this.handleThemeChange()),this.handleThemeChange(),this.getSizeEl(fc),this.initVariables(),this.addDestroyFunc(()=>(e=>{const t=Ld.grids.get(e)?.styleContainer;t&&(Ld.grids.delete(e),Array.from(Ld.grids.values()).some(e=>e.styleContainer===t)?kd(t):(kd(t,!0),Ld.map.delete(t)))})(this)),this.mutationObserver=new MutationObserver(()=>{this.fireStylesChangedEvent("theme")}),this.addDestroyFunc(()=>this.mutationObserver.disconnect())}applyThemeClasses(e,t=[]){const{theme:o}=this,s=o?o._getCssClass():this.applyLegacyThemeClasses();for(const i of Array.from(e.classList))i.startsWith("ag-theme-")&&e.classList.remove(i);if(s){const o=e.className;e.className=`${o}${o?" ":""}${s}${t?.length?" "+t.join(" "):""}`}}applyLegacyThemeClasses(){let e="";this.mutationObserver.disconnect();let t=this.eRootDiv;for(;t;){let o=!1;for(const s of Array.from(t.classList))s.startsWith("ag-theme-")&&(o=!0,e=e?`${e} ${s}`:s);o&&this.mutationObserver.observe(t,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement}return e}addGlobalCSS(e,t){this.theme?Ad(e,this.eStyleContainer,t,this.cssLayer,0,this.styleNonce):this.globalCSS.push([e,t])}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(fc)}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(null!=t)return t;const o=this.measureSizeEl(e);return"detached"===o||"no-styles"===o?(e.cacheDefault&&this.lastKnownValues.set(e,e.defaultValue),e.defaultValue):(this.lastKnownValues.set(e,o),o)}measureSizeEl(e){const t=this.getSizeEl(e);if(null==t.offsetParent)return"detached";const o=t.offsetWidth;return o===vc?"no-styles":(this.sizesMeasured=!0,o)}getMeasurementContainer(){let e=this.eMeasurementContainer;return e||(e=this.eMeasurementContainer=Fe({tag:"div",cls:"ag-measurement-container"}),this.eRootDiv.appendChild(e)),e}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;const o=this.getMeasurementContainer();t=Fe({tag:"div"});const s=this.setSizeElStyles(t,e);o.appendChild(t),this.sizeEls.set(e,t);const{type:i,noWarn:n}=e;if("length"!==i&&"border"!==i)return t;let r=this.measureSizeEl(e);"no-styles"!==r||n||this.varError(s,e.defaultValue);const a=be(this.beans,t,()=>{const t=this.measureSizeEl(e);"detached"!==t&&"no-styles"!==t&&(this.lastKnownValues.set(e,t),t!==r&&(r=t,this.fireStylesChangedEvent(e.changeKey)))});return this.addDestroyFunc(()=>a()),t}setSizeElStyles(e,t){const{changeKey:o,type:s}=t;let i=Od(o);return"border"===s?(i.endsWith("-width")&&(i=i.slice(0,-6)),e.className="ag-measurement-element-border",e.style.setProperty("--ag-internal-measurement-border",`var(${i}, solid ${vc}px)`)):e.style.width=`var(${i}, ${vc}px)`,i}handleThemeChange(){const{gos:e,theme:t}=this,o=e.get("theme");let s;if("legacy"===o)s=void 0;else{const e=o??this.getDefaultTheme();e instanceof dc?s=e:this.themeError(e)}s!==t&&this.handleNewTheme(s),this.postProcessThemeChange(s,o)}handleNewTheme(e){const{gos:t,eRootDiv:o,globalCSS:s}=this,i=this.getAdditionalCss();if(e){Id(this.eStyleContainer,this.cssLayer,this.styleNonce,i);for(const[e,t]of s)Ad(e,this.eStyleContainer,t,this.cssLayer,0,this.styleNonce);s.length=0}this.theme=e,e?._startUse({loadThemeGoogleFonts:t.get("loadThemeGoogleFonts"),styleContainer:this.eStyleContainer,cssLayer:this.cssLayer,nonce:this.styleNonce,moduleCss:i}),((e,t,o,s,i,n)=>{if(Td)return;const r=Ld.grids.get(e);r?r.paramsCss=t:Ld.grids.set(e,{styleContainer:s,paramsCss:t}),kd(s),t&&o&&Ad(t,s,o,i,2,n,!0)})(this,e?._getParamsCss()??null,e?._getParamsClassName()??null,this.eStyleContainer,this.cssLayer,this.styleNonce),this.applyThemeClasses(o),this.fireStylesChangedEvent("theme")}fireStylesChangedEvent(e){this.eventSvc.dispatchEvent({type:"stylesChanged",[`${e}Changed`]:!0})}},vc=15538,wc=(e,t,o)=>{let s=60;const i=setInterval(()=>{"undefined"!=typeof ShadowRoot&&e.getRootNode()instanceof ShadowRoot&&(t(),clearInterval(i)),(re(e)||--s<0)&&clearInterval(i)},1e3);o(()=>clearInterval(i))},bc={wrapperBorder:!0,rowBorder:!0,headerRowBorder:!0,footerRowBorder:{ref:"rowBorder"},columnBorder:{style:"solid",width:1,color:"transparent"},headerColumnBorder:!1,headerColumnBorderHeight:"100%",pinnedColumnBorder:!0,pinnedRowBorder:!0,sidePanelBorder:!0,sideBarPanelWidth:250,sideBarBackgroundColor:{ref:"chromeBackgroundColor"},sideButtonBarBackgroundColor:{ref:"sideBarBackgroundColor"},sideButtonBarTopPadding:0,sideButtonSelectedUnderlineWidth:2,sideButtonSelectedUnderlineColor:"transparent",sideButtonSelectedUnderlineTransitionDuration:0,sideButtonBackgroundColor:"transparent",sideButtonTextColor:{ref:"textColor"},sideButtonHoverBackgroundColor:{ref:"sideButtonBackgroundColor"},sideButtonHoverTextColor:{ref:"sideButtonTextColor"},sideButtonSelectedBackgroundColor:$d,sideButtonSelectedTextColor:{ref:"sideButtonTextColor"},sideButtonBorder:"solid 1px transparent",sideButtonSelectedBorder:!0,sideButtonLeftPadding:{ref:"spacing"},sideButtonRightPadding:{ref:"spacing"},sideButtonVerticalPadding:{calc:"spacing * 3"},cellFontFamily:{ref:"fontFamily"},headerCellHoverBackgroundColor:"transparent",headerCellMovingBackgroundColor:{ref:"headerCellHoverBackgroundColor"},headerCellBackgroundTransitionDuration:"0.2s",cellTextColor:{ref:"textColor"},rangeSelectionBorderStyle:"solid",rangeSelectionBorderColor:Kd,rangeSelectionBackgroundColor:zd(.2),rangeSelectionChartBackgroundColor:"#0058FF1A",rangeSelectionChartCategoryBackgroundColor:"#00FF841A",rangeSelectionHighlightColor:zd(.5),rangeHeaderHighlightColor:(Ed=.08,{ref:"foregroundColor",mix:Ed,onto:"headerBackgroundColor"}),rowNumbersSelectedColor:zd(.5),rowHoverColor:zd(.08),columnHoverColor:zd(.05),selectedRowBackgroundColor:zd(.12),modalOverlayBackgroundColor:{ref:"backgroundColor",mix:.66},dataBackgroundColor:$d,oddRowBackgroundColor:{ref:"dataBackgroundColor"},wrapperBorderRadius:8,cellHorizontalPadding:{calc:"spacing * 2 * cellHorizontalPaddingScale"},cellWidgetSpacing:{calc:"spacing * 1.5"},cellHorizontalPaddingScale:1,rowGroupIndentSize:{calc:"cellWidgetSpacing + iconSize"},valueChangeDeltaUpColor:"#43a047",valueChangeDeltaDownColor:"#e53935",valueChangeValueHighlightBackgroundColor:"#16a08580",rowHeight:{calc:"max(iconSize, dataFontSize) + spacing * 3.25 * rowVerticalPaddingScale"},rowVerticalPaddingScale:1,paginationPanelHeight:{ref:"rowHeight",calc:"max(rowHeight, 22px)"},dragHandleColor:Wd(.7),headerColumnResizeHandleHeight:"30%",headerColumnResizeHandleWidth:2,headerColumnResizeHandleColor:{ref:"borderColor"},iconButtonColor:{ref:"iconColor"},iconButtonBackgroundColor:"transparent",iconButtonBackgroundSpread:4,iconButtonBorderRadius:1,iconButtonHoverColor:{ref:"iconButtonColor"},iconButtonHoverBackgroundColor:Wd(.1),iconButtonActiveColor:Kd,iconButtonActiveBackgroundColor:zd(.28),iconButtonActiveIndicatorColor:Kd,setFilterIndentSize:{ref:"iconSize"},chartMenuPanelWidth:260,chartMenuLabelColor:Wd(.8),cellEditingBorder:{color:Kd},cellEditingShadow:{ref:"cardShadow"},fullRowEditInvalidBackgroundColor:{ref:"invalidColor",onto:"backgroundColor",mix:.25},columnSelectIndentSize:{ref:"iconSize"},toolPanelSeparatorBorder:!0,columnDropCellBackgroundColor:Wd(.07),columnDropCellTextColor:{ref:"textColor"},columnDropCellDragHandleColor:{ref:"textColor"},columnDropCellBorder:{color:Wd(.13)},selectCellBackgroundColor:Wd(.07),selectCellBorder:{color:Wd(.13)},advancedFilterBuilderButtonBarBorder:!0,advancedFilterBuilderIndentSize:{calc:"spacing * 2 + iconSize"},advancedFilterBuilderJoinPillColor:"#f08e8d",advancedFilterBuilderColumnPillColor:"#a6e194",advancedFilterBuilderOptionPillColor:"#f3c08b",advancedFilterBuilderValuePillColor:"#85c0e4",filterPanelApplyButtonColor:$d,filterPanelApplyButtonBackgroundColor:Kd,filterPanelCardSubtleColor:{ref:"textColor",mix:.7},filterPanelCardSubtleHoverColor:{ref:"textColor"},findMatchColor:jd,findMatchBackgroundColor:"#ffff00",findActiveMatchColor:jd,findActiveMatchBackgroundColor:"#ffa500",filterToolPanelGroupIndent:{ref:"spacing"},rowLoadingSkeletonEffectColor:Wd(.15),statusBarLabelColor:jd,statusBarLabelFontWeight:500,statusBarValueColor:jd,statusBarValueFontWeight:500,pinnedSourceRowTextColor:{ref:"textColor"},pinnedSourceRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedSourceRowFontWeight:600,pinnedRowFontWeight:600,pinnedRowBackgroundColor:{ref:"dataBackgroundColor"},pinnedRowTextColor:{ref:"textColor"},rowDragIndicatorColor:{ref:"rangeSelectionBorderColor"},rowDragIndicatorWidth:2,columnDragIndicatorColor:{ref:"accentColor"},columnDragIndicatorWidth:2},yc={cellBatchEditBackgroundColor:"rgba(220 181 139 / 16%)",cellBatchEditTextColor:"#422f00",rowBatchEditBackgroundColor:{ref:"cellBatchEditBackgroundColor"},rowBatchEditTextColor:{ref:"cellBatchEditTextColor"}},Sc={...yc,cellBatchEditTextColor:"#f3d0b3"},Rc=/* @__PURE__ */(()=>Gd({feature:"batchEditStyle",params:yc,css:".ag-cell-batch-edit{background-color:var(--ag-cell-batch-edit-background-color);color:var(--ag-cell-batch-edit-text-color);display:inherit}.ag-row-batch-edit{background-color:var(--ag-row-batch-edit-background-color);color:var(--ag-row-batch-edit-text-color)}"}))(),xc={buttonTextColor:"inherit",buttonFontWeight:"normal",buttonBackgroundColor:"transparent",buttonBorder:!1,buttonBorderRadius:{ref:"borderRadius"},buttonHorizontalPadding:{calc:"spacing * 2"},buttonVerticalPadding:{ref:"spacing"},buttonHoverTextColor:{ref:"buttonTextColor"},buttonHoverBackgroundColor:{ref:"buttonBackgroundColor"},buttonHoverBorder:{ref:"buttonBorder"},buttonActiveTextColor:{ref:"buttonHoverTextColor"},buttonActiveBackgroundColor:{ref:"buttonHoverBackgroundColor"},buttonActiveBorder:{ref:"buttonHoverBorder"},buttonDisabledTextColor:{ref:"inputDisabledTextColor"},buttonDisabledBackgroundColor:{ref:"inputDisabledBackgroundColor"},buttonDisabledBorder:{ref:"inputDisabledBorder"}},Fc=/* @__PURE__ */(()=>Gd({feature:"buttonStyle",params:{...xc,buttonBackgroundColor:$d,buttonBorder:!0,buttonHoverBackgroundColor:{ref:"rowHoverColor"},buttonActiveBorder:{color:Kd}},css:":where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:disabled{cursor:default}&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-button-background-color);border:var(--ag-button-border);border-radius:var(--ag-button-border-radius);color:var(--ag-button-text-color);cursor:pointer;font-weight:var(--ag-button-font-weight);padding:var(--ag-button-vertical-padding) var(--ag-button-horizontal-padding);&:active{background-color:var(--ag-button-active-background-color);border:var(--ag-button-active-border);color:var(--ag-button-active-text-color)}&:disabled{background-color:var(--ag-button-disabled-background-color);border:var(--ag-button-disabled-border);color:var(--ag-button-disabled-text-color)}}.ag-standard-button:hover{background-color:var(--ag-button-hover-background-color);border:var(--ag-button-hover-border);color:var(--ag-button-hover-text-color)}"}))(),Dc=/* @__PURE__ */(()=>Gd({feature:"columnDropStyle",css:".ag-column-drop-vertical-empty-message{align-items:center;border:dashed var(--ag-border-width);border-color:var(--ag-border-color);display:flex;inset:0;justify-content:center;margin:calc(var(--ag-spacing)*1.5) calc(var(--ag-spacing)*2);overflow:hidden;padding:calc(var(--ag-spacing)*2);position:absolute}"}))(),Mc={formulaToken1Color:"#3269c6",formulaToken1BackgroundColor:{ref:"formulaToken1Color",mix:.08},formulaToken1Border:{color:{ref:"formulaToken1Color"}},formulaToken2Color:"#c0343f",formulaToken2BackgroundColor:{ref:"formulaToken2Color",mix:.06},formulaToken2Border:{color:{ref:"formulaToken2Color"}},formulaToken3Color:"#8156b8",formulaToken3BackgroundColor:{ref:"formulaToken3Color",mix:.08},formulaToken3Border:{color:{ref:"formulaToken3Color"}},formulaToken4Color:"#007c1f",formulaToken4BackgroundColor:{ref:"formulaToken4Color",mix:.06},formulaToken4Border:{color:{ref:"formulaToken4Color"}},formulaToken5Color:"#b03e85",formulaToken5BackgroundColor:{ref:"formulaToken5Color",mix:.08},formulaToken5Border:{color:{ref:"formulaToken5Color"}},formulaToken6Color:"#b74900",formulaToken6BackgroundColor:{ref:"formulaToken6Color",mix:.06},formulaToken6Border:{color:{ref:"formulaToken6Color"}},formulaToken7Color:"#247492",formulaToken7BackgroundColor:{ref:"formulaToken7Color",mix:.08},formulaToken7Border:{color:{ref:"formulaToken7Color"}}},Pc=/* @__PURE__ */(()=>Gd({feature:"formulaStyle",params:Mc}))(),Ec={warn:(...e)=>{Et(e[0],e[1])},error:(...e)=>{Tt(e[0],e[1])},preInitErr:(...e)=>{At(e[0],e[2],e[1])}},Tc=()=>{return(e=Ec,new dc({themeLogger:e,overridePrefix:t})).withParams(bc).withPart(Fc).withPart(Dc).withPart(Rc).withPart(Pc);var e,t},Ac=/* @__PURE__ */(()=>Gd({feature:"checkboxStyle",params:{checkboxBorderWidth:1,checkboxBorderRadius:{ref:"borderRadius"},checkboxUncheckedBackgroundColor:$d,checkboxUncheckedBorderColor:Ud(.3),checkboxCheckedBackgroundColor:Kd,checkboxCheckedBorderColor:{ref:"checkboxCheckedBackgroundColor"},checkboxCheckedShapeImage:{svg:''},checkboxCheckedShapeColor:$d,checkboxIndeterminateBackgroundColor:Ud(.3),checkboxIndeterminateBorderColor:{ref:"checkboxIndeterminateBackgroundColor"},checkboxIndeterminateShapeImage:{svg:''},checkboxIndeterminateShapeColor:$d,radioCheckedShapeImage:{svg:''}},css:'.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color)}&:where(.ag-checked):after{background-color:var(--ag-checkbox-checked-shape-color)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input,.ag-radio-button-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}.ag-checkbox-input-wrapper:after,.ag-radio-button-input-wrapper:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}.ag-checkbox-input-wrapper:where(:focus-within,:active),.ag-radio-button-input-wrapper:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color)}&:where(.ag-indeterminate):after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}.ag-cell-editing-error .ag-checkbox-input-wrapper:focus-within{box-shadow:var(--ag-focus-error-shadow)}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}'}))(),Ic=()=>({..._d,...Sc,backgroundColor:"hsl(217, 0%, 17%)",foregroundColor:"#FFF",chromeBackgroundColor:Ud(.05),rowHoverColor:zd(.15),selectedRowBackgroundColor:zd(.2),menuBackgroundColor:Ud(.1),browserColorScheme:"dark",popupShadow:"0 0px 20px #000A",cardShadow:"0 1px 4px 1px #000A",advancedFilterBuilderJoinPillColor:"#7a3a37",advancedFilterBuilderColumnPillColor:"#355f2d",advancedFilterBuilderOptionPillColor:"#5a3168",advancedFilterBuilderValuePillColor:"#374c86",filterPanelApplyButtonColor:jd,findMatchColor:$d,findActiveMatchColor:$d,checkboxUncheckedBorderColor:Ud(.4),toggleButtonOffBackgroundColor:Ud(.4),rowBatchEditBackgroundColor:Ud(.1),formulaToken1Color:"#4da3e5",formulaToken2Color:"#f55864",formulaToken3Color:"#b688f2",formulaToken4Color:"#24bb4a",formulaToken5Color:"#e772ba",formulaToken6Color:"#f69b5f",formulaToken7Color:"#a3e6ff"}),kc=/* @__PURE__ */(()=>Gd({feature:"colorScheme",params:_d,modeParams:{light:_d,dark:Ic(),"dark-blue":{...Ic(),backgroundColor:"#1f2836"}}}))(),Lc={aggregation:'',arrows:'',asc:'',cancel:'',chart:'',"color-picker":'',columns:'',contracted:'',copy:'',cross:'',csv:'',cut:'',desc:'',down:'',excel:'',expanded:'',eye:'',"eye-slash":'',filter:'',first:'',grip:'',group:'',last:'',left:'',linked:'',loading:'',maximize:'',menu:'',"menu-alt":'',minimize:'',minus:'',next:'',none:'',"not-allowed":'',paste:'',pin:'',pivot:'',plus:'',previous:'',right:'',save:'',settings:'',"small-left":'',"small-right":'',tick:'',"tree-closed":'',"tree-indeterminate":'',"tree-open":'',unlinked:'',up:''},Gc={aasc:'',adesc:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"column-arrow":'',edit:'',"filter-add":'',"pinned-bottom":'',"pinned-top":'',"small-down":'',"small-up":'',"un-pin":''},Nc=(e,t=1.5)=>{const o=Gc[e];if(o)return o;const s=Lc[e];if(!s)throw new Error(`Missing icon data for ${e}`);return``+s+""},Bc=(e={})=>Gd({feature:"iconSet",css:()=>((e={})=>{let t="";for(const o of[...Object.keys(Lc),...Object.keys(Gc)]){const s=Nc(o,e.strokeWidth);t+=`.ag-icon-${o}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(s)}'); }\n`}return t})(e)}),Hc=/* @__PURE__ */Bc({strokeWidth:1}),Oc=/* @__PURE__ */Bc(),Vc={inputBackgroundColor:"transparent",inputBorder:!1,inputBorderRadius:0,inputTextColor:{ref:"textColor"},inputPlaceholderTextColor:{ref:"inputTextColor",mix:.5},inputPaddingStart:0,inputHeight:{calc:"max(iconSize, fontSize) + spacing * 2"},inputFocusBackgroundColor:{ref:"inputBackgroundColor"},inputFocusBorder:{ref:"inputBorder"},inputFocusShadow:"none",inputFocusTextColor:{ref:"inputTextColor"},inputDisabledBackgroundColor:{ref:"inputBackgroundColor"},inputDisabledBorder:{ref:"inputBorder"},inputDisabledTextColor:{ref:"inputTextColor"},inputInvalidBackgroundColor:{ref:"inputBackgroundColor"},inputInvalidBorder:{ref:"inputBorder"},inputInvalidTextColor:{ref:"inputTextColor"},inputIconColor:{ref:"inputTextColor"},pickerButtonBorder:!1,pickerButtonFocusBorder:{ref:"inputFocusBorder"},pickerButtonBackgroundColor:{ref:"backgroundColor"},pickerButtonFocusBackgroundColor:{ref:"backgroundColor"},pickerListBorder:!1,pickerListBackgroundColor:{ref:"backgroundColor"},colorPickerThumbSize:18,colorPickerTrackSize:12,colorPickerThumbBorderWidth:3,colorPickerTrackBorderRadius:12,colorPickerColorBorderRadius:4},zc=/* @__PURE__ */(()=>Gd({feature:"inputStyle",params:{...Vc,inputBackgroundColor:$d,inputBorder:!0,inputBorderRadius:{ref:"borderRadius"},inputPaddingStart:{ref:"spacing"},inputFocusBorder:{color:Kd},inputFocusShadow:{ref:"focusShadow"},inputDisabledBackgroundColor:Ud(.06),inputDisabledTextColor:{ref:"textColor",mix:.5},inputInvalidBorder:{color:{ref:"invalidColor"}},pickerButtonBorder:!0,pickerListBorder:!0},css:()=>':where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding-right:var(--ag-input-padding-start)}&:where(.ag-ltr,.ag-rtl) .ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){padding:0 var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper),:where(.ag-filter-add-select),:where(.ag-filter-filter),:where(.ag-filter-toolpanel-search),:where(.ag-floating-filter-search-icon),:where(.ag-mini-filter){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:"";display:block;height:12px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper),:where(.ag-ltr) :where(.ag-filter-add-select),:where(.ag-ltr) :where(.ag-filter-filter),:where(.ag-ltr) :where(.ag-filter-toolpanel-search),:where(.ag-ltr) :where(.ag-floating-filter-search-icon),:where(.ag-ltr) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper),:where(.ag-rtl) :where(.ag-filter-add-select),:where(.ag-rtl) :where(.ag-filter-filter),:where(.ag-rtl) :where(.ag-filter-toolpanel-search),:where(.ag-rtl) :where(.ag-floating-filter-search-icon),:where(.ag-rtl) :where(.ag-mini-filter){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}.ag-input-field-input:where(input:not([type]),input[type=text],input[type=number],input[type=tel],input[type=date],input[type=datetime-local],textarea){&:focus{box-shadow:var(--ag-focus-shadow);&:where(.invalid),&:where(:invalid){box-shadow:var(--ag-focus-error-shadow)}}}'}))(),Wc={tabBarBackgroundColor:"transparent",tabBarHorizontalPadding:0,tabBarTopPadding:0,tabBackgroundColor:"transparent",tabTextColor:{ref:"textColor"},tabHorizontalPadding:{ref:"spacing"},tabTopPadding:{ref:"spacing"},tabBottomPadding:{ref:"spacing"},tabSpacing:"0",tabHoverBackgroundColor:{ref:"tabBackgroundColor"},tabHoverTextColor:{ref:"tabTextColor"},tabSelectedBackgroundColor:{ref:"tabBackgroundColor"},tabSelectedTextColor:{ref:"tabTextColor"},tabSelectedBorderWidth:{ref:"borderWidth"},tabSelectedBorderColor:"transparent",tabSelectedUnderlineColor:"transparent",tabSelectedUnderlineWidth:0,tabSelectedUnderlineTransitionDuration:0,tabBarBorder:!1},Uc=/* @__PURE__ */(()=>Gd({feature:"tabStyle",params:{...Wc,tabBarBorder:!0,tabBarBackgroundColor:Wd(.05),tabTextColor:{ref:"textColor",mix:.7},tabSelectedTextColor:{ref:"textColor"},tabHoverTextColor:{ref:"textColor"},tabSelectedBorderColor:{ref:"borderColor"},tabSelectedBackgroundColor:$d},css:'.ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:solid var(--ag-border-width) var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative}.ag-tab:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}.ag-tab.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-ltr) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}:where(.ag-rtl) .ag-tab.ag-tab-selected:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}.ag-tab:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:"";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}.ag-tab.ag-tab-selected:after{opacity:1}'}))(),$c=/* @__PURE__ */(()=>Tc().withPart(Ac).withPart(kc).withPart(Oc).withPart(Uc).withPart(zc).withPart(Dc).withParams({fontFamily:[{googleFont:"IBM Plex Sans"},"-apple-system","BlinkMacSystemFont","Segoe UI","Roboto","Oxygen-Sans","Ubuntu"]}))(),jc=(e,t,o,s,i)=>({changeKey:e,type:t,defaultValue:o,noWarn:s,cacheDefault:i}),Kc=jc("cellHorizontalPadding","length",16),_c=jc("indentationLevel","length",0,!0,!0),qc=jc("rowGroupIndentSize","length",0),Yc=jc("rowHeight","length",42),Zc=jc("headerHeight","length",48),Qc=jc("rowBorderWidth","border",1),Xc=jc("pinnedRowBorderWidth","border",1),Jc=jc("headerRowBorderWidth","border",1);var eh=class extends ze{constructor(){super(...arguments),this.beanName="eventSvc",this.eventServiceType="global",this.globalSvc=new u}addListener(e,t,o){this.globalSvc.addEventListener(e,t,o)}removeListener(e,t,o){this.globalSvc.removeEventListener(e,t,o)}addGlobalListener(e,t=!1){this.globalSvc.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalSvc.removeGlobalListener(e,t)}dispatchEvent(e){this.globalSvc.dispatchEvent(this.gos.addCommon(e))}dispatchEventOnce(e){this.globalSvc.dispatchEventOnce(this.gos.addCommon(e))}};function th(e,t,o){const s=e.visibleCols.headerGroupRowCount;if(o>=s)return{column:t,headerRowIndex:o};let i=t.getParent();for(;i&&i.getProvidedColumnGroup().getLevel()>o;)i=i.getParent();const n=t.isSpanHeaderHeight();return!i||n&&i.isPadding()?{column:t,headerRowIndex:s}:{column:i,headerRowIndex:i.getProvidedColumnGroup().getLevel()}}var oh=/* @__PURE__ */new Set(["gridPreDestroyed","fillStart","pasteStart"]),sh=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","pinnedRowsChanged","rangeSelectionChanged","cellSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","cellSelectionDeleteStart","cellSelectionDeleteEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterUiChanged","filterOpened","floatingFilterUiChanged","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","dragCancelled","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd","rowDragCancel","findChanged","rowResizeStarted","rowResizeEnded","columnsReset","bulkEditingStarted","bulkEditingStopped","batchEditingStarted","batchEditingStopped"].reduce((e,t)=>{var o;return e[t]=!(o=t)||o.length<2?o:"on"+o[0].toUpperCase()+o.substring(1),e},{}),ih={agSetColumnFilter:"SetFilter",agSetColumnFloatingFilter:"SetFilter",agMultiColumnFilter:"MultiFilter",agMultiColumnFloatingFilter:"MultiFilter",agGroupColumnFilter:"GroupFilter",agGroupColumnFloatingFilter:"GroupFilter",agGroupCellRenderer:"GroupCellRenderer",agGroupRowRenderer:"GroupCellRenderer",agRichSelect:"RichSelect",agRichSelectCellEditor:"RichSelect",agDetailCellRenderer:"SharedMasterDetail",agSparklineCellRenderer:"Sparklines",agDragAndDropImage:"SharedDragAndDrop",agColumnHeader:"ColumnHeaderComp",agColumnGroupHeader:"ColumnGroupHeaderComp",agSortIndicator:"Sort",agAnimateShowChangeCellRenderer:"HighlightChanges",agAnimateSlideCellRenderer:"HighlightChanges",agLoadingCellRenderer:"LoadingCellRenderer",agSkeletonCellRenderer:"SkeletonCellRenderer",agCheckboxCellRenderer:"CheckboxCellRenderer",agLoadingOverlay:"Overlay",agExportingOverlay:"Overlay",agNoRowsOverlay:"Overlay",agNoMatchingRowsOverlay:"Overlay",agTooltipComponent:"Tooltip",agReadOnlyFloatingFilter:"CustomFilter",agTextColumnFilter:"TextFilter",agNumberColumnFilter:"NumberFilter",agBigIntColumnFilter:"BigIntFilter",agDateColumnFilter:"DateFilter",agDateInput:"DateFilter",agTextColumnFloatingFilter:"TextFilter",agNumberColumnFloatingFilter:"NumberFilter",agBigIntColumnFloatingFilter:"BigIntFilter",agDateColumnFloatingFilter:"DateFilter",agFormulaCellEditor:"Formula",agCellEditor:"TextEditor",agSelectCellEditor:"SelectEditor",agTextCellEditor:"TextEditor",agNumberCellEditor:"NumberEditor",agDateCellEditor:"DateEditor",agDateStringCellEditor:"DateEditor",agCheckboxCellEditor:"CheckboxEditor",agLargeTextCellEditor:"LargeTextEditor",agMenuItem:"MenuItem",agColumnsToolPanel:"ColumnsToolPanel",agFiltersToolPanel:"FiltersToolPanel",agNewFiltersToolPanel:"NewFiltersToolPanel",agAggregationComponent:"StatusBar",agSelectedRowCountComponent:"StatusBar",agTotalRowCountComponent:"StatusBar",agFilteredRowCountComponent:"StatusBar",agTotalAndFilteredRowCountComponent:"StatusBar",agFindCellRenderer:"Find"};function nh(e){return`"${e}"`}var rh={allowFormula:"Formula",aggFunc:"SharedAggregation",autoHeight:"RowAutoHeight",cellClass:"CellStyle",cellClassRules:"CellStyle",cellEditor:({cellEditor:e,editable:t,...o})=>{const s=o.groupRowEditable;return t||s?"string"==typeof e?ih[e]??"CustomEditor":"CustomEditor":null},cellRenderer:({cellRenderer:e})=>"string"!=typeof e?null:ih[e],cellStyle:"CellStyle",columnChooserParams:"ColumnMenu",contextMenuItems:"ContextMenu",dndSource:"DragAndDrop",dndSourceOnRowDrag:"DragAndDrop",editable:({editable:e,cellEditor:t})=>e&&!t?"TextEditor":null,enableCellChangeFlash:"HighlightChanges",enablePivot:"SharedPivot",enableRowGroup:"SharedRowGrouping",enableValue:"SharedAggregation",filter:({filter:e})=>e&&"string"!=typeof e&&"boolean"!=typeof e?"CustomFilter":"string"==typeof e?ih[e]??"ColumnFilter":"ColumnFilter",floatingFilter:"ColumnFilter",getQuickFilterText:"QuickFilter",headerTooltip:"Tooltip",headerTooltipValueGetter:"Tooltip",mainMenuItems:"ColumnMenu",menuTabs:e=>{const t=["columnsMenuTab","generalMenuTab"];return e.menuTabs?.some(e=>t.includes(e))?"ColumnMenu":null},pivot:"SharedPivot",pivotIndex:"SharedPivot",rowDrag:"RowDrag",rowGroup:"SharedRowGrouping",rowGroupIndex:"SharedRowGrouping",tooltipField:"Tooltip",tooltipValueGetter:"Tooltip",tooltipComponentSelector:"Tooltip",spanRows:"CellSpan",groupHierarchy:"SharedRowGrouping"},ah={headerName:void 0,columnGroupShow:void 0,headerStyle:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,headerTooltipValueGetter:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,groupRowEditable:void 0,groupRowValueSetter:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,spanRows:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,tooltipComponentSelector:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0,dateComponent:void 0,dateComponentParams:void 0,getFindText:void 0,rowGroupingHierarchy:void 0,groupHierarchy:void 0,allowFormula:void 0},lh=["overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","treeDataChildrenField","treeDataParentIdField","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","invalidEditValueMode","grandTotalRow","themeCssLayer","findSearchValue","styleNonce","renderingMode"],dh=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","activeOverlayParams","popupParent","themeStyleContainer","statusBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterParent","advancedFilterBuilderParams","advancedFilterParams","formulaDataSource","formulaFuncs","initialState","autoSizeStrategy","selectionColumnDef","findOptions","filterHandlers","groupHierarchyConfig"],ch=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector","suppressOverlays"],hh=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipSwitchShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns","rowDragInsertDelay"],uh=["theme","rowSelection"],gh=["cellSelection","sideBar","rowNumbers","suppressGroupChangesColumnVisibility","groupAggFiltering","suppressStickyTotalRow","groupHideParentOfSingleChild","enableRowPinning"],ph=["loadThemeGoogleFonts","suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","allowContextMenuWithControlKey","suppressContextMenu","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","enableCellSpan","suppressClickEdit","rowDragEntireRow","rowDragManaged","refreshAfterGroupEdit","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault","enableFilterHandlers","suppressStartEditOnTab","hidePaddedHeaderRows","ssrmExpandAllAffectsAllRows","animateColumnResizing"],mh=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","overlayComponent","loadingOverlayComponent","noRowsOverlayComponent","overlayComponentSelector","activeOverlay","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getFullRowEditValidationErrors","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","loadingCellRendererSelector","getRowId","chartMenuItems","groupTotalRow","alwaysPassFilter","isRowPinnable","isRowPinned","isRowValidDropPosition"];function fh(e,t,o){return"number"==typeof t||null==t?null==t||t>=o?null:`${e}: value should be greater than or equal to ${o}`:`${e}: value should be a number`}var Ch={alignedGrids:"AlignedGrids",allowContextMenuWithControlKey:"ContextMenu",autoSizeStrategy:"ColumnAutoSize",cellSelection:"CellSelection",columnHoverHighlight:"ColumnHover",datasource:"InfiniteRowModel",doesExternalFilterPass:"ExternalFilter",editType:"EditCore",invalidEditValueMode:"EditCore",enableAdvancedFilter:"AdvancedFilter",enableCellSpan:"CellSpan",enableCharts:"IntegratedCharts",enableRangeSelection:"CellSelection",enableRowPinning:"PinnedRow",findSearchValue:"Find",getFullRowEditValidationErrors:"EditCore",getContextMenuItems:"ContextMenu",getLocaleText:"Locale",getMainMenuItems:"ColumnMenu",getRowClass:"RowStyle",getRowStyle:"RowStyle",groupTotalRow:"SharedRowGrouping",grandTotalRow:"ClientSideRowModelHierarchy",initialState:"GridState",isExternalFilterPresent:"ExternalFilter",isRowPinnable:"PinnedRow",isRowPinned:"PinnedRow",localeText:"Locale",masterDetail:"SharedMasterDetail",pagination:"Pagination",pinnedBottomRowData:"PinnedRow",pinnedTopRowData:"PinnedRow",pivotMode:"SharedPivot",pivotPanelShow:"RowGroupingPanel",quickFilterText:"QuickFilter",rowClass:"RowStyle",rowClassRules:"RowStyle",rowData:"ClientSideRowModel",rowDragManaged:"RowDrag",refreshAfterGroupEdit:["RowGrouping","TreeData"],rowGroupPanelShow:"RowGroupingPanel",rowNumbers:"RowNumbers",rowSelection:"SharedRowSelection",rowStyle:"RowStyle",serverSideDatasource:"ServerSideRowModel",sideBar:"SideBar",statusBar:"StatusBar",treeData:"SharedTreeData",undoRedoCellEditing:"UndoRedoEdit",valueCache:"ValueCache",viewportDatasource:"ViewportRowModel"},vh=()=>{const e={autoSizePadding:{validate:({autoSizePadding:e})=>fh("autoSizePadding",e,0)},cacheBlockSize:{supportedRowModels:["serverSide","infinite"],validate:({cacheBlockSize:e})=>fh("cacheBlockSize",e,1)},cacheOverflowSize:{validate:({cacheOverflowSize:e})=>fh("cacheOverflowSize",e,1)},datasource:{supportedRowModels:["infinite"]},domLayout:{validate:e=>{const t=e.domLayout,o=["autoHeight","normal","print"];return t&&!o.includes(t)?`domLayout must be one of [${o.join()}], currently it's ${t}`:null}},enableFillHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableRangeHandle:{dependencies:{enableRangeSelection:{required:[!0]}}},enableRangeSelection:{dependencies:{rowDragEntireRow:{required:[!1,void 0]}}},enableRowPinning:{supportedRowModels:["clientSide"],validate:({enableRowPinning:e,pinnedTopRowData:t,pinnedBottomRowData:o})=>e&&(t||o)?"Manual row pinning cannot be used together with pinned row data. Either set `enableRowPinning` to `false`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.":null},isRowPinnable:{supportedRowModels:["clientSide"],validate:({enableRowPinning:e,isRowPinnable:t,pinnedTopRowData:o,pinnedBottomRowData:s})=>t&&(o||s)?"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinnable`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.":!e&&t?"`isRowPinnable` requires `enableRowPinning` to be set.":null},isRowPinned:{supportedRowModels:["clientSide"],validate:({enableRowPinning:e,isRowPinned:t,pinnedTopRowData:o,pinnedBottomRowData:s})=>t&&(o||s)?"Manual row pinning cannot be used together with pinned row data. Either remove `isRowPinned`, or remove `pinnedTopRowData` and `pinnedBottomRowData`.":!e&&t?"`isRowPinned` requires `enableRowPinning` to be set.":null},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupHideOpenParents:{supportedRowModels:["clientSide","serverSide"],dependencies:{groupTotalRow:{required:[void 0,"bottom"]},treeData:{required:[void 0,!1],reason:"Tree Data has values at the group level so it doesn't make sense to hide them."}}},groupHideParentOfSingleChild:{dependencies:{groupHideOpenParents:{required:[void 0,!1]}}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveSingleChildren:{required:[void 0,!1]}}},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:{required:[void 0,!1]},groupRemoveLowestSingleChildren:{required:[void 0,!1]}}},groupSelectsChildren:{dependencies:{rowSelection:{required:["multiple"]}}},groupHierarchyConfig:{validate({groupHierarchyConfig:e={}},t,o){for(const s of Object.keys(e))o.validation?.validateColDef(e[s]);return null}},icons:{validate:({icons:e})=>{if(e){if(e.smallDown)return It(262);if(e.smallLeft)return It(263);if(e.smallRight)return It(264)}return null}},infiniteInitialRowCount:{validate:({infiniteInitialRowCount:e})=>fh("infiniteInitialRowCount",e,1)},initialGroupOrderComparator:{supportedRowModels:["clientSide"]},ssrmExpandAllAffectsAllRows:{validate:e=>{if("boolean"==typeof e.ssrmExpandAllAffectsAllRows){if("serverSide"!==e.rowModelType)return"'ssrmExpandAllAffectsAllRows' is only supported with the Server Side Row Model.";if(e.ssrmExpandAllAffectsAllRows&&"function"!=typeof e.getRowId)return"'getRowId' callback must be provided for Server Side Row Model grouping to work correctly."}return null}},keepDetailRowsCount:{validate:({keepDetailRowsCount:e})=>fh("keepDetailRowsCount",e,1)},paginationPageSize:{validate:({paginationPageSize:e})=>fh("paginationPageSize",e,1)},paginationPageSizeSelector:{validate:e=>{const t=e.paginationPageSizeSelector;return"boolean"==typeof t||null==t||t.length?null:"'paginationPageSizeSelector' cannot be an empty array.\n If you want to hide the page size selector, set paginationPageSizeSelector to false."}},pivotMode:{dependencies:{treeData:{required:[!1,void 0],reason:"Pivot Mode is not supported with Tree Data."}}},quickFilterText:{supportedRowModels:["clientSide"]},rowBuffer:{validate:({rowBuffer:e})=>fh("rowBuffer",e,0)},rowClass:{validate:e=>"function"==typeof e.rowClass?"rowClass should not be a function, please use getRowClass instead":null},rowData:{supportedRowModels:["clientSide"]},rowDragManaged:{supportedRowModels:["clientSide"],dependencies:{pagination:{required:[!1,void 0]}}},rowSelection:{validate:({rowSelection:e})=>e&&"string"==typeof e?'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.':e&&"object"!=typeof e?"Expected `RowSelectionOptions` object for the `rowSelection` property.":e&&"multiRow"!==e.mode&&"singleRow"!==e.mode?`Selection mode "${e.mode}" is invalid. Use one of 'singleRow' or 'multiRow'.`:null},rowStyle:{validate:e=>{const t=e.rowStyle;return t&&"function"==typeof t?"rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead":null}},serverSideDatasource:{supportedRowModels:["serverSide"]},serverSideInitialRowCount:{supportedRowModels:["serverSide"],validate:({serverSideInitialRowCount:e})=>fh("serverSideInitialRowCount",e,1)},serverSideOnlyRefreshFilteredGroups:{supportedRowModels:["serverSide"]},serverSideSortAllLevels:{supportedRowModels:["serverSide"]},sortingOrder:{validate:e=>{const t=e.sortingOrder;if(Array.isArray(t)&&t.length>0){const e=t.filter(e=>!Po(e));if(e.length>0)return`sortingOrder must be an array of type (SortDirection | SortDef)[], incorrect items are: ${e.map(e=>"string"==typeof e||null==e?Ft(e):JSON.stringify(e))}]`}else if(!Array.isArray(t)||!t.length)return`sortingOrder must be an array with at least one element, currently it's ${t}`;return null}},tooltipHideDelay:{validate:e=>e.tooltipHideDelay&&e.tooltipHideDelay<0?"tooltipHideDelay should not be lower than 0":null},tooltipShowDelay:{validate:e=>e.tooltipShowDelay&&e.tooltipShowDelay<0?"tooltipShowDelay should not be lower than 0":null},tooltipSwitchShowDelay:{validate:e=>e.tooltipSwitchShowDelay&&e.tooltipSwitchShowDelay<0?"tooltipSwitchShowDelay should not be lower than 0":null},treeData:{supportedRowModels:["clientSide","serverSide"],validate:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const{treeDataChildrenField:t,treeDataParentIdField:o,getDataPath:s,getRowId:i}=e;if(!t&&!o&&!s)return"treeData requires either 'treeDataChildrenField' or 'treeDataParentIdField' or 'getDataPath' in the clientSide row model.";if(t){if(s)return"Cannot use both 'treeDataChildrenField' and 'getDataPath' at the same time.";if(o)return"Cannot use both 'treeDataChildrenField' and 'treeDataParentIdField' at the same time."}if(o){if(!i)return"getRowId callback not provided, tree data with parent id cannot be built.";if(s)return"Cannot use both 'treeDataParentIdField' and 'getDataPath' at the same time."}return null}case"serverSide":{const o=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:o}}return null}},viewportDatasource:{supportedRowModels:["viewport"]},viewportRowModelBufferSize:{validate:({viewportRowModelBufferSize:e})=>fh("viewportRowModelBufferSize",e,0)},viewportRowModelPageSize:{validate:({viewportRowModelPageSize:e})=>fh("viewportRowModelPageSize",e,1)},rowDragEntireRow:{dependencies:{cellSelection:{required:[void 0]}}},autoGroupColumnDef:{validate:({autoGroupColumnDef:e,showOpenedGroup:t})=>e?.field&&t?"autoGroupColumnDef.field and showOpenedGroup are not supported when used together.":e?.valueGetter&&t?"autoGroupColumnDef.valueGetter and showOpenedGroup are not supported when used together.":null},renderingMode:{validate:e=>{const t=e.renderingMode,o=["default","legacy"];return t&&!o.includes(t)?`renderingMode must be one of [${o.join()}], currently it's ${t}`:null}},autoSizeStrategy:{validate:({autoSizeStrategy:e})=>{if(!e)return null;const t=e.type;return"fitCellContents"!==t&&"fitGridWidth"!==t&&"fitProvidedWidth"!==t?`Invalid Auto-size strategy. \`autoSizeStrategy\` must be one of ${["fitCellContents","fitGridWidth","fitProvidedWidth"].map(e=>'"'+e+'"').join(", ")}, currently it's ${t}`:"fitProvidedWidth"===t&&"number"!=typeof e.width?`When using the 'fitProvidedWidth' auto-size strategy, must provide a numeric \`width\`. You provided ${e.width}`:null}}},t={};for(const o of ph)t[o]={expectedType:"boolean"};for(const o of hh)t[o]={expectedType:"number"};return Xe(t,e),t},wh=0,bh=0,yh="__ag_grid_instance";var Sh=class extends We{constructor(e,t){super(),this.column=e,this.eGui=t,this.lastMovingChanged=0}postConstruct(){this.addManagedElementListeners(this.eGui,{click:e=>e&&this.onClick(e)}),this.addManagedListeners(this.column,{movingChanged:()=>{this.lastMovingChanged=Date.now()}})}onClick(e){const{sortSvc:t,rangeSvc:o,gos:s}=this.beans;if(ao(s)&&!e.altKey)o?.handleColumnSelection(this.column,e);else if(this.column.isSortable()){const o=this.column.isMoving(),s=Date.now()-this.lastMovingChanged<50;o||s||t?.progressSortFromEvent(this.column,e)}}};var Rh=class extends We{constructor(e,t){super(),this.eLabel=e,this.columnGroup=t,this.isSticky=!1,this.left=null,this.right=null}postConstruct(){const{columnGroup:e,beans:t}=this,{ctrlsSvc:o}=t;o.whenReady(this,()=>{const t=this.refreshPosition.bind(this);null==e.getPinned()&&this.addManagedEventListeners({bodyScroll:e=>{"horizontal"===e.direction&&this.updateSticky(e.left)}}),this.addManagedListeners(e,{leftChanged:t,displayedChildrenChanged:t}),this.addManagedEventListeners({columnResized:t}),this.refreshPosition()})}refreshPosition(){const{columnGroup:e,beans:t}=this,o=e.getLeft(),s=e.getActualWidth();if(null==o||0===s)return this.left=null,this.right=null,void this.setSticky(!1);this.left=o,this.right=o+s;const i=t.colViewport.getScrollPosition();null!=i&&this.updateSticky(i)}updateSticky(e){const{beans:t,left:o,right:s}=this;if(null==o||null==s)return void this.setSticky(!1);const{gos:i,visibleCols:n}=t,r=i.get("enableRtl")?n.bodyWidth-e:e;this.setSticky(or)}setSticky(e){const{isSticky:t,eLabel:o}=this;t!==e&&(this.isSticky=e,o.classList.toggle("ag-sticky-label",e))}},xh={tag:"div",cls:"ag-header-group-cell-label",role:"presentation",children:[{tag:"span",ref:"agLabel",cls:"ag-header-group-text",role:"presentation"},{tag:"span",ref:"agOpened",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"},{tag:"span",ref:"agClosed",cls:"ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"}]},Fh={moduleName:"ColumnHeaderComp",version:vt,userComponents:{agColumnHeader:class extends ni{constructor(){super(...arguments),this.eFilter=null,this.eFilterButton=null,this.eSortIndicator=null,this.eMenu=null,this.eLabel=null,this.eText=null,this.eColRef=null,this.eSortOrder=null,this.eSortAsc=null,this.eSortDesc=null,this.eSortMixed=null,this.eSortNone=null,this.eSortAbsoluteAsc=null,this.eSortAbsoluteDesc=null,this.isLoadingInnerComponent=!1}refresh(e){const t=this.params;if(this.params=e,this.workOutTemplate(e,!!this.beans?.sortSvc)!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||e.enableSorting!=this.currentSort||e.column.formulaRef!=this.currentRef||null!=this.currentSuppressMenuHide&&this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon)return!1;if(this.innerHeaderComponent){const t={...e};Xe(t,e.innerHeaderComponentParams),this.innerHeaderComponent.refresh?.(t)}else this.setDisplayName(e);return!0}workOutTemplate(e,t){const{formula:o}=this.beans,s=e.template;return s?s?.trim?s.trim():s:function(e,t){const o={"aria-hidden":"true"};return{tag:"div",cls:"ag-cell-label-container",role:"presentation",children:[{tag:"span",ref:"eMenu",cls:"ag-header-icon ag-header-cell-menu-button",attrs:o},{tag:"span",ref:"eFilterButton",cls:"ag-header-icon ag-header-cell-filter-button",attrs:o},{tag:"div",ref:"eLabel",cls:"ag-header-cell-label",role:"presentation",children:[e?{tag:"span",ref:"eColRef",cls:"ag-header-col-ref"}:null,{tag:"span",ref:"eText",cls:"ag-header-cell-text"},{tag:"span",ref:"eFilter",cls:"ag-header-icon ag-header-label-icon ag-filter-icon",attrs:o},t?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:null]}]}}(!!o?.active,t)}init(e){this.params=e;const{sortSvc:t,touchSvc:o,rowNumbersSvc:s,userCompFactory:i}=this.beans,n=t?.getSortIndicatorSelector();this.currentTemplate=this.workOutTemplate(e,!!n),this.setTemplate(this.currentTemplate,n?[n]:void 0),this.eLabel&&(this.mouseListener??(this.mouseListener=this.createManagedBean(new Sh(e.column,this.eLabel)))),o?.setupForHeader(this),this.setMenu(),this.setupSort(),this.setupColumnRefIndicator(),s?.setupForHeader(this),this.setupFilterIcon(),this.setupFilterButton(),this.workOutInnerHeaderComponent(i,e),this.setDisplayName(e)}workOutInnerHeaderComponent(e,t){const o=function(e,t,o){return e.getCompDetails(t,ui,void 0,o)}(e,t,t);o&&(this.isLoadingInnerComponent=!0,o.newAgStackInstance().then(e=>{this.isLoadingInnerComponent=!1,e&&(this.isAlive()?(this.innerHeaderComponent=e,this.eText&&this.eText.appendChild(e.getGui())):this.destroyBean(e))}))}setDisplayName(e){const{displayName:t}=e,o=this.currentDisplayName;this.currentDisplayName=t,!this.eText||o===t||this.innerHeaderComponent||this.isLoadingInnerComponent||(this.eText.textContent=m(t))}addInIcon(e,t,o){const s=ei(e,this.beans,o);s&&t.appendChild(s)}workOutShowMenu(){return this.params.enableMenu&&!!this.beans.menuSvc?.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return!!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return ne(this.eMenu),void(this.eMenu=void 0);const{gos:e,eMenu:t,params:o}=this,s=Co(e);this.addInIcon(s?"menu":"menuAlt",t,o.column),t.classList.toggle("ag-header-menu-icon",!s);const i=this.shouldSuppressMenuHide();this.currentSuppressMenuHide=i,this.addManagedElementListeners(t,{click:()=>this.showColumnMenu(this.eMenu)}),this.toggleMenuAlwaysShow(i)}toggleMenuAlwaysShow(e){this.eMenu?.classList.toggle("ag-header-menu-always-show",e)}showColumnMenu(e){const{currentSuppressMenuHide:t,params:o}=this;t||this.toggleMenuAlwaysShow(!0),o.showColumnMenu(e,()=>{t||this.toggleMenuAlwaysShow(!1)})}onMenuKeyboardShortcut(e){const{params:t,gos:o,beans:s,eMenu:i,eFilterButton:n}=this,r=t.column,a=Co(o);if(e&&!a){if(s.menuSvc?.isFilterMenuInHeaderEnabled(r))return t.showFilter(n??i??this.getGui()),!0}else if(t.enableMenu)return this.showColumnMenu(i??n??this.getGui()),!0;return!1}setupSort(){const{sortSvc:e}=this.beans;if(!e)return;const{enableSorting:t,column:o}=this.params;if(this.currentSort=t,!this.eSortIndicator){this.eSortIndicator=this.createBean(e.createSortIndicator(!0));const{eSortIndicator:t,eSortOrder:o,eSortAsc:s,eSortDesc:i,eSortMixed:n,eSortNone:r,eSortAbsoluteAsc:a,eSortAbsoluteDesc:l}=this;t.attachCustomElements(o,s,i,n,r,a,l)}this.eSortIndicator.setupSort(o),this.currentSort&&e.setupHeader(this,o)}setupColumnRefIndicator(){const{eColRef:e,beans:{editModelSvc:t},params:o}=this;e&&(this.currentRef=o.column.formulaRef,e.textContent=this.currentRef,_(e,!1),this.addManagedEventListeners({cellEditingStarted:()=>{const o=t?.getEditPositions();_(e,!!this.currentRef&&!!o?.some(e=>e.column.isAllowFormula()))},cellEditingStopped:()=>{_(e,!1)}}))}setupFilterIcon(){const{eFilter:e,params:t}=this;if(!e)return;this.configureFilter(t.enableFilterIcon,e,()=>{_(e,t.column.isFilterActive(),{skipAriaHidden:!0})},"filterActive")}setupFilterButton(){const{eFilterButton:e,params:t}=this;e&&(this.configureFilter(t.enableFilterButton,e,this.onFilterChangedButton.bind(this),"filter")?this.addManagedElementListeners(e,{click:()=>t.showFilter(e)}):this.eFilterButton=void 0)}configureFilter(e,t,o,s){if(!e)return ne(t),!1;const i=this.params.column;return this.addInIcon(s,t,i),this.addManagedListeners(i,{filterChanged:o}),o(),!0}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){const{eFilterButton:t,eMenu:o}=this;return e?t??o??this.getGui():o??t??this.getGui()}destroy(){super.destroy(),this.innerHeaderComponent=this.destroyBean(this.innerHeaderComponent),this.mouseListener=this.destroyBean(this.mouseListener)}}},icons:{menu:"menu",menuAlt:"menu-alt"}},Dh={moduleName:"ColumnGroupHeaderComp",version:vt,userComponents:{agColumnGroupHeader:class extends ni{constructor(){super(xh),this.agOpened=null,this.agClosed=null,this.agLabel=null,this.isLoadingInnerComponent=!1}init(e){const{userCompFactory:t,touchSvc:o}=this.beans;this.params=e,this.checkWarnings(),this.workOutInnerHeaderGroupComponent(t,e),this.setupLabel(e),this.addGroupExpandIcon(e),this.setupExpandIcons(),o?.setupForHeaderGroup(this)}checkWarnings(){this.params.template&&Et(89)}workOutInnerHeaderGroupComponent(e,t){const o=function(e,t,o){return e.getCompDetails(t,gi,void 0,o)}(e,t,t);o&&(this.isLoadingInnerComponent=!0,o.newAgStackInstance().then(e=>{this.isLoadingInnerComponent=!1,e&&(this.isAlive()?(this.innerHeaderGroupComponent=e,this.agLabel.appendChild(e.getGui())):this.destroyBean(e))}))}setupExpandIcons(){const{agOpened:e,agClosed:t,params:{columnGroup:o},beans:{colGroupSvc:s}}=this;this.addInIcon("columnGroupOpened",e),this.addInIcon("columnGroupClosed",t);const i=e=>{if(Sn(e))return;const t=!o.isExpanded();s.setColumnGroupOpened(o.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(t,i),this.addTouchAndClickListeners(e,i);const n=e=>{yn(e)};this.addManagedElementListeners(t,{dblclick:n}),this.addManagedElementListeners(e,{dblclick:n}),this.addManagedElementListeners(this.getGui(),{dblclick:i}),this.updateIconVisibility();const r=o.getProvidedColumnGroup(),a=this.updateIconVisibility.bind(this);this.addManagedListeners(r,{expandedChanged:a,expandableChanged:a})}addTouchAndClickListeners(e,t){this.beans.touchSvc?.setupForHeaderGroupElement(this,e,t),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){const{agOpened:e,agClosed:t,params:{columnGroup:o}}=this;if(o.isExpandable()){const s=o.isExpanded();_(e,s),_(t,!s)}else _(e,!1),_(t,!1)}addInIcon(e,t){const o=ei(e,this.beans,null);o&&t.appendChild(o)}addGroupExpandIcon(e){if(!e.columnGroup.isExpandable()){const{agOpened:e,agClosed:t}=this;_(e,!1),_(t,!1)}}setupLabel(e){const{displayName:t,columnGroup:o}=e,{innerHeaderGroupComponent:s,isLoadingInnerComponent:i}=this,n=s||i;a(t)&&!n&&(this.agLabel.textContent=m(t)),o.getColGroupDef()?.suppressStickyLabel||this.createManagedBean(new Rh(this.getGui(),o))}destroy(){super.destroy(),this.innerHeaderGroupComponent&&(this.destroyBean(this.innerHeaderGroupComponent),this.innerHeaderGroupComponent=void 0)}}},icons:{columnGroupOpened:"expanded",columnGroupClosed:"contracted"}},Mh={moduleName:"AnimationFrame",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="animationFrameSvc",this.p1={list:[],sorted:!1},this.p2={list:[],sorted:!1},this.f1={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastScrollTop=0,this.taskCount=0}setScrollTop(e){this.scrollGoingDown=e>=this.lastScrollTop,0===e&&(this.scrollGoingDown=!0),this.lastScrollTop=e}postConstruct(){this.active=!this.gos.get("suppressAnimationFrame"),this.batchFrameworkComps=this.beans.frameworkOverrides.batchFrameworkComps}verify(){!1===this.active&&Et(92)}createTask(e,t,o,s,i=!1){this.verify();let n=o;s&&this.batchFrameworkComps&&(n="f1");const r={task:e,index:t,createOrder:++this.taskCount,deferred:i};this.addTaskToList(this[n],r),this.schedule()}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((e,o)=>e.deferred!==o.deferred?e.deferred?-1:1:e.index!==o.index?t*(o.index-e.index):o.createOrder-e.createOrder),e.sorted=!0}addDestroyTask(e){this.verify(),this.destroyTasks.push(e),this.schedule()}executeFrame(e){const{p1:t,p2:o,f1:s,destroyTasks:i,beans:n}=this,{ctrlsSvc:r,frameworkOverrides:a}=n,l=t.list,d=o.list,c=s.list,h=Date.now();let u=0;const g=e<=0,p=r.getScrollFeature();for(;g||u{for(;(g||u{};else{if(!i.length)break;n=i.pop()}n()}u=Date.now()-h}l.length||d.length||c.length||i.length?this.requestFrame():this.ticking=!1}flushAllFrames(){this.active&&this.executeFrame(-1)}schedule(){this.active&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);ye(this.beans,e)}isQueueEmpty(){return!this.ticking}}]},Ph={moduleName:"Touch",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="touchSvc"}mockBodyContextMenu(e,t){this.mockContextMenu(e,e.eBodyViewport,t)}mockHeaderContextMenu(e,t){this.mockContextMenu(e,e.eGui,t)}mockRowContextMenu(e){if(!sn())return;this.mockContextMenu(e,e.element,(t,o,s)=>{const{rowCtrl:i,cellCtrl:n}=e.getControlsForEventTarget(s?.target??null);n?.column&&n.dispatchCellContextMenuEvent(s??null),this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0,s,i,n)})}handleCellDoubleClick(e,t){return!!(()=>{if(!sn()||Ee("dblclick"))return!1;const t=Date.now(),o=t-e.lastIPadMouseClickEvent<200;return e.lastIPadMouseClickEvent=t,o})()&&(e.onCellDoubleClicked(t),t.preventDefault(),!0)}setupForHeader(e){const{gos:t,sortSvc:o,menuSvc:s}=this.beans;if(t.get("suppressTouch"))return;const{params:i,eMenu:n,eFilterButton:r}=e,l=new Br(e.getGui(),!0);e.addDestroyFunc(()=>l.destroy());const d=e.shouldSuppressMenuHide(),c=d&&a(n)&&i.enableMenu;let h=l;if(c&&(h=new Br(n,!0),e.addDestroyFunc(()=>h.destroy())),i.enableMenu||s?.isHeaderContextMenuEnabled(i.column)){const t=c?"tap":"longTap",o=e=>i.showColumnMenuAfterMouseClick(e.touchStart);e.addManagedListeners(h,{[t]:o}),e.addManagedListeners(l,{longTap:o})}if(i.enableSorting){const t=e=>{const t=e.touchStart.target;d&&(n?.contains(t)||r?.contains(t))||o?.progressSort(i.column,!1,"uiColumnSorted")};e.addManagedListeners(l,{tap:t})}if(i.enableFilterButton&&r){const t=new Br(r,!0);e.addManagedListeners(t,{tap:()=>i.showFilter(r)}),e.addDestroyFunc(()=>t.destroy())}}setupForHeaderGroup(e){const t=e.params;if(this.beans.menuSvc?.isHeaderContextMenuEnabled(t.columnGroup.getProvidedColumnGroup())){const o=new Br(t.eGridHeader,!0),s=e=>t.showColumnMenuAfterMouseClick(e.touchStart);e.addManagedListeners(o,{longTap:s}),e.addDestroyFunc(()=>o.destroy())}}setupForHeaderGroupElement(e,t,o){const s=new Br(t,!0);e.addManagedListeners(s,{tap:o}),e.addDestroyFunc(()=>s.destroy())}mockContextMenu(e,t,o){if(!sn())return;const s=new Br(t);e.addManagedListeners(s,{longTap:e=>{Le(this.beans,e.touchEvent)&&o(void 0,e.touchStart,e.touchEvent)}}),e.addDestroyFunc(()=>s.destroy())}}]};function Eh(e){const t=e;return null!=t?.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}var Th=class{constructor(){this.cellValidations=/* @__PURE__ */new Map}getCellValidation(e){const{rowNode:t,column:o}=e||{};return this.cellValidations?.get(t)?.get(o)}hasCellValidation(e){return e?.rowNode&&e.column?!!this.getCellValidation(e):this.cellValidations.size>0}setCellValidation(e,t){const{rowNode:o,column:s}=e;this.cellValidations.has(o)||this.cellValidations.set(o,/* @__PURE__ */new Map),this.cellValidations.get(o).set(s,t)}clearCellValidation(e){const{rowNode:t,column:o}=e;this.cellValidations.get(t)?.delete(o)}setCellValidationMap(e){this.cellValidations=e}getCellValidationMap(){return this.cellValidations}clearCellValidationMap(){this.cellValidations.clear()}},Ah=class{constructor(){this.rowValidations=/* @__PURE__ */new Map}getRowValidation(e){const{rowNode:t}=e||{};return this.rowValidations.get(t)}hasRowValidation(e){return e?.rowNode?!!this.getRowValidation(e):this.rowValidations.size>0}setRowValidation({rowNode:e},t){this.rowValidations.set(e,t)}clearRowValidation({rowNode:e}){this.rowValidations.delete(e)}setRowValidationMap(e){this.rowValidations=e}getRowValidationMap(){return this.rowValidations}clearRowValidationMap(){this.rowValidations.clear()}};function Ih(e,t={}){const{rowIndex:o,rowId:s,rowCtrl:i,rowPinned:n}=t;if(i)return i;const{rowModel:r,rowRenderer:a}=e;let{rowNode:l}=t;return l||(s?l=function(e,t,o){const{rowModel:s,pinnedRowModel:i}=e;let n;return n??(n=s?.getRowNode(t)),o?n??(n=i?.getPinnedRowById(t,o)):(n??(n=i?.getPinnedRowById(t,"top")),n??(n=i?.getPinnedRowById(t,"bottom"))),n}(e,s,n):null!=o&&(l=r.getRow(o))),a.getRowCtrls(l?[l]:[])?.[0]}function kh(e,t={}){const{cellCtrl:o,colId:s,columnId:i,column:n}=t;if(o)return o;const r=e.colModel.getCol(s??i??Gh(n)),a=t.rowCtrl??Ih(e,t),l=a?.getCellCtrl(r)??void 0;if(l)return l;const d=t.rowNode??a?.rowNode;return d?e.rowRenderer.getCellCtrls([d],[r])?.[0]:void 0}function Lh(e){const{editSvc:t}=e;t?.isBatchEditing()?(Uh(e,{persist:!0}),Kh(e)):t?.stopEditing(void 0,{source:"api"})}function Gh(e){if(e)return"string"==typeof e?e:e.getColId()}var Nh=Symbol("unedited");function Bh({pendingValue:e,sourceValue:t}){return e===Nh&&(e=t),e!==t}function Hh(e,t,o){const{key:s,event:i,cellStartedEdit:n,silent:r}=o??{},{editModelSvc:a,editSvc:l,gos:d,userCompFactory:c}=e,h=kh(e,t),u=h?.comp?.getCellEditor(),g=Vh(e,t,s,n&&!r),p=a?.getEdit(t),m=g.value??p?.sourceValue;if(u)return a?.setEdit(t,{editorValue:jh(e,m,!0,t.column),state:"editing"}),void u.refresh?.(g);const f=t.column.getColDef(),C=Ei(c,f,g);if(!C)return;const{popupFromSelector:v,popupPositionFromSelector:w}=C,b=v??!!f.cellEditorPopup,y=w??f.cellEditorPopupPosition;if(Wh(C.params,i),!h)return;const{rangeFeature:S,rowCtrl:R,comp:x,onEditorAttachedFuncs:F}=h;a?.setEdit(t,{editorValue:jh(e,m,!0,t.column),state:"editing"}),h.editCompDetails=C,F.push(()=>S?.unsetComp()),x?.setEditDetails(C,b,y,d.get("reactiveCustomComponents")),R?.refreshRow({suppressFlash:!0});const D=a?.getEdit(t);r||D?.editorState?.cellStartedEditing||(l?.dispatchCellEvent(t,i,"cellEditingStarted",{value:m}),a?.setEdit(t,{editorState:{cellStartedEditing:!0}}))}function Oh(e,t,o){const s={editorValueExists:!1};if(Zh(e)&&((t.getValidationErrors?.())?.length??0)>0)return s;if(o?.isCancelling)return s;if(o?.isStopping){const e=t?.isCancelAfterEnd?.();if(e)return{...s,isCancelAfterEnd:e}}return{editorValue:t.getValue(),editorValueExists:!0}}function Vh(e,t,o,s){const{valueSvc:i,gos:n,editSvc:r}=e,a=e.gos.get("enableGroupEdit"),l=kh(e,t),d=t.rowNode?.rowIndex??void 0,c=r?.isBatchEditing(),h=e.colModel.getCol(t.column.getId()),{rowNode:u,column:g}=t,p=l.comp?.getCellEditor(),m=r?.getCellDataValue(t),f=void 0===m?p?Oh(e,p)?.editorValue:void 0:m,C=f===Nh?i.getValueForDisplay({column:h,node:u,from:"edit"})?.value:f;let v=a?f:C;return g.isAllowFormula()&&e.formula?.isFormula(v)&&(v=e.formula?.normaliseFormula(v,!0)??v),wo(n,{value:v,eventKey:o??null,column:g,colDef:g.getColDef(),rowIndex:d,node:u,data:u.data,cellStartedEdit:!!s,onKeyDown:l?.onKeyDown.bind(l),stopEditing:o=>{r.stopEditing(t,{source:c?"ui":"api",suppressNavigateAfterEdit:o}),_h(e,t,{})},eGridCell:l?.eGui,parseValue:e=>i.parseValue(h,u,e,l?.value),formatValue:l?.formatValue.bind(l),validate:()=>{r?.validateEdit()}})}function zh(e,t){const{editModelSvc:o}=e;o?.getEditMap().forEach((e,s)=>{e.forEach((e,i)=>{(t||"editing"!==e.state&&e.pendingValue!==Nh)&&(Bh(e)||"editing"===e.state&&!t||o?.removeEdits({rowNode:s,column:i}))})})}function Wh(e,t){return t instanceof KeyboardEvent&&"agNumberCellEditor"===e.column.getColDef().cellEditor?e.suppressPreventDefault=["-","+",".","e"].includes(t?.key??"")||e.suppressPreventDefault:t?.preventDefault?.(),e}function Uh(e,t){for(const o of e.editModelSvc?.getEditPositions()??[]){const s=kh(e,o);if(!s)continue;const i=s.comp?.getCellEditor();if(!i)continue;const{editorValue:n,editorValueExists:r,isCancelAfterEnd:a}=Oh(e,i,t);a&&e.editModelSvc?.setEdit(o,{editorState:{isCancelAfterEnd:a}}),$h(e,o,n,void 0,!r,t)}}function $h(e,t,o,s,i,n){const{editModelSvc:r,valueSvc:a}=e;if(!r)return;const{rowNode:l,column:d}=t;if(!l||!d)return;let c=r.getEdit(t);if(void 0===c?.sourceValue){const o=c?jh(e,c.editorValue,!1,d):Nh,s={sourceValue:a.getValue(d,l,"data"),pendingValue:o};n?.persist&&(s.state="changed"),c=r.setEdit(t,s)}r.setEdit(t,{editorValue:i?jh(e,c.sourceValue,!0,d):o}),n?.persist&&function(e,t){const{editModelSvc:o}=e,s=o?.getEdit(t),i={pendingValue:jh(e,s?.editorValue,!1,t.column)};s?.editorState?.cellStoppedEditing||"editing"===s?.state||(i.state="changed");o?.setEdit(t,i)}(e,t)}function jh(e,t,o,s){const{formula:i}=e;return s.isAllowFormula()&&i?.isFormula(t)?i?.normaliseFormula(t,o)??t:t}function Kh(e,t,o={}){if(t||(t=e.editModelSvc?.getEditPositions()),t)for(const s of t)_h(e,s,o)}function _h(e,t,o,s=kh(e,t)){const i=e.editModelSvc,n=i?.getEdit(t);let r;if(r=n&&"editing"!==n.state&&n.editorState?.cellStoppedEditing?n.state:"changed",!s)return void(n&&i?.setEdit(t,{state:r}));const a=s.comp,l=a?.getCellEditor();if(a&&!l)return s?.refreshCell(),void(n&&(i?.setEdit(t,{state:r}),Yh(e,t,e.gos.get("enableGroupEdit")?qh(n,o?.cancel):{valueChanged:!1,newValue:void 0,oldValue:n.sourceValue},o)));if(Zh(e)){const e=n&&l?.getValidationErrors?.(),o=i?.getCellValidationModel();e?.length?o?.setCellValidation(t,{errorMessages:e}):o?.clearCellValidation(t)}n&&i?.setEdit(t,{state:r}),a?.setEditDetails(),a?.refreshEditStyles(!1,!1),s?.refreshCell({force:!0,suppressFlash:!0});const d=i?.getEdit(t);if(d&&"editing"!==d.state){const s=o?.cancel;Yh(e,t,e.gos.get("enableGroupEdit")?qh(d,s):function(e,t,o){if(o||e.editorState.isCancelAfterEnd)return{valueChanged:!1,newValue:void 0,oldValue:e.sourceValue};let s=e.editorValue;null!=s&&s!==Nh||(s=t?.pendingValue);s===Nh&&(s=void 0);return{valueChanged:Bh(e),newValue:s,oldValue:e.sourceValue}}(d,n,s),o)}}function qh(e,t){const{sourceValue:o,pendingValue:s}=e;let i;return t||s===Nh||(i=s),{valueChanged:!t&&Bh(e),newValue:i,oldValue:o,value:o}}function Yh(e,t,o,{silent:s,event:i}={}){const{editSvc:n,editModelSvc:r}=e,{editorState:a}=r?.getEdit(t)||{},{isCancelBeforeStart:l}=a||{};s||l||(n?.dispatchCellEvent(t,i,"cellEditingStopped",o),r?.setEdit(t,{editorState:{cellStoppedEditing:!0}}))}function Zh(e){return!!e.gos.get("getFullRowEditValidationErrors")||function(e){if(!e)return!1;for(let t=0,o=e.length;t0,t=e?r.join(". "):"";k(a,e),e&&s.announceValue(`${l} ${r}`,"editorValidation"),a instanceof HTMLInputElement?a.setCustomValidity(t):a.classList.toggle("invalid",e)}r?.length>0&&o.setCellValidation({rowNode:i,column:n},{errorMessages:r}),d.add(c.rowCtrl)}if(Uh(e,{persist:!1}),n?.setCellValidationModel(o),a){const t=Xh(e);n?.setRowValidationModel(t)}for(const c of d.values()){c.rowEditStyleFeature?.applyRowStyles();for(const e of c.getAllCellCtrls())e.tooltipFeature?.refreshTooltip(!0),e.editorTooltipFeature?.refreshTooltip(!0),e.editStyleFeature?.applyCellStyles?.()}}var Xh=e=>{const t=new Ah,o=e.gos.get("getFullRowEditValidationErrors"),s=e.editModelSvc?.getEditMap();if(!s)return t;for(const i of s.keys()){const e=s.get(i);if(!e)continue;const n=[],{rowIndex:r,rowPinned:a}=i;for(const t of e.keys()){const o=e.get(t);if(!o)continue;const{editorValue:s,pendingValue:i,sourceValue:l}=o,d=s??(i===Nh?void 0:i)??l;n.push({column:t,colId:t.getColId(),rowIndex:r,rowPinned:a,oldValue:l,newValue:d})}const l=o?.({editorsState:n})??[];l.length>0&&t.setRowValidation({rowNode:i},{errorMessages:l})}return t};function Jh(e){return!(!e.rowPinned||!e.pinnedSibling)}function eu(e,t,o,s){const i="top"===t;if(!o)return eu(e,t,i?e.getPinnedTopRow(0):e.getPinnedBottomRow(0),s);if(!s){const s=i?e.getPinnedTopRowCount():e.getPinnedBottomRowCount();return eu(e,t,o,i?e.getPinnedTopRow(s-1):e.getPinnedBottomRow(s-1))}let n=!1,r=!1;const a=[];return e.forEachPinnedRow(t,e=>e!==o||n?n&&e===s?(r=!0,void a.push(e)):void(n&&!r&&a.push(e)):(n=!0,void a.push(e))),a}var tu=class extends We{constructor(e,t,o,s){super(),this.cellCtrl=e,this.rowNode=o,this.rowCtrl=s,this.beans=t}init(){this.eGui=this.cellCtrl.eGui}onKeyDown(e){const t=e.key;switch(t){case Es:this.onEnterKeyDown(e);break;case Bs:this.onF2KeyDown(e);break;case Ts:this.onEscapeKeyDown(e);break;case Ps:this.onTabKeyDown(e);break;case Ms:case Ns:this.onBackspaceOrDeleteKeyDown(t,e);break;case Gs:case ks:case Ls:case Is:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){const{cellCtrl:o,beans:s}=this;if(!s.editSvc?.isEditing(o,{withOpenEditor:!0})){if(e.shiftKey&&o.isRangeSelectionEnabled())this.onShiftRangeSelect(e);else{const i=o.getFocusedCellPosition();s.navigation?.navigateToNextCell(e,t,i,!0)}e.preventDefault()}}onShiftRangeSelect(e){const{rangeSvc:t,navigation:o}=this.beans;if(!t)return;const s=t.extendLatestRangeInDirection(e);s&&(e.key===Is||e.key===Ls?o?.ensureColumnVisible(s.column):o?.ensureRowVisible(s.rowIndex))}onTabKeyDown(e){this.beans.navigation?.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:o,beans:s,rowNode:i}=this,{gos:n,rangeSvc:r,eventSvc:a,editSvc:l}=s;if(a.dispatchEvent({type:"keyShortcutChangedCellStart"}),function(e,t=!1){return e===Ns||!t&&e===Ms&&on()}(e,n.get("enableCellEditingOnBackspace"))&&!l?.isEditing(o,{withOpenEditor:!0})){if(r&&no(n))r.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(o.isCellEditable()){const e=s.valueSvc.getDeleteValue(o.column,i);i.setDataValue(o.column,e,"cellClear")}}else l?.isEditing(o,{withOpenEditor:!0})||s.editSvc?.startEditing(o,{startedEdit:!0,event:t});a.dispatchEvent({type:"keyShortcutChangedCellEnd"})}onEnterKeyDown(e){const{cellCtrl:t,beans:o}=this,{editSvc:s,navigation:i}=o,n=s?.isEditing(t,{withOpenEditor:!0}),r=t.rowNode,a=s?.isRowEditing(r,{withOpenEditor:!0}),l=t=>{s?.startEditing(t,{startedEdit:!0,event:e,source:"edit"})&&e.preventDefault()};if(n||a){if(this.isCtrlEnter(e))return void s?.applyBulkEdit(t,o?.rangeSvc?.getCellRanges()||[]);if(Qh(o),"block-stop"===s?.checkNavWithValidation(void 0,e))return;s?.isEditing(t,{withOpenEditor:!0})?s?.stopEditing(t,{event:e,source:"edit"}):a&&!t.isCellEditable()?s?.stopEditing({rowNode:r},{event:e,source:"edit"}):l(t)}else if(o.gos.get("enterNavigatesVertically")){const o=e.shiftKey?ks:Gs;i?.navigateToNextCell(null,o,t.cellPosition,!1)}else{if(s?.hasValidationErrors())return;s?.hasValidationErrors(t)&&s.revertSingleCellEdit(t,!0),l(t)}}isCtrlEnter(e){return(e.ctrlKey||e.metaKey)&&e.key===Es}onF2KeyDown(e){const{cellCtrl:t,beans:{editSvc:o}}=this;o?.isEditing()&&(Qh(this.beans),"block-stop"===o?.checkNavWithValidation(void 0,e))||o?.startEditing(t,{startedEdit:!0,event:e})}onEscapeKeyDown(e){const{cellCtrl:t,beans:{editSvc:o}}=this;"block-stop"===o?.checkNavWithValidation(t,e)&&o.revertSingleCellEdit(t),setTimeout(()=>{o?.stopEditing(t,{event:e,cancel:!0})})}processCharacter(e){const t=e.target!==this.eGui,{beans:{editSvc:o},cellCtrl:s}=this;if(!t&&!o?.isEditing(s,{withOpenEditor:!0}))if(e.key===As)this.onSpaceKeyDown(e);else if(o?.isCellEditable(s,"ui")){if(o?.hasValidationErrors()&&!o?.hasValidationErrors(s))return;o?.startEditing(s,{startedEdit:!0,event:e,source:"api",editable:!0}),s.editCompDetails?.params?.suppressPreventDefault||e.preventDefault()}}onSpaceKeyDown(e){const{gos:t,editSvc:o}=this.beans,{rowNode:s}=this.cellCtrl;!o?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&Bt(t)&&this.beans.selectionSvc?.handleSelectionEvent(e,s,"spaceKey"),e.preventDefault()}},ou=class extends We{constructor(e,t,o){super(),this.cellCtrl=e,this.column=o,this.beans=t}onMouseEvent(e,t){if(!Sn(t))switch(e){case"click":this.onCellClicked(t);break;case"pointerdown":case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.beans.touchSvc?.handleCellDoubleClick(this,e))return;const{eventSvc:t,rangeSvc:o,editSvc:s,editModelSvc:i,frameworkOverrides:n,gos:r}=this.beans,a=e.ctrlKey||e.metaKey,{cellCtrl:l}=this,{column:d,cellPosition:c,rowNode:h}=l,u=ga(r,d,h,e);o&&a&&!u&&o.getCellRangeCount(c)>1&&o.intersectLastRange(!0);const g=l.createEvent(e,"cellClicked");g.isEventHandlingSuppressed=u,t.dispatchEvent(g);const p=d.getColDef();if(p.onCellClicked&&window.setTimeout(()=>{n.wrapOutgoing(()=>{p.onCellClicked(g)})},0),!u&&"editing"!==i?.getState(l)){const t=s?.isEditing(),o=s?.isRangeSelectionEnabledWhileEditing(),n=i?.getCellValidationModel().getCellValidationMap().size??0,r=i?.getRowValidationModel().getRowValidationMap().size??0;if(t&&(o||n>0||r>0))return;s?.shouldStartEditing(l,e)?s?.startEditing(l,{event:e}):s?.shouldStopEditing(l,e)&&("fullRow"===this.beans.gos.get("editType")?s?.stopEditing(l,{event:e,source:"edit"}):s?.stopEditing(void 0,{event:e,source:"edit"}))}}onCellDoubleClicked(e){const{column:t,beans:o,cellCtrl:s}=this,{eventSvc:i,frameworkOverrides:n,editSvc:r,editModelSvc:a,gos:l}=o,d=ga(l,s.column,s.rowNode,e),c=t.getColDef(),h=s.createEvent(e,"cellDoubleClicked");if(h.isEventHandlingSuppressed=d,i.dispatchEvent(h),"function"==typeof c.onCellDoubleClicked&&window.setTimeout(()=>{n.wrapOutgoing(()=>{c.onCellDoubleClicked(h)})},0),!d&&r?.shouldStartEditing(s,e)&&"editing"!==a?.getState(s)){const t=r?.isEditing(),o=r?.isRangeSelectionEnabledWhileEditing(),i=a?.getCellValidationModel().getCellValidationMap().size??0,n=a?.getRowValidationModel().getRowValidationMap().size??0;if(t&&(o||i>0||n>0))return;r?.startEditing(s,{event:e})}}onMouseDown(e){const{shiftKey:t}=e,o=e.target,{cellCtrl:s,beans:i}=this,{eventSvc:n,rangeSvc:r,rowNumbersSvc:a,focusSvc:l,gos:d,editSvc:c}=i,{column:h,rowNode:u,cellPosition:g}=s,p=ga(d,h,u,e),m=()=>{const t=s.createEvent(e,"cellMouseDown");t.isEventHandlingSuppressed=p,n.dispatchEvent(t)};if(p)return void m();if(this.isRightClickInExistingRange(e))return;const f=r&&!r.isEmpty(),C=this.containsWidget(o),v=_o(h);if(!a||!v||a.handleMouseDownOnCell(g,e)){if(!t||!f){const t=c?.isEditing(s),i=d.get("enableCellTextSelection")&&e.defaultPrevented,n=(en()||i)&&!t&&!K(o)&&!C;s.focusCell(n,e)}if(t&&f&&!l.isCellFocused(g)){e.preventDefault();const t=l.getFocusedCell();if(t){const{column:o,rowIndex:s,rowPinned:i}=t,n=!!c?.isRangeSelectionEnabledWhileEditing?.();c?.isEditing(t)&&!n&&c?.stopEditing(t),n||l.setFocusedCell({column:o,rowIndex:s,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,sourceEvent:e})}}C||(r?.handleCellMouseDown(e,g),m())}}isRightClickInExistingRange(e){const{rangeSvc:t}=this.beans;if(t){const o=t.isCellInAnyRange(this.cellCtrl.cellPosition),s=bo(this.beans,e);if(o&&s)return!0}return!1}containsWidget(e){return Y(e,"ag-selection-checkbox",3)||Y(e,"ag-drag-handle",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const{eventSvc:t,colHover:o}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOut")),o?.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const{eventSvc:t,colHover:o}=this.beans;t.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOver")),o?.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.eGui,o=t.contains(e.target),s=t.contains(e.relatedTarget);return o&&s}},su=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.column,this.rowNode=e.rowNode}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventSvc,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}init(){this.eSetLeft=this.cellCtrl.getRootElement(),this.eContent=this.cellCtrl.eGui;const e=this.cellCtrl.getCellSpan();if(e||(this.setupColSpan(),this.setupRowSpan()),this.onLeftChanged(),this.onWidthChanged(),e||this._legacyApplyRowSpan(),e){const t=this.refreshSpanHeight.bind(this,e);t(),this.addManagedListeners(this.beans.eventSvc,{paginationChanged:t,recalculateRowBounds:t,pinnedHeightChanged:t})}}refreshSpanHeight(e){const t=e.getCellHeight();null!=t&&(this.eContent.style.height=`${t}px`)}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this._legacyApplyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();t(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventSvc,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eContent)return;const e=this.getCellWidth();this.eContent.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const{column:e,rowNode:t}=this,o=e.getColSpan(t),s=[];if(1===o)s.push(e);else{let t=e;const i=e.getPinned();for(let e=0;t&&ethis.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.setupFocus(),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(s,r),this.refreshFirstAndLastStyles(),this.checkFormulaError(),this.refreshAriaColIndex(),this.positionFeature?.init(),this.customStyleFeature?.setComp(e),this.editStyleFeature?.setComp(e),this.tooltipFeature?.refreshTooltip(),this.keyboardListener?.init(),this.rangeFeature?.setComp(e),this.rowResizeFeature?.refreshRowResizer();const a=n?this.isCellEditable():void 0,l=!a&&this.hasEdit&&this.editSvc?.isEditing(this,{withOpenEditor:!0});if(a||l?this.editSvc?.startEditing(this,{startedEdit:!1,source:"api",silent:!0,continueEditing:!0,editable:a}):this.showValue(!1,!0),this.onCompAttachedFuncs.length){for(const e of this.onCompAttachedFuncs)e();this.onCompAttachedFuncs=[]}}checkFormulaError(){const e=!!this.beans.formula?.getFormulaError(this.column,this.rowNode);this.eGui.classList.toggle("formula-error",e)}setupAutoHeight(e,t){this.isAutoHeight=this.beans.rowAutoHeight?.setupCellAutoHeight(this,e,t)??!1}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}isCellRenderer(){const e=this.column.getColDef();return null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){return this.valueFormatted??this.value}getDeferLoadingCellRenderer(){const{beans:e,column:t}=this,{userCompFactory:o,ctrlsSvc:s,eventSvc:i}=e,n=t.getColDef(),r=this.createCellRendererParams();r.deferRender=!0;const a=Pi(o,n,r);if(s.getGridBodyCtrl()?.scrollFeature?.isScrolling()){let e;const t=new Zs(t=>{e=t}),[o]=this.addManagedListeners(i,{bodyScrollEnd:()=>{e(),o()}});return{loadingComp:a,onReady:t}}return{loadingComp:a,onReady:Zs.resolve()}}showValue(e,t){const{beans:o,column:s,rowNode:i,rangeFeature:n}=this,{userCompFactory:r}=o;let a,l=this.getValueToDisplay();const d=i.stub&&null==i.groupData?.[s.getId()],c=s.getColDef();if(d||this.isCellRenderer()){const e=this.createCellRendererParams();a=!d||_o(s)?Mi(r,c,e):Pi(r,c,e)}if(!a&&!d&&o.findSvc?.isMatch(i,s)){const e=this.createCellRendererParams();a=Mi(r,{...s.getColDef(),cellRenderer:"agFindCellRenderer"},e)}if(this.hasEdit&&this.editSvc.isBatchEditing()&&this.editSvc.isRowEditing(i,{checkSiblings:!0})){const e=this.editSvc.prepDetailsDuringBatch(this,{compDetails:a,valueToDisplay:l});e&&(e.compDetails?a=e.compDetails:e.valueToDisplay&&(l=e.valueToDisplay))}this.comp.setRenderDetails(a,l,e),this.customRowDragComp?.refreshVisibility(),!t&&n&&ye(o,()=>n?.refreshRangeStyleAndHandle()),this.rowResizeFeature?.refreshRowResizer()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(e),!0),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.comp.setIncludeSelection(this.includeSelection),this.comp.setIncludeDndSource(this.includeDndSource),this.comp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}getCellValueClass(){let e="";return"agCheckboxCellRenderer"===this.column.getColDef().cellRenderer&&(e=" ag-allow-overflow"),`ag-cell-value${e}`}isIncludeControl(e,t=!1){return(null==this.rowNode.rowPinned||t&&Jh(this.rowNode))&&!!e}isCheckboxSelection(e){const{rowSelection:t,groupDisplayType:o}=this.beans.gridOptions,s=so(t),i=Ko(this.column);return("custom"!==o||"selectionColumn"===s||!i)&&(e.checkboxSelection||i&&"object"==typeof t&&to(t))}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(e),!0),o=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),s=this.includeDndSource!=this.isIncludeControl(e.dndSource),i=this.isAutoHeight!=this.column.isAutoHeight();return t||o||s||i}onPopupEditorClosed(){const{editSvc:e}=this.beans;e?.isEditing(this,{withOpenEditor:!0})&&e?.stopEditing(this,{source:e?.isBatchEditing()?"ui":"api"})}stopEditing(e=!1){const{editSvc:t}=this.beans;return t?.stopEditing(this,{cancel:e,source:t?.isBatchEditing()?"ui":"api"})??!1}createCellRendererParams(){const{value:e,valueFormatted:t,column:o,rowNode:s,comp:i,eGui:n,beans:{valueSvc:r,gos:a,editSvc:l}}=this;return wo(a,{value:e,valueFormatted:t,getValue:()=>r.getValueForDisplay({column:o,node:s,from:"edit"}).value,setValue:e=>l?.setDataValue({rowNode:s,column:o},e)||s.setDataValue(o,e),formatValue:this.formatValue.bind(this),data:s.data,node:s,pinned:o.getPinned(),colDef:o.getColDef(),column:o,refreshCell:this.refreshCell.bind(this),eGridCell:n,eParentOfValue:i.getParentOfValue(),registerRowDragger:(e,t,o,s)=>this.registerRowDragger(e,t,s),setTooltip:(e,t)=>{a.assertModuleRegistered("Tooltip",3),this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),this.tooltipFeature?.refreshTooltip()}})}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){if(this.refreshShouldDestroy()?this.rowCtrl?.recreateCell(this):this.refreshCell(e),this.hasEdit&&this.editCompDetails){const{editSvc:e,comp:t}=this;!t?.getCellEditor()&&e.isEditing(this,{withOpenEditor:!0})&&e.startEditing(this,{startedEdit:!1,source:"api",silent:!0})}}refreshCell({force:e,suppressFlash:t,newData:o}={}){const{editStyleFeature:s,customStyleFeature:i,rowCtrl:{rowEditStyleFeature:n},beans:{cellFlashSvc:r,filterManager:a},column:l,comp:d,suppressRefreshCell:c,tooltipFeature:h}=this;if(c)return;const{field:u,valueGetter:g,showRowGroup:p,enableCellChangeFlash:m}=l.getColDef(),f=e||null==u&&null==g&&null==p||o,C=!!d,v=this.updateAndFormatValue(C);if(C){if(f||v){this.showValue(!!o,!1);const e=a?.isSuppressFlashingCellsBecauseFiltering();t||e||!m||r?.flashCell(this),s?.applyCellStyles?.(),i?.applyUserStyles(),i?.applyClassesFromColDef(),n?.applyRowStyles(),this.checkFormulaError()}h?.refreshTooltip(),i?.applyCellClassRules()}}isCellEditable(){return this.column.isCellEditable(this.rowNode)}formatValue(e){return this.callValueFormatter(e)??e}callValueFormatter(e){return this.beans.valueSvc.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,o=this.valueFormatted,{value:s,valueFormatted:i}=this.beans.valueSvc.getValueForDisplay({column:this.column,node:this.rowNode,includeValueFormatted:!0,from:"edit"});return this.value=s,this.valueFormatted=i,!e||(!this.valuesAreEqual(t,this.value)||this.valueFormatted!=o)}valuesAreEqual(e,t){const o=this.column.getColDef();return o.equals?o.equals(e,t):e===t}addDomData(e){const t=this.eGui;Ut(this.beans.gos,t,fa,this),e.addDestroyFunc(()=>Ut(this.beans.gos,t,fa,null))}createEvent(e,t){const{rowNode:o,column:s,value:i,beans:n}=this;return function(e,t,o,{rowNode:s,column:i},n){return wo(e.gos,{type:o,node:s,data:s.data,value:n,column:i,colDef:i.getColDef(),rowPinned:s.rowPinned,event:t,rowIndex:s.rowIndex})}(n,e,t,{rowNode:o,column:s},i)}processCharacter(e){this.keyboardListener?.processCharacter(e)}onKeyDown(e){this.keyboardListener?.onKeyDown(e)}onMouseEvent(e,t){this.mouseListener?.onMouseEvent(e,t)}getColSpanningList(){return this.positionFeature?.getColSpanningList()??[]}onLeftChanged(){this.comp&&this.positionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:o}=this;dr(e,t,o.visibleCols)}refreshAriaColIndex(){const e=this.beans.visibleCols.getAriaColIndex(this.column);O(this.eGui,e)}onWidthChanged(){return this.positionFeature?.onWidthChanged()}getRowPosition(){const{rowIndex:e,rowPinned:t}=this.cellPosition;return{rowIndex:e,rowPinned:t}}updateRangeBordersIfRangeCount(){this.comp&&this.rangeFeature?.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){this.comp&&this.rangeFeature?.onCellSelectionChanged()}isRangeSelectionEnabled(){return null!=this.rangeFeature}focusCell(e=!1,t){const o=this.editSvc?.allowedFocusTargetOnValidation(this);o&&o!==this||this.beans.focusSvc.setFocusedCell({...this.getFocusedCellPosition(),forceBrowserFocus:e,sourceEvent:t})}restoreFocus(e=!1){const{beans:{editSvc:t,focusSvc:o},comp:s}=this;if(!s||t?.isEditing(this)||!this.isCellFocused()||!o.shouldTakeFocus())return;const i=()=>{if(!this.isAlive())return;const e=s.getFocusableElement();this.isCellFocused()&&e.focus({preventScroll:!0})};e?setTimeout(i,0):i()}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.restoreFocus(),this.rangeFeature?.onCellSelectionChanged(),this.rowResizeFeature?.refreshRowResizer()}onSuppressCellFocusChanged(e){const t=this.eGui;t&&(_o(this.column)&&(e=!0),we(t,"tabindex",e?void 0:-1))}onFirstRightPinnedChanged(){if(!this.comp)return;const e=this.column.isFirstRightPinned();this.comp.toggleCss("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.comp)return;const e=this.column.isLastLeftPinned();this.comp.toggleCss("ag-cell-last-left-pinned",e)}checkCellFocused(){return this.beans.focusSvc.isCellFocused(this.cellPosition)}isCellFocused(){const e=this.checkCellFocused();return this.hasBeenFocused||(this.hasBeenFocused=e),e}setupFocus(){this.restoreFocus(!0),this.onCellFocused(this.focusEventWhileNotReady??void 0)}onCellFocused(e){const{beans:t}=this;if(On(t))return;if(!this.comp)return void(e&&(this.focusEventWhileNotReady=e));const o=this.isCellFocused(),s=t.editSvc?.isEditing(this)??!1;if(this.comp.toggleCss("ag-cell-focus",o),o&&(e?.forceBrowserFocus||!this.hasBrowserFocus()&&this.beans.focusSvc.shouldTakeFocus())){let o=this.comp.getFocusableElement();if(s){const e=pn(o,null,!0);e.length&&(o=e[0])}const i=!e||e.preventScrollOnBrowserFocus;o.focus({preventScroll:i}),function(e,t){if(!t.isContentEditable)return;const o=S(e).getSelection();if(!o)return;const s=b(e).createRange();s.selectNodeContents(t),s.collapse(!1),o.removeAllRanges(),o.addRange(s)}(t,o)}o&&this.focusEventWhileNotReady&&(this.focusEventWhileNotReady=null),o&&e&&this.rowCtrl.announceDescription()}createCellPosition(){const{rowIndex:e,rowPinned:t}=this.rowNode;this.cellPosition={rowIndex:e,rowPinned:r(t),column:this.column}}applyStaticCssClasses(){const{comp:e}=this;e.toggleCss("ag-cell",!0),e.toggleCss("ag-cell-not-inline-editing",!0);const t=1==this.column.isAutoHeight();e.toggleCss("ag-cell-auto-height",t),e.toggleCss("ag-cell-normal-height",!t)}onColumnHover(){this.beans.colHover?.onCellColumnHover(this.column,this.comp)}onColDefChanged(){this.comp&&(this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editSvc?.isEditing(this)?this.editSvc?.handleColDefChanged(this):this.refreshOrDestroyCell({force:!0,suppressFlash:!0}))}setWrapText(){const e=1==this.column.getColDef().wrapText;this.comp.toggleCss("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),o=this.createEvent(e,"cellContextMenu"),{beans:s}=this;s.eventSvc.dispatchEvent(o),t.onCellContextMenu&&window.setTimeout(()=>{s.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(o)})},0)}getCellRenderer(){return this.comp?.getCellRenderer()??null}destroy(){this.onCompAttachedFuncs=[],this.onEditorAttachedFuncs=[],this.isCellFocused()&&this.hasBrowserFocus()&&this.beans.focusSvc.attemptToRecoverFocus(),super.destroy()}hasBrowserFocus(){return this.eGui?.contains(w(this.beans))??!1}createSelectionCheckbox(){const e=this.beans.selectionSvc?.createCheckboxSelectionComponent();if(e)return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=this.beans.registry.createDynamicBean("dndSourceComp",!1,this.rowNode,this.column,this.eGui);return e&&this.beans.context.createBean(e),e}registerRowDragger(e,t,o){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const s=this.createRowDragComp(e,t,o);s&&(this.customRowDragComp=s,this.addDestroyFunc(()=>{this.beans.context.destroyBean(s),this.customRowDragComp=null}),s.refreshVisibility())}createRowDragComp(e,t,o){const s=this.beans.rowDragSvc?.createRowDragCompForCell(this.rowNode,this.column,()=>this.value,e,t,o);if(s)return this.beans.context.createBean(s),s}cellEditorAttached(){for(const e of this.onEditorAttachedFuncs)e();this.onEditorAttachedFuncs=[]}setFocusedCellPosition(e){}getFocusedCellPosition(){return this.cellPosition}refreshAriaRowIndex(){}getRootElement(){return this.eGui}};function ru(e,t,o,s,i,n){if(null==o&&null==t)return;const r={},a={},l=(e,t)=>{for(const o of e.split(" "))""!=o.trim()&&t(o)};if(o){const t=Object.keys(o);for(let i=0;i{c?r[e]=!0:a[e]=!0})}}if(t&&n)for(const d of Object.keys(t))l(d,e=>{r[e]||(a[e]=!0)});n&&Object.keys(a).forEach(n),Object.keys(r).forEach(i)}function au(e){if(e.group)return e.level;const t=e.parent;return t?t.level+1:0}var lu=0,du=class extends We{constructor(e,t,o,s,i){super(),this.rowNode=e,this.useAnimationFrameForCreate=s,this.printLayout=i,this.focusEventWhileNotReady=null,this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKey=null,this.beans=t,this.gos=t.gos,this.paginationPage=t.pagination?.getCurrentPage()??0,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+lu++,this.rowId=f(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusSvc.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=au(this.rowNode),this.setRowType(),this.setAnimateFlags(o),this.rowStyles=this.processStylesFromGridOptions(),this.rowEditStyleFeature=t.editSvc?.createRowStyleFeature(this),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){"function"==typeof this.businessKeyForNodeFunc&&(this.businessKey=f(this.businessKeyForNodeFunc(this.rowNode)))}updateGui(e,t){"left"===e?this.leftGui=t:"right"===e?this.rightGui=t:"fullWidth"===e?this.fullWidthGui=t:this.centerGui=t}setComp(e,t,o,s){const{context:i,rowRenderer:n}=this.beans,r={rowComp:e,element:t,containerType:o,compBean:s=nr(this,i,s)};this.allRowGuis.push(r),this.updateGui(o,r),this.initialiseRowComp(r);const a=this.rowNode,l="FullWidthLoading"===this.rowType||a.stub,d=!a.data&&"infinite"===this.beans.rowModel.getType();l||d||a.rowPinned||n.dispatchFirstDataRenderedEvent(),this.setupFocus()}unsetComp(e){this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),this.updateGui(e,void 0)}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";for(const o of this.allRowGuis)o.element.style.display=t}initialiseRowComp(e){const t=this.gos;this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(e),this.onRowHeightChanged(e),this.updateRowIndexes(e),this.setFocusedClasses(e),this.setStylesFromGridOptions(!1,e),Bt(t)&&this.rowNode.selectable&&this.onRowSelected(e),this.updateColumnLists(!this.useAnimationFrameForCreate);const o=e.rowComp,s=this.getInitialRowClasses(e.containerType);for(const i of s)o.toggleCss(i,!0);this.executeSlideAndFadeAnimations(e),this.rowNode.group&&G(e.element,1==this.rowNode.expanded),this.setRowCompRowId(o),this.setRowCompRowBusinessKey(o),Ut(t,e.element,va,this),e.compBean.addDestroyFunc(()=>Ut(t,e.element,va,null)),this.useAnimationFrameForCreate?this.beans.animationFrameSvc.createTask(this.addHoverFunctionality.bind(this,e),this.rowNode.rowIndex,"p2",!1):this.addHoverFunctionality(e),this.isFullWidth()&&this.setupFullWidth(e),t.get("rowDragEntireRow")&&this.addRowDraggerToRow(e),this.useAnimationFrameForCreate&&this.beans.animationFrameSvc.addDestroyTask(()=>{this.isAlive()&&e.rowComp.toggleCss("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){null!=this.businessKey&&e.setRowBusinessKey(this.businessKey)}setRowCompRowId(e){const t=f(this.rowNode.id);this.rowId=t,null!=t&&e.setRowId(t)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(_e(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(_e(()=>{e.rowComp.toggleCss("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){const t=this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode,e.element);if(!t)return;const o=this.createBean(t,this.beans.context);this.rowDragComps.push(o),e.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter(e=>e!==o),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,this.beans.context),this.destroyBean(o,this.beans.context)})}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType),o=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(o)}getFullWidthCellRenderers(){return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(e=>e?.rowComp?.getFullWidthCellRenderer()):[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");e&&this.areAllContainersReady()&&e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const{leftGui:e,centerGui:t,rightGui:o,beans:{visibleCols:s}}=this,i=!!e||!s.isPinningLeft(),n=!!t,r=!!o||!s.isPinningRight();return i&&n&&r}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this.rowNode})}setRowType(){const{rowNode:e,gos:t,beans:{colModel:o}}=this,s=e.stub&&!t.get("suppressServerSideFullWidthLoadingRow")&&!t.get("groupHideOpenParents"),i=this.isNodeFullWidthCell(),n=t.get("masterDetail")&&e.detail,r=Xt(t,e,o.isPivotMode());this.rowType=s?"FullWidthLoading":n?"FullWidthDetail":i?"FullWidth":r?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;const{animationFrameSvc:o}=this.beans;!o?.active||e||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(o.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"p1",!1),this.updateColumnListsPending=!0)}getNewCellCtrl(e){if(!this.beans.rowSpanSvc?.isCellSpanning(e,this.rowNode))return new nu(e,this.rowNode,this.beans,this)}isCorrectCtrlForSpan(e){return!this.beans.rowSpanSvc?.isCellSpanning(e.column,this.rowNode)}createCellCtrls(e,t,o=null){const s={list:[],map:{}},i=(e,t,o)=>{null!=o?s.list.splice(o,0,t):s.list.push(t),s.map[e]=t},n=[];for(const d of t){const t=d.getInstanceId();let o=e.map[t];o&&!this.isCorrectCtrlForSpan(o)&&(o.destroy(),o=void 0),o||(o=this.getNewCellCtrl(d)),o&&i(t,o)}for(const d of e.list){const e=d.column.getInstanceId();null==s.map[e]&&(this.isCellEligibleToBeRemoved(d,o)?d.destroy():n.push([e,d]))}if(n.length)for(const[d,c]of n){const e=s.list.findIndex(e=>e.column.getLeft()>c.column.getLeft());i(d,c,-1===e?void 0:Math.max(e-1,0))}const{focusSvc:r,visibleCols:a}=this.beans,l=r.getFocusedCell();if(l&&l.column.getPinned()==o){const e=l.column.getInstanceId();if(!s.map[e]&&a.allCols.includes(l.column)){const t=this.createFocusedCellCtrl();if(t){const o=s.list.findIndex(e=>e.column.getLeft()>t.column.getLeft());i(e,t,-1===o?void 0:Math.max(o-1,0))}}}return s}createFocusedCellCtrl(){const{focusSvc:e,rowSpanSvc:t}=this.beans,o=e.getFocusedCell();if(!o)return;const s=t?.getCellSpan(o.column,this.rowNode);if(s){if(s.firstNode!==this.rowNode||!s.doesSpanContain(o))return}else if(!e.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))return;return this.getNewCellCtrl(o.column)}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){for(const t of this.allRowGuis){const o=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(o,e)}}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const e=this.beans.colViewport,t=this.beans.visibleCols;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t.allCols),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const o=e.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,o);const s=t.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,s,"left");const i=t.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,i,"right")}}isCellEligibleToBeRemoved(e,t){const o=!0,{column:s}=e;if(s.getPinned()!=t)return o;if(!this.isCorrectCtrlForSpan(e))return o;const{visibleCols:i,editSvc:n}=this.beans,r=n?.isEditing(e),a=e.isCellFocused();return r||a?!(i.allCols.indexOf(s)>=0)&&o:o}getDomOrder(){return this.gos.get("ensureDomOrder")||Nt(this.gos,"print")}listenOnDomOrder(e){e.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],()=>{e.rowComp.setDomOrder(this.getDomOrder())})}setAnimateFlags(e){if(this.rowNode.sticky||!e)return;const t=a(this.rowNode.oldRowTop),{visibleCols:o}=this.beans,s=o.isPinningLeft(),i=o.isPinningRight();if(t){const{slideInAnimation:e}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(e.fullWidth=!0);e.center=!0,e.left=s,e.right=i}else{const{fadeInAnimation:e}=this;if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(e.fullWidth=!0);e.center=!0,e.left=s,e.right=i}}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(e.element,t).params),t=e(this.fullWidthGui,null),o=e(this.centerGui,null),s=e(this.leftGui,"left"),i=e(this.rightGui,"right");return t&&o&&s&&i}addListeners(){const{beans:e,gos:t,rowNode:o}=this,{expansionSvc:s,eventSvc:i,context:n,rowSpanSvc:r}=e;this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),...s?.getRowExpandedListeners(this)??{}}),o.detail&&this.addManagedListeners(o.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(o,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this),rowPinned:this.onRowPinned.bind(this)}),this.addManagedListeners(i,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),r&&this.addManagedListeners(r,{spannedCellsUpdated:({pinned:e})=>{e&&!o.rowPinned||this.updateColumnLists()}}),this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,n),this.tooltipFeature=this.destroyBean(this.tooltipFeature,n),this.rowEditStyleFeature=this.destroyBean(this.rowEditStyleFeature,n)}),this.addManagedPropertyListeners(["rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules"],this.postProcessCss.bind(this)),this.addManagedPropertyListener("rowDragEntireRow",()=>{if(t.get("rowDragEntireRow"))for(const e of this.allRowGuis)this.addRowDraggerToRow(e);else this.rowDragComps=this.destroyBeans(this.rowDragComps,n)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{for(const e of this.getAllCellCtrls())e.onRowIndexChanged()},cellChanged:e=>{for(const t of this.getAllCellCtrls())t.onCellChanged(e)}})}onRowPinned(){for(const e of this.allRowGuis)e.rowComp.toggleCss("ag-row-pinned-source",!!this.rowNode.pinnedSibling)}onRowNodeDataChanged(e){this.refreshRow({suppressFlash:!e.update,newData:!e.update})}refreshRow(e){if(this.isFullWidth()===!!this.isNodeFullWidthCell())if(this.isFullWidth())this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);else{for(const t of this.getAllCellCtrls())t.refreshCell(e);for(const e of this.allRowGuis)this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.rowComp);this.onRowSelected(),this.postProcessCss()}else this.beans.rowRenderer.redrawRow(this.rowNode)}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.rowEditStyleFeature?.applyRowStyles(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.beans.rowDropHighlightSvc,t=e?.row===this.rowNode?e.position:"none",o="above"===t,s="inside"===t,i="below"===t,n="none"!==t,r=o||i,a=this.rowNode.uiLevel,l=r&&a>0,d=l?a.toString():"0";for(const c of this.allRowGuis){const e=c.rowComp;e.toggleCss("ag-row-highlight-above",o),e.toggleCss("ag-row-highlight-inside",s),e.toggleCss("ag-row-highlight-below",i),e.toggleCss("ag-row-highlight-indent",l),n?c.element.style.setProperty("--ag-row-highlight-level",d):c.element.style.removeProperty("--ag-row-highlight-level")}}postProcessRowDragging(){const e=this.rowNode.dragging;for(const t of this.allRowGuis)t.rowComp.toggleCss("ag-row-dragging",e)}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.rowAutoHeight?.requestCheckAutoHeight()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:r(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.findFullWidthInfoForEvent(e);if(!t)return;const{rowGui:o,column:s}=t;if(o.element!==e.target)return;const i=this.rowNode,{focusSvc:n,navigation:r}=this.beans,a=n.getFocusedCell(),l={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:a?.column??s};r?.navigateToNextCell(e,e.key,l,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Sn(e))return;const t=this.allRowGuis.find(t=>t.element.contains(e.target)),o=t?t.element:null,s=o===e.target,i=w(this.beans);let n=!1;o&&i&&(n=o.contains(i)&&i.classList.contains("ag-cell"));let r=null;s||n||(r=fn(this.beans,o,!1,e.shiftKey)),(this.isFullWidth()&&s||!r)&&this.beans.navigation?.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){const e=this.allRowGuis.find(e=>ae(e.element))?.element;return e?e.getBoundingClientRect().top:0}onSuppressCellFocusChanged(e){const t=this.isFullWidth()&&e?void 0:this.gos.get("tabIndex");for(const o of this.allRowGuis)we(o.element,"tabindex",t)}setupFocus(){this.isFullWidth()&&(this.restoreFullWidthFocus(!0),this.onFullWidthRowFocused(this.focusEventWhileNotReady??void 0))}restoreFullWidthFocus(e=!1){const{focusSvc:t,editSvc:o}=this.beans;if(o?.isEditing(this))return;if(!t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)||!t.shouldTakeFocus())return;const s=this.getFullWidthRowGuiForFocus();if(!s)return;const i=()=>{this.isAlive()&&t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned)&&s.element.focus({preventScroll:!0})};e?setTimeout(i,0):i()}getFullWidthRowGuiForFocus(e){if(this.fullWidthGui)return this.fullWidthGui;const t=this.beans.focusSvc.getFocusedCell(),o=this.beans.colModel.getCol(e?.column??t?.column);if(!o)return;const s=o?.pinned;return"right"===s?this.rightGui:"left"===s?this.leftGui:this.centerGui}setFullWidthRowFocusedClass(e,t){this.forEachGui(void 0,o=>{o.element.classList.toggle("ag-full-width-focus",t&&o===e)})}onFullWidthRowFocused(e){const{focusSvc:t}=this.beans;if(!this.isFullWidth()||!t.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned))return void this.setFullWidthRowFocusedClass(void 0,!1);const o=this.getFullWidthRowGuiForFocus(e);if(!o)return e&&(this.focusEventWhileNotReady=e),void this.setFullWidthRowFocusedClass(void 0,!1);this.setFullWidthRowFocusedClass(o,!0),this.focusEventWhileNotReady=null,e?.forceBrowserFocus&&o.element.focus({preventScroll:!0})}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){const o={list:[],map:{}};for(const s of e.list)s!==t&&(o.list.push(s),o.map[s.column.getInstanceId()]=s);return o}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"pointerdown":case"touchstart":case"mousedown":this.onRowMouseDown(t)}}createRowEvent(e,t){const{rowNode:o}=this;return wo(this.gos,{type:e,node:o,data:o.data,rowIndex:o.rowIndex,rowPinned:o.rowPinned,event:t})}createRowEventWithSource(e,t){const o=this.createRowEvent(e,t);return o.source=this,o}onRowDblClick(e){if(Sn(e))return;const t=this.createRowEventWithSource("rowDoubleClicked",e);t.isEventHandlingSuppressed=this.isSuppressMouseEvent(e),this.beans.eventSvc.dispatchEvent(t)}findFullWidthInfoForEvent(e){if(!e)return;const t=this.findFullWidthRowGui(e.target),o=this.getColumnForFullWidth(t);return t&&o?{rowGui:t,column:o}:void 0}findFullWidthRowGui(e){return this.allRowGuis.find(t=>t.element.contains(e))}getColumnForFullWidth(e){const{visibleCols:t}=this.beans;switch(e?.containerType){case"center":return t.centerCols[0];case"left":return t.leftCols[0];case"right":return t.rightCols[0];default:return t.allCols[0]}}onRowMouseDown(e){if(this.lastMouseDownOnDragger=Y(e.target,"ag-row-drag",3),!this.isFullWidth()||this.isSuppressMouseEvent(e))return;const{rangeSvc:t,focusSvc:o}=this.beans;t?.removeAllCellRanges();const s=this.findFullWidthInfoForEvent(e);if(!s)return;const{rowGui:i,column:n}=s,r=i.element,a=e.target,l=this.rowNode;let d=e.defaultPrevented||en();r&&r.contains(a)&&K(a)&&(d=!1),o.setFocusedCell({rowIndex:l.rowIndex,column:n,rowPinned:l.rowPinned,forceBrowserFocus:d})}isSuppressMouseEvent(e){const{gos:t,rowNode:o}=this;if(this.isFullWidth())return function(e,t,o,s){const i=t?.suppressMouseEventHandling;return pa(e,void 0,o,s,i)}(t,this.findFullWidthRowGui(e.target)?.rowComp.getFullWidthCellRendererParams(),o,e);const s=Ca(t,e.target);return null!=s&&ga(t,s.column,o,e)}onRowClick(e){if(Sn(e)||this.lastMouseDownOnDragger)return;const t=this.isSuppressMouseEvent(e),{eventSvc:o,selectionSvc:s}=this.beans,i=this.createRowEventWithSource("rowClicked",e);i.isEventHandlingSuppressed=t,o.dispatchEvent(i),t||s?.handleSelectionEvent(e,this.rowNode,"rowClicked")}setupDetailRowAutoHeight(e){"FullWidthDetail"===this.rowType&&this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this,e)}createFullWidthCompDetails(e,t){const{gos:o,rowNode:s}=this,i=wo(o,{fullWidth:!0,data:s.data,node:s,value:s.key,valueFormatted:s.key,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(e,t,o,s)=>this.addFullWidthRowDragging(e,t,o,s),setTooltip:(e,t)=>{o.assertModuleRegistered("Tooltip",3),this.setupFullWidthRowTooltip(e,t)}}),n=this.beans.userCompFactory;switch(this.rowType){case"FullWidthDetail":return function(e,t){return e.getCompDetailsFromGridOptions(Fi,"agDetailCellRenderer",t,!0)}(n,i);case"FullWidthGroup":{const{value:e,valueFormatted:t}=this.beans.valueSvc.getValueForDisplay({node:this.rowNode,includeValueFormatted:!0,from:"edit"});return i.value=e,i.valueFormatted=t,function(e,t){return e.getCompDetailsFromGridOptions(xi,"agGroupRowRenderer",t,!0)}(n,i)}case"FullWidthLoading":return function(e,t){return e.getCompDetailsFromGridOptions(Ri,"agLoadingCellRenderer",t,!0)}(n,i);default:return function(e,t){return e.getCompDetailsFromGridOptions(Si,void 0,t,!0)}(n,i)}}setupFullWidthRowTooltip(e,t){this.fullWidthGui&&(this.tooltipFeature=this.beans.tooltipSvc?.setupFullWidthRowTooltip(this.tooltipFeature,this,e,t))}addFullWidthRowDragging(e,t,o="",s){const{rowDragSvc:i,context:n}=this.beans;if(!i||!this.isFullWidth())return;const r=i.createRowDragComp(()=>o,this.rowNode,void 0,e,t,s);this.createBean(r,n),this.addDestroyFunc(()=>{this.destroyBean(r,n)})}onUiLevelChanged(){const e=au(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,o="ag-row-level-"+this.rowLevel;for(const e of this.allRowGuis)e.rowComp.toggleCss(t,!0),e.rowComp.toggleCss(o,!1)}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBounds.getLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();if(this.firstRowOnPage!==e){this.firstRowOnPage=e;for(const t of this.allRowGuis)t.rowComp.toggleCss("ag-row-first",e)}if(this.lastRowOnPage!==t){this.lastRowOnPage=t;for(const e of this.allRowGuis)e.rowComp.toggleCss("ag-row-last",t)}}getAllCellCtrls(){return 0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=[];if(this.beans.rowStyleSvc?.processClassesFromGridOptions(e,this.rowNode),e.length)for(const t of e)for(const e of this.allRowGuis)e.rowComp.toggleCss(t,!0)}postProcessRowClassRules(){this.beans.rowStyleSvc?.processRowClassRules(this.rowNode,e=>{for(const t of this.allRowGuis)t.rowComp.toggleCss(e,!0)},e=>{for(const t of this.allRowGuis)t.rowComp.toggleCss(e,!1)})}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,e=>e.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return"left"===e||"right"===e?e:null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),o=this.isFullWidth(),{rowNode:s,beans:i}=this,n=[];n.push("ag-row"),n.push(this.rowFocused?"ag-row-focus":"ag-row-no-focus"),this.fadeInAnimation[e]&&n.push("ag-opacity-zero"),n.push(s.rowIndex%2==0?"ag-row-even":"ag-row-odd"),s.isRowPinned()&&(n.push("ag-row-pinned"),i.pinnedRowModel?.isManual()&&n.push("ag-row-pinned-manual")),!s.isRowPinned()&&s.pinnedSibling&&n.push("ag-row-pinned-source"),s.isSelected()&&n.push("ag-row-selected"),s.footer&&n.push("ag-row-footer"),n.push("ag-row-level-"+this.rowLevel),s.stub&&n.push("ag-row-loading"),o&&n.push("ag-full-width-row"),i.expansionSvc?.addExpandedCss(n,s),s.dragging&&n.push("ag-row-dragging");const{rowStyleSvc:r}=i;return r&&(r.processClassesFromGridOptions(n,s),r.preProcessRowClassRules(n,s)),n.push(this.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),this.isFirstRowOnPage()&&n.push("ag-row-first"),this.isLastRowOnPage()&&n.push("ag-row-last"),o&&("left"===t&&n.push("ag-cell-last-left-pinned"),"right"===t&&n.push("ag-cell-first-right-pinned")),n}processStylesFromGridOptions(){return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode)??this.emptyStyle}onRowSelected(e){this.beans.selectionSvc?.onRowCtrlSelected(this,e=>{e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()},e)}announceDescription(){this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode)}addHoverFunctionality(e){if(!this.active)return;const{element:t,compBean:o}=e,{rowNode:s,beans:i,gos:n}=this;o.addManagedListeners(t,{pointerenter:e=>{"mouse"===e.pointerType&&s.dispatchRowEvent("mouseEnter")},pointerleave:e=>{"mouse"===e.pointerType&&s.dispatchRowEvent("mouseLeave")}}),o.addManagedListeners(s,{mouseEnter:()=>{i.dragSvc?.dragging||n.get("suppressRowHoverHighlight")||(t.classList.add("ag-row-hover"),s.setHovered(!0))},mouseLeave:()=>{this.resetHoveredStatus(t)}})}resetHoveredStatus(e){const t=e?[e]:this.allRowGuis.map(e=>e.element);for(const o of t)o.classList.remove("ag-row-hover");this.rowNode.setHovered(!1)}roundRowTopToBounds(e){const t=this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(),o=this.applyPaginationOffset(t.top,!0)-100,s=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(o,e),s)}forEachGui(e,t){if(e)t(e);else for(const o of this.allRowGuis)t(o)}isRowRendered(){return this.allRowGuis.length>0}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,o=this.beans.environment.getDefaultRowHeight(),s=Ht(this.gos)?Ot(this.beans,this.rowNode).height:void 0,i=s?Math.min(o,s)-2+"px":void 0;this.forEachGui(e,e=>{e.element.style.height=`${t}px`,i&&e.element.style.setProperty("--ag-line-height",i)})}destroyFirstPass(e=!1){this.active=!1;const{rowNode:t}=this;if(!e&&$t(this.gos)&&!t.sticky)if(null!=t.rowTop){const e=this.roundRowTopToBounds(t.rowTop);this.setRowTop(e)}else for(const s of this.allRowGuis)s.rowComp.toggleCss("ag-opacity-zero",!0);this.fullWidthGui?.element.contains(w(this.beans))&&this.beans.focusSvc.attemptToRecoverFocus(),t.setHovered(!1);const o=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(o),this.beans.eventSvc.dispatchEvent(o),super.destroy()}destroySecondPass(){this.allRowGuis.length=0;const e=e=>{for(const t of e.list)t.destroy();return{list:[],map:{}}};this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,e=>{e.rowComp.toggleCss("ag-row-focus",this.rowFocused),e.rowComp.toggleCss("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const{focusSvc:e}=this.beans,t=e.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.rowFocused=t,this.setFocusedClasses())}onPaginationChanged(){const e=this.beans.pagination?.getCurrentPage()??0;this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){return this.rowNode.isRowPinned()||this.rowNode.sticky?e:e+this.beans.pageBounds.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&a(e)){const t=this.applyPaginationOffset(e),o=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeight.getRealPixelPosition(t)}px`;this.setRowTopStyle(o)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";const t=this.rowNode;let o;if(t.sticky)o=t.stickyRowTop;else{const s=this.slideInAnimation[e]?this.roundRowTopToBounds(t.oldRowTop):t.rowTop,i=this.applyPaginationOffset(s);o=t.isRowPinned()?i:this.beans.rowContainerHeight.getRealPixelPosition(i)}return o+"px"}setRowTopStyle(e){for(const t of this.allRowGuis)this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`)}getCellCtrl(e,t=!1){let o=null;for(const s of this.getAllCellCtrls())s.column==e&&(o=s);if(null!=o||t)return o;for(const s of this.getAllCellCtrls())s?.getColSpanningList().indexOf(e)>=0&&(o=s);return o}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}updateRowIndexes(e){const t=this.rowNode.getRowIndexString();if(null===t)return;const o=(this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount()??0)+(this.beans.filterManager?.getHeaderRowCount()??0),s=this.rowNode.rowIndex%2==0,i=o+this.rowNode.rowIndex+1;this.forEachGui(e,e=>{e.rowComp.setRowIndex(t),e.rowComp.toggleCss("ag-row-even",s),e.rowComp.toggleCss("ag-row-odd",!s),H(e.element,i)})}};function cu(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}var hu={moduleName:"KeyboardNavigation",version:vt,beans:[class extends We{constructor(){super(),this.beanName="navigation",this.onPageDown=Ye(this.onPageDown,100),this.onPageUp=Ye(this.onPageUp,100)}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const o=e.key,s=e.altKey,i=e.ctrlKey||e.metaKey,n=!!this.beans.rangeSvc&&e.shiftKey,r=Ml(this.gos,e);let a=!1;switch(o){case Vs:case zs:i||s||(this.onHomeOrEndKey(o),a=!0);break;case Is:case Ls:case ks:case Gs:if(!r)return!1;!i||s||n||(this.onCtrlUpDownLeftRight(o,r),a=!0);break;case Os:case Hs:i||s||(a=this.handlePageUpDown(o,r,t))}return a&&e.preventDefault(),a}handlePageUpDown(e,t,o){return o&&(t=this.beans.focusSvc.getFocusedCell()),!!t&&(e===Hs?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo({scrollIndex:e,scrollType:t,scrollColumn:o,focusIndex:s,focusColumn:i,isAsync:n,rowPinned:r}){const{scrollFeature:l}=this.gridBodyCon;a(o)&&!o.isPinned()&&l.ensureColumnVisible(o),a(e)&&l.ensureIndexVisible(e,t),n||l.ensureIndexVisible(s);const{focusSvc:d,rangeSvc:c}=this.beans;d.setFocusedCell({rowIndex:s,column:i,rowPinned:r,forceBrowserFocus:!0}),c?.setRangeToCell({rowIndex:s,rowPinned:r,column:i})}onPageDown(e){const t=this.beans,o=cu(t),s=this.getViewportHeight(),{pageBounds:i,rowModel:n,rowAutoHeight:r}=t,a=i.getPixelOffset(),l=o.top+s,d=n.getRowIndexAtPixel(l+a);r?.active?this.navigateToNextPageWithAutoHeight(e,d):this.navigateToNextPage(e,d)}onPageUp(e){const t=this.beans,o=cu(t),{pageBounds:s,rowModel:i,rowAutoHeight:n}=t,r=s.getPixelOffset(),a=o.top,l=i.getRowIndexAtPixel(a+r);n?.active?this.navigateToNextPageWithAutoHeight(e,l,!0):this.navigateToNextPage(e,l,!0)}navigateToNextPage(e,t,o=!1){const{pageBounds:s,rowModel:i}=this.beans,n=this.getViewportHeight(),r=s.getFirstRow(),a=s.getLastRow(),l=s.getPixelOffset(),d=i.getRow(e.rowIndex),c=o?d?.rowHeight-n-l:n-l,h=d?.rowTop+c;let u,g=i.getRowIndexAtPixel(h+l);if(g===e.rowIndex){const s=o?-1:1;t=g=e.rowIndex+s}o?(u="bottom",ga&&(g=a),t>a&&(t=a)),this.isRowTallerThanView(i.getRow(g))&&(t=g,u="top"),this.navigateTo({scrollIndex:t,scrollType:u,scrollColumn:null,focusIndex:g,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,o=!1){this.navigateTo({scrollIndex:t,scrollType:o?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,o);this.navigateTo({scrollIndex:t,scrollType:o?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){const o=t?-1:1,s=this.getViewportHeight(),{pageBounds:i,rowModel:n}=this.beans,r=i.getLastRow();let a=0,l=e.rowIndex;for(;l>=0&&l<=r;){const e=n.getRow(l);if(e){const t=e.rowHeight??0;if(a+t>s)break;a+=t}l+=o}return Math.max(0,Math.min(l,r))}getViewportHeight(){const e=this.beans,t=cu(e),o=this.beans.scrollVisibleSvc.getScrollbarWidth();let s=t.bottom-t.top;return e.ctrlsSvc.get("center").isHorizontalScrollShowing()&&(s-=o),s}isRowTallerThanView(e){if(!e)return!1;const t=e.rowHeight;return"number"==typeof t&&t>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const o=this.beans.cellNavigation.getNextCellToFocus(e,t,!0),{rowIndex:s,rowPinned:i,column:n}=this.getNormalisedPosition(o)??o,r=n;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:r,focusIndex:s,focusColumn:r,rowPinned:i})}onHomeOrEndKey(e){const t=e===Vs,{visibleCols:o,pageBounds:s,rowModel:i}=this.beans,n=o.allCols,r=t?s.getFirstRow():s.getLastRow(),a=i.getRow(r);if(!a)return;const l=(t?n:[...n].reverse()).find(e=>!e.isSuppressNavigable(a));l&&this.navigateTo({scrollIndex:r,scrollType:null,scrollColumn:l,focusIndex:r,focusColumn:l})}onTabKeyDown(e,t){const o=t.shiftKey,s=this.tabToNextCellCommon(e,o,t),i=this.beans,{ctrlsSvc:n,pageBounds:r,focusSvc:a,gos:l}=i;if(!1===s)if(o){const{rowIndex:o,rowPinned:s}=e.getRowPosition();(s?0===o:o===r.getFirstRow())&&(0===l.get("headerHeight")||Hn(i)?Vn(i,!0,!0):(t.preventDefault(),a.focusPreviousFromFirstCell(t)))}else e instanceof nu&&e.focusCell(!0),(a.focusOverlay(!1)||Vn(i,o))&&t.preventDefault();else s?t.preventDefault():null===s&&n.get("gridCtrl").allowFocusForNextCoreContainer(o)}tabToNextCell(e,t){const o=this.beans,{focusSvc:s,rowRenderer:i}=o,n=s.getFocusedCell();if(!n)return!1;let r=kn(o,n);return!(!r&&(r=i.getRowByPosition(n),!r?.isFullWidth()))&&!!this.tabToNextCellCommon(r,e,t,"api")}tabToNextCellCommon(e,t,o,s="ui"){const{editSvc:i,focusSvc:n}=this.beans;let r;const a=e instanceof nu?e:e.getAllCellCtrls()?.[0];return r=i?.isEditing()?i?.moveToNextCell(a,t,o,s):this.moveToNextCellNotEditing(e,t,o),null===r?r:r||!!n.focusedHeader}moveToNextCellNotEditing(t,o,s){const i=this.beans.visibleCols.allCols;let n;if(t instanceof du){if(n={...t.getRowPosition(),column:o?i[0]:e(i)},this.gos.get("embedFullWidthRows")&&s){const e=t.findFullWidthInfoForEvent(s);e&&(n.column=e.column)}}else n=t.getFocusedCellPosition();const r=this.findNextCellToFocusOn(n,{backwards:o,startEditing:!1});if(!1===r)return null;if(r instanceof nu)r.focusCell(!0);else if(r)return this.tryToFocusFullWidthRow(r,o);return a(r)}findNextCellToFocusOn(e,{backwards:t,startEditing:o,skipToNextEditableCell:s}){let i=e;const n=this.beans,{cellNavigation:r,gos:l,focusSvc:d,rowRenderer:c,rangeSvc:h}=n;for(;;){e!==i&&(e=i),t||(i=this.getLastCellOfColSpan(i)),i=r.getNextTabbedCell(i,t);const u=l.getCallback("tabToNextCell");if(a(u)){const s=u({backwards:t,editing:o,previousCellPosition:e,nextCellPosition:i||null});if(!0===s)i=e;else{if(!1===s)return!1;i={rowIndex:s.rowIndex,column:s.column,rowPinned:s.rowPinned}}}if(!i)return null;if(i.rowIndex<0){const e=Wn(n);return d.focusHeaderPosition({headerPosition:{headerRowIndex:e+i.rowIndex,column:i.column},fromCell:!0}),null}const g="fullRow"===l.get("editType");if(o&&(!g||s)&&!this.isCellEditable(i))continue;this.ensureCellVisible(i);const p=kn(n,i);if(!p){const e=c.getRowByPosition(i);if(!e||!e.isFullWidth()||o)continue;return{...e.getRowPosition(),column:i?.column}}if(!r.isSuppressNavigable(p.column,p.rowNode))return p.setFocusedCellPosition(i),h?.setRangeToCell(i),p}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}lookupRowNodeForCell({rowIndex:e,rowPinned:t}){const{pinnedRowModel:o,rowModel:s}=this.beans;return"top"===t?o?.getPinnedTopRow(e):"bottom"===t?o?.getPinnedBottomRow(e):s.getRow(e)}navigateToNextCell(e,t,o,s){let i=o,n=!1;const r=this.beans,{cellNavigation:d,focusSvc:c,gos:h}=r;for(;i&&(i===o||!this.isValidNavigateCell(i));)h.get("enableRtl")?t===Is&&(i=this.getLastCellOfColSpan(i)):t===Ls&&(i=this.getLastCellOfColSpan(i)),i=d.getNextCellToFocus(t,i),n=l(i);if(n&&e&&e.key===ks&&(i={rowIndex:-1,rowPinned:null,column:o.column}),s){const s=h.getCallback("navigateToNextCell");if(a(s)){const n=s({key:t,previousCellPosition:o,nextCellPosition:i||null,event:e});i=a(n)?{rowPinned:n.rowPinned,rowIndex:n.rowIndex,column:n.column}:null}}if(!i)return;if(i.rowIndex<0){const t=Wn(r);return void c.focusHeaderPosition({headerPosition:{headerRowIndex:t+i.rowIndex,column:o.column},event:e||void 0,fromCell:!0})}const u=this.getNormalisedPosition(i);u?this.focusPosition(u):this.tryToFocusFullWidthRow(i)}getNormalisedPosition(e){if(this.beans.spannedRowRenderer?.getCellByPosition(e))return e;this.ensureCellVisible(e);const t=kn(this.beans,e);return t?(e=t.getFocusedCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(t,o){const{visibleCols:s,rowRenderer:i,focusSvc:n,eventSvc:r}=this.beans,a=s.allCols;if(!i.getRowByPosition(t)?.isFullWidth())return!1;const l=n.getFocusedCell(),d={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column||(o?e(a):a[0])};this.focusPosition(d);const c=null==o?null!=l&&Pn(d,l):o;return r.dispatchEvent({type:"fullWidthRowFocused",rowIndex:d.rowIndex,rowPinned:d.rowPinned,column:d.column,isFullWidthCell:!0,fromBelow:c}),!0}focusPosition(e){const{focusSvc:t,rangeSvc:o}=this.beans;t.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),o?.setRangeToCell(e)}isValidNavigateCell(e){return!!In(this.beans,e)}getLastCellOfColSpan(t){const o=kn(this.beans,t);if(!o)return t;const s=o.getColSpanningList();return 1===s.length?t:{rowIndex:t.rowIndex,column:e(s),rowPinned:t.rowPinned}}ensureCellVisible(e){const t=jt(this.gos),o=this.beans.rowModel.getRow(e.rowIndex),s=t&&o?.sticky,{scrollFeature:i}=this.gridBodyCon;!s&&l(e.rowPinned)&&i.ensureIndexVisible(e.rowIndex),e.column.isPinned()||i.ensureColumnVisible(e.column)}ensureColumnVisible(e){const t=this.gridBodyCon.scrollFeature;e.isPinned()||t.ensureColumnVisible(e)}ensureRowVisible(e){this.gridBodyCon.scrollFeature.ensureIndexVisible(e)}},class extends We{constructor(){super(...arguments),this.beanName="cellNavigation"}wireBeans(e){this.rowSpanSvc=e.rowSpanSvc}getNextCellToFocus(e,t,o=!1){return o?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const o=e===ks,s=e===Gs,i=e===Is;let n,r;const{pageBounds:a,gos:l,visibleCols:d,pinnedRowModel:c}=this.beans,{rowPinned:h}=t;if(o||s)r=h&&c?o?0:"top"===h?c.getPinnedTopRowCount()-1:c.getPinnedBottomRowCount()-1:o?a.getFirstRow():a.getLastRow(),n=t.column;else{const e=l.get("enableRtl");r=t.rowIndex,n=(i!==e?d.allCols:[...d.allCols].reverse()).find(e=>this.isCellGoodToFocusOn({rowIndex:r,rowPinned:null,column:e}))}return n?{rowIndex:r,rowPinned:h,column:n}:null}getNextCellToFocusWithoutCtrlPressed(e,t){let o=t,s=!1;for(;!s;){switch(e){case ks:o=this.getCellAbove(o);break;case Gs:o=this.getCellBelow(o);break;case Ls:o=this.gos.get("enableRtl")?this.getCellToLeft(o):this.getCellToRight(o);break;case Is:o=this.gos.get("enableRtl")?this.getCellToRight(o):this.getCellToLeft(o);break;default:o=null,Et(8,{key:e})}s=!o||this.isCellGoodToFocusOn(o)}return o}isCellGoodToFocusOn(e){const t=e.column;let o;const{pinnedRowModel:s,rowModel:i}=this.beans;switch(e.rowPinned){case"top":o=s?.getPinnedTopRow(e.rowIndex);break;case"bottom":o=s?.getPinnedBottomRow(e.rowIndex);break;default:o=i.getRow(e.rowIndex)}return!!o&&!this.isSuppressNavigable(t,o)}getCellToLeft(e){if(!e)return null;const t=this.beans.visibleCols.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.beans.visibleCols.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellBelow(e){if(!e)return null;const t=this.rowSpanSvc?.getCellEnd(e)??e,o=Nn(this.beans,t,!0);return o?{rowIndex:o.rowIndex,column:e.column,rowPinned:o.rowPinned}:null}getCellAbove(e){if(!e)return null;const t=this.rowSpanSvc?.getCellStart(e)??e,o=Ln(this.beans,{rowIndex:t.rowIndex,rowPinned:t.rowPinned},!0);return o?{rowIndex:o.rowIndex,column:e.column,rowPinned:o.rowPinned}:null}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const{visibleCols:t,pagination:o}=this.beans,s=t.allCols;let i=e.rowIndex,n=e.rowPinned,r=t.getColAfter(e.column);if(!r){r=s[0];const t=Nn(this.beans,e,!0);if(l(t))return null;if(!t.rowPinned&&!(o?.isRowInPage(t.rowIndex)??1))return null;i=t?t.rowIndex:null,n=t?t.rowPinned:null}return{rowIndex:i,column:r,rowPinned:n}}getNextTabbedCellBackwards(t){const{beans:o}=this,{visibleCols:s,pagination:i}=o,n=s.allCols;let r=t.rowIndex,a=t.rowPinned,d=s.getColBefore(t.column);if(!d){d=e(n);const s=Ln(o,{rowIndex:t.rowIndex,rowPinned:t.rowPinned},!0);if(l(s))return null;if(!s.rowPinned&&!(i?.isRowInPage(s.rowIndex)??1))return null;r=s?s.rowIndex:null,a=s?s.rowPinned:null}return{rowIndex:r,column:d,rowPinned:a}}isSuppressNavigable(e,t){const{suppressNavigable:o}=e.colDef;return"boolean"==typeof o?o:"function"==typeof o&&o(e.createColumnFunctionCallbackParams(t))}},class extends We{constructor(){super(...arguments),this.beanName="headerNavigation",this.currentHeaderRowWithoutSpan=-1}postConstruct(){const e=this.beans;e.ctrlsSvc.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl});const t=b(e);this.addManagedElementListeners(t,{mousedown:()=>{this.currentHeaderRowWithoutSpan=-1}})}getHeaderPositionForColumn(t,o){let s;const{colModel:i,colGroupSvc:n,ctrlsSvc:r}=this.beans;if("string"==typeof t?(s=i.getCol(t),s||(s=n?.getColumnGroup(t)??null)):s=t,!s)return null;const a=r.getHeaderRowContainerCtrl()?.getAllCtrls(),l="filter"===e(a||[]).type,d=Wn(this.beans)-1;let c=-1,h=s;for(;h;)c++,h=h.getParent();let u=c;return o&&l&&u===d-1&&u++,-1===u?null:{headerRowIndex:u,column:s}}navigateVertically(e,t){const{focusSvc:o,visibleCols:s}=this.beans,{focusedHeader:i}=o;if(!i)return!1;const{headerRowIndex:n}=i,r=i.column,a=Wn(this.beans),l=this.getHeaderRowType(n),d=s.headerGroupRowCount;let{headerRowIndex:c,column:h,headerRowIndexWithoutSpan:u}="UP"===e?function(e,t,o){const s=o-1;if("filter"!==e){const e=t instanceof Mo&&t.isSpanHeaderHeight();let o=t.getParent();for(;o&&(o.getProvidedColumnGroup().getLevel()>s||e&&o.isPadding());)o=o.getParent();if(o)return e?{column:o,headerRowIndex:o.getProvidedColumnGroup().getLevel(),headerRowIndexWithoutSpan:s}:{column:o,headerRowIndex:s,headerRowIndexWithoutSpan:s}}return{column:t,headerRowIndex:s,headerRowIndexWithoutSpan:s}}(l,r,n):function(e,t,o){const s=t+1,i={column:e,headerRowIndex:s,headerRowIndexWithoutSpan:s};if(e instanceof Ds){if(s>=o)return{column:e.getDisplayedLeafColumns()[0],headerRowIndex:o,headerRowIndexWithoutSpan:s};let t=e.getDisplayedChildren()[0];if(t instanceof Ds&&t.isPadding()){const e=t.getDisplayedLeafColumns()[0];e.isSpanHeaderHeight()&&(t=e)}i.column=t,t instanceof Mo&&t.isSpanHeaderHeight()&&(i.headerRowIndex=o,i.headerRowIndexWithoutSpan=s)}return i}(r,n,d),g=!1;return c<0&&(c=0,h=r,g=!0),c>=a?(c=-1,this.currentHeaderRowWithoutSpan=-1):void 0!==u&&(this.currentHeaderRowWithoutSpan=u),!(!g&&!h)&&o.focusHeaderPosition({headerPosition:{headerRowIndex:c,column:h},allowUserOverride:!0,event:t})}navigateHorizontally(e,t=!1,o){const{focusSvc:s,gos:i}=this.beans,n={...s.focusedHeader};let r,a;-1!==this.currentHeaderRowWithoutSpan?n.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=n.headerRowIndex,"LEFT"===e!==i.get("enableRtl")?(a="Before",r=this.findHeader(n,a)):(a="After",r=this.findHeader(n,a));const l=i.getCallback("tabToNextHeader");if(t&&l){const e=s.focusHeaderPositionFromUserFunc({userFunc:l,headerPosition:r,direction:a});if(e){const{headerRowIndex:e}=s.focusedHeader||{};null!=e&&e!=n.headerRowIndex&&(this.currentHeaderRowWithoutSpan=e)}return e}return r||!t?s.focusHeaderPosition({headerPosition:r,direction:a,fromTab:t,allowUserOverride:!0,event:o}):this.focusNextHeaderRow(n,a,o)}focusNextHeaderRow(t,o,s){const i=this.beans,n=t.headerRowIndex;let r,a=null;const l=Wn(i),d=this.beans.visibleCols.allCols;if("Before"===o){if(n<=0)return!1;a=e(d),r=n-1,this.currentHeaderRowWithoutSpan-=1}else a=d[0],r=n+1,this.currentHeaderRowWithoutSpan=l&&(h=-1),i.focusSvc.focusHeaderPosition({headerPosition:{column:c,headerRowIndex:h},direction:o,fromTab:!0,allowUserOverride:!0,event:s})}scrollToColumn(t,o="After"){if(t.getPinned())return;let s;if(Fs(t)){const i=t.getDisplayedLeafColumns();s="Before"===o?e(i):i[0]}else s=t;this.gridBodyCon.scrollFeature.ensureColumnVisible(s)}findHeader(e,t){const{colGroupSvc:o,visibleCols:s}=this.beans;let i=e.column;if(i instanceof Ds){const e=i.getDisplayedLeafColumns();i="Before"===t?e[0]:e[e.length-1]}const n="Before"===t?s.getColBefore(i):s.getColAfter(i);if(!n)return;const r=s.headerGroupRowCount;if(e.headerRowIndex>=r)return{headerRowIndex:e.headerRowIndex,column:n};const a=o?.getColGroupAtLevel(n,e.headerRowIndex);return a?a.isPadding()&&n.isSpanHeaderHeight()?{headerRowIndex:s.headerGroupRowCount,column:n}:{headerRowIndex:e.headerRowIndex,column:a??n}:{headerRowIndex:n instanceof Mo&&n.isSpanHeaderHeight()?s.headerGroupRowCount:e.headerRowIndex,column:n}}getHeaderRowType(e){const t=this.beans.ctrlsSvc.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}}],apiFunctions:{getFocusedCell:function(e){return e.focusSvc.getFocusedCell()},clearFocusedCell:function(e){return e.focusSvc.clearFocusedCell()},setFocusedCell:function(e,t,o,s){e.focusSvc.setFocusedCell({rowIndex:t,column:o,rowPinned:s,forceBrowserFocus:!0})},setFocusedHeader:function(e,t,o=!1){const s=e.headerNavigation?.getHeaderPositionForColumn(t,o);s&&e.focusSvc.focusHeaderPosition({headerPosition:s})},tabToNextCell:function(e,t){return e.navigation?.tabToNextCell(!1,t)??!1},tabToPreviousCell:function(e,t){return e.navigation?.tabToNextCell(!0,t)??!1}}},uu=class extends We{constructor(e,t){super(),this.isLeft=e,this.elements=t,this.getWidth=e?()=>this.beans.pinnedCols.leftWidth:()=>this.beans.pinnedCols.rightWidth}postConstruct(){this.addManagedEventListeners({[(this.isLeft?"left":"right")+"PinnedWidthChanged"]:this.onPinnedWidthChanged.bind(this)})}onPinnedWidthChanged(){const e=this.getWidth(),t=e>0;for(const o of this.elements)o&&(_(o,t),me(o,e))}},gu={moduleName:"PinnedColumn",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="pinnedCols"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl});const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const{gos:e,visibleCols:t,eventSvc:o}=this.beans,s=Nt(e,"print"),i=s?0:t.getColsLeftWidth(),n=s?0:t.getDisplayedColumnsRightWidth();i!=this.leftWidth&&(this.leftWidth=i,o.dispatchEvent({type:"leftPinnedWidthChanged"})),n!=this.rightWidth&&(this.rightWidth=n,o.dispatchEvent({type:"rightPinnedWidthChanged"}))}keepPinnedColumnsNarrowerThanViewport(){const e=X(this.gridBodyCtrl.eBodyViewport);if(e<=50)return;const t=this.getPinnedColumnsOverflowingViewport(e-50),o=this.gos.getCallback("processUnpinnedColumns"),{columns:s,hasLockedPinned:i}=t;let n=s;(n.length||i)&&(o&&(n=o({columns:n,viewportWidth:e})),n?.length&&(n=n.filter(e=>!_o(e)),this.setColsPinned(n,null,"viewportSizeFeature")))}createPinnedWidthFeature(e,...t){return new uu(e,t)}setColsPinned(e,t,o){const{colModel:s,colAnimation:i,visibleCols:n,gos:r}=this.beans;if(!s.cols)return;if(!e?.length)return;if(Nt(r,"print"))return void Et(37);let a;i?.start(),a=!0===t||"left"===t?"left":"right"===t?"right":null;const l=[];for(const d of e){if(!d)continue;const e=s.getCol(d);e&&(e.getPinned()!==a&&(this.setColPinned(e,a),l.push(e)))}l.length&&(n.refresh(o),fs(this.eventSvc,l,o)),i?.finish()}initCol(e){const{pinned:t,initialPinned:o}=e.colDef;void 0!==t?this.setColPinned(e,t):this.setColPinned(e,o)}setColPinned(e,t){e.pinned=!0===t||"left"===t?"left":"right"===t?"right":null,e.dispatchStateUpdatedEvent("pinned")}setupHeaderPinnedWidth(e){const{scrollVisibleSvc:t}=this.beans;if(null==e.pinned)return;const o="left"===e.pinned,s="right"===e.pinned;e.hidden=!0;const i=()=>{const i=o?this.leftWidth:this.rightWidth;if(null==i)return;const n=0==i,r=e.hidden!==n,a=this.gos.get("enableRtl"),l=t.getScrollbarWidth(),d=t.verticalScrollShowing&&(a&&o||!a&&s)?i+l:i;e.comp.setPinnedContainerWidth(`${d}px`),e.comp.setDisplayed(!n),r&&(e.hidden=n,e.refresh())};e.addManagedEventListeners({leftPinnedWidthChanged:i,rightPinnedWidthChanged:i,scrollVisibilityChanged:i,scrollbarWidthChanged:i})}getHeaderResizeDiff(e,t){if(t.getPinned()){const{leftWidth:t,rightWidth:o}=this,s=X(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport)-50;if(t+o+e>s){if(!(s>t+o))return 0;e=s-t-o}}return e}getPinnedColumnsOverflowingViewport(e){const t=(this.rightWidth??0)+(this.leftWidth??0);let o=!1;if(t0;){if(r0){const e=i[a++];if(e.colDef.lockPinned){o=!0;continue}d-=e.getActualWidth(),l.push(e)}}return{columns:l,hasLockedPinned:o}}}],css:[".ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}"]},pu=class extends ze{constructor(){super(),this.beanName="ariaAnnounce",this.descriptionContainer=null,this.pendingAnnouncements=/* @__PURE__ */new Map,this.lastAnnouncement="",this.updateAnnouncement=qe(this,this.updateAnnouncement.bind(this),200)}postConstruct(){const e=this.beans,t=this.descriptionContainer=b(e).createElement("div");t.classList.add("ag-aria-description-container"),I(t,"polite"),x(t,"relevant","additions text"),function(e,t){x(e,"atomic",t)}(t,!0),e.eRootDiv.appendChild(t)}announceValue(e,t){this.pendingAnnouncements.set(t,e),this.updateAnnouncement()}updateAnnouncement(){if(!this.descriptionContainer)return;const e=Array.from(this.pendingAnnouncements.values()).join(". ");this.pendingAnnouncements.clear(),this.descriptionContainer.textContent="",setTimeout(()=>{this.handleAnnouncementUpdate(e)},50)}handleAnnouncementUpdate(e){if(!this.isAlive()||!this.descriptionContainer)return;let t=e;null!=t&&""!=t.replace(/[ .]/g,"")?(this.lastAnnouncement===t&&(t=`${t}​`),this.lastAnnouncement=t,this.descriptionContainer.textContent=t):this.lastAnnouncement=""}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(ie(e),e.remove()),this.descriptionContainer=null,this.pendingAnnouncements.clear()}},mu={moduleName:"Aria",version:vt,beans:[class extends pu{}]},fu="ag-delay-render",Cu={moduleName:"ColumnDelayRender",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="colDelayRenderSvc",this.hideRequested=!1,this.alreadyRevealed=!1,this.timesRetried=0,this.requesters=/* @__PURE__ */new Set}hideColumns(e){this.alreadyRevealed||this.requesters.has(e)||(this.requesters.add(e),this.hideRequested||(this.beans.ctrlsSvc.whenReady(this,e=>{e.gridBodyCtrl.eGridBody.classList.add(fu)}),this.hideRequested=!0))}revealColumns(e){if(this.alreadyRevealed||!this.isAlive())return;if(this.requesters.delete(e),this.requesters.size>0)return;const{renderStatus:t,ctrlsSvc:o}=this.beans;if(t){if(!t.areHeaderCellsRendered()&&this.timesRetried<5)return this.timesRetried++,void setTimeout(()=>this.revealColumns(e));this.timesRetried=0}o.getGridBodyCtrl().eGridBody.classList.remove(fu),this.alreadyRevealed=!0}}],css:[":where(.ag-delay-render){.ag-cell,.ag-header-cell,.ag-header-group-cell,.ag-row,.ag-spanned-cell-wrapper{visibility:hidden}}"]};var vu={tag:"div",cls:"ag-overlay",role:"presentation",children:[{tag:"div",cls:"ag-overlay-panel",role:"presentation",children:[{tag:"div",ref:"eOverlayWrapper",cls:"ag-overlay-wrapper",role:"presentation"}]}]},wu=class extends ni{constructor(){super(vu),this.eOverlayWrapper=null,this.activeOverlay=null,this.activePromise=null,this.activeCssClass=null,this.elToFocusAfter=null,this.overlayExclusive=!1,this.oldWrapperPadding=null,this.registerCSS(".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{pointer-events:all}.ag-overlay-exporting-center,.ag-overlay-loading-center{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);display:flex;padding:var(--ag-spacing)}")}handleKeyDown(t){if(t.key!==Ps||t.defaultPrevented||Sn(t))return;const{beans:o,eOverlayWrapper:s}=this;if(s&&fn(o,s,!1,t.shiftKey))return;let i=!1;i=t.shiftKey?o.focusSvc.focusGridView({column:e(o.visibleCols.allCols),backwards:!0,canFocusOverlay:!1}):Vn(o,!1),i&&t.preventDefault()}updateLayoutClasses(e,t){const o=this.eOverlayWrapper;if(!o)return;const s=o.classList,{AUTO_HEIGHT:i,NORMAL:n,PRINT:r}=Qr;s.toggle(i,t.autoHeight),s.toggle(n,t.normal),s.toggle(r,t.print)}postConstruct(){this.createManagedBean(new Xr(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.beans.overlays.setWrapperComp(this,!1),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)}),this.addManagedEventListeners({gridSizeChanged:this.refreshWrapperPadding.bind(this)})}setWrapperTypeClass(e){const t=this.eOverlayWrapper?.classList;t?(this.activeCssClass&&t.toggle(this.activeCssClass,!1),this.activeCssClass=e,t.toggle(e,!0)):this.activeCssClass=null}showOverlay(e,t,o){if(this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=e,this.overlayExclusive=o,!e)return this.refreshWrapperPadding(),Zs.resolve();if(this.setWrapperTypeClass(t),this.setDisplayed(!0,{skipAriaHidden:!0}),this.refreshWrapperPadding(),o&&this.isGridFocused()){const e=w(this.beans);e&&!y(this.beans)&&(this.elToFocusAfter=e)}return e.then(t=>{const s=this.eOverlayWrapper;s?this.activePromise===e?(this.activePromise=null,t&&(this.activeOverlay!==t&&(s.appendChild(t.getGui()),this.activeOverlay=t),o&&this.isGridFocused()&&mn(s))):this.activeOverlay!==t&&(this.destroyBean(t),t=null):this.destroyBean(t)}),e}refreshWrapperPadding(){if(!this.eOverlayWrapper)return void(this.oldWrapperPadding=null);let e=0;(!!this.activeOverlay||!!this.activePromise)&&!this.overlayExclusive&&(e=this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight||0),e!==this.oldWrapperPadding&&(this.oldWrapperPadding=e,this.eOverlayWrapper.style.setProperty("padding-top",`${e}px`))}destroyActiveOverlay(){this.activePromise=null;const e=this.activeOverlay;if(!e)return this.overlayExclusive=!1,this.elToFocusAfter=null,void this.refreshWrapperPadding();let t=this.elToFocusAfter;this.elToFocusAfter=null,this.activeOverlay=null,this.overlayExclusive=!1,t&&!this.isGridFocused()&&(t=null),this.destroyBean(e);const o=this.eOverlayWrapper;o&&ie(o),t?.focus?.({preventScroll:!0}),this.refreshWrapperPadding()}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}isGridFocused(){const e=w(this.beans);return!!e&&this.beans.eGridDiv.contains(e)}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.beans.overlays.setWrapperComp(this,!0),super.destroy(),this.eOverlayWrapper=null}},bu={selector:"AG-OVERLAY-WRAPPER",component:wu},yu=["refresh"],Su=e=>({name:e,optionalMethods:yu}),Ru={id:"agLoadingOverlay",overlayType:"loading",comp:Su("loadingOverlayComponent"),wrapperCls:"ag-overlay-loading-wrapper",exclusive:!0,compKey:"loadingOverlayComponent",paramsKey:"loadingOverlayComponentParams",isSuppressed:e=>{const t=e.get("loading");return!1===t||!0===e.get("suppressLoadingOverlay")&&!0!==t}},xu={id:"agNoRowsOverlay",overlayType:"noRows",comp:Su("noRowsOverlayComponent"),wrapperCls:"ag-overlay-no-rows-wrapper",compKey:"noRowsOverlayComponent",paramsKey:"noRowsOverlayComponentParams",isSuppressed:e=>e.get("suppressNoRowsOverlay")},Fu={id:"agNoMatchingRowsOverlay",overlayType:"noMatchingRows",comp:Su("noMatchingRowsOverlayComponent"),wrapperCls:"ag-overlay-no-matching-rows-wrapper"},Du={id:"agExportingOverlay",overlayType:"exporting",comp:Su("exportingOverlayComponent"),wrapperCls:"ag-overlay-exporting-wrapper",exclusive:!0},Mu={id:"activeOverlay",comp:Su("activeOverlay"),wrapperCls:"ag-overlay-modal-wrapper",exclusive:!0},Pu={moduleName:"Overlay",version:vt,userComponents:{agLoadingOverlay:class extends yr{constructor(){super(...arguments),this.eLoadingIcon=null,this.eLoadingText=null}init(e){const{beans:t,gos:o}=this,s=r(o.get("overlayLoadingTemplate")?.trim());if(this.setTemplate(s??Rr),!s){const o=ei("overlayLoading",t,null);o&&this.eLoadingIcon.appendChild(o);const s=e.loading?.overlayText??this.getLocaleTextFunc()("loadingOoo","Loading...");this.eLoadingText.textContent=s,t.ariaAnnounce.announceValue(s,"overlay")}}},agNoRowsOverlay:class extends yr{init(e){const{beans:t,gos:o}=this,s=r(o.get("overlayNoRowsTemplate")?.trim());if(this.setTemplate(s??Fr),!s){const o=e.noRows?.overlayText??this.getLocaleTextFunc()("noRowsToShow","No Rows To Show");this.getGui().textContent=o,t.ariaAnnounce.announceValue(o,"overlay")}}},agNoMatchingRowsOverlay:class extends yr{init(e){const{beans:t}=this;this.setTemplate(xr);const o=e.noMatchingRows?.overlayText??this.getLocaleTextFunc()("noMatchingRows","No Matching Rows");this.getGui().textContent=o,t.ariaAnnounce.announceValue(o,"overlay")}},agExportingOverlay:class extends yr{constructor(){super(...arguments),this.eExportingIcon=null,this.eExportingText=null}init(e){const{beans:t}=this;this.setTemplate(Sr);const o=ei("overlayExporting",t,null);o&&this.eExportingIcon.appendChild(o);const s=e.exporting?.overlayText??this.getLocaleTextFunc()("exportingOoo","Exporting...");this.eExportingText.textContent=s,t.ariaAnnounce.announceValue(s,"overlay")}}},apiFunctions:{showLoadingOverlay:function(e){e.overlays?.showLoadingOverlay()},showNoRowsOverlay:function(e){e.overlays?.showNoRowsOverlay()},hideOverlay:function(e){e.overlays?.hideOverlay()}},icons:{overlayLoading:"loading",overlayExporting:"loading"},beans:[class extends We{constructor(){super(...arguments),this.beanName="overlays",this.eWrapper=void 0,this.exclusive=!1,this.oldExclusive=!1,this.currentDef=null,this.showInitialOverlay=!0,this.userForcedNoRows=!1,this.exportsInProgress=0,this.newColumnsLoadedCleanup=null}postConstruct(){const e=this.gos;this.showInitialOverlay=Lt(e);const t=()=>{this.userForcedNoRows||this.updateOverlay(!1)},[o,s,i,n]=this.addManagedEventListeners({newColumnsLoaded:t,rowCountReady:()=>{this.disableInitialOverlay(),t(),s()},rowDataUpdated:t,modelUpdated:t});this.newColumnsLoadedCleanup=o,this.addManagedPropertyListeners(["loading","activeOverlay","activeOverlayParams","overlayComponentParams","loadingOverlayComponentParams","noRowsOverlayComponentParams"],e=>this.onPropChange(new Set(e.changeSet?.properties)))}destroy(){this.doHideOverlay(),super.destroy(),this.eWrapper=void 0}setWrapperComp(e,t){this.isAlive()&&(t?this.eWrapper===e&&(this.eWrapper=void 0):this.eWrapper=e,this.updateOverlay(!1))}isVisible(){return!!this.currentDef}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos;if(!this.eWrapper||e.get("activeOverlay"))return;if(this.isDisabled(Ru))return;const t=e.get("loading");(t||void 0===t)&&this.doShowOverlay(Ru)}showNoRowsOverlay(){this.showInitialOverlay=!1;const e=this.gos;!this.eWrapper||e.get("activeOverlay")||e.get("loading")||this.isDisabled(xu)||(this.userForcedNoRows=!0,this.doShowOverlay(xu))}async showExportOverlay(e){const{gos:t,beans:o}=this;if(!this.eWrapper||t.get("activeOverlay")||t.get("loading")||this.isDisabled(Du)||this.userForcedNoRows&&this.currentDef===xu)return void e();const s=this.getDesiredDefWithOverride(Du);if(!s)return void e();this.exportsInProgress++,this.focusedCell=o.focusSvc.getFocusedCell(),await this.doShowOverlay(s),await new Promise(e=>setTimeout(()=>e()));const i=Date.now();try{e()}finally{const e=Date.now()-i,t=Math.max(0,300-e),s=()=>{this.exportsInProgress--,0===this.exportsInProgress&&(this.updateOverlay(!1),function(e,t){const o=e.focusSvc,s=o.getFocusedCell();if(s&&t&&Mn(s,t)){const{rowIndex:s,rowPinned:i,column:n}=t;y(e)&&o.setFocusedCell({rowIndex:s,column:n,rowPinned:i,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!gn()})}}(o,this.focusedCell),this.focusedCell=null)};t>0?setTimeout(()=>s(),t):s()}}hideOverlay(){const e=this.gos;this.showInitialOverlay=!1;const t=this.userForcedNoRows;this.userForcedNoRows=!1,e.get("loading")?Et(99):e.get("activeOverlay")?Et(296):this.currentDef!==Fu?(this.doHideOverlay(),t&&this.getOverlayDef()!==xu&&this.updateOverlay(!1)):Et(297)}getOverlayWrapperSelector(){return bu}getOverlayWrapperCompClass(){return wu}onPropChange(e){const t=e.has("activeOverlay");if((t||e.has("loading"))&&this.updateOverlay(t))return;const o=this.currentDef,s=this.eWrapper?.activeOverlay;if(s&&o){const t=e.has("activeOverlayParams");if(o===Mu)t&&s.refresh?.(this.makeCompParams(!0));else{const t=o.paramsKey;(e.has("overlayComponentParams")||t&&e.has(t))&&s.refresh?.(this.makeCompParams(!1,t,o.overlayType))}}}updateOverlay(e){const t=this.eWrapper;if(!t)return this.currentDef=null,!1;const o=this.getDesiredDefWithOverride(),s=this.currentDef,i=o===Mu&&e;return o!==s?o?(this.doShowOverlay(o),!0):(this.disableInitialOverlay(),this.doHideOverlay()):i&&o?(t.hideOverlay(),this.doShowOverlay(o),!0):(o||this.disableInitialOverlay(),!1)}getDesiredDefWithOverride(e){const{gos:t}=this;let o=(s=t.get("activeOverlay"))?{agLoadingOverlay:Ru,agNoRowsOverlay:xu,agNoMatchingRowsOverlay:Fu,agExportingOverlay:Du}[s]??Mu:null;var s;return o||(o=e??this.getOverlayDef(),o&&this.isDisabled(o)&&(o=null)),o}getOverlayDef(){const{gos:e,beans:t}=this,{rowModel:o}=t,s=e.get("loading");if(void 0!==s){if(this.disableInitialOverlay(),s)return Ru}else if(this.showInitialOverlay){if(!(this.isDisabled(Ru)||e.get("columnDefs")&&e.get("rowData")))return Ru;this.disableInitialOverlay()}else this.disableInitialOverlay();return(i=o.getOverlayType())?{loading:Ru,noRows:xu,noMatchingRows:Fu,exporting:Du}[i]:null;var i}disableInitialOverlay(){this.showInitialOverlay=!1,this.newColumnsLoadedCleanup?.(),this.newColumnsLoadedCleanup=null}doShowOverlay(e){const{gos:t,beans:o}=this,{userCompFactory:s}=o;this.currentDef=e;const i=e!==Mu,n=!!e.exclusive;let r,a;this.exclusive=n,(e.paramsKey&&t.get(e.paramsKey)||e.compKey&&t.get(e.compKey))&&(r=e.paramsKey),i&&(t.get("overlayComponent")||t.get("overlayComponentSelector"))&&(a=s.getCompDetailsFromGridOptions({name:"overlayComponent",optionalMethods:["refresh"]},void 0,this.makeCompParams(!1,e.paramsKey,e.overlayType))),a??(a=s.getCompDetailsFromGridOptions(e.comp,i?e.id:void 0,this.makeCompParams(!i,r,e.overlayType),!1));const l=a?.newAgStackInstance()??null,d=this.eWrapper?this.eWrapper.showOverlay(l,e.wrapperCls,n):Zs.resolve();return this.eWrapper?.refreshWrapperPadding(),this.setExclusive(n),d}makeCompParams(e,t,o){const{gos:s}=this;return wo(s,(e?s.get("activeOverlayParams"):{...s.get("overlayComponentParams"),...t&&s.get(t)||null,overlayType:o})??{})}doHideOverlay(){let e=!1;this.currentDef&&(this.currentDef=null,e=!0),this.exclusive=!1;const t=this.eWrapper;return t&&(t.hideOverlay(),t.refreshWrapperPadding(),this.setExclusive(!1)),e}setExclusive(e){this.oldExclusive!==e&&(this.oldExclusive=e,this.eventSvc.dispatchEvent({type:"overlayExclusiveChanged"}))}isDisabled(e){const{gos:t}=this;return e.overlayType&&t.get("suppressOverlays")?.includes(e.overlayType)||!0===e.isSuppressed?.(t)}}]},Eu=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.rowNode.id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e?.id)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.rowNode!=e?null:t):null}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,o=this.entriesMap[t];delete this.entriesMap[t],s(this.entriesList,o)}removeFromCache(e){const t=e.rowNode.id;delete this.entriesMap[t],s(this.entriesList,e)}getEntries(){return this.entriesList}};function Tu(e){if(!e)return;const t={top:{},bottom:{},normal:{}};for(const o of e){const e=o.id;switch(o.rowPinned){case"top":t.top[e]=o;break;case"bottom":t.bottom[e]=o;break;default:t.normal[e]=o}}return t}function Au(e,t){const o=e.id;switch(e.rowPinned){case"top":return null!=t.top[o];case"bottom":return null!=t.bottom[o];default:return null!=t.normal[o]}}var Iu=e=>{if(e.data)return e;let t=e.childrenAfterGroup;for(;t?.length;){const e=t[0];if(e.data)return e;t=e.childrenAfterGroup}},ku=e=>{if(!e)return e;if("bigint"==typeof e)return e<0n?-e:e;const t=Number(e);return isNaN(t)?e:Math.abs(t)};var Lu=(e,t)=>({tag:"span",ref:`eSort${e}`,cls:`ag-sort-indicator-icon ag-sort-${t} ag-hidden`,attrs:{"aria-hidden":"true"}}),Gu={tag:"span",cls:"ag-sort-indicator-container",children:[Lu("Order","order"),Lu("Asc","ascending-icon"),Lu("Desc","descending-icon"),Lu("Mixed","mixed-icon"),Lu("AbsoluteAsc","absolute-ascending-icon"),Lu("AbsoluteDesc","absolute-descending-icon"),Lu("None","none-icon")]},Nu=class extends ni{constructor(e){super(),this.eSortOrder=null,this.eSortAsc=null,this.eSortDesc=null,this.eSortMixed=null,this.eSortNone=null,this.eSortAbsoluteAsc=null,this.eSortAbsoluteDesc=null,e||this.setTemplate(Gu)}attachCustomElements(e,t,o,s,i,n,r){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=o,this.eSortMixed=s,this.eSortNone=i,this.eSortAbsoluteAsc=n,this.eSortAbsoluteDesc=r}setupSort(e,t=!1){if(this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),!e.isSortable()&&!e.getColDef().showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addInIcon("sortAbsoluteAscending",this.eSortAbsoluteAsc,e),this.addInIcon("sortAbsoluteDescending",this.eSortAbsoluteDesc,e);const o=this.updateIcons.bind(this),s=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",o),this.addManagedEventListeners({newColumnsLoaded:o,sortChanged:s,columnRowGroupChanged:s}),this.onSortChanged()}addInIcon(e,t,o){if(null==t)return;const s=ei(e,this.beans,o);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const{eSortAsc:e,eSortDesc:t,eSortAbsoluteAsc:o,eSortAbsoluteDesc:s,eSortNone:i,column:n,gos:r,beans:a}=this,{isDefaultSortAllowed:l,isAbsoluteSortAllowed:d,isAbsoluteSort:c,isDefaultSort:h,isAscending:u,isDescending:g,direction:p}=Go(n,a);e&&_(e,u&&h&&l,{skipAriaHidden:!0}),t&&_(t,g&&h&&l,{skipAriaHidden:!0}),i&&_(i,!(!n.getColDef().unSortIcon&&!r.get("unSortIcon")||p),{skipAriaHidden:!0}),o&&_(o,u&&c&&d,{skipAriaHidden:!0}),s&&_(s,g&&c&&d,{skipAriaHidden:!0})}setupMultiSortIndicator(){const{eSortMixed:e,column:t,gos:o}=this;this.addInIcon("sortUnSort",e,t);const s=t.getColDef().showRowGroup;Kt(o)&&s&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){const{eSortMixed:e,beans:t,column:o}=this;e&&_(e,"mixed"===t.sortSvc.getDisplaySortForColumn(o)?.direction,{skipAriaHidden:!0})}updateSortOrder(){const{eSortOrder:e,column:t,beans:{sortSvc:o}}=this;if(!e)return;const s=o.getColumnsWithSortingOrdered(),i=o.getDisplaySortIndexForColumn(t)??-1,n=s.some(e=>o.getDisplaySortIndexForColumn(e)??!1);_(e,i>=0&&n,{skipAriaHidden:!0}),i>=0?e.textContent=(i+1).toString():ie(e)}},Bu={selector:"AG-SORT-INDICATOR",component:Nu},Hu={moduleName:"Sort",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="sortSvc"}progressSort(e,t,o){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,o)}progressSortFromEvent(e,t){const o="ctrl"===this.gos.get("multiSortKey")?t.ctrlKey||t.metaKey:t.shiftKey;this.progressSort(e,o,"uiColumnSorted")}setSortForColumn(e,t,o,s){const{gos:i,showRowGroupCols:n}=this.beans;let r=[e];if(Kt(i)&&e.getColDef().showRowGroup){const t=(n?.getSourceColumnsForGroupColumn?.(e))?.filter(e=>e.isSortable());t&&(r=[e,...t])}for(const l of r)this.setColSort(l,t,s);const a=[];if(!((o||i.get("alwaysMultiSort"))&&!i.get("suppressMultiSort"))){const e=this.clearSortBarTheseColumns(r,s);a.push(...e)}this.updateSortIndex(e),a.push(...r),this.dispatchSortChangedEvents(s,a)}updateSortIndex(e){const{gos:t,colModel:o,showRowGroupCols:s}=this.beans,i=Kt(t),n=s?.getShowRowGroupCol(e.getId()),r=i&&n||e,a=this.getColumnsWithSortingOrdered();o.forAllCols(e=>this.setColSortIndex(e,null));const l=a.filter(e=>(!i||!e.getColDef().showRowGroup)&&e!==r);(r.getSortDef()?[...l,r]:l).forEach((e,t)=>this.setColSortIndex(e,t))}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){let e=!1;return this.beans.colModel.forAllCols(t=>{if(t.getSortDef())return e=!0,!0}),e}dispatchSortChangedEvents(e,t){const o={type:"sortChanged",source:e};t&&(o.columns=t),this.eventSvc.dispatchEvent(o)}clearSortBarTheseColumns(e,t){const o=[];return this.beans.colModel.forAllCols(s=>{e.includes(s)||(s.getSortDef()&&o.push(s),this.setColSort(s,void 0,t))}),o}getNextSortDirection(e){const t=e.getSortingOrder(),o=e.getSortDef();let s=t.findIndex(e=>Io(e,o))+1;return s>=t.length&&(s=0),Po(t[s])}getIndexedSortMap(){const{gos:e,colModel:t,showRowGroupCols:o,rowGroupColsSvc:s}=this.beans;let i=[];if(t.forAllCols(e=>{e.getSortDef()&&i.push(e)}),t.isPivotMode()){const t=Kt(e);i=i.filter(e=>{const s=!!e.getAggFunc(),i=!e.isPrimary(),n=t?o?.getShowRowGroupCol(e.getId()):e.getColDef().showRowGroup;return s||i||n})}const n=s?.columns.filter(e=>!!e.getSortDef())??[],r={};i.forEach((e,t)=>r[e.getId()]=t),i.sort((e,t)=>{const o=e.getSortIndex(),s=t.getSortIndex();return null!=o&&null!=s?o-s:null==o&&null==s?r[e.getId()]>r[t.getId()]?1:-1:null==s?-1:1});const a=Kt(e)&&!!n.length;a&&(i=[...new Set(i.map(e=>o?.getShowRowGroupCol(e.getId())??e))]);const l=/* @__PURE__ */new Map;if(i.forEach((e,t)=>l.set(e,t)),a)for(const d of n){const e=o.getShowRowGroupCol(d.getId());l.set(d,l.get(e))}return l}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([,e],[,t])=>e-t).map(([e])=>e)}collectSortItems(e=!1){const t=[],o=this.getColumnsWithSortingOrdered();for(const s of o){const o=s.getSortDef()?.direction;if(!o)continue;const i={sort:o,type:Lo(s.getSortDef()?.type)};e?i.colId=s.getId():i.column=s,t.push(i)}return t}getSortModel(){return this.collectSortItems(!0)}getSortOptions(){return this.collectSortItems()}canColumnDisplayMixedSort(e){const t=Kt(this.gos),o=!!e.getColDef().showRowGroup;return t&&o}getDisplaySortForColumn(e){const t=this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSortDef();const o=null!=e.getColDef().field||e.getColDef().valueGetter?[e,...t]:t,s=o[0].getSortDef();return o.every(e=>Io(e.getSortDef(),s))?s:{type:Lo(e.getSortDef()?.type),direction:"mixed"}}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}setupHeader(e,t){const o=()=>{const{type:o,direction:s}=Po(t.getSortDef());if(e.toggleCss("ag-header-cell-sorted-asc","asc"===s),e.toggleCss("ag-header-cell-sorted-desc","desc"===s),e.toggleCss("ag-header-cell-sorted-abs-asc","absolute"===o&&"asc"===s),e.toggleCss("ag-header-cell-sorted-abs-desc","absolute"===o&&"desc"===s),e.toggleCss("ag-header-cell-sorted-none",!s),t.getColDef().showRowGroup){const o=!(this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(t))?.every(e=>s==e.getSortDef()?.direction);e.toggleCss("ag-header-cell-sorted-mixed",o)}};e.addManagedEventListeners({sortChanged:o,columnPinned:o,columnRowGroupChanged:o,displayedColumnsChanged:o})}initCol(e){const{sortIndex:t,initialSortIndex:o}=e.colDef,s=ts(e.colDef);s&&e.setSortDef(s,!0),void 0!==t?null!==t&&(e.sortIndex=t):null!==o&&(e.sortIndex=o)}updateColSort(e,t,o){void 0!==t&&this.setColSort(e,Po(t),o)}setColSort(e,t,o){Io(e.getSortDef(),t)||(e.setSortDef(Po(t),void 0===t),e.dispatchColEvent("sortChanged",o)),e.dispatchStateUpdatedEvent("sort")}setColSortIndex(e,t){e.sortIndex=t,e.dispatchStateUpdatedEvent("sortIndex")}createSortIndicator(e){return new Nu(e)}getSortIndicatorSelector(){return Bu}},class extends We{constructor(){super(...arguments),this.beanName="rowNodeSorter",this.accentedSort=!1,this.primaryColumnsSortGroups=!1,this.pivotActive=!1}postConstruct(){this.firstLeaf=Lt(this.gos)?Dl:Iu,this.addManagedPropertyListeners(["accentedSort","autoGroupColumnDef","treeData"],this.updateOptions.bind(this));const e=this.updatePivotModeState.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,columnPivotChanged:e}),this.updateOptions(),e()}updateOptions(){this.accentedSort=!!this.gos.get("accentedSort"),this.primaryColumnsSortGroups=Kt(this.gos)}updatePivotModeState(){this.pivotActive=this.beans.colModel.isPivotActive()}doFullSortInPlace(e,t){return e.sort((e,o)=>this.compareRowNodes(t,e,o))}compareRowNodes(e,t,o){if(t===o)return 0;const s=this.accentedSort;for(let i=0,n=e.length;i{i.push(e),e.sibling&&i.push(e.sibling)})}o.refreshCells({rowNodes:i})}}]},zu={moduleName:"CommunityCore",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="gridDestroySvc",this.destroyCalled=!1}destroy(){if(this.destroyCalled)return;const{stateSvc:e,ctrlsSvc:t,context:o}=this.beans;this.eventSvc.dispatchEvent({type:"gridPreDestroyed",state:e?.getState()??{}}),this.destroyCalled=!0,t.get("gridCtrl")?.destroyGridUi(),o.destroy(),super.destroy()}},class extends We{constructor(){super(),this.beanName="apiFunctionSvc",this.api=new cl,this.fns={...ll,dispatchEvent:dl},this.preDestroyLink="";const{api:e}=this;for(const t of Object.keys(al))e[t]=this.makeApi(t)[t]}postConstruct(){this.preDestroyLink=this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){const{fns:o,beans:s}=this;o!==ll&&(o[e]=s?.validation?.validateApiFunction(e,t)??t)}makeApi(e){return{[e]:(...t)=>{const{beans:o,fns:{[e]:s}}=this;return s?s(o,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:o,preDestroyLink:s}=this;if(t){const t=al[e];o.assertModuleRegistered(t,`api.${e}`)&&Et(27,{fnName:e,module:t})}else Et(26,{fnName:e,preDestroyLink:s})}destroy(){super.destroy(),this.fns=ll,this.beans=null}},class extends Dd{constructor(){super(...arguments),this.agGridDefaults={},this.agGridDefaultOverrides={},this.jsComps={},this.selectors={},this.icons={}}postConstruct(){const e=this.gos.get("components");if(null!=e)for(const t of Object.keys(e))this.jsComps[t]=e[t]}registerModule(e){const{icons:t,userComponents:o,dynamicBeans:s,selectors:i}=e;if(o){const e=(e,t,o,s)=>{this.agGridDefaults[e]=t,(o||s)&&(this.agGridDefaultOverrides[e]={params:o,processParams:s})};for(const t of Object.keys(o)){let s=o[t];if(Md(s)&&(s=s.getComp(this.beans)),"object"==typeof s){const{classImp:o,params:i,processParams:n}=s;e(t,o,i,n)}else e(t,s)}}this.registerDynamicBeans(s);for(const n of i??[])this.selectors[n.selector]=n;if(t)for(const n of Object.keys(t))this.icons[n]=t[n]}getUserComponent(e,t){const o=(e,t,o,s)=>({componentFromFramework:t,component:e,params:o,processParams:s}),{frameworkOverrides:s}=this.beans,i=s.frameworkComponent(t,this.gos.get("components"));if(null!=i)return o(i,!0);const n=this.jsComps[t];if(n)return o(n,s.isFrameworkComponent(n));const r=this.agGridDefaults[t];if(r){const e=this.agGridDefaultOverrides[t];return o(r,!1,e?.params,e?.processParams)}return this.beans.validation?.missingUserComponent(e,t,this.agGridDefaults,this.jsComps),null}getSelector(e){return this.selectors[e]}getIcon(e){return this.icons[e]}getDynamicError(e,t){return t?It(279,{name:e}):this.beans.validation?.missingDynamicBean(e)??It(256)}},class extends We{constructor(){super(...arguments),this.beanName="userCompFactory"}wireBeans(e){this.agCompUtils=e.agCompUtils,this.registry=e.registry,this.frameworkCompWrapper=e.frameworkCompWrapper,this.gridOptions=e.gridOptions}getCompDetailsFromGridOptions(e,t,o,s=!1){return this.getCompDetails(this.gridOptions,e,t,o,s)}getCompDetails(e,t,o,s,i=!1){const{name:n,cellRenderer:r}=t;let a,l,{compName:d,jsComp:c,fwComp:h,paramsFromSelector:u,popupFromSelector:g,popupPositionFromSelector:p}=di(this.beans.frameworkOverrides,e,t,s);const m=e=>{const t=this.registry.getUserComponent(n,e);t&&(c=t.componentFromFramework?void 0:t.component,h=t.componentFromFramework?t.component:void 0,a=t.params,l=t.processParams)};var f;if(null!=d&&m(d),null==c&&null==h&&null!=o&&m(o),!c||!r||(f=c)&&f.prototype&&"getGui"in f.prototype||(c=this.agCompUtils?.adaptFunction(t,c)),!c&&!h){const{validation:e}=this.beans;return void(!i||d===o&&o?o&&!e&&Tt(146,{comp:o}):d?e?.isProvidedUserComp(d)||Tt(50,{compName:d}):o?e||Tt(260,{...this.gos.getModuleErrorParams(),propName:n,compName:o}):Tt(216,{name:n}))}const C=this.mergeParams(e,t,s,u,a,l),v=null==c,w=c??h;return{componentFromFramework:v,componentClass:w,params:C,type:t,popupFromSelector:g,popupPositionFromSelector:p,newAgStackInstance:()=>this.newAgStackInstance(w,v,C,t)}}newAgStackInstance(e,t,o,s){let i;i=!t?new e:this.frameworkCompWrapper.wrap(e,s.mandatoryMethods,s.optionalMethods,s),this.createBean(i);const n=i.init?.(o);return null==n?Zs.resolve(i):n.then(()=>i)}mergeParams(e,t,o,s=null,i,n){const r={...o,...i},a=e?.[t.name+"Params"];return"function"==typeof a?Xe(r,a(o)):"object"==typeof a&&Xe(r,a),Xe(r,s),n?n(r):r}},class extends We{constructor(){super(...arguments),this.beanName="rowContainerHeight",this.scrollY=0,this.uiBodyHeight=0}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=function(){if(void 0!==ji)return ji;if(!document.body)return-1;let e=1e6;const t=tn()?6e6:1e9,o=document.createElement("div");for(document.body.appendChild(o);;){const s=2*e;if(o.style.height=s+"px",s>t||o.clientHeight!==s)break;e=s}return o.remove(),ji=e,e}(),it(this.gos,"RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}updateOffset(){if(!this.stretching)return;const e=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();e===this.scrollY&&t===this.uiBodyHeight||(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;it(this.gos,`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventSvc.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventSvc.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}},class extends We{constructor(){super(...arguments),this.beanName="visibleCols",this.colsAndGroupsMap={},this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.headerGroupRowCount=0,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.isBodyWidthDirty=!0}refresh(e,t=!1){const{colFlex:o,colModel:s,colGroupSvc:i,colViewport:n,selectionColSvc:r}=this.beans;t||this.buildTrees(s,i),i?.updateOpenClosedVisibility(),this.leftCols=Ql(this.treeLeft),this.centerCols=Ql(this.treeCenter),this.rightCols=Ql(this.treeRight),r?.refreshVisibility(this.leftCols,this.centerCols,this.rightCols),this.joinColsAriaOrder(s),this.joinCols(),this.headerGroupRowCount=this.getHeaderRowCount(),this.setLeftValues(e),this.autoHeightCols=this.allCols.filter(e=>e.isAutoHeight()),o?.refreshFlexedColumns(),this.updateBodyWidths(),this.setFirstRightAndLastLeftPinned(s,this.leftCols,this.rightCols,e),n.checkViewportColumns(!1),this.eventSvc.dispatchEvent({type:"displayedColumnsChanged",source:e})}getHeaderRowCount(){if(!this.gos.get("hidePaddedHeaderRows"))return this.beans.colModel.cols.treeDepth;let e=0;for(const t of this.allCols){let o=t.getParent();for(;o;){if(!o.isPadding()){const t=o.getProvidedColumnGroup().getLevel()+1;t>e&&(e=t);break}o=o.getParent()}}return e}updateBodyWidths(){const e=Uo(this.centerCols),t=Uo(this.leftCols),o=Uo(this.rightCols);this.isBodyWidthDirty=this.bodyWidth!==e,this.bodyWidth===e&&this.leftWidth===t&&this.rightWidth===o||(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=o,this.eventSvc.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventSvc.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(t,o,s,i){let n,r;this.gos.get("enableRtl")?(n=o?o[0]:null,r=s?e(s):null):(n=o?e(o):null,r=s?s[0]:null);for(const e of t.getCols())e.setLastLeftPinned(e===n,i),e.setFirstRightPinned(e===r,i)}buildTrees(e,t){const o=e.getColsToShow(),s=o.filter(e=>"left"==e.getPinned()),i=o.filter(e=>"right"==e.getPinned()),n=o.filter(e=>"left"!=e.getPinned()&&"right"!=e.getPinned()),r=new ql,a=e=>t?t.createColumnGroups(e):e.columns;this.treeLeft=a({columns:s,idCreator:r,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=a({columns:i,idCreator:r,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=a({columns:n,idCreator:r,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.leftCols=[],this.rightCols=[],this.centerCols=[],this.allCols=[],this.ariaOrderColumns=[]}joinColsAriaOrder(e){const t=e.getCols(),o=[],s=[],i=[];for(const n of t){const e=n.getPinned();e?!0===e||"left"===e?o.push(n):i.push(n):s.push(n)}this.ariaOrderColumns=o.concat(s).concat(i)}getAriaColIndex(e){let t;return t=Fs(e)?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}setLeftValuesOfGroups(){for(const e of[this.treeLeft,this.treeRight,this.treeCenter])for(const t of e)Fs(t)&&t.checkLeft()}setLeftValuesOfCols(e){const{colModel:t}=this.beans;if(!t.getColDefCols())return;const o=t.getCols().slice(0),s=this.gos.get("enableRtl");for(const i of[this.leftCols,this.rightCols,this.centerCols]){if(s){let t=Uo(i);for(const o of i)t-=o.getActualWidth(),o.setLeft(t,e)}else{let t=0;for(const o of i)o.setLeft(t,e),t+=o.getActualWidth()}Yl(o,i)}for(const i of o)i.setLeft(null,e)}joinCols(){this.gos.get("enableRtl")?this.allCols=this.rightCols.concat(this.centerCols).concat(this.leftCols):this.allCols=this.leftCols.concat(this.centerCols).concat(this.rightCols)}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}isColDisplayed(e){return this.allCols.indexOf(e)>=0}getLeftColsForRow(e){const{leftCols:t,beans:{colModel:o}}=this;return o.colSpanActive?this.getColsForRow(e,t):t}getRightColsForRow(e){const{rightCols:t,beans:{colModel:o}}=this;return o.colSpanActive?this.getColsForRow(e,t):t}getColsForRow(e,t,o,s){const i=[];let n=null;for(let r=0;r1){const e=d-1;for(let o=1;o<=e;o++)c.push(t[r+o]);r+=e}let h;if(o){h=!1;for(const e of c)o(e)&&(h=!0)}else h=!0;h&&(0===i.length&&n&&s&&s(a)&&i.push(n),i.push(a)),n=a}return i}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getColBefore(e){const t=this.allCols,o=t.indexOf(e);return o>0?t[o-1]:null}isPinningLeft(){return this.leftCols.length>0}isPinningRight(){return this.rightCols.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=e=>{this.colsAndGroupsMap[e.getUniqueId()]=e};Zl(this.treeCenter,!1,e),Zl(this.treeLeft,!1,e),Zl(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}getFirstColumn(){const t=this.gos.get("enableRtl"),o=["leftCols","centerCols","rightCols"];t&&o.reverse();for(let s=0;s(t,o)=>{if(!this.isAlive())return;const s=oh.has(t);if(s&&!e||!s&&e)return;if(!function(e){return!!sh[e]}(t))return;const i=(e,t)=>{const o=sh[e],s=this.gridOptions[o];"function"==typeof s&&this.beans.frameworkOverrides.wrapOutgoing(()=>s(t))};if(this.gridReadyFired)i(t,o);else if("gridReady"===t){i(t,o),this.gridReadyFired=!0;for(const e of this.queueEvents)i(e.eventName,e.event);this.queueEvents=[]}else this.queueEvents.push({eventName:t,event:o})}}wireBeans(e){this.gridOptions=e.gridOptions,this.validation=e.validation,this.api=e.gridApi,this.gridId=e.context.getId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){this.validateGridOptions(this.gridOptions),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this),!0),this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:e})=>{this.updateGridOptions({options:e,force:!0,source:"optionsUpdated"})}})}destroy(){super.destroy(),this.queueEvents=[]}get(e){return this.gridOptions[e]??ot[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return a(this.gridOptions[e])}mergeGridCommonParams(e){if(e){return t=>e(this.addCommon(t))}return e}updateGridOptions({options:e,force:t,source:o="api"}){const s={id:wh++,properties:[]},i=[],{gridOptions:n,validation:r}=this;for(const a of Object.keys(e)){const l=tt.applyGlobalGridOption(a,e[a]);r?.warnOnInitialPropertyUpdate(o,a);const d=t||"object"==typeof l&&"api"===o,c=n[a];if(d||c!==l){n[a]=l;const e={type:a,currentValue:l,previousValue:c,changeSet:s,source:o};i.push(e)}}this.validateGridOptions(this.gridOptions),s.properties=i.map(e=>e.type);for(const a of i)it(this,`Updated property ${a.type} from`,a.previousValue," to ",a.currentValue),this.propEventSvc.dispatchEvent(a)}addPropertyEventListener(e,t){this.propEventSvc.addEventListener(e,t)}removePropertyEventListener(e,t){this.propEventSvc.removeEventListener(e,t)}getDomDataKey(){return this.domDataKey}addCommon(e){return e.api=this.api,e.context=this.gridOptionsContext,e}validateOptions(e,t){for(const o of Object.keys(e)){const s=e[o];if(null==s||!1===s)continue;let i=t[o];"function"==typeof i&&(i=i(e,this.gridOptions,this.beans)),i&&this.assertModuleRegistered(i,o)}}validateGridOptions(e){this.validateOptions(e,Ch),this.validation?.processGridOptions(e)}validateColDef(e,t,o){!o&&this.beans.dataTypeSvc?.isColPendingInference(t)||(this.validateOptions(e,rh),this.validation?.validateColDef(e))}assertModuleRegistered(e,t){const o=Array.isArray(e)?e.some(e=>this.isModuleRegistered(e)):this.isModuleRegistered(e);return o||Tt(200,{...this.getModuleErrorParams(),moduleName:e,reasonOrId:t}),o}getModuleErrorParams(){return{gridId:this.gridId,gridScoped:ft(),rowModelType:this.get("rowModelType"),isUmd:!1}}isModuleRegistered(e){return mt(e,this.gridId,this.get("rowModelType"))}setInstanceDomData(e){e[yh]=this.instanceId}isElementInThisInstance(e){let t=e;for(;t;){const e=t[yh];if(a(e))return e===this.instanceId;t=t.parentElement}return!1}},class extends We{constructor(){super(...arguments),this.beanName="colModel",this.pivotMode=!1,this.ready=!1,this.changeEventsDispatching=!1}postConstruct(){this.pivotMode=this.gos.get("pivotMode"),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents","rowNumbers","hidePaddedHeaderRows"],e=>this.refreshAll(Xo(e.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],this.recreateColumnDefs.bind(this)),this.addManagedPropertyListener("pivotMode",e=>this.setPivotMode(this.gos.get("pivotMode"),Xo(e.source)))}createColsFromColDefs(e){const{beans:t}=this,{valueCache:o,colAutosize:s,rowGroupColsSvc:i,pivotColsSvc:n,valueColsSvc:r,visibleCols:a,eventSvc:l,groupHierarchyColSvc:d}=t,c=this.colDefs?bs(t,e):void 0;o?.expire();const h=this.colDefCols?.list,u=this.colDefCols?.tree,g=is(t,this.colDefs,!0,u,e);$o(t,this.colDefCols?.tree,g.columnTree);const p=g.columnTree,m=g.treeDepth,f=Wo(p),C={};for(const v of f)C[v.getId()]=v;this.colDefCols={tree:p,treeDepth:m,list:f,map:C},this.createColumnsForService([d],this.colDefCols,e),i?.extractCols(e,h),n?.extractCols(e,h),r?.extractCols(e,h),this.ready=!0,this.changeEventsDispatching=!0,this.refreshCols(!0,e),this.changeEventsDispatching=!1,a.refresh(e),l.dispatchEvent({type:"columnEverythingChanged",source:e}),c&&(this.changeEventsDispatching=!0,c(),this.changeEventsDispatching=!1),l.dispatchEvent({type:"newColumnsLoaded",source:e}),"gridInitializing"===e&&s?.applyAutosizeStrategy()}refreshCols(e,o){if(!this.colDefCols)return;const s=this.cols?.tree;this.saveColOrder();const{autoColSvc:i,selectionColSvc:n,rowNumbersSvc:r,quickFilter:a,pivotResultCols:l,showRowGroupCols:d,rowAutoHeight:c,visibleCols:h,colViewport:u,eventSvc:g,formula:p}=this.beans,m=this.selectCols(l,this.colDefCols);p?.setFormulasActive(m),this.createColumnsForService([i,n,r],m,o);const f=(C=this.gos,this.showingPivotResult?!C.get("enableStrictPivotColumnOrder"):C.get("maintainColumnOrder"));var C;e&&!f||this.restoreColOrder(m),this.positionLockedCols(m),d?.refresh(),a?.refreshCols(),this.setColSpanActive(),c?.setAutoHeightActive(m),h.clear(),u.clear(),t(s,this.cols.tree)||g.dispatchEvent({type:"gridColumnsChanged"})}createColumnsForService(e,t,o){for(const s of e)s&&(s.createColumns(t,e=>{this.lastOrder=e(this.lastOrder),this.lastPivotOrder=e(this.lastPivotOrder)},o),s.addColumns(t))}selectCols(e,t){const o=e?.getPivotResultCols()??null;this.showingPivotResult=null!=o;const{map:s,list:i,tree:n,treeDepth:r}=o??t;return this.cols={list:i.slice(),map:{...s},tree:n.slice(),treeDepth:r},o&&(o.list.some(e=>void 0!==this.cols?.map[e.getColId()])||(this.lastPivotOrder=null)),this.cols}getColsToShow(){if(!this.cols)return[];const{beans:e,showingPivotResult:t,cols:o}=this,{valueColsSvc:s,selectionColSvc:i}=e,n=this.isPivotMode()&&!t,r=i?.isSelectionColumnEnabled(),a=function({gos:e,formula:t}){const o=e.get("rowNumbers");return o||!!t?.active&&!1!==o}(e),l=s?.columns;return o.list.filter(e=>{const t=jo(e);if(n){const o=l?.includes(e);return t||o||r&&Ko(e)||a&&_o(e)}return t||e.isVisible()})}refreshAll(e){this.ready&&(this.refreshCols(!1,e),this.beans.visibleCols.refresh(e))}setColsVisible(e,t=!1,o){ws(this.beans,{state:e.map(e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t}))},o)}restoreColOrder(e){const t=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!t)return;const o=t.filter(t=>null!=e.map[t.getId()]);if(0===o.length)return;if(o.length===e.list.length)return void(e.list=o);const s=e=>{const t=e.getOriginalParent();return!!t&&(t.getChildren().length>1||s(t))};if(!o.some(e=>s(e))){const t=new Set(o);for(const s of e.list)t.has(s)||o.push(s);return void(e.list=o)}const i=/* @__PURE__ */new Map;for(let h=0;h!i.has(e));if(0===n.length)return void(e.list=o);const r=(e,t)=>{const o=t?t.getOriginalParent():e.getOriginalParent();if(!o)return null;let s=null,n=null;for(const r of o.getChildren())if(r!==t&&r!==e){if(r instanceof Mo){const e=i.get(r);if(null==e)continue;(null==s||s{const t=i.get(e);null!=t&&(null==s||s=0;h--)d[c--]=a[h];for(let h=o.length-1;h>=0;h--){const e=o[h],t=l.get(e);if(t)if(Array.isArray(t))for(let o=t.length-1;o>=0;o--){const e=t[o];d[c--]=e}else d[c--]=t;d[c--]=e}e.list=d}positionLockedCols(e){e.list=gs(e.list,this.gos)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list??null:this.lastOrder=this.cols?.list??null}getColumnDefs(e){return this.colDefCols&&this.beans.colDefFactory?.getColumnDefs(this.colDefCols.list,this.showingPivotResult,this.lastOrder,this.cols?.list??[],e)}setColSpanActive(){this.colSpanActive=!!this.cols?.list.some(e=>null!=e.getColDef().colSpan)}isPivotMode(){return this.pivotMode}setPivotMode(e,t){if(e===this.pivotMode)return;if(this.pivotMode=e,!this.ready)return;this.refreshCols(!1,t);const{visibleCols:o,eventSvc:s}=this.beans;o.refresh(t),s.dispatchEvent({type:"columnPivotModeChanged"})}isPivotActive(){const e=this.beans.pivotColsSvc?.columns;return this.pivotMode&&!!e?.length}recreateColumnDefs(e){if(!this.cols)return;this.beans.autoColSvc?.updateColumns(e);const t=Xo(e.source);this.createColsFromColDefs(t)}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){$o(this.beans,this.colDefCols?.tree),super.destroy()}getColTree(){return this.cols?.tree??[]}getColDefColTree(){return this.colDefCols?.tree??[]}getColDefCols(){return this.colDefCols?.list??null}getCols(){return this.cols?.list??[]}forAllCols(e){const{pivotResultCols:t,autoColSvc:s,selectionColSvc:i,groupHierarchyColSvc:n}=this.beans;o(this.colDefCols?.list,e)||o(s?.columns?.list,e)||o(i?.columns?.list,e)||o(n?.columns?.list,e)||o(t?.getPivotResultCols()?.list,e)}getColsForKeys(e){return e?e.map(e=>this.getCol(e)).filter(e=>null!=e):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return null==e?null:this.getColFromCollection(e,this.cols)}getColById(e){return this.cols?.map[e]??null}getColFromCollection(e,t){if(null==t)return null;const{map:o,list:s}=t;if("string"==typeof e&&o[e])return o[e];for(let a=0;a{const e=()=>{for(const e of this.getAllCellCtrls())e.onCellSelectionChanged()},t=()=>{for(const e of this.getAllCellCtrls())e.updateRangeBordersIfRangeCount()},o=()=>{this.eventSvc.addListener("cellSelectionChanged",e),this.eventSvc.addListener("columnMoved",t),this.eventSvc.addListener("columnPinned",t),this.eventSvc.addListener("columnVisible",t)},s=()=>{this.eventSvc.removeListener("cellSelectionChanged",e),this.eventSvc.removeListener("columnMoved",t),this.eventSvc.removeListener("columnPinned",t),this.eventSvc.removeListener("columnVisible",t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{no(this.gos)?o():s()}),no(this.gos)&&o()}}wireBeans(e){this.pageBounds=e.pageBounds,this.colModel=e.colModel,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusSvc=e.focusSvc,this.rowContainerHeight=e.rowContainerHeight,this.ctrlsSvc=e.ctrlsSvc,this.editSvc=e.editSvc}postConstruct(){this.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),pinnedRowsChanged:this.onPinnedRowsChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this,{})}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListener("suppressCellFocus",e=>this.onSuppressCellFocusChanged(e.currentValue)),this.addManagedPropertyListeners(["groupSuppressBlankHeader","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.addManagedPropertyListener("cellSelection",({currentValue:e,previousValue:t})=>{(!t&&e||t&&!e)&&this.redrawRows()});const{stickyRowSvc:e,gos:t,showRowGroupCols:o}=this.beans;if(o&&this.addManagedPropertyListener("showOpenedGroup",()=>{const e=o.columns;e.length&&this.refreshCells({columns:e,force:!0})}),e)this.stickyRowFeature=e.createStickyRowFeature(this,this.createRowCon.bind(this),this.destroyRowCtrls.bind(this));else{const e=this.gridBodyCtrl;e.setStickyTopHeight(0),e.setStickyBottomHeight(0)}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=Nt(t,"print"),this.embedFullWidthRows=this.printLayout||t.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount();this.cachedRowCtrls=new Eu(null!=e?e:3)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?.stickyTopRowCtrls??[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?.stickyBottomRowCtrls??[]}updateAllRowCtrls(){const e=Object.values(this.rowCtrlsByRowIndex),t=Object.values(this.zombieRowCtrls),o=this.cachedRowCtrls?.getEntries()??[];t.length>0||o.length>0?this.allRowCtrls=[...e,...t,...o]:this.allRowCtrls=e}isCellBeingRendered(e,t){const o=this.rowCtrlsByRowIndex[e];return t&&o?!!o.isFullWidth()||(!!this.beans.spannedRowRenderer?.getCellByPosition({rowIndex:e,column:t,rowPinned:null})||!!o.getCellCtrl(t)||!o.isRowRendered()):!!o}updateCellFocus(e){for(const t of this.getAllCellCtrls())t.onCellFocused(e);for(const t of this.getFullWidthRowCtrls())t.onFullWidthRowFocused(e)}onCellFocusChanged(e){if(null!=e?.rowIndex&&!e.rowPinned){const t=this.beans.colModel.getCol(e.column)??void 0;this.isCellBeingRendered(e.rowIndex,t)||this.redraw()}this.updateCellFocus(e)}onSuppressCellFocusChanged(e){for(const t of this.getAllCellCtrls())t.onSuppressCellFocusChanged(e);for(const t of this.getFullWidthRowCtrls())t.onSuppressCellFocusChanged(e)}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>this.onCellFocusChanged(e),cellFocusCleared:()=>this.updateCellFocus(),flashCells:e=>{const{cellFlashSvc:t}=this.beans;if(t)for(const o of this.getAllCellCtrls())t.onFlashCells(o,e)},columnHoverChanged:()=>{for(const e of this.getAllCellCtrls())e.onColumnHover()},displayedColumnsChanged:()=>{for(const e of this.getAllCellCtrls())e.onDisplayedColumnsChanged()},displayedColumnsWidthChanged:()=>{if(this.printLayout)for(const e of this.getAllCellCtrls())e.onLeftChanged()}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){for(const e of this.destroyFuncsForColumnListeners)e();this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();const e=this.colModel.getCols();for(const t of e){const e=e=>{for(const o of this.getAllCellCtrls())o.column===t&&e(o)},o=()=>{e(e=>e.onLeftChanged())},s=()=>{e(e=>e.onWidthChanged())},i=()=>{e(e=>e.onFirstRightPinnedChanged())},n=()=>{e(e=>e.onLastLeftPinnedChanged())},r=()=>{e(e=>e.onColDefChanged())};t.__addEventListener("leftChanged",o),t.__addEventListener("widthChanged",s),t.__addEventListener("firstRightPinnedChanged",i),t.__addEventListener("lastLeftPinnedChanged",n),t.__addEventListener("colDefChanged",r),this.destroyFuncsForColumnListeners.push(()=>{t.__removeEventListener("leftChanged",o),t.__removeEventListener("widthChanged",s),t.__removeEventListener("firstRightPinnedChanged",i),t.__removeEventListener("lastLeftPinnedChanged",n),t.__removeEventListener("colDefChanged",r)})}}onDomLayoutChanged(){const e=Nt(this.gos,"print"),t=e||this.gos.get("embedFullWidthRows"),o=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,o&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsNotSpanningForColumn(e){const t=[];for(const o of this.getAllRowCtrls()){const s=o.getCellCtrl(e,!0)?.eGui;s&&t.push(s)}return t}refreshFloatingRowComps(e=!0){this.refreshFloatingRows(this.topRowCtrls,"top",e),this.refreshFloatingRows(this.bottomRowCtrls,"bottom",e)}refreshFloatingRows(e,t,o){const{pinnedRowModel:s,beans:i,printLayout:n}=this,r=Object.fromEntries(e.map(e=>[e.rowNode.id,e]));s?.forEachPinnedRow(t,(a,l)=>{const d=e[l];d&&void 0===s.getPinnedRowById(d.rowNode.id,t)&&(d.destroyFirstPass(),d.destroySecondPass()),a.id in r&&o?(e[l]=r[a.id],delete r[a.id]):e[l]=new du(a,i,!1,!1,n)}),e.length=("top"===t?s?.getPinnedTopRowCount():s?.getPinnedBottomRowCount())??0}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}onPinnedRowsChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature?.refreshStickyNode(e);else{if(this.cachedRowCtrls?.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const o=t[e.rowIndex];o&&o.rowNode===e&&(o.destroyFirstPass(),o.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){const{editSvc:t}=this.beans;if(t?.isEditing()&&(t.isBatchEditing()?t.cleanupEditors():t.stopEditing(void 0,{source:"api"})),null==e)this.redrawAfterModelUpdate();else{for(const t of e??[])this.redrawRow(t,!0);this.dispatchDisplayedRowsChanged(!1)}}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.beans.focusSvc?.getFocusCellToUseAfterRefresh();this.updateContainerHeights(),this.scrollToTopIfNewData(e);const o=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&$t(this.gos),i=o?this.getRowsToRecycle():null;o||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender();const{stickyRowFeature:n,gos:r}=this;if(n){n.checkStickyRows();const e=n.extraTopHeight+n.extraBottomHeight;e&&this.updateContainerHeights(e)}this.recycleRows(i,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(r.get("enableRowPinning")?o:void 0),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,o=this.gos.get("suppressScrollOnNewData");t&&!o&&(this.gridBodyCtrl.scrollFeature.scrollToTop(),this.stickyRowFeature?.resetOffsets())}updateContainerHeights(e=0){const{rowContainerHeight:t}=this;if(this.printLayout)return void t.setModelHeight(null);let o=this.pageBounds.getCurrentPageHeight();0===o&&(o=1),t.setModelHeight(o+e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error(It(252));this.refreshInProgress=!0,this.beans.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.beans.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){if(!e)return;const t=this.beans.focusSvc,o=this.findPositionToFocus(e);o?e.rowIndex===o.rowIndex&&e.rowPinned==o.rowPinned?t.doesRowOrCellHaveBrowserFocus()||this.updateCellFocus(wo(this.gos,{...o,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"})):t.setFocusedCell({...o,preventScrollOnBrowserFocus:!0,forceBrowserFocus:!0}):t.focusHeaderPosition({headerPosition:{headerRowIndex:Wn(this.beans)-1,column:e.column}})}findPositionToFocus(e){const{pagination:t,pageBounds:o}=this.beans;let s=e;for(null==s.rowPinned&&t&&o&&!t.isRowInPage(s.rowIndex)&&(s={rowPinned:null,rowIndex:o.getFirstRow()});s;){if(null==s.rowPinned&&o)if(s.rowIndexo.getLastRow()&&(s={rowPinned:null,rowIndex:o.getLastRow()});const t=this.getRowByPosition(s);if(t?.isAlive())return{...t.getRowPosition(),column:e.column};s=Ln(this.beans,s)}return null}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),o=t.length;for(let s=0;sAu(e.rowNode,t)):o}getCellCtrls(e,t){let o;a(t)&&(o={},t.forEach(e=>{const t=this.colModel.getCol(e);a(t)&&(o[t.getId()]=!0)}));const s=[];for(const i of this.getRowCtrls(e))for(const e of i.getAllCellCtrls()){const t=e.column.getId();o&&!o[t]||s.push(e)}return s}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(e=!1){const t=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(t,e),this.stickyRowFeature?.destroyStickyCtrls()}getRowsToRecycle(){const e=[];for(const o of Object.keys(this.rowCtrlsByRowIndex))null==this.rowCtrlsByRowIndex[o].rowNode.id&&e.push(o);this.removeRowCtrls(e);const t={};for(const o of Object.values(this.rowCtrlsByRowIndex)){t[o.rowNode.id]=o}return this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){for(const o of e){const e=this.rowCtrlsByRowIndex[o];e&&(e.destroyFirstPass(t),e.destroySecondPass()),delete this.rowCtrlsByRowIndex[o]}}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{focusSvc:t,animationFrameSvc:o}=this.beans,{afterScroll:s}=e;let i;const n=this.stickyRowFeature;n&&(i=t?.getFocusCellToUseAfterRefresh()||void 0);const r=this.firstRenderedRow,a=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let l=!1;if(n){l=n.checkStickyRows();const e=n.extraTopHeight+n.extraBottomHeight;e&&this.updateContainerHeights(e)}const d=this.firstRenderedRow!==r||this.lastRenderedRow!==a;if((!s||l||d)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,s),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(s&&!l),null!=i)){const e=t?.getFocusCellToUseAfterRefresh();null!=i&&null==e&&(o?.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const o={};for(const i of e)o[i]=!0;const s=Object.keys(this.rowCtrlsByRowIndex).filter(e=>!o[e]);this.removeRowCtrls(s,t)}calculateIndexesToDraw(e){const t=[];for(let r=this.firstRenderedRow;r<=this.lastRenderedRow;r++)t.push(r);const o=this.beans.pagination,s=this.beans.focusSvc?.getFocusedCell()?.rowIndex;null!=s&&(sthis.lastRenderedRow)&&(!o||o.isRowInPage(s))&&s{const o=e.rowNode.rowIndex;null!=o&&o!==s&&(othis.lastRenderedRow)&&this.doNotUnVirtualiseRow(e)&&t.push(o)};for(const r of Object.values(this.rowCtrlsByRowIndex))i(r);if(e)for(const r of Object.values(e))i(r);t.sort((e,t)=>e-t);const n=[];for(let r=0;r{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){this.eventSvc.dispatchEvent({type:"displayedRowsChanged",afterScroll:e})}onDisplayedColumnsChanged(){const{visibleCols:e}=this.beans,t=e.isPinningLeft(),o=e.isPinningRight();this.pinningLeft===t&&o===this.pinningRight||(this.pinningLeft=t,this.pinningRight=o,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];for(const t of this.getFullWidthRowCtrls()){const o=t.rowNode.rowIndex;e.push(o.toString())}this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=Tu(e);return this.getAllRowCtrls().filter(e=>{if(!e.isFullWidth())return!1;const o=e.rowNode;return!(null!=t&&!Au(o,t))})}createOrUpdateRowCtrl(e,t,o,s){let i,n=this.rowCtrlsByRowIndex[e];if(n||(i=this.rowModel.getRow(e),a(i)&&a(t)&&t[i.id]&&i.alreadyRendered&&(n=t[i.id],t[i.id]=null)),!n){if(i||(i=this.rowModel.getRow(e)),!a(i))return;n=this.createRowCon(i,o,s)}i&&(i.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=n}destroyRowCtrls(e,t){const o=[];if(e)for(const s of Object.values(e))if(s)if(this.cachedRowCtrls&&s.isCacheable())this.cachedRowCtrls.addRow(s);else if(s.destroyFirstPass(!t),t){const e=s.instanceId;this.zombieRowCtrls[e]=s,o.push(()=>{s.destroySecondPass(),delete this.zombieRowCtrls[e]})}else s.destroySecondPass();t&&(o.push(()=>{this.isAlive()&&(this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged())}),window.setTimeout(()=>{for(const e of o)e()},400))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*Vt(this.beans)}workOutFirstAndLastRowsToRender(){const{rowContainerHeight:e,pageBounds:t,rowModel:o}=this;let s,i;if(e.updateOffset(),o.isRowsToRender())if(this.printLayout)this.beans.environment.refreshRowHeightVariable(),s=t.getFirstRow(),i=t.getLastRow();else{const n=this.getRowBufferInPixels(),r=this.ctrlsSvc.getScrollFeature(),a=this.gos.get("suppressRowVirtualisation");let l,d,c=!1;do{const o=t.getPixelOffset(),{pageFirstPixel:s,pageLastPixel:i}=t.getCurrentPagePixelRange(),h=e.divStretchOffset,u=r.getVScrollPosition(),g=u.top,p=u.bottom;a?(l=s+h,d=i+h):(l=Math.max(g+o-n,s)+h,d=Math.min(p+o+n,i)+h),this.firstVisibleVPixel=Math.max(g+o,s)+h,this.lastVisibleVPixel=Math.min(p+o,i)+h,c=this.ensureAllRowsInRangeHaveHeightsCalculated(l,d)}while(c);let h=o.getRowIndexAtPixel(l),u=o.getRowIndexAtPixel(d);const g=t.getFirstRow(),p=t.getLastRow();hp&&(u=p),s=h,i=u}else s=0,i=-1;const n=Nt(this.gos,"normal"),r=this.gos.get("suppressMaxRenderedRowRestriction"),a=Math.max(this.getRowBuffer(),500);n&&!r&&i-s>a&&(i=s+a);const l=s!==this.firstRenderedRow,d=i!==this.lastRenderedRow;(l||d)&&(this.firstRenderedRow=s,this.lastRenderedRow=i,this.eventSvc.dispatchEvent({type:"viewportChanged",firstRow:s,lastRow:i}))}dispatchFirstDataRenderedEvent(){this.dataFirstRenderedFired||(this.dataFirstRenderedFired=!0,ye(this.beans,()=>{this.beans.eventSvc.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const o=this.pinnedRowModel?.ensureRowHeightsValid(),s=this.stickyRowFeature?.ensureRowHeightsValid(),{pageBounds:i,rowModel:n}=this,r=n.ensureRowHeightsValid(e,t,i.getFirstRow(),i.getLastRow());return(r||s)&&this.eventSvc.dispatchEvent({type:"recalculateRowBounds"}),!!(s||r||o)&&(this.updateContainerHeights(),!0)}doNotUnVirtualiseRow(e){const t=!1,o=e.rowNode,s=this.focusSvc.isRowFocused(o.rowIndex,o.rowPinned),i=this.editSvc?.isEditing(e),n=o.detail;return(s||i||n)&&!!this.isRowPresent(o)||t}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(this.beans.pagination?.isRowInPage(e.rowIndex)??!0)}createRowCon(e,t,o){const s=this.cachedRowCtrls?.getRow(e)??null;if(s)return s;const i=o&&!this.printLayout&&!!this.beans.animationFrameSvc?.active;return new du(e,this.beans,t,i,this.printLayout)}getRenderedNodes(){const e=Object.values(this.rowCtrlsByRowIndex).map(e=>e.rowNode);return[...this.getStickyTopRowCtrls().map(e=>e.rowNode),...e,...this.getStickyBottomRowCtrls().map(e=>e.rowNode)]}getRowByPosition(e){let t;const{rowIndex:o}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[o];break;case"bottom":t=this.bottomRowCtrls[o];break;default:t=this.rowCtrlsByRowIndex[o],t||(t=this.getStickyTopRowCtrls().find(e=>e.rowNode.rowIndex===o)||null,t||(t=this.getStickyBottomRowCtrls().find(e=>e.rowNode.rowIndex===o)||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const o=e>this.lastRenderedRow;return!(tthis.callColumnCellValueChangedHandler(e);this.eventSvc.addListener("cellValueChanged",o,!0),this.addDestroyFunc(()=>this.eventSvc.removeListener("cellValueChanged",o,!0)),this.addManagedPropertyListener("treeData",e=>this.isTreeData=e.currentValue)}getValueForDisplay(e){const t=this.beans,o=e.column,s=e.node,i=t.showRowGroupColValueSvc,n=!o&&s.group,r=o?.colDef.showRowGroup,a=!this.isTreeData||s.footer;if(i&&a&&(n||r)){const t=i.getGroupValue(s,o,this.displayIgnoresAggData(s));return null==t?{value:null,valueFormatted:null}:{value:t.value,valueFormatted:e.includeValueFormatted?i.formatAndPrefixGroupColValue(t,o,e.exporting):null}}if(!o)return{value:s.key,valueFormatted:null};let l=this.getValue(o,s,e.from,this.displayIgnoresAggData(s)),d=l;const c=t.formula;o.isAllowFormula()&&c?.isFormula(l)&&(e.useRawFormula?(l=c.normaliseFormula(l,!0),d=c.resolveValue(o,s)):(l=c.resolveValue(o,s),d=l));return{value:l,valueFormatted:e.includeValueFormatted&&!(e.exporting&&!1===o.colDef.useValueFormatterForExport)?this.formatValue(o,s,d):null}}getValue(e,t,o,s=!1){if(this.initialised||this.init(),!t)return;const i=e.getColDef();if(!t.group){const t=i.pivotValueColumn;t&&(e=t)}const n=this.editSvc?.getPendingEditValue(t,e,o);if(void 0!==n)return n;const r=i.showRowGroup;if("string"==typeof r&&(this.beans.rowGroupColsSvc?.getColumnIndex(r)??-1)>t.level)return null;let a=this.resolveValue(e,t,s);if(this.cellExpressions&&C(a)){const o=a.substring(1);a=this.executeValueGetter(o,t.data,e,t)}return a}getFormulaFromDataSource(e,t){const o=this.formulaDataSvc;if(!o?.hasDataSource()||!e.isAllowFormula())return;const s=o.getFormula({column:e,rowNode:t});return C(s)?s:void 0}displayIgnoresAggData(e){return!(!e.group||!e.expanded||e.footer)&&((!e.leafGroup||!this.colModel.isPivotMode())&&(!!e.sibling&&!this.gos.get("groupSuppressBlankHeader")))}resolveValue(e,t,o){const s=e.getColDef(),i=e.getColId(),n=this.isTreeData,r=this.getFormulaFromDataSource(e,t);if(void 0!==r)return r;const a=!o&&t.aggData&&void 0!==t.aggData[i];if(n&&a)return t.aggData[i];const l=t.data,d=s.field;if(n&&s.valueGetter)return this.executeValueGetter(s.valueGetter,l,e,t);if(n&&d&&l)return hd(l,d,e.isFieldContainsDots());const c=t.groupData;if(c&&i in c)return t.groupData[i];if(a)return t.aggData[i];const h=s.showRowGroup,u="string"!=typeof h||!t.group,g=this.isSsrm&&o&&!!s.aggFunc,p=this.isSsrm&&t.footer&&t.field&&(!0===h||h===t.field);if(s.valueGetter&&!g){if(!u)return;return this.executeValueGetter(s.valueGetter,l,e,t)}if(p)return hd(l,t.field,e.isFieldContainsDots());if(d&&l&&!g){if(!u)return;return hd(l,d,e.isFieldContainsDots())}}parseValue(e,t,o,s){const i=e.getColDef();if(i.allowFormula&&this.beans.formula?.isFormula(o))return o;const n=i.valueParser;if(a(n)){const r=wo(this.gos,{node:t,data:t?.data,oldValue:s,newValue:o,colDef:i,column:e});return"function"==typeof n?n(r):this.expressionSvc?.evaluate(n,r)}return o}getDeleteValue(e,t){return a(e.getColDef().valueParser)?this.parseValue(e,t,"",this.getValueForDisplay({column:e,node:t,from:"edit"}).value)??null:null}formatValue(e,t,o,s,i=!0){const{expressionSvc:n}=this.beans;let r,a=null;const l=e.getColDef();if(s?r=s:i&&(r=l.valueFormatter),r){const s=t?t.data:null,i=wo(this.gos,{value:o,node:t,data:s,colDef:l,column:e});a="function"==typeof r?r(i):n?n.evaluate(r,i):null}else if(l.refData)return l.refData[o]||"";return null==a&&Array.isArray(o)&&(a=o.join(", ")),a}setValue(e,t,o,s){const i=t.getColDef();if(!e.data&&this.canCreateRowNodeData(e,i)&&(e.data={}),!this.isSetValueSupported({column:t,newValue:o,colDef:i}))return!1;const n=this.getValue(t,e,"data"),r=wo(this.gos,{node:e,data:e.data,oldValue:n,newValue:o,colDef:i,column:t}),a=e.group?i.groupRowValueSetter:void 0;let l=!1,d=!1;if(e.data){const n=this.handleExternalFormulaChange({column:t,eventSource:s,newValue:o,setterParams:r,rowNode:e});if(null!==n)return n;l=this.computeValueChange({column:t,rowNode:e,newValue:o,params:r,rowData:e.data,valueSetter:i.valueSetter,field:i.field})??!0}return a&&(d=a(wo(this.gos,{node:e,data:e.data,oldValue:n,newValue:o,colDef:i,column:t,eventSource:s,valueChanged:l||o!==n,aggregatedChildren:this.beans.aggStage?.getAggregatedChildren(e,t)??[]}))??!0),!(!l&&!d)&&this.finishValueChange(e,t,r,s)}canCreateRowNodeData(e,t){return!e.group||null==t.groupRowValueSetter&&null==t.groupRowEditable&&!t.pivotValueColumn}finishValueChange(e,t,o,s){e.resetQuickFilterAggregateText(),this.valueCache?.onDataChanged();const i=this.getValue(t,e,"data");return this.dispatchCellValueChangedEvent(e,o,i,s),e.pinnedSibling&&this.dispatchCellValueChangedEvent(e.pinnedSibling,o,i,s),!0}isSetValueSupported(e){const{column:t,newValue:o,colDef:s}=e,{field:i,valueSetter:n}=s,r=this.beans.formula,a=t.isAllowFormula()&&r?.isFormula(o),d=!!this.formulaDataSvc?.hasDataSource();return!l(i)||!l(n)||d&&a?!(this.dataTypeSvc&&!this.dataTypeSvc.checkType(t,o))||(Et(135),!1):(Et(17),!1)}handleExternalFormulaChange(e){const{column:t,rowNode:o,newValue:s,eventSource:i,setterParams:n}=e,r=this.beans.formula,d=this.formulaDataSvc;if(!d?.hasDataSource()||!t.isAllowFormula())return null;const c=r?.isFormula(s),h=d.getFormula({column:t,rowNode:o});if(c){if(h===s)return!1;d.setFormula({column:t,rowNode:o,formula:s});const e=r?.resolveValue(t,o),c=t.getColDef();if(a(c.valueSetter)||!l(c.field)){const s={...n,newValue:e};this.computeValueChange({column:t,rowNode:o,newValue:e,params:s,rowData:o.data,valueSetter:c.valueSetter,field:c.field})}return this.finishValueChange(o,t,n,i)}return void 0!==h&&d.setFormula({column:t,rowNode:o,formula:void 0}),null}computeValueChange(e){const{valueSetter:t,params:o,rowData:s,field:i,column:n,newValue:r}=e;return a(t)?"function"==typeof t?t(o):this.expressionSvc?.evaluate(t,o):!!s&&this.setValueUsingField(s,i,r,n.isFieldContainsDots())}dispatchCellValueChangedEvent(e,t,o,s){this.eventSvc.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:t.column,colDef:t.colDef,data:e.data,node:e,oldValue:t.oldValue,newValue:o,value:o,source:s})}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.beans.frameworkOverrides.wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,context:e.context})})}setValueUsingField(e,t,o,s){if(!t)return!1;let i=!1;if(s){const s=t.split(".");let n=e;for(;s.length>0&&n;){const e=s.shift();0===s.length?(i=n[e]===o,i||(n[e]=o)):n=n[e]}}else i=e[t]===o,i||(e[t]=o);return!i}executeValueGetterWithValueCache(e,t,o,s){const i=o.getColId(),n=this.valueCache.getValue(s,i);if(void 0!==n)return n;const r=this.executeValueGetterWithoutValueCache(e,t,o,s);return this.valueCache.setValue(s,i,r),r}executeValueGetterWithoutValueCache(e,t,o,s){const i=wo(this.gos,{data:t,node:s,column:o,colDef:o.getColDef(),getValue:e=>this.getValueCallback(s,e)});let n;return n="function"==typeof e?e(i):this.expressionSvc?.evaluate(e,i),n}getValueCallback(e,t){const o=this.colModel.getColDefCol(t);return o?this.getValue(o,e,"data"):null}getKeyForNode(e,t){const o=this.getValue(e,t,"data"),s=e.getColDef().keyCreator;let i=o;return s&&(i=s(wo(this.gos,{value:o,colDef:e.getColDef(),column:e,node:t,data:t.data}))),"string"==typeof i||null==i||(i=String(i),"[object Object]"===i&&Et(121)),i}},class extends We{constructor(){super(...arguments),this.beanName="focusSvc",this.focusFallbackTimeout=null,this.needsFocusRestored=!1}wireBeans(e){this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.rowRenderer=e.rowRenderer,this.navigation=e.navigation,this.filterManager=e.filterManager,this.overlays=e.overlays}postConstruct(){const e=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:e,columnRowGroupChanged:e}),this.addDestroyFunc(un(this.beans))}attemptToRecoverFocus(){this.needsFocusRestored=!0,null!=this.focusFallbackTimeout&&clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=window.setTimeout(this.setFocusRecovered.bind(this),100)}setFocusRecovered(){this.needsFocusRestored=!1,null!=this.focusFallbackTimeout&&(clearTimeout(this.focusFallbackTimeout),this.focusFallbackTimeout=null)}shouldTakeFocus(){return this.gos.get("suppressFocusAfterRefresh")?(this.setFocusRecovered(),!1):this.needsFocusRestored?(this.setFocusRecovered(),!0):this.doesRowOrCellHaveBrowserFocus()}onColumnEverythingChanged(){if(!this.focusedCell)return;const e=this.focusedCell.column;e!==this.colModel.getCol(e.getId())&&this.clearFocusedCell()}getFocusCellToUseAfterRefresh(){const{gos:e,focusedCell:t}=this;return e.get("suppressFocusAfterRefresh")||e.get("suppressCellFocus")||!t?null:this.doesRowOrCellHaveBrowserFocus()?t:null}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeader?null:this.isDomDataPresentInHierarchy(w(this.beans),ur)?this.focusedHeader:null}doesRowOrCellHaveBrowserFocus(){const e=w(this.beans);return!!this.isDomDataPresentInHierarchy(e,fa,!0)||this.isDomDataPresentInHierarchy(e,va,!0)}isDomDataPresentInHierarchy(e,t,o){let s=e;for(;s;){const e=Wt(this.gos,s,t);if(e)return!e.destroyed||!o||(this.attemptToRecoverFocus(),!1);s=s.parentNode}return!1}getFocusedCell(){return this.focusedCell}getFocusEventParams(e){const{rowIndex:t,rowPinned:o,column:s}=e,i={rowIndex:t,rowPinned:o,column:s,isFullWidthCell:!1},n=this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:o});return n&&(i.isFullWidthCell=n.isFullWidth()),i}clearFocusedCell(){if(null==this.focusedCell)return;const e=this.getFocusEventParams(this.focusedCell);this.focusedCell=null,this.eventSvc.dispatchEvent({type:"cellFocusCleared",...e})}setFocusedCell(e){this.setFocusRecovered();const{column:t,rowIndex:o,rowPinned:s,forceBrowserFocus:i=!1,preventScrollOnBrowserFocus:n=!1,sourceEvent:a}=e,l=this.colModel.getCol(t);if(!l)return void(this.focusedCell=null);this.focusedCell={rowIndex:o,rowPinned:r(s),column:l};const d=this.getFocusEventParams(this.focusedCell);this.eventSvc.dispatchEvent({type:"cellFocused",...d,...this.previousCellFocusParams&&{previousParams:this.previousCellFocusParams},forceBrowserFocus:i,preventScrollOnBrowserFocus:n,sourceEvent:a}),this.previousCellFocusParams=d}isCellFocused(e){return null!=this.focusedCell&&Mn(e,this.focusedCell)}isHeaderWrapperFocused(e){if(null==this.focusedHeader)return!1;const{column:t,rowCtrl:{rowIndex:o,pinned:s}}=e,{column:i,headerRowIndex:n}=this.focusedHeader;return t===i&&o===n&&s==i.getPinned()}focusHeaderPosition(e){if(this.setFocusRecovered(),Hn(this.beans))return!1;const{direction:t,fromTab:o,allowUserOverride:s,event:i,fromCell:n,rowWithoutSpanValue:r,scroll:a=!0}=e;let{headerPosition:l}=e;if(n&&this.filterManager?.isAdvFilterHeaderActive())return this.focusAdvancedFilter(l);if(s){const e=this.focusedHeader,s=Wn(this.beans);if(o){const o=this.gos.getCallback("tabToNextHeader");o&&(l=this.getHeaderPositionFromUserFunc({userFunc:o,direction:t,currentPosition:e,headerPosition:l,headerRowCount:s}))}else{const t=this.gos.getCallback("navigateToNextHeader");t&&i&&(l=t({key:i.key,previousHeaderPosition:e,nextHeaderPosition:l,headerRowCount:s,event:i}))}}return!!l&&this.focusProvidedHeaderPosition({headerPosition:l,direction:t,event:i,fromCell:n,rowWithoutSpanValue:r,scroll:a})}focusHeaderPositionFromUserFunc(e){if(Hn(this.beans))return!1;const{userFunc:t,headerPosition:o,direction:s,event:i}=e,n=this.focusedHeader,r=Wn(this.beans),a=this.getHeaderPositionFromUserFunc({userFunc:t,direction:s,currentPosition:n,headerPosition:o,headerRowCount:r});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:s,event:i})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:o,currentPosition:s,headerPosition:i,headerRowCount:n}=e,r=t({backwards:"Before"===o,previousHeaderPosition:s,nextHeaderPosition:i,headerRowCount:n});return!0===r?s:!1===r?null:r}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:o,fromCell:s,rowWithoutSpanValue:i,event:n,scroll:r=!0}=e,{column:a,headerRowIndex:l}=t,{filterManager:d,ctrlsSvc:c,headerNavigation:h}=this.beans;if(this.focusedHeader&&(u=e.headerPosition,g=this.focusedHeader,u.headerRowIndex===g.headerRowIndex&&u.column===g.column))return!1;var u,g;if(-1===l)return d?.isAdvFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView({column:a,event:n});r&&h?.scrollToColumn(a,o);const p=c.getHeaderRowContainerCtrl(a.getPinned())?.focusHeader(t.headerRowIndex,a,n)||!1;return h&&p&&(null!=i||s)&&(h.currentHeaderRowWithoutSpan=i??-1),p}focusFirstHeader(){if(this.overlays?.exclusive&&this.focusOverlay())return!0;const e=this.visibleCols.allCols[0];if(!e)return!1;const t=th(this.beans,e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(t){if(this.overlays?.exclusive&&this.focusOverlay(!0))return!0;const o=Wn(this.beans)-1,s=e(this.visibleCols.allCols);return this.focusHeaderPosition({headerPosition:{headerRowIndex:o,column:s},rowWithoutSpanValue:-1,event:t})}focusPreviousFromFirstCell(e){return this.filterManager?.isAdvFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCell}isRowFocused(e,t){return null!=this.focusedCell&&(this.focusedCell.rowIndex===e&&this.focusedCell.rowPinned===r(t))}focusOverlay(e){const t=this.overlays?.isVisible()&&this.overlays.eWrapper?.getGui();return!!t&&mn(t,e)}focusGridView(e){const{backwards:t=!1,canFocusOverlay:o=!0,event:s}=e;if(this.overlays?.exclusive)return o&&this.focusOverlay(t);if(On(this.beans))return t&&!Hn(this.beans)?this.focusLastHeader():!(!o||!this.focusOverlay(t))||!t&&Vn(this.beans,t);const i=t?An(this.beans):Tn(this.beans);if(i){const o=e.column??this.focusedHeader?.column,{rowIndex:n,rowPinned:a}=i,l=In(this.beans,i);if(!o||!l||null==n)return!1;if(o.isSuppressNavigable(l)){const e=this.gos.get("enableRtl");let t;return t=s&&s.key!==Ps?s.key:e?Is:Ls,this.beans.navigation?.navigateToNextCell(null,t,{rowIndex:n,column:o,rowPinned:a||null},!0),!0}return this.navigation?.ensureCellVisible({rowIndex:n,column:o,rowPinned:a}),t&&this.rowRenderer.getRowByPosition(i)?.isFullWidth()&&this.navigation?.tryToFocusFullWidthRow(i,t)?!0:(this.setFocusedCell({rowIndex:n,column:o,rowPinned:r(a),forceBrowserFocus:!0}),this.beans.rangeSvc?.setRangeToCell({rowIndex:n,rowPinned:a,column:o}),!0)}return!(!o||!this.focusOverlay(t))||!(!t||!this.focusLastHeader())}focusAdvancedFilter(e){return this.advFilterFocusColumn=e?.column,this.beans.advancedFilter?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(e,t){const o=(t?void 0:this.advFilterFocusColumn)??this.visibleCols.allCols?.[0];return e?this.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:Wn(this.beans)-1}}):this.focusGridView({column:o})}clearAdvancedFilterColumn(){this.advFilterFocusColumn=void 0}},class extends Cc{initVariables(){this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.getSizeEl(Yc),this.getSizeEl(Zc),this.getSizeEl(Qc),this.getSizeEl(Xc),this.refreshRowBorderWidthVariable()}getPinnedRowBorderWidth(){return this.getCSSVariablePixelValue(Xc)}getRowBorderWidth(){return this.getCSSVariablePixelValue(Qc)}getHeaderRowBorderWidth(){return this.getCSSVariablePixelValue(Jc)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(Yc)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(Zc)}getDefaultCellHorizontalPadding(){return this.getCSSVariablePixelValue(Kc)}getCellPaddingLeft(){const e=this.getDefaultCellHorizontalPadding(),t=this.getCSSVariablePixelValue(_c);return e-1+this.getCSSVariablePixelValue(qc)*t}getCellPadding(){const e=this.getDefaultCellHorizontalPadding()-1;return this.getCellPaddingLeft()+e}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}refreshRowHeightVariable(){const{eRootDiv:e}=this,t=e.style.getPropertyValue("--ag-line-height").trim(),o=this.gos.get("rowHeight");if(null==o||isNaN(o)||!isFinite(o))return null!==t&&e.style.setProperty("--ag-line-height",null),-1;const s=`${o}px`;return t!=s?(e.style.setProperty("--ag-line-height",s),o):""!=t?Number.parseFloat(t):-1}fireStylesChangedEvent(e){"rowBorderWidth"===e&&this.refreshRowBorderWidthVariable(),super.fireStylesChangedEvent(e)}refreshRowBorderWidthVariable(){const e=this.getCSSVariablePixelValue(Qc);this.eRootDiv.style.setProperty("--ag-internal-row-border-width",`${e}px`)}postProcessThemeChange(e,t){e&&getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded")&&Tt(t?106:239)}getAdditionalCss(){const e=/* @__PURE__ */new Map;return e.set("core",['.ag-aria-description-container{border:0;z-index:9999;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-viewport{position:relative}.ag-spanning-container{position:absolute;top:0;z-index:1}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important}.ag-body-viewport::-webkit-scrollbar,.ag-center-cols-viewport::-webkit-scrollbar,.ag-floating-bottom-viewport::-webkit-scrollbar,.ag-floating-top-viewport::-webkit-scrollbar,.ag-header-viewport::-webkit-scrollbar,.ag-sticky-bottom-viewport::-webkit-scrollbar,.ag-sticky-top-viewport::-webkit-scrollbar{display:none!important}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-floating-bottom-container,.ag-floating-top-container,.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-left-sticky-bottom,.ag-pinned-right-cols-container,.ag-pinned-right-sticky-bottom,.ag-sticky-bottom-container,.ag-sticky-top-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-active),&:where(.ag-scrollbar-scrolling){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-animation.ag-prevent-animation) .ag-row{transition:none!important;&:where(.ag-row.ag-after-created){transition:none!important}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value:not(.ag-allow-overflow),.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{white-space:normal;word-break:break-word}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-top:not(.ag-invisible)){border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}:where(.ag-floating-bottom:not(.ag-invisible)){border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-data-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%;z-index:1}.ag-sticky-bottom{box-sizing:content-box!important;:where(.ag-pinned-left-sticky-bottom),:where(.ag-pinned-right-sticky-bottom),:where(.ag-sticky-bottom-container){border-top:var(--ag-row-border);box-sizing:border-box}}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;:where(.ag-column-group-closed-icon),:where(.ag-column-group-opened-icon){cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row,.ag-spanned-row{color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-data-font-size);white-space:nowrap;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px) - 2px)}.ag-row{background-color:var(--ag-data-background-color);border-bottom:var(--ag-row-border);height:var(--ag-row-height);width:100%;&.ag-row-editing-invalid{background-color:var(--ag-full-row-edit-invalid-background-color)}}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}.ag-spanned-cell-wrapper{background-color:var(--ag-data-background-color);position:absolute}.ag-spanned-cell-wrapper>.ag-spanned-cell{display:block;position:relative}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-cell-wrap-text:not(.ag-cell-auto-height)) .ag-cell-wrapper{align-items:normal;height:100%;:where(.ag-cell-value){height:100%}}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-context-menu-open .ag-full-width-row.ag-row-focus .ag-cell-wrapper.ag-row-group,.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}.ag-full-width-row.ag-row-focus:focus{box-shadow:none}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}.ag-drag-handle-disabled{opacity:.35;pointer-events:none}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after,.ag-row-highlight-inside:after{background-color:var(--ag-row-drag-indicator-color);border-radius:calc(var(--ag-row-drag-indicator-width)/2);content:"";height:var(--ag-row-drag-indicator-width);pointer-events:none;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after,:where(.ag-ltr) .ag-row-highlight-inside:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after,:where(.ag-rtl) .ag-row-highlight-inside:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-highlight-indent:after{display:block;width:auto}:where(.ag-ltr) .ag-row-highlight-indent:after{left:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size));right:1px}:where(.ag-rtl) .ag-row-highlight-indent:after{left:1px;right:calc((var(--ag-cell-widget-spacing) + var(--ag-icon-size))*2 + var(--ag-cell-horizontal-padding) + var(--ag-row-highlight-level)*var(--ag-row-group-indent-size))}.ag-row-highlight-inside:after{background-color:var(--ag-selected-row-background-color);border:1px solid var(--ag-range-selection-border-color);display:block;height:auto;inset:0;width:auto}.ag-body,.ag-floating-bottom,.ag-floating-top{background-color:var(--ag-data-background-color)}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-header-range-highlight{background-color:var(--ag-range-header-highlight-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-data-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-container,.ag-center-cols-viewport{min-height:150px}}.ag-overlay-exporting-wrapper,.ag-overlay-loading-wrapper,.ag-overlay-modal-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{background-color:var(--ag-row-loading-skeleton-effect-color)}50%{background-color:color-mix(in srgb,transparent,var(--ag-row-loading-skeleton-effect-color) 40%)}to{background-color:var(--ag-row-loading-skeleton-effect-color)}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label,:where(.ag-header-group-cell-selectable) .ag-header-cell-comp-wrapper{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden)),:where(.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{contain:paint;display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:"";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:"";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)):before,.ag-header-group-cell:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:"";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}.ag-header-cell:where(:not(.ag-floating-filter)):where(:hover):before,.ag-header-group-cell:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}.ag-header-cell:where(:not(.ag-floating-filter)):where(.ag-header-cell-moving):before,.ag-header-group-cell:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}:where(.ag-header-cell:not(.ag-floating-filter)>*,.ag-header-group-cell>*){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{word-break:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{color:var(--ag-subtle-text-color)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-left:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-col-ref{margin-right:var(--ag-spacing)}.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:"";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-column-drag-indicator-color);border-radius:calc(var(--ag-column-drag-indicator-width)/2);content:"";height:100%;position:absolute;top:0;width:var(--ag-column-drag-indicator-width)}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2}:where(.ag-ltr) .ag-header-cell-resize{right:-3px}:where(.ag-rtl) .ag-header-cell-resize{left:-3px}.ag-header-cell-resize:after{background-color:var(--ag-header-column-resize-handle-color);content:"";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}:where(.ag-ltr) .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-rtl) .ag-header-cell-resize:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{container-type:normal;display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{container-type:normal;display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab;:where(.ag-icon){color:var(--ag-drag-handle-color)}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{background-color:var(--ag-icon-button-background-color);border-radius:var(--ag-icon-button-border-radius);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-background-color);color:var(--ag-icon-button-color)}.ag-chart-menu-icon:hover,.ag-chart-settings-next:hover,.ag-chart-settings-prev:hover,.ag-column-group-icons:hover,.ag-column-select-header-icon:hover,.ag-filter-toolpanel-expand:hover,.ag-floating-filter-button-button:hover,.ag-group-title-bar-icon:hover,.ag-header-cell-filter-button:hover,.ag-header-cell-menu-button:hover,.ag-header-expand-icon:hover,.ag-panel-title-bar-button-icon:hover,.ag-panel-title-bar-button:hover,.ag-set-filter-group-icons:hover,:where(.ag-group-contracted) .ag-icon:hover,:where(.ag-group-expanded) .ag-icon:hover{background-color:var(--ag-icon-button-hover-background-color);box-shadow:0 0 0 var(--ag-icon-button-background-spread) var(--ag-icon-button-hover-background-color);color:var(--ag-icon-button-hover-color)}:where(.ag-filter-active),:where(.ag-filter-toolpanel-group-instance-header-icon),:where(.ag-filter-toolpanel-instance-header-icon){position:relative}:where(.ag-filter-active):after,:where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-filter-toolpanel-instance-header-icon):after{background-color:var(--ag-icon-button-active-indicator-color);border-radius:50%;content:"";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-ltr) :where(.ag-filter-active):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-ltr) :where(.ag-filter-toolpanel-instance-header-icon):after{right:-1px}:where(.ag-rtl) :where(.ag-filter-active):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-group-instance-header-icon):after,:where(.ag-rtl) :where(.ag-filter-toolpanel-instance-header-icon):after{left:-1px}.ag-filter-active{background-image:linear-gradient(var(--ag-icon-button-active-background-color),var(--ag-icon-button-active-background-color));border-radius:1px;outline:solid var(--ag-icon-button-background-spread) var(--ag-icon-button-active-background-color);:where(.ag-icon-filter){clip-path:path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z");color:var(--ag-icon-button-active-color)}}']),function(e,t){for(const o of t.sort((e,t)=>e.moduleName.localeCompare(t.moduleName))){const t=o.css;t&&e.set(`module-${o.moduleName}`,t)}}(e,Array.from(new Set(lt))),e}getDefaultTheme(){return $c}varError(e,t){Et(9,{variable:{cssName:e,defaultValue:t}})}themeError(e){Tt(240,{theme:e})}shadowRootError(){Tt(293)}},class extends We{constructor(){super(...arguments),this.beanName="scrollVisibleSvc"}wireBeans(e){this.ctrlsSvc=e.ctrlsSvc,this.colAnimation=e.colAnimation}postConstruct(){const{gos:e}=this;this.horizontalScrollShowing=!0===e.get("alwaysShowHorizontalScroll"),this.verticalScrollShowing=!0===e.get("alwaysShowVerticalScroll"),this.getScrollbarWidth();const t=this.updateScrollVisible.bind(this);this.addManagedEventListeners({displayedColumnsChanged:t,displayedColumnsWidthChanged:t,newColumnsLoaded:t})}updateScrollVisible(){const{colAnimation:e}=this;e?.isActive()?e.executeLaterVMTurn(()=>{e.executeLaterVMTurn(()=>this.updateScrollVisibleImpl())}):this.updateScrollVisibleImpl()}updateScrollVisibleImpl(){const e=this.ctrlsSvc.get("center");if(!e||this.colAnimation?.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.verticalScrollShowing};this.setScrollsVisible(t),this.updateScrollGap()}updateScrollGap(){const e=this.ctrlsSvc.get("center"),t=e.hasHorizontalScrollGap(),o=e.hasVerticalScrollGap();this.horizontalScrollGap===t&&this.verticalScrollGap===o||(this.horizontalScrollGap=t,this.verticalScrollGap=o,this.eventSvc.dispatchEvent({type:"scrollGapChanged"}))}setScrollsVisible(e){this.horizontalScrollShowing===e.horizontalScrollShowing&&this.verticalScrollShowing===e.verticalScrollShowing||(this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing,this.eventSvc.dispatchEvent({type:"scrollVisibilityChanged"}))}getScrollbarWidth(){if(null==this.scrollbarWidth){const e=this.gos.get("scrollbarWidth"),t="number"==typeof e&&e>=0?e:rn();null!=t&&(this.scrollbarWidth=t,this.eventSvc.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}},class extends We{constructor(){super(...arguments),this.beanName="ctrlsSvc",this.params={},this.ready=!1,this.readyCallbacks=[]}postConstruct(){this.addEventListener("ready",()=>{if(this.updateReady(),this.ready){for(const e of this.readyCallbacks)e(this.params);this.readyCallbacks.length=0}},this.beans.frameworkOverrides.runWhenReadyAsync?.()??!1)}updateReady(){const e=Object.values(this.params);this.ready=23===e.length&&e.every(e=>e?.isAlive()??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const e=this.readyCallbacks.indexOf(t);e>=0&&this.readyCallbacks.splice(e,1)})}register(e,t){this.params[e]=t,this.updateReady(),this.ready&&this.dispatchLocalEvent({type:"ready"}),t.addDestroyFunc(()=>{this.updateReady()})}get(e){return this.params[e]}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:o}=this.params;return[e,o,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}getScrollFeature(){return this.getGridBodyCtrl().scrollFeature}},class extends We{constructor(){super(...arguments),this.beanName="syncSvc",this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.beans.ctrlsSvc.whenReady(this,()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){const{colModel:t,rowModel:o}=this.beans;t.setColumnDefs(e??[],"gridInitializing"),o.start()}gridReady(){const{eventSvc:e,gos:t}=this;e.dispatchEvent({type:"gridReady"}),it(t,`initialised successfully, enterprise = ${t.isModuleRegistered("EnterpriseCore")}`)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.beans.colModel.setColumnDefs(t,Xo(e.source))}},class extends We{constructor(){super(...arguments),this.beanName="colNames"}getDisplayNameForColumn(e,t,o=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t),{aggColNameSvc:i}=this.beans;return o&&i?i.getHeaderName(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,o){const s=t?.getColGroupDef();return s?this.getHeaderName(s,null,e,t,o):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,o,s,i){const n=e.headerValueGetter;if(n){const r=wo(this.gos,{colDef:e,column:t,columnGroup:o,providedColumnGroup:s,location:i});return"function"==typeof n?n(r):"string"==typeof n?this.beans.expressionSvc?.evaluate(n,r)??null:""}return null!=e.headerName?e.headerName:e.field?(r=e.field)&&null!=r?r.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map(e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):"")).join(" "):null:"";var r}},class extends We{constructor(){super(...arguments),this.beanName="colViewport",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.columnsToRenderLeft=[],this.columnsToRenderRight=[],this.columnsToRenderCenter=[]}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}getScrollPosition(){return this.scrollPosition}setScrollPosition(e,t,o=!1){const{visibleCols:s}=this,i=s.isBodyWidthDirty;if(e!==this.scrollWidth||t!==this.scrollPosition||i){if(this.scrollWidth=e,this.scrollPosition=t,s.isBodyWidthDirty=!0,this.gos.get("enableRtl")){const o=s.bodyWidth;this.viewportLeft=o-t-e,this.viewportRight=o-t}else this.viewportLeft=t,this.viewportRight=e+t;this.colModel.ready&&this.checkViewportColumns(o)}}getColumnHeadersToRender(e){switch(e){case"left":return this.columnsToRenderLeft;case"right":return this.columnsToRenderRight;default:return this.columnsToRenderCenter}}getHeadersToRender(e,t){let o;switch(e){case"left":o=this.rowsOfHeadersToRenderLeft[t];break;case"right":o=this.rowsOfHeadersToRenderRight[t];break;default:o=this.rowsOfHeadersToRenderCenter[t]}return o??[]}extractViewportColumns(){const e=this.visibleCols.centerCols;this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return!(!e.isAutoHeaderHeight()&&!function(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.getParent()}return!1}(e))||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,o=t+e.getActualWidth(),s=this.viewportLeft-200,i=this.viewportRight+200;return!(ti&&o>i)}getViewportColumns(){const{leftCols:e,rightCols:t}=this.visibleCols;return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.colModel.colSpanActive)return this.colsWithinViewport;const t=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),{visibleCols:o}=this,s=o.centerCols;return o.getColsForRow(e,s,t,e=>{const t=e.getLeft();return a(t)&&t>this.viewportLeft})}checkViewportColumns(e=!1){this.extractViewport()&&this.eventSvc.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}calculateHeaderRows(){const{leftCols:e,rightCols:t}=this.visibleCols;this.columnsToRenderLeft=e,this.columnsToRenderRight=t,this.columnsToRenderCenter=this.colsWithinViewport;const o=e=>{const t=/* @__PURE__ */new Set,o={};for(const s of e){let e=s.getParent();const i=s.isSpanHeaderHeight();for(;e&&!t.has(e);){if(i&&e.isPadding()){e=e.getParent();continue}const s=e.getProvidedColumnGroup().getLevel();o[s]??(o[s]=[]),o[s].push(e),t.add(e),e=e.getParent()}}return o};this.rowsOfHeadersToRenderLeft=o(e),this.rowsOfHeadersToRenderRight=o(t),this.rowsOfHeadersToRenderCenter=o(this.headerColsWithinViewport)}extractViewport(){this.extractViewportColumns();const e=this.getViewportColumns().map(e=>`${e.getId()}-${e.getPinned()||"normal"}`).join("#"),t=this.colsWithinViewportHash!==e;return t&&(this.colsWithinViewportHash=e,this.calculateHeaderRows()),t}},class extends We{constructor(){super(...arguments),this.beanName="iconSvc"}createIconNoSpan(e,t){return ei(e,this.beans,t?.column)}}],icons:{selectOpen:"small-down",smallDown:"small-down",colorPicker:"color-picker",smallUp:"small-up",checkboxChecked:"small-up",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off",smallLeft:"small-left",smallRight:"small-right"},apiFunctions:{getGridId:function(e){return e.context.getId()},destroy:function(e){e.gridDestroySvc.destroy()},isDestroyed:function(e){return e.gridDestroySvc.destroyCalled},getGridOption:function(e,t){return e.gos.get(t)},setGridOption:function(e,t,o){hl(e,{[t]:o})},updateGridOptions:hl,isModuleRegistered:function(e,t){const o=t.replace(/Module$/,"");return e.gos.isModuleRegistered(o)}},dependsOn:[Rd,Wl,Kl,Hu,Fh,Xl,Dh,Pu,Vu,Mh,hu,gu,mu,Ph,Fd,xd,Ou,td,Cu]};function Wu(e){const{inputValue:t,allSuggestions:o,hideIrrelevant:s,filterByPercentageOfBestMatch:i}=e;let n=(o??[]).map((e,o)=>({value:e,relevance:Uu(t,e),idx:o}));if(n.sort((e,t)=>e.relevance-t.relevance),s&&(n=n.filter(e=>e.relevance0&&i&&i>0){const e=n[0].relevance*i;n=n.filter(t=>e-t.relevance<0)}const r=[],a=[];for(const l of n)r.push(l.value),a.push(l.idx);return{values:r,indices:a}}function Uu(e,t){const o=e.length,s=t.length;if(0===s)return o||0;let i,n=e.toLocaleLowerCase(),r=t.toLocaleLowerCase();e.length1&&i>1){const o=e[h-2],s=n[h-2],a=t[i-2];s===r[i-2]&&(d++,o===a&&d++)}h{const a=function(e,t){const o=[];for(const s of Array.isArray(e)?e:[e]){const e=Ku[s];if(e)for(const s of e){const e=_u[s];e&&e!==t||o.push(s)}else o.push(s)}return o}(t,i),l="string"==typeof e?e:eg[e];if(r)return function(e,t){const o=t.filter(e=>"IntegratedCharts"===e||"Sparklines"===e);let s="";return!globalThis?.agCharts&&o.length>0?s=`Unable to use ${e} as either the ag-charts-community or ag-charts-enterprise script needs to be included alongside ag-grid-enterprise.\n`:t.some(e=>$u[e])&&(s+=`Unable to use ${e} as that requires the ag-grid-enterprise script to be included.\n`),s}(l,a);const d=a.filter(e=>"IntegratedCharts"===e||"Sparklines"===e),c=d.length>0?`${d.map(e=>qu(e)).join()} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.`:"";return`Unable to use ${l} as ${a.length>1?"one of "+a.map(e=>qu(e)).join(", "):qu(a[0])} is not registered${o?" for gridId: "+s:""}. ${c} Check if you have registered the module:\n\n${(e=>{const t=e.map(e=>`import { ${qu(e)} } from '${$u[e]?"ag-grid-enterprise":"ag-grid-community"}';`);return e.some(e=>"IntegratedCharts"===e||"Sparklines"===e)&&t.push("import { AgChartsEnterpriseModule } from 'ag-charts-enterprise';"),`import { ModuleRegistry } from 'ag-grid-community'; \n${t.join(" \n")} \n\nModuleRegistry.registerModules([ ${e.map(e=>qu(e,!0)).join(", ")} ]); \n\nFor more info see: ${yt}/modules/`})(a)}`+(n?` \n\n${n}`:"")},Qu=e=>`${e} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'.\n\nimport { AgChartsEnterpriseModule } from 'ag-charts-enterprise';\nimport { ModuleRegistry } from 'ag-grid-community';\nimport { ${e} } from 'ag-grid-enterprise';\n \nModuleRegistry.registerModules([${e}.with(AgChartsEnterpriseModule)]);\n `,Xu={1:()=>"`rowData` must be an array",2:({nodeId:e})=>`Duplicate node id '${e}' detected from getRowId callback, this could cause issues in your grid.`,3:()=>"Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.",4:({id:e})=>`Could not find row id=${e}, data item was not found for this id`,5:({data:e})=>["Could not find data item as object was not found.",e," Consider using getRowId to help the Grid find matching row data"],6:()=>"'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'",7:()=>"Pivoting is not supported with aligned grids as it may produce different columns in each grid.",8:({key:e})=>`Unknown key for navigation ${e}`,9:({variable:e})=>`No value for ${e?.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e?.defaultValue} will be used and updated when styles load.`,10:({eventType:e})=>`As of v33, the '${e}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`,11:()=>"No gridOptions provided to createGrid",12:({colKey:e})=>["column ",e," not found"],13:()=>"Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.",14:({groupPrefix:e})=>`Row IDs cannot start with ${e}, this is a reserved prefix for AG Grid's row grouping feature.`,15:({expression:e})=>["value should be either a string or a function",e],16:({expression:e,params:t,e:o})=>["Processing of the expression failed","Expression = ",e,"Params = ",t,"Exception = ",o],17:()=>"you need either field or valueSetter set on colDef for editing to work",18:()=>"alignedGrids contains an undefined option.",19:()=>"alignedGrids - No api found on the linked grid.",20:()=>'You may want to configure via a callback to avoid setup race conditions:\n "alignedGrids: () => [linkedGrid]"',21:()=>"pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.",22:({key:e})=>`${e} is an initial property and cannot be updated.`,23:()=>"The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.",24:()=>"row height must be a number if not using standard row model",25:({id:e})=>["The getRowId callback must return a string. The ID ",e," is being cast to a string."],26:({fnName:e,preDestroyLink:t})=>`Grid API function ${e}() cannot be called as the grid has been destroyed.\n Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\n To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${t}`,27:({fnName:e,module:t})=>`API function '${e}' not registered to module '${t}'`,28:()=>"setRowCount cannot be used while using row grouping.",29:()=>"tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?",30:({toIndex:e})=>["tried to insert columns in invalid location, toIndex = ",e,"remember that you should not count the moving columns when calculating the new index"],31:()=>"infinite loop in resizeColumnSets",32:()=>"applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.",33:()=>"stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON.",34:({key:e})=>`the column type '${e}' is a default column type and cannot be overridden.`,35:()=>"Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type.",36:({t:e})=>"colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes",37:()=>"Changing the column pinning status is not allowed with domLayout='print'",38:({iconName:e})=>`provided icon '${e}' needs to be a string or a function`,39:()=>"Applying column order broke a group where columns should be married together. Applying new order has been discarded.",40:({e:e,method:t})=>`${e}\n${(e=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${e}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`)(t)}`,41:()=>"Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.",42:()=>"Browser does not support document.execCommand('copy') for clipboard operations",43:({iconName:e})=>`As of v33, icon '${e}' is deprecated. Use the icon CSS name instead.`,44:()=>'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.',45:({parentCellDataType:e})=>`The data type definition ${e} does not exist.`,46:()=>'The "baseDataType" property of a data type definition must match that of its parent.',47:({cellDataType:e})=>`Missing data type definition - "${e}"`,48:({property:e})=>`Cell data type is "object" but no Value ${e} has been provided. Please either provide an object data type definition with a Value ${e}, or set "colDef.value${e}"`,49:({methodName:e})=>`Framework component is missing the method ${e}()`,50:({compName:e})=>`Could not find component ${e}, did you forget to configure this component?`,51:()=>"Export cancelled. Export is not allowed as per your configuration.",52:()=>"There is no `window` associated with the current `document`",53:()=>"unknown value type during csv conversion",54:()=>"Could not find document body, it is needed for drag and drop and context menu.",55:()=>"addRowDropZone - A container target needs to be provided",56:()=>"addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.",57:()=>"unable to show popup filter, filter instantiation failed",58:()=>"no values found for select cellEditor",59:()=>"cannot select pinned rows",60:()=>"cannot select node until it has finished loading",61:()=>"since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.",62:({colId:e})=>`setFilterModel() - no column found for colId: ${e}`,63:({colId:e})=>`setFilterModel() - unable to fully apply model, filtering disabled for colId: ${e}`,64:({colId:e})=>`setFilterModel() - unable to fully apply model, unable to create filter for colId: ${e}`,65:()=>"filter missing setModel method, which is needed for setFilterModel",66:()=>"filter API missing getModel method, which is needed for getFilterModel",67:()=>"Filter is missing isFilterActive() method",68:()=>"Column Filter API methods have been disabled as Advanced Filters are enabled.",69:({guiFromFilter:e})=>`getGui method from filter returned ${e}; it should be a DOM element.`,70:({newFilter:e})=>"Grid option quickFilterText only supports string inputs, received: "+typeof e,71:()=>"debounceMs is ignored when apply button is present",72:({keys:e})=>["ignoring FilterOptionDef as it doesn't contain one of ",e],73:()=>"invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'",74:()=>"no filter options for filter",75:()=>"Unknown button type specified",76:({filterModelType:e})=>['Unexpected type of filter "',e,'", it looks like the filter was configured with incorrect Filter Options'],77:()=>"Filter model is missing 'conditions'",78:()=>'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.',79:()=>'"filterParams.maxNumConditions" must be greater than or equal to zero.',80:()=>'"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.',81:()=>'"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".',82:({param:e})=>`DateFilter ${e} is not a number`,83:()=>"DateFilter minValidYear should be <= maxValidYear",84:()=>"DateFilter minValidDate should be <= maxValidDate",85:()=>"DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.",86:()=>"DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.",87:()=>"DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.",88:({index:e})=>`Invalid row index for ensureIndexVisible: ${e}`,89:()=>"A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)",90:()=>"datasource is missing getRows method",91:()=>"Filter is missing method doesFilterPass",92:()=>"AnimationFrameService called but animation frames are off",93:()=>"cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`",94:({paginationPageSizeOption:e,pageSizeSet:t,pageSizesSet:o,pageSizeOptions:s})=>`'paginationPageSize=${e}'${t?"":" (default value)"}, but ${e} is not included in${o?"":" the default"} paginationPageSizeSelector=[${s?.join(", ")}].`,95:({paginationPageSizeOption:e,paginationPageSizeSelector:t})=>`Either set '${t}' to an array that includes ${e} or to 'false' to disable the page size selector.`,96:({id:e,data:t})=>["Duplicate ID",e,"found for pinned row with data",t,"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter."],97:({colId:e})=>`cellEditor for column ${e} is missing getGui() method`,98:()=>"popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.",99:()=>"Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.",101:({propertyName:e,componentName:t,agGridDefaults:o,jsComps:s})=>{const i=[],n=Wu({inputValue:t,allSuggestions:[...Object.keys(o??[]).filter(e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e)),...Object.keys(s??[]).filter(e=>!!s[e])],hideIrrelevant:!0,filterByPercentageOfBestMatch:.8}).values;return i.push(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.\n`),n.length>0&&i.push(` Did you mean: [${n.slice(0,3)}]?\n`),i.push("If using a custom component check it has been registered correctly."),i},102:()=>"selectAll: 'filtered' only works when gridOptions.rowModelType='clientSide'",103:()=>"Invalid selection state. When using client-side row model, the state must conform to `string[]`.",104:({value:e,param:t})=>`Numeric value ${e} passed to ${t} param will be interpreted as ${e} seconds. If this is intentional use "${e}s" to silence this warning.`,105:({e:e})=>["chart rendering failed",e],106:()=>`Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${yt}/theming-migration/`,107:({key:e,value:t})=>`Invalid value for theme param ${e} - ${t}`,108:({e:e})=>["chart update failed",e],109:({inputValue:e,allSuggestions:t})=>{const o=Wu({inputValue:e,allSuggestions:t,hideIrrelevant:!0,filterByPercentageOfBestMatch:.8}).values;return[`Could not find '${e}' aggregate function. It was configured as "aggFunc: '${e}'" but it wasn't found in the list of registered aggregations.`,o.length>0?` Did you mean: [${o.slice(0,3)}]?`:"","If using a custom aggregation function check it has been registered correctly."].join("\n")},110:()=>"groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup",111:()=>"Invalid selection state. When `groupSelects` is enabled, the state must conform to `IServerSideGroupSelectionState`.",113:()=>"Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values",114:({component:e})=>`Could not find component with name of ${e}. Is it in Vue.components?`,116:()=>"Invalid selection state. The state must conform to `IServerSideSelectionState`.",117:()=>"selectAll must be of boolean type.",118:()=>"Infinite scrolling must be enabled in order to set the row count.",119:()=>"Unable to instantiate filter",120:()=>"MultiFloatingFilterComp expects MultiFilter as its parent",121:()=>"a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key",122:()=>"could not find the document, document is empty",123:()=>"Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.",124:()=>"No active charts to update.",125:({chartId:e})=>`Unable to update chart. No active chart found with ID: ${e}.`,126:()=>"unable to restore chart as no chart model is provided",127:({allRange:e})=>`unable to create chart as ${e?"there are no columns in the grid":"no range is selected"}.`,128:({feature:e})=>`${e} is only available if using 'multiRow' selection mode.`,129:({feature:e,rowModel:t})=>`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`,130:()=>'cannot multi select unless selection mode is "multiRow"',132:()=>"Row selection features are not available unless `rowSelection` is enabled.",133:({iconName:e})=>`icon '${e}' function should return back a string or a dom object`,134:({iconName:e})=>`Did not find icon '${e}'`,135:()=>"Data type of the new value does not match the cell data type of the column",136:()=>"Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.",137:({type:e,currentChartType:t})=>`Unable to update chart as a '${e}' update type is not permitted on a ${t}.`,138:({chartType:e})=>`invalid chart type supplied: ${e}`,139:({customThemeName:e})=>`a custom chart theme with the name ${e} has been supplied but not added to the 'chartThemes' list`,140:({name:e})=>`no stock theme exists with the name '${e}' and no custom chart theme with that name was supplied to 'customChartThemes'`,141:()=>"cross filtering with row grouping is not supported.",142:()=>"cross filtering is only supported in the client side row model.",143:({panel:e})=>`'${e}' is not a valid Chart Tool Panel name`,144:({type:e})=>`Invalid charts data panel group name supplied: '${e}'`,145:({group:e})=>`As of v32, only one charts customize panel group can be expanded at a time. '${e}' will not be expanded.`,146:({comp:e})=>`Unable to instantiate component '${e}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`,147:({group:e})=>`Invalid charts customize panel group name supplied: '${e}'`,148:({group:e})=>`invalid chartGroupsDef config '${e}'`,149:({group:e,chartType:t})=>`invalid chartGroupsDef config '${e}.${t}'`,150:()=>"'seriesChartTypes' are required when the 'customCombo' chart type is specified.",151:({chartType:e})=>`invalid chartType '${e}' supplied in 'seriesChartTypes', converting to 'line' instead.`,152:({colId:e})=>`no 'seriesChartType' found for colId = '${e}', defaulting to 'line'.`,153:({chartDataType:e})=>`unexpected chartDataType value '${e}' supplied, instead use 'category', 'series' or 'excluded'`,154:({colId:e})=>`cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${e}`,155:({option:e})=>`'${e}' is not a valid Chart Toolbar Option`,156:({panel:e})=>`Invalid panel in chartToolPanelsDef.panels: '${e}'`,157:({unrecognisedGroupIds:e})=>["unable to find group(s) for supplied groupIds:",e],158:()=>"can not expand a column item that does not represent a column group header",159:()=>"Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.",160:()=>"Export cancelled. Export is not allowed as per your configuration.",161:()=>"The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'",162:({id:e,dataType:t})=>`Unrecognized data type for excel export [${e}.dataType=${t}]`,163:({featureName:e})=>`Excel table export does not work with ${e}. The exported Excel file will not contain any Excel tables.\n Please turn off ${e} to enable Excel table exports.`,164:()=>"Unable to add data table to Excel sheet: A table already exists.",165:()=>"Unable to add data table to Excel sheet: Missing required parameters.",166:({unrecognisedGroupIds:e})=>["unable to find groups for these supplied groupIds:",e],167:({unrecognisedColIds:e})=>["unable to find columns for these supplied colIds:",e],168:()=>"detailCellRendererParams.template should be function or string",169:()=>'Reference to eDetailGrid was missing from the details template. Please add data-ref="eDetailGrid" to the template.',170:({providedStrategy:e})=>`invalid cellRendererParams.refreshStrategy = ${e} supplied, defaulting to refreshStrategy = 'rows'.`,171:()=>"could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions",172:()=>"could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData",173:({group:e})=>`invalid chartGroupsDef config '${e}'`,174:({group:e,chartType:t})=>`invalid chartGroupsDef config '${e}.${t}'`,175:({menuTabName:e,itemsToConsider:t})=>[`Trying to render an invalid menu item '${e}'. Check that your 'menuTabs' contains one of `,t],176:({key:e})=>`unknown menu item type ${e}`,177:()=>"valid values for cellSelection.handle.direction are 'x', 'y' and 'xy'. Default to 'xy'.",178:({colId:e})=>`column ${e} is not visible`,179:()=>"totalValueGetter should be either a function or a string (expression)",180:()=>"agRichSelectCellEditor requires cellEditorParams.values to be set",181:()=>"agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.",182:()=>'you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data',183:()=>"Group Column Filter only works on group columns. Please use a different filter.",184:({parentGroupData:e,childNodeData:t})=>["duplicate group keys for row data, keys should be unique",[e,t]],185:({data:e})=>["getDataPath() should not return an empty path",[e]],186:({rowId:e,rowData:t,duplicateRowsData:o})=>["duplicate group keys for row data, keys should be unique",e,t,...o??[]],187:({rowId:e,firstData:t,secondData:o})=>[`Duplicate node id ${e}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`,"first instance",t,"second instance",o],188:e=>`getRowId callback must be provided for Server Side Row Model ${e?.feature||"selection"} to work correctly.`,189:({startRow:e})=>`invalid value ${e} for startRow, the value should be >= 0`,190:({rowGroupId:e,data:t})=>["null and undefined values are not allowed for server side row model keys",e?`column = ${e}`:"","data is ",t],194:({method:e})=>`calling gridApi.${e}() is only possible when using rowModelType=\`clientSide\`.`,195:({justCurrentPage:e})=>`selecting just ${e?"current page":"filtered"} only works when gridOptions.rowModelType='clientSide'`,196:({key:e})=>`Provided ids must be of string type. Invalid id provided: ${e}`,197:()=>"`toggledNodes` must be an array of string ids.",199:()=>"getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use `api.getServerSideSelectionState()` instead.",200:Zu,201:({rowModelType:e})=>`Could not find row model for rowModelType = ${e}`,202:()=>"`getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model. Use `api.getServerSideSelectionState()` instead.",203:()=>"Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.",204:()=>"Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.",205:({duplicateIdText:e})=>`Unable to display rows as duplicate row ids (${e}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`,206:()=>"getRowId callback must be implemented for transactions to work. Transaction was ignored.",207:()=>'The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.',208:()=>"Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.",209:()=>`Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${yt}/filter-set-filter-list/#filter-value-types`,210:()=>"Set Filter has a Key Creator, but provided values are primitives. Did you mean to provide complex objects?",211:()=>"property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.",212:()=>"please review all your toolPanel components, it seems like at least one of them doesn't have an id",213:()=>"Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.",214:({key:e})=>`unable to lookup Tool Panel as invalid key supplied: ${e}`,215:({key:e,defaultByKey:t})=>`the key ${e} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(t??{}).join(",")}`,216:({name:e})=>`Missing component for '${e}'`,217:({invalidColIds:e})=>["unable to find grid columns for the supplied colDef(s):",e],218:({property:e,defaultOffset:t})=>`${e} must be a number, the value you provided is not a valid number. Using the default of ${t}px.`,219:({property:e})=>`Property ${e} does not exist on the target object.`,220:({lineDash:e})=>`'${e}' is not a valid 'lineDash' option.`,221:()=>"agAggregationComponent should only be used with the client and server side row model.",222:()=>"agFilteredRowCountComponent should only be used with the client side row model.",223:()=>"agSelectedRowCountComponent should only be used with the client and server side row model.",224:()=>"agTotalAndFilteredRowCountComponent should only be used with the client side row model.",225:()=>"agTotalRowCountComponent should only be used with the client side row model.",226:()=>"viewport is missing init method.",227:()=>"menu item icon must be DOM node or string",228:({menuItemOrString:e})=>`unrecognised menu item ${e}`,230:()=>"detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://www.ag-grid.com/react-data-grid/master-detail-custom-detail/",231:()=>"As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.",232:()=>"Using both rowData and v-model. rowData will be ignored.",233:({methodName:e})=>`Framework component is missing the method ${e}()`,234:()=>'Group Column Filter does not work with the colDef property "field". This property will be ignored.',235:()=>'Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.',236:()=>'Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.',237:()=>"Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.",238:()=>"setRowCount can only accept a positive row count.",239:()=>'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string "legacy" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.',240:({theme:e})=>`theme grid option must be a Theming API theme object or the string "legacy", received: ${e}`,243:()=>"Failed to deserialize state - each provided state object must be an object.",244:()=>"Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.",245:()=>"Failed to deserialize state - `toggledNodes` must be an array.",246:()=>"Failed to deserialize state - Every `toggledNode` requires an associated string id.",247:()=>"Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule. \nPlease rebuild the selection state and reapply it.",248:()=>"SetFloatingFilter expects SetFilter as its parent",249:()=>"Must supply a Value Formatter in Set Filter params when using a Key Creator",250:()=>"Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.",251:({chartType:e})=>`AG Grid: Unable to create chart as an invalid chartType = '${e}' was supplied.`,252:()=>"cannot get grid to draw rows when it is in the middle of drawing rows. \nYour code probably called a grid API method while the grid was in the render stage. \nTo overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). \nTo see what part of your code that caused the refresh check this stacktrace.",253:({version:e})=>["Illegal version string: ",e],254:()=>"Cannot create chart: no chart themes available.",255:({point:e})=>`Lone surrogate U+${e?.toString(16).toUpperCase()} is not a scalar value`,256:()=>"Unable to initialise. See validation error, or load ValidationModule if missing.",257:()=>Qu("IntegratedChartsModule"),258:()=>Qu("SparklinesModule"),259:({part:e})=>`the argument to theme.withPart must be a Theming API part object, received: ${e}`,260:({propName:e,compName:t,gridScoped:o,gridId:s,rowModelType:i})=>Zu({reasonOrId:`AG Grid '${e}' component: ${t}`,moduleName:ih[t],gridId:s,gridScoped:o,rowModelType:i}),261:()=>"As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.",262:()=>'As of v33, icon key "smallDown" is deprecated. Use "advancedFilterBuilderSelect" for Advanced Filter Builder dropdown, "selectOpen" for Select cell editor and dropdowns (e.g. Integrated Charts menu), "richSelectOpen" for Rich Select cell editor.',263:()=>'As of v33, icon key "smallLeft" is deprecated. Use "panelDelimiterRtl" for Row Group Panel / Pivot Panel, "subMenuOpenRtl" for sub-menus.',264:()=>'As of v33, icon key "smallRight" is deprecated. Use "panelDelimiter" for Row Group Panel / Pivot Panel, "subMenuOpen" for sub-menus.',265:({colId:e})=>`Unable to infer chart data type for column '${e}' if first data entry is null. Please specify "chartDataType", or a "cellDataType" in the column definition. For more information, see ${yt}/integrated-charts-range-chart#coldefchartdatatype .`,266:()=>'As of v33.1, using "keyCreator" with the Rich Select Editor has been deprecated. It now requires the "formatValue" callback to convert complex data to strings.',267:()=>"Detail grids can not use a different theme to the master grid, the `theme` detail grid option will be ignored.",268:()=>"Transactions aren't supported with tree data when using treeDataChildrenField",269:()=>"When `masterSelects: 'detail'`, detail grids must be configured with multi-row selection",270:({id:e,parentId:t})=>`Cycle detected for row with id='${e}' and parent id='${t}'. Resetting the parent for row with id='${e}' and showing it as a root-level node.`,271:({id:e,parentId:t})=>`Parent row not found for row with id='${e}' and parent id='${t}'. Showing row with id='${e}' as a root-level node.`,272:()=>"No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule:\n \n import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community';\n \n ModuleRegistry.registerModules([ AllCommunityModule ]);\n ",273:({providedId:e,usedId:t})=>`Provided column id '${e}' was already in use, ensure all column and group ids are unique. Using '${t}' instead.`,274:({prop:e})=>{let t=`Since v33, ${e} has been deprecated.`;switch(e){case"maxComponentCreationTimeMs":t+=" This property is no longer required and so will be removed in a future version.";break;case"setGridApi":t+=" This method is not called by AG Grid. To access the GridApi see: https://ag-grid.com/react-data-grid/grid-interface/#grid-api ";break;case"children":t+=" For multiple versions AgGridReact does not support children."}return t},275:Yu,276:()=>"Row Numbers Row Resizer cannot be used when Grid Columns have `autoHeight` enabled.",277:({colId:e})=>`'enableFilterHandlers' is set to true, but column '${e}' does not have 'filter.doesFilterPass' or 'filter.handler' set.`,278:({colId:e})=>`Unable to create filter handler for column '${e}'`,279:e=>{},280:({colId:e})=>`'name' must be provided for custom filter components for column '${e}`,281:({colId:e})=>`Filter for column '${e}' does not have 'filterParams.buttons', but the new Filters Tool Panel has buttons configured. Either configure buttons for the filter, or disable buttons on the Filters Tool Panel.`,282:()=>"New filter tool panel requires `enableFilterHandlers: true`.",283:()=>"As of v34, use the same method on the filter handler (`api.getColumnFilterHandler(colKey)`) instead.",284:()=>"As of v34, filters are active when they have a model. Use `api.getColumnFilterModel()` instead.",285:()=>"As of v34, use (`api.getColumnFilterModel()`) instead.",286:()=>"As of v34, use (`api.setColumnFilterModel()`) instead.",287:()=>"`api.doFilterAction()` requires `enableFilterHandlers = true",288:()=>"`api.getColumnFilterModel(key, true)` requires `enableFilterHandlers = true",289:({rowModelType:e})=>`Row Model '${e}' is not supported with Batch Editing`,290:({rowIndex:e,rowPinned:t})=>`Row with index '${e}' and pinned state '${t}' not found`,291:()=>"License Key being set multiple times with different values. This can result in an incorrect license key being used,",292:({colId:e})=>`The Multi Filter for column '${e}' has buttons configured against the child filters. When 'enableFilterHandlers=true', buttons must instead be provided against the parent Multi Filter params. The child filter buttons will be ignored.`,293:()=>"The grid was initialised detached from the DOM and was then inserted into a Shadow Root. Theme styles are probably broken. Pass the themeStyleContainer grid option to let the grid know where in the document to insert theme CSS.",294:()=>"When using the `agRichSelectCellEditor` setting `filterListAsync = true` requires `allowTyping = true` and the `values()` callback must return a Promise of filtered values.",295:({blockedService:e})=>`colDef.allowFormula is not supported with ${e}. Formulas has been turned off.`,296:()=>"Since v35, `api.hideOverlay()` does not hide the overlay when `activeOverlay` is set. Set `activeOverlay=null` instead.",297:()=>'`api.hideOverlay()` does not hide the no matching rows overlay as it is only controlled by grid state. Set `suppressOverlays=["noMatchingRows"] to not show it.'};function Ju(e,t){const o=Xu[e];if(!o)return[`Missing error text for error id ${e}!`];const s=o(t),i=`\nSee ${Mt(e,t)}`;return Array.isArray(s)?s.concat(i):[s,i]}var eg={1:"Charting Aggregation",2:"pivotResultFields",3:"setTooltip"},tg=class{constructor(e="javascript"){var t;this.frameworkName=e,this.renderingEngine="vanilla",this.batchFrameworkComps=!1,this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e(),this.baseDocLink=`${st}/${this.frameworkName}-data-grid`,t=this.baseDocLink,yt=t}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return this.baseDocLink+(e?"/"+e:"")}},og=/* @__PURE__ */new WeakMap,sg=/* @__PURE__ */new WeakMap;function ig(e,t,o){if(!t)return Tt(11),{};const s=o;let i;if(!s?.setThemeOnGridDiv){const t=Xs({tag:"div"});t.style.height="100%",e.appendChild(t),e=t,i=()=>e.remove()}return(new rg).create(e,t,t=>{const o=new nl(e);t.createBean(o)},void 0,o,i)}var ng=1,rg=class{create(e,t,o,s,i,n){const r=tt.applyGlobalGridOptions(t),a=r.gridId??String(ng++),l=this.getRegisteredModules(i,a,r.rowModelType),d=this.createBeansList(r.rowModelType,l,a),c=this.createProvidedBeans(e,r,i);if(!d)return;const h=new Vr({providedBeanInstances:c,beanClasses:d,id:a,beanInitComparator:Ur,beanDestroyComparator:$r,derivedBeans:[zr],destroyCallback:()=>{sg.delete(u),og.delete(e),function(e){delete ct[e]}(a),n?.()}});this.registerModuleFeatures(h,l),o(h),h.getBean("syncSvc").start(),s?.(h);const u=h.getBean("gridApi");return og.set(e,u),sg.set(u,e),u}getRegisteredModules(e,t,o){return pt(zu,void 0,!0),e?.modules?.forEach(e=>pt(e,t)),function(e,t){const o=ct[e]??{};return[...Object.values(dt.all??{}),...Object.values(o.all??{}),...Object.values(dt[t]??{}),...Object.values(o[t]??{})]}(t,ag(o))}registerModuleFeatures(e,t){const o=e.getBean("registry"),s=e.getBean("apiFunctionSvc");for(const i of t){o.registerModule(i);const e=i.apiFunctions;if(e){const t=Object.keys(e);for(const o of t)s?.addFunction(o,e[o])}}}createProvidedBeans(e,t,o){let s=o?o.frameworkOverrides:null;l(s)&&(s=new tg);const i={gridOptions:t,eGridDiv:e,eRootDiv:e,globalListener:o?o.globalListener:null,globalSyncListener:o?o.globalSyncListener:null,frameworkOverrides:s};return o?.providedBeanInstances&&Object.assign(i,o.providedBeanInstances),i}createBeansList(e,t,o){const s={clientSide:"ClientSideRowModel",infinite:"InfiniteRowModel",serverSide:"ServerSideRowModel",viewport:"ViewportRowModel"},i=ag(e),n=s[i];if(!n)return void At(201,{rowModelType:i},`Unknown rowModelType ${i}.`);if(!ht)return void At(272,void 0,"No AG Grid modules are registered! It is recommended to start with all Community features via the AllCommunityModule:\n \n import { ModuleRegistry, AllCommunityModule } from 'ag-grid-community';\n \n ModuleRegistry.registerModules([ AllCommunityModule ]);\n ");if(!e){const e=Object.entries(s).filter(([e,t])=>mt(t,o,e));if(1==e.length){const[t,o]=e[0];if(t!==i){const e={moduleName:o,rowModelType:t};return void At(275,e,Yu(e))}}}if(!mt(n,o,i)){const e=!1,t=`rowModelType = '${i}'`,s=e?`Unable to use ${t} as that requires the ag-grid-enterprise script to be included.\n`:`Missing module ${n}Module for rowModelType ${i}.`;return void At(200,{reasonOrId:t,moduleName:n,gridScoped:ft(),gridId:o,rowModelType:i,isUmd:e},s)}const r=/* @__PURE__ */new Set;for(const a of t)for(const e of a.beans??[])r.add(e);return Array.from(r)}};function ag(e){return e??"clientSide"}var lg=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},cg(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){this.dispatchRowDataUpdateStarted(e),this.destroyAllNodes();const t=cg(this.rootNode),o=new Array(e.length);t._leafs=o;let s=0;const i=this.beans.groupStage?.getNestedDataGetter(),n=i?/* @__PURE__ */new Set:null,r=(e,t)=>{const a=e.level+1;for(let l=0,d=t.length;l{if(!h&&void 0!==h){const t=e.sourceRowIndex;h=t<=u,u=t}e.data!==t&&(e.updateData(t),r.has(e)||a.add(e),!e.selectable&&e.isSelected()&&d.push(e))},m=(e,t,o)=>{for(let s=0,n=t.length;s0;if(f){const e=o._leafs??(o._leafs=[]);void 0===h?pg(e,l,n):gg(e,l)&&(n.reordered=!0)}(f||g||a.size)&&(e.rowDataUpdated=!0,this.deselect(d))}deleteUnusedNodes(e,{removals:t},o,s){const i=this.rootNode._leafs;for(let n=0,r=i.length;n0}updateRowData(e,t,o){if(this.dispatchRowDataUpdateStarted(e.add),this.beans.groupStage?.getNestedDataGetter())return Et(268),{remove:[],update:[],add:[]};const s=[],i=Jt(this.gos),n=this.executeRemove(i,e,t,s,o),r=this.executeUpdate(i,e,t,s),a=this.executeAdd(e,t);return this.deselect(s),{remove:n,update:r,add:a}}executeRemove(e,{remove:t},{adds:o,updates:s,removals:i},n,r){const a=this.rootNode._leafs,l=a?.length,d=t?.length;if(!d||!l)return[];let c=0,h=l,u=0;const g=new Array(d);for(let p=0;pu&&(u=l),g[c++]=a,this.destroyNode(a,r)&&(a.isSelected()&&n.push(a),o.delete(a)||(s.delete(a),i.push(a)))}return g.length=c,c&&ug(a,h,u),g}executeUpdate(e,{update:t},{adds:o,updates:s},i){const n=t?.length;if(!n)return[];const r=new Array(n);let a=0;for(let l=0;l=l;--e){const o=s[e];o.sourceRowIndex=t,s[t--]=o}t.reordered=!0}s.length=a;const d=new Array(r),c=t.adds;for(let h=0;h=o||Number.isNaN(t))return o;t=Math.ceil(t);const s=this.gos;return t>0&&s.get("treeData")&&s.get("getDataPath")&&(t=dg(e,t)),t}},dg=(e,t)=>{for(let o=0,s=e.length;o{e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",0!==e._leafs?.length&&(e._leafs=[]);const t=[],o=[],s=[],i=[];e.childrenAfterGroup=t,e.childrenAfterSort=o,e.childrenAfterAggFilter=s,e.childrenAfterFilter=i;const n=e.sibling;return n&&(n.childrenAfterGroup=t,n.childrenAfterSort=o,n.childrenAfterAggFilter=s,n.childrenAfterFilter=i,n.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},hg=(e,t)=>{if(e)for(let o=0,s=e.length;o{for(let s=t=Math.max(0,t),i=e.length;s{e.length=t.size;let o=0,s=!1,i=!1;for(const n of t){const t=n.sourceRowIndex;t===o?i||(i=s):(t>=0?i=!0:s=!0,n.sourceRowIndex=o,e[o]=n),++o}return i},pg=(e,t,{adds:o})=>{const s=e.length,i=t.size;i>s&&(e.length=i);let n=0;for(let r=0;r{const r=new Array(n);let a,l=0,d=o[l],c=-1,h=0,u=0;const g=o.length,p=s.length;for(;;){if(c<0){if(h>=p)break;if(a=s[h++],c=i.get(a)??-1,c<0)continue}if((e.compareRowNodes(t,d,a)||~i.get(d)-c)<0){if(r[u++]=d,++l>=g)break;d=o[l]}else r[u++]=a,c=-1}for(;l=0&&(r[u++]=e)}return r},Cg=(e,t,o)=>{let s=0;o.length=t.size;for(let i=0,n=e.length;i{const t=e.childrenAfterSort,o=e.sibling;if(o&&(o.childrenAfterSort=t),t)for(let s=0,i=t.length-1;s<=i;s++){const e=t[s],o=0===s,n=s===i;e.firstChild!==o&&(e.firstChild=o,e.dispatchRowEvent("firstChildChanged")),e.lastChild!==n&&(e.lastChild=n,e.dispatchRowEvent("lastChildChanged")),e.childIndex!==s&&(e.childIndex=s,e.dispatchRowEvent("childIndexChanged"))}},wg=e=>{const t=e.childrenAfterSort,o=e.childrenAfterAggFilter,s=t?.length,i=o?.length;if(!s||!i)return null;const n=new Array(i),r=/* @__PURE__ */new Set;for(let l=0;l{const o=t.childrenAfterGroup;if(o)for(let s=0,i=o.length;s{this.beans.groupStage?.invalidateGroupCols(),this.refreshModel({step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")})};this.addManagedEventListeners({newColumnsLoaded:o,columnRowGroupChanged:o,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:()=>this.refreshModel({step:"pivot"}),columnPivotModeChanged:()=>this.refreshModel({step:"group"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),stylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,o=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(e=>!!e);this.stages=o;for(let s=o.length-1;s>=0;--s){const e=o[s];for(const o of e.refreshProps)t.set(o,s)}this.addManagedPropertyListeners([...t.keys(),"rowData"],e=>{const t=e.changeSet?.properties;t&&this.onPropChange(t)}),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,o,s){let i,n=!1;do{i=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(r,o),d=Math.min(a,s);for(let e=l;e<=d;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=Ot(this.beans,t);t.setRowHeight(e.height),i=!0,n=!0}}i&&this.setRowTopAndRowIndex()}while(i);return n}onPropChange(e){const{nodeManager:t,gos:o,beans:s}=this,i=s.groupStage;if(!t)return;const n=new Set(e),r=i?.onPropChange(n);let a;n.has("rowData")?a=o.get("rowData"):r&&(a=i?.extractData()),a&&!Array.isArray(a)&&(a=null,Et(1));const l={step:"nothing",changedProps:n};if(a){const e=!r&&!this.isEmpty()&&a.length>0&&o.exists("getRowId")&&!o.get("resetRowDataOnUpdate");this.refreshingData=!0,e?(l.keepRenderedRows=!0,l.animate=!o.get("suppressAnimationFrame"),l.changedRowNodes=new Fl,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0)}const d=l.rowDataUpdated?"group":this.getRefreshedStage(e);d&&(l.step=d,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:o}=this;if(!t)return null;const s=t.length;let i=s;for(let n=0,r=e.length;n{null==e?.id||t.has(e.id)||e.clearRowTopAndRowIndex()},i=e=>{s(e),s(e.detailNode),s(e.sibling);const t=e.childrenAfterGroup;if(!e.hasChildren()||!t)return;const n=-1==e.level;if(!o||n||e.expanded)for(let o=0,s=t.length;o{let t=i[e];if(this.gos.get("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex},r=t.footerSvc;return r?r?.getTopDisplayIndex(s,e,i,n):n(e)}getTopLevelIndexFromDisplayedIndex(e){const{rootNode:t,rowsToDisplay:o}=this;if(!t||!o.length||o[0]===t)return e;let s=this.getRow(e);s.footer&&(s=s.sibling);let i=s.parent;for(;i&&i!==t;)s=i,i=s.parent;const n=t.childrenAfterSort?.indexOf(s)??-1;return n>=0?n: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:$t(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const e=0===t.length||t.some(e=>e.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:e,keepRenderedRows:!0,animate:$t(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:$t(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new El(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:o,rowDataUpdated:s}=e;return!(!t||o||!s)&&(!t.removals.length&&!t.adds.size)}reMapRows(){if(this.refreshingModel||this.refreshingData)return this.noKeepRenderedRows=!0,this.noKeepUndoRedoStack=!0,void(this.noAnimate=!0);this.refreshModel({step:"map",keepRenderedRows:!1,keepUndoRedoStack:!1,animate:!1})}refreshModel(e){const{nodeManager:t,eventSvc:o,started:s}=this;if(!t)return;const i=!!e.rowDataUpdated,n=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&i));if(s&&i&&o.dispatchEvent({type:"rowDataUpdated"}),this.deferRefresh(e))return this.setPendingRefreshFlags(e),void(this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i));this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.updateRefreshParams(e);let r=!1;this.refreshingModel=!0;try{this.executeRefresh(e,n,i),r=!0}finally{this.refreshingData=!1,this.refreshingModel=!1,r||this.setPendingRefreshFlags(e)}this.clearPendingRefreshFlags(),o.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}executeRefresh(e,t,o){const{beans:s}=this;switch(s.masterDetailSvc?.refreshModel(e),o&&"group"!==e.step&&s.colFilter?.refreshModel(),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(t);case"pivot":this.doPivot(t);case"aggregate":this.doAggregate(t);case"filter_aggregates":this.doFilterAggregates(t);case"sort":this.doSort(t,e.changedRowNodes);case"map":this.doRowsToDisplay()}const i=/* @__PURE__ */new Set;this.setRowTopAndRowIndex(i),this.clearRowTopAndRowIndex(t,i),this.updateRefreshParams(e)}deferRefresh(e){return!!this.refreshingModel||(!!this.beans.colModel.changeEventsDispatching||(this.isSuppressModelUpdateAfterUpdateTransaction(e)?(this.started&&(this.refreshingData=!1),!0):!this.started))}setPendingRefreshFlags(e){this.pendingNewData||(this.pendingNewData=!!e.newData),this.noKeepRenderedRows||(this.noKeepRenderedRows=!e.keepRenderedRows),this.noKeepUndoRedoStack||(this.noKeepUndoRedoStack=!e.keepUndoRedoStack),this.noAnimate||(this.noAnimate=!e.animate)}clearPendingRefreshFlags(){this.pendingNewData=!1,this.noKeepRenderedRows=!1,this.noKeepUndoRedoStack=!1,this.noAnimate=!1}updateRefreshParams(e){e.newData=this.pendingNewData||!!e.newData,e.keepRenderedRows=!this.noKeepRenderedRows&&!!e.keepRenderedRows,e.keepUndoRedoStack=!this.noKeepUndoRedoStack&&!!e.keepUndoRedoStack,e.animate=!this.noAnimate&&!!e.animate}isEmpty(){return!this.rootNode?._leafs?.length||!this.beans.colModel?.ready}isRowsToRender(){return this.rowsToDisplay.length>0}getOverlayType(){const{beans:e,gos:t}=this;if(this.rootNode?._leafs?.length){if(e.filterManager?.isAnyFilterPresent()&&0===this.getRowCount())return"noMatchingRows"}else if(this.rowCountReady||0==(t.get("rowData")?.length??0))return"noRows";return null}getNodesInRangeForSelection(e,t){let o=!1,s=!1;const i=[],n=mo(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(!s)if(o&&(r===t||r===e)&&(s=!0,n&&r.group))bg(i,r);else{if(!o){if(r!==t&&r!==e)return;o=!0,t===e&&(s=!0)}r.group&&n||i.push(r)}}),i}getTopLevelNodes(){return this.rootNode?.childrenAfterGroup??null}getRow(e){return this.rowsToDisplay[e]}getFormulaRow(e){return this.formulaRows[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,o=t.length;if(this.isEmpty()||0===o)return-1;let s=0,i=o-1;if(e<=0)return 0;if(t[i].rowTop<=e)return i;let n=-1,r=-1;for(;;){const o=Math.floor((s+i)/2),a=t[o];if(this.isRowInPixel(a,e))return o;if(a.rowTope&&(i=o-1),n===s&&r===i)return o;n=s,r=i}}isRowInPixel(e,t){const o=e.rowTop,s=o+e.rowHeight;return o<=t&&s>t}forEachLeafNode(e){const t=this.rootNode?._leafs;if(t)for(let o=0,s=t.length;oe.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,e=>e.childrenAfterSort)}forEachPivotNode(e,t,o){const{colModel:s,rowGroupColsSvc:i}=this.beans;if(!s.isPivotMode())return;if(!i?.columns.length)return void e(this.rootNode,0);const n=o?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,e=>e.leafGroup?null:e[n])}depthFirstSearchRowNodes(e,t=!1,o=e=>e.childrenAfterGroup,s=this.rootNode,i=0){let n=i;if(!s)return n;const r=s===this.rootNode;if(r||e(s,n++),s.hasChildren()&&!s.footer){const i=o(s);if(i){const a=this.beans.footerSvc;n=a?.addTotalRows(n,s,e,t,r,"top")??n;for(const s of i)n=this.depthFirstSearchRowNodes(e,t,o,s,n);return a?.addTotalRows(n,s,e,t,r,"bottom")??n}}return n}doAggregate(e){this.rootNode&&this.beans.aggStage?.execute(e)}doFilterAggregates(e){const t=this.rootNode,o=this.beans.filterAggStage;o?o.execute(e):t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const o=this.beans.sortStage;o?o.execute(e,t):e.forEachChangedNodeDepthFirst(e=>{e.childrenAfterSort=e.childrenAfterAggFilter.slice(0),vg(e)})}doGrouping(e){const t=this.rootNode;if(!t)return;const o=this.beans.groupStage?.execute(e);if(void 0===o){const e=t._leafs;t.childrenAfterGroup=e,t.updateHasChildren();const o=t.sibling;o&&(o.childrenAfterGroup=e)}(o||e.rowDataUpdated)&&this.beans.colFilter?.refreshModel(),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;t?t.execute(e):e.forEachChangedNodeDepthFirst(e=>{e.childrenAfterFilter=e.childrenAfterGroup,mg(e)},!0)}doPivot(e){this.beans.pivotStage?.execute(e)}getRowNode(e){const t=this.nodeManager?.getRowNode(e);return"object"==typeof t?t:this.beans.groupStage?.getNonLeaf(e)}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const e=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),e)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){const{nodeManager:e,beans:t,eventSvc:o,asyncTransactions:s}=this;if(!e)return;t.valueCache?.onDataChanged();const i=[],n=[],r=new Fl,a=!this.gos.get("suppressAnimationFrame");for(const{rowDataTransaction:l,callback:d}of s??[]){this.rowNodesCountReady=!0,this.refreshingData=!0;const t=e.updateRowData(l,r,a);i.push(t),d&&n.push(d.bind(null,t))}this.commitTransactions(r,a),n.length>0&&setTimeout(()=>{for(let e=0,t=n.length;e0&&o.dispatchEvent({type:"asyncTransactionsFlushed",results:i}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){const t=this.nodeManager;if(!t)return null;this.beans.valueCache?.onDataChanged(),this.rowNodesCountReady=!0;const o=new Fl,s=!this.gos.get("suppressAnimationFrame");this.refreshingData=!0;const i=t.updateRowData(e,o,s);return this.commitTransactions(o,s),i}commitTransactions(e,t){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:t,changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{rootNode:e,beans:t}=this;if(t.formula?.active){const t=e?.childrenAfterSort??[];this.formulaRows=t,this.rowsToDisplay=t.filter(e=>!e.softFiltered);for(const e of this.rowsToDisplay)e.setUiLevel(0);return}const o=t.flattenStage;if(o)return void(this.rowsToDisplay=o.execute());const s=this.rootNode.childrenAfterSort??[];for(const i of s)i.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 o=e.sibling;o?.setRowHeight(o.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const o=t.detailNode;o?.setRowHeight(o.rowHeight,!0);const s=t.sibling;s?.setRowHeight(s.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){e.rowHeightChanged&&!this.beans.rowAutoHeight?.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,this.stages=null,this.stagesRefreshProps.clear(),clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},class extends We{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e,t){const o=this.beans.sortSvc.getSortOptions(),s=o.length>0&&!!t&&this.gos.get("deltaSort"),{gos:i,colModel:n,rowGroupColsSvc:r,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:d}=this.beans,c=i.get("groupMaintainOrder"),h=n.getCols().some(e=>e.isRowGroupActive()),u=r?.columns,g=n.isPivotMode(),p=i.getCallback("postSortRows");let m,f=!1;if(e?.forEachChangedNodeDepthFirst(i=>{const n=g&&i.leafGroup;let r=c&&h&&!i.leafGroup;r&&(m??(m=this.shouldSortContainsGroupCols(o)),r&&(r=!m));let l=null;if(r){let e=!1;if(u){const t=i.level+1;t{const n=t.childrenAfterSort,r=t.childrenAfterAggFilter;if(!r)return n&&n.length>0?n:[];const a=r.length;if(a<=1)return n?.length!==a||0!==a&&n[0]!==r[0]?r.slice():n;if(!n||a<=4)return e.doFullSortInPlace(r.slice(),i);const l=/* @__PURE__ */new Map,{updates:d,adds:c}=o,h=[];for(let g=0;ge.compareRowNodes(i,t,o)||~l.get(t)-~l.get(o)),u===a?h:fg(e,i,h,n,l,a))})(a,i,t,e,o):a.doFullSortInPlace(i.childrenAfterAggFilter.slice(),o));l||(l=i.childrenAfterAggFilter?.slice()??[]),f||(f=i.childrenAfterSort?.[0]!==l[0]),i.childrenAfterSort=l,vg(i),p&&p({nodes:i.childrenAfterSort})}),f&&i.get("groupHideOpenParents")){const e=d?.columns;e?.length&&l.refreshCells({columns:e,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(Kt(this.gos)){for(let o=0;oi&&(t=i),t}function xg({ctrlsSvc:e,scrollVisibleSvc:t}){const o=e.getGridBodyCtrl(),s=o.isVerticalScrollShowing()?t.getScrollbarWidth():0;return X(o.eGridBody)-s}var Fg="ag-animate-autosize";function Dg({ctrlsSvc:e,gos:t},o){if(!t.get("animateColumnResizing")||t.get("enableRtl")||!e.isAlive())return;const s=e.getGridBodyCtrl().eGridBody.classList;o?s.add(Fg):s.remove(Fg)}var Mg={moduleName:"ColumnAutoSize",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let o=!1;const s=t.type;if("fitGridWidth"===s||"fitProvidedWidth"===s)o=!0;else if("fitCellContents"===s){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const s=e.get("rowData");o=null!=s&&s.length>0&&Lt(e)}o&&this.beans.colDelayRenderSvc?.hideColumns(s)}}autoSizeCols(e){const{eventSvc:t,visibleCols:o,colModel:s}=this.beans;Dg(this.beans,!0),this.innerAutoSizeCols(e).then(i=>{const n=e=>vs(t,Array.from(e),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return Dg(this.beans,!1),n(i);const r=xg(this.beans),a=e.colKeys.filter(e=>!(s.getCol(e)?.getColDef().suppressAutoSize||_o(e)||(e=>o.leftCols.some(t=>Jo(t,e)))(e)||(e=>o.rightCols.some(t=>Jo(t,e)))(e)));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:e.columnLimits?.map(e=>({...e,key:e.colId})),colKeys:a,onlyScaleUp:!0,animate:!1}),Dg(this.beans,!1),n(i)})}innerAutoSizeCols(e){return new Promise((t,o)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,o));const{colKeys:s,skipHeader:i,skipHeaderGroups:n,stopAtGroup:r,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:d=[],source:c="api"}=e,{animationFrameSvc:h,renderStatus:u,colModel:g,autoWidthCalc:p,visibleCols:m}=this.beans;if(h?.flushAllFrames(),this.timesDelayed<5&&u&&(!u.areHeaderCellsRendered()||!u.areCellsRendered()))return this.timesDelayed++,void setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,o)});this.timesDelayed=0;const f=/* @__PURE__ */new Set;let C=-1;const v=Object.fromEntries(d.map(({colId:e,...t})=>[e,t])),w=i??this.gos.get("skipHeaderOnAutoSize"),b=n??w;for(;0!==C;){C=0;const e=[];for(const t of s){if(!t||qo(t))continue;const o=g.getCol(t);if(!o||f.has(o)||o.getColDef().suppressAutoSize)continue;const s=p.getPreferredWidthForColumn(o,w);if(s>0){const e=v[o.colId]??{};e.minWidth??(e.minWidth=l),e.maxWidth??(e.maxWidth=a);const t=Rg(o,s,e);o.setActualWidth(t,c),f.add(o),C++}e.push(o)}e.length&&m.refresh(c)}b||this.autoSizeColumnGroupsByColumns(s,c,r),t(f)})}autoSizeColumn(e,t,o){this.autoSizeCols({colKeys:[e],skipHeader:o,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,o){const{colModel:s,ctrlsSvc:i}=this.beans,n=/* @__PURE__ */new Set,r=s.getColsForKeys(e);for(const l of r){let e=l.getParent();for(;e&&e!=o;)e.isPadding()||n.add(e),e=e.getParent()}let a;for(const l of n){for(const e of i.getHeaderRowContainerCtrls())if(a=e.getHeaderCtrlForColumn(l),a)break;a?.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){this.shouldQueueResizeOperations?this.pushResizeOperation(()=>this.autoSizeAllColumns(e)):this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const o=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",o)};e.addEventListener("dblclick",s);const i=new Br(e);return i.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),i.destroy()}}addColumnGroupResize(e,t,o){const s=this.gos.get("skipHeaderOnAutoSize"),i=()=>{const e=[],i=t.getDisplayedLeafColumns();for(const t of i)t.getColDef().suppressAutoSize||e.push(t.getColId());e.length>0&&this.autoSizeCols({colKeys:e,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),o()};return e.addEventListener("dblclick",i),()=>e.removeEventListener("dblclick",i)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const o=xg(this.beans);o>0?this.sizeColumnsToFit(o,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):100===t?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):500===t?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Et(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",o,i){if(this.shouldQueueResizeOperations)return void this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,o,i));const{beans:n}=this,r=i?.animate??!0;r&&Dg(n,!0);const a={};for(const{key:s,...C}of i?.columnLimits??[])a["string"==typeof s?s:s.getColId()]=C;const l=n.visibleCols.allCols;if(e<=0||!l.length)return;const d=Uo(l);if(i?.onlyScaleUp&&d>e)return;if(e===d&&l.every(e=>{if(e.colDef.suppressSizeToFit)return!0;const t=a?.[e.getId()],o=t?.minWidth??i?.defaultMinWidth,s=t?.maxWidth??i?.defaultMaxWidth,n=e.getActualWidth();return(null==o||n>=o)&&(null==s||n<=s)}))return;const c=[],h=[];for(const s of l){const e=i?.colKeys?.some(e=>Jo(s,e))??!0;s.getColDef().suppressSizeToFit||!e?h.push(s):c.push(s)}const u=c.slice(0);let g=!1;const p=e=>{s(c,e),h.push(e)},m={};for(const s of c){i?.onlyScaleUp&&(m[s.getColId()]=s.getActualWidth()),s.resetActualWidth(t);const e=a?.[s.getId()],o=e?.minWidth??i?.defaultMinWidth??-1/0,n=e?.maxWidth??i?.defaultMaxWidth??1/0,r=s.getActualWidth(),l=Math.max(Math.min(r,n),o);l!=r&&s.setActualWidth(l,t,!0)}for(;!g;){g=!0;const o=e-Uo(h);if(o<=0)for(const e of c){const o=a?.[e.getId()]?.minWidth??i?.defaultMinWidth??e.minWidth;e.setActualWidth(o,t,!0)}else{const e=o/Uo(c);let s=o;for(let o=c.length-1;o>=0;o--){const n=c[o],r=n.getColId(),l=m[r],d=a?.[r],h=d?.minWidth??i?.defaultMinWidth??l,u=d?.maxWidth??i?.defaultMaxWidth,f=Math.max(h??-1/0,n.getMinWidth()),C=Math.min(u??1/0,n.getMaxWidth());let v=Math.round(n.getActualWidth()*e);vC?(v=C,p(n),g=!1):0===o&&(v=s),n.setActualWidth(v,t,!0),s-=v}}}for(const s of u)s.fireColumnWidthChangedEvent(t);const f=n.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),o||(vs(this.eventSvc,u,!0,t),r&&Dg(n,!1))}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,o=e.get("autoSizeStrategy");"fitGridWidth"!==o?.type&&"fitProvidedWidth"!==o?.type||setTimeout(()=>{if(!this.isAlive())return;const e=o.type;if("fitGridWidth"===e){const{columnLimits:e,defaultMinWidth:t,defaultMaxWidth:s}=o,i=e?.map(({colId:e,minWidth:t,maxWidth:o})=>({key:e,minWidth:t,maxWidth:o}));this.sizeColumnsToFitGridBody({defaultMinWidth:t,defaultMaxWidth:s,columnLimits:i})}else"fitProvidedWidth"===e&&this.sizeColumnsToFit(o.width,"sizeColumnsToFit");t?.revealColumns(e)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{if(!this.isAlive())return;const o="autosizeColumns";e?this.autoSizeCols({...t,source:o,colKeys:e}):this.autoSizeAllColumns({...t,source:o}),this.beans.colDelayRenderSvc?.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()}}],apiFunctions:{sizeColumnsToFit:function(e,t){"number"==typeof t?e.colAutosize?.sizeColumnsToFit(t,"api"):e.colAutosize?.sizeColumnsToFitGridBody(t)},autoSizeColumns:Sg,autoSizeAllColumns:function(e,t){t&&"object"==typeof t?Sg(e,t):e.colAutosize?.autoSizeAllColumns({source:"api",skipHeader:t})}},dependsOn:[Ul],css:[":where(.ag-ltr) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,left .2s ease-in-out}}:where(.ag-rtl) :where(.ag-animate-autosize){.ag-cell,.ag-header-cell,.ag-header-group-cell{transition:width .2s ease-in-out,right .2s ease-in-out}}"]},Pg={moduleName:"SharedExport",version:vt,beans:[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:o,columnKeys:s,skipRowGroups:i,exportRowNumbers:n}=t,r=this.getColumnsToExport({allColumns:o,skipRowGroups:i,columnKeys:s,exportRowNumbers:n});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((e,t)=>t(e),e).parse()}processRow(e,t,o,s){const i=t.shouldRowBeSkipped||(()=>!1),n=null!=t.rowPositions||!!t.onlySelected,r=this.gos.get("groupHideOpenParents")&&!n,a=this.colModel.isPivotMode()?s.leafGroup:!s.group,l=!!s.footer,d=1===s.allChildrenCount&&1===s.childrenAfterGroup?.length&&function(e,t){const o=e.get("groupHideParentOfSingleChild");return!0===o||!("leafGroupsOnly"!==o||!t.leafGroup)||!!e.get("groupRemoveSingleChildren")||!(!e.get("groupRemoveLowestSingleChildren")||!t.leafGroup)}(this.gos,s);if(!a&&!l&&(t.skipRowGroups||d||r)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&"top"===s.rowPinned||t.skipPinnedBottom&&"bottom"===s.rowPinned||s.stub)return;if(-1===s.level&&!a&&!l)return;if(i(wo(this.gos,{node:s})))return;const c=e.onNewBodyRow(s);if(o.forEach((e,t)=>{c.onColumn(e,t,s)}),t.getCustomContentBelowRow){const o=t.getCustomContentBelowRow(wo(this.gos,{node:s}));o&&e.addCustomContent(o)}}appendContent(e){return t=>{const o=e.appendContent;return o&&t.addCustomContent(o),t}}prependContent(e){return t=>{const o=e.prependContent;return o&&t.addCustomContent(o),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return o=>{if(!e.skipColumnGroupHeaders){const s=new ql,{colGroupSvc:i}=this.beans,n=i?i.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(n,o,e.processGroupHeaderCallback)}return o}}exportHeaders(e,t){return o=>{if(!e.skipColumnHeaders){const e=o.onNewHeaderRow();t.forEach((t,o)=>{e.onColumn(t,o,void 0)})}return o}}processPinnedTopRows(e,t){return o=>{const s=this.processRow.bind(this,o,e,t);return e.rowPositions?e.rowPositions.filter(e=>"top"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel?.getPinnedTopRow(e.rowIndex)).forEach(s):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("top",s),o}}processRows(e,t){return o=>{const s=this.rowModel,i=Lt(this.gos),n=Gt(this.gos),r=!i&&e.onlySelected,a=this.processRow.bind(this,o,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(e=>null==e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>s.getRow(e.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())i?s.forEachPivotNode(a,!0,"filteredAndSorted"===l):n?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||r){const e=this.beans.selectionSvc?.getSelectedNodes()??[];this.replicateSortedOrder(e),e.forEach(a)}else"all"===l?s.forEachNode(a):i||n?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return o}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:o}=this.beans;if(!t||!o)return;const s=t.getSortOptions(),i=(e,t)=>null!=e.rowIndex&&null!=t.rowIndex?e.rowIndex-t.rowIndex:e.level===t.level?e.parent?.id===t.parent?.id?o.compareRowNodes(s,e,t)||(e.rowIndex??-1)-(t.rowIndex??-1):i(e.parent,t.parent):e.level>t.level?i(e.parent,t):i(e,t.parent);e.sort(i)}processPinnedBottomRows(e,t){return o=>{const s=this.processRow.bind(this,o,e,t);return e.rowPositions?e.rowPositions.filter(e=>"bottom"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel?.getPinnedBottomRow(e.rowIndex)).forEach(s):this.pinnedRowModel?.isManual()||this.pinnedRowModel?.forEachPinnedRow("bottom",s),o}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:o=!1,exportRowNumbers:s=!1,columnKeys:i}=e,{colModel:n,gos:r,visibleCols:a}=this,l=n.isPivotMode(),d=e=>!Ko(e)&&(!_o(e)||s);if(i?.length)return n.getColsForKeys(i).filter(d);const c=r.get("treeData");let h=[];return h=t&&!l?n.getCols():a.allCols,h=h.filter(e=>d(e)&&(!(o&&!c)||!jo(e))),h}recursivelyAddHeaderGroups(e,t,o){const s=[];for(const i of e){const e=i;if(e.getChildren)for(const t of e.getChildren()??[])s.push(t)}e.length>0&&Fs(e[0])&&this.doAddHeaderHeader(t,e,o),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,o)}doAddHeaderHeader(t,o,s){const i=t.onNewHeaderGroupingRow();let n=0;for(const r of o){const t=r;let o;o=s?s(wo(this.gos,{columnGroup:t})):this.beans.colNames.getDisplayNameForColumnGroup(t,"header");const a=(t.isExpandable()?t.getLeafColumns():[]).reduce((t,o,s,i)=>{let n=e(t);return"open"!==o.getColumnGroupShow()?n&&null==n[1]&&(n[1]=s-1):n&&null==n[1]||(n=[s],t.push(n)),s===i.length-1&&n&&null==n[1]&&(n[1]=s),t},[]);i.onColumn(t,o||"",n++,t.getLeafColumns().length-1,a)}}}]},Eg=class extends We{getFileName(e){const t=this.getDefaultFileExtension();return e?.length||(e=this.getDefaultFileName()),e.includes(".")?e:`${e}.${t}`}getData(e){return this.beans.gridSerializer.serialize(this.createSerializingSession(e),e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}};function Tg(e,t){const o=document.defaultView||window;if(!o)return void Et(52);const s=document.createElement("a"),i=o.URL.createObjectURL(t);s.setAttribute("href",i),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:o})),s.remove(),o.setTimeout(()=>{o.URL.revokeObjectURL(i)},0)}var Ag=class{constructor(e){this.valueFrom="data";const{colModel:t,rowGroupColsSvc:o,colNames:s,valueSvc:i,gos:n,processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:d,valueFrom:c}=e;this.colModel=t,this.rowGroupColsSvc=o,this.colNames=s,this.valueSvc=i,this.gos=n,this.processCellCallback=r,this.processHeaderCallback=a,this.processGroupHeaderCallback=l,this.processRowGroupCallback=d,c&&(this.valueFrom=c)}prepare(e){}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e){const{column:t,node:o,currentColumnIndex:s,accumulatedRowIndex:i,type:n,useRawFormula:r}=e,a=0===s&&Xt(this.gos,o,this.colModel.isPivotMode());if(this.processRowGroupCallback&&(this.gos.get("treeData")||o.group)&&(t.isRowGroupDisplayed(o.rowGroupColumn?.getColId()??"")||a))return{value:this.processRowGroupCallback(wo(this.gos,{column:t,node:o}))??""};if(this.processCellCallback)return{value:this.processCellCallback(wo(this.gos,{accumulatedRowIndex:i,column:t,node:o,value:this.valueSvc.getValueForDisplay({column:t,node:o,from:this.valueFrom}).value,type:n,parseValue:e=>this.valueSvc.parseValue(t,o,e,this.valueSvc.getValue(t,o,this.valueFrom)),formatValue:e=>this.valueSvc.formatValue(t,o,e)??e}))??""};const l=this.gos.get("treeData"),d=this.valueSvc,c=-1===o.level&&o.footer,h=!0===t.colDef.showRowGroup&&(o.group||l);if(!c&&(a||h)){let e="",s=o;for(;s&&-1!==s.level;){const{value:o,valueFormatted:i}=d.getValueForDisplay({column:a?void 0:t,node:s,includeValueFormatted:!0,exporting:!0,from:this.valueFrom});e=` -> ${i??o??""}${e}`,s=s.parent}return{value:e,valueFormatted:e}}const{value:u,valueFormatted:g}=d.getValueForDisplay({column:t,node:o,includeValueFormatted:!0,exporting:!0,useRawFormula:r,from:this.valueFrom});return{value:u??"",valueFormatted:g}}getHeaderName(e,t){return e?e(wo(this.gos,{column:t})):this.colNames.getDisplayNameForColumn(t,"csv",!0)}},Ig=class extends Ag{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:o}=e;this.suppressQuotes=t,this.columnSeparator=o}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach(e=>{this.beginNewLine(),e.forEach((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,o,s){0!=o&&(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){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,o){0!=t&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue({column:e,node:o,currentColumnIndex:t,accumulatedRowIndex:t,type:"csv",useRawFormula:!1});this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(Et(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}};var kg,Lg={moduleName:"CsvExport",version:vt,beans:[class extends Eg{constructor(){super(...arguments),this.beanName="csvCreator"}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void Et(51);const t=()=>{const t=this.getMergedParams(e),o=this.getData(t),s=new Blob(["\ufeff",o],{type:"text/plain"}),i=t.fileName,n="function"==typeof i?i(wo(this.gos,{})):i;Tg(this.getFileName(n),s)},{overlays:o}=this.beans;o?o.showExportOverlay(t):t()}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const o=t?Object.assign({},e):this.getMergedParams(e);return this.getData(o)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:o,rowGroupColsSvc:s,valueSvc:i,gos:n}=this.beans,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:d,suppressQuotes:c,columnSeparator:h,valueFrom:u}=e;return new Ig({colModel:t,colNames:o,valueSvc:i,gos:n,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:d||void 0,suppressQuotes:c||!1,columnSeparator:h||",",rowGroupColsSvc:s,valueFrom:u})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}}],apiFunctions:{getDataAsCsv:function(e,t){return e.csvCreator?.getDataAsCsv(t)},exportDataAsCsv:function(e,t){e.csvCreator?.exportDataAsCsv(t)}},dependsOn:[Pg]},Gg=class extends ze{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}postConstruct(){this.refreshTooltip()}setBrowserTooltip(e,t){const o="title",s=this.ctrl.getGui();s&&(null==e||""==e&&!t?s.removeAttribute(o):s.setAttribute(o,e))}updateTooltipText(){const{getTooltipValue:e}=this.ctrl;e&&(this.tooltip=e())}createTooltipFeatureIfNeeded(){if(null==this.tooltipManager){const e=this.beans.registry.createDynamicBean("tooltipStateManager",!0,this.ctrl,()=>this.tooltip);e&&(this.tooltipManager=this.createBean(e,this.beans.context))}}attemptToShowTooltip(){this.tooltipManager?.prepareToShowTooltip()}attemptToHideTooltip(){this.tooltipManager?.hideTooltip()}setTooltipAndRefresh(e){this.tooltip=e,this.refreshTooltip()}refreshTooltip(e){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)):(this.setBrowserTooltip(e?"":null,e),this.createTooltipFeatureIfNeeded())}destroy(){this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context),super.destroy()}},Ng=!1,Bg=class extends ze{constructor(e,t){super(),this.tooltipCtrl=e,this.getTooltipValue=t,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.tooltipCtrl.getGui();0===this.tooltipTrigger&&this.addManagedListeners(e,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),1===this.tooltipTrigger&&this.addManagedListeners(e,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(e,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(e,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return Math.max(200,t)}getTooltipDelay(e){return this.tooltipCtrl[`getTooltip${e}DelayOverride`]?.()??this.getGridOptionsTooltipDelay(`tooltip${e}Delay`)}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),sn()||(Ng?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},100):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){const t=e.relatedTarget,o=this.tooltipCtrl.getGui(),s=this.tooltipComp?.getGui();this.isInteractingWithTooltip||o.contains(t)||this.interactionEnabled&&s?.contains(t)||this.setToDoNothing()}onKeyDown(){this.isInteractingWithTooltip&&(this.isInteractingWithTooltip=!1),this.setToDoNothing()}prepareToShowTooltip(e){if(0!=this.state||Ng)return;let t=0;e&&(t=this.isLastTooltipHiddenRecently()?this.getTooltipDelay("SwitchShow"):this.getTooltipDelay("Show")),this.lastMouseEvent=e||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),t),this.state=1}isLastTooltipHiddenRecently(){return Date.now()-kg<1e3}setToDoNothing(e){e||2!==this.state||this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.clearEventHandlers(),this.onDocumentKeyDownCallback&&(this.onDocumentKeyDownCallback(),this.onDocumentKeyDownCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e=this.getTooltipValue(),t=this.tooltipCtrl;if(!a(e)||t.shouldDisplayTooltip&&!t.shouldDisplayTooltip())return void this.setToDoNothing();const o=this.gos.addCommon({location:t.getLocation?.()??"UNKNOWN",value:e,hideTooltipCallback:()=>this.hideTooltip(!0),...t.getAdditionalParams?.()});this.state=2,this.tooltipInstanceCount++;const s=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.createTooltipComp(o,s)}hideTooltip(e){!e&&this.isInteractingWithTooltip||(this.tooltipComp&&(this.destroyTooltipComp(),kg=Date.now()),this.eventSvc.dispatchEvent({type:"tooltipHide",parentGui:this.tooltipCtrl.getGui()}),e&&(this.isInteractingWithTooltip=!1),this.setToDoNothing(!0))}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.destroyBean(t);const o=t.getGui();this.tooltipComp=t,o.classList.contains("ag-tooltip")||o.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&o.classList.add("ag-tooltip-animate"),this.interactionEnabled&&o.classList.add("ag-tooltip-interactive");const s=this.getLocaleTextFunc(),i=this.popupSvc?.addPopup({eChild:o,ariaLabel:s("ariaLabelTooltip","Tooltip")});if(i&&(this.tooltipPopupDestroyFunc=i.hideFunc),this.positionTooltip(),1===this.tooltipTrigger){const e=()=>this.setToDoNothing();[this.onBodyScrollEventCallback]=this.addManagedEventListeners({bodyScroll:e}),this.setEventHandlers(e)}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(o,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(b(this.beans),{keydown:e=>{o.contains(e?.target)||this.onKeyDown()}}),1===this.tooltipTrigger&&([this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(o,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}))),this.eventSvc.dispatchEvent({type:"tooltipShow",tooltipGui:o,parentGui:this.tooltipCtrl.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,this.lockService())}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){const e=this.tooltipComp?.getGui(),t=w(this.beans);return!!e&&e.contains(t)}onTooltipFocusOut(e){const t=this.tooltipCtrl.getGui();this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,t.contains(e.relatedTarget)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupSvc?.positionPopupUnderMouseEvent({...e,mouseEvent:this.lastMouseEvent}):this.popupSvc?.positionPopupByComponent({...e,eventSource:this.tooltipCtrl.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,o=0===this.tooltipTrigger?1e3:0;window.setTimeout(()=>{e(),this.destroyBean(t)},o),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){for(const e of[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener])e&&e();this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){Ng=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},100)}unlockService(){Ng=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("Hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}},Hg=0,Og=class extends ze{constructor(){super(...arguments),this.beanName="popupSvc",this.popupList=[]}postConstruct(){this.addManagedEventListeners({stylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.getDefaultPopupParent()}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:o,nudgeY:s,skipObserver:i}=e;this.positionPopup({ePopup:t,nudgeX:o,nudgeY:s,keepWithinBounds:!0,skipObserver:i,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,e.type,e.ePopup,null,e.mouseEvent)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:o,nudgeY:s,keepWithinBounds:i,eventSource:n,alignSide:r="left",position:a="over",type:l}=e,d=n.getBoundingClientRect(),c=this.getParentRect();this.setAlignedTo(n,t);this.positionPopup({ePopup:t,nudgeX:o,nudgeY:s,keepWithinBounds:i,updatePosition:()=>{let o,i=d.left-c.left;return"right"===r&&(i-=t.offsetWidth-d.width),"over"===a?(o=d.top-c.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),o="under"===this.shouldRenderUnderOrAbove(t,d,c,e.nudgeY||0)?d.top-c.top+d.height:d.top-t.offsetHeight-2*(s||0)-c.top),{x:i,y:o}},postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,l,t,n,null)})}positionPopupForMenu(e){const{eventSource:t,ePopup:o,event:s}=e,i=t.getBoundingClientRect(),n=this.getParentRect();this.setAlignedTo(t,o);let r=!1;this.positionPopup({ePopup:o,keepWithinBounds:!0,updatePosition:()=>{const e=this.keepXYWithinBounds(o,i.top-n.top,0),t=o.clientWidth>0?o.clientWidth:200;r||(o.style.minWidth=`${t}px`,r=!0);const s=n.right-n.left-t;let a;return this.gos.get("enableRtl")?(a=d(),a<0&&(a=l(),this.setAlignedStyles(o,"left")),a>s&&(a=0,this.setAlignedStyles(o,"right"))):(a=l(),a>s&&(a=d(),this.setAlignedStyles(o,"right")),a<0&&(a=0,this.setAlignedStyles(o,"left"))),{x:a,y:e};function l(){return i.right-n.left-2}function d(){return i.left-n.left-t}},postProcessCallback:()=>this.callPostProcessPopup(e.additionalParams,"subMenu",o,t,s instanceof MouseEvent?s:void 0)})}shouldRenderUnderOrAbove(e,t,o,s){const i=o.bottom-t.bottom,n=t.top-o.top,r=e.offsetHeight+s;return i>r?"under":n>r||n>i?"above":"under"}setAlignedStyles(e,t){const o=this.getPopupIndex(e);if(-1===o)return;const{alignedToElement:s}=this.popupList[o];if(s){for(const t of["right","left","over","above","under"])s.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`);t&&(s.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}}setAlignedTo(e,t){const o=this.getPopupIndex(t);if(-1!==o){this.popupList[o].alignedToElement=e}}positionPopup(e){const{ePopup:t,keepWithinBounds:o,nudgeX:s,nudgeY:i,skipObserver:n,updatePosition:r}=e,a={width:0,height:0},l=(n=!1)=>{let{x:l,y:d}=r();n&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,s&&(l+=s),i&&(d+=i),o&&(l=this.keepXYWithinBounds(t,l,1),d=this.keepXYWithinBounds(t,d,0)),t.style.left=`${l}px`,t.style.top=`${d}px`,e.postProcessCallback&&e.postProcessCallback())};if(l(),!n){const e=be(this.beans,t,()=>l(!0));setTimeout(()=>e(),200)}}getParentRect(){const e=b(this.beans);let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),te(t)}keepXYWithinBounds(e,t,o){const s=0===o,i=s?"clientHeight":"clientWidth",n=s?"top":"left",r=s?"height":"width",a=s?"scrollTop":"scrollLeft",l=b(this.beans),d=l.documentElement,c=this.getPopupParent(),h=e.getBoundingClientRect(),u=c.getBoundingClientRect(),g=l.documentElement.getBoundingClientRect(),p=c===l.body,m=Math.ceil(h[r]);let f=p?(s?J:ee)(d)+d[a]:c[i];p&&(f-=Math.abs(g[n]-u[n]));const C=f-m;return Math.min(Math.max(t,0),Math.max(C,0))}addPopup(e){const{eChild:t,ariaLabel:o,ariaOwns:s,alwaysOnTop:i,positionCallback:n,anchorToElement:r}=e,a=this.getPopupIndex(t);if(-1!==a)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(t);const l=this.createPopupWrapper(t,!!i,o,s),d=this.addEventListenersToPopup({...e,wrapperEl:l});return n&&n(),this.addPopupToPopupList(t,l,d,r),{hideFunc:d}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();a(e.style.top)||(e.style.top=-1*t.top+"px"),a(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,o,s){const i=this.getPopupParent(),{environment:n,gos:r}=this.beans,a=Fe({tag:"div"});return n.applyThemeClasses(a),a.classList.add("ag-popup"),e.classList.add(r.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||P(e,"dialog"),o?E(e,o):s&&(e.id||(e.id=`popup-component-${Hg}`),W(s,e.id)),a.appendChild(e),i.appendChild(a),t?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),a}addEventListenersToPopup(e){const t=this.beans,o=b(t),{wrapperEl:s,eChild:i,closedCallback:n,afterGuiAttached:r,closeOnEsc:a,modal:l,ariaOwns:d}=e;let c=!1;const h=e=>{s.contains(w(t))&&(e.key!==Ts||this.isStopPropagation(e)||p({keyboardEvent:e}))},u=e=>p({mouseEvent:e}),g=e=>p({touchEvent:e}),p=(e={})=>{const{mouseEvent:t,touchEvent:r,keyboardEvent:a,forceHide:l}=e;(l||!this.isEventFromCurrentPopup({mouseEvent:t,touchEvent:r},i)&&!c)&&(c=!0,s.remove(),o.removeEventListener("keydown",h),o.removeEventListener("mousedown",u),o.removeEventListener("touchstart",g),o.removeEventListener("contextmenu",u),this.eventSvc.removeListener("dragStarted",u),n&&n(t||r||a),this.removePopupFromPopupList(i,d))};return r&&r({hidePopup:p}),window.setTimeout(()=>{a&&o.addEventListener("keydown",h),l&&(o.addEventListener("mousedown",u),this.eventSvc.addListener("dragStarted",u),o.addEventListener("touchstart",g),o.addEventListener("contextmenu",u))},0),p}addPopupToPopupList(e,t,o,s){this.popupList.push({element:e,wrapper:t,hideFunc:o,instanceId:Hg,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s),Hg+=1}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const o=this.getPopupIndex(e);if(-1===o)return;const s=this.popupList[o];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(e=>e&&e()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const i=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=i,s.isAnchored=!0,i}removePopupFromPopupList(e,t){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),t&&W(t,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),o=t.getBoundingClientRect(),{element:s,ePopup:i}=e,n=s.getBoundingClientRect(),r=e=>Number.parseInt(e.substring(0,e.length-1),10),a=(e,t)=>{const s=o[e]-n[e],a=r(i.style[e]);return{initialDiff:s,lastDiff:s,initial:a,last:a,direction:t}},l=a("top",0),d=a("left",1),c=this.beans.frameworkOverrides;return new Zs(o=>{c.wrapIncoming(()=>{var n,a;(n=()=>{const o=t.getBoundingClientRect(),n=s.getBoundingClientRect();if(0==n.top&&0==n.left&&0==n.height&&0==n.width)return void e.hidePopup();const a=(e,t)=>{const s=r(i.style[t]);e.last!==s&&(e.initial=s,e.last=s);const a=o[t]-n[t];if(a!=e.lastDiff){const o=this.keepXYWithinBounds(i,e.initial+e.initialDiff-a,e.direction);i.style[t]=`${o}px`,e.last=o}e.lastDiff=a};a(l,"top"),a(d,"left")},a=200,new Zs(e=>{e(window.setInterval(n,a))})).then(e=>{o(()=>{null!=e&&window.clearInterval(e)})})},"popupPositioning")})}isEventFromCurrentPopup(e,t){const{mouseEvent:o,touchEvent:s}=e,i=o||s;if(!i)return!1;const n=this.getPopupIndex(t);if(-1===n)return!1;for(let r=n;re.element)}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return Sn(e)}}]};function zg(e){return"whenTruncated"===e.get("tooltipShowMode")}function Wg(e,t){return zg(e)?ge(t):void 0}var Ug=(e,t)=>{const o=e;return"function"==typeof o.getTranslatedMessage?o.getTranslatedMessage(t):e.message},$g=(e,t,o)=>{const{editModelSvc:s}=e,i=s?.getCellValidationModel()?.getCellValidation(t)?.errorMessages,n=s?.getRowValidationModel().getRowValidation(t)?.errorMessages,r=i||n;return r?.length?r.join(o("tooltipValidationErrorSeparator",". ")):void 0},jg=(e,t,o)=>{const{editSvc:s}=e,{column:i}=t,n=((e,t)=>{if(zg(e.gos)){if(t.isCellRenderer()){const e=t.column.getColDef();if(!e.showRowGroup&&"agGroupCellRenderer"!==e.cellRenderer)return;return ge(()=>{const e=t.eGui;return e.querySelector(".ag-group-value")||e.querySelector(".ag-cell-value")||e})}return ge(()=>{const e=t.eGui;return 0===e.children.length?e:e.querySelector(".ag-cell-value")})}})(e,t),r=()=>!s?.isEditing(t)&&(!n||!!i.isTooltipEnabled()&&n());return{shouldDisplayDefault:r,shouldDisplayColumnTooltip:r,shouldDisplayCustomTooltip:o??r}},Kg={moduleName:"Tooltip",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,o,s){e&&t.destroyBean(e);const i=this.gos,n=zg(i),{column:r,eGui:a}=t,l=r.getColDef();s||!n||l.headerComponent||(s=ge(()=>a.querySelector(".ag-header-cell-text")));const d="header",c=this.beans.colNames.getDisplayNameForColumn(r,"header",!0),h=o??c,u={getGui:()=>a,getLocation:()=>d,getTooltipValue:()=>o??l?.headerTooltipValueGetter?.(wo(i,{location:d,colDef:l,column:r,value:h,valueFormatted:c}))??l?.headerTooltip,shouldDisplayTooltip:s,getAdditionalParams:()=>({column:r,colDef:r.getColDef()})};let g=this.createTooltipFeature(u);return g&&(g=t.createBean(g),t.setRefreshFunction("tooltip",()=>g.refreshTooltip())),g}setupHeaderGroupTooltip(e,t,o,s){e&&t.destroyBean(e);const i=this.gos,n=zg(i),{column:r,eGui:a}=t,l=r.getColGroupDef();s||!n||l?.headerGroupComponent||(s=ge(()=>a.querySelector(".ag-header-group-text")));const d="headerGroup",c=this.beans.colNames.getDisplayNameForColumnGroup(r,"header"),h=o??c,u={getGui:()=>a,getLocation:()=>d,getTooltipValue:()=>o??l?.headerTooltipValueGetter?.(wo(i,{location:d,colDef:l,column:r,value:h,valueFormatted:c}))??l?.headerTooltip,shouldDisplayTooltip:s,getAdditionalParams:()=>{const e={column:r};return l&&(e.colDef=l),e}},g=this.createTooltipFeature(u);return g?t.createBean(g):g}enableCellTooltipFeature(e,t,o){const{beans:s}=this,{column:i,rowNode:n}=e,r=jg(s,e,o),l=this.getLocaleTextFunc();let d=null;const c=()=>(d=(({beans:e,ctrl:t,value:o,displayFunctions:s,translate:i})=>{const{editSvc:n,formula:r,gos:l}=e,{column:d,rowNode:c}=t;if(r?.active&&d.isAllowFormula()){const e=r.getFormulaError(d,c);if(e)return{value:Ug(e,i),location:"cellFormula",shouldDisplay:()=>!!r?.getFormulaError(d,c)}}if(!n?.isEditing(t)){const o=$g(e,t,i);if(o)return{value:o,location:"cellEditor",shouldDisplay:()=>!n?.isEditing(t)&&!!$g(e,t,i)}}const{shouldDisplayCustomTooltip:h,shouldDisplayColumnTooltip:u}=s;if(null!=o)return{value:o,location:"cell",shouldDisplay:h};const g=d.getColDef(),p=c.data;if(g.tooltipField&&a(p))return{value:hd(p,g.tooltipField,d.isTooltipFieldContainsDots()),location:"cell",shouldDisplay:u};const m=g.tooltipValueGetter;return m?{value:m(wo(l,{location:"cell",colDef:d.getColDef(),column:d,rowIndex:t.cellPosition.rowIndex,node:c,data:c.data,value:t.value,valueFormatted:t.valueFormatted})),location:"cell",shouldDisplay:u}:null})({beans:s,ctrl:e,value:t,displayFunctions:r,translate:l}),d),h={getGui:()=>e.eGui,getLocation:()=>d?.location??"cell",getTooltipValue:()=>c()?.value,shouldDisplayTooltip:()=>{const e=d??c();return!!e&&(!e.shouldDisplay||e.shouldDisplay())},getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:n,data:n.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(h,s)}setupFullWidthRowTooltip(e,t,o,s){const i={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>o,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},n=this.beans,r=n.context;e&&t.destroyBean(e,r);const a=this.createTooltipFeature(i,n);if(a)return t.createBean(a,r)}setupCellEditorTooltip(e,t){const{beans:o}=this,{context:s}=o,i=t.getValidationElement?.(!0)||!t.isPopup?.()&&e.eGui;if(!i)return;const n=this.createTooltipFeature({getGui:()=>i,getTooltipValue:()=>$g(o,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{const{editModelSvc:e}=o,t=e?.getRowValidationModel()?.getRowValidationMap(),s=e?.getCellValidationModel()?.getCellValidationMap(),i=!!t&&t.size>0,n=!!s&&s.size>0;return i||n}},o);return n?e.createBean(n,s):void 0}initCol(e){const{colDef:t}=e;e.tooltipEnabled=a(t.tooltipField)||a(t.tooltipValueGetter)||a(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}}],dynamicBeans:{tooltipFeature:Gg,highlightTooltipFeature:class extends Gg{constructor(e,t,o){super(e,o),this.highlightTracker=t,this.onHighlight=this.onHighlight.bind(this)}postConstruct(){super.postConstruct(),this.wireHighlightListeners()}wireHighlightListeners(){this.addManagedPropertyListener("tooltipTrigger",({currentValue:e})=>{this.setTooltipMode(e)}),this.setTooltipMode(this.gos.get("tooltipTrigger")),this.highlightTracker.addEventListener("itemHighlighted",this.onHighlight)}onHighlight(e){1===this.tooltipMode&&(e.highlighted?this.attemptToShowTooltip():this.attemptToHideTooltip())}setTooltipMode(e="focus"){this.tooltipMode="focus"===e?1:0}destroy(){this.highlightTracker.removeEventListener("itemHighlighted",this.onHighlight),super.destroy()}},tooltipStateManager:class extends Bg{createTooltipComp(e,t){(function(e,t){return e.getCompDetails(t.colDef,wi,"agTooltipComponent",t,!0)})(this.beans.userCompFactory,e)?.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){this.onColumnMovedEventCallback?.(),this.onColumnMovedEventCallback=void 0}}},userComponents:{agTooltipComponent:class extends wr{constructor(){super({tag:"div",cls:"ag-tooltip"})}init(e){const{value:t}=e,o=this.getGui();o.textContent=m(t);const s=e.location.replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase();o.classList.add(`ag-${s}-tooltip`)}}},dependsOn:[Vg],css:[".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip),&:where(.ag-cell-formula-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}"]},_g={selector:"AG-INPUT-TEXT-FIELD",component:class extends Pr{constructor(e,t="ag-text-field",o="text"){super(e,t,o)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){const o=this.eInput;return o.value!==e&&(o.value=a(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}setCustomValidity(e){const t=this.eInput,o=e.length>0;t.setCustomValidity(e),o&&t.reportValidity(),k(t,o)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListeners(this.eInput,{keydown:t=>{ua(t)&&t.key&&!e.test(t.key)&&t.preventDefault()},paste:t=>{(t.clipboardData?.getData("text"))?.split("").some(t=>!e.test(t))&&t.preventDefault()}})}}},qg=class extends br{constructor(e){super(),this.cellEditorInput=e,this.eEditor=null}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:o}=this,{cellStartedEdit:s,eventKey:i,suppressPreventDefault:n}=e;let r;o.getInputElement().setAttribute("title",""),t.init(o,e);let a=!0;s?(this.focusAfterAttached=!0,i===Ms||i===Ns?r="":i&&1===i.length?n?a=!1:r=i:(r=t.getStartValue(),i!==Bs&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,r=t.getStartValue()),a&&null!=r&&o.setStartValue(r),this.addGuiEventListener("keydown",e=>{const{key:t}=e;t!==Hs&&t!==Os||e.preventDefault()})}afterGuiAttached(){const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;en()||t.getFocusableElement().focus();const o=t.getInputElement();this.highlightAllOnFocus?o.select():this.cellEditorInput.setCaret?.()}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),o=e.getInputElement();t.focus(),o.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},Yg={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},Zg=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return Yg}getAgComponents(){return[_g]}init(e,t){this.eEditor=e,this.params=t;const o=t.maxLength;null!=o&&e.setMaxLength(o)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:o}=e,s=this.getValue(),i=this.getLocaleTextFunc();let n=[];return null!=t&&"string"==typeof s&&s.length>t&&n.push(i("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),n.length||(n=null),o?o({value:s,cellEditorParams:e,internalErrors:n}):n}getValue(){const{eEditor:e,params:t}=this,o=e.getValue();return a(o)||a(t.value)?t.parseValue(o):t.value}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){en()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),o=a(t)&&t.length||0;o&&e.getInputElement().setSelectionRange(o,o)}},Qg=class extends qg{constructor(){super(new Zg(()=>this.getLocaleTextFunc()))}};var Xg={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Jg=class extends wr{constructor(e){super(Xg),this.params=e}postConstruct(){Ut(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedElementListeners(e,{keydown:e=>{ba(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)}})}};function ep(e,t){return e.editModelSvc?.hasEdits(t,{withOpenEditor:!0})??!1}function tp(e,t){const o=t.column,s=t.rowNode,i=o.getColDef();if(!s)return ep(e,t);const n=i.editable;if(s.group){const n=i.groupRowEditable;if(null!=n)return!!o.isColumnFunc(s,n)||ep(e,t)}return!!o.isColumnFunc(s,n)||ep(e,t)}var op=(e,t=!1)=>{if(void 0!==e)return Bh(e)||t&&"editing"===e.state};function sp(e,t,o=!1){return op(e.editModelSvc?.getEdit(t),o)}var ip=(e,t,o)=>{if(e)for(let s=0,i=e.length;s{const t={rowNode:s,column:e};return sp(o,t,!0)||np(o,t)||rp(o,t)});return void this.applyStyle(n,e)}this.applyStyle(n)}applyStyle(e=!1,t=!1){const o=!!this.editSvc?.isBatchEditing(),s="fullRow"===this.gos.get("editType");this.rowCtrl?.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",s&&t),i.toggleCss("ag-row-batch-edit",s&&t&&o),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},dp=e=>()=>{const t=new Set(e.colModel.getCols()),o=e.editModelSvc.getEditMap(!0);(({editModelSvc:e},t,o)=>{for(const s of t)e?.getEditRow(s)?.forEach((t,i)=>!o.has(i)&&e.removeEdits({rowNode:s,column:i}))})(e,(({rowModel:e,pinnedRowModel:t,editModelSvc:o},s)=>{const i=/* @__PURE__ */new Set;e.forEachNode(e=>s.has(e)&&i.add(e)),t?.forEachPinnedRow("top",e=>s.has(e)&&i.add(e)),t?.forEachPinnedRow("bottom",e=>s.has(e)&&i.add(e));for(const n of s)i.has(n)||o.removeEdits({rowNode:n});return i})(e,new Set(o.keys())),t)},cp=/* @__PURE__ */new Set(["undo","redo","paste","bulk","rangeSvc"]),hp=/* @__PURE__ */new Set(["ui","api"]),up={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},gp=new Set(Object.keys(up)),pp=/* @__PURE__ */new Set(["paste","rangeSvc","cellClear","redo","undo"]),mp={cancel:!0,source:"api"},fp={cancel:!1,source:"api"},Cp={checkSiblings:!0},vp={force:!0,suppressFlash:!0};function wp(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(e=>Array.from(e.keys())))]:void 0}}function bp(e,t){return t??e.get("editType")??"singleCell"}var yp=class extends We{postConstruct(){this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:this.onCellFocusChanged?.bind(this),cellFocusCleared:this.onCellFocusChanged?.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const o=e.previousParams,{editSvc:s,beans:i}=this,n="cellFocused"===e.type?e.sourceEvent:null;o&&(t=kh(i,o));const{gos:r,editModelSvc:a}=i,l="cellFocusCleared"===e.type;if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:t,rowIndex:d,rowPinned:c}=e,h={column:t,rowNode:In(i,{rowIndex:d,rowPinned:c})},u="block"===r.get("invalidEditValueMode");if(u)return;const g=!u,p=!!a?.getCellValidationModel().hasCellValidation(h),m=g&&p;!o&&!l||s.stopEditing(void 0,{cancel:m,source:l&&g?"api":void 0,event:n})||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t?.refreshCell({suppressFlash:!0,force:!0})}stopCancelled(e){const t=this.editSvc.isBatchEditing()&&!e;for(const o of this.model.getEditPositions())_h(this.beans,o,{cancel:!0},kh(this.beans,o)),this.model.stop(o,t,!0);return!0}stopCommitted(e,t){const o=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const r of o)s.all.push(r),(this.model.getCellValidationModel().getCellValidation(r)?.errorMessages?.length??0)>0?s.fail.push(r):s.pass.push(r);const i=this.processValidationResults(s),n=this.editSvc.isBatchEditing()&&!t;for(const r of i.destroy)_h(this.beans,r,{event:e},kh(this.beans,r)),this.model.stop(r,n,!1);for(const r of i.keep){const e=kh(this.beans,r);!this.editSvc.cellEditingInvalidCommitBlocks()&&e&&this.editSvc.revertSingleCellEdit(e)}return!0}cleanupEditors({rowNode:e}={},t){Uh(this.beans,{persist:!1});const o=this.model.getEditPositions(),s=[];if(e)for(const i of o)i.rowNode!==e&&s.push(i);else for(const i of o)s.push(i);Kh(this.beans,s),zh(this.beans,t)}setFocusOutOnEditor(e){e.comp?.getCellEditor()?.focusOut?.()}setFocusInOnEditor(e){const t=e.comp,o=t?.getCellEditor();if(o?.focusIn)o.focusIn();else{const o="fullRow"===this.beans.gos.get("editType");e.focusCell(o),e.onEditorAttachedFuncs.push(()=>t?.getCellEditor()?.focusIn?.())}}setupEditors(e){const{event:t,ignoreEventKey:o=!1,startedEdit:s,position:i,cells:n=this.model.getEditPositions()}=e,r=t instanceof KeyboardEvent&&!o&&t.key||void 0;!function(e,t,o,s,i,n){0===t.length&&o?.rowNode&&o?.column&&Hh(e,o,{key:s,event:i,cellStartedEdit:n});const{valueSvc:r,editSvc:a,editModelSvc:l}=e,{rowNode:d,column:c}=o??{};for(const h of t){const{rowNode:t,column:u}=h,g=kh(e,h);if(!g){if(t&&u){const i=r.getValue(u,t,"data"),n=(o?.rowNode===t&&o?.column===u&&s||void 0)??a?.getCellDataValue(h)??r.getValueForDisplay({column:u,node:t,from:"edit"})?.value??i??Nh;l?.setEdit(h,{pendingValue:jh(e,n,!1,u),sourceValue:i,state:"editing"})}continue}const p=n&&d===g.rowNode&&g.column===c;Hh(e,{rowNode:d,column:g.column},{key:p?s:null,event:p?i:null,cellStartedEdit:p&&n})}}(this.beans,n,i,r,t,s)}dispatchCellEvent(e,t,o,s){const i=kh(this.beans,e);i&&this.eventSvc.dispatchEvent({...i.createEvent(t??null,o),...s})}dispatchRowEvent(e,t,o){if(o)return;const s=Ih(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,o="ui"){const s=this.editSvc.isBatchEditing();return!(!s||"api"!==o)||(!s||"ui"!==o&&"edit"!==o)&&("api"===o||(t instanceof KeyboardEvent&&!s?t.key===Es:null))}shouldCancel(e,t,o="ui"){const s=this.editSvc.isBatchEditing();return t instanceof KeyboardEvent&&!s&&t.key===Ts||(!(!s||"api"!==o)||"api"===o)}setEditMap(e,t){t?.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const o=[];if(e.forEach((e,t)=>{e.forEach((e,s)=>{"editing"===e.state&&o.push({...e,rowNode:t,column:s})})}),t?.update&&(e=new Map([...this.model.getEditMap(),...e])),this.model?.setEditMap(e),o.length>0){const e=o.at(-1),t=e.pendingValue===Nh?void 0:e.pendingValue;this.start({position:e,event:new KeyboardEvent("keydown",{key:t}),source:"api"});const s=kh(this.beans,e);s&&this.setFocusInOnEditor(s)}}destroy(){this.cleanupEditors(),super.destroy()}},Sp={moduleName:"TextEditor",version:vt,userComponents:{agCellEditor:Qg,agTextCellEditor:Qg},dependsOn:[{moduleName:"EditCore",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="editModelSvc",this.edits=/* @__PURE__ */new Map,this.cellValidations=new Th,this.rowValidations=new Ah,this.suspendEdits=!1}suspend(e){this.suspendEdits=e}removeEdits({rowNode:e,column:t}){if(!this.hasEdits({rowNode:e})||!e)return;const o=this.getEditRow(e);t?o.delete(t):o.clear(),0===o.size&&this.edits.delete(e)}getEditRow(e,t={}){if(this.suspendEdits)return;if(0===this.edits.size)return;const o=e&&this.edits.get(e);if(o)return o;if(t.checkSiblings){const t=e.pinnedSibling;if(t)return this.getEditRow(t)}}getEditRowDataValue(e,{checkSiblings:t}={}){if(!e||0===this.edits.size)return;const o=this.getEditRow(e),s=e.pinnedSibling,i=t&&s&&this.getEditRow(s);if(!o&&!i)return;const n={...e.data},r=(e,t)=>e.forEach(({pendingValue:e},o)=>{e!==Nh&&(t[o.getColId()]=e)});return o&&r(o,n),i&&r(i,n),n}getEdit(e={},t){const{rowNode:o,column:s}=e,i=this.edits;if(this.suspendEdits||0===i.size||!o||!s)return;const n=i.get(o)?.get(s);if(n)return n;if(t?.checkSiblings){const e=o.pinnedSibling;if(e)return i.get(e)?.get(s)}}getEditMap(e=!0){if(this.suspendEdits||0===this.edits.size)/* @__PURE__ */return new Map;if(!e)return this.edits;const t=/* @__PURE__ */new Map;return this.edits.forEach((e,o)=>{const s=/* @__PURE__ */new Map;e.forEach(({editorState:e,...t},o)=>s.set(o,{...t})),t.set(o,s)}),t}setEditMap(e){this.edits.clear(),e.forEach((e,t)=>{const o=/* @__PURE__ */new Map;e.forEach((e,t)=>o.set(t,{...e})),this.edits.set(t,o)})}setEdit(e,t){const o=this.edits;0!==o.size&&o.has(e.rowNode)||o.set(e.rowNode,/* @__PURE__ */new Map);const s={editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0},...this.getEdit(e),...t};return this.getEditRow(e.rowNode).set(e.column,s),s}clearEditValue(e){const{rowNode:t,column:o}=e;if(!t)return;const s=e=>{e.editorValue=void 0,e.pendingValue=e.sourceValue,e.state="changed"};if(!o)return void this.getEditRow(t)?.forEach(s);const i=this.getEdit(e);i&&s(i)}getState(e){if(!this.suspendEdits)return this.getEdit(e)?.state}getEditPositions(e){if(this.suspendEdits||0===(e??this.edits).size)return[];const t=[];return(e??this.edits).forEach((e,o)=>{for(const s of e.keys()){const{editorState:i,...n}=e.get(s);t.push({rowNode:o,column:s,...n})}}),t}hasRowEdits(e,t){return!this.suspendEdits&&(0!==this.edits.size&&!!this.getEditRow(e,t))}hasEdits(e={},t={}){if(this.suspendEdits)return!1;if(0===this.edits.size)return!1;const{rowNode:o,column:s}=e,{withOpenEditor:i}=t;if(o){const n=this.getEditRow(o,t);return!!n&&(s?i?"editing"===this.getEdit(e)?.state:n.has(s):0!==n.size&&(!i||Array.from(n.values()).some(({state:e})=>"editing"===e)))}return i?this.getEditPositions().some(({state:e})=>"editing"===e):this.edits.size>0}start(e){const t=this.getEditRow(e.rowNode)??/* @__PURE__ */new Map,{rowNode:o,column:s}=e;s&&!t.has(s)&&t.set(s,{editorValue:void 0,pendingValue:Nh,sourceValue:this.beans.valueSvc.getValue(s,o,"data"),state:"editing",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}}),this.edits.set(o,t)}stop(e,t,o){if(this.hasEdits(e))if(t){const t=this.getEditRow(e.rowNode)?.get(e.column);!t||t.pendingValue!==Nh&&t.pendingValue!==t.sourceValue?t&&o&&(t.editorValue=void 0):this.removeEdits(e)}else this.removeEdits(e)}clear(){for(const e of this.edits.values())e.clear();this.edits.clear()}getCellValidationModel(){return this.cellValidations}getRowValidationModel(){return this.rowValidations}setCellValidationModel(e){this.cellValidations=e}setRowValidationModel(e){this.rowValidations=e}destroy(){super.destroy(),this.clear()}},class extends We{constructor(){super(...arguments),this.beanName="editSvc",this.committing=!1,this.batch=!1,this.batchStartDispatched=!1,this.stopping=!1,this.rangeSelectionWhileEditing=0}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:e})=>{this.stopEditing(void 0,mp),this.createStrategy(e)});const t=dp(e),o=()=>{const t=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return t||o?this.stopEditing(void 0,mp):this.isEditing()&&(this.batch?Kh(e,this.model.getEditPositions()):this.stopEditing(void 0,fp)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:o,filterChanged:o,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}startBatchEditing(){this.batch||(this.batch=!0,this.batchStartDispatched=!1,this.stopEditing(void 0,mp))}stopBatchEditing(e){this.batch&&(e&&this.stopEditing(void 0,e),this.batchStartDispatched&&this.dispatchBatchStopped(/* @__PURE__ */new Map,!1),this.batch=!1,this.batchStartDispatched=!1)}ensureBatchStarted(){this.batch&&!this.batchStartDispatched&&(this.batchStartDispatched=!0,this.dispatchBatchEvent("batchEditingStarted",/* @__PURE__ */new Map))}createStrategy(e){const{beans:t,gos:o,strategy:s}=this,i=bp(o,e);if(s){if(s.beanName===i)return s;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(i,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,o,s="ui"){const i=function(e,{column:t},o,s,i="ui"){if(o instanceof KeyboardEvent&&(o.key===Ps||o.key===Es||o.key===Bs||o.key===Ms&&s))return!0;if(o?.shiftKey&&0!=e.rangeSvc?.getCellRanges().length)return!1;const n=t?.getColDef(),r=function(e,t){return!0===e.get("suppressClickEdit")?0:!0===e.get("singleClickEdit")||t?.singleClickEdit?1:2}(e.gos,n),a=o?.type;return"click"===a&&1===o?.detail&&1===r||"dblclick"===a&&2===o?.detail&&2===r||"api"===i&&!!s}(this.beans,e,t,o,s);return i&&(this.strategy??(this.strategy=this.createStrategy())),i}shouldStopEditing(e,t,o="ui"){return this.strategy?.shouldStop(e,t,o)??null}shouldCancelEditing(e,t,o="ui"){return this.strategy?.shouldCancel(e,t,o)??null}validateEdit(){return function(e){Qh(e,!0);const t=e.editModelSvc?.getCellValidationModel().getCellValidationMap();if(!t)return null;const o=[];return t.forEach((e,t)=>{e.forEach(({errorMessages:e},s)=>{o.push({column:s,rowIndex:t.rowIndex,rowPinned:t.rowPinned,messages:e??null})})}),o}(this.beans)}isEditing(e,t){return this.model.hasEdits(e??void 0,t??Cp)}isRowEditing(e,t){return!!e&&this.model.hasRowEdits(e,t)}enableRangeSelectionWhileEditing(){this.beans.rangeSvc&&this.gos.get("cellSelection")&&this.rangeSelectionWhileEditing++}disableRangeSelectionWhileEditing(){this.rangeSelectionWhileEditing=Math.max(0,this.rangeSelectionWhileEditing-1)}isRangeSelectionEnabledWhileEditing(){return this.rangeSelectionWhileEditing>0}startEditing(e,t){const{startedEdit:o=!0,event:s=null,source:i="ui",ignoreEventKey:n=!1,silent:r}=t;if(this.strategy??(this.strategy=this.createStrategy()),!(t.editable??this.isCellEditable(e,"api")))return;const a=kh(this.beans,e);if(a&&!a.comp)return t.editable=void 0,void a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));const l=this.shouldStartEditing(e,s,o,i);!1!==l||"api"===i?(this.batch||!this.shouldStopEditing(e,void 0,i)||t.continueEditing||this.stopEditing(void 0,{source:i}),l&&this.ensureBatchStarted(),this.strategy.start({position:e,event:s,source:i,ignoreEventKey:n,startedEdit:o,silent:r})):this.isEditing(e)&&this.stopEditing()}stopEditing(e,t){const o=this.prepareStopContext(e,t);if(!o)return!1;this.stopping=!0;let s=!1,{edits:i}=o;try{const n=this.processStopRequest(o);return s||(s=n.res),i=n.edits,this.finishStopEditing({...o,edits:i,params:t,position:e,res:s}),s}finally{this.rangeSelectionWhileEditing=0,this.stopping=!1}}prepareStopContext(e,t){const{event:o=null,cancel:s=!1,source:i="ui",forceCancel:n=!1,forceStop:r=!1,commit:a=!1}=t||{};if(gp.has(i)&&this.batch)return this.bulkRefresh(e),null;const l=this.committing?up[i]:i;if(!(this.committing||this.isEditing(e)||this.batch&&this.model.hasEdits(e,Cp))||!this.strategy||this.stopping)return null;const d=kh(this.beans,e);d&&(d.onEditorAttachedFuncs=[]);const c=!s&&(!!this.shouldStopEditing(e,o,l)||(this.committing||"paste"===i)&&!this.batch)||r,h=s&&!!this.shouldCancelEditing(e,o,l)||n;return{cancel:s,cellCtrl:d,edits:this.model.getEditMap(!0),event:o??null,forceCancel:n,forceStop:r,commit:a,position:e,source:i,treatAsSource:l,willCancel:h,willStop:c}}processStopRequest(e){const{event:t,position:o,willCancel:s,willStop:i}=e;return i||s?this.handleStopOrCancel(e):this.shouldHandleMidBatchKey(t,o)?{res:!1,edits:this.handleMidBatchKey(t,o,e)}:(Uh(this.beans,{persist:!0}),this.batch&&this.strategy?.cleanupEditors(o),{res:!1,edits:this.model.getEditMap()})}handleStopOrCancel(e){const{beans:t,model:o}=this,{cancel:s,commit:i,edits:n,event:r,source:a,willCancel:l,willStop:d}=e;Uh(t,{persist:!this.batch||!l,isCancelling:l||s,isStopping:d});const c=o.getEditMap(),h=l||this.batch&&!i?[]:this.processEdits(c,a);s?this.strategy?.stopCancelled(e.forceCancel):this.strategy?.stopCommitted(r,i),this.clearValidationIfNoOpenEditors();for(const u of h)o.clearEditValue(u);this.bulkRefresh(void 0,n);for(const u of o.getEditPositions(c)){const e=kh(t,u),o=Bh(u);e?.refreshCell({force:!0,suppressFlash:!o})}return{res:d,edits:c}}shouldHandleMidBatchKey(e,t){return e instanceof KeyboardEvent&&this.batch&&!!this.strategy?.midBatchInputsAllowed(t)&&this.isEditing(t,{withOpenEditor:!0})}handleMidBatchKey(e,t,o){const{beans:s,model:i}=this,{cellCtrl:n,edits:r}=o,{key:a}=e,l=a===Es,d=a===Ts,c=a===Ps;if(l||c||d){if(l||c)Uh(s,{persist:!0});else if(d&&n){const{rowNode:e,column:t}=n;if(this.batch&&e&&t){const o={rowNode:e,column:t};Kh(s,[o],{silent:!0}),this.model.stop(o,!0,!0),kh(s,o)?.refreshCell(vp)}else this.revertSingleCellEdit(n)}return this.batch?this.strategy?.cleanupEditors():Kh(s,i.getEditPositions(),{event:e,cancel:d}),e.preventDefault(),this.bulkRefresh(t,r,{suppressFlash:!0}),i.getEditMap()}return r}finishStopEditing({cellCtrl:e,edits:t,params:o,position:s,res:i,commit:n,forceCancel:r,willCancel:a,willStop:l}){const d=this.beans;i&&s&&(this.batch&&!n||this.model.removeEdits(s)),this.navigateAfterEdit(o,e?.cellPosition),zh(d),this.clearValidationIfNoOpenEditors(),this.bulkRefresh();const{rowRenderer:c,formula:h}=d;if(a&&c.refreshRows({rowNodes:Array.from(t.keys())}),this.batch){h?h.refreshFormulas(!0):c.refreshRows({suppressFlash:!0,force:!0});const e=l&&n;(e||a&&r)&&this.dispatchBatchStopped(t,e)}}dispatchBatchStopped(e,t){let o;t&&(o=function(e){const t=/* @__PURE__ */new Map;for(const[o,s]of e){const e=/* @__PURE__ */new Map;for(const[t,o]of s)Bh(o)&&e.set(t,o);e.size>0&&t.set(o,e)}return t}(e),o.size>0&&this.ensureBatchStarted()),this.batchStartDispatched&&(this.batchStartDispatched=!1,this.dispatchBatchEvent("batchEditingStopped",o??/* @__PURE__ */new Map))}clearValidationIfNoOpenEditors(){this.model.hasEdits(void 0,{withOpenEditor:!0})||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap())}navigateAfterEdit(e,t){if(!e||!t)return;const{event:o,suppressNavigateAfterEdit:s}=e;if(!(o instanceof KeyboardEvent)||s)return;const{key:i,shiftKey:n}=o,r=this.gos.get("enterNavigatesVerticallyAfterEdit");if(i!==Es||!r)return;const a=n?ks:Gs;this.beans.navigation?.navigateToNextCell(null,a,t,!1)}processEdits(e,t){const o=Array.from(e.keys()),s=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,i=[];for(const n of o){const o=e.get(n);for(const e of o.keys()){const r=o.get(e),a={rowNode:n,column:e};if(Bh(r)&&!s){const o=kh(this.beans,a);this.setNodeDataValue(n,e,r.pendingValue,o,t)||i.push(a)}}}return i}setNodeDataValue(e,t,o,s,i="edit"){const n=hp.has(i)?"edit":i;s&&(s.suppressRefreshCell=!0),this.committing=!0;try{return e.setDataValue(t,o,n)}finally{this.committing=!1,s&&(s.suppressRefreshCell=!1)}}syncEditAfterCommit(e,t){const o=this.model.getEdit(e);o&&"editing"!==o.state&&(t?this.beans.editModelSvc?.setEdit(e,{sourceValue:this.valueSvc.getValue(e.column,e.rowNode,"data")}):this.model.clearEditValue(e))}setEditMap(e,t){this.strategy??(this.strategy=this.createStrategy()),this.strategy?.setEditMap(e,t),this.bulkRefresh();let o=vp;t?.forceRefreshOfEditCellsOnly&&(o={...wp(e),...vp}),this.beans.rowRenderer.refreshCells(o)}dispatchEditValuesChanged({rowNode:e,column:t},o={}){if(!e||!t||!o)return;const{pendingValue:s,sourceValue:i}=o,{rowIndex:n,rowPinned:r,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:n,rowPinned:r,column:t,source:"api",data:a,newValue:s,oldValue:i,value:s,colDef:t.getColDef()})}bulkRefresh(e={},t,o={}){const{beans:s,gos:i}=this,{editModelSvc:n,rowModel:r}=s;Lt(i)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),o):t&&n?.getEditMap(!1)?.forEach((e,t)=>{for(const s of e.keys())this.refCell({rowNode:t,column:s},e.get(s),o)}))}refCell({rowNode:e,column:t},o,s={}){const{beans:i,gos:n}=this,r=/* @__PURE__ */new Set([e]),a=/* @__PURE__ */new Set,l=e.pinnedSibling;l&&r.add(l);const d=e.sibling;d&&a.add(d);let c=e.parent;for(;c;)c.sibling?.footer&&n.get("groupTotalRow")||!c.parent&&c.sibling&&n.get("grandTotalRow")?a.add(c.sibling):a.add(c),c=c.parent;for(const h of r)this.dispatchEditValuesChanged({rowNode:h,column:t},o);for(const h of r)kh(i,{rowNode:h,column:t})?.refreshCell(s);for(const h of a)kh(i,{rowNode:h,column:t})?.refreshCell(s)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{gos:o,beans:s}=this,i=e.rowNode,n=e.column.getColDef();if(i.group&&null==n.groupRowEditable)if(o.get("treeData")){if(!i.data&&!o.get("enableGroupEdit"))return!1}else if(!o.get("enableGroupEdit"))return!1;const r="fullRow"===bp(o)?function(e,t,o="ui"){const s=tp(e,t);if(s||"ui"===o)return s;const{rowNode:i,column:n}=t;for(const r of e.colModel.getCols())if(r!==n&&tp(e,{rowNode:i,column:r}))return!0;return!1}(s,e,t):tp(s,e);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}cellEditingInvalidCommitBlocks(){return"block"===this.gos.get("invalidEditValueMode")}checkNavWithValidation(e,t,o=!0){if(this.hasValidationErrors(e)){const s=kh(this.beans,e);return this.cellEditingInvalidCommitBlocks()?(t?.preventDefault?.(),o&&(s&&!s.hasBrowserFocus()&&s.focusCell(),s?.comp?.getCellEditor()?.focusIn?.()),"block-stop"):(s&&this.revertSingleCellEdit(s),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){const o=kh(this.beans,e);o?.comp?.getCellEditor()&&(Kh(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),Hh(this.beans,e,{silent:!0}),Qh(this.beans),o?.refreshCell(vp),t&&(o?.focusCell(),o?.comp?.getCellEditor()?.focusIn?.()))}hasValidationErrors(e){Qh(this.beans);const t=kh(this.beans,e);t&&(t.refreshCell(vp),t.rowCtrl.rowEditStyleFeature?.applyRowStyles());let o=!1;return e?.rowNode?(o||(o=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(o||(o=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(o||(o=this.model.getCellValidationModel().getCellValidationMap().size>0),o||(o=this.model.getRowValidationModel().getRowValidationMap().size>0)),o}moveToNextCell(e,t,o,s="ui"){let i;const n=this.isEditing(),r=n&&"block-stop"===this.checkNavWithValidation(void 0,o);return e instanceof nu&&n&&(i=this.strategy?.moveToNextEditingCell(e,t,o,s,r)),null===i||(i=i||!!this.beans.focusSvc.focusedHeader,!1!==i||r||this.stopEditing()),i}getPendingEditValue(e,t,o){if("data"===o)return;if("batch"===o&&!this.batch)return;const s=this.model.getEdit({rowNode:e,column:t},Cp);if(!s)return;if(this.stopping&&!this.batch&&!s.editorState?.cellStartedEditing)return;if("edit"===o){const e=s.editorValue;if(null!=e&&e!==Nh)return e}const i=s.pendingValue;return i!==Nh?i:void 0}getCellDataValue(e){const t=this.model.getEdit(e,Cp);if(t){const e=t.pendingValue;if(e!==Nh)return e;const o=t.sourceValue;if(null!=o)return o}return this.valueSvc.getValue(e.column,e.rowNode,"data")}addStopEditingWhenGridLosesFocus(e){!function(e,t,o){const{gos:s,popupSvc:i}=t;if(!s.get("stopEditingWhenCellsLoseFocus"))return;const n=e=>{const n=e.relatedTarget;if(null===nn(n))return void Lh(t);let r=o.some(e=>e.contains(n))&&s.isElementInThisInstance(n);r||(r=!!i&&(i.getActivePopups().some(e=>e.contains(n))||i.isElementWithinCustomPopup(n))),r||Lh(t)};for(const r of o)e.addManagedElementListeners(r,{focusout:n})}(this,this.beans,e)}createPopupEditorWrapper(e){return new Jg(e)}batchResetToSourceValue(e){if(!this.batch)return!1;const t=this.model.getEdit(e);if(!t)return!1;const{pendingValue:o,sourceValue:s,state:i}=t;return o!==s&&("editing"!==i&&(this.dispatchEditValuesChanged(e,{...t,pendingValue:s}),this.beans.editModelSvc?.removeEdits(e),this.bulkRefresh(e),!0))}setDataValue(e,t,o){try{const s=this.batch,i=this.isEditing(s?void 0:e);if((!i||this.committing)&&!pp.has(o))return;if(!i&&!s&&"paste"===o)return;const n=this.beans;let r;if(this.strategy??(this.strategy=this.createStrategy()),r=s?"ui":this.committing?o??"api":"api",!o||cp.has(o))return this.applyDirectValue(e,t,o);const a=this.applyExistingEdit(e,t,o,r);return void 0!==a?a:($h(n,e,t,0,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0)}finally{this.committing=!1}}applyExistingEdit(e,t,o,s){const i=this.model.getEdit(e);if(i)return i.pendingValue!==t&&(i.sourceValue!==t?($h(this.beans,e,t,0,void 0,{persist:!0}),this.ensureBatchStarted(),this.stopEditing(e,{source:s,suppressNavigateAfterEdit:!0}),!0):(this.beans.editModelSvc?.removeEdits(e),this.ensureBatchStarted(),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0))}applyDirectValue(e,t,o){const s=this.beans;if(this.batch)return $h(s,e,t,0,void 0,{persist:!0}),this.cleanupEditors(),zh(s),this.ensureBatchStarted(),this.bulkRefresh(),!0;$h(s,e,t,0,void 0,{persist:!0});const i=kh(s,e),n=this.setNodeDataValue(e.rowNode,e.column,t,i,o);return this.syncEditAfterCommit(e,n),kh(s,e)?.refreshCell(vp),n}handleColDefChanged(e){!function(e,t){const o=t.comp?.getCellEditor();if(!o?.refresh)return;const{eventKey:s,cellStartedEdit:i}=t.editCompDetails.params,{column:n}=t,r=Vh(e,t,s,i),a=n.getColDef(),l=Ei(e.userCompFactory,a,r);o.refresh(Wh(l.params,s))}(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){const{model:o}=this;if(!this.batch)return;if(!o.hasRowEdits(e.rowNode,Cp))return;const{rowNode:s}=e,{compDetails:i,valueToDisplay:n}=t;if(i){const{params:e}=i;return e.data=o.getEditRowDataValue(s,Cp),{compDetails:i}}return{valueToDisplay:n}}cleanupEditors(){this.strategy?.cleanupEditors()}dispatchCellEvent(e,t,o,s){this.strategy?.dispatchCellEvent(e,t,o,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return wo(this.gos,{type:e,..."batchEditingStopped"===e?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(e=>({rowIndex:e.rowNode.rowIndex,rowPinned:e.rowNode.rowPinned,columnId:e.column.getColId(),newValue:e.pendingValue,oldValue:e.sourceValue}))}applyBulkEdit({rowNode:e,column:t},o){if(!o||0===o.length)return;const{beans:s,rangeSvc:i,valueSvc:n}=this,{formula:r}=s;Uh(s,{persist:!0});const a=this.model.getEditMap(!0);let l=a.get(e)?.get(t)?.pendingValue,d=!1;this.batch||(this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),d=!0);const c=r?.isFormula(l)??!1;o.forEach(e=>{const t=e.columns.some(e=>e?.isAllowFormula());if(i?.forEachRowInRange(e,o=>{const i=In(s,o);if(void 0===i)return;const d=a.get(i)??/* @__PURE__ */new Map;let h=l;for(const t of e.columns){if(!t)continue;const e=!!c&&t.isAllowFormula();if(this.isCellEditable({rowNode:i,column:t},"api")){const e=n.getValue(t,i,"data",!0);let o=n.parseValue(t,i??null,h,e);Number.isNaN(o)&&(o=null),d.set(t,{editorValue:void 0,pendingValue:o,sourceValue:e,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}e&&(h=r?.updateFormulaByOffset({value:h,columnDelta:1}))}d.size>0&&a.set(i,d),c&&t&&(l=r?.updateFormulaByOffset({value:l,rowDelta:1}))}),this.setEditMap(a),this.batch)return this.cleanupEditors(),zh(s),this.ensureBatchStarted(),void this.bulkRefresh();this.committing=!0;try{this.stopEditing(void 0,{source:"bulk"})}finally{this.committing=!1,d&&this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(a)})}}),this.bulkRefresh();const h=kh(s,{rowNode:e,column:t});h&&h.focusCell(!0)}createCellStyleFeature(e){return new ap(e,this.beans)}createRowStyleFeature(e){return new lp(e,this.beans)}setEditingCells(e,t){const{beans:o}=this,{colModel:s,valueSvc:i}=o,n=/* @__PURE__ */new Map;for(let{colId:r,column:a,colKey:l,rowIndex:d,rowPinned:c,newValue:h,state:u}of e){const e=r?s.getCol(r):l?s.getCol(l):a;if(!e)continue;const g=In(o,{rowIndex:d,rowPinned:c});if(!g)continue;const p=i.getValue(e,g,"data",!0);if(!t?.forceRefreshOfEditCellsOnly&&!Bh({pendingValue:h,sourceValue:p})&&"editing"!==u)continue;let m=n.get(g);m||(m=/* @__PURE__ */new Map,n.set(g,m)),void 0===h&&(h=Nh),m.set(e,{editorValue:void 0,pendingValue:h,sourceValue:p,state:u??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(n,t)}onCellFocused(e){const t=kh(this.beans,e);if(!t||!this.isEditing(t,Cp))return;const o=this.model.getEdit(t);if(!o||!Bh(o))return;const s=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");this.beans.ariaAnnounce?.announceValue(s,"pendingChange")}allowedFocusTargetOnValidation(e){return kh(this.beans,e)}}],apiFunctions:{getEditingCells:function(e){const t=e.editModelSvc?.getEditMap(),o=[];return t?.forEach((e,t)=>{const{rowIndex:s,rowPinned:i}=t;e.forEach((e,t)=>{const{editorValue:n,pendingValue:r,sourceValue:a,state:l}=e,d=Bh(e);let c=n??r;c===Nh&&(c=void 0);const h={newValue:c,oldValue:a,state:l,column:t,colId:t.getColId(),colKey:t.getColId(),rowIndex:s,rowPinned:i},u="editing"===l;(u||!u&&d)&&o.push(h)})}),o},getEditRowValues:function(e,t){return e.editModelSvc?.getEditRowDataValue(t,{checkSiblings:!0})},getCellEditorInstances:(e,t={})=>{const o=e.rowRenderer.getCellCtrls(t.rowNodes,t.columns),s=new Array(o.length);let i=0;for(let n=0,r=o.length;ne.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,o),"ensureVisible")}(e,i),function(e,t,o="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,o),"ensureVisible")}(e,s),r?.startEditing({rowNode:d,column:l},{event:o?new KeyboardEvent("keydown",{key:o}):void 0,source:"api",editable:!0})):Et(290,{rowIndex:i,rowPinned:n})},stopEditing:function(e,t=!1){const{editSvc:o}=e;if(o?.isBatchEditing()){if(t)for(const t of e.editModelSvc?.getEditPositions()??[])"editing"===t.state&&o.revertSingleCellEdit(t);else Uh(e,{persist:!0});Kh(e,void 0,{cancel:t})}else o?.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})},isEditing:function(e,t){const o=kh(e,t);return!!e.editSvc?.isEditing(o)},validateEdit:function(e){return e.editSvc?.validateEdit()||null}},dynamicBeans:{singleCell:class extends yp{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,o="ui"){const s=super.shouldStop(e,t,o);if(null!==s)return s;const i=e?.rowNode,n=e?.column,r=this.rowNode,a=this.column;return r&&a||!i||!n?r!==i||a!==n||!r&&!a&&this.model.hasEdits(void 0,{withOpenEditor:!0}):null}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:o,event:s,ignoreEventKey:i}=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:o,event:s,ignoreEventKey:i})}dispatchRowEvent(e,t,o){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stopCancelled(e){return super.stopCancelled(e),this.clearPosition()}stopCommitted(e,t){return super.stopCommitted(e,t),this.clearPosition()}clearPosition(){return this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:o}=this.beans,{rowIndex:s,column:i,rowPinned:n}=e,r=In(this.beans,{rowIndex:s,rowPinned:n}),a=Gh(i),l=t.getCol(a),d=e.previousParams;if(d){const e=Gh(d.column);if(d?.rowIndex===s&&e===a&&d?.rowPinned===n)return}"cellFocused"==e.type&&(o?.isRangeSelectionEnabledWhileEditing()||o?.isEditing({rowNode:r,column:l},{withOpenEditor:!0}))||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,o,s="ui",i=!1){const n=this.beans.focusSvc.getFocusedCell();n&&(e=kn(this.beans,n)??e);const r=e.cellPosition;let a;const l="fullRow"===this.beans.gos.get("editType");l&&this.model.suspend(!0),i||(e.eGui.focus(),this.editSvc?.stopEditing(e,{source:this.editSvc?.isBatchEditing()?"ui":"api",event:o}));try{a=this.beans.navigation?.findNextCellToFocusOn(r,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(!1===a)return null;if(null==a)return!1;const d=a.cellPosition,c=e.isCellEditable(),h=a.isCellEditable(),u=d&&r.rowIndex===d.rowIndex&&r.rowPinned===d.rowPinned;c&&!i&&this.setFocusOutOnEditor(e);const g=this.gos.get("suppressStartEditOnTab");if(u||i||(super.cleanupEditors(a,!0),g?a.focusCell(!0,o):this.editSvc.startEditing(a,{startedEdit:!0,event:o,source:s,ignoreEventKey:!0,editable:h})),h&&!i){if(a.focusCell(!1,o),g)a.focusCell(!0,o);else if(!a.comp?.getCellEditor()){const e=this.editSvc?.isEditing(a,{withOpenEditor:!0});Hh(this.beans,a,{event:o,cellStartedEdit:!0,silent:e}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else h&&i&&this.setFocusInOnEditor(a),a.focusCell(!0,o);return e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},fullRow:class extends yp{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,o="ui"){const{rowNode:s}=e||{};if(!Ih(this.beans,{rowNode:this.rowNode}))return!0;const i=super.shouldStop({rowNode:this.rowNode},t,o);return null!==i?i:!!this.rowNode&&s!==this.rowNode}midBatchInputsAllowed({rowNode:e}){return!!e&&this.model.hasEdits({rowNode:e})}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:o,startedEdit:s,event:i,ignoreEventKey:n}=e,{rowNode:r}=t;this.rowNode!==r&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],d=[];for(const c of a)c.isCellEditable(r)&&d.push(c);if(0!=d.length){this.dispatchRowEvent({rowNode:r},"rowEditingStarted",o),this.startedRows.push(r);for(const e of d){const t={rowNode:r,column:e};l.push(t),this.model.hasEdits(t)||this.model.start(t)}this.rowNode=r,this.setupEditors({cells:l,position:t,startedEdit:s,event:i,ignoreEventKey:n})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stopCancelled(e){const{rowNode:t}=this;return!(t&&!this.model.hasRowEdits(t))&&(super.stopCancelled(e),this.cleanupEditors({rowNode:t},!0),this.rowNode=void 0,!0)}stopCommitted(e,t){const{rowNode:o}=this;if(o&&!this.model.hasRowEdits(o))return!1;const s=[];if(this.model.getEditMap().forEach((e,t)=>{if(e&&0!==e.size)for(const o of e.values())if(Bh(o)){s.push(t);break}}),Qh(this.beans),"block-stop"===this.editSvc.checkNavWithValidation({rowNode:o}))return!1;if(super.stopCommitted(e,t),t||!this.editSvc.isBatchEditing())for(const i of s)this.dispatchRowEvent({rowNode:i},"rowValueChanged");return this.cleanupEditors({rowNode:o},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,o=e.previousParams;if(o?.rowIndex===t||e.sourceEvent instanceof KeyboardEvent)return;if(this.beans.editSvc?.isRangeSelectionEnabledWhileEditing())return;const s=kh(this.beans,o);"block"===this.gos.get("invalidEditValueMode")&&s&&(this.model.getCellValidationModel().getCellValidation(s)||this.model.getRowValidationModel().getRowValidation(s))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const o of this.startedRows)this.dispatchRowEvent({rowNode:o},"rowEditingStopped"),this.destroyEditorsForRow(o);this.startedRows.length=0}destroyEditorsForRow(e){const t=Ih(this.beans,{rowNode:e});if(!t)return;const o={};for(const s of t.getAllCellCtrls())s.comp?.getCellEditor()&&_h(this.beans,s,o,s)}moveToNextEditingCell(e,t,o,s="ui",i=!1){const n=e.cellPosition;let r;this.model.suspend(!0);try{r=this.beans.navigation?.findNextCellToFocusOn(n,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(!1===r)return null;if(null==r)return!1;const a=r.cellPosition,l=e.isCellEditable(),d=r.isCellEditable(),c=a&&n.rowIndex===a.rowIndex&&n.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const h=this.gos.get("suppressStartEditOnTab");return d&&!i?h?r.focusCell(!0,o):(r.comp?.getCellEditor()||Hh(this.beans,r,{event:o,cellStartedEdit:!0}),this.setFocusInOnEditor(r),r.focusCell(!1,o)):(d&&i&&this.setFocusInOnEditor(r),r.focusCell(!0,o)),c||i||(this.editSvc?.stopEditing({rowNode:e.rowNode},{event:o,forceStop:!0}),this.editSvc?.isRowEditing(e.rowNode,{withOpenEditor:!0})&&this.cleanupEditors(r,!0),h?r.focusCell(!0,o):this.editSvc.startEditing(r,{startedEdit:!0,event:o,source:s,ignoreEventKey:!0,editable:d||void 0})),e.rowCtrl?.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:e},o)=>{if("editing"!==e)return;const s=kh(this.beans,{rowNode:t,column:o});s&&!s.comp?.getCellEditor()&&Hh(this.beans,s,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}}},dependsOn:[Vg,Kg],css:[".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) .ag-text-area-input{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}"]}]},Rp={agSetColumnFilter:"agSetColumnFilterHandler",agMultiColumnFilter:"agMultiColumnFilterHandler",agGroupColumnFilter:"agGroupColumnFilterHandler",agNumberColumnFilter:"agNumberColumnFilterHandler",agBigIntColumnFilter:"agBigIntColumnFilterHandler",agDateColumnFilter:"agDateColumnFilterHandler",agTextColumnFilter:"agTextColumnFilterHandler"},xp=new Set(Object.values(Rp));function Fp(e,t){const o=e.filterUi;if(!o)return null;if(o.created)return o.promise;if(t)return null;const s=o.create(o.refreshed),i=o;return i.created=!0,i.promise=s,s}function Dp(e,t,o,s,i,n,r){return t.refresh?.({...o,model:s,source:n,additionalEventAttributes:r}),e().then(e=>{if(e){const{filter:t,filterParams:o}=e;Mp(t,o,s,i,n,r)}})}function Mp(e,t,o,s,i,n){e?.refresh?.({...t,model:o,state:s,source:i,additionalEventAttributes:n})}function Pp(e,t,o,s){const i=e();i?.created&&i.promise.then(e=>{const n=t();Mp(e,i.filterParams,n,o()??{model:n},"ui",s)})}function Ep(e){let t,o,s=!1;const{action:i,filterParams:n,getFilterUi:r,getModel:a,getState:l,updateState:d,updateModel:c,processModelToApply:h}=e;switch(i){case"apply":{const e=l();o=e?.model??null,h&&(o=h(o)),t={state:e?.state,model:o},s=!0;break}case"clear":t={model:null},n?.buttons?.includes("apply")||(s=!0,o=null);break;case"reset":t={model:null},s=!0,o=null;break;case"cancel":t={model:a()}}d(t),s?c(o):Pp(r,a,l,{fromAction:i})}function Tp(e,t){return e[t]??null}function Ap(e,t,o){e.menuVisible!==t&&(e.menuVisible=t,e.dispatchColEvent("menuVisibleChanged",o))}function Ip(e){const{enterpriseMenuFactory:t,filterMenuFactory:o,gos:s}=e;return t&&Co(s)?t:o}var kp={moduleName:"SharedMenu",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="menuSvc"}postConstruct(){const{enterpriseMenuFactory:e,filterMenuFactory:t}=this.beans;this.activeMenuFactory=e??t}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){this.showColumnMenuCommon(Ip(this.beans),e,e.containerType,!0)}showHeaderContextMenu(e,t,o){this.activeMenuFactory?.showMenuAfterContextMenuEvent(e,t,o)}hidePopupMenu(){this.beans.contextMenuSvc?.hideActiveMenu(),this.activeMenuFactory?.hideActiveMenu()}hideFilterMenu(){Ip(this.beans)?.hideActiveMenu()}isColumnMenuInHeaderEnabled(e){const{suppressHeaderMenuButton:t}=e.getColDef();return!t&&!!this.activeMenuFactory?.isMenuEnabled(e)&&(Co(this.gos)||!!this.beans.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.beans.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(e&&xo(e)?e.getColDef():e?.getColGroupDef())?.suppressHeaderContextMenu&&"new"===this.gos.get("columnMenu")}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(sn()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!Co(this.gos)&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!(!this.beans.filterManager?.isFilterAllowed(e)||Co(this.gos)||this.isFilterMenuInHeaderEnabled(e)||this.isFloatingFilterButtonDisplayed(e))}isFloatingFilterButtonEnabled(e){return!e.getColDef().suppressFloatingFilterButton}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos,t=e.get("suppressMenuHide");return Co(e)?!!e.exists("suppressMenuHide")&&t:t}showColumnMenuCommon(e,t,o,s){const{positionBy:i,onClosedCallback:n}=t,r=t.column;if("button"===i){const{buttonElement:i}=t;e?.showMenuAfterButtonClick(r,i,o,n,s)}else if("mouse"===i){const{mouseEvent:i}=t;e?.showMenuAfterMouseEvent(r,i,o,n,s)}else if(r){const t=this.beans,i=t.ctrlsSvc;i.getScrollFeature().ensureColumnVisible(r,"auto"),ye(t,()=>{const t=i.getHeaderRowContainerCtrl(r.getPinned())?.getHeaderCtrlForColumn(r);t&&e?.showMenuAfterButtonClick(r,t.getAnchorElementForMenu(s),o,n,s)})}}}],apiFunctions:{showColumnMenu:function(e,t){const o=e.colModel.getCol(t);o?e.menuSvc?.showColumnMenu({column:o,positionBy:"auto"}):Tt(12,{colKey:t})},hidePopupMenu:function(e){e.menuSvc?.hidePopupMenu()}}};var Lp={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Gp=["january","february","march","april","may","june","july","august","september","october","november","december"];function Np(e,t){return null==e?-1:null==t?1:Number.parseFloat(e)-Number.parseFloat(t)}function Bp(e,t){if(null==e)return-1;if(null==t)return 1;const o=od(e),s=od(t);return null!=o&&null!=s?o===s?0:o>s?1:-1:String(e).localeCompare(String(t))}function Hp(e){return e instanceof Date&&!isNaN(e.getTime())}var Op={number:()=>{},bigint:()=>{},boolean:()=>({maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]}),date:()=>({isValidDate:Hp}),dateString:({dataTypeDefinition:e})=>({comparator:(t,o)=>{const s=e.dateParser(o);return null==o||st?1:0},isValidDate:t=>"string"==typeof t&&Hp(e.dateParser(t))}),dateTime:e=>Op.date(e),dateTimeString:e=>Op.dateString(e),object:()=>{},text:()=>{}},Vp={number:()=>({comparator:Np}),bigint:()=>({comparator:Bp}),boolean:({t:e})=>({valueFormatter:t=>a(t.value)?e(String(t.value),t.value?"True":"False"):e("blanks","(Blanks)")}),date:({formatValue:e,t:t})=>({valueFormatter:o=>{const s=e(o);return a(s)?s:t("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,o)=>{if("NaN"===e)return t("invalidDate","Invalid Date");if(1===o&&null!=e){const o=Gp[Number(e)-1];return t(o,Lp[o])}return e??t("blanks","(Blanks)")},treeListPathGetter:e=>ad(e,!1)}),dateString:({formatValue:e,dataTypeDefinition:t,t:o})=>({valueFormatter:t=>{const s=e(t);return a(s)?s:o("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>ad(t.dateParser(e??void 0),!1),treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Gp[Number(e)-1];return o(t,Lp[t])}return e??o("blanks","(Blanks)")}}),dateTime:e=>{const t=Vp.date(e);return t.treeListPathGetter=ad,t},dateTimeString(e){const t=e.dataTypeDefinition.dateParser,o=Vp.dateString(e);return o.treeListPathGetter=e=>ad(t(e??void 0)),o},object:({formatValue:e,t:t})=>({valueFormatter:o=>{const s=e(o);return a(s)?s:t("blanks","(Blanks)")}}),text:()=>{}};function zp(e,t,o,s,i,n,r){let a=t,l=o;const d="agSetColumnFilter"===e;l||"object"!==s.baseDataType||d||(l=({column:e,node:t})=>i({column:e,node:t,value:n.valueSvc.getValue(e,t,"data")}));const c=(0,(d?Vp:Op)[s.baseDataType])({dataTypeDefinition:s,formatValue:i,t:r});return a="object"==typeof t?{...c,...t}:c,{filterParams:a,filterValueGetter:l}}var Wp={boolean:"agTextColumnFilter",date:"agDateColumnFilter",dateString:"agDateColumnFilter",dateTime:"agDateColumnFilter",dateTimeString:"agDateColumnFilter",bigint:"agBigIntColumnFilter",number:"agNumberColumnFilter",object:"agTextColumnFilter",text:"agTextColumnFilter"},Up={boolean:"agTextColumnFloatingFilter",date:"agDateColumnFloatingFilter",dateString:"agDateColumnFloatingFilter",dateTime:"agDateColumnFloatingFilter",dateTimeString:"agDateColumnFloatingFilter",bigint:"agBigIntColumnFloatingFilter",number:"agNumberColumnFloatingFilter",object:"agTextColumnFloatingFilter",text:"agTextColumnFloatingFilter"};function $p(e,t=!1){return(t?Up:Wp)[e??"text"]}function jp(e,t,o){if(null==t)return null;let s=null;const{compName:i,jsComp:n,fwComp:r}=Ii(e,t);return i?s={agSetColumnFilter:"agSetColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",agBigIntColumnFilter:"agBigIntColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[i]:null==n&&null==r&&!0===t.filter&&(s=o()),s}var Kp={filterHandler:()=>({doesFilterPass:()=>!0})};function _p(e,t,o,s){if(!e.isPrimary())return!0;const i=!o;return!(!e.isValueActive()||!i)&&(!!t||s)}var qp={moduleName:"FilterCore",version:vt,beans:[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:e})=>this.onAdvFilterEnabledChanged(e),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:o}=this;this.alwaysPassFilter=o.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=o.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterState(e,t,o="api"){this.isAdvFilterEnabled()||this.colFilter?.setState(e,t,o)}setFilterModel(e,t="api",o){this.isAdvFilterEnabled()?o||this.warnAdvFilters():this.colFilter?.setModel(e,t)}getFilterModel(){return this.colFilter?.getModel()??{}}getFilterState(){return this.colFilter?.getState()}isColumnFilterPresent(){return!!this.colFilter?.isFilterPresent()}isAggregateFilterPresent(){return!!this.colFilter?.isAggFilterPresent()}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){e?this.colFilter?.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilter?.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){return!!this.advancedFilter?.isEnabled()}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){_t(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:o,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):Zs.resolve()).then(()=>{const e={source:t,type:"filterChanged",columns:s};o&&Xe(e,o),this.eventSvc.dispatchEvent(e),this.colFilter?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.colFilter?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilter?.isFilterPresent()}updateAggFiltering(){this.aggFiltering=!!_t(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){const{rowNode:t}=e;return!!this.alwaysPassFilter?.(t)||!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t))&&!(this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){const{rowNode:t}=e;return!!this.alwaysPassFilter?.(t)||!(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){return!this.isAdvFilterEnabled()&&!!this.colFilter?.isFilterAllowed(e)}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){this.isAdvFilterEnabled()&&(this.beans.dataTypeSvc?.isPendingInference?this.advFilterModelUpdateQueue.push(e):(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(){return!this.isAdvFilterEnabled()&&!!this.colFilter?.hasFloatingFilters()}getColumnFilterInstance(e){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):this.colFilter?.getFilterInstance(e)??Promise.resolve(void 0)}warnAdvFilters(){Et(68)}setupAdvFilterHeaderComp(e){this.advancedFilter?.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):this.colFilter?.setModelForColumn(e,t)??Promise.resolve()}}],apiFunctions:{isAnyFilterPresent:function(e){return!!e.filterManager?.isAnyFilterPresent()},onFilterChanged:function(e,t="api"){e.filterManager?.onFilterChanged({source:t})}},css:[".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;:where(.ag-set-filter-group-closed-icon),:where(.ag-set-filter-group-indeterminate-icon),:where(.ag-set-filter-group-opened-icon){cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper{min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>:where(.ag-date-floating-filter-wrapper),>:where(.ag-floating-filter-input),>:where(.ag-input-field){flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(.ag-input-field-input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:var(--ag-widget-container-vertical-padding);:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}"],dependsOn:[{moduleName:"ClientSideRowModelFilter",version:vt,rowModels:["clientSide"],beans:[class extends We{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const t=!!this.filterManager?.isChildFilterPresent();this.beans.formula?.active?this.softFilter(t,e):this.filterNodes(t,e)}filterNodes(e,t){const o=(t,o)=>{t.hasChildren()?t.childrenAfterFilter=e&&!o?t.childrenAfterGroup.filter(e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,o=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||o}):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,mg(t)};if(this.doingTreeDataFiltering()){const e=(t,s)=>{if(t.childrenAfterGroup)for(let i=0;ie(t,!1);t.executeFromRootNode(s)}else{const e=e=>o(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}softFilter(e,t){t.forEachChangedNodeDepthFirst(t=>{if(t.childrenAfterFilter=t.childrenAfterGroup,t.hasChildren())for(const o of t.childrenAfterGroup)o.softFiltered=e&&!(o.data&&this.filterManager.doesRowPassFilter({rowNode:o}));mg(t)},!0)}doingTreeDataFiltering(){const{gos:e}=this;return e.get("treeData")&&!e.get("excludeChildrenWhenTreeDataFiltering")}}]}]},Yp={moduleName:"FilterValue",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,o){if(!t)return;const s=e.getColDef(),{selectableFilter:i,valueSvc:n,formula:r}=this.beans,a=o??i?.getFilterValueGetter(e.getColId())??s.filterValueGetter;if(a)return this.executeFilterValueGetter(a,t.data,e,t,s);const l=n.getValue(e,t,"data");return e.isAllowFormula()&&r?.isFormula(l)?r.resolveValue(e,t):l}executeFilterValueGetter(e,t,o,s,i){const{expressionSvc:n,valueSvc:r}=this.beans,a=wo(this.gos,{data:t,node:s,column:o,colDef:i,getValue:r.getValueCallback.bind(r,s)});return"function"==typeof e?e(a):n?.evaluate(e,a)}}]},Zp={moduleName:"ColumnFilter",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=/* @__PURE__ */new Map,this.allColumnListeners=/* @__PURE__ */new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=/* @__PURE__ */new Map,this.handlerMap={...Rp},this.isGlobalButtons=!1,this.activeFilterComps=/* @__PURE__ */new Set}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.addManagedPropertyListener("pivotMode",this.onPivotModeChanged.bind(this));const e=this.gos,t={...e.get("initialState")?.filter?.filterModel??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",o){const{colModel:s,dataTypeSvc:i,filterManager:n}=this.beans;if(i?.isPendingInference)return void this.modelUpdates.push({model:e,source:t});const r=[],a=this.getModel(!0);if(e){const t=new Set(Object.keys(e));this.allColumnFilters.forEach((o,s)=>{const i=e[s];r.push(this.setModelOnFilterWrapper(o,i)),t.delete(s)}),t.forEach(t=>{const o=s.getColDefCol(t)||s.getCol(t);if(!o)return void Et(62,{colId:t});if(!o.isFilterAllowed())return void Et(63,{colId:t});const i=this.getOrCreateFilterWrapper(o,!0);i?r.push(this.setModelOnFilterWrapper(i,e[t],!0)):Et(64,{colId:t})})}else this.model={},this.allColumnFilters.forEach(e=>{r.push(this.setModelOnFilterWrapper(e,null))});Zs.all(r).then(()=>{const e=this.getModel(!0),s=[];this.allColumnFilters.forEach((t,o)=>{c(a?a[o]:null,e?e[o]:null)||s.push(t.column)}),s.length>0?n?.onFilterChanged({columns:s,source:t}):o&&this.updateActive("filterChanged")})}getModel(e){const t={},{allColumnFilters:o,initialModel:s,beans:{colModel:i}}=this;if(o.forEach((e,o)=>{const s=this.getModelFromFilterWrapper(e);a(s)&&(t[o]=s)}),!e)for(const n of Object.keys(s)){const e=s[n];a(e)&&!o.has(n)&&i.getCol(n)?.isFilterAllowed()&&(t[n]=e)}return t}setState(e,t,o="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const e=t[s];this.state.set(s,{model:Tp(this.model,s),state:e})}this.setModel(e,o,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let o=!1;return e.forEach((e,s)=>{const i=e.state;null!=i&&(o=!0,t[s]=i)}),o?t:void 0}getModelFromFilterWrapper(e){const t=e.column.getColId();if(e.isHandler)return Tp(this.model,t);const o=e.filter;return o?"function"!=typeof o.getModel?(Et(66),null):o.getModel():Tp(this.initialModel,t)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return!!e.size&&(e.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),!0)}updateActiveFilters(){const{colModel:e,gos:t}=this.beans,o=!!_t(t),s=[],i=[],n=(t,n,r)=>{n&&(_p(t,e.isPivotMode(),e.isPivotActive(),o)?s.push(r):i.push(r))},r=[];return this.allColumnFilters.forEach(e=>{const t=e.column,o=t.getColId();if(e.isHandler)r.push(Zs.resolve().then(()=>{n(t,this.isHandlerActive(t),{colId:o,isHandler:!0,handler:e.handler,handlerParams:e.handlerParams})}));else{const s=Fp(e);s&&r.push(s.then(e=>{n(t,(e=>!!e&&(e.isFilterActive?e.isFilterActive():(Et(67),!1)))(e),{colId:o,isHandler:!1,comp:e})}))}}),Zs.all(r).then(()=>{this.activeAggregateFilters=s,this.activeColumnFilters=i})}updateFilterFlagInColumns(e,t){const o=[];return this.allColumnFilters.forEach(s=>{const i=s.column;if(s.isHandler)o.push(Zs.resolve().then(()=>{this.setColFilterActive(i,this.isHandlerActive(i),e,t)}));else{const n=Fp(s);n&&o.push(n.then(o=>{this.setColFilterActive(i,o.isFilterActive(),e,t)}))}}),this.beans.groupFilter?.updateFilterFlags(e,t),Zs.all(o)}doFiltersPass(e,t,o){const{data:s,aggData:i}=e,n=o?this.activeAggregateFilters:this.activeColumnFilters,r=o?i:s,a=this.model;for(let l=0;l{this.isAlive()&&o?.onFilterChanged(e)};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:o}=e,s=t?.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",o).then(()=>{this.allColumnFilters.forEach(e=>{const{column:t,isHandler:o}=e;s!==t.getColId()&&(o&&e.handler.onAnyFilterChanged?.(),Fp(e,o)?.then(e=>{"function"==typeof e?.onAnyFilterChanged&&e.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!this.gos.get("allowShowChangeAfterFilter")&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(e=>{const o=e.isHandler;o&&e.handler.onNewRowsLoaded?.();const s=Fp(e,o);s&&t.push(s.then(e=>{e.onNewRowsLoaded?.()}))}),Zs.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:o,colModel:s}=this.beans;return(i,n)=>{const r=n?s.getCol(n):e;return r?o.getValue(r,i,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t?.isHandler)return this.isHandlerActive(e);const o=t?.filter;return o?o.isFilterActive():null!=Tp(this.initialModel,e.getColId())}isHandlerActive(e){const t=a(Tp(this.model,e.getColId()));if(t)return t;const o=this.beans.groupFilter;return!!o?.isGroupFilter(e)&&o.isFilterActive(e)}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?Fp(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const o=Fp(t);return o?o.then(e=>({comp:e,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const o=this.getOrCreateFilterWrapper(e,t);return o?.isHandler?o.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let o=this.cachedFilter(e);return!o&&t&&(o=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,o)),o}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>this.beans.dataTypeSvc?.getBaseDataType(e),t)}getDefaultFilterFromDataType(e,t=!1){return(o=this.gos).isModuleRegistered("SetFilter")&&!o.get("suppressSetFilterByDefault")?t?"agSetColumnFloatingFilter":"agSetColumnFilter":$p(e(),t);var o}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,o,s,i,n){const r=()=>{const r=s(this.createFilterCompParams(e,i,n),i);return Ti(this.beans.userCompFactory,t,r,o)},a=r();if(!a)return null;return{compDetails:a,createFilterUi:e=>(e?r():a).newAgStackInstance()}}createFilterInstance(e,t,o,s){const i=this.beans.selectableFilter;i?.isSelectable(t)&&(t=i.getFilterDef(e,t));const{handler:n,handlerParams:r,handlerGenerator:a}=this.createHandler(e,t,o)??{},l=this.createFilterComp(e,t,o,s,!!n,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:n,handlerGenerator:a,handlerParams:r};const{compDetails:d,createFilterUi:c}=l;return this.isGlobalButtons&&(d.params?.buttons?.length||Et(281,{colId:e.getColId()})),{compDetails:d,handler:n,handlerGenerator:a,handlerParams:r,createFilterUi:c}}createBaseFilterParams(e,t){const{filterManager:o,rowModel:s}=this.beans;return wo(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:t=>o?.doesRowPassOtherFilters(e.getColId(),t)??!0,rowModel:s})}createFilterCompParams(e,t,o,s){const i=this.filterChangedCallbackFactory(e),n=this.createBaseFilterParams(e,s);if(n.filterChangedCallback=i,n.filterModifiedCallback=s?()=>{}:t=>this.filterModified(e,t),t){const t=n,s=e.getColId(),r=Tp(this.model,s);t.model=r,t.state=this.state.get(s)??{model:r},t.onModelChange=(t,o)=>{this.updateStoredModel(s,t),this.refreshHandlerAndUi(e,t,"ui",!1,o).then(()=>{i({...o,source:"columnFilter"})})},t.onStateChange=t=>{this.updateState(e,t),this.updateOrRefreshFilterUi(e)},t.onAction=(t,o,s)=>{this.updateModel(e,t,o),this.dispatchLocalEvent({type:"filterAction",column:e,action:t,event:s})},t.getHandler=()=>this.getHandler(e,!0),t.onUiChange=t=>this.filterUiChanged(e,t),t.source=o}return n}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,o){const s=t(),i={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(o),i}createFilterWrapper(e){const{compDetails:t,handler:o,handlerGenerator:s,handlerParams:i,createFilterUi:n}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),e=>e),r=e.getColId();if(o)return delete this.initialModel[r],o.init?.({...i,source:"init",model:Tp(this.model,r)}),{column:e,isHandler:!0,handler:o,handlerGenerator:s,handlerParams:i,filterUi:this.createFilterUiForHandler(t,n)};if(n){const o={column:e,filterUi:null,isHandler:!1};return o.filterUi=this.createFilterUiLegacy(t,n,e=>{o.filter=e??void 0}),o}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,o){const{gos:s,frameworkOverrides:i,registry:n}=this.beans;let r;const a=s.get("enableFilterHandlers"),l=a?(e=>{const t=e.filter;if(li(t)){const e=t.handler;return e||(r=t.doesFilterPass,r?()=>({doesFilterPass:r}):void 0)}return"string"==typeof t?t:void 0})(t):void 0,d=e=>()=>this.createBean(n.createDynamicBean(e,!0));let c,h;if("string"==typeof l){const e=s.get("filterHandlers")?.[l];null!=e?c=e:xp.has(l)&&(c=d(l),h=l)}else c=l;if(!c){let e;const{compName:s,jsComp:n,fwComp:r}=Ii(i,t);s?e=s:null==n&&null==r&&!0===t.filter&&(e=o),h=this.handlerMap[e],h&&(c=d(h))}if(!c){if(!a)return;return Lt(s)&&Et(277,{colId:e.getColId()}),Kp}return{filterHandler:c,handlerNameOrCallback:r??h}}createHandler(e,t,o){const s=this.createHandlerFunc(e,t,o);if(!s)return;const i=ki(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:n,filterHandler:r}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,r,i);return{handler:a,handlerParams:l,handlerGenerator:n??r}}createHandlerFromFunc(e,t,o){const s=e.getColDef();return{handler:t(wo(this.gos,{column:e,colDef:s})),handlerParams:this.createHandlerParams(e,o)}}createHandlerParams(e,t){const o=e.getColDef(),s=e.getColId(),i=this.filterChangedCallbackFactory(e);return wo(this.gos,{colDef:o,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:e=>this.beans.filterManager?.doesRowPassOtherFilters(s,e)??!0,onModelChange:(t,o)=>{this.updateStoredModel(s,t),this.refreshHandlerAndUi(e,t,"handler",!1,o).then(()=>{i({...o,source:"columnFilter"})})},onModelAsStringChange:()=>{e.dispatchColEvent("filterChanged","filterChanged"),this.dispatchLocalEvent({type:"filterModelAsStringChanged",column:e})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:o,groupFilter:s}=this.beans;this.allColumnFilters.forEach((o,s)=>{let i;i=o.column.isPrimary()?t.getColDefCol(s):t.getCol(s),i&&i===o.column||(e.push(o.column),this.disposeFilterWrapper(o,"columnChanged"),this.disposeColumnListener(s))});const i=s&&e.every(e=>s.isGroupFilter(e));e.length>0&&!i&&o?.onFilterChanged({columns:e,source:"api"})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const t=this.beans.groupFilter;return!t?.isGroupFilter(e)||t.isFilterAllowed(e)}getFloatingFilterCompDetails(e,t){const{userCompFactory:o,frameworkOverrides:s,selectableFilter:i,gos:n}=this.beans,r=e.getColDef(),a=i?.isSelectable(r)?i.getFilterDef(e,r):r,l=jp(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",d=n.get("enableFilterHandlers"),c=wo(n,{column:e,filterParams:ki(o,a,this.createFilterCompParams(e,d,"init",!0)),currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:t=>{this.getOrCreateFilterUi(e)?.then(e=>{t(Eh(e))})},showParentFilter:t});if(d){const t=c,o=e.getColId(),s=this.filterChangedCallbackFactory(e);t.onUiChange=t=>this.floatingFilterUiChanged(e,t),t.model=Tp(this.model,o),t.onModelChange=(t,i)=>{this.updateStoredModel(o,t),this.refreshHandlerAndUi(e,t,"floating",!0,i).then(()=>{s({...i,source:"columnFilter"})})},t.getHandler=()=>this.getHandler(e,!0),t.source="init"}return Ai(o,r,c,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,o,s){const i="paramsUpdated";if(e.isHandler){const n=t.getColId();delete this.initialModel[n],this.state.delete(n);const r=e.filterUi;e.filterUi=this.createFilterUiForHandler(o,s);const a=this.eventSvc;r?.created?r.promise.then(e=>{this.destroyBean(e),a.dispatchEvent({type:"filterDestroyed",source:i,column:t})}):a.dispatchEvent({type:"filterHandlerDestroyed",source:i,column:t})}else this.destroyFilter(t,i)}destroyFilter(e,t="api"){const o=e.getColId(),s=this.allColumnFilters.get(o);this.disposeColumnListener(o),delete this.initialModel[o],s&&this.disposeFilterWrapper(s,t).then(t=>{t&&this.isAlive()&&this.beans.filterManager?.onFilterChanged({columns:[e],source:"api"})})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let o=!1;const{column:s,isHandler:i,filterUi:n}=e,r=s.getColId();i&&(o=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(n){if(n.created)return n.promise.then(e=>(o=i?o:!!e?.isFilterActive(),this.destroyBean(e),a(),o));a()}return Zs.resolve(o)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:t?.source??"columnFilter"})}}filterParamsChanged(e,t="api"){const o=this.allColumnFilters.get(e);if(!o)return;const s=this.beans,i=o.column,n=i.getColDef(),r=i.isFilterAllowed(),a=this.getDefaultFilter(i),l=s.selectableFilter,d=l?.isSelectable(n)?l.getFilterDef(i,n):n,c=r?this.createHandlerFunc(i,d,this.getDefaultFilter(i)):void 0,h=!!c,u=o.isHandler;if(u!=h)return void this.destroyFilter(i,"paramsUpdated");const{compDetails:g,createFilterUi:p}=(r?this.createFilterComp(i,d,a,e=>e,h,"colDef"):null)??{compDetails:null,createFilterUi:null},m=g?.params??ki(s.userCompFactory,d,this.createFilterCompParams(i,h,"colDef"));if(u){const s=c?.handlerNameOrCallback??c?.filterHandler,n=Tp(this.model,e);if(o.handlerGenerator!=s){const r=o.handler,{handler:a,handlerParams:l}=this.createHandlerFromFunc(i,c.filterHandler,m);o.handler=a,o.handlerParams=l,o.handlerGenerator=s,delete this.model[e],a.init?.({...l,source:"init",model:null}),this.destroyBean(r),null!=n&&this.beans.filterManager?.onFilterChanged({columns:[i],source:t})}else{const e=this.createHandlerParams(i,g?.params);o.handlerParams=e,o.handler.refresh?.({...e,source:"colDef",model:n})}}!this.areFilterCompsDifferent(o.filterUi?.compDetails??null,g)&&o.filterUi&&g?(o.filterUi.filterParams=m,Fp(o,u)?.then(e=>{!1===(!e?.refresh||e.refresh(m))?this.destroyFilterUi(o,i,g,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:i,params:m})})):this.destroyFilterUi(o,i,g,p)}refreshHandlerAndUi(e,t,o,s,i){const n=this.cachedFilter(e);if(!n)return s&&this.getOrCreateFilterWrapper(e,!0),Zs.resolve();if(!n.isHandler)return Zs.resolve();const{filterUi:r,handler:a,handlerParams:l}=n;return Dp(()=>{if(r){const{created:e,filterParams:t}=r;if(e)return r.promise.then(e=>e?{filter:e,filterParams:t}:void 0);r.refreshed=!0}return Zs.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},o,i)}setColumnFilterWrapper(e,t){const o=e.getColId();this.allColumnFilters.set(o,t),this.allColumnListeners.set(o,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(o)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:o}=e,{componentClass:s}=t;return!(o===s||o?.render&&s?.render&&o.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(e=>e.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const o=this.getOrCreateFilterUi(t);return o?new Promise(e=>{o.then(t=>{e(Eh(t))})}):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:o})=>{this.setModelForColumn(e,t).then(()=>o())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:t,model:o}=this,s=e.getColId(),i=t.get(s);return i?i.model??null:Tp(o,s)}const o=this.cachedFilter(e);return o?this.getModelFromFilterWrapper(o):null}setModelForColumn(e,t){if(this.beans.dataTypeSvc?.isPendingInference){let o=()=>{};const s=new Promise(e=>{o=e});return this.columnModelUpdates.push({key:e,model:t,resolve:o}),s}return new Promise(o=>{this.setModelForColumnLegacy(e,t).then(e=>o(e))})}getStateForColumn(e){return this.state.get(e)??{model:Tp(this.model,e)}}setModelForColumnLegacy(e,t){const o=this.beans.colModel.getColDefCol(e),s=o?this.getOrCreateFilterWrapper(o,!0):null;return s?this.setModelOnFilterWrapper(s,t):Zs.resolve()}setColDefPropsForDataType(e,t,o){const s=e.filter,i=!0===s?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if("string"!=typeof i)return;let n,r;const a=this.beans,{filterParams:l,filterValueGetter:d}=e;({filterParams:n,filterValueGetter:r}="agMultiColumnFilter"===i?a.multiFilter?.getParamsForDataType(l,d,t,o)??{}:zp(i,l,d,t,o,a,this.getLocaleTextFunc())),e.filterParams=n,r&&(e.filterValueGetter=r)}setColFilterActive(e,t,o,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",o)),e.dispatchColEvent("filterChanged",o,s)}setModelOnFilterWrapper(e,t,o){return new Zs(s=>{if(e.isHandler){const i=e.column,n=i.getColId(),r=this.model[n];return this.updateStoredModel(n,t),o&&t===r?void s():void this.refreshHandlerAndUi(i,t,"api").then(()=>s())}const i=Fp(e);i?i.then(e=>{if("function"!=typeof e?.setModel)return Et(65),void s();(e.setModel(t)||Zs.resolve()).then(()=>s())}):s()})}updateStoredModel(e,t){a(t)?this.model[e]=t:delete this.model[e];const o={model:t,state:this.state.get(e)?.state};this.state.set(e,o)}filterModified(e,t){this.getOrCreateFilterUi(e)?.then(o=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:o,...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,o){const s=e.getColId(),i=this.cachedFilter(e),n=()=>i?.filterUi;Ep({action:t,filterParams:i?.filterUi?.filterParams,getFilterUi:n,getModel:()=>Tp(this.model,s),getState:()=>this.state.get(s),updateState:t=>this.updateState(e,t),updateModel:e=>n()?.filterParams?.onModelChange(e,{...o,fromAction:t}),processModelToApply:i?.isHandler?i.handler.processModelToApply?.bind(i.handler):void 0})}updateAllModels(e,t){const o=[];this.allColumnFilters.forEach((t,s)=>{const i=this.beans.colModel.getColDefCol(s);i&&Ep({action:e,filterParams:t.filterUi?.filterParams,getFilterUi:()=>t.filterUi,getModel:()=>Tp(this.model,s),getState:()=>this.state.get(s),updateState:e=>this.updateState(i,e),updateModel:t=>{this.updateStoredModel(s,t),this.dispatchLocalEvent({type:"filterAction",column:i,action:e}),o.push(this.refreshHandlerAndUi(i,t,"ui"))},processModelToApply:t?.isHandler?t.handler.processModelToApply?.bind(t.handler):void 0})}),o.length&&Zs.all(o).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();Pp(()=>this.cachedFilter(e)?.filterUi,()=>Tp(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:o}=this;for(const i of o)if("COLUMN_MENU"===i.source)return!1;let s=!1;for(const i of e.keys()){const o=e.get(i);if(!1===o.valid)return!1;(o.model??null)!==Tp(t,i)&&(s=!0)}return s}hasUnappliedModel(e){const{model:t,state:o}=this;return(o.get(e)?.model??null)!==Tp(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if("newFiltersToolPanel"===t)return!0;const o=this.beans.filterPanelSvc;return!!o?.isActive&&!!o.getState(e.getColId())}onPivotModeChanged(e){const{colModel:t,pivotColsSvc:o}=this.beans,s=!!_t(this.gos),n=e.currentValue,r=n?this.activeColumnFilters:this.activeAggregateFilters,a=n?this.activeAggregateFilters:this.activeColumnFilters,l=[];for(const i of r){const e=t.getColById(i.colId),r=n&&!!o?.columns.length;e&&n===_p(e,n,r,s)&&(a.push(i),l.push(i))}i(r,l)}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}},class extends We{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){this.hidePopup?.()}showMenuAfterMouseEvent(e,t,o,s){e&&!e.isColumn||this.showPopup(e,s=>{this.popupSvc?.positionPopupUnderMouseEvent({additionalParams:{column:e},type:o,mouseEvent:t,ePopup:s})},o,t.target,Co(this.gos),s)}showMenuAfterButtonClick(e,t,o,s){if(e&&!e.isColumn)return;let i=-1,n="left";const r=Co(this.gos);!r&&this.gos.get("enableRtl")&&(i=1,n="right");const a=r?void 0:4*i,l=r?void 0:4;this.showPopup(e,s=>{this.popupSvc?.positionPopupByComponent({type:o,eventSource:t,ePopup:s,nudgeX:a,nudgeY:l,alignSide:n,keepWithinBounds:!0,position:"under",additionalParams:{column:e}})},o,t,r,s)}showPopup(e,t,o,s,i,n){const r=e?this.createBean(new qi(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!r?.hasFilter()||!e)return void Tt(57);const a=Xs({tag:"div",cls:"ag-menu"+(i?"":" ag-filter-menu"),role:"presentation"});let l;[this.tabListener]=this.addManagedElementListeners(a,{keydown:e=>this.trapFocusWithin(e,a)}),a.appendChild(r?.getGui());const d=vo(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,c=this.getLocaleTextFunc(),h=i&&"columnFilter"!==o?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),u=this.popupSvc?.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:t=>{Ap(e,!1,"contextMenu");const i=t instanceof KeyboardEvent;this.tabListener&&(this.tabListener=this.tabListener()),i&&s&&ae(s)&&Cn(s)?.focus({preventScroll:!0}),r?.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,o,e),n?.()},positionCallback:()=>t(a),anchorToElement:d,ariaLabel:h});u&&(this.hidePopup=l=u.hideFunc),r.afterInit().then(()=>{t(a),r.afterGuiAttached({container:o,hidePopup:l})}),Ap(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,o,e)}trapFocusWithin(e,t){e.key!==Ps||e.defaultPrevented||fn(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),mn(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,o){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:o??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}}],dynamicBeans:{headerFilterCellCtrl:class extends gr{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,o,s,i){this.comp=e;const n=nr(this,this.beans.context,i);this.eButtonShowMainFilter=o,this.eFloatingFilterBody=s,this.setGui(t,n),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(n),this.setupLeft(n),this.setupHover(n),this.setupFocus(n),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(n),this.setupUi(),n.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(n);const r=()=>this.onColDefChanged(n);n.addManagedListeners(this.column,{colDefChanged:r}),n.addManagedEventListeners({filterSwitched:({column:e})=>{e===this.column&&r()}}),n.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,o=e.colDef;return wo(t.gos,{colDef:o,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,o=!!e.floatingFilter;this.active=t&&o}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=ei("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new xn(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();E(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){const{beans:t}=this;if(w(t)===this.eGui)return;const o=fn(t,this.eGui,null,e.shiftKey);if(o)return t.headerNavigation?.scrollToColumn(this.column),e.preventDefault(),void o.focus();const s=this.findNextColumnWithFloatingFilter(e.shiftKey);s&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:s},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let o=this.column;do{if(o=e?t.getColBefore(o):t.getColAfter(o),!o)break}while(!o.getColDef().filter||!o.getColDef().floatingFilter);return o}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case ks:case Gs:case Is:case Ls:if(t)return;yn(e);case Es:t&&mn(this.eGui)&&e.preventDefault();break;case Ts:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),o=!!e.relatedTarget&&Y(e.relatedTarget,"ag-floating-filter");if(t&&o&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==Ps);if(e&&t){const t=e.shiftKey;mn(this.eGui,t)}}this.focusThis()}setupHover(e){this.beans.colHover?.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new rr(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!Co(this.gos)}setupUserComp(){if(!this.active)return;const e=this.beans.colFilter?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.beans.menuSvc?.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:o,gos:s}=this,i=e=>{if(!("filterDestroyed"!==e?.source||this.isAlive()&&t?.isAlive()))return;const i=this.comp.getFloatingFilterComp();i&&i.then(i=>{if(i){if(s.get("enableFilterHandlers")){const t=e;let o="filter";return t?.afterFloatingFilter?o="ui":t?.afterDataChange?o="dataChanged":"api"===e?.source&&(o="api"),void this.updateFloatingFilterParams(this.userCompDetails,o)}const n=t?.getCurrentFloatingFilterParentModel(o),r=e?{...e,columns:e.columns??[],source:"api"===e.source?"api":"columnFilter"}:null;i.onParentModelChanged(n,r)}})};[this.destroySyncListener]=e.addManagedListeners(o,{filterChanged:i}),t?.isFilterActive(o)&&i(null)}setupWidth(e){const t=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};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(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const o=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,i=this.active?s?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();n&&i?n.then(t=>{!t||s?.areFilterCompsDifferent(this.userCompDetails??null,i)?this.updateCompDetails(e,i,o):this.updateFloatingFilterParams(i,"colDef")}):this.updateCompDetails(e,i,o)}updateCompDetails(e,t,o){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),o&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){if(!e)return;let o=e.params;this.comp.getFloatingFilterComp()?.then(e=>{"function"==typeof e?.refresh&&(this.gos.get("enableFilterHandlers")&&(o={...o,model:Tp(this.beans.colFilter?.model??{},this.column.getColId()),source:t}),e.refresh(o))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}}},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:function(e){const t=e.filterManager;return!!t?.isColumnFilterPresent()||!!t?.isAggregateFilterPresent()},getColumnFilterInstance:function(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)},destroyFilter:function(e,t){const o=e.colModel.getColDefCol(t);if(o)return e.colFilter?.destroyFilter(o,"api")},setFilterModel:function(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))},getFilterModel:function(e){return e.filterManager?.getFilterModel()??{}},getColumnFilterModel:function(e,t,o){const{gos:s,colModel:i,colFilter:n}=e;o&&!s.get("enableFilterHandlers")&&(Et(288),o=!1);const r=i.getColDefCol(t);return r?n?.getModelForColumn(r,o)??null:null},setColumnFilterModel:function(e,t,o){return e.filterManager?.setColumnFilterModel(t,o)??Promise.resolve()},showColumnFilter:function(e,t){const o=e.colModel.getCol(t);o?e.menuSvc?.showFilterMenu({column:o,containerType:"columnFilter",positionBy:"auto"}):Tt(12,{colKey:t})},hideColumnFilter:function(e){e.menuSvc?.hideFilterMenu()},getColumnFilterHandler:function(e,t){const o=e.colModel.getCol(t);if(o)return e.colFilter?.getHandler(o,!0);Tt(12,{colKey:t})},doFilterAction:function(e,t){const{colModel:o,colFilter:s,gos:i}=e;if(!i.get("enableFilterHandlers"))return void Et(287);const{colId:n,action:r}=t;if(n){const e=o.getColById(n);e&&s?.updateModel(e,r)}else s?.updateAllModels(r)}},dependsOn:[qp,Vg,Yp,kp]},Qp={moduleName:"QuickFilter",version:vt,apiFunctions:{isQuickFilterPresent:function(e){return!!e.quickFilter?.isFilterPresent()},getQuickFilter:function(e){return e.quickFilter?.getText()},resetQuickFilter:function(e){e.quickFilter?.resetCache()}},dependsOn:[{moduleName:"QuickFilterCore",version:vt,rowModels:["clientSide"],beans:[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",e=>this.setFilter(e.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(){const{autoColSvc:e,colModel:t,gos:o,pivotResultCols:s}=this.beans,i=t.isPivotMode(),n=e?.getColumns(),r=t.getColDefCols();let a=(i&&!o.get("applyQuickFilterBeforePivotOrAgg")?s?.getPivotResultCols()?.list:r)??[];n&&(a=a.concat(n)),this.colsToUse=o.get("includeHiddenColumnsInQuickFilter")?a:a.filter(e=>e.isVisible()||e.isRowGroupActive())}isFilterPresent(){return null!==this.quickFilter}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(o=>t?this.doesRowPassCache(e,o):this.doesRowPassNoCache(e,o))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseFilter(e){return a(e)?e.toUpperCase():null}setFilter(e){if(null!=e&&"string"!=typeof e)return void Et(70,{newFilter:e});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"),o=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,o&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(o=>{const s=this.getTextForColumn(o,e);return a(s)&&s.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let o;e?(this.checkGenerateAggText(t),o=t.quickFilterAggregateText):o=this.getAggText(t);const{quickFilterParts:s,matcher:i}=this;return i(s,o)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let o=this.beans.filterValueSvc.getValue(e,t);const s=e.getColDef();if(s.getQuickFilterText){const i=wo(this.gos,{value:o,node:t,data:t.data,column:e,colDef:s});o=s.getQuickFilterText(i)}return a(o)?o.toString().toUpperCase():null}getAggText(e){const t=[];for(const o of this.colsToUse){const s=this.getTextForColumn(o,e);a(s)&&t.push(s)}return t.join("\n")}}],dependsOn:[qp,Yp]}]};var Xp={moduleName:"EventApi",version:vt,apiFunctions:{addEventListener:function(e,t,o){e.apiEventSvc?.addListener(t,o)},addGlobalListener:function(e,t){e.apiEventSvc?.addGlobalListener(t)},removeEventListener:function(e,t,o){e.apiEventSvc?.removeListener(t,o)},removeGlobalListener:function(e,t){e.apiEventSvc?.removeGlobalListener(t)}},beans:[class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=/* @__PURE__ */new Map,this.asyncListeners=/* @__PURE__ */new Map,this.syncGlobalListeners=/* @__PURE__ */new Set,this.globalListenerPairs=/* @__PURE__ */new Map}postConstruct(){this.wrapSvc=this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.()}addListener(e,t){const o=this.wrapSvc?.wrap(e,t)??t,s=!oh.has(e),i=s?this.asyncListeners:this.syncListeners;i.has(e)||i.set(e,/* @__PURE__ */new Set),i.get(e).add(o),this.eventSvc.addListener(e,o,s)}removeListener(e,t){const o=this.wrapSvc?.unwrap(e,t)??t,s=!!this.asyncListeners.get(e)?.delete(o);s||this.syncListeners.get(e)?.delete(o),this.eventSvc.removeListener(e,o,s)}addGlobalListener(e){const t=this.wrapSvc?.wrapGlobal(e)??e,o=(e,o)=>{oh.has(e)&&t(e,o)},s=(e,o)=>{oh.has(e)||t(e,o)};this.globalListenerPairs.set(e,{syncListener:o,asyncListener:s});const i=this.eventSvc;i.addGlobalListener(o,!1),i.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:o,globalListenerPairs:s}=this,i=o?.unwrapGlobal(e)??e;if(s.has(i)){const{syncListener:o,asyncListener:n}=s.get(i);t.removeGlobalListener(o,!1),t.removeGlobalListener(n,!0),s.delete(e)}else this.syncGlobalListeners.delete(i),t.removeGlobalListener(i,!1)}destroyEventListeners(e,t){e.forEach((e,o)=>{e.forEach(e=>this.eventSvc.removeListener(o,e,t)),e.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const o of e)this.eventSvc.removeGlobalListener(o,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:e,asyncListener:o})=>{t.removeGlobalListener(e,!1),t.removeGlobalListener(o,!0)}),e.clear()}}]};function Jp(e,t){if("number"!=typeof e)return"";const o=t(),s=o("thousandSeparator",","),i=o("decimalSeparator",".");return e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${s}`)}var em={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},tm={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]};var om={moduleName:"HighlightChanges",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:/* @__PURE__ */new Map,"data-changed":/* @__PURE__ */new Map}}animateCell(e,t,o=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const i=this.animations[t];i.delete(e);const n=Date.now(),r=n+o,a={phase:"flash",flashEndTime:r,fadeEndTime:n+o+s};i.set(e,a);const l=`ag-cell-${t}`,d=`${l}-animation`,{comp:c,eGui:{style:h}}=e;c.toggleCss(l,!0),c.toggleCss(d,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&r+15{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),o)}),this.nextAnimationTime=r)}advanceAnimations(){const e=Date.now();let t=null;for(const o of Object.keys(this.animations)){const s=this.animations[o],i=`ag-cell-${o}`,n=`${i}-animation`;for(const[o,r]of s){if(!o.isAlive()||!o.comp){s.delete(o);continue}const{phase:a,flashEndTime:l,fadeEndTime:d}=r,c="flash"===a?l:d;if(!(e+15>=c)){t=Math.min(c,t??1/0);continue}const{comp:h,eGui:{style:u}}=o;switch(a){case"flash":h.toggleCss(i,!1),h.toggleCss(n,!0),u.transition=`background-color ${d-l}ms`,u.transitionDelay=l-e+"ms",t=Math.min(d,t??1/0),r.phase="fade";break;case"fade":h.toggleCss(i,!1),h.toggleCss(n,!1),u.removeProperty("transition"),u.removeProperty("transition-delay"),s.delete(o)}}}null==t?(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 o=Dn(e.cellPosition);t.cells[o]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t?.flashDuration,t?.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}}],userComponents:{agAnimateShowChangeCellRenderer:class extends ni{constructor(){super(em),this.eValue=null,this.eDelta=null,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const o=Math.abs(t),s=e.formatValue(o),i=a(s)?s:o,n=t>=0,r=this.eDelta;r.textContent=n?"↑"+i:"↓"+i,r.classList.toggle("ag-value-change-delta-up",n),r.classList.toggle("ag-value-change-delta-down",!n)}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"),ie(this.eDelta)}refresh(e,t=!1){const{value:o,valueFormatted:s}=e,{eValue:i,lastValue:n,beans:r}=this;if(o===n)return!1;if(a(s)?i.textContent=s:a(o)?i.textContent=o:ie(i),r.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;const l=o&&"object"==typeof o&&"toNumber"in o?o.toNumber():o,d=n&&"object"==typeof n&&"toNumber"in n?n.toNumber():n;if(l===d)return!1;if("number"==typeof l&&"number"==typeof d){const t=l-d;this.showDelta(e,t)}return n&&i.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=o,!0}},agAnimateSlideCellRenderer:class extends ni{constructor(){super(tm),this.eCurrent=null,this.refreshCount=0,this.registerCSS(".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}")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious?.remove();const{beans:t,eCurrent:o}=this,s=Xs({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=o.textContent,this.getGui().insertBefore(s,o),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.ePrevious?.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let o=e.value;if(l(o)&&(o=""),o===this.lastValue)return!1;if(this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=o;const s=this.eCurrent;return a(e.valueFormatted)?s.textContent=e.valueFormatted:a(e.value)?s.textContent=o:ie(s),!0}}},apiFunctions:{flashCells:function(e,t={}){const{cellFlashSvc:o}=e;o&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))o.flashCell(s,t)})}}};var sm={tag:"div",cls:"ag-selection-checkbox",role:"presentation",children:[{tag:"ag-checkbox",ref:"eCheckbox",role:"presentation"}]},im=class extends ni{constructor(){super(sm,[Tr]),this.eCheckbox=null}postConstruct(){this.eCheckbox.setPassive(!0)}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.getLocaleTextFunc(),{rowNode:t,eCheckbox:o}=this,s=t.isSelected(),i=U(e,s),[n,r]=t.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],a=e(n,r);o.setValue(s,!0),o.setInputAriaLabel(`${a} (${i})`)}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getWrapperElement(),{dblclick:yn,click:e=>{yn(e),this.eCheckbox.isDisabled()||this.beans.selectionSvc?.handleSelectionEvent(e,this.rowNode,"checkboxSelected")}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.addManagedPropertyListener("rowSelection",({currentValue:e,previousValue:t})=>{("object"==typeof e?io(e):void 0)!==("object"==typeof t?io(t):void 0)&&this.onSelectableChanged()}),co(this.gos)||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}showOrHideSelect(){const{column:e,rowNode:t,overrides:o,gos:s}=this,i=t.selectable,n=this.getIsVisible();let r;if("function"==typeof n){const s=o?.callbackParams;if(e){const o=e.createColumnFunctionCallbackParams(t);r=n({...s,...o})}else r=n({...s,node:t,data:t.data})}else r=n??!1;const a=i&&!r||!i&&r,l=i||r,d=s.get("rowSelection"),c=d&&"string"!=typeof d?!io(d):!!e?.getColDef().showDisabledCheckboxes;this.setVisible(l&&(!a||c)),this.setDisplayed(l&&(!a||c)),l&&this.eCheckbox.setDisabled(a),o?.removeHidden&&this.setDisplayed(l)}getIsVisible(){const e=this.overrides;if(e)return e.isVisible;const t=this.gos.get("rowSelection");return t&&"string"!=typeof t?to(t):this.column?.getColDef()?.checkboxSelection}},nm=class{constructor(e,t){this.rowModel=e,this.pinnedRowModel=t,this.selectAll=!1,this.rootId=null,this.endId=null,this.cachedRange=[]}reset(){this.rootId=null,this.endId=null,this.cachedRange.length=0}setRoot(e){this.rootId=e.id,this.endId=null,this.cachedRange.length=0}setEndRange(e){this.endId=e.id,this.cachedRange.length=0}getRange(){if(0===this.cachedRange.length){const e=this.getRoot(),t=this.getEnd();if(null==e||null==t)return this.cachedRange;this.cachedRange=this.getNodesInRange(e,t)??[]}return this.cachedRange}isInRange(e){return null!==this.rootId&&this.getRange().some(t=>t.id===e.id)}getRoot(e){return this.rootId?this.getRowNode(this.rootId):e?(this.setRoot(e),e):void 0}getEnd(){if(this.endId)return this.getRowNode(this.endId)}getRowNode(e){let t;const{rowModel:o,pinnedRowModel:s}=this;return t??(t=o.getRowNode(e)),s?.isManual()&&(t??(t=s.getPinnedRowById(e,"top")),t??(t=s.getPinnedRowById(e,"bottom"))),t}truncate(e){const t=this.getRange();if(0===t.length)return{keep:[],discard:[]};const o=t[0].id===this.rootId,s=t.findIndex(t=>t.id===e.id);if(s>-1){const i=t.slice(0,s),n=t.slice(s+1);return this.setEndRange(e),o?{keep:i,discard:n}:{keep:n,discard:i}}return{keep:t,discard:[]}}extend(e,t=!1){const o=this.getRoot();if(null==o){const o=this.getRange().slice();return t&&e.depthFirstSearch(e=>!e.group&&o.push(e)),o.push(e),this.setRoot(e),{keep:o,discard:[]}}const s=this.getNodesInRange(o,e);if(!s)return this.setRoot(e),{keep:[e],discard:[]};if(s.find(e=>e.id===this.endId))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const t=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:t}}}getNodesInRange(e,t){const{pinnedRowModel:o,rowModel:s}=this;if(!o?.isManual())return s.getNodesInRangeForSelection(e,t);if("top"===e.rowPinned&&!t.rowPinned)return eu(o,"top",e,void 0).concat(s.getNodesInRangeForSelection(s.getRow(0),t)??[]);if("bottom"===e.rowPinned&&!t.rowPinned){const i=eu(o,"bottom",void 0,e),n=s.getRowCount(),r=s.getRow(n-1);return(s.getNodesInRangeForSelection(t,r)??[]).concat(i)}if(!e.rowPinned&&!t.rowPinned)return s.getNodesInRangeForSelection(e,t);if("top"===e.rowPinned&&"top"===t.rowPinned)return eu(o,"top",e,t);if("bottom"===e.rowPinned&&"top"===t.rowPinned){const i=eu(o,"top",t,void 0),n=eu(o,"bottom",void 0,e),r=s.getRow(0),a=s.getRow(s.getRowCount()-1);return i.concat(s.getNodesInRangeForSelection(r,a)??[]).concat(n)}if(!e.rowPinned&&"top"===t.rowPinned)return eu(o,"top",t,void 0).concat(s.getNodesInRangeForSelection(s.getRow(0),e)??[]);if("top"===e.rowPinned&&"bottom"===t.rowPinned){const i=eu(o,"top",e,void 0),n=eu(o,"bottom",void 0,t),r=s.getRow(0),a=s.getRow(s.getRowCount()-1);return i.concat(s.getNodesInRangeForSelection(r,a)??[]).concat(n)}if("bottom"===e.rowPinned&&"bottom"===t.rowPinned)return eu(o,"bottom",e,t);if(!e.rowPinned&&"bottom"===t.rowPinned){const i=eu(o,"bottom",void 0,t),n=s.getRow(s.getRowCount());return(s.getNodesInRangeForSelection(e,n)??[]).concat(i)}return null}},rm=class extends We{constructor(e){super(),this.column=e,this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(w(this.beans))&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e;const t=this.createManagedBean(new Er);this.cbSelectAll=t,t.addCss("ag-header-select-all"),P(t.getGui(),"presentation"),this.showOrHideSelectAll();const o=this.updateStateOfCheckbox.bind(this);this.addManagedEventListeners({newColumnsLoaded:()=>this.showOrHideSelectAll(),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:o,paginationChanged:o,modelUpdated:o}),this.addManagedPropertyListener("rowSelection",({currentValue:e,previousValue:t})=>{const o=e=>"string"!=typeof e&&e&&"singleRow"!==e.mode?e.selectAll:void 0;o(e)!==o(t)&&this.showOrHideSelectAll(),this.updateStateOfCheckbox()}),this.addManagedListeners(t,{fieldValueChanged:this.onCbSelectAll.bind(this)}),t.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onDisplayedColumnsChanged(e){this.isAlive()&&this.showOrHideSelectAll("uiColumnMoved"===e.source)}showOrHideSelectAll(e=!1){const t=this.isCheckboxSelection();this.cbSelectAllVisible=t,this.cbSelectAll.setDisplayed(t),t&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel(e)}updateStateOfCheckbox(){if(!this.cbSelectAllVisible||this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.getSelectAllMode(),t=this.beans.selectionSvc,o=this.cbSelectAll,s=t.getSelectAllState(e);o.setValue(s);const i=t.hasNodesToSelect(e);o.setDisabled(!i),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(e=!1){const t=this.getLocaleTextFunc(),{headerCellCtrl:o,cbSelectAll:s,cbSelectAllVisible:i}=this,n=U(t,s.getValue()),r=t("ariaRowSelectAll","Press Space to toggle all rows selection");o.setAriaDescriptionProperty("selectAll",i?`${r} (${n})`:null),s.setInputAriaLabel(t("ariaHeaderSelection","Column with Header Selection")),e||o.announceAriaDescription()}checkSelectionType(e){return!!uo(this.gos)||(Et(128,{feature:e}),!1)}checkRightRowModelType(e){const{gos:t,rowModel:o}=this.beans;return!(!Lt(t)&&!Gt(t))||(Et(129,{feature:e,rowModel:o.getType()}),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.getSelectAllMode();let o="uiSelectAll";"currentPage"===t?o="uiSelectAllCurrentPage":"filtered"===t&&(o="uiSelectAllFiltered");const s={source:o,selectAll:t},i=this.beans.selectionSvc;e?i.selectAllRowNodes(s):i.deselectAllRowNodes(s)}isCheckboxSelection(){const{column:e,gos:t,beans:o}=this,s="object"==typeof t.get("rowSelection")?"headerCheckbox":"headerCheckboxSelection";return am(o,e)&&this.checkRightRowModelType(s)&&this.checkSelectionType(s)}getSelectAllMode(){const e=po(this.gos,!1);if(e)return e;const{headerCheckboxSelectionCurrentPageOnly:t,headerCheckboxSelectionFilteredOnly:o}=this.column.getColDef();return t?"currentPage":o?"filtered":"all"}destroy(){super.destroy(),this.cbSelectAll=void 0,this.headerCellCtrl=void 0}};function am({gos:e,selectionColSvc:t},o){const s=e.get("rowSelection"),i=o.getColDef(),{headerCheckboxSelection:n}=i;let r=!1;if("object"==typeof s){const e=Ko(o),i=jo(o);("autoGroupColumn"===so(s)&&i||e&&t?.isSelectionColumnEnabled())&&(r=oo(s))}else r="function"==typeof n?n(wo(e,{column:o,colDef:i})):!!n;return r}var lm=class extends We{postConstruct(){const{gos:e,beans:t}=this;this.selectionCtx=new nm(t.rowModel,t.pinnedRowModel),this.addManagedPropertyListeners(["isRowSelectable","rowSelection"],()=>{const t=co(e);t!==this.isRowSelectable&&(this.isRowSelectable=t,this.updateSelectable())}),this.isRowSelectable=co(e),this.addManagedEventListeners({cellValueChanged:e=>this.updateRowSelectable(e.node),rowNodeDataChanged:e=>this.updateRowSelectable(e.node)})}destroy(){super.destroy(),this.selectionCtx.reset()}createCheckboxSelectionComponent(){return new im}createSelectAllFeature(e){if(am(this.beans,e))return new rm(e)}isMultiSelect(){return uo(this.gos)}onRowCtrlSelected(e,t,o){const s=!!e.rowNode.isSelected();e.forEachGui(o,e=>{e.rowComp.toggleCss("ag-row-selected",s);const o=e.element;V(o,s),o.contains(w(this.beans))&&t(e)})}announceAriaRowSelection(e){if(this.isRowSelectionBlocked(e))return;const t=e.isSelected(),o=this.beans.editSvc?.isEditing({rowNode:e});if(!e.selectable||o)return;const s=this.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row`);this.beans.ariaAnnounce?.announceValue(s,"rowSelection")}isRowSelectionBlocked(e){return!e.selectable||e.rowPinned&&!Jh(e)||!Bt(this.gos)}updateRowSelectable(e,t){const o=e.rowPinned&&e.pinnedSibling?e.pinnedSibling.selectable:this.isRowSelectable?.(e)??!0;return this.setRowSelectable(e,o,t),o}setRowSelectable(e,t,o){if(e.selectable!==t){if(e.selectable=t,e.dispatchRowEvent("selectableChanged"),o)return;if(mo(this.gos)){const t=this.calculateSelectedFromChildren(e);return void this.setNodesSelected({nodes:[e],newValue:t??!1,source:"selectableChanged"})}e.isSelected()&&!e.selectable&&this.setNodesSelected({nodes:[e],newValue:!1,source:"selectableChanged"})}}calculateSelectedFromChildren(e){let t=!1,o=!1;if(!e.childrenAfterGroup?.length)return e.selectable?e.__selected:null;for(let s=0;s0&&t>0?void 0:e>0)}function hm(e){const t=!1===e.isSelected(),o=e.childrenAfterFilter?.some(hm)??!1;return t||o}var um={moduleName:"SharedRowSelection",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,Xo(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;null!=t&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),Qo(e))}createColumns(e,t){const o=e.treeDepth,s=(this.columns?.treeDepth??-1)==o,i=this.generateSelectionCols();if(Zo(i,this.columns?.list??[])&&s)return;(()=>{$o(this.beans,this.columns?.tree),this.columns=null})();const{colGroupSvc:n}=this.beans,r=n?.findDepth(e.tree)??0;this.columns={list:i,tree:n?.balanceTreeForAutoCols(i,r)??[],treeDepth:r,map:{}};t(e=>{if(!e)return null;const t=e.filter(e=>!Ko(e));return[...i,...t]})}updateColumns(e){const t=Xo(e.source),{beans:o}=this;for(const s of this.columns?.list??[]){const i=this.createSelectionColDef(e.currentValue);s.setColDef(i,null,t),ws(o,{state:[es(i,s.colId)]},t)}}getColumn(e){return this.columns?.list.find(t=>Jo(t,e))??null}getColumns(){return this.columns?.list??null}isSelectionColumnEnabled(){const{gos:e,beans:t}=this,o=e.get("rowSelection");if("object"!=typeof o||!Bt(e))return!1;const s=(t.autoColSvc?.getColumns()?.length??0)>0;if("autoGroupColumn"===o.checkboxLocation&&s)return!1;const i=!!to(o),n=oo(o);return i||n}createSelectionColDef(e){const{gos:t}=this,o=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:i,spanRows:n,...r}=o??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(e,t,o,s){const i=o.isSelected();return i===s.isSelected()?0:i?1:-1},editable:!1,suppressFillHandle:!0,suppressAutoSize:!0,pinned:null,...r,colId:"ag-Grid-SelectionColumn",chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const o=new Mo(e,null,t,!1);return this.createBean(o),[o]}onSelectionOptionsChanged(e,t,o){const s=(t&&"string"!=typeof t?to(t):void 0)!==(e&&"string"!=typeof e?to(e):void 0),i=(t&&"string"!=typeof t?oo(t):void 0)!==(e&&"string"!=typeof e?oo(e):void 0),n=so(e)!==so(t);(s||i||n)&&this.beans.colModel.refreshAll(o)}destroy(){$o(this.beans,this.columns?.tree),super.destroy()}refreshVisibility(e,t,o){if(!this.columns?.list.length)return;const i=e.length+t.length+o.length;if(0===i)return;const n=this.columns.list[0];if(!n.isVisible())return;(this.beans.rowNumbersSvc?.getColumn("ag-Grid-RowNumbersColumn")?2:1)===i&&(()=>{let i;switch(n.pinned){case"left":case!0:i=e;break;case"right":i=o;break;default:i=t}i&&s(i,n)})()}}],css:[':where(.ag-selection-checkbox) .ag-checkbox-input-wrapper:before{content:"";cursor:pointer;inset:-8px;position:absolute}'],apiFunctions:{setNodesSelected:function(e,t){if(!t.nodes.every(e=>e.rowPinned&&!Jh(e)?(Et(59),!1):void 0!==e.id||(Et(60),!1)))return;const{nodes:o,source:s,newValue:i}=t;e.selectionSvc?.setNodesSelected({nodes:o,source:s??"api",newValue:i})},selectAll:function(e,t,o="apiSelectAll"){e.selectionSvc?.selectAllRowNodes({source:o,selectAll:t})},deselectAll:function(e,t,o="apiSelectAll"){e.selectionSvc?.deselectAllRowNodes({source:o,selectAll:t})},selectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"filtered"})},deselectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"filtered"})},selectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.selectAllRowNodes({source:t,selectAll:"currentPage"})},deselectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionSvc?.deselectAllRowNodes({source:t,selectAll:"currentPage"})},getSelectedNodes:function(e){return e.selectionSvc?.getSelectedNodes()??[]},getSelectedRows:function(e){return e.selectionSvc?.getSelectedRows()??[]}}},gm={moduleName:"RowSelection",version:vt,rowModels:["clientSide","infinite","viewport"],beans:[class extends lm{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=/* @__PURE__ */new Map,this.detailSelection=/* @__PURE__ */new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=ho(e),this.groupSelectsDescendants=mo(e),this.groupSelectsFiltered="filteredDescendants"===go(e),this.masterSelectsDetail="detail"===fo(e),this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=mo(e),o=ho(e),s="filteredDescendants"===go(e);this.masterSelectsDetail="detail"===fo(e),t===this.groupSelectsDescendants&&s===this.groupSelectsFiltered&&o===this.mode||(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=s,this.mode=o)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,o){if(this.isRowSelectionBlocked(t))return 0;const s=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,o);if(null==s)return 0;if(this.selectionCtx.selectAll=!1,"select"in s)return s.reset?this.resetNodes():this.selectRange(s.deselect,!1,o),this.selectRange(s.select,!0,o);{const t=s.checkFilteredNodes?hm(s.node):s.newValue;return this.setNodesSelected({nodes:[s.node],newValue:t,clearSelection:s.clearSelection,keepDescendants:s.keepDescendants,event:e,source:o})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:o,nodes:s,event:i,source:n,keepDescendants:r=!1}){if(0===s.length)return 0;const{gos:a}=this;if(!Bt(a)&&e)return Et(132),0;if(s.length>1&&!this.isMultiSelect())return Et(130),0;let l=0;for(let d=0;d0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n))),l}selectRange(e,t,o){let s=0;return e.forEach(e=>{const i=dm(e);i.group&&this.groupSelectsDescendants||this.selectRowNode(i,t,void 0,o)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(o),this.dispatchSelectionChanged(o)),s}selectChildren(e,t,o){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:o,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=/* @__PURE__ */new Map;this.selectedNodes.forEach((o,s)=>{e(o)&&t.set(s,o)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:o,rowModel:s}=this.beans;if(!Lt(o))return!1;const i=s.rootNode;if(!i)return!1;t||((t=new El(!0,i)).active=!1);let n=!1;return t.forEachChangedNodeDepthFirst(t=>{if(t!==i){const o=this.calculateSelectedFromChildren(t);n=this.selectRowNode(t,null!==o&&o,void 0,e)||n}}),n}clearOtherNodes(e,t,o){const s=/* @__PURE__ */new Map;let i=0;return this.selectedNodes.forEach(n=>{const r=n.id==e.id;if(!(t&&function(e,t){let o=t.parent;for(;o;){if(o===e)return!0;o=o.parent}return!1}(e,n)||r)){const e=this.selectedNodes.get(n.id);i+=this.setNodesSelected({nodes:[e],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:o}),this.groupSelectsDescendants&&n.parent&&s.set(n.parent.id,n.parent)}}),s.forEach(e=>{const t=this.calculateSelectedFromChildren(e);this.selectRowNode(e,null!==t&&t,void 0,o)}),i}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 kr(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(!Lt(e))return;const o=t.getTopLevelNodes();if(null===o)return;const s=[];return function e(t){for(let o=0,i=t.length;o{const o=this.selectRowNode(dm(t),!1,void 0,e);s||(s=o)};if("currentPage"===t||"filtered"===t){if(!o)return void Tt(102);this.getNodesToSelect(t).forEach(i)}else this.selectedNodes.forEach(i),this.reset(e);if(this.selectionCtx.selectAll=!1,o&&this.groupSelectsDescendants){const t=this.updateGroupsFromChildrenSelections(e);s||(s=t)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,o=0;return this.getNodesToSelect(e).forEach(e=>{this.groupSelectsDescendants&&e.group||(e.isSelected()?t++:e.selectable&&o++)}),{selectedCount:t,notSelectedCount:o}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:o}=this.getSelectedCounts(e);return cm(t,o)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(e=>e.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],o=e=>t.push(e);if("currentPage"===e)return this.forEachNodeOnPage(e=>{if(e.group){if(!e.expanded&&!e.footer){const t=e=>{o(e),e.childrenAfterFilter?.forEach(t)};return void t(e)}this.groupSelectsDescendants||o(e)}else o(e)}),t;const s=this.beans.rowModel;return"filtered"===e?(s.forEachNodeAfterFilter(o),t):(s.forEachNode(o),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:o}=this.beans,s=t.getFirstRow(),i=t.getLastRow();for(let n=s;n<=i;n++){const t=o.getRow(n);t&&e(t)}}selectAllRowNodes(e){const{gos:t,selectionCtx:o}=this;if(!Bt(t))return void Et(132);if(function(e){return"string"!=typeof e.get("rowSelection")}(t)&&!uo(t))return void Et(130);if(!this.canSelectAll())return;const{source:s,selectAll:i}=e;let n=!1;if(this.getNodesToSelect(i).forEach(e=>{const t=this.selectRowNode(dm(e),!0,void 0,s);n||(n=t)}),o.selectAll=!0,Lt(t)&&this.groupSelectsDescendants){const e=this.updateGroupsFromChildrenSelections(s);n||(n=e)}n&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,o){if(e||(e=[]),!Array.isArray(e))return void Tt(103);const s=new Set(e),i=[];this.beans.rowModel.forEachNode(e=>{s.has(e.id)&&i.push(e)}),o&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:i,source:t})}canSelectAll(){return Lt(this.beans.gos)}updateSelectable(e){const{gos:t,rowModel:o}=this.beans;if(!Bt(t))return;const s="selectableChanged",i=void 0!==e,n=Lt(t)&&this.groupSelectsDescendants,r=[],a=e=>{if(!i||e.group){if(n&&e.group){const t=e.childrenAfterGroup?.some(e=>e.selectable)??!1;return void this.setRowSelectable(e,t,!0)}!this.updateRowSelectable(e,!0)&&e.isSelected()&&r.push(e)}};if(n){if(void 0===e){const t=o.rootNode;e=t?new El(!1,t):void 0}e?.forEachChangedNodeDepthFirst(a,!i,!i)}else o.forEachNode(a);r.length&&this.setNodesSelected({nodes:r,newValue:!1,source:s}),!i&&n&&this.updateGroupsFromChildrenSelections?.(s)}updateSelectableAfterGrouping(e){this.updateSelectable(e),this.groupSelectsDescendants&&this.updateGroupsFromChildrenSelections?.("rowGroupChanged",e)&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){if(!this.masterSelectsDetail)return;const o=e.detailNode?.detailGridInfo?.api;if(!o)return;const s=function(e){let t=0,o=0;return e.forEachNode(e=>{e.isSelected()?t++:e.selectable&&o++}),cm(t,o)}(o);e.isSelected()!==s&&this.selectRowNode(e,s,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),s||this.detailSelection.set(e.id,new Set(o.getSelectedNodes().map(e=>e.id)))}setDetailSelectionState(e,t,o){if(this.masterSelectsDetail)if(uo(t))switch(e.isSelected()){case!0:o.selectAll();break;case!1:o.deselectAll();break;case void 0:{const t=this.detailSelection.get(e.id);if(t){const e=[];for(const s of t){const t=o.getRowNode(s);t&&e.push(t)}o.setNodesSelected({nodes:e,newValue:!0,source:"masterDetail"})}break}}else Et(269)}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}}],dependsOn:[um]},pm=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,o=e.colDef,s=o.cellClassRules,i=this.getCellClassParams(e,o);ru(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,i,e=>t.toggleCss(e,!0),e=>t.toggleCss(e,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,o=t.cellStyle;if(!o)return;let s;s="function"==typeof o?o(this.getCellClassParams(e,t)):o,s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,o=e.colDef,s=this.getCellClassParams(e,o);for(const n of this.staticClasses)t.toggleCss(n,!1);const i=this.beans.cellStyles.getStaticCellClasses(o,s);this.staticClasses=i;for(const n of i)t.toggleCss(n,!0)}getCellClassParams(e,t){const{value:o,rowNode:s}=this.cellCtrl;return wo(this.beans.gos,{value:o,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},mm={moduleName:"CellStyle",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,o,s){ru(this.beans.expressionSvc,void 0,e.cellClassRules,t,o,s),this.processStaticCellClasses(e,t,o)}getStaticCellClasses(e,t){const{cellClass:o}=e;if(!o)return[];let s;return s="function"==typeof o?o(t):o,"string"==typeof s&&(s=[s]),s||[]}createCellCustomStyleFeature(e){return new pm(e,this.beans)}processStaticCellClasses(e,t,o){this.getStaticCellClasses(e,t).forEach(e=>{o(e)})}}]},fm={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,overlayComponent:!0,suppressOverlays:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,groupLockGroupColumns:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,renderingMode:!0,columnMenu:!0,suppressSetFilterByDefault:!0,getDataPath:!0,enableCellSpan:!0,enableFilterHandlers:!0,filterHandlers:!0},Cm="clientSide",vm="serverSide",wm="infinite",bm={onGroupExpandedOrCollapsed:[Cm],refreshClientSideRowModel:[Cm],isRowDataEmpty:[Cm],forEachLeafNode:[Cm],forEachNodeAfterFilter:[Cm],forEachNodeAfterFilterAndSort:[Cm],resetRowHeights:[Cm,vm],applyTransaction:[Cm],applyTransactionAsync:[Cm],flushAsyncTransactions:[Cm],getBestCostNodeSelection:[Cm],getServerSideSelectionState:[vm],setServerSideSelectionState:[vm],applyServerSideTransaction:[vm],applyServerSideTransactionAsync:[vm],applyServerSideRowData:[vm],retryServerSideLoads:[vm],flushServerSideAsyncTransactions:[vm],refreshServerSide:[vm],getServerSideGroupLevelState:[vm],refreshInfiniteCache:[wm],purgeInfiniteCache:[wm],getInfiniteRowCount:[wm],isLastRowIndexKnown:[wm,vm],expandAll:[Cm,vm],collapseAll:[Cm,vm],onRowHeightChanged:[Cm,vm],setRowCount:[wm,vm],getCacheBlockState:[wm,vm]},ym={showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'},clearRangeSelection:{version:"v32.2",message:"Use `clearCellSelection` instead."},getInfiniteRowCount:{version:"v32.2",old:"getInfiniteRowCount()",new:"getDisplayedRowCount()"},selectAllFiltered:{version:"v33",old:"selectAllFiltered()",new:'selectAll("filtered")'},deselectAllFiltered:{version:"v33",old:"deselectAllFiltered()",new:'deselectAll("filtered")'},selectAllOnCurrentPage:{version:"v33",old:"selectAllOnCurrentPage()",new:'selectAll("currentPage")'},deselectAllOnCurrentPage:{version:"v33",old:"deselectAllOnCurrentPage()",new:'deselectAll("currentPage")'}};var Sm={detailCellRendererCtrl:"SharedMasterDetail",dndSourceComp:"DragAndDrop",fillHandle:"CellSelection",groupCellRendererCtrl:"GroupCellRenderer",headerFilterCellCtrl:"ColumnFilter",headerGroupCellCtrl:"ColumnGroup",rangeHandle:"CellSelection",tooltipFeature:"Tooltip",highlightTooltipFeature:"Tooltip",tooltipStateManager:"Tooltip",groupStrategy:"RowGrouping",treeGroupStrategy:"TreeData",rowNumberRowResizer:"RowNumbers",singleCell:"EditCore",fullRow:"EditCore",agSetColumnFilterHandler:"SetFilter",agMultiColumnFilterHandler:"MultiFilter",agGroupColumnFilterHandler:"GroupFilter",agNumberColumnFilterHandler:"NumberFilter",agBigIntColumnFilterHandler:"BigIntFilter",agDateColumnFilterHandler:"DateFilter",agTextColumnFilterHandler:"TextFilter"},Rm={expanded:1,contracted:1,"tree-closed":1,"tree-open":1,"tree-indeterminate":1,pin:1,"eye-slash":1,arrows:1,left:1,right:1,group:1,aggregation:1,pivot:1,"not-allowed":1,chart:1,cross:1,cancel:1,tick:1,first:1,previous:1,next:1,last:1,linked:1,unlinked:1,"color-picker":1,loading:1,menu:1,"menu-alt":1,filter:1,"filter-add":1,columns:1,maximize:1,minimize:1,copy:1,cut:1,paste:1,grip:1,save:1,csv:1,excel:1,"small-down":1,"small-left":1,"small-right":1,"small-up":1,asc:1,desc:1,aasc:1,adesc:1,none:1,up:1,down:1,plus:1,minus:1,settings:1,"checkbox-checked":1,"checkbox-indeterminate":1,"checkbox-unchecked":1,"radio-button-on":1,"radio-button-off":1,eye:1,"column-arrow":1,"un-pin":1,"pinned-top":1,"pinned-bottom":1,"chevron-up":1,"chevron-down":1,"chevron-left":1,"chevron-right":1,edit:1},xm={chart:"MenuCore",cancel:"EnterpriseCore",first:"Pagination",previous:"Pagination",next:"Pagination",last:"Pagination",linked:"IntegratedCharts",loadingMenuItems:"MenuCore",unlinked:"IntegratedCharts",menu:"ColumnHeaderComp",legacyMenu:"ColumnMenu",filter:"ColumnFilter",filterActive:"ColumnFilter",filterAdd:"NewFiltersToolPanel",filterCardCollapse:"NewFiltersToolPanel",filterCardExpand:"NewFiltersToolPanel",filterCardEditing:"NewFiltersToolPanel",filterTab:"ColumnMenu",filtersToolPanel:"FiltersToolPanel",columns:["MenuCore"],columnsToolPanel:["ColumnsToolPanel"],maximize:"EnterpriseCore",minimize:"EnterpriseCore",save:"MenuCore",columnGroupOpened:"ColumnGroupHeaderComp",columnGroupClosed:"ColumnGroupHeaderComp",accordionOpen:"EnterpriseCore",accordionClosed:"EnterpriseCore",accordionIndeterminate:"EnterpriseCore",columnSelectClosed:["ColumnsToolPanel","ColumnMenu"],columnSelectOpen:["ColumnsToolPanel","ColumnMenu"],columnSelectIndeterminate:["ColumnsToolPanel","ColumnMenu"],columnMovePin:"SharedDragAndDrop",columnMoveHide:"SharedDragAndDrop",columnMoveMove:"SharedDragAndDrop",columnMoveLeft:"SharedDragAndDrop",columnMoveRight:"SharedDragAndDrop",columnMoveGroup:"SharedDragAndDrop",columnMoveValue:"SharedDragAndDrop",columnMovePivot:"SharedDragAndDrop",dropNotAllowed:"SharedDragAndDrop",ensureColumnVisible:["ColumnsToolPanel","ColumnMenu"],groupContracted:"GroupCellRenderer",groupExpanded:"GroupCellRenderer",setFilterGroupClosed:"SetFilter",setFilterGroupOpen:"SetFilter",setFilterGroupIndeterminate:"SetFilter",setFilterLoading:"SetFilter",close:"EnterpriseCore",check:"MenuItem",colorPicker:"CommunityCore",groupLoading:"LoadingCellRenderer",overlayLoading:"Overlay",overlayExporting:"Overlay",menuAlt:"ColumnHeaderComp",menuPin:"MenuCore",menuValue:"MenuCore",menuAddRowGroup:["MenuCore","ColumnsToolPanel"],menuRemoveRowGroup:["MenuCore","ColumnsToolPanel"],clipboardCopy:"MenuCore",clipboardCut:"MenuCore",clipboardPaste:"MenuCore",pivotPanel:["ColumnsToolPanel","RowGroupingPanel"],rowGroupPanel:["ColumnsToolPanel","RowGroupingPanel"],valuePanel:"ColumnsToolPanel",columnDrag:"EnterpriseCore",rowDrag:["RowDrag","DragAndDrop"],csvExport:"MenuCore",excelExport:"MenuCore",smallDown:"CommunityCore",selectOpen:"CommunityCore",richSelectOpen:"RichSelect",richSelectRemove:"RichSelect",richSelectLoading:"RichSelect",smallLeft:"CommunityCore",smallRight:"CommunityCore",subMenuOpen:"MenuItem",subMenuOpenRtl:"MenuItem",panelDelimiter:"RowGroupingPanel",panelDelimiterRtl:"RowGroupingPanel",smallUp:"CommunityCore",sortAscending:["MenuCore","Sort"],sortDescending:["MenuCore","Sort"],sortAbsoluteAscending:["MenuCore","Sort"],sortAbsoluteDescending:["MenuCore","Sort"],sortUnSort:["MenuCore","Sort"],advancedFilterBuilder:"AdvancedFilter",advancedFilterBuilderDrag:"AdvancedFilter",advancedFilterBuilderInvalid:"AdvancedFilter",advancedFilterBuilderMoveUp:"AdvancedFilter",advancedFilterBuilderMoveDown:"AdvancedFilter",advancedFilterBuilderAdd:"AdvancedFilter",advancedFilterBuilderRemove:"AdvancedFilter",advancedFilterBuilderSelectOpen:"AdvancedFilter",chartsMenu:"IntegratedCharts",chartsMenuEdit:"IntegratedCharts",chartsMenuAdvancedSettings:"IntegratedCharts",chartsMenuAdd:"IntegratedCharts",chartsColorPicker:"IntegratedCharts",chartsThemePrevious:"IntegratedCharts",chartsThemeNext:"IntegratedCharts",chartsDownload:"IntegratedCharts",checkboxChecked:"CommunityCore",checkboxIndeterminate:"CommunityCore",checkboxUnchecked:"CommunityCore",radioButtonOn:"CommunityCore",radioButtonOff:"CommunityCore",rowPin:"PinnedRow",rowUnpin:"PinnedRow",rowPinBottom:"PinnedRow",rowPinTop:"PinnedRow"},Fm=/* @__PURE__ */new Set(["colorPicker","smallUp","checkboxChecked","checkboxIndeterminate","checkboxUnchecked","radioButtonOn","radioButtonOff","smallDown","smallLeft","smallRight"]);var Dm=/* @__PURE__ */new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Mm={moduleName:"Validation",version:vt,beans:[class extends We{constructor(){super(...arguments),this.beanName="validation"}wireBeans(e){this.gridOptions=e.gridOptions,bt=Ju}warnOnInitialPropertyUpdate(e,t){"api"===e&&fm[t]&&Et(22,{key:t})}processGridOptions(e){this.processOptions(e,{objectName:"gridOptions",allProperties:[...ch,...dh,...lh,...hh,...mh,...ph,...gh,...uh,...Object.values(sh)],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:{suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."},enableFillHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeHandle:{version:"32.2",message:"Use `cellSelection.handle` instead."},enableRangeSelection:{version:"32.2",message:"Use `cellSelection = true` instead."},suppressMultiRangeSelection:{version:"32.2",message:"Use `cellSelection.suppressMultiRanges` instead."},suppressClearOnFillReduction:{version:"32.2",message:"Use `cellSelection.handle.suppressClearOnFillReduction` instead."},fillHandleDirection:{version:"32.2",message:"Use `cellSelection.handle.direction` instead."},fillOperation:{version:"32.2",message:"Use `cellSelection.handle.setFillValue` instead."},suppressRowClickSelection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},suppressRowDeselection:{version:"32.2",message:"Use `rowSelection.enableClickSelection` instead."},rowMultiSelectWithClick:{version:"32.2",message:"Use `rowSelection.enableSelectionWithoutKeys` instead."},groupSelectsChildren:{version:"32.2",message:'Use `rowSelection.groupSelects = "descendants"` instead.'},groupSelectsFiltered:{version:"32.2",message:'Use `rowSelection.groupSelects = "filteredDescendants"` instead.'},isRowSelectable:{version:"32.2",message:"Use `selectionOptions.isRowSelectable` instead."},suppressCopySingleCellRanges:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},suppressCopyRowsToClipboard:{version:"32.2",message:"Use `rowSelection.copySelectedRows` instead."},onRangeSelectionChanged:{version:"32.2",message:"Use `onCellSelectionChanged` instead."},onRangeDeleteStart:{version:"32.2",message:"Use `onCellSelectionDeleteStart` instead."},onRangeDeleteEnd:{version:"32.2",message:"Use `onCellSelectionDeleteEnd` instead."},suppressBrowserResizeObserver:{version:"32.2",message:"The grid always uses the browser's ResizeObserver, this grid option has no effect."},onColumnEverythingChanged:{version:"32.2",message:"Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events."},groupRemoveSingleChildren:{version:"33",message:"Use `groupHideParentOfSingleChild` instead."},groupRemoveLowestSingleChildren:{version:"33",message:'Use `groupHideParentOfSingleChild: "leafGroupsOnly"` instead.'},suppressRowGroupHidesColumns:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressHideOnGroup"` instead.'},suppressMakeColumnVisibleAfterUnGroup:{version:"33",message:'Use `suppressGroupChangesColumnVisibility: "suppressShowOnUngroup"` instead.'},unSortIcon:{version:"33",message:"Use `defaultColDef.unSortIcon` instead."},sortingOrder:{version:"33",message:"Use `defaultColDef.sortingOrder` instead."},suppressPropertyNamesCheck:{version:"33",message:"`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant."},suppressAdvancedFilterEval:{version:"34",message:"Advanced filter no longer uses function evaluation, so this option has no effect."}},validations:vh()})}validateApiFunction(e,t){return function(e,t,o){const s=ym[e];if(s){const{version:o,new:i,old:n,message:r}=s,a=n??e;return(...e)=>(nt(`Since ${o} api.${a} is deprecated. ${i?`Please use ${i} instead. `:""}${r??""}`),t.apply(t,e))}const i=bm[e];return i?(...s)=>{const n=o.rowModel.getType();if(i.includes(n))return t.apply(t,s);rt(`api.${e} can only be called when gridOptions.rowModelType is ${i.join(" or ")}`)}:t}(e,t,this.beans)}missingUserComponent(e,t,o,s){const i=ih[t];i?this.gos.assertModuleRegistered(i,`AG Grid '${e}' component: ${t}`):Et(101,{propertyName:e,componentName:t,agGridDefaults:o,jsComps:s})}missingDynamicBean(e){const t=Sm[e];return t?It(200,{...this.gos.getModuleErrorParams(),moduleName:t,reasonOrId:e}):void 0}checkRowEvents(e){Dm.has(e)&&Et(10,{eventType:e})}validateIcon(e){if(Fm.has(e)&&Et(43,{iconName:e}),Rm[e])return;const t=xm[e];t?Tt(200,{reasonOrId:`icon '${e}'`,moduleName:t,gridScoped:ft(),gridId:this.beans.context.getId(),rowModelType:this.gos.get("rowModelType"),additionalText:"Alternatively, use the CSS icon name directly."}):Et(134,{iconName:e})}isProvidedUserComp(e){return!!ih[e]}validateColDef(e){this.processOptions(e,{objectName:"colDef",allProperties:Object.keys(ah),docsUrl:"column-properties/",deprecations:{checkboxSelection:{version:"32.2",message:"Use `rowSelection.checkboxes` in `GridOptions` instead."},headerCheckboxSelection:{version:"32.2",message:"Use `rowSelection.headerCheckbox = true` in `GridOptions` instead."},headerCheckboxSelectionFilteredOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.'},headerCheckboxSelectionCurrentPageOnly:{version:"32.2",message:'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.'},showDisabledCheckboxes:{version:"32.2",message:"Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead."},rowGroupingHierarchy:{version:"34.3",message:"Use `colDef.groupHierarchy` instead."}},validations:{autoHeight:{supportedRowModels:["clientSide","serverSide"],validate:(e,{paginationAutoPageSize:t})=>t?"colDef.autoHeight is not supported with paginationAutoPageSize.":null},allowFormula:{supportedRowModels:["clientSide"]},cellRendererParams:{validate:e=>null==e.rowGroup&&null==e.rowGroupIndex&&"agGroupCellRenderer"!==e.cellRenderer||!("checkbox"in e.cellRendererParams)?null:'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.'},flex:{validate:(e,t)=>t.autoSizeStrategy?"colDef.flex is not supported with gridOptions.autoSizeStrategy":null},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerValueGetter:{validate:e=>{const t=e.headerValueGetter;return"function"==typeof t||"string"==typeof t?null:"headerValueGetter must be a function or a valid string expression"}},icons:{validate:({icons:e})=>{if(e){if(e.smallDown)return It(262);if(e.smallLeft)return It(263);if(e.smallRight)return It(264)}return null}},sort:{validate:e=>Ao(e.sort)||Eo(e.sort)?null:`sort must be of type (SortDirection | SortDef), currently it is ${"object"==typeof e.sort?JSON.stringify(e.sort):Ft(e.sort)}`},initialSort:{validate:e=>Ao(e.initialSort)||Eo(e.initialSort)?null:`initialSort must be of non-null type (SortDirection | SortDef), currently it is ${"object"==typeof e.initialSort?JSON.stringify(e.initialSort):Ft(e.initialSort)}`},sortingOrder:{validate:e=>{const t=e.sortingOrder;if(Array.isArray(t)&&t.length>0){const e=t.filter(e=>!(Ao(e)||Eo(e)));if(e.length>0)return`sortingOrder must be an array of type non-null (SortDirection | SortDef)[], incorrect items are: [${e.map(e=>"string"==typeof e||null==e?Ft(e):JSON.stringify(e)).join(", ")}]`}else if(!Array.isArray(t)||!t.length)return`sortingOrder must be an array with at least one element, currently it is [${t}]`;return null}},type:{validate:e=>{const t=e.type;return t instanceof Array?t.some(e=>"string"!=typeof e)?"if colDef.type is supplied an array it should be of type 'string[]'":null:"string"==typeof t?null:"colDef.type should be of type 'string' | 'string[]'"}},rowSpan:{validate:(e,{suppressRowTransform:t})=>t?null:"colDef.rowSpan requires suppressRowTransform to be enabled."},spanRows:{dependencies:{editable:{required:[!1,void 0]},rowDrag:{required:[!1,void 0]},colSpan:{required:[void 0]},rowSpan:{required:[void 0]}},validate:(e,{rowSelection:t,cellSelection:o,suppressRowTransform:s,enableCellSpan:i,rowDragEntireRow:n,enableCellTextSelection:r})=>"object"==typeof t&&"singleRow"===t?.mode&&t?.enableClickSelection?"colDef.spanRows is not supported with rowSelection.clickSelection":o?"colDef.spanRows is not supported with cellSelection.":s?"colDef.spanRows is not supported with suppressRowTransform.":i?n?"colDef.spanRows is not supported with rowDragEntireRow.":r?"colDef.spanRows is not supported with enableCellTextSelection.":null:"colDef.spanRows requires enableCellSpan to be enabled."},groupHierarchy:{validate(e,{groupHierarchyConfig:t={}},o){const s=/* @__PURE__ */new Set(["year","quarter","month","formattedMonth","day","hour","minute","second"]),i=[];for(const n of e.groupHierarchy??[])"object"!=typeof n?s.has(n)||n in t||i.push(nh(n)):o.validation?.validateColDef(n);return i.length>0?`The following parts of colDef.groupHierarchy are not recognised: ${i.join(", ")}.\nChoose one of ${[...s].map(nh).join(", ")}, or define your own parts in gridOptions.groupHierarchyConfig.`:null}}}})}processOptions(e,t){const{validations:o,deprecations:s,allProperties:i,propertyExceptions:n,objectName:r,docsUrl:a}=t;i&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...n??[],...Object.keys(s)],i,r,a);const l=/* @__PURE__ */new Set;if(Object.keys(e).forEach(t=>{const i=s[t];if(i){const{message:e,version:o}=i;l.add(`As of v${o}, ${String(t)} is deprecated. ${e??""}`)}const n=e[t];if(null==n||!1===n)return;const r=o[t];if(!r)return;const{dependencies:a,validate:d,supportedRowModels:c,expectedType:h}=r;if(h){const e=typeof n;if(e!==h)return void l.add(`${String(t)} should be of type '${h}' but received '${e}' (${n}).`)}if(c){const e=this.gridOptions.rowModelType??"clientSide";if(!c.includes(e))return void l.add(`${String(t)} is not supported with the '${e}' row model. It is only valid with: ${c.join(", ")}.`)}if(a){const o=this.checkForRequiredDependencies(t,a,e);if(o)return void l.add(o)}if(d){const t=d(e,this.gridOptions,this.beans);if(t)return void l.add(t)}}),l.size>0)for(const d of l)nt(d)}checkForRequiredDependencies(e,t,o){const s=Object.entries(t).filter(([e,t])=>{const s=o[e];return!t.required.includes(s)});return 0===s.length?null:s.map(([t,o])=>`'${String(e)}' requires '${t}' to be one of [${o.required.map(e=>null===e?"null":void 0===e?"undefined":e).join(", ")}]. ${o.reason??""}`).join("\n ")}checkProperties(e,t,o,s,i){const n=function(e,t,o){const s={},i=e.filter(e=>!t.some(t=>t===e));if(i.length>0)for(const n of i)s[n]=Wu({inputValue:n,allSuggestions:o}).values;return s}(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...o],o),r=Object.keys(n);for(const a of r){let e=`invalid ${s} property '${a}' did you mean any of these: ${n[a].slice(0,8).join(", ")}.`;o.includes("context")&&(e+=`\nIf you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),nt(e)}r.length>0&&i&&nt(`to see all the valid ${s} properties please check: ${this.beans.frameworkOverrides.getDocLink(i)}`)}}]},Pm=class extends We{constructor(){super(...arguments),this.dispatchColumnChangedEvent=Cs,this.columns=[],this.columnIndexMap={},this.updateIndexMap=()=>{this.columnIndexMap={},this.columns.forEach((e,t)=>this.columnIndexMap[e.getId()]=t)}}wireBeans(e){this.colModel=e.colModel,this.aggFuncSvc=e.aggFuncSvc,this.visibleCols=e.visibleCols,this.groupHierarchCols=e.groupHierarchyColSvc}sortColumns(e){const{groupHierarchCols:t}=this;this.columns.sort((o,s)=>t?.compareVirtualColumns(o,s)??e(o,s)),this.updateIndexMap()}setColumns(e,t){this.setColList(e,this.columns,this.eventName,!0,!0,this.columnProcessors.set,t)}addColumns(e,t){this.updateColList(e,this.columns,!0,!0,this.columnProcessors.add,this.eventName,t)}removeColumns(e,t){this.updateColList(e,this.columns,!1,!0,this.columnProcessors.remove,this.eventName,t)}getColumnIndex(e){return this.columnIndexMap[e]}setColList(e=[],t,o,s,i,n,r){const a=this.colModel.getCols();if(!a||0===a.length)return;const l=/* @__PURE__ */new Map;t.forEach((e,t)=>l.set(e,t)),t.length=0;for(const c of e){const e=this.colModel.getColDefCol(c);e&&t.push(e)}t.forEach((e,t)=>{const o=l.get(e);void 0!==o?s&&o!==t||l.delete(e):l.set(e,0)}),this.updateIndexMap();const d=this.colModel.getColDefCols();for(const c of d??[])n(c,t.indexOf(c)>=0,r);i&&this.colModel.refreshCols(!1,r),this.visibleCols.refresh(r),this.dispatchColumnChangedEvent(this.eventSvc,o,[...l.keys()],r)}updateColList(e=[],t,o,i,n,r,a){if(!e||0===e.length)return;let l=!1;const d=/* @__PURE__ */new Set;for(const h of e){if(!h)continue;const e=this.colModel.getColDefCol(h);if(e){if(d.add(e),o){if(t.indexOf(e)>=0)continue;t.push(e)}else{const o=t.indexOf(e);if(o<0)continue;for(let e=o+1;e=0:e?void 0!==h?h:!!(void 0!==g)&&(null!=g&&g>=0):o.indexOf(m)>=0,p&&((e?null!=u||null!=g:null!=u)?s.push(m):i.push(m))}const h=e=>{const t=e.getColDef();return r(t)??a(t)};s.sort((e,t)=>h(e)-h(t));const u=[],g=this.groupHierarchCols,p=e=>{g?g.expandColumnInto(u,e):u.push(e)};s.forEach(p);for(const m of o)i.indexOf(m)>=0&&p(m);for(const m of i)u.indexOf(m)<0&&p(m);for(const m of o)u.indexOf(m)<0&&n(m,!1,e);for(const m of u)o.indexOf(m)<0&&n(m,!0,e);return this.columns=u,this.updateIndexMap(),this.columns}restoreColumnOrder(e,t){const o=this.columns,s=this.colModel.getColDefCols();if(!o.length||!s)return e;const i=Object.keys(t),n=new Set(i),r=new Set(i),a=new Set(o.map(e=>{const t=e.getColId();return r.delete(t),t}).concat(i)),l=[],d={};let c=0;for(let w=0;w{const o=d[e];for(let s=g;s>>32-i,o)}ff(e,t,o,s,i,n,r){return this.cmn(t&o|~t&s,e,t,i,n,r)}gg(e,t,o,s,i,n,r){return this.cmn(t&s|o&~s,e,t,i,n,r)}hh(e,t,o,s,i,n,r){return this.cmn(t^o^s,e,t,i,n,r)}ii(e,t,o,s,i,n,r){return this.cmn(o^(t|~s),e,t,i,n,r)}md51(e){const t=e.length,o=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(o,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s>2]|=e.charCodeAt(s)<<(s%4<<3);if(i[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(o,i),s=0;s<16;s++)i[s]=0;return i[14]=8*t,this.md5cycle(o,i),o}md5blk(e){const t=[];for(let o=0;o<64;o+=4)t[o>>2]=e.charCodeAt(o)+(e.charCodeAt(o+1)<<8)+(e.charCodeAt(o+2)<<16)+(e.charCodeAt(o+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let o="",s=0;for(;s<4;s++)o+=t[e>>8*s+4&15]+t[e>>8*s&15];return o}hex(e){for(let t=0;t>16)+(t>>16)+(o>>16)<<16|65535&o}},Im={"01":"GRID","02":"CHARTS","0102":"BOTH"},km="https://www.ag-grid.com/licensing/",Lm=class e{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new Am,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(e.licenseKey),o=`AG Grid ${"BOTH"===t.currentLicenseType?"and AG Charts ":""}Enterprise`,s=void 0===t.suppliedLicenseType?"":`AG ${"BOTH"===t.suppliedLicenseType?"Grid and AG Charts":"GRID"===t.suppliedLicenseType?"Grid":"Charts"} Enterprise`;if(t.missing)this.isWebsiteUrl()&&!this.isForceWatermark()||this.outputMissingLicenseKey(o);else if(t.expired){const i=e.getGridReleaseDate(),n=e.formatDate(i);this.outputExpiredKey(t.expiry,n,o,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,o,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,o,s)}static extractExpiry(t){const o=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt(e.decode(o),10))}static extractLicenseComponents(t){let o=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(o=o.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=o.length-32,i=o.substring(s),n=o.substring(0,s),[r,a,l]=e.extractBracketedInformation(o);return{md5:i,license:n,version:r,isTrial:a,type:l}}getLicenseDetails(t){const o=e.chartsLicenseManager?"BOTH":"GRID";if(!t?.length)return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:o};const s=e.getGridReleaseDate(),{md5:i,license:n,version:r,isTrial:a,type:l}=e.extractLicenseComponents(t);let d,c,h,u=i===this.md5.md5(n)&&!t.includes("For_Trialing_ag-Grid_Only"),g=null,p=!1;function m(){d=gg,r){case"legacy":case"2":a&&m();break;case"3":l?.length?(h=l,l!==Im["01"]&&l!==Im["0102"]||"BOTH"===o&&"BOTH"!==h?(u=!1,p=!0):a&&m()):u=!1}return u?{licenseKey:t,valid:u,expiry:e.formatDate(g),expired:c,version:r,isTrial:a,trialExpired:d,incorrectLicenseType:p,currentLicenseType:o,suppliedLicenseType:h}:{licenseKey:t,valid:u,incorrectLicenseType:p,currentLicenseType:o,suppliedLicenseType:h}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!!this.watermarkMessage?.length}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const{hostname:e=""}=(this.document.defaultView||window).location;return e}isForceWatermark(){const{pathname:e}=(this.document.defaultView||window).location;return!!e&&e.includes("forceWatermark")}isWebsiteUrl(){return null!==this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)}isLocalhost(){return null!==this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)}static formatDate(e){const t=e.getDate(),o=e.getMonth(),s=e.getFullYear();return t+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][o]+" "+s}static getGridReleaseDate(){return new Date(parseInt(e.decode(e.RELEASE_INFORMATION),10))}static decode(t){const o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s,i,n,r,a,l,d,c="",h=0;const u=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;h>4,i=(15&a)<<4|l>>2,n=(3&l)<<6|d,c+=String.fromCharCode(s),64!=l&&(c+=String.fromCharCode(i)),64!=d&&(c+=String.fromCharCode(n));return c=e.utf8_decode(c),c}static utf8_decode(e){e=e.replace(/rn/g,"n");let t="";for(let o=0;o127&&s<2048?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t}static setChartsLicenseManager(e){this.chartsLicenseManager=e,this.chartsLicenseManager?.setLicenseKey(this.licenseKey,!0)}static setLicenseKey(e){a(this.licenseKey)&&this.licenseKey!==e&&Rt(nt,291,void 0,!0,"AG Grid: License Key being set multiple times with different values. This can result in an incorrect license key being used."),this.licenseKey=e,this.chartsLicenseManager?.setLicenseKey(e,!0)}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const t=e.match(/\[(.*?)\]/g).map(e=>e.replace("[","").replace("]",""));if(!t||0===t.length)return["legacy",!1,void 0];const o=1===t.filter(e=>"TRIAL"===e).length,s=t.filter(e=>0===e.indexOf("v"))[0];return[s?s.replace("v",""):"legacy",o,Im[t.filter(e=>Im[e])[0]]]}centerPadAndOutput(e){const t=this.totalMessageLength-e.length;console.error(e.padStart(t/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,t="*",o=""){console.error(e.padEnd(this.totalMessageLength-o.length,t)+o)}outputInvalidLicenseKey(e,t,o){e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${o} only and does not cover you for ${t}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${km}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${km}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,t,o){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${o} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(e,t,o,s){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${o} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions${""==s?"":` of ${s}`} released before ${e}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${t}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};Lm.RELEASE_INFORMATION="MTc3MDgwOTgzNDk5MQ==";var Gm=Lm,Nm={tag:"div",cls:"ag-watermark",children:[{tag:"div",ref:"eLicenseTextRef",cls:"ag-watermark-text"}]},Bm={selector:"AG-WATERMARK",component:class extends ni{constructor(){super(Nm),this.eLicenseTextRef=null,this.registerCSS('.ag-watermark{bottom:20px;color:#9b9b9b;opacity:.7;position:absolute;transition:opacity 1s ease-out 3s}:where(.ag-ltr) .ag-watermark{right:25px}:where(.ag-rtl) .ag-watermark{left:25px}.ag-watermark:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDkiIGhlaWdodD0iMzYiIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyMDkgMzYiPjxwYXRoIGZpbGw9IiM5YjliOWIiIGQ9Ik0xOTIuOTkzIDIzLjY1OHYtNy45NDZoLTEzLjU0MWwtNy45NDcgNy45NDZ6TTIwOC4yNSAzLjk1aC0xNi45NzRsLTguMDEgNy45NDdoMjQuOTg0ek0xNjMuNjIyIDMxLjYwNWw0LjA2OS00LjA2OWgxMy43MzJ2Ny45NDdoLTE3LjgwMXoiLz48cGF0aCBmaWxsPSIjOWI5YjliIiBkPSJNMTY2LjYxIDE5Ljc4aDguNzczbDguMDEtNy45NDZIMTY2LjYxek0xNTcuMDExIDMxLjYwNWg2LjYxMWw3Ljg4My03Ljk0N2gtMTQuNDk0ek0xOTEuMjc2IDMuOTVsLTQuMDY4IDQuMDdIMTYxLjI3Vi4wNzJoMzAuMDA2ek0yMC44NCAzMC4yMDZIOC4zNzhsLTIuMTYyIDUuMzRILjc1TDEyLjI1NyA4LjU5Mmg0Ljc2OEwyOC41MyAzNS41NDZoLTUuNTN6bS0xLjcxNy00LjI2TDE0LjYwOSAxNC45NWwtNC41MTQgMTAuOTk4ek0xMDQuNDM3IDE4LjUwOWMxLjU4OS0yLjM1MiA1LjU5NC0yLjYwNyA3LjI0Ny0yLjYwN3Y0LjU3OGMtMi4wMzQgMC00LjA2OS4wNjMtNS4yNzcuOTUzLTEuMjA3Ljg5LTEuODQzIDIuMDk4LTEuODQzIDMuNTZ2MTAuNTUzaC00Ljk1OVYxNS45MDJoNC43Njh6TTExOS4zNzYgMTUuOTAyaC00Ljk1OHYxOS42NDRoNC45NTh6TTExOS4zNzYgNy4xM2gtNC45NTh2NS44NDhoNC45NTh6TTE0My45NzkgNy4xM3YyOC40MTZoLTQuNzY4bC0uMTI3LTIuOTg4YTguMyA4LjMgMCAwIDEtMi42NyAyLjQ4Yy0xLjA4MS41NzItMi40MTYuODktMy45NDIuODktMS4zMzUgMC0yLjYwNi0uMjU1LTMuNjg3LS43LTEuMTQ0LS41MDgtMi4xNjItMS4xNDQtMi45ODgtMi4wMzRhOS42IDkuNiAwIDAgMS0xLjk3MS0zLjE3OWMtLjUwOC0xLjIwNy0uNjk5LTIuNjA2LS42OTktNC4xMzJzLjI1NC0yLjkyNC42OTktNC4xOTZjLjUwOS0xLjI3MSAxLjE0NS0yLjM1MiAxLjk3MS0zLjI0MnMxLjg0NC0xLjU4OSAyLjk4OC0yLjA5OCAyLjM1Mi0uNzYzIDMuNjg3LS43NjNjMS41MjYgMCAyLjc5Ny4yNTUgMy44NzguODI3czEuOTcxIDEuMzM1IDIuNjcgMi40MTZWNy4xOTNoNC45NTl6bS0xMC40MjYgMjQuNTM4YzEuNjUzIDAgMi45MjQtLjU3MiAzLjk0MS0xLjY1M3MxLjUyNi0yLjU0MyAxLjUyNi00LjMyMy0uNTA5LTMuMTc4LTEuNTI2LTQuMzIyYy0xLjAxNy0xLjA4MS0yLjI4OC0xLjY1My0zLjk0MS0xLjY1My0xLjU5IDAtMi45MjUuNTcyLTMuODc4IDEuNjUzLTEuMDE3IDEuMDgtMS41MjYgMi41NDMtMS41MjYgNC4zMjIgMCAxLjc4LjUwOSAzLjE4IDEuNTI2IDQuMjYgMS4wMTcgMS4xNDQgMi4yODggMS43MTYgMy44NzggMS43MTZNNTcuMjAyIDIwLjM1M0g0NC45MzN2NC4yNTloNi45OTNjLS4xOSAyLjE2MS0xLjAxNyAzLjgxNC0yLjQxNiA1LjE1LTEuMzk4IDEuMjctMy4xNzggMS45MDYtNS40NjcgMS45MDYtMS4yNzEgMC0yLjQ4LS4yNTQtMy40OTYtLjY5OWE3IDcgMCAwIDEtMi43MzQtMS45N2MtLjc2My0uODI3LTEuMzM1LTEuODQ0LTEuNzgtMy4wNTJzLS42MzYtMi40OC0uNjM2LTMuOTQyLjE5LTIuNzMzLjYzNi0zLjk0MWMuMzgxLTEuMjA4IDEuMDE3LTIuMTYyIDEuNzgtMy4wNTIuNzYzLS44MjYgMS42NTMtMS40NjIgMi43MzMtMS45N2E5LjEgOS4xIDAgMCAxIDMuNTYtLjdxNC4wMDUgMCA2LjEwMyAxLjkwN2wzLjMwNi0zLjMwNWMtMi40OC0xLjkwNy01LjY1OC0yLjkyNS05LjQwOS0yLjkyNS0yLjA5NyAwLTQuMDA0LjMxOC01LjcyMSAxLjAxOC0xLjcxNi42OTktMy4xNzkgMS41ODktNC4zODYgMi43OTdBMTIuMSAxMi4xIDAgMCAwIDMxLjIgMTYuMjJjLS42MzUgMS43MTctLjk1MyAzLjYyNC0uOTUzIDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1NyAxLjAxNyAyLjAzNSAwIDMuODc4LS4zMTggNS41MzEtMS4wMTcgMS42NTMtLjcgMy4wNTItMS41OSA0LjE5Ni0yLjc5N3ExLjcxNi0xLjgxMiAyLjY3LTQuMzg3Yy42MzYtMS43MTYuOTU0LTMuNjIzLjk1NC01LjY1OHYtLjgyNmMtLjE5MS0uMTI3LS4yNTUtLjQ0NS0uMjU1LS43TTk1Ljk4MiAyMC4zNTNoLTEyLjI3djQuMjU5aDYuOTkzYy0uMTkgMi4xNjEtMS4wMTcgMy44MTQtMi40MTYgNS4xNS0xLjM5OCAxLjI3LTMuMTc4IDEuOTA2LTUuNDY3IDEuOTA2LTEuMjcxIDAtMi40OC0uMjU0LTMuNDk2LS42OTlhNyA3IDAgMCAxLTIuNzM0LTEuOTdjLS43NjMtLjgyNy0xLjMzNS0xLjg0NC0xLjc4LTMuMDUycy0uNjM2LTIuNDgtLjYzNi0zLjk0Mi4xOS0yLjczMy42MzYtMy45NDFjLjM4MS0xLjIwOCAxLjAxNy0yLjE2MiAxLjc4LTMuMDUyLjc2My0uODI2IDEuNjUzLTEuNDYyIDIuNzM0LTEuOTdhOS4xIDkuMSAwIDAgMSAzLjU2LS43cTQuMDA1IDAgNi4xMDMgMS45MDdsMy4zMDUtMy4zMDVjLTIuNDc5LTEuOTA3LTUuNjU4LTIuOTI1LTkuNDA4LTIuOTI1LTIuMDk4IDAtNC4wMDUuMzE4LTUuNzIyIDEuMDE4LTEuNzE2LjY5OS0zLjE3OCAxLjU4OS00LjM4NiAyLjc5N2ExMi4xIDEyLjEgMCAwIDAtMi43OTcgNC4zODZjLS42MzYgMS43MTctLjk1NCAzLjYyNC0uOTU0IDUuNjU4cy4zMTggMy45NDIgMS4wMTcgNS42NThjLjcgMS43MTcgMS41OSAzLjE3OSAyLjc5NyA0LjM4N2ExMi4xIDEyLjEgMCAwIDAgNC4zODcgMi43OTdjMS43MTYuNyAzLjYyMyAxLjAxNyA1LjY1OCAxLjAxNyAyLjAzNCAwIDMuODc4LS4zMTggNS41My0xLjAxNyAxLjY1My0uNyAzLjA1Mi0xLjU5IDQuMTk2LTIuNzk3cTEuNzE4LTEuODEyIDIuNjctNC4zODdjLjYzNi0xLjcxNi45NTQtMy42MjMuOTU0LTUuNjU4di0uODI2Yy0uMTktLjEyNy0uMjU1LS40NDUtLjI1NS0uNyIvPjwvc3ZnPg==");background-repeat:no-repeat;background-size:170px 40px;content:"";display:block;height:40px;width:170px}.ag-watermark-text{font-family:Impact,sans-serif;font-size:19px;font-weight:700;opacity:.5}:where(.ag-ltr) .ag-watermark-text{padding-left:.7rem}:where(.ag-rtl) .ag-watermark-text{padding-right:.7rem}')}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.textContent=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCss("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}}},Hm=class extends We{constructor(){super(...arguments),this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){this.licenseManager=new Gm(b(this.beans)),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new Gm(null).getLicenseDetails(e)}getWatermarkSelector(){return Bm}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){Gm.setLicenseKey(e)}static setChartsLicenseManager(e){Gm.setChartsLicenseManager(e)}},Om={0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10,"0.00E+00":11,"# ?/?":12,"# ??/??":13,"mm-dd-yy":14,"d-mmm-yy":15,"d-mmm":16,"mmm-yy":17,"h:mm AM/PM":18,"h:mm:ss AM/PM":19,"h:mm":20,"h:mm:ss":21,"m/d/yy h:mm":22,"#,##0 ;(#,##0)":37,"#,##0 ;[Red](#,##0)":38,"#,##0.00;(#,##0.00)":39,"#,##0.00;[Red](#,##0.00)":40,"mm:ss":45,"[h]:mm:ss":46,"mmss.0":47,"##0.0E+0":48,"@":49},Vm="\r\n";function zm(e,t,o){if(!t&&""!==t&&0!==t)return"";let s=t;return"boolean"==typeof t&&o&&(s=o(t)),` ${e}="${s}"`}function Wm(e,t){let o="";if(e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(e=>{for(const s of Object.keys(e.map))o+=zm(e.prefix+s,e.map[s],t)}),e.properties.rawMap))for(const i of Object.keys(e.properties.rawMap))o+=zm(i,e.properties.rawMap[i],t);let s="<"+e.name+o;if(!e.children&&null==e.textNode)return s+"/>"+Vm;if(null!=e.textNode)return s+">"+e.textNode+""+Vm;if(s+=">\r\n",e.children)for(const i of e.children)s+=Wm(i,t);return s+""+Vm}var Um=e=>Math.round(96*e/72),$m=e=>Math.ceil(9525*e),jm=(e,t)=>{if(!t)return;let o;return o="number"==typeof t?t:t({rowIndex:e}),o},Km=(e,t)=>{const o=function(e={}){const t=["version"];return e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone"),``${t}="${e[t]}"`).join(" ")} ?>`}({encoding:"UTF-8",standalone:"yes"}),s=Wm(e);return t?s:`${o}${s}`},_m=e=>{const t=String.fromCharCode,o=Math.floor(e/26),s=e%26;return o&&26!==e?s?o<26?t(65+o-1)+t(65+s-1):_m(o)+t(65+s-1):_m(o-1)+"Z":t(65+e-1)},qm=e=>e.replaceAll("\n","_x000a_"),Ym=e=>{if(null==e)return null;let t="";for(let o=0;o=0&&s<=31&&10!==s){t+=`_x${s.toString(16).toUpperCase().padStart(4,"0")}_`}else t+=e[o]}return t},Zm=e=>{const t=[];for(const o of e.keys()){const e=o.toString(),s={name:"t",textNode:f(Ym(e))};e.trim().length!==e.length&&(s.properties={rawMap:{"xml:space":"preserve"}}),t.push({name:"si",children:[s]})}return t},Qm=class extends Ag{constructor(e){super(e),this.mixedStyles={},this.mixedStyleCounter=0,this.rows=[],this.frozenRowCount=0,this.skipFrozenRows=!1,this.frozenColumnCount=0,this.skipFrozenColumns=!1,this.formulaSvc=e.formulaSvc,this.config=Object.assign({},e),this.workbook=e.workbook,this.stylesByIds={};for(const o of this.config.baseExcelStyles)this.stylesByIds[o.id]=o;const t={id:"_quotePrefix",quotePrefix:1};this.stylesByIds[t.id]=t,this.excelStyles=[...this.config.baseExcelStyles,t]}addCustomContent(e){for(const t of e){const e=this.rows.length+1;let o;this.config.suppressRowOutline||null==t.outlineLevel||(o=t.outlineLevel);const s={height:jm(e,t.height||this.config.rowHeight),cells:(t.cells||[]).map((t,o)=>{const s=this.addImage(e,this.columnsToExport[o],t.data?.value);let i=null;t.styleId&&(i="string"==typeof t.styleId?[t.styleId]:t.styleId);const n=this.getStyleId(i);if(s)return this.createCell(n,this.getDataTypeForValue(s.value),null==s.value?"":s.value);const r=t.data?.value??"",a=this.getDataTypeForValue(r);return t.mergeAcross?this.createMergedCell(n,a,r,t.mergeAcross):this.createCell(n,a,r)}),outlineLevel:o};null!=t.collapsed&&(s.collapsed=t.collapsed),null!=t.hidden&&(s.hidden=t.hidden),this.rows.push(s)}}onNewHeaderGroupingRow(){const e=[],{freezeRows:t,headerRowHeight:o}=this.config;return this.rows.push({cells:e,height:jm(this.rows.length+1,o)}),t&&this.frozenRowCount++,{onColumn:(t,o,s,i,n)=>{const r=this.config.styleLinker({rowType:"HEADER_GROUPING",rowIndex:1,value:`grouping-${o}`,columnGroup:t});e.push({...this.createMergedCell(this.getStyleId(r),this.getDataTypeForValue("string"),o,i),collapsibleRanges:n})}}}onNewHeaderRow(){const{freezeRows:e,headerRowHeight:t}=this.config;return e&&this.frozenRowCount++,this.onNewRow(this.onNewHeaderColumn,t)}onNewBodyRow(e){const{freezeRows:t,rowHeight:o}=this.config;this.skipFrozenRows||("headersAndPinnedRows"===t&&"top"===e?.rowPinned||"function"==typeof t&&t(wo(this.gos,{node:e}))?this.frozenRowCount++:this.skipFrozenRows=!0);const s=this.onNewRow(this.onNewBodyColumn,o);return e&&this.addRowOutlineIfNecessary(e),s}prepare(e){super.prepare(e),this.columnsToExport=[...e],this.cols=e.map((e,t)=>this.convertColumnToExcel(e,t))}parse(){const e=this.rows.reduce((e,t)=>Math.max(e,t.cells.length),0);for(;this.cols.length{const s=this.extractHeaderValue(o),i=this.config.styleLinker({rowType:"HEADER",rowIndex:e,value:s,column:o});t.push(this.createCell(this.getStyleId(i),this.getDataTypeForValue("string"),s))}}onNewBodyColumn(e,t){let o=0;const{freezeColumns:s,rightToLeft:i}=this.config;return(n,r,a)=>{if(o>0)return void(o-=1);if(!this.skipFrozenColumns){const e=n.getPinned();"pinned"===s&&e&&(!0===e||"left"===e)!==i||"function"==typeof s&&s(wo(this.gos,{column:n}))?this.frozenColumnCount++:this.skipFrozenColumns=!0}const{value:l,valueFormatted:d}=this.extractRowCellValue({column:n,node:a,currentColumnIndex:r,accumulatedRowIndex:e,type:"excel",useRawFormula:!0}),c=l,h="bigint"==typeof c?c.toString():c,u=this.config.styleLinker({rowType:"BODY",rowIndex:e,value:c,column:n,node:a}),g=this.getStyleId(u),p=n.getColSpan(a),m=this.addImage(e,n,h);if(m)t.push(this.createCell(g,this.getDataTypeForValue(m.value),null==m.value?"":m.value));else if(p>1)o=p-1,t.push(this.createMergedCell(g,this.getDataTypeForValue(c),h,p-1));else{const o=n.isAllowFormula()&&this.formulaSvc?.isFormula(h),s=this.createCell(g,o?"f":this.getDataTypeForValue(c),o?this.formulaSvc?.updateFormulaByOffset({value:h,rowDelta:e-(a.formulaRowIndex+1),useRefFormat:!1}):h,d);t.push(s)}}}onNewRow(e,t){const o=[];return this.rows.push({cells:o,height:jm(this.rows.length+1,t)}),{onColumn:e.bind(this,this.rows.length,o)()}}addWorksheetToWorkbook(e){const{excelStyles:t,config:o}=this;return this.mapSharedStrings(e),this.frozenColumnCount&&(o.frozenColumnCount=this.frozenColumnCount),this.frozenRowCount&&(o.frozenRowCount=this.frozenRowCount),this.workbook.addWorksheet(t,e,o)}mapSharedStrings(e){let t;for(const o of e.table.rows)for(const e of o.cells){const o=e.data;if(!o||"s"!==o.type)continue;const s=o.value;null!=s&&(""!==s?o.value=this.workbook.getStringPosition(String(s)).toString():(t??(t=this.workbook.getStringPosition("").toString()),o.value=t))}}getDataTypeForValue(e){if(void 0===e)return"empty";let t="s";try{this.isNumerical(e)&&(t="n")}catch(o){}return t}getTypeFromStyle(e,t){if(this.isFormula(t))return"f";if(e?.dataType)switch(e.dataType.toLocaleLowerCase()){case"formula":return"f";case"string":return"s";case"number":return"n";case"datetime":return"d";case"error":return"e";case"boolean":return"b";default:Et(162,{id:e.id,dataType:e.dataType})}return null}addImage(e,t,o){if(!this.config.addImageToCell)return;const s=this.config.addImageToCell(e,t,o);return s?(this.workbook.addBodyImageToMap(s.image,e,t,this.columnsToExport,this.config.rowHeight),s):void 0}createCell(e,t,o,s){const i=this.getStyleById(e);i?.dataType||"s"!==t||null==s||(o=s);const n=this.getTypeFromStyle(i,o)||t,{value:r,escaped:a}=this.getCellValue(n,o),l=[];return i&&l.push(e),a&&l.push("_quotePrefix"),{styleId:e=this.getStyleId(l)||void 0,data:{type:n,value:r}}}createMergedCell(e,t,o,s){const i=null==o?"":o;return{styleId:this.getStyleById(e)?e:void 0,data:{type:t,value:"s"===t?String(i):o},mergeAcross:s}}getCellValue(e,t){let o=!1;if(null==t||"s"===e&&""===t)return{value:"",escaped:!1};if("s"===e)"'"===(t=String(t))[0]&&(o=!0,t=t.slice(1));else if("f"===e)t=this.addXlfnPrefix(t).slice(1);else if("n"===e){const e=Number(t);isNaN(e)?t="":""!==t&&(t=e.toString())}return{value:t,escaped:o}}addXlfnPrefix(e){return e?e.replace(/(^|[^A-Z0-9._])(CONCAT)(\s*\()/gi,(e,t,o,s)=>`${t}_xlfn.${o}${s}`):e}getStyleId(e){if(!e?.length)return null;const t=e.filter(e=>null!=this.stylesByIds[e]);if(!t.length)return null;if(1===t.length)return t[0];const o=t.join("-");return this.mixedStyles[o]||this.addNewMixedStyle(t),this.mixedStyles[o].excelID}addNewMixedStyle(e){this.mixedStyleCounter+=1;const t=`mixedStyle${this.mixedStyleCounter}`,o={};for(const i of e){const e=this.stylesByIds[i];e&&Xe(o,e,!0,!0)}o.id=t;const s=e.join("-");this.mixedStyles[s]={excelID:t,key:s,result:o},this.excelStyles.push(o),this.stylesByIds[t]=o}isFormula(e){if(null==e)return!1;const t=String(e);return this.config.autoConvertFormulas&&C(t)}isNumerical(e){return"bigint"!=typeof e&&(isFinite(e)&&""!==e&&!isNaN(parseFloat(e)))}getStyleById(e){return null==e?null:this.stylesByIds[e]||null}},Xm={getTemplate(e){const{name:t,ContentType:o,Extension:s,PartName:i}=e;return{name:t,properties:{rawMap:{Extension:s,PartName:i,ContentType:o}}}}},Jm=e=>"jpg"===e?"jpeg":e,ef={getTemplate({sheetLen:e,hasCustomProperties:t}){const o=new Array(e).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",PartName:`/xl/worksheets/sheet${t+1}.xml`})),s=ZC.size,i=QC.size,n={};XC.forEach(e=>{n[Jm(e.type)]=!0});const r=new Array(s).fill(void 0).map((e,t)=>({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.drawing+xml",PartName:`/xl/drawings/drawing${t+1}.xml`})),a=[];ev.forEach(({name:e})=>{a.push({name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",PartName:`/xl/tables/${e}.xml`})});const l=t?[{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",PartName:"/docProps/custom.xml"}]:[],d=Object.keys(n).map(e=>({name:"Default",ContentType:`image/${e}`,Extension:e}));return i&&d.push({name:"Default",Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}),{name:"Types",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"}},children:[...d,{name:"Default",Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"},{name:"Default",ContentType:"application/xml",Extension:"xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",PartName:"/xl/workbook.xml"},...o,{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml",PartName:"/xl/theme/theme1.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",PartName:"/xl/styles.xml"},{name:"Override",ContentType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",PartName:"/xl/sharedStrings.xml"},...r,...a,{name:"Override",ContentType:"application/vnd.openxmlformats-package.core-properties+xml",PartName:"/docProps/core.xml"},...l].map(e=>Xm.getTemplate(e))}}},tf={getTemplate(e){const t=/* @__PURE__ */(new Date).toJSON();return{name:"cp:coreProperties",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance"}}]},children:[{name:"dc:creator",textNode:e},{name:"dc:title",textNode:"Workbook"},{name:"dcterms:created",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:t},{name:"dcterms:modified",properties:{rawMap:{"xsi:type":"dcterms:W3CDTF"}},textNode:t}]}}},of=e=>Object.keys(e).filter(t=>t&&null!=e[t]).map((t,o)=>({name:"property",properties:{rawMap:{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:(o+2).toString(),name:f(t)??""}},children:[{name:"vt:lpwstr",textNode:f(Ym(String(e[t])))??""}]})),sf={getTemplate:e=>({name:"Properties",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}},children:of(e)})},nf=(e,t)=>({name:`xdr:${e}`,children:[{name:"xdr:col",textNode:t.col.toString()},{name:"xdr:colOff",textNode:t.offsetX.toString()},{name:"xdr:row",textNode:t.row.toString()},{name:"xdr:rowOff",textNode:t.offsetY.toString()}]}),rf=e=>{const t=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(e.recolor?.toLowerCase()){case"grayscale":case"sepia":case"washout":t.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:t}},af=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:null!=e.altText?e.altText:void 0}},children:[rf(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),lf=e=>{if(!e.saturation&&!e.tint)return;const t=[];return e.saturation&&t.push({name:"a:satMod",properties:{rawMap:{val:1e3*e.saturation}}}),e.tint&&t.push({name:"a:tint",properties:{rawMap:{val:1e3*e.tint}}}),t},df=(e,t)=>{let o;if(e.transparency){const t=Math.min(Math.max(e.transparency,0),100);o=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(1e3*t)}}}]}if(e.recolor)switch(o||(o=[]),e.recolor.toLocaleLowerCase()){case"grayscale":o.push({name:"a:grayscl"});break;case"sepia":o.push((i={color:"D9C3A5",tint:50,saturation:180},{name:"a:duotone",children:[{name:"a:prstClr",properties:{rawMap:{val:(s={color:"black"}).color}},children:lf(s)},{name:"a:srgbClr",properties:{rawMap:{val:i.color}},children:lf(i)}]}));break;case"washout":o.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}})}var s,i;return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${t}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:o},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},cf=(e,t)=>{const o={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:t.width,cy:t.height}}}]};if(e.rotation){const t=e.rotation;o.properties={rawMap:{rot:6e4*Math.min(Math.max(t,0),360)}}}return{name:"xdr:spPr",children:[o,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},hf=(e,t,o,s)=>({name:"xdr:pic",children:[af(e,t+1),df(e,o+1),cf(e,s)]}),uf={getTemplate(e){const{sheetIndex:t}=e,o=ZC.get(t),s=JC.get(t);return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main","xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"}},children:o.map((e,t)=>{const o=(e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;const{position:t={},fitCell:o,width:s=0,height:i=0,totalHeight:n,totalWidth:r}=e,{offsetX:a=0,offsetY:l=0,row:d=1,rowSpan:c=1,column:h=1,colSpan:u=1}=t;return{from:{row:d-1,col:h-1,offsetX:$m(a),offsetY:$m(l)},to:{row:d-1+(o?1:c-1),col:h-1+(o?1:u-1),offsetX:$m(s+a),offsetY:$m(i+l)},height:$m(n||i),width:$m(r||s)}})(e);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[nf("from",o.from),nf("to",o.to),hf(e,t,s.get(e.id).index,o),{name:"xdr:clientData"}]}})}}},gf={getTemplate(e){const{Id:t,Type:o,Target:s}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:o,Target:s}}}}},pf={getTemplate:e=>({name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:e.map(e=>gf.getTemplate(e))})},mf={getTemplate:e=>({name:"sst",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",count:e.size,uniqueCount:e.size}},children:Zm(e)})},ff={None:"None",Dot:"Dotted",Dash:"Dashed",Double:"Double",DashDot:"DashDot",DashDotDot:"DashDotDot",SlantDashDot:"SlantDashDot",Continuous:"Continuous"},Cf=["Dashed","DashDot","DashDotDot"],vf={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinDiagStripe:"lightUp",ThinHorzCross:"lightGrid",ThinDiagCross:"lightTrellis",Gray125:"gray125",Gray0625:"gray0625"},wf={Automatic:"general",Left:"left",Center:"center",Right:"right",Fill:"fill",Justify:"justify",CenterAcrossSelection:"centerContinuous",Distributed:"distributed",JustifyDistributed:"justify"},bf={Automatic:void 0,Top:"top",Bottom:"bottom",Center:"center",Justify:"justify",Distributed:"distributed",JustifyDistributed:"justify"},yf=e=>null==e?e:("#"===e.charAt(0)&&(e=e.substring(1)),6===e.length?"FF"+e:e),Sf=(e,t)=>{if(!e)return"thin";const o=(e=>{switch(e){case 1:return"thin";case 2:return"medium";case 3:return"thick";default:return"hair"}})(t);if("Continuous"===e)return o;const s=ff[e];return"medium"===o&&Cf.some(e=>e===s)?`medium${s}`:`${s.charAt(0).toLowerCase()}${s.substring(1)}`},Rf=e=>wf[e]||"general",xf=e=>bf[e]||void 0,Ff=e=>({name:"color",properties:{rawMap:{rgb:yf(e||"#000000")}}}),Df={getTemplate(e){const{left:t,right:o,top:s,bottom:i,diagonal:n}=e,r=t?[Ff(t.color)]:void 0,a=o?[Ff(o.color)]:void 0,l=s?[Ff(s.color)]:void 0,d=i?[Ff(i.color)]:void 0,c=n?[Ff(n.color)]:void 0;return{name:"border",children:[{name:"left",properties:{rawMap:{style:t?.style}},children:r},{name:"right",properties:{rawMap:{style:o?.style}},children:a},{name:"top",properties:{rawMap:{style:s?.style}},children:l},{name:"bottom",properties:{rawMap:{style:i?.style}},children:d},{name:"diagonal",properties:{rawMap:{style:n?.style}},children:c}]}}},Mf={getTemplate:e=>({name:"borders",properties:{rawMap:{count:e.length}},children:e.map(e=>Df.getTemplate(e))})},Pf=e=>{const t=["Context","LeftToRight","RightToLeft"].indexOf(e);return Math.max(t,0)},Ef={getTemplate(e){const{horizontal:t,indent:o,readingOrder:s,rotate:i,shrinkToFit:n,vertical:r,wrapText:a}=e;return{name:"alignment",properties:{rawMap:{horizontal:t&&Rf(t),indent:o,readingOrder:s&&Pf(s),textRotation:i,shrinkToFit:n,vertical:r&&xf(r),wrapText:a}}}}},Tf={getTemplate(e){const t=!1===e.protected?0:1;return{name:"protection",properties:{rawMap:{hidden:!0===e.hideFormula?1:0,locked:t}}}}},Af={getTemplate(e){const{alignment:t,borderId:o,fillId:s,fontId:i,numFmtId:n,protection:r,quotePrefix:a,xfId:l}=e,d=[];return t&&d.push(Ef.getTemplate(t)),r&&d.push(Tf.getTemplate(r)),{name:"xf",properties:{rawMap:{applyAlignment:t?1:void 0,applyProtection:r?1:void 0,applyBorder:o?1:void 0,applyFill:s?1:void 0,borderId:o,fillId:s,applyFont:i?1:void 0,fontId:i,applyNumberFormat:n?1:void 0,numFmtId:n,quotePrefix:a?1:void 0,xfId:l}},children:d.length?d:void 0}}},If={getTemplate:e=>({name:"cellStyleXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>Af.getTemplate(e))})},kf={getTemplate(e){const{builtinId:t,name:o,xfId:s}=e;return{name:"cellStyle",properties:{rawMap:{builtinId:t,name:o,xfId:s}}}}},Lf={getTemplate:e=>({name:"cellStyles",properties:{rawMap:{count:e.length}},children:e.map(e=>kf.getTemplate(e))})},Gf={getTemplate:e=>({name:"cellXfs",properties:{rawMap:{count:e.length}},children:e.map(e=>Af.getTemplate(e))})},Nf={getTemplate(e){const{patternType:t,fgTheme:o,fgTint:s,fgRgb:i,bgRgb:n,bgIndexed:r}=e,a={name:"patternFill",properties:{rawMap:{patternType:t}}};return(o||s||i)&&(a.children=[{name:"fgColor",properties:{rawMap:{theme:o,tint:s,rgb:i}}}]),(r||n)&&(a.children||(a.children=[]),a.children.push({name:"bgColor",properties:{rawMap:{indexed:r,rgb:n}}})),{name:"fill",children:[a]}}},Bf={getTemplate:e=>({name:"fills",properties:{rawMap:{count:e.length}},children:e.map(e=>Nf.getTemplate(e))})},Hf={getTemplate(e){const{size:t,colorTheme:o,color:s="FF000000",fontName:i="Calibri",family:n,scheme:r,italic:a,bold:l,strikeThrough:d,outline:c,shadow:h,underline:u,verticalAlign:g}=e,p=[{name:"sz",properties:{rawMap:{val:t}}},{name:"color",properties:{rawMap:{theme:o,rgb:s}}},{name:"name",properties:{rawMap:{val:i}}}];return n&&p.push({name:"family",properties:{rawMap:{val:n}}}),r&&p.push({name:"scheme",properties:{rawMap:{val:r}}}),a&&p.push({name:"i"}),l&&p.push({name:"b"}),d&&p.push({name:"strike"}),c&&p.push({name:"outline"}),h&&p.push({name:"shadow"}),u&&p.push({name:"u",properties:{rawMap:{val:u}}}),g&&p.push({name:"vertAlign",properties:{rawMap:{val:g}}}),{name:"font",children:p}}},Of={getTemplate:e=>({name:"fonts",properties:{rawMap:{count:e.length}},children:e.map(e=>Hf.getTemplate(e))})};var Vf,zf,Wf,Uf,$f,jf,Kf,_f,qf,Yf={getTemplate(e){let{formatCode:t,numFmtId:o}=e;return t.length&&(t=function(e){const t=e.split(/(\[[^\]]*\])/);for(let o=0;o({name:"numFmts",properties:{rawMap:{count:e.length}},children:e.map(e=>Yf.getTemplate(e))})},Qf=(e,t)=>(e.includes("mixedStyle")&&t>1&&(e+=`_${t}`),e),Xf=()=>{Vf={base:0},zf=[],Wf=[{fontName:"Calibri",colorTheme:"1",family:"2",scheme:"minor"}],Uf=[{patternType:"none"},{patternType:"gray125"}],$f=[{left:void 0,right:void 0,top:void 0,bottom:void 0,diagonal:void 0}],jf=[{borderId:0,fillId:0,fontId:0,numFmtId:0}],Kf=[{borderId:0,fillId:0,fontId:0,numFmtId:0,xfId:0}],_f=[{builtinId:0,name:"Normal",xfId:0}]},Jf=e=>{const t=(o=e.pattern)?vf[o]||o:"none";var o;const s=yf(e.color),i=yf(e.patternColor);let n=Uf.findIndex(e=>{const{patternType:o,fgRgb:n,bgRgb:r}=e;return!(o!=t||n!=s||r!=i)});return-1===n&&(n=Uf.length,Uf.push({patternType:t,fgRgb:s,bgRgb:i})),n},eC=e=>{const{fontName:t="Calibri",color:o,size:s,bold:i,italic:n,outline:r,shadow:a,strikeThrough:l,underline:d,family:c,verticalAlign:h}=e,u=yf(o),g=(e=>{if(void 0===e)return;const t=["Automatic","Roman","Swiss","Modern","Script","Decorative"].indexOf(e||"Automatic");return Math.max(t,0)})(c),p=d?d.toLocaleLowerCase():void 0,m=h?h.toLocaleLowerCase():void 0;let f=Wf.findIndex(e=>!(e.fontName!=t||e.color!=u||e.size!=s||e.bold!=i||e.italic!=n||e.outline!=r||e.shadow!=a||e.strikeThrough!=l||e.underline!=p||e.verticalAlign!=m||e.family!=g));return-1===f&&(f=Wf.length,Wf.push({fontName:t,color:u,size:s,bold:i,italic:n,outline:r,shadow:a,strikeThrough:l,underline:p,verticalAlign:m,family:null!=g?g.toString():void 0})),f},tC=e=>{const{alignment:t,borders:o,font:s,interior:i,numberFormat:n,protection:r,quotePrefix:a}=e;let{id:l}=e,d=0,c=0,h=0,u=0;l&&(l=Qf(l,qf),null==Vf[l]&&(i&&(d=Jf(i)),o&&(c=(e=>{const{borderBottom:t,borderTop:o,borderLeft:s,borderRight:i}=e;let n,r,a,l,d,c,h,u;s&&(a=Sf(s.lineStyle,s.weight),h=yf(s.color)),i&&(l=Sf(i.lineStyle,i.weight),u=yf(i.color)),t&&(n=Sf(t.lineStyle,t.weight),d=yf(t.color)),o&&(r=Sf(o.lineStyle,o.weight),c=yf(o.color));let g=$f.findIndex(e=>{const{left:t,right:o,top:s,bottom:i}=e;if(!t&&(a||h))return!1;if(!o&&(l||u))return!1;if(!s&&(r||c))return!1;if(!i&&(n||d))return!1;const{style:g,color:p}=t||{},{style:m,color:f}=o||{},{style:C,color:v}=s||{},{style:w,color:b}=i||{};return g==a&&p==h&&m==l&&f==u&&C==r&&v==c&&w==n&&b==d});return-1===g&&(g=$f.length,$f.push({left:{style:a,color:h},right:{style:l,color:u},top:{style:r,color:c},bottom:{style:n,color:d},diagonal:{style:void 0,color:void 0}})),g})(o)),s&&(h=eC(s)),n&&(u=(e=>{if(Om[e])return Om[e];let t=zf.findIndex(t=>t.formatCode===e);return-1===t?(t=zf.length+164,zf.push({formatCode:e,numFmtId:t})):t=zf[t].numFmtId,t})(n.format)),Vf[l]=Kf.length,Kf.push({alignment:t,borderId:c||0,fillId:d||0,fontId:h||0,numFmtId:u||0,protection:r,quotePrefix:a,xfId:0})))},oC=(e,t)=>Vf[Qf(e,t)]||0,sC={getTemplate(e){const t=Zf.getTemplate(zf),o=Of.getTemplate(Wf.map(t=>({...t,size:null!=t.size?t.size:e}))),s=Bf.getTemplate(Uf),i=Mf.getTemplate($f),n=If.getTemplate(jf),r=Gf.getTemplate(Kf),a=Lf.getTemplate(_f);return Xf(),{name:"styleSheet",properties:{rawMap:{"mc:Ignorable":"x14ac x16r2 xr",xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:x14ac":"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac","xmlns:x16r2":"http://schemas.microsoft.com/office/spreadsheetml/2015/02/main","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision"}},children:[t,o,s,i,n,r,a,{name:"tableStyles",properties:{rawMap:{count:0,defaultPivotStyle:"PivotStyleLight16",defaultTableStyle:"TableStyleMedium2"}}}]}}},iC={getTemplate(e,t){const{name:o,columns:s,rowRange:i,displayName:n,showRowStripes:r,showColumnStripes:a,showFilterButtons:l,highlightFirstColumn:d,highlightLastColumn:c}=e||{},h=!i||i[0]-i[1]===0;if(!e||!o||!Array.isArray(s)||!s.length||h)return{name:"table"};const u=s.map((e,t)=>({name:"filterColumn",properties:{rawMap:{colId:t.toString(),hiddenButton:l[t]?0:1}}})),g=`A${i[0]}:${_m(s.length)}${i[1]}`,p=`${t+1}`,m=t?`${n}_${p}`:n;return{name:"table",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"xr xr3","xmlns:xr":"http://schemas.microsoft.com/office/spreadsheetml/2014/revision","xmlns:xr3":"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3",name:m,displayName:m,ref:g,totalsRowShown:0,id:p}},children:[{name:"autoFilter",properties:{rawMap:{ref:g}},children:u},{name:"tableColumns",properties:{rawMap:{count:s.length}},children:s.map((e,t)=>({name:"tableColumn",properties:{rawMap:{id:(t+1).toString(),name:f(qm(e)),dataCellStyle:"Normal"}}}))},{name:"tableStyleInfo",properties:{rawMap:{name:"TableStyleLight1",showFirstColumn:d?1:0,showLastColumn:c?1:0,showRowStripes:r?1:0,showColumnStripes:a?1:0}}}]}}},nC=e=>{const[t,o,s,i]=e;return{name:`a:${t}`,children:[{name:`a:${o}`,properties:{rawMap:{val:s,lastClr:i}}}]}},rC={getTemplate:()=>({name:"a:clrScheme",properties:{rawMap:{name:"Office"}},children:[nC(["dk1","sysClr","windowText","000000"]),nC(["lt1","sysClr","window","FFFFFF"]),nC(["dk2","srgbClr","44546A"]),nC(["lt2","srgbClr","E7E6E6"]),nC(["accent1","srgbClr","4472C4"]),nC(["accent2","srgbClr","ED7D31"]),nC(["accent3","srgbClr","A5A5A5"]),nC(["accent4","srgbClr","FFC000"]),nC(["accent5","srgbClr","5B9BD5"]),nC(["accent6","srgbClr","70AD47"]),nC(["hlink","srgbClr","0563C1"]),nC(["folHlink","srgbClr","954F72"])]})},aC=e=>{const[t,o,s,i]=e;return{name:`a:${t}`,properties:{rawMap:{script:s,typeface:o,panose:i}}}},lC={getTemplate:()=>({name:"a:fontScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:majorFont",children:[aC(["latin","Calibri Light",void 0,"020F0302020204030204"]),aC(["ea",""]),aC(["cs",""]),aC(["font","游ゴシック Light","Jpan"]),aC(["font","맑은 κ³ λ”•","Hang"]),aC(["font","η­‰ηΊΏ Light","Hans"]),aC(["font","ζ–°η΄°ζ˜Žι«”","Hant"]),aC(["font","Times New Roman","Arab"]),aC(["font","Times New Roman","Hebr"]),aC(["font","Tahoma","Thai"]),aC(["font","Nyala","Ethi"]),aC(["font","Vrinda","Beng"]),aC(["font","Shruti","Gujr"]),aC(["font","MoolBoran","Khmr"]),aC(["font","Tunga","Knda"]),aC(["font","Raavi","Guru"]),aC(["font","Euphemia","Cans"]),aC(["font","Plantagenet Cherokee","Cher"]),aC(["font","Microsoft Yi Baiti","Yiii"]),aC(["font","Microsoft Himalaya","Tibt"]),aC(["font","MV Boli","Thaa"]),aC(["font","Mangal","Deva"]),aC(["font","Gautami","Telu"]),aC(["font","Latha","Taml"]),aC(["font","Estrangelo Edessa","Syrc"]),aC(["font","Kalinga","Orya"]),aC(["font","Kartika","Mlym"]),aC(["font","DokChampa","Laoo"]),aC(["font","Iskoola Pota","Sinh"]),aC(["font","Mongolian Baiti","Mong"]),aC(["font","Times New Roman","Viet"]),aC(["font","Microsoft Uighur","Uigh"]),aC(["font","Sylfaen","Geor"]),aC(["font","Arial","Armn"]),aC(["font","Leelawadee UI","Bugi"]),aC(["font","Microsoft JhengHei","Bopo"]),aC(["font","Javanese Text","Java"]),aC(["font","Segoe UI","Lisu"]),aC(["font","Myanmar Text","Mymr"]),aC(["font","Ebrima","Nkoo"]),aC(["font","Nirmala UI","Olck"]),aC(["font","Ebrima","Osma"]),aC(["font","Phagspa","Phag"]),aC(["font","Estrangelo Edessa","Syrn"]),aC(["font","Estrangelo Edessa","Syrj"]),aC(["font","Estrangelo Edessa","Syre"]),aC(["font","Nirmala UI","Sora"]),aC(["font","Microsoft Tai Le","Tale"]),aC(["font","Microsoft New Tai Lue","Talu"]),aC(["font","Ebrima","Tfng"])]},{name:"a:minorFont",children:[aC(["latin","Calibri",void 0,"020F0502020204030204"]),aC(["ea",""]),aC(["cs",""]),aC(["font","游ゴシック","Jpan"]),aC(["font","맑은 κ³ λ”•","Hang"]),aC(["font","η­‰ηΊΏ","Hans"]),aC(["font","ζ–°η΄°ζ˜Žι«”","Hant"]),aC(["font","Arial","Arab"]),aC(["font","Arial","Hebr"]),aC(["font","Tahoma","Thai"]),aC(["font","Nyala","Ethi"]),aC(["font","Vrinda","Beng"]),aC(["font","Shruti","Gujr"]),aC(["font","DaunPenh","Khmr"]),aC(["font","Tunga","Knda"]),aC(["font","Raavi","Guru"]),aC(["font","Euphemia","Cans"]),aC(["font","Plantagenet Cherokee","Cher"]),aC(["font","Microsoft Yi Baiti","Yiii"]),aC(["font","Microsoft Himalaya","Tibt"]),aC(["font","MV Boli","Thaa"]),aC(["font","Mangal","Deva"]),aC(["font","Gautami","Telu"]),aC(["font","Latha","Taml"]),aC(["font","Estrangelo Edessa","Syrc"]),aC(["font","Kalinga","Orya"]),aC(["font","Kartika","Mlym"]),aC(["font","DokChampa","Laoo"]),aC(["font","Iskoola Pota","Sinh"]),aC(["font","Mongolian Baiti","Mong"]),aC(["font","Arial","Viet"]),aC(["font","Microsoft Uighur","Uigh"]),aC(["font","Sylfaen","Geor"]),aC(["font","Arial","Armn"]),aC(["font","Leelawadee UI","Bugi"]),aC(["font","Microsoft JhengHei","Bopo"]),aC(["font","Javanese Text","Java"]),aC(["font","Segoe UI","Lisu"]),aC(["font","Myanmar Text","Mymr"]),aC(["font","Ebrima","Nkoo"]),aC(["font","Nirmala UI","Olck"]),aC(["font","Ebrima","Osma"]),aC(["font","Phagspa","Phag"]),aC(["font","Estrangelo Edessa","Syrn"]),aC(["font","Estrangelo Edessa","Syrj"]),aC(["font","Estrangelo Edessa","Syre"]),aC(["font","Nirmala UI","Sora"]),aC(["font","Microsoft Tai Le","Tale"]),aC(["font","Microsoft New Tai Lue","Talu"]),aC(["font","Ebrima","Tfng"])]}]})},dC=(e,t,o)=>({name:`a:${e}`,properties:{rawMap:{val:t}},children:o}),cC=e=>{const[t,o,s,i,n,r]=e,a=[];return a.push(dC("satMod",s)),i&&a.push(dC("lumMod",i)),n&&a.push(dC("tint",n)),r&&a.push(dC("shade",r)),{name:"a:gs",properties:{rawMap:{pos:t}},children:[{name:"a:schemeClr",properties:{rawMap:{val:o}},children:a}]}},hC=(e,t)=>({name:"a:solidFill",children:[dC("schemeClr",e,t)]}),uC=e=>{const[t,o,s,i,n]=e,[r,a]=n;return{name:"a:gradFill",properties:{rawMap:{rotWithShape:t}},children:[{name:"a:gsLst",children:[cC(o),cC(s),cC(i)]},{name:"a:lin",properties:{rawMap:{ang:r,scaled:a}}}]}},gC=e=>{const[t,o,s,i]=e;return{name:"a:ln",properties:{rawMap:{w:t,cap:o,cmpd:s,algn:i}},children:[hC("phClr"),dC("prstDash","solid"),{name:"a:miter",properties:{rawMap:{lim:"800000"}}}]}},pC=e=>{const t=[];if(e){const[o,s,i,n,r]=e;t.push({name:"a:outerShdw",properties:{rawMap:{blurRad:o,dist:s,dir:i,algn:n,rotWithShape:r}},children:[dC("srgbClr","000000",[dC("alpha","63000")])]})}return{name:"a:effectStyle",children:[Object.assign({},{name:"a:effectLst"},t.length?{children:t}:{})]}},mC={getTemplate:()=>({name:"a:fmtScheme",properties:{rawMap:{name:"Office"}},children:[{name:"a:fillStyleLst",children:[hC("phClr"),uC(["1",["0","phClr","105000","110000","67000"],["50000","phClr","103000","105000","73000"],["100000","phClr","109000","105000","81000"],["5400000","0"]]),uC(["1",["0","phClr","103000","102000","94000"],["50000","phClr","110000","100000",void 0,"100000"],["100000","phClr","120000","99000",void 0,"78000"],["5400000","0"]])]},{name:"a:lnStyleLst",children:[gC(["6350","flat","sng","ctr"]),gC(["12700","flat","sng","ctr"]),gC(["19050","flat","sng","ctr"])]},{name:"a:effectStyleLst",children:[pC(),pC(),pC(["57150","19050","5400000","ctr","0"])]},{name:"a:bgFillStyleLst",children:[hC("phClr"),hC("phClr",[dC("tint","95000"),dC("satMod","170000")]),uC(["1",["0","phClr","150000","102000","93000","98000"],["50000","phClr","130000","103000","98000","90000"],["100000","phClr","120000",void 0,void 0,"63000"],["5400000","0"]])]}]})},fC={getTemplate:()=>({name:"a:themeElements",children:[rC.getTemplate(),lC.getTemplate(),mC.getTemplate()]})},CC={getTemplate:()=>({name:"a:theme",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{a:"http://schemas.openxmlformats.org/drawingml/2006/main"}}],rawMap:{name:"Office Theme"}},children:[fC.getTemplate(),{name:"a:objectDefaults"},{name:"a:extraClrSchemeLst"}]})},vC=e=>{const{aspectratio:t,rotation:o}=e||{},s={};return t&&(s.aspectratio="t"),o&&(s.rotation="t"),{name:"o:lock",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:s}}};var wC=(e,t)=>{let o;const{recolor:s,brightness:i,contrast:n,id:r}=e;if(s&&(o={},"Washout"!==s&&"Grayscale"!==s||(o.gain="19661f",o.blacklevel="22938f"),"Black & White"!==s&&"Grayscale"!==s||(o.grayscale="t","Black & White"===s&&(o.bilevel="t"))),!s||"Grayscale"===s){if(o||(o={}),null!=n&&50!==n){let e="1";n>=0&&(n<50?e=String(n/50):n<100?e=String(50/(100-n)):100===n&&(e="2147483647f")),o.gain=e}null!=i&&50!==i&&(o.blacklevel=(a=i,l=0,d=100,c=-.5,h=.5,(a-l)/(d-l)*(h-c)+c).toString())}var a,l,d,c,h;return{name:"v:imagedata",properties:{prefixedAttributes:[{prefix:"o:",map:{relid:`rId${t}`,title:r}}],rawMap:o}}},bC=e=>Math.floor(.74999943307122*(e??0)),yC={getTemplate(e){const t=QC.get(e.sheetIndex)||[];return{name:"xml",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{v:"urn:schemas-microsoft-com:vml",o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel"}}]},children:[{name:"o:shapelayout",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}]},children:[{name:"o:idmap",properties:{prefixedAttributes:[{prefix:"v:",map:{ext:"edit"}}],rawMap:{data:"1"}}}]},{name:"v:shapetype",properties:{prefixedAttributes:[{prefix:"o:",map:{spt:"75",preferrelative:"t"}}],rawMap:{coordsize:"21600,21600",filled:"f",id:"_x0000_t75",path:"m@4@5l@4@11@9@11@9@5xe",stroked:"f"}},children:[{name:"v:stroke",properties:{rawMap:{joinstyle:"miter"}}},(o=["if lineDrawn pixelLineWidth 0","sum @0 1 0","sum 0 0 @1","prod @2 1 2","prod @3 21600 pixelWidth","prod @3 21600 pixelHeight","sum @0 0 1","prod @6 1 2","prod @7 21600 pixelWidth","sum @8 21600 0","prod @7 21600 pixelHeight","sum @10 21600 0"],{name:"v:formulas",children:o.map(e=>({name:"v:f",properties:{rawMap:{eqn:e}}}))}),{name:"v:path",properties:{prefixedAttributes:[{prefix:"o:",map:{connecttype:"rect",extrusionok:"f"}}],rawMap:{gradientshapeok:"t"}}},vC({aspectratio:!0})]},...t.map((e,t)=>((e,t)=>{const{width:o=0,height:s=0,altText:i}=e,n=bC(o),r=bC(s);return{name:"v:shape",properties:{rawMap:{id:e.headerFooterPosition,"o:spid":"_x0000_s1025",style:`position: absolute; margin-left: 0; margin-top: 10in; margin-bottom: 0; margin-right: 0; width: ${n}pt; height: ${r}pt; z-index: ${t+1}`,type:"#_x0000_t75",alt:i}},children:[wC(e,t+1),vC({rotation:!0})]}})(e,t))]};var o}},SC={getTemplate(e,t){const o=(t+1).toString();return{name:"sheet",properties:{rawMap:{name:e,sheetId:o,"r:id":`rId${o}`}}}}},RC={getTemplate:e=>({name:"sheets",children:e.map((e,t)=>SC.getTemplate(e,t))})},xC={getTemplate:(e,t)=>({name:"workbook",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:[{name:"bookViews",children:[{name:"workbookView",properties:{rawMap:{activeTab:t}}}]},RC.getTemplate(e)]})},FC={getTemplate(e){const{min:t,max:o,outlineLevel:s,s:i,width:n,hidden:r,bestFit:a}=e;let l=1,d="0";return n>1&&(l=(e=>Math.ceil((e-12)/7+1))(n),d="1"),{name:"col",properties:{rawMap:{min:t,max:o,outlineLevel:null!=s?s:void 0,width:l,style:i,hidden:r?"1":"0",bestFit:a?"1":"0",customWidth:d}}}}},DC={getTemplate:e=>({name:"mergeCell",properties:{rawMap:{ref:e}}})},MC={getTemplate(e,t,o){const{ref:s,data:i,styleId:n}=e,{type:r,value:a}=i||{type:"empty",value:null};let l=r;"f"===r?l="str":r.charAt(0)===r.charAt(0).toUpperCase()&&(l=(e=>{const t=e.charAt(0).toLowerCase();return"s"===t?"inlineStr":t})(r));const d={name:"c",properties:{rawMap:{r:s,t:"empty"===l?void 0:l,s:n?oC(n,o):void 0}}};if("empty"===l)return d;let c;return c="str"===l&&"f"===r?[{name:"f",textNode:f(Ym(a))}]:"inlineStr"===l?[{name:"is",children:[{name:"t",textNode:f(Ym(a))}]}]:[{name:"v",textNode:a}],Object.assign({},d,{children:c})}},PC=e=>""!==e.data?.value||void 0!==e.styleId,EC={getTemplate(e,t,o){const{collapsed:s,hidden:i,height:n,outlineLevel:r,cells:a=[]}=e;((e,t)=>{const o=[];let s=0;for(let i=0;i=0;i--){const s=[],n=e[o[i].pos];for(let e=1;e<=n.mergeAcross;e++)s.push({ref:`${_m(o[i].excelPos+1+e)}${t+1}`,styleId:n.styleId,data:{type:"empty",value:null}});s.length&&e.splice(o[i].pos+1,0,...s)}})(a,t);return{name:"row",properties:{rawMap:{r:t+1,collapsed:s?"1":"0",hidden:i?"1":"0",ht:n,customHeight:null!=n?"1":"0",spans:"1:1",outlineLevel:r||void 0}},children:a.filter(PC).map((e,t)=>MC.getTemplate(e,t,o))}}},TC=e=>{if(null==e)return 1;const t=["Letter","Letter Small","Tabloid","Ledger","Legal","Statement","Executive","A3","A4","A4 Small","A5","A6","B4","B5","Folio","Envelope","Envelope DL","Envelope C5","Envelope B5","Envelope C3","Envelope C4","Envelope C6","Envelope Monarch","Japanese Postcard","Japanese Double Postcard"].indexOf(e);return-1===t?1:t+1},AC=(e,t,o)=>e.reduce((e,s,i)=>{const n="Center"===(r=s.position)?"C":"Right"===r?"R":"L";var r;const a=(l=`${e}&${n}`,(d=s.font)?(l+="&"",l+=d.fontName||"Calibri",d.bold!==d.italic?l+=d.bold?",Bold":",Italic":d.bold?l+=",Bold Italic":l+=",Regular",l+=""",d.size&&(l+=`&${d.size}`),d.strikeThrough&&(l+="&S"),d.underline&&(l+="&"+("Double"===d.underline?"E":"U")),d.color&&(l+=`&K${d.color.replace("#","").toUpperCase()}`),l):l);var l,d;s.position||(s.position=["Left","Center","Right"][i]);const{image:c}=s;return"&[Picture]"===s.value&&c&&iv(c,`${n}${t}${o}`),`${a}${f((e=>{const t={"&[Page]":"&P","&[Pages]":"&N","&[Date]":"&D","&[Time]":"&T","&[Tab]":"&A","&[Path]":"&Z","&[File]":"&F","&[Picture]":"&G"};for(const o of Object.keys(t))e=e.replace(o,t[o]);return e})(s.value))}`},""),IC=e=>{const t=[];return["all","first","even"].forEach(o=>{const s=e[o],i="all"===o?"odd":o;if(s)for(const e of Object.keys(s)){const n=s[e],r=`${e.charAt(0).toUpperCase()}${e.slice(1)}`,a=e[0].toUpperCase();if(n){const e="all"===o?"":o.toUpperCase();t.push({name:`${i}${r}`,properties:{rawMap:{"xml:space":"preserve"}},textNode:AC(n,a,e)})}}}),t},kC=e=>t=>(e.length&&t.children.push({name:"cols",children:e.map(e=>FC.getTemplate(e))}),t),LC=(e,t)=>o=>(e.length&&o.children.push({name:"sheetData",children:e.map((e,o)=>EC.getTemplate(e,o,t))}),o),GC=e=>t=>{if(!e)return t;const o="boolean"==typeof e?{}:e,s={sheet:1},i=o.password?(e=>{const t=e.length;if(!t)return"";const o=new Array(t+1);o[0]=t;for(let i=1;i<=t;i++)o[i]=255&e.charCodeAt(i-1);let s=0;for(let i=o.length-1;i>=0;i--)s=((16384&s?1:0)|s<<1&32767)^o[i];return(52811^s).toString(16).toUpperCase().padStart(4,"0")})(o.password):"";i&&(s.password=i);const n={autoFilter:!1,deleteColumns:!1,deleteRows:!1,formatCells:!1,formatColumns:!1,formatRows:!1,insertColumns:!1,insertHyperlinks:!1,insertRows:!1,pivotTables:!1,selectLockedCells:!0,selectUnlockedCells:!0};return Object.keys(n).forEach(e=>{const t=o[e];null!=t&&t!==n[e]&&(s[e]=t?0:1)}),t.children.push({name:"sheetProtection",properties:{rawMap:s}}),t},NC=e=>t=>{const{top:o=.75,right:s=.7,bottom:i=.75,left:n=.7,header:r=.3,footer:a=.3}=e;return t.children.push({name:"pageMargins",properties:{rawMap:{bottom:i,footer:a,header:r,left:n,right:s,top:o}}}),t},BC=e=>t=>{var o;return e&&t.children.push({name:"pageSetup",properties:{rawMap:{horizontalDpi:0,verticalDpi:0,orientation:(o=e.orientation,!o||"Portrait"!==o&&"Landscape"!==o?"portrait":o.toLocaleLowerCase()),paperSize:TC(e.pageSize)}}}),t},HC=e=>t=>{if(!e)return t;const o=null!=e.first?1:0,s=null!=e.even?1:0;return t.children.push({name:"headerFooter",properties:{rawMap:{differentFirst:o,differentOddEven:s}},children:IC(e)}),t},OC=e=>t=>(ZC.get(e)?.length&&t.children.push({name:"drawing",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t),VC=e=>t=>(QC.get(e)&&t.children.push({name:"legacyDrawingHF",properties:{rawMap:{"r:id":"rId"+ ++t.rIdCounter}}}),t),zC=(e=0,t=0)=>{const o=e>0||t>0;return o?[{name:"pane",properties:{rawMap:{state:o?"frozen":void 0,topLeftCell:o?`${_m(e+1)}${t+1}`:void 0,xSplit:0===e?void 0:e,ySplit:0===t?void 0:t}}}]:void 0},WC=(e=!1,t,o)=>s=>(s.children.push({name:"sheetViews",children:[{name:"sheetView",properties:{rawMap:{rightToLeft:!0===e?"1":"0",workbookViewId:"0"}},children:zC(t,o)}]}),s),UC=e=>t=>{const o=e.reduce((e,t)=>t.outlineLevel&&t.outlineLevel>e?t.outlineLevel:e,0);return t.children.push({name:"sheetFormatPr",properties:{rawMap:{baseColWidth:10,defaultRowHeight:16,outlineLevelRow:o||void 0}}}),t},$C={getTemplate(e){const{worksheet:t,currentSheet:o,config:s}=e,{margins:i={},pageSetup:n,headerFooterConfig:r,suppressColumnOutline:a,rightToLeft:l,frozenRowCount:d,frozenColumnCount:c,protectSheet:h}=s,{table:u}=t,{rows:g,columns:p}=u,m=p?.length?((e,t,o)=>{const s=[],i=[];e.forEach((e,o)=>{const n=e.cells;let r,a=0;n.forEach((e,n)=>{const l=n+a+1,d=_m(l),c=o+1;if(e.mergeAcross){a+=e.mergeAcross;const t=_m(n+a+1);s.push(`${d}${c}:${t}${c}`)}t[l-1]||(t[l-1]={});const{collapsibleRanges:h}=e;h&&h.forEach(e=>{i.push([l+e[0],l+e[1]])}),r=t[l-1],r.min=l,r.max=l,e.ref=`${d}${c}`})}),i.sort((e,t)=>e[0]!==t[0]?e[0]-t[0]:t[1]-e[1]);const n=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map;return i.filter(e=>{const t=e.toString();return!n.get(t)&&(n.set(t,!0),!0)}).forEach(e=>{const s=t.find(t=>t.min==e[0]&&t.max==e[1]),i=r.get(e[0]);t.push({min:e[0],max:e[1],outlineLevel:o?void 0:i||1,width:(s||{width:100}).width}),r.set(e[0],(i||0)+1)}),s})(g,p,!!a):[],f=ev.get(o),{children:C}=[e=>(e.children.push({name:"sheetPr",children:[{name:"outlinePr",properties:{rawMap:{summaryBelow:0}}}]}),e),WC(l,c,d),UC(g),kC(p),LC(g,o+1),GC(h),(w=m,e=>(w.length&&e.children.push({name:"mergeCells",properties:{rawMap:{count:w.length}},children:w.map(e=>DC.getTemplate(e))}),e)),NC(i),BC(n),HC(r),OC(o),VC(o),(v=f,e=>(v&&e.children.push({name:"tableParts",properties:{rawMap:{count:"1"}},children:[{name:"tablePart",properties:{rawMap:{"r:id":"rId"+ ++e.rIdCounter}}}]}),e))].reduce((e,t)=>t(e),{children:[],rIdCounter:0});var v,w;return{name:"worksheet",properties:{prefixedAttributes:[{prefix:"xmlns:",map:{r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}}],rawMap:{xmlns:"http://schemas.openxmlformats.org/spreadsheetml/2006/main"}},children:C}}},jC=/* @__PURE__ */new Map,KC=[],_C=[],qC=/* @__PURE__ */new Map,YC=/* @__PURE__ */new Map,ZC=/* @__PURE__ */new Map,QC=/* @__PURE__ */new Map,XC=/* @__PURE__ */new Map,JC=/* @__PURE__ */new Map,ev=/* @__PURE__ */new Map,tv="AG-GRID-TABLE",ov="SINGLE_SHEET";function sv(e,t,o){!function(e){const t=f(e.name)||"";let o="";for(;-1!==KC.indexOf(`${t}${o}`);)o=""===o?"_1":`_${parseInt(o.slice(1),10)+1}`;e.name=`${t}${o}`,KC.push(e.name)}(t),((e,t)=>{1===(qf=t)&&Xf(),e.forEach(tC)})(e,KC.length);const s=Object.assign({},o);o.exportAsExcelTable&&o.pivotModeActive&&(Et(163,{featureName:"pivot mode"}),s.exportAsExcelTable=!1),function(e,t){const{exportAsExcelTable:o,prependContent:s,appendContent:i,headerRowCount:n=0}=t;if(!o)return;const{name:r,showColumnStripes:a,showRowStripes:l,showFilterButton:d,highlightFirstColumn:c,highlightLastColumn:h}="boolean"==typeof o?{}:o,u=function(e){return e.replace(/^[^a-zA-Z_]+/,"_").replace(/\s/g,"_").replace(/[^a-zA-Z0-9_]/g,"_")}(r||tv),g=KC.length-1,{table:p}=e,{rows:m,columns:f}=p,C=s?s.length:0,v=i?i.length:0,w=m.length,b=f.length,y=[],S=[];for(let R=0;Rt.id===e.id)||i.push(e)}function nv(e,t,o,s,i){const n=KC.length,{row:r,column:a}=e.position||{},l=e;s&&(null==t||null==o||r&&a||(e.position||(e.position={}),e.position=Object.assign({},e.position,{row:t,column:s.indexOf(o)+1})),((e,t)=>{const{colSpan:o,column:s}=e.position;if(e.width)if(o){const i=t.slice(s-1,s+o-1);let n=0;for(let t=0;t{const{rowSpan:o,row:s}=e.position;if(e.height)if(o){let i=0,n=0;for(let r=s;re.sheetId===o);e?e.image.push(t):s.push({sheetId:o,image:[t]})}else YC.set(t.id,[{sheetId:o,image:[t]}]),XC.set(t.id,{type:t.imageType,index:XC.size})}function av(e,t){return Km(iC.getTemplate(e,t))}function lv({drawingIndex:e,vmlDrawingIndex:t,tableName:o}={}){if(void 0===e&&void 0===t&&void 0===o)return"";const s=[];return null!=e&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`}),null!=t&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",Target:`../drawings/vmlDrawing${t+1}.vml`}),null!=o&&s.push({Id:`rId${s.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:`../tables/${o}.xml`}),Km(pf.getTemplate(s))}var dv=(e,t)=>{if(!e.size)return;const o=/* @__PURE__ */new Map;t.forEach((t,s)=>{e.has(t)&&o.set(s,e.get(t))}),e.clear(),o.forEach((t,o)=>e.set(o,t))},cv=e=>{const t=qC.get(e)??[];t.push(KC.length-1),qC.set(e,t),_C.push(e)},hv=e=>{if(e.length<=1)return;const t=(e=>{const t=new Map(qC),o=[];for(const s of e){const e=t.get(s);if(!e?.length)return null;const i=e.shift();o.push(i),t.set(s,e)}return o})(e)??(e=>{if(!e.length||0===_C.length)return null;const t=/* @__PURE__ */new Set,o=[];for(const s of e){const e=_C.findIndex((e,o)=>!t.has(o)&&e===s);if(-1===e)return null;t.add(e),o.push(e)}return o})(e);t&&(e=>{const t=/* @__PURE__ */new Map;e.forEach((e,o)=>t.set(e,o)),KC=e.map(e=>KC[e]),_C=e.map(e=>_C[e]),dv(ZC,e),dv(QC,e),dv(ev,e),dv(JC,e),YC.forEach(e=>{e.forEach(e=>{const o=t.get(e.sheetId);null!=o&&(e.sheetId=o)})}),qC=/* @__PURE__ */new Map,_C.forEach((e,t)=>{const o=qC.get(e)??[];o.push(t),qC.set(e,o)})})(t)},uv=class{getStringPosition(e){return function(e){return jC.has(e)?jC.get(e):(jC.set(e,jC.size),jC.size-1)}(e)}addBodyImageToMap(e,t,o,s,i){nv(e,t,o,s,i)}addHeaderFooterImageToMap(e,t){iv(e,t)}addWorksheet(e,t,o){return sv(e,t,o)}syncOrderWithSheetData(e){hv(e)}reset(){jC.clear(),YC.clear(),ZC.clear(),QC.clear(),XC.clear(),JC.clear(),ev.clear(),KC=[],_C=[],qC=/* @__PURE__ */new Map,ov="SINGLE_SHEET"}setFactoryMode(e){!function(e){ov=e}(e)}getFactoryMode(){return ov}getSheetNames(){return[...KC]}},gv=async e=>{const{size:t,content:o}=await(async e=>{let t=0;const o=[],s=new WritableStream({write:e=>{o.push(e),t+=e.length}}),i=new ReadableStream({start:t=>{const o=new FileReader;o.onload=e=>{e.target?.result&&t.enqueue(e.target.result),t.close()},o.readAsArrayBuffer(e)}}),n=new window.CompressionStream("deflate-raw");return await i.pipeThrough(n).pipeTo(s),{size:t,content:new Blob(o)}})(new Blob([e]));return{size:t,content:new Uint8Array(await o.arrayBuffer())}};function pv(e,t){let o="";for(let s=0;s>>=8;return o}var mv=e=>{if(!e.length)return 0;let t=-1,o=0,s=0,i=0;for(let n=0;n>>8^i;return-1^t},fv=e=>e.length?mv("string"==typeof e?(new TextEncoder).encode(e):e):0,Cv=/* @__PURE__ */new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function vv(e){const t=String.fromCharCode;function o(e,o){return t(e>>o&63|128)}function s(e){if(!(4294967168&e))return t(e);let s="";return 4294965248&e?4294901760&e?4292870144&e||(s=t(e>>18&7|240),s+=o(e,12),s+=o(e,6)):(!function(e){if(e>=55296&&e<=57343)throw new Error(It(255,{point:e}))}(e),s=t(e>>12&15|224),s+=o(e,6)):s=t(e>>6&31|192),s+=t(63&e|128),s}const i=function(e){const t=[];if(!e)return[];const o=e.length;let s,i,n=0;for(;n=55296&&s<=56319&&n{const{content:r,path:a,created:l}=e,d=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(l),c=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(l),h=fv(i),u=void 0!==n?n:s,g=vv(a),p=g!==a;let m="";if(p){const e=pv(1,1)+pv(fv(g),4)+g;m="up"+pv(e.length,2)+e}const f="\0"+(p?"\0\b":"\0\0")+pv(t?8:0,2)+pv(d,2)+pv(c,2)+pv(u?h:0,4)+pv(n??s,4)+pv(s,4)+pv(g.length,2)+pv(m.length,2),C="PK"+f+g+m,v="PK\0"+f+"\0\0\0\0\0\0"+(r?"\0\0\0\0":"\0\0\0")+pv(o,4)+g+m;return{localFileHeader:Uint8Array.from(C,e=>e.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,e=>e.charCodeAt(0))}},bv=e=>{let t;if("string"==typeof e){const o=atob(e.split(";base64,")[1]);t=Uint8Array.from(o,e=>e.charCodeAt(0))}else t=e;return{size:t.length,content:t}},yv=async e=>{const{content:t}=e,{size:o,content:s}=t?bv(t):{size:0,content:Uint8Array.from([])};let i,n,r=!1;if("file"===e.type&&s&&o>0){const e=await gv(s);i=e.content,n=e.size,r=!0}return{rawContent:s,rawSize:o,deflatedContent:i,deflatedSize:n,isCompressed:r}},Sv=(e,t)=>{const{content:o}=e,{content:s}=o?bv(o):{content:Uint8Array.from([])};return{...wv(e,!1,t,s.length,s,void 0),content:s,isCompressed:!1}},Rv=class{constructor(){this.folders=[],this.files=[]}addFolders(e){e.forEach(this.addFolder.bind(this))}addFolder(e){this.folders.push({path:e,created:/* @__PURE__ */new Date,isBase64:!1,type:"folder"})}addFile(e,t,o=!1){this.files.push({path:e,created:/* @__PURE__ */new Date,content:o?t:(new TextEncoder).encode(t),isBase64:o,type:"file"})}async getZipFile(e="application/zip"){const t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}clearStream(){this.folders=[],this.files=[]}packageFiles(e){let t=0,o=0;for(const d of e){const{localFileHeader:e,centralDirectoryHeader:s,content:i}=d;t+=e.length+i.length,o+=s.length}const s=new Uint8Array(t),i=new Uint8Array(o);let n=0,r=0;for(const d of e){const{localFileHeader:e,centralDirectoryHeader:t,content:o}=d;s.set(e,n),n+=e.length,s.set(o,n),n+=o.length,i.set(t,r),r+=t.length}const a=((e,t,o)=>{const s="PK\0\0\0\0"+pv(e,2)+pv(e,2)+pv(t,4)+pv(o,4)+"\0\0";return Uint8Array.from(s,e=>e.charCodeAt(0))})(e.length,o,t),l=new Uint8Array(s.length+i.length+a.length);return l.set(s),l.set(i,s.length),l.set(a,s.length+i.length),l}async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=await Promise.all(e.map(yv)),o=[];let s=0;for(let i=0;i{const s="xl/drawings",i=`${s}/drawing${o+1}.xml`,n=`${s}/_rels/drawing${o+1}.xml.rels`;e.addFile(n,function(e){const t=JC.get(e)||[],o=[];for(const[s,i]of t){const{index:e,type:t}=i;o.push({Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${XC.get(s).index+1}.${Jm(t)}`})}return Km(pf.getTemplate(o))}(t)),e.addFile(i,function(e){return Km(uf.getTemplate({sheetIndex:e}))}(t))},Fv=(e,t,o)=>{const s="xl/drawings",i=`${s}/vmlDrawing${o+1}.vml`,n=`${s}/_rels/vmlDrawing${o+1}.vml.rels`;e.addFile(i,function(e){return Km(yC.getTemplate({sheetIndex:e}),!0)}(t)),e.addFile(n,function(e){const t=QC.get(e)||[],o=[];for(let s=0;s{const r=!!n&&Object.keys(n).some(e=>null!=n[e]);var a,l,d;e.addFile("xl/workbook.xml",(a=i,Km(xC.getTemplate(KC,a)))),e.addFile("xl/styles.xml",(l=t,Km(sC.getTemplate(l)))),e.addFile("xl/sharedStrings.xml",Km(mf.getTemplate(jC))),e.addFile("xl/theme/theme1.xml",Km(CC.getTemplate())),e.addFile("xl/_rels/workbook.xml.rels",function(e){const t=new Array(e).fill(void 0).map((e,t)=>({Id:`rId${t+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",Target:`worksheets/sheet${t+1}.xml`}));return Km(pf.getTemplate([...t,{Id:`rId${e+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"},{Id:`rId${e+2}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"},{Id:`rId${e+3}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",Target:"sharedStrings.xml"}]))}(s)),e.addFile("docProps/core.xml",function(e){return Km(tf.getTemplate(e))}(o)),r&&e.addFile("docProps/custom.xml",(d=n,Km(sf.getTemplate(d)))),e.addFile("[Content_Types].xml",function(e,t){return Km(ef.getTemplate({sheetLen:e,hasCustomProperties:t}))}(s,r)),e.addFile("_rels/.rels",function(e){const t=[{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Target:"xl/workbook.xml"},{Id:"rId2",Type:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Target:"docProps/core.xml"}];return e&&t.push({Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",Target:"docProps/custom.xml"}),Km(pf.getTemplate(t))}(r))},Mv=(e,t,o={},s)=>{if(!t||0===t.length)return Et(159),s.reset(),!1;s.syncOrderWithSheetData(t);const{fontSize:i=11,author:n="AG Grid",activeTab:r=0,customMetadata:a}=o,l=t.length,d=Math.max(Math.min(r,l-1),0);return(e=>{if(e.addFolders(["_rels/","docProps/","xl/","xl/theme/","xl/_rels/","xl/worksheets/"]),!YC.size)return;e.addFolders(["xl/worksheets/_rels","xl/drawings/","xl/drawings/_rels","xl/media/"]);let t=0;YC.forEach(o=>{const{base64:s,imageType:i}=o[0].image[0];e.addFile(`xl/media/image${++t}.${Jm(i)}`,s,!0)})})(e),(e=>{const t=ev,o=Array.from(t.keys());for(let s=0;s{let o=0,s=0;for(let i=0;i0&&ZC.has(i),a=ev.size>0&&ev.get(i),l=YC.size&&QC.has(i);if(!r&&!a&&!l)continue;let d,c,h;r&&(xv(e,i,o),c=o,o++),l&&(Fv(e,i,s),h=s,s++),a&&(d=a.name);const u=`xl/worksheets/_rels/sheet${i+1}.xml.rels`;e.addFile(u,lv({tableName:d,drawingIndex:c,vmlDrawingIndex:h}))}})(e,t),Dv(e,i,n,l,d,a),s.reset(),!0},Pv=(e,t=new uv)=>{const{data:o,fontSize:s,author:i,activeSheetIndex:n,customMetadata:r}=e,a=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",l=new Rv;return Mv(l,o,{author:i,fontSize:s,activeTab:n,customMetadata:r},t)?l.getZipFile(a):Promise.resolve(void 0)},Ev=(e,t=new uv)=>{const{data:o,fontSize:s,author:i,activeSheetIndex:n,customMetadata:r}=e,a=e.mimeType||"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",l=new Rv;if(Mv(l,o,{author:i,fontSize:s,activeTab:n,customMetadata:r},t))return l.getUncompressedZipFile(a)};var Tv=class extends ol{constructor(e,t){super(function(e){return{tag:"div",cls:`ag-virtual-list-viewport ag-${e}-virtual-list-viewport`,role:"presentation",children:[{tag:"div",ref:"eContainer",cls:`ag-virtual-list-container ag-${e}-virtual-list-container`}]}}(t?.cssIdentifier||"default")),this.stopPropagationCallbacks=e,this.renderedRows=/* @__PURE__ */new Map,this.rowHeight=20,this.pageSize=-1,this.isScrolling=!1,this.isHeightFromTheme=!0,this.eContainer=null,this.awaitStableCallbacks=[],this.registerCSS(":where(.ag-virtual-list-viewport) .ag-tab-guard{position:sticky}.ag-virtual-list-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:auto;position:relative;width:100%}.ag-virtual-list-container{overflow:hidden;position:relative}.ag-virtual-list-item{height:var(--ag-list-item-height);position:absolute;width:100%}");const{cssIdentifier:o="default",ariaRole:s="listbox",listName:i,moveItemCallback:n}=t||{};this.cssIdentifier=o,this.ariaRole=s,this.listName=i,this.moveItemCallback=n}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)},this.stopPropagationCallbacks),this.refreshAriaProperties(),this.addManagedEventListeners({stylesChanged:this.onStylesChanged.bind(this)})}onStylesChanged(e){e.listItemHeightChanged&&(this.rowHeight=this.getItemHeight(),this.refresh())}refreshAriaProperties(){const e=this.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),t=this.eContainer;P(t,this.model?.getRowCount()>0?this.ariaRole:"presentation"),E(t,e)}addResizeObserver(){const e=be(this.beans,this.getGui(),()=>ye(this.beans,()=>this.drawVirtualRows()));this.addDestroyFunc(e)}focusInnerElement(e){return this.focusRow(e?this.model.getRowCount()-1:0),!0}onFocusIn(e){const t=e.target;var o;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=(o=t,Number.parseInt(o.getAttribute("aria-posinset"),10)-1))}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){const{key:t,shiftKey:o}=e;switch(t){case ks:case Gs:{const s=t===ks;e.preventDefault(),o?this.moveItem(s):this.navigate(s)}break;case Vs:case zs:case Hs:case Os:null!==this.navigateToPage(t)&&e.preventDefault()}}onTabKeyDown(e){this.stopPropagationCallbacks?.stopPropagation(e),this.forceFocusOutOfContainer(e.shiftKey)}getNextRow(e){if(null==this.lastFocusedRowIndex)return;const t=this.lastFocusedRowIndex+(e?-1:1);return t<0||t>=this.model.getRowCount()?void 0:t}moveItem(e){if(!this.moveItemCallback)return;const t=this.getComponentAt(this.lastFocusedRowIndex);t&&this.moveItemCallback(t,e)}navigate(e){const t=this.getNextRow(e);void 0!==t&&this.focusRow(t)}navigateToPage(e,t="focused"){let o=!1;"focused"===t&&(t=this.getLastFocusedRow(),o=!0);const s=this.model.getRowCount()-1;let i=-1;return e===Vs?i=0:e===zs?i=s:e===Os?i=Math.min(t+this.pageSize,s):e===Hs&&(i=Math.max(t-this.pageSize,0)),-1===i?null:(o?this.focusRow(i):this.ensureIndexVisible(i),i)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.isScrolling||(this.isScrolling=!0,this.ensureIndexVisible(e),ye(this.beans,()=>{if(this.isScrolling=!1,!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()}))}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,o)=>e(t.rowComponent,o))}getItemHeight(){return this.isHeightFromTheme?this.beans.environment.getDefaultListItemHeight():this.rowHeight}ensureIndexVisible(e,t=!0){const o=this.model.getRowCount();if("number"!=typeof e||e<0||e>=o)return!1;const s=e*this.rowHeight,i=s+this.rowHeight,n=this.getGui(),r=n.scrollTop,a=n.offsetHeight,l=r+a,d=t?0:this.rowHeight,c=ls+d?(n.scrollTop=s,!0):!!c&&(n.scrollTop=i-a,!0)}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.isHeightFromTheme=!1,this.rowHeight=e,this.refresh()}refresh(e){if(null==this.model||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=t*this.rowHeight+"px",this.refreshAriaProperties(),this.awaitStable(()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}awaitStable(e){if(this.awaitStableCallbacks.push(e),this.awaitStableCallbacks.length>1)return;const t=this.model.getRowCount();Ze(this,()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{if(!this.isAlive())return;const e=this.awaitStableCallbacks;this.awaitStableCallbacks=[];for(const t of e)t()})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&"function"==typeof this.model.areRowsEqual&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),o=t.scrollTop,s=o+t.offsetHeight;if(o===s)this.clearVirtualRows();else{const t=Math.floor(o/this.rowHeight),i=Math.floor(s/this.rowHeight);this.pageSize=Math.floor((s-o)/this.rowHeight),this.ensureRowsRendered(t,i,e)}}ensureRowsRendered(e,t,o){this.renderedRows.forEach((o,s)=>{(st)&&s!==this.lastFocusedRowIndex&&this.removeRow(s)}),o&&this.refreshRows();for(let s=e;s<=t;s++)this.renderedRows.has(s)||sthis.lastFocusedRowIndex=e),s.appendChild(i.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",s):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",s):this.eContainer.appendChild(s),this.renderedRows.set(e,{rowComponent:i,eDiv:s,value:t})}removeRow(e){const t=this.renderedRows.get(e);t.eDiv.remove(),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,o)=>{if(o>=e)this.removeRow(o);else{const e=this.model.getRow(o);this.model.areRowsEqual?.(t.value,e)?this.componentUpdater(e,t.rowComponent):this.removeRow(o)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),this.awaitStableCallbacks.length=0,super.destroy())}},Av="ag-list-item-hovered",Iv=class extends ze{constructor(e,t,o){super(),this.comp=e,this.virtualList=t,this.params=o,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.beans.environment.addGlobalCSS('.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}',"component-AgVirtualListDragFeature"),this.params.addListeners(this,this.listItemDragStart.bind(this),this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){this.beans.dragAndDrop?.addDropTarget({isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>this.moveBlocked?"pinned":"move",getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave(),onDragCancel:()=>this.onDragCancel()})}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new xl({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),o=this.virtualList.getComponentAt(t.rowIndex);if(!o)return;const s=o.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,$(s,Av),$(s,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),o=Number.parseFloat(window.getComputedStyle(t).paddingTop),s=this.virtualList.getRowHeight(),i=this.virtualList.getScrollTop(),n=Math.max(0,(e.y-o+i)/s),r=this.params.getNumRows(this.comp)-1,a=0|Math.min(r,n);return{rowIndex:a,position:Math.round(n)>n||n>r?"bottom":"top",component:this.virtualList.getComponentAt(a)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearDragProperties())}onDragCancel(){this.clearDragProperties()}onDragLeave(){this.clearDragProperties()}clearDragProperties(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){const e=this.virtualList.getGui();for(const t of e.querySelectorAll(`.${Av}`))for(const e of[Av,"ag-item-highlight-top","ag-item-highlight-bottom"])t.classList.remove(e);this.lastHoveredListItem=null}};var kv=class extends si{constructor(e){var t;super(((t=e.cssIdentifier)??(t=t||"default"),{tag:"div",cls:`ag-panel ag-${t}-panel`,attrs:{tabindex:"-1"},children:[{tag:"div",ref:"eTitleBar",cls:`ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable`,children:[{tag:"span",ref:"eTitle",cls:`ag-panel-title-bar-title ag-${t}-panel-title-bar-title`},{tag:"div",ref:"eTitleBarButtons",cls:`ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons`}]},{tag:"div",ref:"eContentWrapper",cls:`ag-panel-content-wrapper ag-${t}-panel-content-wrapper`}]})),this.config=e,this.closable=!0,this.eContentWrapper=null,this.eTitleBar=null,this.eTitleBarButtons=null,this.eTitle=null,this.registerCSS(".ag-panel{background-color:var(--ag-panel-background-color);display:flex;flex-direction:column;overflow:hidden;position:relative}.ag-dialog{border:var(--ag-dialog-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dialog-shadow);position:absolute}.ag-panel-title-bar{align-items:center;background-color:var(--ag-panel-title-bar-background-color);border-bottom:var(--ag-panel-title-bar-border);color:var(--ag-panel-title-bar-text-color);cursor:default;display:flex;flex:none;font-family:var(--ag-panel-title-bar-font-family);font-size:var(--ag-panel-title-bar-font-size);font-weight:var(--ag-panel-title-bar-font-weight);height:var(--ag-panel-title-bar-height);padding:var(--ag-spacing) var(--ag-cell-horizontal-padding)}.ag-panel-title-bar-button{cursor:pointer;:where(.ag-icon){color:var(--ag-panel-title-bar-icon-color)}}:where(.ag-ltr) .ag-panel-title-bar-button{margin-left:calc(var(--ag-spacing)*2);margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-panel-title-bar-button{margin-left:var(--ag-spacing);margin-right:calc(var(--ag-spacing)*2)}.ag-panel-title-bar-title{flex:1 1 auto}.ag-panel-title-bar-buttons{display:flex}.ag-panel-content-wrapper{display:flex;flex:1 1 auto;overflow:hidden;position:relative}:where(.ag-dragging-fill-handle) .ag-dialog,:where(.ag-dragging-range-handle) .ag-dialog{opacity:.7;pointer-events:none}")}postConstruct(){const{component:e,closable:t,hideTitleBar:o,title:s,minWidth:i=250,width:n,minHeight:r=250,height:a,centered:l,popup:d,x:c,y:h,postProcessPopupParams:u}=this.config,g=this.beans,p=this.createManagedBean(new Xi(this.getGui(),{minWidth:i,width:n,minHeight:r,height:a,centered:l,x:c,y:h,popup:d,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}));this.positionableFeature=p;const m=this.getGui();if(e&&this.setBodyComponent(e),o?_(this.eTitleBar,!1):(s&&this.setTitle(s),this.setClosable(null!=t?t:this.closable)),this.addManagedElementListeners(this.eTitleBar,{mousedown:e=>{if(m.contains(e.relatedTarget)||m.contains(w(g))||this.eTitleBarButtons.contains(e.target))return void e.preventDefault();const t=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");t&&t.focus()}}),d&&p.isPositioned())return;let f;if(this.renderComponent&&this.renderComponent(),u){const{type:e,eventSource:t,mouseEvent:o}=u;f=()=>g.popupSvc?.callPostProcessPopup(u,e,m,t,o)}p.initialisePosition(f),this.eContentWrapper.style.height="0"}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.remove(),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable&&(this.closable=e),e){const e=this.closeButtonComp=new si({tag:"div",cls:"ag-button"});this.createBean(e);const t=e.getGui(),o=this.beans.iconSvc.createIconNoSpan("close",this.beans);o.classList.add("ag-panel-title-bar-button-icon"),t.appendChild(o),this.addTitleBarButton(e),e.addManagedElementListeners(t,{click:this.onBtClose.bind(this)})}else this.closeButtonComp&&(this.closeButtonComp.getGui().remove(),this.closeButtonComp=this.destroyBean(this.closeButtonComp))}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const o=this.eTitleBarButtons,s=o.children,i=s.length;null==t&&(t=i),t=Math.max(0,Math.min(t,i)),e.addCss("ag-panel-title-bar-button");const n=e.getGui();0===t?o.prepend(n):t===i?o.append(n):s[t-1].after(n),e.setParentComponent(this)}getBodyHeight(){return Q(this.eContentWrapper)}getBodyWidth(){return X(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&ae(e)&&this.close(),super.destroy()}},Lv=class extends kv{constructor(e,t){super({...e,popup:!0}),this.callbacks=t,this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}wireBeans(e){this.popupSvc=e.popupSvc}postConstruct(){const e=this.getGui(),{movable:t,resizable:o,maximizable:s,modal:i}=this.config;this.addCss("ag-dialog"),super.postConstruct(),this.tabGuardFeature=this.createManagedBean(new tl(this,this.callbacks?.stopPropagationCallbacks)),this.tabGuardFeature.initialiseTabGuard({isFocusableContainer:!0,onFocusIn:()=>{this.popupSvc?.bringPopupToFront(e)},onTabKeyDown:t=>{if(i)return;const o=t.shiftKey,s=fn(this.beans,e,!1,o);s&&!this.tabGuardFeature.getTabGuardCtrl().isTabGuard(s)||this.callbacks?.focusNextContainer(this.beans,o)&&t.preventDefault()}}),t&&this.setMovable(t),s&&this.setMaximizable(s),o&&this.setResizable(o),this.config.modal||this.callbacks?.configureFocusableContainer(this.beans,this)}setAllowFocus(e){this.tabGuardFeature.getTabGuardCtrl().setAllowFocus(e)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:o,title:s,afterGuiAttached:i}=this.config,n=this.getLocaleTextFunc(),r=this.popupSvc?.addPopup({modal:o,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:s||n("ariaLabelDialog","Dialog"),afterGuiAttached:i});r&&(this.close=r.hideFunc)}onClosed(e){this.destroy(),this.config.closedCallback?.(e)}setMaximized(e){this.isMaximizable&&e!==this.isMaximized&&this.toggleMaximize()}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:e,y:t,width:o,height:s}=this.lastPosition;this.setWidth(o),this.setHeight(s),this.positionableFeature.offsetElement(e,t)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){_(this.maximizeIcon,!this.isMaximized),_(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){if(this.maximizeListeners.length){for(const e of this.maximizeListeners)e();this.maximizeListeners.length=0}this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;this.isMaximizable=e;const o=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),o.addManagedElementListeners(o.getGui(),{click:this.toggleMaximize.bind(this)}),this.addTitleBarButton(o,0),this.maximizeListeners.push(...this.addManagedElementListeners(t,{dblclick:this.toggleMaximize.bind(this)})),[this.resizeListenerDestroy]=this.addManagedListeners(this.positionableFeature,{resize:()=>{this.isMaximized=!1,this.refreshMaximizeIcon()}})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new si({tag:"div",cls:"ag-dialog-button"})),t=e.getGui(),o=this.beans.iconSvc;return this.maximizeIcon=o.createIconNoSpan("maximize"),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=o.createIconNoSpan("minimize"),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}},Gv=class extends ol{constructor(e){super(),this.setTemplateFromElement(e.getGui(),void 0,void 0,!0)}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===Ts&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}},Nv=class extends ze{constructor(e){super(),this.callbacks=e,this.ACTIVATION_DELAY=80,this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){const{menuItemDef:t,isAnotherSubMenuOpen:o,level:s,childComponent:i,contextParams:n}=e;return this.params=e.menuItemDef,this.level=s,this.isAnotherSubMenuOpen=o,this.childComponent=i,this.contextParams=n,this.cssClassPrefix=this.params.menuItemParams?.cssClassPrefix??"ag-menu-option",this.callbacks.getMenuItemComp(this.beans,this.params,{...t,level:s,isAnotherSubMenuOpen:o,openSubMenu:e=>this.openSubMenu(e),closeSubMenu:()=>this.closeSubMenu(),closeMenu:e=>this.closeMenu(e),updateTooltip:(e,t)=>this.refreshTooltip(e,t),onItemActivated:()=>this.onItemActivated()}).then(e=>{if(!e)return;this.menuItemComp=e;const t=e.configureDefaults?.();t&&this.configureDefaults(!0===t?void 0:t)})}addListeners(e,t){t?.suppressClick||this.addManagedElementListeners(e,{click:e=>this.onItemSelected(e)}),t?.suppressKeyboardSelect||this.addManagedElementListeners(e,{keydown:e=>{e.key!==Es&&e.key!==As||(e.preventDefault(),this.onItemSelected(e))}}),t?.suppressMouseDown||this.addManagedElementListeners(e,{mousedown:e=>{e.stopPropagation(),e.preventDefault()}}),t?.suppressMouseOver||this.addManagedElementListeners(e,{mouseenter:()=>this.onMouseEnter(),mouseleave:()=>this.onMouseLeave()})}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1,t){if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const o=Xs({tag:"div",cls:"ag-menu",role:"presentation"});let s;this.eSubMenuGui=o;let i=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const e=this.createBean(new Gv(this.childComponent));e.setParentComponent(this);const t=e.getGui(),n="mouseenter",r=()=>this.cancelDeactivate();t.addEventListener(n,r),s=()=>{t.removeEventListener(n,r),this.destroyBean(e)},o.appendChild(t),this.childComponent.afterGuiAttached&&(i=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const t=this.createBean(new Bv(this.level+1,this.contextParams,this.callbacks));t.setParentComponent(this),t.addMenuItems(this.params.subMenu),o.appendChild(t.getGui()),this.addManagedListeners(t,{closeMenu:e=>this.dispatchLocalEvent(e)}),t.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),s=()=>this.destroyBean(t),e&&(i=()=>{t.activateFirstItem(),this.subMenuIsOpening=!1})}const n=this.beans.popupSvc,r=this.getLocaleTextFunc(),a=n?.addPopup({modal:!0,eChild:o,positionCallback:()=>{const e=this.eGui;n?.positionPopupForMenu({eventSource:e,ePopup:o,event:t instanceof MouseEvent?t:void 0,additionalParams:this.callbacks.getPostProcessPopupParams(this.contextParams)})},anchorToElement:this.eGui,ariaLabel:r("ariaLabelSubMenu","SubMenu"),afterGuiAttached:i});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{a&&a.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),s(),this.menuItemComp.setExpanded?.(!1),this.eSubMenuGui=void 0},this.menuItemComp.setExpanded?.(!0)}setAriaExpanded(e){this.suppressAria||G(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e,t){this.cancelActivate(),this.params.disabled&&!t||(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!0),this.suppressFocus||this.callbacks.preserveRangesWhile(this.beans,()=>this.eGui.focus({preventScroll:!t})),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),this.menuItemComp.setActive?.(!1),this.isActive=!1,this.subMenuIsOpen&&this.closeSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){this.menuItemComp.select?.(),this.params.action?this.beans.frameworkOverrides.wrapOutgoing(()=>this.params.action(this.gos.addCommon({...this.contextParams}))):this.openSubMenu(e&&"keydown"===e.type,e),this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect||this.closeMenu(e)}closeMenu(e){const t={type:"closeMenu"};e&&(e instanceof MouseEvent?t.mouseEvent=e:t.keyboardEvent=e),this.dispatchLocalEvent(t)}onItemActivated(){const e={type:"menuItemActivated",menuItem:this};this.dispatchLocalEvent(e)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),this.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),this.ACTIVATION_DELAY):this.deactivate()}refreshRootElementGui(e){let t=this.menuItemComp.getGui();const{cssClassPrefix:o,params:{cssClasses:s,disabled:i}}=this,n=this.menuItemComp.getRootElement?.();if(n&&(e||t.classList.add("ag-menu-option-custom"),t=n),this.suppressRootStyles=!!e,!this.suppressRootStyles){t.classList.add(o);for(const e of s??[])t.classList.add(e);i&&t.classList.add(`${o}-disabled`)}return t}applyAriaProperties(e){const{params:{checked:t,subMenu:o,subMenuRole:s,disabled:i}}=this;var n;P(e,null!=t?"menuitemcheckbox":"menuitem"),o&&x(e,"haspopup",!1===(n=s??"menu")?null:n),i&&function(e,t){x(e,"disabled",t)}(e,!0)}configureDefaults(e){if(!this.menuItemComp)return void setTimeout(()=>this.configureDefaults(e));const{suppressRootStyles:t,suppressTooltip:o,suppressAria:s,suppressTabIndex:i,suppressFocus:n}=e||{},{params:{tooltip:r,disabled:a}}=this,l=this.eGui=this.refreshRootElementGui(!!t);this.suppressAria=!!s,s||this.applyAriaProperties(l),i||l.setAttribute("tabindex","-1"),o||this.refreshTooltip(r),a||this.addListeners(l,e),this.suppressFocus=!!n}refreshTooltip(e,t){if(this.tooltip=e,this.tooltipFeature=this.destroyBean(this.tooltipFeature),!e||!this.menuItemComp)return;const o=this.beans.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu",shouldDisplayTooltip:t});o&&(this.tooltipFeature=this.createBean(o))}destroy(){this.tooltipFeature=this.destroyBean(this.tooltipFeature),this.menuItemComp?.destroy?.(),super.destroy()}},Bv=class extends ol{constructor(e=0,t,o){super({tag:"div",cls:"ag-menu-list",role:"menu"}),this.level=e,this.menuActionParams=t,this.callbacks=o,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.callbacks.preserveRangesWhile(this.beans,()=>this.handleKeyDown(e)),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){this.getParentComponent()?.getGui()?.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case ks:case Ls:case Gs:case Is:e.preventDefault(),this.handleNavKey(e.key);break;case Ts:this.closeIfIsChild()&&this.callbacks.stopPropagationCallbacks.stopPropagation(e)}}handleFocusIn(e){const t=e.relatedTarget;(this.tabGuardFeature.getTabGuardCtrl().isTabGuard(t)||!this.getGui().contains(t)&&!this.activeMenuItem?.getSubMenuGui()?.contains(t))&&(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){const t=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(t)||this.activeMenuItem.getSubMenuGui()?.contains(t)||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){null!=e&&Zs.all(e.map(e=>"separator"===e?Zs.resolve({eGui:this.createSeparator()}):"string"==typeof e?(this.callbacks.warnNoItem?.(e),Zs.resolve({eGui:null})):this.addItem(e))).then(e=>{for(const t of e??[])t?.eGui&&(this.appendChild(t.eGui),t.comp&&this.menuItems.push(t.comp))})}addItem(e){const t=this.createManagedBean(new Nv(this.callbacks));return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(e=>e.isSubMenuOpen()),level:this.level,contextParams:this.menuActionParams}).then(()=>(t.setParentComponent(this),this.addManagedListeners(t,{closeMenu:e=>{this.dispatchLocalEvent(e)},menuItemActivated:e=>{this.activeMenuItem&&this.activeMenuItem!==e.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=e.menuItem}}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(e=>!e.isDisabled())[0];e&&e.activate()}createSeparator(){const e={tag:"div",cls:"ag-menu-separator-part"};return Fe({tag:"div",cls:"ag-menu-separator",attrs:{"aria-hidden":"true"},children:[e,e,e,e]})}handleNavKey(e){switch(e){case ks:case Gs:{const t=this.findNextItem(e===ks);return void(t&&t!==this.activeMenuItem&&t.activate(!1,!0))}}e===(this.gos.get("enableRtl")?Ls:Is)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return!!(t&&t instanceof Nv)&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0)}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(t){const o=[...this.menuItems];if(!o.length)return;if(!this.activeMenuItem)return t?e(o):o[0];let s;t&&o.reverse();let i=!1;for(const e of o){if(i){s=e;break}e===this.activeMenuItem&&(i=!0)}return i&&!s?o[0]:s||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}},Hv=class extends si{constructor(e){super({tag:"div"}),this.callbacks=e}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addAriaAttributes(),this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addAriaAttributes(){const{checked:e,subMenu:t}=this.params,o=this.getGui();e&&function(e,t){F(e,"checked",void 0===t?"mixed":t)}(o,e),t&&G(o,!1)}addIcon(){if(this.params.isCompact)return;const e=Fe({tag:"span",ref:"eIcon",cls:`${this.getClassName("part")} ${this.getClassName("icon")}`,role:"presentation"}),{checked:t,icon:o}=this.params;t?e.appendChild(this.beans.iconSvc.createIconNoSpan("check")):o&&(ve(o)?e.appendChild(o):"string"==typeof o?e.innerHTML=o:this.callbacks?.warnNoIcon?.()),this.getGui().appendChild(e)}addName(){const e=Fe({tag:"span",ref:"eName",cls:`${this.getClassName("part")} ${this.getClassName("text")}`,children:this.params.name||""});this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=Fe({tag:"span",ref:"eShortcut",cls:`${this.getClassName("part")} ${this.getClassName("shortcut")}`,children:this.params.shortcut||""});this.getGui().appendChild(e)}addSubMenu(){const e=Fe({tag:"span",ref:"ePopupPointer",cls:`${this.getClassName("part")} ${this.getClassName("popup-pointer")}`}),t=this.getGui();if(this.params.subMenu){const t=this.gos.get("enableRtl")?"subMenuOpenRtl":"subMenuOpen";e.appendChild(this.beans.iconSvc.createIconNoSpan(t))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}};function Ov(e,t){if(!t)return null;const o=pn(e),s=o.indexOf(t);if(-1===s)return null;let i=-1;for(let n=s-1;n>=0;n--)if(o[n].classList.contains(Xa)){i=n;break}return i<=0?null:o[i-1]}function Vv(e,t){if(!t)return!1;const o=e.querySelectorAll(`.${vn}`);if(!o.length)return!1;for(let s=0;sthis.activeItem?.tabbedItem?.afterDetachedCallback?.())}setupHeader(){const{enableCloseButton:e,cssClass:t}=this.params,o=(e,o)=>{e.classList.add(`ag-tabs-${o}`),t&&e.classList.add(`${t}-${o}`)};e?(this.setupCloseButton(o),this.eTabHeader=Fe({tag:"div",role:"presentation"}),o(this.eHeader,"header-wrapper"),this.eHeader.appendChild(this.eTabHeader)):this.eTabHeader=this.eHeader,P(this.eTabHeader,"tablist"),o(this.eTabHeader,"header")}setupCloseButton(e){const t=Fe({tag:"button"});e(t,"close-button");const o=this.beans.iconSvc.createIconNoSpan("close");E(t,this.params.closeButtonAriaLabel),t.appendChild(o),this.addManagedElementListeners(t,{click:()=>this.params.onCloseClicked?.()});const s=Fe({tag:"div",role:"presentation"});e(s,"close-button-wrapper"),s.appendChild(t),this.eHeader.appendChild(s),this.eCloseButton=t}handleKeyDown(e){switch(e.key){case Ls:case Is:{if(!this.eTabHeader.contains(w(this.beans)))return;const t=e.key===Ls,o=this.gos.get("enableRtl"),s=this.items.indexOf(this.activeItem),i=t!==o?Math.min(s+1,this.items.length-1):Math.max(s-1,0);if(s===i)return;e.preventDefault();const n=this.items[i];this.showItemWrapper(n),n.eHeaderButton.focus();break}case ks:case Gs:e.stopPropagation()}}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,eHeader:o,eBody:s,activeItem:i,params:n}=this,{suppressTrapFocus:r,enableCloseButton:a}=n,l=w(t),d=e.target,c=e.shiftKey;if(o.contains(l))return e.preventDefault(),void(a&&c&&!this.eCloseButton?.contains(l)?this.eCloseButton?.focus():r&&c?Ov(b(t).body,d)?.focus():this.focusBody(e.shiftKey));let h=null;Vv(s,d)&&(c&&(h=Ov(s,d)),h||r||(h=i.eHeaderButton)),h||!s.contains(l)||(h=fn(t,s,!1,c),h)?h&&(e.preventDefault(),h.focus()):r&&!c?this.forceFocusOutOfContainer(c):a&&!c?(e.preventDefault(),this.eCloseButton?.focus()):(e.preventDefault(),this.focusHeader())}focusInnerElement(e){return e?this.focusBody(!0):(this.focusHeader(),!0)}focusHeader(e){this.activeItem.eHeaderButton.focus({preventScroll:e})}focusBody(e){return mn(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=Fe({tag:"span",cls:"ag-tab",role:"tab",attrs:{tabindex:"-1"}});t.appendChild(e.title),this.eTabHeader.appendChild(t),E(t,e.titleLabel);const o={tabbedItem:e,eHeaderButton:t};this.items.push(o),t.addEventListener("click",this.showItemWrapper.bind(this,o))}showItem(e){const t=this.items.find(t=>t.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){const{tabbedItem:t,eHeaderButton:o}=e;this.params.onItemClicked?.({item:t}),this.activeItem!==e?(this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),ie(this.eBody),t.bodyPromise.then(e=>{this.eBody.appendChild(e);const o=!gn();if(this.params.suppressFocusBodyOnOpen||mn(this.eBody,!1,o),t.afterAttachedCallback&&t.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const o=t.getScrollableContainer?.()||e;[this.lastScrollListener]=this.addManagedElementListeners(o,{scroll:()=>{this.tabbedItemScrollMap.set(t.name,o.scrollTop)}});const s=this.tabbedItemScrollMap.get(t.name);void 0!==s&&setTimeout(()=>{o.scrollTop=s},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),this.activeItem.tabbedItem.afterDetachedCallback?.()),o.classList.add("ag-tab-selected"),this.activeItem=e):this.params.onActiveItemClicked?.()}};var Wv=class extends si{constructor(e={}){super(function(e){const t=e.cssIdentifier||"default";return{tag:"div",cls:`ag-group ag-${t}-group`,role:"presentation",children:[{tag:"div",ref:"eToolbar",cls:`ag-group-toolbar ag-${t}-group-toolbar`,children:[{tag:"ag-checkbox",ref:"cbGroupEnabled"}]},{tag:"div",ref:"eContainer",cls:`ag-group-container ag-group-container-${e.direction||"vertical"} ag-${t}-group-container`}]}}(e),[Tr]),this.params=e,this.suppressEnabledCheckbox=!0,this.suppressToggleExpandOnEnableChange=!1,this.eToolbar=null,this.cbGroupEnabled=null,this.eContainer=null,this.registerCSS(".ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}");const{enabled:t,items:o,suppressEnabledCheckbox:s,expanded:i,suppressToggleExpandOnEnableChange:n,useToggle:r}=e;this.cssIdentifier=e.cssIdentifier||"default",this.enabled=null==t||t,this.items=o||[],this.useToggle=r??!1,this.alignItems=e.alignItems||"center",this.expanded=null==i||i,null!=s&&(this.suppressEnabledCheckbox=s),null!=n&&(this.suppressToggleExpandOnEnableChange=n)}postConstruct(){if(this.setupTitleBar(),this.items.length){const e=this.items;this.items=[],this.addItems(e)}const e=this.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.enabled&&this.setEnabled(this.enabled,void 0,!0),this.setAlignItems(this.alignItems);const{onEnableChange:t,onExpandedChange:o,suppressOpenCloseIcons:s}=this.params;this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(s??!1),this.refreshChildDisplay(),_(this.eContainer,this.expanded),this.cbGroupEnabled.onValueChange(e=>{this.setEnabled(e,!0,this.suppressToggleExpandOnEnableChange),this.dispatchEnableChangeEvent(e)}),null!=t&&this.onEnableChange(t),null!=o&&this.onExpandedChange(o)}refreshChildDisplay(){_(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),this.eTitleBar?.refreshOnExpand(this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCss(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCss(t),this}toggleGroupExpand(e,t){if(this.eTitleBar?.isSuppressCollapse()&&!this.useToggle)e=!0,t=!0;else if(e=null!=e?e:!this.expanded,this.expanded===e)return this;return this.expanded=e,this.refreshChildDisplay(),_(this.eContainer,e),t||this.dispatchLocalEvent({type:e?"expanded":"collapsed"}),this}addItems(e){for(const t of e)this.addItem(t)}prependItem(e){this.insertItem(e,!0)}addItem(e){this.insertItem(e,!1)}updateItems(e){const t=this.items;let o=0;for(let s=0;se(t.enabled)}),this}onExpandedChange(e){return this.addManagedListeners(this,{expanded:()=>e(!0),collapsed:()=>e(!1)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.eTitleBar?.hideOpenCloseIcons(e),this}refreshDisabledStyles(){const e=!this.enabled;this.eContainer.classList.toggle("ag-disabled",e),this.eTitleBar?.refreshDisabledStyles(this.suppressEnabledCheckbox&&e),this.eContainer.classList.toggle("ag-disabled-group-container",e)}setupTitleBar(){const e=this.useToggle?this.createToggleTitleBar():this.createDefaultTitleBar();this.eToolbar.insertAdjacentElement("beforebegin",e.getGui())}createDefaultTitleBar(){const e=this.createManagedBean(new $v(this.params));return this.eTitleBar=e,e.refreshOnExpand(this.expanded),this.addManagedListeners(e,{expandedChanged:e=>this.toggleGroupExpand(e.expanded)}),e}createToggleTitleBar(){const e=this.createManagedBean(new Em({value:this.enabled,label:this.params.title,labelAlignment:"left",labelWidth:"flex",onValueChange:e=>{this.setEnabled(e,!0),this.dispatchEnableChangeEvent(e)}}));return e.addCss("ag-group-title-bar"),e.addCss(`ag-${this.params.cssIdentifier??"default"}-group-title-bar ag-unselectable`),this.eToggle=e,this.toggleGroupExpand(this.enabled),e}},Uv="ag-disabled-group-title-bar";var $v=class extends si{constructor(e={}){super(function(e){const t=e.cssIdentifier??"default";return{tag:"div",cls:`ag-group-title-bar ag-${t}-group-title-bar ag-unselectable`,role:e.suppressKeyboardNavigation?"presentation":"group",children:[{tag:"span",ref:"eGroupOpenedIcon",cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eGroupClosedIcon",cls:`ag-group-title-bar-icon ag-${t}-group-title-bar-icon`,role:"presentation"},{tag:"span",ref:"eTitle",cls:`ag-group-title ag-${t}-group-title`}]}}(e)),this.suppressOpenCloseIcons=!1,this.suppressKeyboardNavigation=!1,this.eGroupOpenedIcon=null,this.eGroupClosedIcon=null,this.eTitle=null;const{title:t,suppressOpenCloseIcons:o,suppressKeyboardNavigation:s}=e;t&&t.length>0&&(this.title=t),null!=o&&(this.suppressOpenCloseIcons=o),this.suppressKeyboardNavigation=s??!1}postConstruct(){this.setTitle(this.title),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract()}setupExpandContract(){const e=this.beans.iconSvc;this.eGroupClosedIcon.appendChild(e.createIconNoSpan("accordionClosed")),this.eGroupOpenedIcon.appendChild(e.createIconNoSpan("accordionOpen")),this.addManagedElementListeners(this.getGui(),{click:()=>this.dispatchExpandChanged(),keydown:e=>{switch(e.key){case Es:case As:e.preventDefault(),this.dispatchExpandChanged();break;case Ls:case Is:e.preventDefault(),this.dispatchExpandChanged(e.key===Ls)}}})}refreshOnExpand(e){this.refreshAriaStatus(e),this.refreshOpenCloseIcons(e)}refreshAriaStatus(e){this.suppressOpenCloseIcons||G(this.getGui(),e)}refreshOpenCloseIcons(e){const t=!this.suppressOpenCloseIcons;_(this.eGroupOpenedIcon,t&&e),_(this.eGroupClosedIcon,t&&!e)}isSuppressCollapse(){return this.suppressOpenCloseIcons}dispatchExpandChanged(e){const t={type:"expandedChanged",expanded:e};this.dispatchLocalEvent(t)}setTitle(e){const t=this.getGui(),o=!!e&&e.length>0;e=o?e:void 0,this.eTitle.textContent=e??"",_(t,o),e!==this.title&&(this.title=e);const s=t.classList.contains(Uv);return this.refreshDisabledStyles(s),this}addWidget(e){return this.getGui().appendChild(e),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.dispatchExpandChanged(!0),this}refreshDisabledStyles(e){const t=this.getGui();e?(t.classList.add(Uv),t.removeAttribute("tabindex"),P(t,"presentation")):(t.classList.remove(Uv),"string"!=typeof this.title||this.suppressKeyboardNavigation?(t.removeAttribute("tabindex"),P(t,"presentation")):(this.activateTabIndex([t]),P(t,"group")))}},jv="35.1.0",Kv={moduleName:"EnterpriseCore",version:jv,beans:[Hm],icons:{accordionOpen:"tree-open",accordionClosed:"tree-closed",accordionIndeterminate:"tree-indeterminate",close:"cross",cancel:"cancel",maximize:"maximize",minimize:"minimize",columnDrag:"grip"},dependsOn:[],setLicenseKey:Hm.setLicenseKey},_v={stopPropagationCallbacks:Rn,focusNextContainer:(e,t)=>Vn(e,t),configureFocusableContainer:(e,t)=>{const o=e.ctrlsSvc.get("gridCtrl");o.addFocusableContainer(t),t.addDestroyFunc(()=>o.removeFocusableContainer(t))}},qv=class extends Lv{constructor(e){super(e,_v)}},Yv=class extends Tv{constructor(e){super(Rn,e)}},Zv=class extends Iv{};var Qv={tag:"div",cls:"ag-side-button",role:"presentation",children:[{tag:"button",ref:"eToggleButton",cls:"ag-button ag-side-button-button",role:"tab",attrs:{type:"button",tabindex:"-1","aria-expanded":"false"},children:[{tag:"div",ref:"eIconWrapper",cls:"ag-side-button-icon-wrapper",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eLabel",cls:"ag-side-button-label"}]}]},Xv=class extends ni{constructor(e){super(),this.toolPanelDef=e,this.eToggleButton=null,this.eIconWrapper=null,this.eLabel=null}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){this.setTemplate(Qv,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}setLabel(){const e=this.toolPanelDef,t=this.getLocaleTextFunc()(e.labelKey,e.labelDefault);this.eLabel.textContent=t}setIcon(){this.eIconWrapper.insertAdjacentElement("afterbegin",ei(this.toolPanelDef.iconKey,this.beans))}onButtonPressed(){this.dispatchLocalEvent({type:"toggleButtonClicked"})}setSelected(e){this.toggleCss("ag-selected",e),G(this.eToggleButton,e)}},Jv={tag:"div",cls:"ag-side-buttons",role:"tablist"},ew={selector:"AG-SIDE-BAR-BUTTONS",component:class extends ni{constructor(){super(Jv),this.buttonComps=[]}postConstruct(){this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){e.key===Ps&&e.shiftKey&&(Vn(this.beans,!0)?e.preventDefault():yn(e))}setActiveButton(e){for(const t of this.buttonComps)t.setSelected(e===t.getToolPanelId())}addButtonComp(e){const t=this.createBean(new Xv(e));return this.buttonComps.push(t),this.appendChild(t),t.addEventListener("toggleButtonClicked",()=>{this.dispatchLocalEvent({type:"sideBarButtonClicked",toolPanelId:e.id})}),t}clearButtons(){this.buttonComps=this.destroyBeans(this.buttonComps),ie(this.getGui())}destroy(){this.clearButtons(),super.destroy()}}},tw={id:"columns",labelDefault:"Columns",labelKey:"columns",iconKey:"columnsToolPanel",toolPanel:"agColumnsToolPanel"},ow={id:"filters",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agFiltersToolPanel"},sw={columns:tw,filters:ow,"filters-new":{id:"filters-new",labelDefault:"Filters",labelKey:"filters",iconKey:"filtersToolPanel",toolPanel:"agNewFiltersToolPanel"}};function iw(e){if(e){if(!0===e)return{toolPanels:[tw,ow],defaultToolPanel:"columns"};if("string"==typeof e)return iw([e]);if(Array.isArray(e)){const t=[];for(const o of e){const e=sw[o];e?t.push(e):Et(215,{key:o,defaultByKey:sw})}if(0===t.length)return;return{toolPanels:t,defaultToolPanel:t[0].id}}return{toolPanels:nw(e.toolPanels),defaultToolPanel:e.defaultToolPanel,hiddenByDefault:e.hiddenByDefault,position:e.position,hideButtons:e.hideButtons}}}function nw(e){const t=[];return e?(e.forEach(e=>{const o=rw(e);o&&t.push(o)}),t):t}function rw(e){return"string"!=typeof e?e:sw[e]?sw[e]:(Et(215,{key:e,defaultByKey:sw}),null)}var aw=class extends ni{constructor(){super({tag:"div",cls:"ag-tool-panel-horizontal-resize"}),this.minWidth=100,this.maxWidth=null}postConstruct(){const e=this.beans.horizontalResizeSvc.addResizeBar({eResizeBar:this.getGui(),dragStartPixels:1,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this),onResizeEnd:this.onResizeEnd.bind(this)});this.addDestroyFunc(e),this.inverted=this.gos.get("enableRtl")}dispatchResizeEvent(e,t,o){this.eventSvc.dispatchEvent({type:"toolPanelSizeChanged",width:o,started:e,ended:t})}onResizeStart(){this.startingWidth=this.elementToResize.offsetWidth,this.dispatchResizeEvent(!0,!1,this.startingWidth)}onResizeEnd(e){return this.onResizing(e,!0)}onResizing(e,t=!1){const o=this.inverted?-1:1;let s=Math.max(this.minWidth,Math.floor(this.startingWidth-e*o));null!=this.maxWidth&&(s=Math.min(this.maxWidth,s)),this.elementToResize.style.width=`${s}px`,this.dispatchResizeEvent(!1,t,s)}};var lw={name:"toolPanel",optionalMethods:["refresh","getState"]},dw={tag:"div",cls:"ag-tool-panel-wrapper",role:"tabpanel"},cw=class extends ni{constructor(){super(dw)}postConstruct(){const e=this.getGui(),t=this.resizeBar=this.createManagedBean(new aw);e.setAttribute("id",`ag-${this.getCompId()}`),t.elementToResize=e,this.appendChild(t)}getToolPanelId(){return this.toolPanelId}setToolPanelDef(e,t){const{id:o,minWidth:s,maxWidth:i,width:n}=e;this.toolPanelId=o,this.width=n;const r=function(e,t,o){return e.getCompDetails(t,lw,void 0,o,!0)}(this.beans.userCompFactory,e,t);if(null==r)return!1;const a=r.newAgStackInstance();this.params=r.params,a.then(this.setToolPanelComponent.bind(this));const l=this.resizeBar;return null!=s&&(l.minWidth=s),null!=i&&(l.maxWidth=i),!0}setToolPanelComponent(e){this.toolPanelCompInstance=e,this.appendChild(e.getGui()),this.addDestroyFunc(()=>{this.destroyBean(e)});const t=this.width;t&&(this.getGui().style.width=`${t}px`)}getToolPanelInstance(){return this.toolPanelCompInstance}setResizerSizerSide(e){const t="left"===e,o=this.gos.get("enableRtl")?t:!t;this.resizeBar.inverted=o}refresh(){this.toolPanelCompInstance?.refresh(this.params)}},hw={tag:"div",cls:"ag-side-bar ag-unselectable",children:[{tag:"ag-side-bar-buttons",ref:"sideBarButtons"}]};function uw(e){return"agFiltersToolPanel"===e||"agNewFiltersToolPanel"===e}var gw={selector:"AG-SIDE-BAR",component:class extends ni{constructor(){super(hw,[ew]),this.sideBarButtons=null,this.toolPanelWrappers=[],this.registerCSS('.ag-tool-panel-wrapper{display:flex;overflow:hidden auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-side-bar-panel-width)}.ag-tool-panel-external{display:flex;flex-direction:row}:where(.ag-tool-panel-external) .ag-tool-panel-wrapper{flex-grow:1}.ag-select-agg-func-item{align-items:center;display:flex;flex:1 1 auto;flex-flow:row nowrap;height:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.ag-tool-panel-horizontal-resize{cursor:ew-resize;height:100%;position:absolute;top:0;width:5px;z-index:1}.ag-side-bar{background-color:var(--ag-side-bar-background-color);display:flex;flex-direction:row-reverse;position:relative}:where(.ag-ltr) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{right:-3px}:where(.ag-rtl) :where(.ag-side-bar-left) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-ltr) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{left:-3px}:where(.ag-rtl) :where(.ag-side-bar-right) .ag-tool-panel-horizontal-resize{right:-3px}.ag-side-bar-left{flex-direction:row;order:-1}.ag-side-buttons{background-color:var(--ag-side-button-bar-background-color);padding-top:var(--ag-side-button-bar-top-padding);position:relative}.ag-side-button{background-color:var(--ag-side-button-background-color);border-bottom:var(--ag-side-button-border);border-top:var(--ag-side-button-border);color:var(--ag-side-button-text-color);margin-top:-1px;position:relative}.ag-side-button:before{background-color:transparent;bottom:0;content:"";display:block;position:absolute;top:0;transition:background-color var(--ag-side-button-selected-underline-transition-duration);width:var(--ag-side-button-selected-underline-width)}:where(.ag-ltr) .ag-side-button:before{left:0}:where(.ag-rtl) .ag-side-button:before{right:0}.ag-side-button:hover{background-color:var(--ag-side-button-hover-background-color);color:var(--ag-side-button-hover-text-color)}.ag-side-button.ag-selected{background-color:var(--ag-side-button-selected-background-color);border-bottom:var(--ag-side-button-selected-border);border-top:var(--ag-side-button-selected-border);color:var(--ag-side-button-selected-text-color)}.ag-side-button.ag-selected:before{background-color:var(--ag-side-button-selected-underline-color)}.ag-side-button-button{align-items:center;display:flex;flex-direction:column;gap:var(--ag-spacing);position:relative;white-space:nowrap;width:100%;&:focus{box-shadow:none}}:where(.ag-ltr) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding)}:where(.ag-rtl) .ag-side-button-button{padding:var(--ag-side-button-vertical-padding) var(--ag-side-button-left-padding) var(--ag-side-button-vertical-padding) var(--ag-side-button-right-padding)}.ag-side-button-button:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-side-button-label{writing-mode:vertical-lr}@media (resolution <= 1.5x){.ag-side-button-label{font-family:"Segoe UI",var(--ag-font-family)}:where(.ag-ltr) .ag-side-button-label{transform:rotate(.05deg)}:where(.ag-rtl) .ag-side-button-label{transform:rotate(-.05deg)}}:where(.ag-ltr) .ag-side-bar-left,:where(.ag-rtl) .ag-side-bar-right{border-right:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-left:var(--ag-side-panel-border)}}:where(.ag-ltr) .ag-side-bar-right,:where(.ag-rtl) .ag-side-bar-left{border-left:var(--ag-side-panel-border);:where(.ag-tool-panel-wrapper){border-right:var(--ag-side-panel-border)}}')}postConstruct(){this.sideBarButtons.addEventListener("sideBarButtonClicked",this.onToolPanelButtonClicked.bind(this));const{beans:e,gos:t}=this,{sideBar:o}=t.get("initialState")??{};this.setSideBarDef({sideBarDef:iw(t.get("sideBar")),sideBarState:o}),this.addManagedPropertyListener("sideBar",()=>this.setState()),e.sideBar.comp=this;const s=this.getFocusableElement();this.createManagedBean(new xn(s,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),function(e,t,o){t.addManagedElementListeners(o,{keydown:t=>{if(!t.defaultPrevented&&t.key===Ps){const s=t.shiftKey;fn(e,o,!1,s)||Vn(e,s)&&t.preventDefault()}}})}(e,this,s),this.addManagedPropertyListener("enableAdvancedFilter",this.onAdvancedFilterChanged.bind(this))}onTabKeyDown(e){if(e.defaultPrevented)return;const{beans:t,sideBarButtons:o}=this,s=this.getGui(),i=o.getGui(),n=w(t),r=s.querySelector(".ag-tool-panel-wrapper:not(.ag-hidden)"),a=e.target,l=e.shiftKey;if(!r)return Vn(t,l)?(e.preventDefault(),!0):Vn(t,l,!0);if(i.contains(n))return void(mn(r,l)&&e.preventDefault());if(!l)return;let d=null;r.contains(n)?d=fn(t,r,void 0,!0):Vv(r,a)&&(d=Ov(r,a)),d||(d=i.querySelector(".ag-selected button"),d=ae(d)?d:null),d&&d!==e.target&&(e.preventDefault(),d.focus())}handleKeyDown(e){const t=w(this.beans),o=this.sideBarButtons;if(!o.getGui().contains(t))return;const s=o.getGui(),i=Array.prototype.slice.call(s.querySelectorAll(".ag-side-button")),n=i.findIndex(e=>e.contains(t));let r=null;switch(e.key){case Is:case ks:r=Math.max(0,n-1);break;case Ls:case Gs:r=Math.min(n+1,i.length-1)}if(null===r)return;const a=i[r].querySelector("button");a&&(a.focus(),e.preventDefault())}onToolPanelButtonClicked(e){const t=e.toolPanelId;this.openedItem()===t?this.openToolPanel(void 0,"sideBarButtonClicked"):this.openToolPanel(t,"sideBarButtonClicked")}clearDownUi(){this.sideBarButtons.clearButtons(),this.destroyToolPanelWrappers()}setSideBarDef({sideBarDef:e,sideBarState:t,existingToolPanelWrappers:o}){if(this.setDisplayed(!1),this.sideBar=e,e&&this.sideBarButtons.setDisplayed(!e.hideButtons),e?.toolPanels){const s=e.toolPanels;if(this.createToolPanelsAndSideButtons(s,t,o),!this.toolPanelWrappers.length)return;const i=t?t.visible:!e.hiddenByDefault;if(this.setDisplayed(i),this.setSideBarPosition(t?t.position:e.position),i)if(t){const{openToolPanel:e}=t;e&&this.openToolPanel(e,"sideBarInitializing")}else this.openToolPanel(e.defaultToolPanel,"sideBarInitializing")}}getDef(){return this.sideBar}setSideBarPosition(e){e||(e="right"),this.position=e;const t="left"===e,o=t?"right":"left";this.toggleCss("ag-side-bar-left",t),this.toggleCss("ag-side-bar-right",!t);for(const s of this.toolPanelWrappers)s.setResizerSizerSide(o);return this.dispatchSideBarUpdated(),this}setDisplayed(e,t){super.setDisplayed(e,t),this.dispatchSideBarUpdated()}getState(){const e={};for(const t of this.toolPanelWrappers)e[t.getToolPanelId()]=t.getToolPanelInstance()?.getState?.();return{visible:this.isDisplayed(),position:this.position,openToolPanel:this.openedItem(),toolPanels:e}}createToolPanelsAndSideButtons(e,t,o){for(const s of e)this.createToolPanelAndSideButton(s,t?.toolPanels?.[s.id],o?.[s.id])}validateDef(e){const{id:t,toolPanel:o}=e;return null==t?(Et(212),!1):!uw(o)||!this.beans.filterManager?.isAdvFilterEnabled()||(Et(213),!1)}createToolPanelAndSideButton(e,t,o){if(!this.validateDef(e))return void this.destroyBean(o);let s;if(o)s=o;else if(s=this.createBean(new cw),!s.setToolPanelDef(e,wo(this.gos,{initialState:t,onStateUpdated:()=>this.dispatchSideBarUpdated()})))return;s.setDisplayed(!1);const i=s.getGui(),n=e.parent instanceof HTMLElement?e.parent:this;n===e.parent&&(this.beans.environment.applyThemeClasses(n,["ag-external","ag-tool-panel-external"]),i.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr")),n.appendChild(i),this.toolPanelWrappers.push(s),z(this.sideBarButtons.addButtonComp(e).eToggleButton,i)}refresh(){for(const e of this.toolPanelWrappers)e.refresh()}renderToolPanelUnderParent(e,t){const o=this.sideBar?.toolPanels?.find(t=>("string"==typeof t?t:t.id)===e);if(o){const s=rw(o);if(s){const o=this.gos.get("initialState")?.sideBar?.toolPanels?.[s.id];s.parent=t;const i=this.toolPanelWrappers.find(t=>t.getToolPanelId()===e);this.createToolPanelAndSideButton(s,o,i)}}}openToolPanel(e,t="api",o){o&&e&&this.renderToolPanelUnderParent(e,o);const s=this.openedItem();if(s!==e){for(const t of this.toolPanelWrappers){const o=e===t.getToolPanelId();t.setDisplayed(o)}s!==this.openedItem()&&(this.sideBarButtons.setActiveButton(e),this.raiseToolPanelVisibleEvent(e,s??void 0,t))}}getToolPanelInstance(e){const t=this.toolPanelWrappers.filter(t=>t.getToolPanelId()===e)[0];if(t)return t.getToolPanelInstance();Et(214,{key:e})}raiseToolPanelVisibleEvent(e,t,o){const s=!!e&&!!t,i=this.eventSvc;t&&i.dispatchEvent({type:"toolPanelVisibleChanged",source:o,key:t,visible:!1,switchingToolPanel:s}),e&&i.dispatchEvent({type:"toolPanelVisibleChanged",source:o,key:e,visible:!0,switchingToolPanel:s})}close(e="api"){this.openToolPanel(void 0,e)}isToolPanelShowing(){return!!this.openedItem()}openedItem(){let e=null;for(const t of this.toolPanelWrappers)t.isDisplayed()&&(e=t.getToolPanelId());return e}setState(e){const t=iw(this.gos.get("sideBar")),o={};t&&this.sideBar&&t.toolPanels?.forEach(t=>{const{id:s}=t;if(!s)return;const i=this.sideBar.toolPanels?.find(e=>e.id===s);if(!i||t.toolPanel!==i.toolPanel)return;const n=this.toolPanelWrappers.find(e=>e.getToolPanelId()===s);if(!n)return;const r=wo(this.gos,{...t.toolPanelParams??{},initialState:e?.toolPanels?.[s],onStateUpdated:()=>this.dispatchSideBarUpdated()});!0===n.getToolPanelInstance()?.refresh(r)&&(this.toolPanelWrappers=this.toolPanelWrappers.filter(e=>e!==n),ne(n.getGui()),o[s]=n)}),this.clearDownUi(),this.setSideBarDef({sideBarDef:t,sideBarState:e,existingToolPanelWrappers:o})}dispatchSideBarUpdated(){this.eventSvc.dispatchEvent({type:"sideBarUpdated"})}destroyToolPanelWrappers(){for(const e of this.toolPanelWrappers)ne(e.getGui()),this.destroyBean(e);this.toolPanelWrappers.length=0}onAdvancedFilterChanged(){this.sideBar?.toolPanels?.some(e=>uw("string"==typeof e?e:e.toolPanel))&&this.setState()}destroy(){this.destroyToolPanelWrappers(),super.destroy()}}},pw={moduleName:"SideBar",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="sideBar"}getSelector(){return gw}}],apiFunctions:{isSideBarVisible:function(e){return e.sideBar?.comp.isDisplayed()??!1},setSideBarVisible:function(e,t){e.sideBar?.comp.setDisplayed(t)},setSideBarPosition:function(e,t){e.sideBar?.comp.setSideBarPosition(t)},openToolPanel:function(e,t,o){e.sideBar?.comp.openToolPanel(t,"api",o)},closeToolPanel:function(e){e.sideBar?.comp.close("api")},getOpenedToolPanel:function(e){return e.sideBar?.comp.openedItem()??null},refreshToolPanel:function(e){e.sideBar?.comp.refresh()},isToolPanelShowing:function(e){return e.sideBar?.comp.isToolPanelShowing()??!1},getToolPanelInstance:function(e,t){const o=e.sideBar?.comp.getToolPanelInstance(t);return Eh(o)},getSideBar:function(e){return e.sideBar?.comp.getDef()}},dependsOn:[Kv,Il]},mw=class extends Hv{constructor(){super({warnNoIcon:()=>Et(227)})}},fw={moduleName:"MenuItem",version:jv,userComponents:{agMenuItem:mw},icons:{check:"tick",subMenuOpen:"small-right",subMenuOpenRtl:"small-left"},css:['.ag-menu-list{cursor:default;display:table;padding:var(--ag-spacing) 0;width:100%}.ag-menu-option,.ag-menu-separator{display:table-row}.ag-menu-option-part,.ag-menu-separator-part{display:table-cell;vertical-align:middle}.ag-menu-option{cursor:pointer;font-weight:500}:where(.ag-ltr) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:right}:where(.ag-rtl) :where(.ag-menu-option-popup-pointer) .ag-icon{text-align:left}.ag-menu-option-text{white-space:nowrap}.ag-menu-option-custom{display:contents}.ag-compact-menu-option{display:flex;flex-wrap:nowrap;width:100%}.ag-compact-menu-option-text{flex:1 1 auto;white-space:nowrap}.ag-menu-separator{height:calc(var(--ag-spacing)*2 + 1px)}.ag-menu-separator-part:after{border-top:solid var(--ag-border-width) var(--ag-menu-separator-color);content:"";display:block}.ag-compact-menu-option-active,.ag-menu-option-active{background-color:var(--ag-row-hover-color)}.ag-compact-menu-option-part,.ag-menu-option-part{line-height:var(--ag-icon-size);padding:calc(var(--ag-spacing) + 2px) 0}.ag-compact-menu-option-disabled,.ag-menu-option-disabled{cursor:not-allowed;opacity:.5}.ag-compact-menu-option-icon,.ag-menu-option-icon{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-compact-menu-option-icon,:where(.ag-ltr) .ag-menu-option-icon{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-compact-menu-option-icon,:where(.ag-rtl) .ag-menu-option-icon{padding-right:calc(var(--ag-spacing)*2)}.ag-compact-menu-option-text,.ag-menu-option-text{padding-left:calc(var(--ag-spacing)*2);padding-right:calc(var(--ag-spacing)*2)}:where(.ag-ltr) .ag-compact-menu-option-shortcut,:where(.ag-ltr) .ag-menu-option-shortcut{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-shortcut,:where(.ag-rtl) .ag-menu-option-shortcut{padding-left:var(--ag-spacing)}:where(.ag-ltr) .ag-compact-menu-option-popup-pointer,:where(.ag-ltr) .ag-menu-option-popup-pointer{padding-right:var(--ag-spacing)}:where(.ag-rtl) .ag-compact-menu-option-popup-pointer,:where(.ag-rtl) .ag-menu-option-popup-pointer{padding-left:var(--ag-spacing)}.ag-menu-column-select-wrapper{height:265px;overflow:auto;:where(.ag-column-select){height:100%}}.ag-menu:where(.ag-tabs){min-width:290px}.ag-context-menu-loading-icon{pointer-events:none;position:absolute}']},Cw={tag:"div",cls:"ag-column-select-header",role:"presentation",children:[{tag:"div",ref:"eExpand",cls:"ag-column-select-header-icon"},{tag:"ag-checkbox",ref:"eSelect",cls:"ag-column-select-header-checkbox"},{tag:"ag-input-text-field",ref:"eFilterTextField",cls:"ag-column-select-header-filter-wrapper"}]},vw={selector:"AG-PRIMARY-COLS-HEADER",component:class extends ni{constructor(){super(Cw,[Tr,_g]),this.eExpand=null,this.eSelect=null,this.eFilterTextField=null}postConstruct(){this.createExpandIcons(),this.addManagedListeners(this.eExpand,{click:this.onExpandClicked.bind(this),keydown:e=>{e.key===As&&(e.preventDefault(),this.onExpandClicked())}}),this.addManagedElementListeners(this.eSelect.getInputElement(),{click:this.onSelectClicked.bind(this)}),this.addManagedPropertyListener("functionsReadOnly",()=>this.onFunctionsReadOnlyPropChanged()),this.eFilterTextField.setAutoComplete(!1).onValueChange(()=>this.onFilterTextChanged()),this.addManagedEventListeners({newColumnsLoaded:this.showOrHideOptions.bind(this)});const e=this.getLocaleTextFunc();this.eSelect.setInputAriaLabel(e("ariaColumnSelectAll","Toggle All Columns Visibility")),this.eFilterTextField.setInputAriaLabel(e("ariaFilterColumnsInput","Filter Columns Input")),this.activateTabIndex([this.eExpand])}onFunctionsReadOnlyPropChanged(){const e=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(e),this.eSelect.toggleCss("ag-column-select-column-readonly",e)}init(e){this.params=e;const t=this.gos.get("functionsReadOnly");this.eSelect.setReadOnly(t),this.eSelect.toggleCss("ag-column-select-column-readonly",t),this.beans.colModel.ready&&this.showOrHideOptions()}createExpandIcons(){const e=this.beans;this.eExpand.appendChild(this.eExpandChecked=ei("columnSelectOpen",e)),this.eExpand.appendChild(this.eExpandUnchecked=ei("columnSelectClosed",e)),this.eExpand.appendChild(this.eExpandIndeterminate=ei("columnSelectIndeterminate",e)),this.setExpandState(0)}showOrHideOptions(){const e=this.params,t=!e.suppressColumnFilter,o=!e.suppressColumnSelectAll,s=!e.suppressColumnExpandAll,i=!!this.beans.colModel.colDefCols?.treeDepth,n=this.getLocaleTextFunc();this.eFilterTextField.setInputPlaceholder(n("searchOoo","Search...")),_(this.eFilterTextField.getGui(),t),_(this.eSelect.getGui(),o),_(this.eExpand,s&&i)}onFilterTextChanged(){this.onFilterTextChangedDebounced||(this.onFilterTextChangedDebounced=qe(this,()=>{const e=this.eFilterTextField.getValue();this.dispatchLocalEvent({type:"filterChanged",filterText:e})},300)),this.onFilterTextChangedDebounced()}onSelectClicked(){this.dispatchLocalEvent({type:this.selectState?"unselectAll":"selectAll"})}onExpandClicked(){this.dispatchLocalEvent({type:0===this.expandState?"collapseAll":"expandAll"})}setExpandState(e){this.expandState=e,_(this.eExpandChecked,0===e),_(this.eExpandUnchecked,1===e),_(this.eExpandIndeterminate,2===e)}setSelectionState(e){this.selectState=e,this.eSelect.setValue(this.selectState)}}};function ww(e){return!!e&&void 0!==e.children}function bw(e){return ww(e)?e.groupId:e.colId}function yw(t,o,s){if(!ww(t))return!0;const i=t,n=s;if(((t,o)=>{const s=t.children.map(bw).includes(bw(o)),i=e(t.children),n=i&&bw(i)!==bw(o);return s&&n})(i,n))return i.children.push(n),!0;if(i.groupId===o&&!i.children.map(bw).includes(bw(n)))return i.children.push(n),!0;for(let e=i.children.length-1;e>=0&&!yw(i.children[e],o,s);e--);return!1}function Sw(e){const t=(e,t)=>ww(e)&&ww(t)&&bw(e)===bw(t),o=(e,t)=>{if(!ww(t))return e;const s=e,i=t;if(i.children&&i.groupId&&yw(s,i.groupId,i.children[0]))return s;for(const n of i.children)o(s,n);return s},s=[];for(let i=1;i<=e.length;i++){const n=e[i-1],r=e[i];t(n,r)?e[i]=o(n,r):s.push(n)}return s}function Rw(e,t){t(Sw(function(e){const t=(e,o)=>{let s;if(No(e))if(e.isPadding())s=o;else{const t=Object.assign({},e.getColGroupDef());t.groupId=e.getGroupId(),t.children=[o],s=t}else{const t=Object.assign({},e.getColDef());t.colId=e.getColId(),s=t}const i=e.getOriginalParent();return i?t(i,s):s};return e.getCols().filter(e=>{const t=e.getColDef();return e.isPrimary()&&!t.showRowGroup}).map(e=>t(e,e.getColDef()))}(e)))}var xw=class{constructor(e,t,o,s=!1,i){this.displayName=e,this.depth=o,this.group=s,this.localEventService=new u,s?(this.columnGroup=t,this._expanded=i,this.children=[]):this.column=t}get expanded(){return!!this._expanded}set expanded(e){e!==this._expanded&&(this._expanded=e,this.localEventService.dispatchEvent({type:"expandedChanged"}))}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}};function Fw(e,t,o,s){Dw(e,function(e){const t=[],o=e=>{for(const s of e)s.passesFilter&&(s.group?o(s.children):t.push(s.column))};return o(e),t}(t),o,s)}function Dw(e,t,o,s){e.colModel.isPivotMode()?function(e,t,o,s){!function(e,t,o,s){const i=[],n=t=>{if(!t.isAnyFunctionActive())if(t.isAllowValue()){const o="string"==typeof t.getAggFunc()?t.getAggFunc():e.aggFuncSvc?.getDefaultAggFunc(t);i.push({colId:t.getId(),aggFunc:o})}else t.isAllowRowGroup()?i.push({colId:t.getId(),rowGroup:!0}):t.isAllowPivot()&&i.push({colId:t.getId(),pivot:!0})},r=e=>{(e.isPivotActive()||e.isRowGroupActive()||e.isValueActive())&&i.push({colId:e.getId(),pivot:!1,rowGroup:!1,aggFunc:null})},a=o?n:r;t.forEach(a),i.length>0&&ws(e,{state:i},s)}(e,t,o,s)}(e,t,o,s):function(e,t,o,s){const i=[];for(const n of t)n.getColDef().lockVisible||n.isVisible()!=o&&i.push({colId:n.getId(),hide:!o});i.length>0&&ws(e,{state:i},s)}(e,t,o,s)}function Mw(e,t){const{columns:o,visibleState:s,pivotState:i,eventType:n}=t;ws(e,{state:o.map(t=>{const o=t.getColId();if(e.colModel.isPivotMode()){const e=i?.[o];return{colId:o,pivot:e?.pivot,rowGroup:e?.rowGroup,aggFunc:e?.aggFunc}}return{colId:o,hide:!s?.[o]}})},n)}function Pw(e){return{pivot:e.isPivotActive(),rowGroup:e.isRowGroupActive(),aggFunc:e.isValueActive()?e.getAggFunc():void 0}}function Ew(e,t){const{gos:o,rowGroupColsSvc:s}=t;if(!s||!e)return!1;const i=o.get("groupLockGroupColumns");return!(!e.isRowGroupActive()||0===i)&&(-1===i||i>s.columns.findIndex(t=>t.getColId()===e.getColId()))}function Tw(e,t,o){const s=e(t,`${"groupBy"===t?"Group by":"Un-Group by"} ${o}`,[o]);return s.indexOf(o)>=0?s:`${s} ${o}`}var Aw={name:"menuItem",optionalMethods:["setActive","select","setExpanded","configureDefaults"]},Iw={getMenuItemComp:(e,t,o)=>e.userCompFactory.getCompDetails(t,Aw,"agMenuItem",wo(e.gos,o),!0)?.newAgStackInstance()??Zs.resolve(),getPostProcessPopupParams:({column:e,node:t})=>({column:e,rowNode:t}),preserveRangesWhile:function(e,t){if(!e.gos.get("enableCellTextSelection"))return t();if(!tn()&&!en())return t();const{selection:o,ranges:s}=function(e){const t=v(e),o="getSelection"in t?t.getSelection():null,s=[];for(let i=0;i<(o?.rangeCount??0);i++){const e=o?.getRangeAt(i);e&&s.push(e)}return{selection:o,ranges:s}}(e);t(),o?.removeAllRanges();for(const i of s)o?.addRange(i)},stopPropagationCallbacks:Rn,warnNoItem:e=>{Et(228,{menuItemOrString:e})}},kw=class extends Nv{constructor(){super(Iw)}},Lw=class extends Bv{constructor(e,t={column:null,node:null,value:null}){super(e,t,Iw)}},Gw=class extends ni{constructor(e,t,o){super({tag:"div",cls:"ag-menu"}),this.column=e,this.mouseEventOrTouch=t,this.parentEl=o,this.displayName=null}postConstruct(){const{column:e,beans:{colNames:t}}=this;let o;if(this.initializeProperties(e),o=xo(e)?t.getDisplayNameForColumn(e,"columnToolPanel"):t.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),this.displayName=o,this.buildMenuItemMap(),this.isActive()){const e=this.mouseEventOrTouch;"preventDefault"in e&&e.preventDefault();const t=this.getMappedMenuItems();if(0===t.length)return;this.displayContextMenu(t)}}initializeProperties(e){let t;t=No(e)?e.getLeafColumns():[e],this.columns=t;const o=this.beans.colModel.isPivotMode();this.allowScrollIntoView=!o&&t.some(this.isColumnValidForScrollIntoView),this.allowGrouping=t.some(e=>e.isPrimary()&&e.isAllowRowGroup()),this.allowValues=t.some(e=>e.isPrimary()&&e.isAllowValue()),this.allowPivoting=o&&t.some(e=>e.isPrimary()&&e.isAllowPivot())}buildMenuItemMap(){const e=this.getLocaleTextFunc(),{beans:t,displayName:o}=this,{rowGroupColsSvc:s,valueColsSvc:i,pivotColsSvc:n,colModel:r}=t,a=/* @__PURE__ */new Map;this.menuItemMap=a;const l=r.isPivotMode();a.set("scrollIntoView",{allowedFunction:e=>!e.isPinned()&&!l&&this.isColumnValidForScrollIntoView(e),activeFunction:()=>!1,activateLabel:()=>e("scrollColumnIntoView",`Scroll ${o} into View`,[o]),activateFunction:()=>{const e=this.columns.find(this.isColumnValidForScrollIntoView);e&&this.beans.ctrlsSvc.getScrollFeature().ensureColumnVisible(e)},deActivateFunction:()=>{},addIcon:"ensureColumnVisible"});const d=e=>e.isPrimary()&&e.isAllowRowGroup()&&!Ew(e,t);a.set("rowGroup",{allowedFunction:d,activeFunction:e=>e.isRowGroupActive(),activateLabel:()=>Tw(e,"groupBy",o),deactivateLabel:()=>Tw(e,"ungroupBy",o),activateFunction:()=>s?.setColumns(this.addColumnsToList(s.columns,d),"toolPanelUi"),deActivateFunction:()=>s?.setColumns(this.removeColumnsFromList(s.columns,d),"toolPanelUi"),addIcon:"menuAddRowGroup",removeIcon:"menuRemoveRowGroup"});const c=e=>e.isPrimary()&&e.isAllowValue();a.set("value",{allowedFunction:c,activeFunction:e=>e.isValueActive(),activateLabel:()=>e("addToValues",`Add ${o} to values`,[o]),deactivateLabel:()=>e("removeFromValues",`Remove ${o} from values`,[o]),activateFunction:()=>i?.setColumns(this.addColumnsToList(i.columns,c),"toolPanelUi"),deActivateFunction:()=>i?.setColumns(this.removeColumnsFromList(i.columns,c),"toolPanelUi"),addIcon:"valuePanel",removeIcon:"valuePanel"});const h=e=>l&&e.isPrimary()&&e.isAllowPivot();a.set("pivot",{allowedFunction:h,activeFunction:e=>e.isPivotActive(),activateLabel:()=>e("addToLabels",`Add ${o} to labels`,[o]),deactivateLabel:()=>e("removeFromLabels",`Remove ${o} from labels`,[o]),activateFunction:()=>n?.setColumns(this.addColumnsToList(n.columns,h),"toolPanelUi"),deActivateFunction:()=>n?.setColumns(this.removeColumnsFromList(n.columns,h),"toolPanelUi"),addIcon:"pivotPanel",removeIcon:"pivotPanel"})}isColumnValidForScrollIntoView(e){if(!e.isVisible())return!1;const t=e.getParent();return!t||(t.getDisplayedChildren()?.includes(e)??!0)}addColumnsToList(e,t){return[...e].concat(this.columns.filter(o=>t(o)&&!e.includes(o)))}removeColumnsFromList(e,t){return e.filter(e=>t(e)&&!this.columns.includes(e))}displayContextMenu(e){const t=this.getGui(),o=this.createBean(new Lw),s=this.getLocaleTextFunc();let i=()=>{};t.appendChild(o.getGui()),o.addMenuItems(e),o.addManagedListeners(o,{closeMenu:()=>{this.parentEl.focus(),i()}});const n=this.beans.popupSvc,r=n.addPopup({modal:!0,eChild:t,closeOnEsc:!0,afterGuiAttached:()=>mn(o.getGui()),ariaLabel:s("ariaLabelContextMenu","Context Menu"),closedCallback:e=>{e instanceof KeyboardEvent&&this.parentEl.focus(),this.destroyBean(o)}});r&&(i=r.hideFunc),n.positionPopupUnderMouseEvent({type:"columnContextMenu",mouseEvent:this.mouseEventOrTouch,ePopup:t})}isActive(){return this.allowScrollIntoView||this.allowGrouping||this.allowValues||this.allowPivoting}getMappedMenuItems(){const e=[],{menuItemMap:t,columns:o,displayName:s,beans:i}=this;for(const n of t.values()){const t=o.some(e=>n.allowedFunction(e)&&!n.activeFunction(e)),r=o.some(e=>n.allowedFunction(e)&&n.activeFunction(e));t&&e.push({name:n.activateLabel(s),icon:ei(n.addIcon,i,null),action:()=>n.activateFunction()}),r&&n.removeIcon&&n.deactivateLabel&&e.push({name:n.deactivateLabel(s),icon:ei(n.removeIcon,i,null),action:()=>n.deActivateFunction?.()})}return e}},Nw={tag:"div",cls:"ag-column-select-column-group",children:[{tag:"span",ref:"eColumnGroupIcons",cls:"ag-column-group-icons",children:[{tag:"span",ref:"eGroupClosedIcon",cls:"ag-column-group-closed-icon"},{tag:"span",ref:"eGroupOpenedIcon",cls:"ag-column-group-opened-icon"}]},{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},Bw=class extends ni{constructor(e,t,o,s){super(),this.modelItem=e,this.allowDragging=t,this.eventType=o,this.focusWrapper=s,this.cbSelect=null,this.eLabel=null,this.eGroupOpenedIcon=null,this.eGroupClosedIcon=null,this.eColumnGroupIcons=null,this.processingColumnStateChange=!1;const{columnGroup:i,depth:n,displayName:r}=e;this.columnGroup=i,this.columnDepth=n,this.displayName=r}postConstruct(){this.setTemplate(Nw,[Tr]);const{beans:e,cbSelect:t,eLabel:o,displayName:s,columnDepth:i,modelItem:n,focusWrapper:r,columnGroup:a}=this,{registry:l,gos:d}=e,c=ei("columnDrag",e);this.eDragHandle=c,c.classList.add("ag-drag-handle","ag-column-select-column-group-drag-handle");const h=t.getGui(),u=t.getInputElement();h.after(c),u.setAttribute("tabindex","-1"),o.textContent=s??"",this.setupExpandContract(),this.addCss("ag-column-select-indent-"+i),this.getGui().style.setProperty("--ag-indentation-level",String(i)),this.tooltipFeature=this.createOptionalManagedBean(l.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumnGroup",shouldDisplayTooltip:Wg(d,()=>o)})),this.addManagedEventListeners({columnPivotModeChanged:this.onColumnStateChanged.bind(this)}),this.addManagedElementListeners(o,{click:this.onLabelClicked.bind(this)}),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedListeners(n,{expandedChanged:this.onExpandChanged.bind(this)});const g=new Br(this.getGui(),!1);this.addManagedListeners(g,{longTap:e=>this.onContextMenu(e.touchStart)}),this.addDestroyFunc(g.destroy.bind(g)),this.addManagedListeners(r,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)}),this.setOpenClosedIcons(),this.setupDragging(),this.onColumnStateChanged(),this.addVisibilityListenersToAllChildren(),this.refreshAriaExpanded(),this.refreshAriaLabel(),this.setupTooltip();const p=lr(a.getColGroupDef(),d,null,a);for(const m of p)this.toggleCss(m,!0)}getColumns(){return this.columnGroup.getLeafColumns()}setupTooltip(){const e=this.columnGroup.getColGroupDef();if(!e)return;const t=()=>this.tooltipFeature?.setTooltipAndRefresh(e.headerTooltip);t(),this.addManagedEventListeners({newColumnsLoaded:t})}handleKeyDown(e){switch(e.key){case Is:e.preventDefault(),this.modelItem.expanded=!1;break;case Ls:e.preventDefault(),this.modelItem.expanded=!0;break;case As:e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected())}}onContextMenu(e){const{columnGroup:t,gos:o}=this;if(o.get("functionsReadOnly"))return;const s=this.createBean(new Gw(t,e,this.focusWrapper));this.addDestroyFunc(()=>{s.isAlive()&&this.destroyBean(s)})}addVisibilityListenersToAllChildren(){const e=this.onColumnStateChanged.bind(this);for(const t of this.columnGroup.getLeafColumns())this.addManagedListeners(t,{visibleChanged:e,columnValueChanged:e,columnPivotChanged:e,columnRowGroupChanged:e})}setupDragging(){if(!this.allowDragging)return void _(this.eDragHandle,!1);const e=this.beans,{gos:t,eventSvc:o,dragAndDrop:s}=e;let i=!t.get("suppressDragLeaveHidesColumns");const n={type:Li.ToolPanel,eElement:this.eDragHandle,dragItemName:this.displayName,getDefaultIconName:()=>i?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{i=!t.get("suppressDragLeaveHidesColumns"),o.dispatchEvent({type:"columnPanelItemDragStart",column:this.columnGroup})},onDragStopped:()=>{o.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:t=>{i&&Mw(e,{columns:this.columnGroup.getLeafColumns(),visibleState:t?.visibleState,pivotState:t?.pivotState,eventType:this.eventType})},onGridExit:()=>{i&&this.onChangeCommon(!1)}};s.addDragSource(n,!0),this.addDestroyFunc(()=>s.removeDragSource(n))}createDragItem(){const e=this.columnGroup.getLeafColumns(),t={},o={};for(const s of e){const e=s.getId();t[e]=s.isVisible(),o[e]=Pw(s)}return{columns:e,visibleState:t,pivotState:o}}setupExpandContract(){const{beans:e,eGroupClosedIcon:t,eGroupOpenedIcon:o,eColumnGroupIcons:s}=this;t.appendChild(Js("columnSelectClosed",e,null)),o.appendChild(Js("columnSelectOpen",e,null));const i=this.onExpandOrContractClicked.bind(this);this.addManagedElementListeners(t,{click:i}),this.addManagedElementListeners(o,{click:i});const n=new Br(s,!0);this.addManagedListeners(n,{tap:i}),this.addDestroyFunc(n.destroy.bind(n))}onLabelClicked(){const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}getVisibleLeafColumns(){const e=[],t=o=>{for(const s of o)s.passesFilter&&(s.group?t(s.children):e.push(s.column))};return t(this.modelItem.children),e}onChangeCommon(e){this.refreshAriaLabel(),this.processingColumnStateChange||Fw(this.beans,this.modelItem.children,e,this.eventType)}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:o}=this,s=this.getLocaleTextFunc(),i=s("ariaColumnGroup","Column Group"),n=e.getValue(),r=void 0===n?s("ariaIndeterminate","indeterminate"):n?s("ariaVisible","visible"):s("ariaHidden","hidden"),a=s("ariaToggleVisibility","Press SPACE to toggle visibility");E(t,`${o} ${i}`),e.setInputAriaLabel(`${a} (${r})`),A(t,e.getInputElement().id)}onColumnStateChanged(){const e=this.workOutSelectedValue(),t=this.workOutReadOnlyValue();this.processingColumnStateChange=!0;const o=this.cbSelect;o.setValue(e),o.setReadOnly(t),this.toggleCss("ag-column-select-column-group-readonly",t),this.processingColumnStateChange=!1}workOutSelectedValue(){const e=this.beans.colModel.isPivotMode(),t=this.getVisibleLeafColumns();let o=0,s=0;for(const i of t)!e&&i.getColDef().lockVisible||(this.isColumnChecked(i,e)?o++:s++);if(!(o>0&&s>0))return o>0}workOutReadOnlyValue(){const e=this.beans.colModel.isPivotMode();let t=0;for(const o of this.columnGroup.getLeafColumns())e?o.isAnyFunctionAllowed()&&t++:o.getColDef().lockVisible||t++;return 0===t}isColumnChecked(e,t){if(t){const t=e.isPivotActive(),o=e.isRowGroupActive(),s=e.isValueActive();return t||o||s}return e.isVisible()}onExpandOrContractClicked(){const e=this.modelItem;e.expanded=!e.expanded}onExpandChanged(){this.setOpenClosedIcons(),this.refreshAriaExpanded()}setOpenClosedIcons(){const e=this.modelItem.expanded;_(this.eGroupClosedIcon,!e),_(this.eGroupOpenedIcon,e)}refreshAriaExpanded(){G(this.focusWrapper,this.modelItem.expanded)}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect,o=t.getValue();!t.isReadOnly()&&(e&&!o||!e&&o)&&t.toggle()}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}setSelected(e){this.cbSelect.setValue(e,!0)}},Hw=e=>No(e)?e.getLeafColumns():e?[e]:[],Ow=(e,t,o)=>{if(!t)return 0;const s=t[0],i=t.length;return e.indexOf(s)!(!e.get("suppressMovableColumns")&&!t.colModel.isPivotMode())||!!o.find(({colDef:e})=>!!e.suppressMovable||!!e.lockPosition),zw=(e,t,o)=>{if(!o)return;const{component:s}=o;let i=null,n="top"===o.position;if(s instanceof Bw?(i=s.getColumns()[0],n=!0):s&&(i=s.column),!i)return;const r=((e,t,o,s)=>{if(!o||!t)return null;const i=e.colModel.getCols(),n=i.indexOf(o),r=s?n:n+1;return r-Ow(i,t,r)})(e,t,i,n);null!=r&&e.colMoves?.moveColumns(t,r,"toolPanelUi")},Ww={tag:"div",cls:"ag-column-select-column",children:[{tag:"ag-checkbox",ref:"cbSelect",cls:"ag-column-select-checkbox"},{tag:"span",ref:"eLabel",cls:"ag-column-select-column-label"}]},Uw=class extends ni{constructor(e,t,o,s){super(),this.modelItem=e,this.allowDragging=t,this.groupsExist=o,this.focusWrapper=s,this.eLabel=null,this.cbSelect=null,this.processingColumnStateChange=!1;const{column:i,depth:n,displayName:r}=e;this.column=i,this.columnDepth=n,this.displayName=r}postConstruct(){this.setTemplate(Ww,[Tr]);const{beans:e,cbSelect:t,displayName:o,eLabel:s,columnDepth:i,groupsExist:n,column:r,gos:a,focusWrapper:l}=this,d=ei("columnDrag",e);this.eDragHandle=d,d.classList.add("ag-drag-handle","ag-column-select-column-drag-handle");const c=t.getGui(),h=t.getInputElement();c.after(d),h.setAttribute("tabindex","-1"),s.textContent=o,n&&this.addCss("ag-column-select-add-group-indent"),this.addCss(`ag-column-select-indent-${i}`),this.getGui().style.setProperty("--ag-indentation-level",String(i)),this.tooltipFeature=this.createOptionalManagedBean(e.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.focusWrapper,getLocation:()=>"columnToolPanelColumn",shouldDisplayTooltip:Wg(a,()=>s),getAdditionalParams:()=>({colDef:r.getColDef()})})),this.setupDragging();const u=this.onColumnStateChanged.bind(this);this.addManagedEventListeners({columnPivotModeChanged:u}),this.addManagedListeners(r,{columnValueChanged:u,columnPivotChanged:u,columnRowGroupChanged:u,visibleChanged:u}),this.addManagedListeners(l,{keydown:this.handleKeyDown.bind(this),contextmenu:this.onContextMenu.bind(this)});const g=new Br(l);this.addManagedListeners(g,{longTap:e=>this.onContextMenu(e.touchStart)}),this.addDestroyFunc(g.destroy.bind(g)),this.addManagedPropertyListener("functionsReadOnly",this.onColumnStateChanged.bind(this)),this.addManagedListeners(t,{fieldValueChanged:this.onCheckboxChanged.bind(this)}),this.addManagedElementListeners(s,{click:this.onLabelClicked.bind(this)}),this.onColumnStateChanged(),this.refreshAriaLabel(),this.setupTooltip();const p=lr(r.getColDef(),a,r,null);for(const m of p)this.toggleCss(m,!0)}getColumn(){return this.column}setupTooltip(){const e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.column.getColDef().headerTooltip);e(),this.addManagedEventListeners({newColumnsLoaded:e})}onContextMenu(e){const{column:t,gos:o}=this;if(o.get("functionsReadOnly"))return;const s=this.createBean(new Gw(t,e,this.focusWrapper));this.addDestroyFunc(()=>{s.isAlive()&&this.destroyBean(s)})}handleKeyDown(e){e.key===As&&(e.preventDefault(),this.isSelectable()&&this.onSelectAllChanged(!this.isSelected()))}onLabelClicked(){if(this.gos.get("functionsReadOnly"))return;const e=!this.cbSelect.getValue();this.onChangeCommon(e)}onCheckboxChanged(e){this.onChangeCommon(e.selected)}onChangeCommon(e){this.cbSelect.isReadOnly()||(this.refreshAriaLabel(),this.processingColumnStateChange||Dw(this.beans,[this.column],e,"toolPanelUi"))}refreshAriaLabel(){const{cbSelect:e,focusWrapper:t,displayName:o}=this,s=this.getLocaleTextFunc(),i=s("ariaColumn","Column"),n=e.getValue()?s("ariaVisible","visible"):s("ariaHidden","hidden"),r=s("ariaToggleVisibility","Press SPACE to toggle visibility");E(t,`${o} ${i}`),this.cbSelect.setInputAriaLabel(`${r} (${n})`),A(t,e.getInputElement().id)}setupDragging(){const e=this.eDragHandle;if(!this.allowDragging)return void _(e,!1);const t=this.beans,{gos:o,eventSvc:s,dragAndDrop:i}=t;let n=!o.get("suppressDragLeaveHidesColumns");const r={type:Li.ToolPanel,eElement:e,dragItemName:this.displayName,getDefaultIconName:()=>n?"hide":"notAllowed",getDragItem:()=>this.createDragItem(),onDragStarted:()=>{n=!o.get("suppressDragLeaveHidesColumns"),s.dispatchEvent({type:"columnPanelItemDragStart",column:this.column})},onDragStopped:()=>{s.dispatchEvent({type:"columnPanelItemDragEnd"})},onGridEnter:e=>{n&&Mw(t,{columns:[this.column],visibleState:e?.visibleState,pivotState:e?.pivotState,eventType:"toolPanelUi"})},onGridExit:()=>{n&&this.onChangeCommon(!1)}};i.addDragSource(r,!0),this.addDestroyFunc(()=>i.removeDragSource(r))}createDragItem(){const e=this.column.getColId(),t={[e]:this.column.isVisible()},o={[e]:Pw(this.column)};return{columns:[this.column],visibleState:t,pivotState:o}}onColumnStateChanged(){this.processingColumnStateChange=!0;const e=this.beans.colModel.isPivotMode();if(e){const e=this.column.isAnyFunctionActive();this.cbSelect.setValue(e)}else this.cbSelect.setValue(this.column.isVisible());let t=!0,o=!0;if(e){const e=this.gos.get("functionsReadOnly"),s=!this.column.isAnyFunctionAllowed();t=!e&&!s,o=t}else{const{enableRowGroup:e,enableValue:s,lockPosition:i,suppressMovable:n,lockVisible:r}=this.column.getColDef();t=!r,o=!!e||!!s||!(!!i||!!n)}this.cbSelect.setReadOnly(!t),this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!o),this.toggleCss("ag-column-select-column-readonly",!o&&!t),this.cbSelect.setPassive(!1),this.processingColumnStateChange=!1}getDisplayName(){return this.displayName}onSelectAllChanged(e){const t=this.cbSelect;e!==t.getValue()&&(t.isReadOnly()||t.toggle())}isSelected(){return this.cbSelect.getValue()}isSelectable(){return!this.cbSelect.isReadOnly()}isExpandable(){return!1}setExpanded(e){Et(158)}},$w=class{constructor(e){this.items=e}getRowCount(){return this.items.length}getRow(e){return this.items[e]}},jw={selector:"AG-PRIMARY-COLS-LIST",component:class extends ni{constructor(){super({tag:"div",cls:"ag-column-select-list",role:"presentation"}),this.destroyColumnItemFuncs=[],this.hasLoadedInitialState=!1,this.isInitialState=!1,this.skipRefocus=!1}wireBeans(e){this.colModel=e.colModel}destroy(){this.destroyColumnTree(),super.destroy()}destroyColumnTree(){this.allColsTree=[];for(const e of this.destroyColumnItemFuncs)e();this.destroyColumnItemFuncs=[]}init(e,t,o){this.params=e;const{suppressSyncLayoutWithGrid:s,contractColumnSelection:i,suppressColumnMove:n}=e;this.allowDragging=t,this.eventType=o,s||this.addManagedEventListeners({columnMoved:this.onColumnsChanged.bind(this)}),this.addManagedEventListeners({newColumnsLoaded:this.onColumnsChanged.bind(this)});const r=this.fireSelectionChangedEvent.bind(this);this.addManagedEventListeners({columnPivotChanged:r,columnPivotModeChanged:r,columnRowGroupChanged:r,columnValueChanged:r,columnVisible:r,newColumnsLoaded:r}),this.expandGroupsByDefault=!i;const a=n||s,l=this.createManagedBean(new Yv({cssIdentifier:"column-select",ariaRole:"tree",moveItemCallback:(e,t)=>{a||this.moveItems(e,t)}}));this.virtualList=l,this.appendChild(l.getGui()),l.setComponentCreator((e,t)=>{var o,s;return o=t,s=e.depth+1,x(o,"level",s),this.createComponentFromItem(e,t)}),this.colModel.ready&&this.onColumnsChanged(),a||this.createItemDragFeature()}createItemDragFeature(){const{gos:e,beans:t,virtualList:o}=this;this.createManagedBean(new Zv(this,o,{dragSourceType:Li.ToolPanel,addListeners:(e,t,o)=>{e.addManagedEventListeners({columnPanelItemDragStart:t,columnPanelItemDragEnd:o})},getCurrentDragValue:e=>(e=>e.column)(e),isMoveBlocked:o=>Vw(e,t,Hw(o)),getNumRows:e=>e.getDisplayedColsList().length,moveItem:(e,o)=>zw(t,Hw(e),o)}))}moveItems(e,t){const{gos:o,beans:s}=this,{modelItem:i}=e,{group:n,columnGroup:r,column:a,expanded:l}=i,d=Hw(n?r:a);if(Vw(o,s,d))return;const c=this.displayedColsList.indexOf(i),h=t?-1:1;let u=0;if(t){const t=e.columnDepth>0?a.getParent()?.getChildren():null;t?.length&&a===t[0]&&(u=-1)}else n&&(u=l?i.children.length:0);const g=Math.min(Math.max(c+u+h,0),this.displayedColsList.length-1);this.skipRefocus=!0,zw(s,d,{rowIndex:g,position:t?"top":"bottom",component:this.virtualList.getComponentAt(g)}),this.focusRowIfAlive(g-u).then(()=>{this.skipRefocus=!1})}createComponentFromItem(e,t){const o=this.allowDragging;if(e.group){const s=new Bw(e,o,this.eventType,t);return this.createBean(s),s}const s=new Uw(e,o,this.groupsExist,t);return this.createBean(s),s}onColumnsChanged(){const e=this.params;this.hasLoadedInitialState||(this.hasLoadedInitialState=!0,this.isInitialState=!!e.initialState);const t=this.getExpandedStates(),o=this.colModel.isPivotMode();e.suppressSyncLayoutWithGrid||o?this.buildTreeFromProvidedColumnDefs():this.buildTreeFromWhatGridIsDisplaying(),this.setExpandedStates(t),this.markFilteredColumns(),this.flattenAndFilterModel(),this.isInitialState=!1}getDisplayedColsList(){return this.displayedColsList}getExpandedStates(){const e={};if(this.isInitialState){const{expandedGroupIds:t}=this.params.initialState;for(const o of t)e[o]=!0;return e}return this.allColsTree?(this.forEachItem(t=>{if(!t.group)return;const o=t.columnGroup;o&&(e[o.getId()]=t.expanded)}),e):{}}setExpandedStates(e){if(!this.allColsTree)return;const{isInitialState:t}=this;this.forEachItem(o=>{if(!o.group)return;const s=o.columnGroup;if(s){const i=e[s.getId()];(null!=i||t)&&(o.expanded=!!i)}})}buildTreeFromWhatGridIsDisplaying(){Rw(this.colModel,this.setColumnLayout.bind(this))}setColumnLayout(e){const t=function(e,t){const o=[],s=(t,i)=>{if(ww(t)){const e=t,o=new Bo(e,void 0!==e.groupId?e.groupId:e.headerName,!1,i),n=[];for(const t of e.children){const e=s(t,i+1);e&&n.push(e)}return o.setChildren(n),o}{const s=t,i=s.colId?s.colId:s.field,n=e.getColDefCol(i);return n||o.push(s),n}},i=[];for(const n of t){const e=s(n,0);e&&i.push(e)}return o.length>0&&Et(217,{invalidColIds:o}),i}(this.colModel,e);this.buildListModel(t),this.groupsExist=e.some(e=>e&&void 0!==e.children),this.markFilteredColumns(),this.flattenAndFilterModel()}buildTreeFromProvidedColumnDefs(){const e=this.colModel;this.buildListModel(e.getColDefColTree()),this.groupsExist=!!e.colDefCols?.treeDepth}buildListModel(e){const t=this.onColumnExpanded.bind(this),o=e=>{e.addEventListener("expandedChanged",t);const o=e.removeEventListener.bind(e,"expandedChanged",t);this.destroyColumnItemFuncs.push(o)},s=this.beans.colNames,i=(e,t,o)=>{for(const s of e)No(s)?n(s,t,o):r(s,t,o)},n=(e,t,n)=>{if(e.getColGroupDef()?.suppressColumnsToolPanel)return;if(e.isPadding())return void i(e.getChildren(),t,n);const r=new xw(s.getDisplayNameForProvidedColumnGroup(null,e,"columnToolPanel"),e,t,!0,this.expandGroupsByDefault);n.push(r),o(r),i(e.getChildren(),t+1,r.children)},r=(e,t,o)=>{if(e.getColDef()?.suppressColumnsToolPanel)return;const i=s.getDisplayNameForColumn(e,"columnToolPanel");o.push(new xw(i,e,t))};this.destroyColumnTree(),i(e,0,this.allColsTree)}onColumnExpanded(){this.flattenAndFilterModel()}flattenAndFilterModel(){this.displayedColsList=[];const e=t=>{t.passesFilter&&(this.displayedColsList.push(t),t.group&&t.expanded&&t.children.forEach(e))},t=this.virtualList;this.allColsTree.forEach(e),t.setModel(new $w(this.displayedColsList));let o=null;this.skipRefocus||(o=t.getLastFocusedRow()),t.refresh(),null!=o&&this.focusRowIfAlive(o),this.notifyListeners(),this.refreshAriaLabel()}refreshAriaLabel(){const e=this.getLocaleTextFunc(),t=e("ariaColumnPanelList","Column List"),o=e("columns","Columns"),s=this.displayedColsList.length;E(this.virtualList.getAriaElement(),`${t} ${s} ${o}`)}focusRowIfAlive(e){return-1===e?Promise.resolve():new Promise(t=>{window.setTimeout(()=>{this.isAlive()&&this.virtualList.focusRow(e),t()},0)})}forEachItem(e){const t=o=>{for(const s of o)e(s),s.group&&t(s.children)},o=this.allColsTree;o&&t(o)}doSetExpandedAll(e){this.forEachItem(t=>{t.group&&(t.expanded=e)})}setGroupsExpanded(e,t){if(!t)return void this.doSetExpandedAll(e);const o=[];this.forEachItem(s=>{if(!s.group)return;const i=s.columnGroup.getId();t.indexOf(i)>=0&&(s.expanded=e,o.push(i))});const s=t.filter(e=>!o.includes(e));s.length>0&&Et(157,{unrecognisedGroupIds:s})}getExpandState(){let e=0,t=0;return this.forEachItem(o=>{o.group&&(o.expanded?e++:t++)}),e>0&&t>0?2:t>0?1:0}doSetSelectedAll(e){Fw(this.beans,this.allColsTree,e,this.eventType)}getSelectionState(){let e=0,t=0;const o=this.colModel.isPivotMode();if(this.forEachItem(s=>{if(s.group)return;if(!s.passesFilter)return;const i=s.column,n=i.getColDef();let r;if(o){if(!i.isAllowPivot()&&!i.isAllowRowGroup()&&!i.isAllowValue())return;r=i.isValueActive()||i.isPivotActive()||i.isRowGroupActive()}else{if(n.lockVisible)return;r=i.isVisible()}r?e++:t++}),!(e>0&&t>0))return!(0===e||t>0)}setFilterText(e){this.filterText=a(e)?e.toLowerCase():null,this.markFilteredColumns(),this.flattenAndFilterModel()}markFilteredColumns(){const e=e=>{if(!a(this.filterText))return!0;const t=e.displayName;return null==t||-1!==t.toLowerCase().indexOf(this.filterText)},t=(o,s)=>{let i=!1;if(o.group){const n=e(o);for(const e of o.children){const o=t(e,n||s);o&&(i=o)}}const n=!(!s&&!i)||e(o);return o.passesFilter=n,n};for(const o of this.allColsTree)t(o,!1)}notifyListeners(){this.fireGroupExpandedEvent(),this.fireSelectionChangedEvent()}fireGroupExpandedEvent(){const e=this.getExpandState();this.dispatchLocalEvent({type:"groupExpanded",state:e})}fireSelectionChangedEvent(){if(!this.allColsTree)return;const e=this.getSelectionState();this.dispatchLocalEvent({type:"selectionChanged",state:e})}getExpandedGroups(){const e=[];return this.allColsTree?(this.forEachItem(t=>{t.group&&t.expanded&&e.push(t.columnGroup.getId())}),e):e}}},Kw={tag:"div",cls:"ag-column-select",children:[{tag:"ag-primary-cols-header",ref:"primaryColsHeaderPanel"},{tag:"ag-primary-cols-list",ref:"primaryColsListPanel"}]},_w=class extends ni{constructor(){super(Kw,[vw,jw]),this.primaryColsHeaderPanel=null,this.primaryColsListPanel=null,this.registerCSS(".ag-column-select{display:flex;flex:3 1 0px;flex-direction:column;overflow:hidden;position:relative}.ag-column-select-header{flex:none;height:var(--ag-header-height);padding-left:var(--ag-widget-container-horizontal-padding);padding-right:var(--ag-widget-container-horizontal-padding)}.ag-column-select-column,.ag-column-select-column-group,.ag-column-select-header{align-items:center;display:flex;gap:var(--ag-widget-horizontal-spacing);position:relative}.ag-column-select-column,.ag-column-select-column-group{height:100%}:where(.ag-ltr) .ag-column-select-column,:where(.ag-ltr) .ag-column-select-column-group{padding-left:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}:where(.ag-rtl) .ag-column-select-column,:where(.ag-rtl) .ag-column-select-column-group{padding-right:calc(var(--ag-indentation-level)*var(--ag-column-select-indent-size))}.ag-column-select-column-group:where(:not(:last-child)),.ag-column-select-column:where(:not(:last-child)){margin-bottom:var(--ag-widget-vertical-spacing)}.ag-column-select-header-icon{border-radius:var(--ag-border-radius);cursor:pointer;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);&:focus-visible{box-shadow:var(--ag-focus-shadow)}}.ag-column-select-header-filter-wrapper{flex:1 1 auto}.ag-column-select-header-filter{width:100%}.ag-column-select-list{flex:1 1 0px;overflow:hidden}:where(.ag-ltr) .ag-column-select-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}:where(.ag-rtl) .ag-column-select-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-spacing)*1.5)}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly{opacity:.5;pointer-events:none;.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-column-select-virtual-list-viewport{padding:calc(var(--ag-widget-container-vertical-padding)*.5) 0}.ag-column-select-virtual-list-item{padding:0 var(--ag-widget-container-horizontal-padding)}.ag-column-select-column-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-select-checkbox{display:flex}")}init(e,t,o){const{primaryColsHeaderPanel:s,primaryColsListPanel:i}=this;s.init(t);const n=t.suppressColumnFilter,r=t.suppressColumnSelectAll;t.suppressColumnExpandAll&&n&&r&&s.setDisplayed(!1),this.addManagedListeners(i,{groupExpanded:e=>{s.setExpandState(e.state),t.onStateUpdated()},selectionChanged:e=>s.setSelectionState(e.state)}),i.init(t,e,o),this.addManagedListeners(s,{expandAll:i.doSetExpandedAll.bind(i,!0),collapseAll:i.doSetExpandedAll.bind(i,!1),selectAll:i.doSetSelectedAll.bind(i,!0),unselectAll:i.doSetSelectedAll.bind(i,!1),filterChanged:e=>i.setFilterText(e.filterText)}),this.positionableFeature=this.createManagedBean(new Ji(this.getGui(),{minHeight:100}))}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0})}expandGroups(e){this.primaryColsListPanel.setGroupsExpanded(!0,e)}collapseGroups(e){this.primaryColsListPanel.setGroupsExpanded(!1,e)}setColumnLayout(e){this.primaryColsListPanel.setColumnLayout(e)}syncLayoutWithGrid(){this.primaryColsListPanel.onColumnsChanged()}getExpandedGroups(){return this.primaryColsListPanel.getExpandedGroups()}};function qw(e,t,o){null!=e&&null!=t&&e.splice(o,0,...t)}var Yw={tag:"div",cls:"ag-unselectable",role:"presentation"},Zw=class extends ni{constructor(e){super(Yw),this.horizontal=e,this.state="notDragging",this.guiDestroyFunctions=[],this.childPillComponents=[],this.resizeEnabled=!1,this.addElementClasses(this.getGui()),this.ePillDropList=Xs({tag:"div"}),this.addElementClasses(this.ePillDropList,"list"),this.registerCSS(".ag-column-drop{align-items:center;display:inline-flex;overflow:auto;position:relative;width:100%}.ag-column-drop-list{align-items:center;display:flex}.ag-column-drop-cell{align-items:center;background-color:var(--ag-column-drop-cell-background-color);border:var(--ag-column-drop-cell-border);border-radius:500px;color:var(--ag-column-drop-cell-text-color);display:flex;padding:calc(var(--ag-spacing)*.25);position:relative;&:focus-visible{box-shadow:var(--ag-focus-shadow)}:where(.ag-drag-handle){color:var(--ag-column-drop-cell-drag-handle-color)}}:where(.ag-ltr) .ag-column-drop-cell{padding-left:calc(var(--ag-spacing)*.75)}:where(.ag-rtl) .ag-column-drop-cell{padding-right:calc(var(--ag-spacing)*.75)}.ag-column-drop-cell-text{flex:1 1 auto;margin:0 var(--ag-spacing);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-column-drop-vertical{align-items:stretch;display:flex;flex-direction:column;min-height:75px;overflow:hidden}.ag-column-drop-vertical-title-bar{align-items:center;display:flex;flex:none;padding:var(--ag-widget-container-vertical-padding) calc(var(--ag-spacing)*2) 0}.ag-column-drop-vertical-list{align-items:stretch;flex-direction:column;flex-grow:1;overflow-x:auto;padding-bottom:var(--ag-spacing);padding-left:var(--ag-spacing);padding-right:var(--ag-spacing);position:relative}:where(.ag-column-drop-empty) .ag-column-drop-vertical-list{overflow:hidden}.ag-column-drop-cell-button{cursor:pointer;min-width:0;opacity:.75}:where(.ag-ltr) .ag-column-drop-cell-button{margin-right:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-button{margin-left:calc(var(--ag-spacing)/4)}.ag-column-drop-cell-button:hover{opacity:1}:where(.ag-ltr) .ag-column-drop-cell-drag-handle{margin-left:calc(var(--ag-spacing)/4)}:where(.ag-rtl) .ag-column-drop-cell-drag-handle{margin-right:calc(var(--ag-spacing)/4)}.ag-column-drop-wrapper{display:flex}.ag-column-drop-horizontal-half-width{width:50%!important}.ag-column-drop-cell-ghost{opacity:.5}.ag-column-drop-horizontal{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;white-space:nowrap}:where(.ag-ltr) .ag-column-drop-horizontal{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-column-drop-horizontal{padding-right:var(--ag-cell-horizontal-padding)}.ag-column-drop-horizontal-list{gap:var(--ag-cell-widget-spacing)}.ag-column-drop-vertical-cell{margin-top:var(--ag-spacing)}:where(.ag-ltr) .ag-column-drop-vertical-icon{margin-right:var(--ag-widget-horizontal-spacing)}:where(.ag-rtl) .ag-column-drop-vertical-icon{margin-left:var(--ag-widget-horizontal-spacing)}.ag-select-agg-func-popup{background:var(--ag-background-color);border:solid var(--ag-border-width) var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);height:calc(var(--ag-spacing)*5*3.5);padding:0;position:absolute}.ag-select-agg-func-virtual-list-item{cursor:default}:where(.ag-ltr) .ag-select-agg-func-virtual-list-item{padding-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-select-agg-func-virtual-list-item{padding-right:calc(var(--ag-spacing)*2)}.ag-select-agg-func-virtual-list-item:hover{background-color:var(--ag-selected-row-background-color)}:where(.ag-ltr) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-right:solid var(--ag-border-width) var(--ag-border-color)}:where(.ag-rtl) .ag-column-drop-horizontal-half-width:where(:not(:last-child)){border-left:solid var(--ag-border-width) var(--ag-border-color)}")}toggleResizable(e){this.positionableFeature.setResizable(!!e&&{bottom:!0}),this.resizeEnabled=e}isSourceEventFromTarget(e){const{dropZoneTarget:t,dragSource:o}=e;return t.contains(o.eElement)}destroy(){this.destroyGui(),super.destroy()}destroyGui(){for(const e of this.guiDestroyFunctions)e();this.guiDestroyFunctions.length=0,this.childPillComponents.length=0,ie(this.getGui()),ie(this.ePillDropList)}init(e){this.params=e??{},this.createManagedBean(new xn(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.onKeyDown.bind(this)})),this.setupDropTarget(),this.positionableFeature=new Ji(this.getGui()),this.createManagedBean(this.positionableFeature),this.refreshGui(),E(this.ePillDropList,this.getAriaLabel())}onTabKeyDown(t){const o=pn(this.getFocusableElement(),null,!0),s=o.length;if(0===s)return;const{shiftKey:i}=t,n=w(this.beans),r=n===o[0],a=n===e(o);1===s||r&&i||a&&!i||o[i?0:s-1].focus()}onKeyDown(e){const{key:t}=e,o=!this.horizontal;let s=t===Gs,i=t===ks;if(!o){const e=this.gos.get("enableRtl");s=!e&&t===Ls||e&&t===Is,i=!e&&t===Is||e&&t===Ls}if(s||i)if(e.preventDefault(),e.shiftKey)this.moveFocusedItem(i);else{const e=fn(this.beans,this.getFocusableElement(),!1,i);e&&e.focus()}}moveFocusedItem(e){const t=this.getFocusedItem();if(-1===t)return;const o=e?-1:1;if(!this.normalizeAndUpdateInsertIndex(t,t+o))return;const s=this.childPillComponents[t];if(!s.isMovable())return;const i=s.getItem();this.focusItemAtIndex(this.insertIndex),this.rearrangeItems([i],!0)}addElementClasses(e,t){t=t?`-${t}`:"";const o=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop${t}`,`ag-column-drop-${o}${t}`)}setupDropTarget(){this.dropTarget={getContainer:this.getGui.bind(this),getIconName:this.getIconName.bind(this),onDragging:this.onDragging.bind(this),onDragEnter:this.onDragEnter.bind(this),onDragLeave:this.onDragLeave.bind(this),onDragStop:this.onDragStop.bind(this),onDragCancel:this.onDragCancel.bind(this),isInterestedIn:this.isInterestedIn.bind(this)},this.beans.dragAndDrop?.addDropTarget(this.dropTarget)}minimumAllowedNewInsertIndex(){return 0}checkInsertIndex(e){const t=this.getNewInsertIndex(e);return!(t<0)&&this.normalizeAndUpdateInsertIndex(this.insertIndex,t)}normalizeAndUpdateInsertIndex(e,t){const o=this.minimumAllowedNewInsertIndex(),s=Math.max(o,t),i=s!==e;return i&&(this.insertIndex=s),i}getNewInsertIndex(e){const t=e.event,o=this.horizontal?t.clientX:t.clientY,s=this.childPillComponents.map(e=>e.getGui().getBoundingClientRect()),i=s.findIndex(e=>this.horizontal?e.right>o&&e.lefto);if(-1===i){const e=this.gos.get("enableRtl");return s.every(e=>o>(this.horizontal?e.right:e.bottom))?e&&this.horizontal?0:this.childPillComponents.length:s.every(e=>o<(this.horizontal?e.left:e.top))?e&&this.horizontal?this.childPillComponents.length:0:this.insertIndex}return this.insertIndex<=i?i+1:i}checkDragStartedBySelf(e){"notDragging"===this.state&&(this.state="rearrangeItems",this.potentialDndItems=this.getItems(e.dragSource.getDragItem()),this.refreshGui(),this.checkInsertIndex(e),this.refreshGui())}onDragging(e){this.checkDragStartedBySelf(e),this.checkInsertIndex(e)&&this.refreshGui()}handleDragEnterEnd(e){}onDragEnter(e){const t=this.getItems(e.dragSource.getDragItem());this.state="newItemsIn";const o=t.filter(t=>this.isItemDroppable(t,e)),s=o.every(e=>-1!==this.childPillComponents.map(e=>e.getItem()).indexOf(e));0!==o.length&&(this.potentialDndItems=o,s?this.state="notDragging":(this.handleDragEnterEnd(e),this.checkInsertIndex(e),this.refreshGui()))}isPotentialDndItems(){return!!this.potentialDndItems?.length}handleDragLeaveEnd(e){}onDragLeave(e){if("rearrangeItems"===this.state){const t=this.getItems(e.dragSource.getDragItem());this.removeItems(t)}this.isPotentialDndItems()&&(this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}onDragCancel(e){this.isPotentialDndItems()&&("newItemsIn"===this.state&&this.handleDragLeaveEnd(e),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}onDragStop(){this.isPotentialDndItems()&&("newItemsIn"===this.state?this.addItems(this.potentialDndItems):this.rearrangeItems(this.potentialDndItems),this.potentialDndItems=[],this.refreshGui()),this.state="notDragging"}removeItems(e){const t=this.getExistingItems().filter(t=>!e.includes(t));this.updateItems(t)}addItems(e){if(!e)return;const t=this.getExistingItems().slice();qw(t,e.filter(e=>t.indexOf(e)<0),this.insertIndex),this.updateItems(t)}addItem(e){this.insertIndex=this.getExistingItems().length,this.addItems([e]),this.refreshGui()}rearrangeItems(e,o){let s;return s=o?this.getExistingItems().filter(t=>-1===e.indexOf(t)):this.getNonGhostItems().slice(),qw(s,e,this.insertIndex),!t(s,this.getExistingItems())&&(this.updateItems(s),!0)}refreshGui(){let e=0;this.horizontal||(e=this.ePillDropList.scrollTop);const t=this.resizeEnabled,o=this.getFocusedItem(),{eGridDiv:s}=this.beans,i=gn();let n=null;i&&(n=fn(this.beans,s)??fn(this.beans,s,!1,!0)),this.toggleResizable(!1),this.destroyGui(),this.addIconAndTitleToGui(),this.addEmptyMessageToGui(),this.addItemsToGui(),0!==e&&(this.ePillDropList.scrollTop=e),t&&this.toggleResizable(t),i&&this.restoreFocus(o,n)}getFocusedItem(){const e=this.getGui(),t=w(this.beans);return e.contains(t)?Array.from(e.querySelectorAll(".ag-column-drop-cell")).indexOf(t):-1}focusItemAtIndex(e){const t=this.getGui(),o=Array.from(t.querySelectorAll(".ag-column-drop-cell"))[e];o&&o.focus({preventScroll:!0})}restoreFocus(e,t){const o=this.getGui(),s=Array.from(o.querySelectorAll(".ag-column-drop-cell"));if(-1===e)return;0===s.length&&t.focus();const i=s[Math.min(s.length-1,e)];i&&i.focus()}focusList(e){const t=e?this.childPillComponents.length-1:0;this.restoreFocus(t,this.getFocusableElement())}getNonGhostItems(){const e=this.getExistingItems();return this.isPotentialDndItems()?e.filter(e=>!this.potentialDndItems.includes(e)):e}addItemsToGui(){const e=this.getNonGhostItems().map(e=>this.createItemComponent(e,!1));if(this.isPotentialDndItems()){const t=this.potentialDndItems.map(e=>this.createItemComponent(e,!0));this.insertIndex>=e.length?e.push(...t):e.splice(this.insertIndex,0,...t)}this.appendChild(this.ePillDropList),e.forEach((e,t)=>{t>0&&this.addArrow(this.ePillDropList),this.ePillDropList.appendChild(e.getGui())}),this.addAriaLabelsToComponents()}addAriaLabelsToComponents(){const{childPillComponents:e,ePillDropList:t}=this,o=e.length;P(t,0===o?"presentation":"listbox");for(let s=0;sthis.destroyBean(o)),t||this.childPillComponents.push(o),o}addIconAndTitleToGui(){const{title:e,icon:t}=this.params;if(!e||!t)return;const o=Xs({tag:"div"});if(L(o,!0),this.addElementClasses(o,"title-bar"),this.addElementClasses(t,"icon"),this.toggleCss("ag-column-drop-empty",this.isExistingItemsEmpty()),o.appendChild(t),!this.horizontal){const t=Xs({tag:"span"});this.addElementClasses(t,"title"),t.textContent=e,o.appendChild(t)}this.appendChild(o)}isExistingItemsEmpty(){return 0===this.getExistingItems().length}addEmptyMessageToGui(){const{emptyMessage:e}=this.params;if(!e||!this.isExistingItemsEmpty()||this.isPotentialDndItems())return;const t=Xs({tag:"span"});t.textContent=e,this.addElementClasses(t,"empty-message"),this.ePillDropList.appendChild(t)}addArrow(e){if(this.horizontal){const t=ei(this.gos.get("enableRtl")?"panelDelimiterRtl":"panelDelimiter",this.beans);this.addElementClasses(t,"cell-separator"),e.appendChild(t)}}},Qw={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},Xw=class extends ni{constructor(e,t,o,s,i){super(),this.dragSourceDropTarget=e,this.ghost=t,this.horizontal=o,this.template=s,this.agComponents=i,this.eText=null,this.eDragHandle=null,this.eButton=null}postConstruct(){this.setTemplate(this.template??Qw,this.agComponents);const e=this.getGui(),{beans:t,eDragHandle:o,eText:s,eButton:i}=this;this.addElementClasses(e),this.addElementClasses(o,"drag-handle"),this.addElementClasses(s,"text"),this.addElementClasses(i,"button"),o.appendChild(ei("columnDrag",t)),i.appendChild(ei("cancel",t)),this.tooltipFeature=this.createOptionalManagedBean(t.registry.createDynamicBean("tooltipFeature",!1,{getGui:()=>this.getGui()})),this.setupComponents(),!this.ghost&&this.isDraggable()&&this.addDragSource(),this.setupAria(),this.setupTooltip(),this.activateTabIndex(),this.refreshDraggable()}isDraggable(){return!0}refreshDraggable(){this.eDragHandle.classList.toggle("ag-column-select-column-readonly",!this.isDraggable())}setupAria(){const e=this.getLocaleTextFunc(),t=[this.getAriaDisplayName()];this.addAdditionalAriaInstructions(t,e),E(this.getGui(),t.join(". "))}addAdditionalAriaInstructions(e,t){if(this.isRemovable()){const o=t("ariaDropZoneColumnComponentDescription","Press DELETE to remove");e.push(o)}}setupTooltip(){const e=()=>this.tooltipFeature?.setTooltipAndRefresh(this.getTooltip());e(),this.addManagedEventListeners({newColumnsLoaded:e})}getDragSourceId(){}getDefaultIconName(){return"notAllowed"}addDragSource(){const{beans:{dragAndDrop:e},eDragHandle:t}=this,o=this.createGetDragItem(),s=this.getDefaultIconName(),i={type:this.getDragSourceType(),sourceId:this.getDragSourceId(),eElement:t,getDefaultIconName:()=>s,getDragItem:o,dragItemName:this.getDisplayName()};e?.addDragSource(i,!0),this.addDestroyFunc(()=>e?.removeDragSource(i))}setupComponents(){this.eText.textContent=this.getDisplayValue(),this.setupRemove(),this.ghost&&this.addCss("ag-column-drop-cell-ghost")}isRemovable(){return!0}refreshRemove(){_(this.eButton,this.isRemovable())}setupRemove(){this.refreshRemove();const e={type:"columnRemove"};this.addGuiEventListener("keydown",e=>this.onKeyDown(e)),this.addManagedElementListeners(this.eButton,{click:t=>{this.dispatchLocalEvent(e),t.stopPropagation()}});const t=new Br(this.eButton);this.addManagedListeners(t,{tap:()=>this.dispatchLocalEvent(e)}),this.addDestroyFunc(t.destroy.bind(t))}onKeyDown(e){e.key===Ns&&this.isRemovable()&&(e.preventDefault(),this.dispatchLocalEvent({type:"columnRemove"}))}getDisplayValue(){return this.getDisplayName()}addElementClasses(e,t){t=t?`-${t}`:"";const o=this.horizontal?"horizontal":"vertical";e.classList.add(`ag-column-drop-cell${t}`,`ag-column-drop-${o}-cell${t}`)}destroy(){super.destroy(),this.dragSourceDropTarget=null}},Jw=class extends Xw{constructor(e,t,o,s,i){super(t,o,i),this.column=e,this.dropZonePurpose=s,this.eSortIndicator=null,this.popupShowing=!1}postConstruct(){const{sortSvc:e,colNames:t}=this.beans;this.template={tag:"span",role:"option",children:[{tag:"span",ref:"eDragHandle",cls:"ag-drag-handle ag-column-drop-cell-drag-handle",role:"presentation"},{tag:"span",ref:"eText",cls:"ag-column-drop-cell-text",attrs:{"aria-hidden":"true"}},e?{tag:"ag-sort-indicator",ref:"eSortIndicator"}:void 0,{tag:"span",ref:"eButton",cls:"ag-column-drop-cell-button",role:"presentation"}]},e&&(this.agComponents=[e.getSortIndicatorSelector()]),this.displayName=t.getDisplayNameForColumn(this.column,"columnDrop"),super.postConstruct(),e&&(this.setupSort(),this.addManagedEventListeners({sortChanged:()=>{this.setupAria()}})),this.isGroupingZone()&&this.addManagedPropertyListener("groupLockGroupColumns",()=>{this.refreshRemove(),this.refreshDraggable(),this.setupAria()})}getItem(){return this.column}getDisplayName(){return this.displayName}getTooltip(){return this.column.getColDef().headerTooltip}addAdditionalAriaInstructions(e,t){const o=this.gos.get("rowGroupPanelSuppressSort"),s=this.gos.get("functionsReadOnly");if(this.isAggregationZone()&&!s){const o=t("ariaDropZoneColumnValueItemDescription","Press ENTER to change the aggregation type");e.push(o)}if(this.isGroupingZone()&&this.column.isSortable()&&!o){const o=t("ariaDropZoneColumnGroupItemDescription","Press ENTER to sort");e.push(o)}super.addAdditionalAriaInstructions(e,t)}isMovable(){return this.isDraggable()}isDraggable(){return this.isReadOnly()}isRemovable(){return this.isReadOnly()}isReadOnly(){return!this.isGroupingAndLocked()&&!this.gos.get("functionsReadOnly")}getAriaDisplayName(){const e=this.getLocaleTextFunc(),{name:t,aggFuncName:o}=this.getColumnAndAggFuncName(),s=e("ariaDropZoneColumnComponentAggFuncSeparator"," of "),i={asc:e("ariaDropZoneColumnComponentSortAscending","ascending"),desc:e("ariaDropZoneColumnComponentSortDescending","descending")},n=this.column.getSort(),r=this.gos.get("rowGroupPanelSuppressSort");return[o&&`${o}${s}`,t,this.isGroupingZone()&&!r&&n&&`, ${i[n]}`].filter(e=>!!e).join("")}getColumnAndAggFuncName(){const e=this.displayName;let t="";if(this.isAggregationZone()){const e=this.column.getAggFunc(),o="string"==typeof e?e:"agg";t=this.getLocaleTextFunc()(o,o)}return{name:e,aggFuncName:t}}setupSort(){if(this.column.isSortable()&&this.isGroupingZone()&&!this.gos.get("rowGroupPanelSuppressSort")){this.eSortIndicator.setupSort(this.column,!0);const e=e=>{e.preventDefault(),this.beans.sortSvc.progressSortFromEvent(this.column,e)};this.addGuiEventListener("click",e),this.addGuiEventListener("keydown",t=>{t.key===Es&&this.isGroupingZone()&&e(t)})}}getDefaultIconName(){return"hide"}createGetDragItem(){const{column:e}=this;return()=>{const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}}setupComponents(){super.setupComponents(),this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&this.addGuiEventListener("click",this.onShowAggFuncSelection.bind(this))}onKeyDown(e){super.onKeyDown(e),e.key===Es&&this.isAggregationZone()&&!this.gos.get("functionsReadOnly")&&(e.preventDefault(),this.onShowAggFuncSelection())}getDisplayValue(){const{name:e,aggFuncName:t}=this.getColumnAndAggFuncName();return this.isAggregationZone()?`${t}(${e})`:e}onShowAggFuncSelection(){if(this.popupShowing)return;this.popupShowing=!0;const{aggFuncSvc:e,popupSvc:t}=this.beans,o=new Yv({cssIdentifier:"select-agg-func"}),s=e.getFuncNames(this.column),i=this.getGui(),n=o.getGui();o.setModel({getRow:function(e){return s[e]},getRowCount:function(){return s.length}}),this.createBean(o);const r=Xs({tag:"div",cls:"ag-select-agg-func-popup"});r.style.top="0px",r.style.left="0px",r.appendChild(n),r.style.width=`${i.clientWidth}px`;const[a]=this.addManagedElementListeners(r,{focusout:e=>{!r.contains(e.relatedTarget)&&d&&d.hideFunc()}}),l=this.getLocaleTextFunc(),d=t.addPopup({modal:!0,eChild:r,closeOnEsc:!0,closedCallback:e=>{this.destroyBean(o),this.popupShowing=!1,"Escape"===e?.key&&i.focus(),a&&a()},ariaLabel:l("ariaLabelAggregationFunction","Aggregation Function")});d&&o.setComponentCreator(this.createAggSelect.bind(this,d.hideFunc)),o.addGuiEventListener("keydown",e=>{if(e.key===Es||e.key===As){const e=o.getLastFocusedRow();if(null==e)return;const t=o.getComponentAt(e);t&&t.selectItem()}}),t.positionPopupByComponent({type:"aggFuncSelect",eventSource:i,ePopup:r,keepWithinBounds:!0,additionalParams:{column:this.column},position:"under"}),o.refresh();let c=s.findIndex(e=>e===this.column.getAggFunc());-1===c&&(c=0),o.focusRow(c)}createAggSelect(e,t){const o=this.getLocaleTextFunc(),s=t.toString();return new eb(()=>{e(),this.getGui().focus(),this.beans.valueColsSvc?.setColumnAggFunc?.(this.column,t,"toolPanelDragAndDrop")},o(s,s))}isGroupingAndLocked(){return this.isGroupingZone()&&Ew(this.column,this.beans)}isAggregationZone(){return"aggregation"===this.dropZonePurpose}isGroupingZone(){return"rowGroup"===this.dropZonePurpose}getDragSourceType(){return Li.ToolPanel}destroy(){super.destroy(),this.column=null}},eb=class extends ni{constructor(e,t){super({tag:"div",cls:"ag-select-agg-func-item",children:t}),this.selectItem=e,this.addGuiEventListener("click",this.selectItem)}},tb=class extends Zw{constructor(e,t){super(e),this.dropZonePurpose=t,this.addElementClasses(this.getGui(),this.dropZonePurpose.toLowerCase())}init(e){super.init(e),this.addManagedEventListeners({newColumnsLoaded:this.refreshGui.bind(this)}),this.addManagedPropertyListeners(["functionsReadOnly","rowGroupPanelSuppressSort","groupLockGroupColumns"],this.refreshGui.bind(this))}getItems(e){return e.columns??[]}isInterestedIn(e){return e===Li.HeaderCell||e===Li.ToolPanel}minimumAllowedNewInsertIndex(){const{gos:e,rowGroupColsSvc:t}=this.beans,o=e.get("groupLockGroupColumns"),s=t?.columns.length??0;return-1===o?s:Math.min(o,s)}showOrHideColumnOnExit(e){return this.isRowGroupPanel()&&eo(this.gos,!0)&&!e.fromNudge}handleDragEnterEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem().columns;this.setColumnsVisible(t,!1,"uiColumnDragged")}}handleDragLeaveEnd(e){if(this.showOrHideColumnOnExit(e)){const t=e.dragSource.getDragItem();this.setColumnsVisible(t.columns,!0,"uiColumnDragged")}}setColumnsVisible(e,t,o){if(e){const s=e.filter(e=>!e.getColDef().lockVisible);this.beans.colModel.setColsVisible(s,t,o)}}isRowGroupPanel(){return"rowGroup"===this.dropZonePurpose}createPillComponent(e,t,o,s){return new Jw(e,t,o,this.dropZonePurpose,s)}},ob=class extends tb{constructor(e){super(e,"pivot")}postConstruct(){const e=this.getLocaleTextFunc(),t=e("pivotColumnsEmptyMessage","Drag here to set column labels"),o=e("pivots","Column Labels");super.init({icon:ei("pivotPanel",this.beans,null),emptyMessage:t,title:o}),this.addManagedEventListeners({newColumnsLoaded:this.refresh.bind(this),columnPivotChanged:this.refresh.bind(this),columnPivotModeChanged:this.checkVisibility.bind(this)}),this.refresh()}getAriaLabel(){return this.getLocaleTextFunc()("ariaPivotDropZonePanelLabel","Column Labels")}refresh(){this.checkVisibility(),this.refreshGui()}checkVisibility(){const e=this.beans.colModel,t=e.isPivotMode();if(this.horizontal)switch(this.gos.get("pivotPanelShow")){case"always":this.setDisplayed(t);break;case"onlyWhenPivoting":{const o=e.isPivotActive();this.setDisplayed(t&&o);break}default:this.setDisplayed(!1)}else this.setDisplayed(t)}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&(e.isAllowPivot()&&(!e.isPivotActive()||this.isSourceEventFromTarget(t)))}updateItems(e){this.beans.pivotColsSvc?.setColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"pivot":"notAllowed"}getExistingItems(){return this.beans.pivotColsSvc?.columns??[]}},sb=class extends tb{constructor(e){super(e,"rowGroup")}postConstruct(){const e=this.getLocaleTextFunc(),t=e("rowGroupColumnsEmptyMessage","Drag here to set row groups"),o=e("groups","Row Groups");super.init({icon:ei("rowGroupPanel",this.beans,null),emptyMessage:t,title:o}),this.addManagedEventListeners({columnRowGroupChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaRowGroupDropZonePanelLabel","Row Groups")}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary()||e.colDef.showRowGroup)&&(e.isAllowRowGroup()&&(!e.isRowGroupActive()||this.isSourceEventFromTarget(t)))}updateItems(e){this.beans.rowGroupColsSvc?.setColumns(e,"toolPanelUi")}getIconName(){return this.isPotentialDndItems()?"group":"notAllowed"}getExistingItems(){return this.beans.rowGroupColsSvc?.columns??[]}},ib=class extends tb{constructor(e){super(e,"aggregation")}postConstruct(){const e=this.getLocaleTextFunc(),t=e("valueColumnsEmptyMessage","Drag here to aggregate"),o=e("values","Values");super.init({icon:ei("valuePanel",this.beans,null),emptyMessage:t,title:o}),this.addManagedEventListeners({columnValueChanged:this.refreshGui.bind(this)})}getAriaLabel(){return this.getLocaleTextFunc()("ariaValuesDropZonePanelLabel","Values")}getIconName(){return this.isPotentialDndItems()?"aggregate":"notAllowed"}isItemDroppable(e,t){return!(this.gos.get("functionsReadOnly")||!e.isPrimary())&&(e.isAllowValue()&&(!e.isValueActive()||this.isSourceEventFromTarget(t)))}updateItems(e){this.beans.valueColsSvc?.setColumns(e,"toolPanelUi")}getExistingItems(){return this.beans.valueColsSvc?.columns??[]}},nb={tag:"div",cls:"ag-pivot-mode-panel",children:[{tag:"ag-toggle-button",ref:"cbPivotMode",cls:"ag-pivot-mode-select"}]},rb=class extends ni{constructor(){super(...arguments),this.cbPivotMode=null}postConstruct(){this.setTemplate(nb,[Tm]);const e=this.cbPivotMode,{colModel:t,ctrlsSvc:o,gos:s}=this.beans;e.setValue(t.isPivotMode());const i=this.getLocaleTextFunc();e.setLabel(i("pivotMode","Pivot Mode"));const n=()=>{const o=t.isPivotMode();e.setValue(o)};this.addManagedListeners(e,{fieldValueChanged:()=>{const i=!!e.getValue();if(i!==t.isPivotMode()){s.updateGridOptions({options:{pivotMode:i},source:"toolPanelUi"});for(const e of o.getHeaderRowContainerCtrls())e.refresh()}}}),this.addManagedEventListeners({newColumnsLoaded:n,columnPivotModeChanged:n})}},ab={moduleName:"ColumnsToolPanel",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="colToolPanelFactory"}setPanelVisible(e,t,o){return e?e.setDisplayed(t):t&&(e=o()),e}createRowGroupPanel(e,t){return this.createPanel(e,t,new sb(!1))}createValuesPanel(e,t){return this.createPanel(e,t,new ib(!1))}createPivotPanel(e,t){return this.createPanel(e,t,new ob(!1))}createPivotModePanel(e,t,o){return this.createPanel(e,t,new rb,o)}createPanel(e,t,o,s){return o=e.createBean(o),t.push(()=>e.destroyBean(o)),s?e.prependChild(o):e.appendChild(o),o}}],userComponents:{agColumnsToolPanel:class extends ni{constructor(){super({tag:"div",cls:"ag-column-panel"}),this.initialised=!1,this.childDestroyFuncs=[],this.registerCSS(".ag-column-panel{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.ag-pivot-mode-panel{display:flex;height:var(--ag-header-height)}.ag-pivot-mode-select{align-items:center;display:flex}:where(.ag-ltr) .ag-pivot-mode-select{margin-left:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-pivot-mode-select{margin-right:var(--ag-widget-container-horizontal-padding)}.ag-column-panel-column-select{border-bottom:var(--ag-tool-panel-separator-border)}.ag-column-panel-column-select:where(:nth-child(n+2 of :not(.ag-hidden))){border-top:var(--ag-tool-panel-separator-border)}:where(.ag-column-panel) .ag-column-drop-vertical{flex:1 1 0px;min-height:50px}:where(.ag-column-panel) .ag-column-drop-vertical:where(:not(.ag-last-column-drop)){border-bottom:var(--ag-tool-panel-separator-border)}")}wireBeans(e){this.colToolPanelFactory=e.colToolPanelFactory}setVisible(e){super.setDisplayed(e),e&&!this.initialised&&this.init(this.params)}init(e){const t={...wo(this.gos,{suppressColumnMove:!1,suppressColumnSelectAll:!1,suppressColumnFilter:!1,suppressColumnExpandAll:!1,contractColumnSelection:!1,suppressPivotMode:!1,suppressRowGroups:!1,suppressValues:!1,suppressPivots:!1,suppressSyncLayoutWithGrid:!1}),...e};this.params=t;const{childDestroyFuncs:o,colToolPanelFactory:s,gos:i}=this,n=i.isModuleRegistered("SharedPivot"),r=n||i.isModuleRegistered("SharedRowGrouping");!t.suppressPivotMode&&s&&n&&(this.pivotModePanel=s.createPivotModePanel(this,o));const a=this.createBean(new _w);if(this.primaryColsPanel=a,o.push(()=>this.destroyBean(this.primaryColsPanel)),a.init(!0,t,"toolPanelUi"),a.addCss("ag-column-panel-column-select"),this.appendChild(a),s){!t.suppressRowGroups&&r&&(this.rowGroupDropZonePanel=s.createRowGroupPanel(this,o)),!t.suppressValues&&r&&(this.valuesDropZonePanel=s.createValuesPanel(this,o)),!t.suppressPivots&&n&&(this.pivotDropZonePanel=s.createPivotPanel(this,o)),this.setLastVisible();const[e]=this.addManagedEventListeners({columnPivotModeChanged:()=>{this.resetChildrenHeight(),this.setLastVisible()}});o.push(()=>e())}this.initialised=!0}setPivotModeSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.pivotModePanel=t.setPanelVisible(this.pivotModePanel,e,t.createPivotModePanel.bind(t,this,this.childDestroyFuncs,!0)),this.setLastVisible())}setRowGroupsSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.rowGroupDropZonePanel=t.setPanelVisible(this.rowGroupDropZonePanel,e,t.createRowGroupPanel.bind(t,this,this.childDestroyFuncs)),this.setLastVisible())}setValuesSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.valuesDropZonePanel=t.setPanelVisible(this.valuesDropZonePanel,e,t.createValuesPanel.bind(t,this,this.childDestroyFuncs)),this.setLastVisible())}setPivotSectionVisible(e){const t=this.colToolPanelFactory;t&&(this.pivotDropZonePanel=t.setPanelVisible(this.pivotDropZonePanel,e,t.createPivotPanel.bind(t,this,this.childDestroyFuncs)),this.pivotDropZonePanel?.setDisplayed(e),this.setLastVisible())}setResizers(){for(const e of[this.primaryColsPanel,this.rowGroupDropZonePanel,this.valuesDropZonePanel,this.pivotDropZonePanel]){if(!e)continue;const t=e.getGui();e.toggleResizable(!t.classList.contains("ag-last-column-drop")&&!t.classList.contains("ag-hidden"))}}setLastVisible(){const t=this.getGui(),o=Array.prototype.slice.call(t.querySelectorAll(".ag-column-drop"));for(const e of o)e.classList.remove("ag-last-column-drop");const s=e(t.querySelectorAll(".ag-column-drop:not(.ag-hidden)"));s&&s.classList.add("ag-last-column-drop"),this.setResizers()}resetChildrenHeight(){const e=this.getGui().children;for(let t=0;t({name:e(t,o+"β€Ž"),action:()=>this.chartSvc.createPivotChart({chartType:s}),_key:i,_enterprise:n});return{name:e("pivotChart","Pivot Chart"),_key:"pivotChart",subMenu:[{_key:"pivotColumnChart",name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped","groupedColumn","pivotGroupedColumn"),t("stackedColumn","Stacked","stackedColumn","pivotStackedColumn"),t("normalizedColumn","100% Stacked","normalizedColumn","pivotNormalizedColumn")]},{_key:"pivotBarChart",name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped","groupedBar","pivotGroupedBar"),t("stackedBar","Stacked","stackedBar","pivotStackedBar"),t("normalizedBar","100% Stacked","normalizedBar","pivotNormalizedBar")]},{_key:"pivotPieChart",name:e("pieChart","Pie"),subMenu:[t("pie","Pie","pie","pivotPie"),t("donut","Donut","donut","pivotDonut")]},{_key:"pivotLineChart",name:e("lineChart","Line"),subMenu:[t("lineChart","Line","line","pivotLineChart"),t("stackedLine","Stacked","stackedLine","pivotStackedLine"),t("normalizedLine","100% Stacked","normalizedLine","pivotNormalizedLine")]},{_key:"pivotAreaChart",name:e("areaChart","Area"),subMenu:[t("areaChart","Area","area","pivotArea"),t("stackedArea","Stacked","stackedArea","pivotStackedArea"),t("normalizedArea","100% Stacked","normalizedArea","pivotNormalizedArea")]},{_key:"pivotXYChart",name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter","scatter","pivotScatter"),t("bubble","Bubble","bubble","pivotBubble")]},{_key:"pivotStatisticalChart",_enterprise:!1,name:e("statisticalChart","Statistical"),subMenu:[t("histogramChart","Histogram","histogram","pivotHistogram",!1)]},{_key:"pivotHierarchicalChart",_enterprise:!0,name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemapChart","Treemap","treemap","pivotTreemap",!0),t("sunburstChart","Sunburst","sunburst","pivotSunburst",!0)]},{_key:"pivotFunnel",name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel","funnel","pivotFunnel"),t("coneFunnel","Cone Funnel","coneFunnel","pivotConeFunnel"),t("pyramid","Pyramid","pyramid","pivotPyramid")]},{_key:"pivotCombinationChart",name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line","columnLineCombo","pivotColumnLineCombo"),t("AreaColumnCombo","Area & Column","areaColumnCombo","pivotAreaColumnCombo")]}],icon:ei("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"pivotColumnChart",column:"pivotGroupedColumn",stackedColumn:"pivotStackedColumn",normalizedColumn:"pivotNormalizedColumn"},barGroup:{_key:"pivotBarChart",bar:"pivotGroupedBar",stackedBar:"pivotStackedBar",normalizedBar:"pivotNormalizedBar"},pieGroup:{_key:"pivotPieChart",pie:"pivotPie",donut:"pivotDonut",doughnut:"pivotDonut"},lineGroup:{_key:"pivotLineChart",line:"pivotLineChart",stackedLine:"pivotStackedLine",normalizedLine:"pivotNormalizedLine"},areaGroup:{_key:"pivotAreaChart",area:"pivotArea",stackedArea:"pivotStackedArea",normalizedArea:"pivotNormalizedArea"},scatterGroup:{_key:"pivotXYChart",bubble:"pivotBubble",scatter:"pivotScatter"},combinationGroup:{_key:"pivotCombinationChart",columnLineCombo:"pivotColumnLineCombo",areaColumnCombo:"pivotAreaColumnCombo",customCombo:null},hierarchicalGroup:{_key:"pivotHierarchicalChart",treemap:"pivotTreemap",sunburst:"pivotSunburst"},statisticalGroup:{_key:"pivotStatisticalChart",histogram:"pivotHistogram",rangeBar:null,rangeArea:null,boxPlot:null},funnelGroup:{_key:"pivotFunnel",funnel:"pivotFunnel",coneFunnel:"pivotConeFunnel",pyramid:"pivotPyramid"},polarGroup:null,specializedGroup:null}}},db=class{constructor(e,t,o){this.beans=e,this.chartSvc=t,this.getLocaleTextFunc=o}getMenuItem(){const e=this.getLocaleTextFunc(),t=(t,o,s,i,n=!1)=>({name:e(t,o),action:()=>this.chartSvc.createChartFromCurrentRange(s),_key:i,_enterprise:n});return{name:e("chartRange","Chart Range"),_key:"chartRange",subMenu:[{name:e("columnChart","Column"),subMenu:[t("groupedColumn","Grouped","groupedColumn","rangeGroupedColumn"),t("stackedColumn","Stacked","stackedColumn","rangeStackedColumn"),t("normalizedColumn","100% Stacked","normalizedColumn","rangeNormalizedColumn")],_key:"rangeColumnChart"},{name:e("barChart","Bar"),subMenu:[t("groupedBar","Grouped","groupedBar","rangeGroupedBar"),t("stackedBar","Stacked","stackedBar","rangeStackedBar"),t("normalizedBar","100% Stacked","normalizedBar","rangeNormalizedBar")],_key:"rangeBarChart"},{name:e("pieChart","Pie"),subMenu:[t("pie","Pie","pie","rangePie"),t("donut","Donut","donut","rangeDonut")],_key:"rangePieChart"},{name:e("lineChart","Line"),subMenu:[t("lineChart","Line","line","rangeLineChart"),t("stackedLine","Stacked","stackedLine","rangeStackedLine"),t("normalizedLine","100% Stacked","normalizedLine","rangeNormalizedLine")],_key:"rangeLineChart"},{name:e("areaChart","Area"),subMenu:[t("areaChart","Area","area","rangeArea"),t("stackedArea","Stacked","stackedArea","rangeStackedArea"),t("normalizedArea","100% Stacked","normalizedArea","rangeNormalizedArea")],_key:"rangeAreaChart"},{name:e("xyChart","X Y (Scatter)"),subMenu:[t("scatter","Scatter","scatter","rangeScatter"),t("bubble","Bubble","bubble","rangeBubble")],_key:"rangeXYChart"},{name:e("polarChart","Polar"),subMenu:[t("radarLine","Radar Line","radarLine","rangeRadarLine"),t("radarArea","Radar Area","radarArea","rangeRadarArea"),t("nightingale","Nightingale","nightingale","rangeNightingale"),t("radialColumn","Radial Column","radialColumn","rangeRadialColumn"),t("radialBar","Radial Bar","radialBar","rangeRadialBar")],_key:"rangePolarChart",_enterprise:!0},{name:e("statisticalChart","Statistical"),subMenu:[t("boxPlot","Box Plot","boxPlot","rangeBoxPlot",!0),t("histogramChart","Histogram","histogram","rangeHistogram",!1),t("rangeBar","Range Bar","rangeBar","rangeRangeBar",!0),t("rangeArea","Range Area","rangeArea","rangeRangeArea",!0)],_key:"rangeStatisticalChart",_enterprise:!1},{name:e("hierarchicalChart","Hierarchical"),subMenu:[t("treemap","Treemap","treemap","rangeTreemap"),t("sunburst","Sunburst","sunburst","rangeSunburst")],_key:"rangeHierarchicalChart",_enterprise:!0},{name:e("specializedChart","Specialized"),subMenu:[t("heatmap","Heatmap","heatmap","rangeHeatmap"),t("waterfall","Waterfall","waterfall","rangeWaterfall")],_key:"rangeSpecializedChart",_enterprise:!0},{name:e("funnel","Funnel"),subMenu:[t("funnel","Funnel","funnel","rangeFunnel"),t("coneFunnel","Cone Funnel","coneFunnel","rangeConeFunnel"),t("pyramid","Pyramid","pyramid","rangePyramid")],_key:"rangeFunnel",_enterprise:!0},{name:e("combinationChart","Combination"),subMenu:[t("columnLineCombo","Column & Line","columnLineCombo","rangeColumnLineCombo"),t("AreaColumnCombo","Area & Column","areaColumnCombo","rangeAreaColumnCombo")],_key:"rangeCombinationChart"}],icon:ei("chart",this.beans,void 0)}}getConfigLookup(){return{columnGroup:{_key:"rangeColumnChart",column:"rangeGroupedColumn",stackedColumn:"rangeStackedColumn",normalizedColumn:"rangeNormalizedColumn"},barGroup:{_key:"rangeBarChart",bar:"rangeGroupedBar",stackedBar:"rangeStackedBar",normalizedBar:"rangeNormalizedBar"},pieGroup:{_key:"rangePieChart",pie:"rangePie",donut:"rangeDonut",doughnut:"rangeDonut"},lineGroup:{_key:"rangeLineChart",line:"rangeLineChart",stackedLine:"rangeStackedLine",normalizedLine:"rangeNormalizedLine"},areaGroup:{_key:"rangeAreaChart",area:"rangeArea",stackedArea:"rangeStackedArea",normalizedArea:"rangeNormalizedArea"},scatterGroup:{_key:"rangeXYChart",bubble:"rangeBubble",scatter:"rangeScatter"},polarGroup:{_key:"rangePolarChart",radarLine:"rangeRadarLine",radarArea:"rangeRadarArea",nightingale:"rangeNightingale",radialColumn:"rangeRadialColumn",radialBar:"rangeRadialBar"},statisticalGroup:{_key:"rangeStatisticalChart",boxPlot:"rangeBoxPlot",histogram:"rangeHistogram",rangeBar:"rangeRangeBar",rangeArea:"rangeRangeArea"},hierarchicalGroup:{_key:"rangeHierarchicalChart",treemap:"rangeTreemap",sunburst:"rangeSunburst"},specializedGroup:{_key:"rangeSpecializedChart",heatmap:"rangeHeatmap",waterfall:"rangeWaterfall"},funnelGroup:{_key:"rangeFunnel",funnel:"rangeFunnel",coneFunnel:"rangeConeFunnel",pyramid:"rangePyramid"},combinationGroup:{_key:"rangeCombinationChart",columnLineCombo:"rangeColumnLineCombo",areaColumnCombo:"rangeAreaColumnCombo",customCombo:null}}}},cb={pinSubMenu:"PinnedColumn",pinLeft:"PinnedColumn",pinRight:"PinnedColumn",clearPinned:"PinnedColumn",pinRowSubMenu:"PinnedRow",pinBottom:"PinnedRow",pinTop:"PinnedRow",unpinRow:"PinnedRow",valueAggSubMenu:"SharedAggregation",autoSizeThis:"ColumnAutoSize",autoSizeAll:"ColumnAutoSize",rowGroup:"SharedRowGrouping",rowUnGroup:"SharedRowGrouping",resetColumns:"CommunityCore",expandAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],contractAll:["ClientSideRowModelHierarchy","ServerSideRowModel"],copy:"Clipboard",copyWithHeaders:"Clipboard",copyWithGroupHeaders:"Clipboard",cut:"Clipboard",paste:"Clipboard",export:["CsvExport","ExcelExport"],csvExport:"CsvExport",excelExport:"ExcelExport",separator:"CommunityCore",pivotChart:"IntegratedCharts",chartRange:"IntegratedCharts",columnFilter:"ColumnFilter",columnChooser:"ColumnMenu",sortAscending:"Sort",sortDescending:"Sort",sortAbsoluteAscending:"Sort",sortAbsoluteDescending:"Sort",sortUnSort:"Sort"};var hb="separator";function ub(e,t){if(e)for(let o=e.length-2;o>=0;o--){const s=e[o]===t,i=e[o+1]===t;s&&i&&e.splice(o+1,1)}}var gb={sortAscending:{fallback:"Sort Ascending",getSortDef:()=>({type:"default",direction:"asc"})},sortDescending:{fallback:"Sort Descending",getSortDef:()=>({type:"default",direction:"desc"})},sortAbsoluteAscending:{fallback:"Sort Absolute Ascending",getSortDef:()=>({type:"absolute",direction:"asc"})},sortAbsoluteDescending:{fallback:"Sort Absolute Descending",getSortDef:()=>({type:"absolute",direction:"desc"})},sortUnSort:{fallback:"Clear Sort",getSortDef:e=>({type:Lo(e.getSortDef()?.type),direction:null})}};function pb(e,t,o,s){let i;if(e.isPrimary())i=e;else{const t=e.getColDef().pivotValueColumn;i=a(t)?t:void 0}const n=[];if(i){const e=i.isValueActive(),r=t.getFuncNames(i);n.push({name:s("noAggregation","None"),action:()=>{o.removeColumns([i],"contextMenu"),o.setColumnAggFunc(i,void 0,"contextMenu")},checked:!e});for(const a of r)n.push({name:s(a,t.getDefaultFuncLabel(a)),action:()=>{o.setColumnAggFunc(i,a,"contextMenu"),o.addColumns([i],"contextMenu")},checked:e&&i.getAggFunc()===a})}return n}var mb="filterMenuTab",fb="generalMenuTab",Cb="columnsMenuTab",vb=[fb,mb,Cb],wb=class extends We{constructor(e,t,o,s,i){super(),this.column=e,this.restoreFocusParams=t,this.initialSelection=o,this.restrictTo=s,this.sourceElement=i,this.tabFactories={},this.includeChecks={};const{tabFactories:n,includeChecks:r}=this;n[fb]=this.createMainPanel.bind(this),n[mb]=this.createFilterPanel.bind(this),n[Cb]=this.createColumnsPanel.bind(this),r[fb]=()=>!0,r[mb]=()=>!!e&&!!this.beans.filterManager?.isFilterAllowed(e),r[Cb]=()=>!0}postConstruct(){const e=new zv({items:this.getTabsToCreate().map(e=>this.createTab(e)),cssClass:"ag-menu",onActiveItemClicked:this.onHidePopup.bind(this),onItemClicked:this.onTabItemClicked.bind(this)});this.tabbedLayout=this.createBean(e),this.mainMenuList?.setParentComponent(e),this.addDestroyFunc(()=>this.destroyBean(e))}getTabsToCreate(){return this.restrictTo?this.restrictTo:(this.column?.getColDef().menuTabs??vb).filter(e=>this.isValidMenuTabItem(e)&&this.isNotSuppressed(e))}isValidMenuTabItem(e){let t=!0,o=vb;return null!=this.restrictTo&&(t=this.restrictTo.indexOf(e)>-1,o=this.restrictTo),t=t&&vb.indexOf(e)>-1,t||Et(175,{menuTabName:e,itemsToConsider:o}),t}isNotSuppressed(e){return this.includeChecks[e]()}createTab(e){return this.tabFactories[e]()}showTabBasedOnPreviousSelection(){this.showTab(this.initialSelection)}showTab(e){const{tabItemColumns:t,tabbedLayout:o,tabItemFilter:s,tabItemGeneral:i}=this;t&&e===Cb?o.showItem(t):s&&e===mb?o.showItem(s):i&&e===fb?o.showItem(i):o.showFirstItem()}onTabItemClicked(e){let t=null;switch(e.item){case this.tabItemColumns:t=Cb;break;case this.tabItemFilter:t=mb;break;case this.tabItemGeneral:t=fb}t&&this.activateTab(t)}activateTab(e){const t={type:"tabSelected",key:e};this.dispatchLocalEvent(t)}createMainPanel(){const{beans:e,column:t}=this,o=e.colMenuFactory,s=o.createMenu(this,o.getMenuItems(t),this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=s,s.addEventListener("closeMenu",this.onHidePopup.bind(this));const i={title:ei("legacyMenu",e,t),titleLabel:fb.replace("MenuTab",""),bodyPromise:Zs.resolve(s.getGui()),name:fb};return this.tabItemGeneral=i,i}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}createFilterPanel(){const e=this.column?this.createBean(new qi(this.column,"COLUMN_MENU")):null;this.filterComp=e,e?.hasFilter()||Tt(119);return this.tabItemFilter={title:ei("filterTab",this.beans,this.column),titleLabel:mb.replace("MenuTab",""),bodyPromise:Zs.resolve(e?.getGui()),afterAttachedCallback:t=>e?.afterGuiAttached(t),afterDetachedCallback:()=>e?.afterGuiDetached(),name:mb},this.tabItemFilter}createColumnsPanel(){const e=Xs({tag:"div",cls:"ag-menu-column-select-wrapper"}),{beans:t,column:o}=this,s=t.colChooserFactory.createColumnSelectPanel(this,o).getGui();s.classList.add("ag-menu-column-select"),e.appendChild(s);const i={title:ei("columns",t,o),titleLabel:Cb.replace("MenuTab",""),bodyPromise:Zs.resolve(e),name:Cb};return this.tabItemColumns=i,i}afterGuiAttached(e){const{container:t,hidePopup:o}=e;this.tabbedLayout.setAfterAttachedParams({container:t,hidePopup:o}),o&&(this.hidePopupFunc=o,this.addDestroyFunc(o))}getGui(){return this.tabbedLayout.getGui()}destroy(){super.destroy(),this.destroyBean(this.filterComp)}},bb=class extends ni{constructor(e,t,o,s){super({tag:"div",ref:"eColumnMenu",cls:"ag-menu ag-column-menu",role:"presentation"}),this.menuItems=e,this.column=t,this.restoreFocusParams=o,this.sourceElement=s,this.eColumnMenu=null}postConstruct(){const e=this.beans.colMenuFactory.createMenu(this,this.menuItems,this.column,()=>this.sourceElement??this.getGui());this.mainMenuList=e,e.addEventListener("closeMenu",this.onHidePopup.bind(this)),this.eColumnMenu.appendChild(e.getGui())}onHidePopup(e){this.beans.menuUtils.closePopupAndRestoreFocusOnSelect(this.hidePopupFunc,this.restoreFocusParams,e)}afterGuiAttached({hidePopup:e}){e&&(this.hidePopupFunc=e,this.addDestroyFunc(e)),mn(this.mainMenuList.getGui())}};var yb={moduleName:"MenuCore",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="menuItemMapper"}mapWithStockItems(e,t,o,s,i){if(!e)return[];const n=[],r=this.getLocaleTextFunc(),{beans:a,gos:d}=this,{pinnedCols:c,colAutosize:h,aggFuncSvc:u,rowGroupColsSvc:g,colNames:p,colModel:m,clipboardSvc:f,expansionSvc:C,focusSvc:v,csvCreator:w,excelCreator:b,menuSvc:y,colChooserFactory:S,sortSvc:R,chartMenuItemMapper:x,valueColsSvc:F,pinnedRowModel:D}=a,M=(e,t,s,i)=>{switch(function(e,t){const o=cb[t];o&&e.assertModuleRegistered(o,`menu item '${t}'`)}(d,e),e){case"pinSubMenu":return c&&t?{name:r("pinColumn","Pin Column"),icon:ei("menuPin",a,null),subMenu:["clearPinned","pinLeft","pinRight"]}:null;case"pinLeft":return c&&t?{name:r("pinLeft","Pin Left"),action:()=>c.setColsPinned([t],"left",i),checked:!!t&&t.isPinnedLeft()}:null;case"pinRight":return c&&t?{name:r("pinRight","Pin Right"),action:()=>c.setColsPinned([t],"right",i),checked:!!t&&t.isPinnedRight()}:null;case"clearPinned":return c&&t?{name:r("noPin","No Pin"),action:()=>c.setColsPinned([t],null,i),checked:!!t&&!t.isPinned()}:null;case"pinRowSubMenu":{const e=d.get("enableRowPinning"),s=[],i=o?.rowPinned??o?.pinnedSibling?.rowPinned;return i&&s.push("unpinRow"),e&&"bottom"!==e&&"top"!=i&&s.push("pinTop"),e&&"top"!==e&&"bottom"!=i&&s.push("pinBottom"),D?.isManual()?{name:r("pinRow","Pin Row"),icon:ei("rowPin",a,t),subMenu:s}:null}case"pinTop":return D?.isManual()?{name:r("pinTop","Pin to Top"),icon:ei("rowPinTop",a,t),action:({node:e,column:t})=>e&&D.pinRow(e,"top",t)}:null;case"pinBottom":return D?.isManual()?{name:r("pinBottom","Pin to Bottom"),icon:ei("rowPinBottom",a,t),action:({node:e,column:t})=>e&&D.pinRow(e,"bottom",t)}:null;case"unpinRow":return D?.isManual()?{name:r("unpinRow","Unpin Row"),icon:ei("rowUnpin",a,t),action:({node:e,column:t})=>e&&D.pinRow(e,null,t)}:null;case"valueAggSubMenu":return u&&F&&(t?.isPrimary()||t?.getColDef().pivotValueColumn)?{name:r("valueAggregation","Value Aggregation"),icon:ei("menuValue",a,null),subMenu:pb(t,u,F,r),disabled:d.get("functionsReadOnly")}:null;case"autoSizeThis":return h?{name:r("autosizeThisColumn","Autosize This Column"),action:()=>t&&h.autoSizeColumn(t,i,d.get("skipHeaderOnAutoSize"))}:null;case"autoSizeAll":return h?{name:r("autosizeAllColumns","Autosize All Columns"),action:()=>h.autoSizeAllColumns({source:i,skipHeader:d.get("skipHeaderOnAutoSize")})}:null;case"rowGroup":return g?{name:Tw(r,"groupBy",p.getDisplayNameForColumn(t,"header")),disabled:d.get("functionsReadOnly")||t?.isRowGroupActive()||!t?.getColDef().enableRowGroup,action:()=>g.addColumns([t],i),icon:ei("menuAddRowGroup",a,null)}:null;case"rowUnGroup":if(g&&d.isModuleRegistered("SharedRowGrouping")){const e=t?.getColDef().showRowGroup,o=d.get("groupLockGroupColumns");let s,n,l;if(!0===e)s=r("ungroupAll","Un-Group All"),n=d.get("functionsReadOnly")||-1===o||o>=(g.columns.length??0),l=()=>g.setColumns(g.columns.slice(0,o),i);else if("string"==typeof e){const t=m.getColDefCol(e);s=Tw(r,"ungroupBy",null!=t?p.getDisplayNameForColumn(t,"header"):e),n=d.get("functionsReadOnly")||Ew(t,a),l=()=>{g.removeColumns([e],i)}}else s=Tw(r,"ungroupBy",p.getDisplayNameForColumn(t,"header")),n=d.get("functionsReadOnly")||!t?.isRowGroupActive()||!t?.getColDef().enableRowGroup||Ew(t,a),l=()=>g.removeColumns([t],i);return{name:s,disabled:n,action:l,icon:ei("menuRemoveRowGroup",a,null)}}return null;case"resetColumns":return{name:r("resetColumns","Reset Columns"),action:()=>function(e,t){const{colModel:o,autoColSvc:s,selectionColSvc:i,eventSvc:n,gos:r}=e,a=o.getColDefCols();if(!a?.length)return;const d=Wo(o.getColDefColTree()),c=[];let h=1e3,u=1e3;const g=e=>{const t=Ss(e);l(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=h++),l(t.pivotIndex)&&t.pivot&&(t.pivotIndex=u++),c.push(t)};s?.getColumns()?.forEach(g),i?.getColumns()?.forEach(g),d?.forEach(g),ws(e,{state:c},t);const p=s?.getColumns()??[];ws(e,{state:[...i?.getColumns()??[],...p,...a].map(e=>({colId:e.colId})),applyOrder:!0},t),n.dispatchEvent(wo(r,{type:"columnsReset",source:t}))}(a,i)};case"expandAll":return C?{name:r("expandAll","Expand All Row Groups"),action:()=>C.expandAll(!0)}:null;case"contractAll":return C?{name:r("collapseAll","Collapse All Row Groups"),action:()=>C.expandAll(!1)}:null;case"copy":return f?{name:r("copy","Copy"),shortcut:r("ctrlC","Ctrl+C"),icon:ei("clipboardCopy",a,null),action:()=>f.copyToClipboard()}:null;case"copyWithHeaders":return f?{name:r("copyWithHeaders","Copy with Headers"),icon:ei("clipboardCopy",a,null),action:()=>f.copyToClipboard({includeHeaders:!0})}:null;case"copyWithGroupHeaders":return f?{name:r("copyWithGroupHeaders","Copy with Group Headers"),icon:ei("clipboardCopy",a,null),action:()=>f.copyToClipboard({includeHeaders:!0,includeGroupHeaders:!0})}:null;case"cut":if(f){const e=v.getFocusedCell(),t=e?In(a,e):null,o=!!t&&e?.column.isCellEditable(t);return{name:r("cut","Cut"),shortcut:r("ctrlX","Ctrl+X"),icon:ei("clipboardCut",a,null),disabled:!o||d.get("suppressCutToClipboard"),action:()=>f.cutToClipboard(void 0,"contextMenu")}}return null;case"paste":if(f){const e=d.get("suppressClipboardApi")||d.get("suppressClipboardPaste")||!t||!o||!t.isCellEditable(o)||t.isSuppressPaste(o);return{name:r("paste","Paste"),shortcut:r("ctrlV","Ctrl+V"),icon:ei("clipboardPaste",a,null),disabled:e,action:()=>f.pasteFromClipboard()}}return null;case"export":{const e=[];return!d.get("suppressCsvExport")&&w&&e.push("csvExport"),!d.get("suppressExcelExport")&&b&&e.push("excelExport"),e.length?{name:r("export","Export"),subMenu:e,icon:ei("save",a,null)}:null}case"csvExport":return w?{name:r("csvExport","CSV Export"),icon:ei("csvExport",a,null),action:()=>w.exportDataAsCsv()}:null;case"excelExport":return b?{name:r("excelExport","Excel Export"),icon:ei("excelExport",a,null),action:()=>b.exportDataAsExcel()}:null;case"separator":return e;case"pivotChart":case"chartRange":return x.getChartItems(e);case"columnFilter":return y&&t?{name:r("columnFilter","Column Filter"),icon:ei("filter",a,null),action:()=>y.showFilterMenu({column:t,buttonElement:s(),containerType:"columnFilter",positionBy:"button"})}:null;case"columnChooser":{const e=v.focusedHeader;return S?{name:r("columnChooser","Choose Columns"),icon:ei("columns",a,null),action:()=>S.showColumnChooser({column:t,eventSource:s(),headerPosition:e})}:null}case"sortUnSort":case"sortAscending":case"sortDescending":case"sortAbsoluteAscending":case"sortAbsoluteDescending":{if(!R||!t)return null;const{fallback:o,getSortDef:s}=gb[e];return{name:r(e,o),icon:ei(e,a,null),action:()=>R.setSortForColumn(t,s(t),!1,i)}}default:return Et(176,{key:e}),null}};for(const l of e){let e;if(e="string"==typeof l?M(l,t,s,i):{...l},!e)continue;const r=e,{subMenu:a}=r;a&&a instanceof Array&&(r.subMenu=this.mapWithStockItems(a,t,o,s,i)),null!=e&&n.push(e)}return ub(n,hb),n}},class extends We{constructor(){super(...arguments),this.beanName="chartMenuItemMapper"}getChartItems(e){const t=this.beans,o=t.chartSvc,s="pivotChart"===e;if(!o)return null;const i=this.getLocaleTextFunc.bind(this),n=s?new lb(t,o,i):new db(t,o,i),r=o.isEnterprise();let a=n.getMenuItem();if(a?.subMenu&&!r){const e=t=>({...t,subMenu:t.subMenu?.filter(e=>!e._enterprise).map(t=>e(t))});a=e(a)}const l=this.gos.get("chartToolPanelsDef")?.settingsPanel?.chartGroupsDef;return l&&(a=this.filterAndOrderChartMenu(a,l,n.getConfigLookup())),this.cleanInternals(a)}cleanInternals(e){if(!e)return e;const t=e=>{delete e?._key,delete e?._enterprise;for(const o of e?.subMenu??[])t(o);return e};return t(e)}buildLookup(e){const t={},o=e=>{if(t[e._key]=e,e.subMenu)for(const t of e.subMenu)o(t)};return o(e),t}filterAndOrderChartMenu(e,t,o){const s=this.buildLookup(e),i={...e,subMenu:[]};for(const n of Object.keys(t)){const e=t[n],r=o[n];if(null===r)continue;if(null==r){Et(173,{group:n});continue}const a=s[r._key];if(a)if(a.subMenu){const t=e.map(e=>{const t=r[e];if(null!=t)return s[t];Et(174,{group:n,chartType:e})}).filter(e=>void 0!==e);t.length>0&&(a.subMenu=t,i.subMenu?.push(a))}else i.subMenu?.push(a)}return 0==i.subMenu?.length?null:i}},class extends We{constructor(){super(...arguments),this.beanName="menuUtils"}restoreFocusOnClose(e,t,o,s){const{eventSource:i}=e,n=o instanceof KeyboardEvent;if(!s&&!n||!i)return;const r=w(this.beans);(t.contains(r)||y(this.beans))&&this.focusHeaderCell(e)}closePopupAndRestoreFocusOnSelect(e,t,o){let s;o?.keyboardEvent&&(s=o.keyboardEvent),e(s&&{keyboardEvent:s});const i=this.beans,n=i.focusSvc,r=n.getFocusedCell();if(y(i))if(r){const{rowIndex:e,rowPinned:t,column:o}=r;n.setFocusedCell({rowIndex:e,column:o,rowPinned:t,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}else this.focusHeaderCell(t)}onContextMenu(e){const{mouseEvent:t,touchEvent:o,showMenuCallback:s,source:i}=e;if((this.gos.get("allowContextMenuWithControlKey")||!t||!t.ctrlKey&&!t.metaKey)&&(t&&this.blockMiddleClickScrollsIfNeeded(t),("ui"!==i||!this.gos.get("suppressContextMenu"))&&s(t??o.touches[0]))){const e=t??o;e?.cancelable&&e.preventDefault()}}async focusHeaderCell(t){const{column:o,columnIndex:s,headerPosition:i,eventSource:n}=t,{visibleCols:r,headerNavigation:a,focusSvc:l}=this.beans,d=await r.allCols.some(e=>e===o);if(this.isAlive())if(o?.isAlive()&&d&&n&&ae(n)){const e=Cn(n);e&&(a?.scrollToColumn(o),e.focus())}else if(i&&-1!==s){const t=r.allCols,o=t[s]||e(t);o&&l.focusHeaderPosition({headerPosition:{headerRowIndex:i.headerRowIndex,column:o}})}}blockMiddleClickScrollsIfNeeded(e){this.gos.get("suppressMiddleClickScrolls")&&2===e.which&&e.preventDefault()}}],icons:{chart:"chart",columns:"columns",loadingMenuItems:"loading",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",save:"save",csvExport:"csv",excelExport:"excel",sortAscending:"asc",sortDescending:"desc",sortAbsoluteAscending:"aasc",sortAbsoluteDescending:"adesc",sortUnSort:"none"},dependsOn:[Kv,Vg,kp,fw]},Sb={moduleName:"ColumnMenu",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="enterpriseMenuFactory"}hideActiveMenu(){this.destroyBean(this.activeMenu)}showMenuAfterMouseEvent(e,t,o,s,i){const{column:n,columnGroup:r}=this.splitColumnOrGroup(e),a=i?"filterMenuTab":void 0;this.showMenu(n,r,e=>{const s=e.getGui();this.beans.popupSvc.positionPopupUnderMouseEvent({type:o,additionalParams:{column:n},mouseEvent:t,ePopup:s}),a&&e.showTab?.(a),this.dispatchVisibleChangedEvent(!0,!1,n,r,a)},o,a,void 0,t.target,s)}splitColumnOrGroup(e){const t=e&&xo(e);return{column:t?e:void 0,columnGroup:t?void 0:e}}showMenuAfterButtonClick(e,t,o,s,i){let n=-1,r="left";this.gos.get("enableRtl")&&(n=1,r="right");const a=i?"filterMenuTab":void 0,l=a?[a]:void 0,d=Co(this.gos),c=(d?9:4)*n,h=d?-23:4,{column:u,columnGroup:g}=this.splitColumnOrGroup(e);this.showMenu(u,g,e=>{const s=e.getGui();this.beans.popupSvc.positionPopupByComponent({type:o,additionalParams:{column:u},eventSource:t,ePopup:s,alignSide:r,nudgeX:c,nudgeY:h,position:"under",keepWithinBounds:!0}),a&&e.showTab?.(a),this.dispatchVisibleChangedEvent(!0,!1,u,g,a)},o,a,l,t,s)}showMenu(e,t,o,s,i,n,r,a){const l=this.getMenuParams(e,t,n,r);if(!l)return;const{menu:d,eMenuGui:c,anchorToElement:h,restoreFocusParams:u}=l,g=[],{menuUtils:p,popupSvc:m}=this.beans;g.push(t=>{const o=d.getGui();this.destroyBean(d),e&&(Ap(e,!1,"contextMenu"),p.restoreFocusOnClose(u,o,t)),a?.()});const f=this.getLocaleTextFunc();if(m.addPopup({modal:!0,eChild:c,closeOnEsc:!0,closedCallback:o=>{for(const e of g)e(o);this.dispatchVisibleChangedEvent(!1,!1,e,t,i)},afterGuiAttached:e=>d.afterGuiAttached(Object.assign({},{container:s},e)),positionCallback:i?()=>o(d):void 0,ariaLabel:f("ariaLabelColumnMenu","Column Menu")}),i||(d.showTabBasedOnPreviousSelection?.(),o(d)),vo(this.gos)){const t=m.setPopupPositionRelatedToElement(c,h);t&&e&&this.addStopAnchoring(t,e,g)}d.addEventListener("tabSelected",t=>{this.dispatchVisibleChangedEvent(!1,!0,e),this.lastSelectedTab=t.key,this.dispatchVisibleChangedEvent(!0,!0,e)}),e&&Ap(e,!0,"contextMenu"),this.activeMenu=d,d.addEventListener("destroyed",()=>{this.activeMenu===d&&(this.activeMenu=null)})}addStopAnchoring(e,t,o){e.then(e=>{t.__addEventListener("leftChanged",e),t.__addEventListener("visibleChanged",e),o.push(()=>{t.__removeEventListener("leftChanged",e),t.__removeEventListener("visibleChanged",e)})})}getMenuParams(e,t,o,s){const{focusSvc:i,visibleCols:n,ctrlsSvc:r}=this.beans,a={column:e,headerPosition:i.focusedHeader,columnIndex:n.allCols.indexOf(e),eventSource:s},l=this.createMenu(e,t,a,o,s);return l?{menu:l,eMenuGui:l.getGui(),anchorToElement:s||r.getGridBodyCtrl().eGridBody,restoreFocusParams:a}:void 0}createMenu(e,t,o,s,i){if(Co(this.gos))return this.createBean(new wb(e,o,this.lastSelectedTab,s,i));{const s=this.beans.colMenuFactory.getMenuItems(e,t);return s.length?this.createBean(new bb(s,e,o,i)):void 0}}dispatchVisibleChangedEvent(e,t,o,s,i){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:t,key:this.lastSelectedTab??i??(Co(this.gos)?fb:"columnMenu"),column:o??null,columnGroup:s??null})}isMenuEnabled(e){if(!Co(this.gos))return!0;const t=!this.beans.filterManager?.isFilterAllowed(e),o=e.getColDef().menuTabs??vb;return(t&&o.includes(mb)?o.length-1:o.length)>0}showMenuAfterContextMenuEvent(e,t,o){this.beans.menuUtils.onContextMenu({mouseEvent:t,touchEvent:o,source:"ui",showMenuCallback:t=>(this.showMenuAfterMouseEvent(e,t,"columnMenu"),!0)})}},class extends We{constructor(){super(...arguments),this.beanName="colMenuFactory"}createMenu(e,t,o,s){const i=e.createManagedBean(new Lw(0,{column:o??null,node:null,value:null})),n=this.beans.menuItemMapper.mapWithStockItems(t,o??null,null,s,"columnMenu");return i.addMenuItems(n),i}getMenuItems(e=null,t=null){const o=this.getDefaultMenuOptions(e);let s;const i=(e?.getColDef()??t?.getColGroupDef())?.mainMenuItems;if(Array.isArray(i))s=i;else if("function"==typeof i)s=i(wo(this.gos,{column:e,columnGroup:t,defaultItems:o}));else{const i=this.gos.getCallback("getMainMenuItems");s=i?i({column:e,columnGroup:t,defaultItems:o}):o}return ub(s,hb),s}getDefaultMenuOptions(e){const t=[],{beans:o,gos:s}=this,{colChooserFactory:i,rowGroupColsSvc:n,colModel:r,expansionSvc:a,sortSvc:l,menuSvc:d,pinnedCols:c,aggFuncSvc:h,colAutosize:u}=o,g=Co(s),p=()=>{!g&&i&&t.push("columnChooser"),t.push("resetColumns")};if(!e)return p(),t;const{colDef:m}=e,f=c&&!m.lockPinned,C=n?.columns.length??0,v=C>0,w=qt(s),b=s.get("treeData"),y=e.isPrimary(),S=!y||h&&e.isAllowValue()&&(v||w||b);if(l&&!g&&e.isSortable()){const{isDefaultSortAllowed:s,isAbsoluteSortAllowed:i,isAbsoluteSort:n,isDefaultSort:r,isAscending:a,isDescending:l,direction:d}=Go(e,o);!s||a&&r||t.push("sortAscending"),!s||l&&r||t.push("sortDescending"),!i||a&&n||t.push("sortAbsoluteAscending"),!i||l&&n||t.push("sortAbsoluteDescending"),d&&t.push("sortUnSort"),t.push(hb)}if(d?.isFilterMenuItemEnabled(e)&&(t.push("columnFilter"),t.push(hb)),f&&t.push("pinSubMenu"),S&&t.push("valueAggSubMenu"),(f||S)&&t.push(hb),u&&(m.suppressAutoSize||t.push("autoSizeThis"),t.push("autoSizeAll"),t.push(hb)),n&&s.isModuleRegistered("SharedRowGrouping")){const s=t.length;m.showRowGroup?t.push("rowUnGroup"):e.isAllowRowGroup()&&y&&(e.isRowGroupActive()?Ew(e,o)||t.push("rowUnGroup"):t.push("rowGroup")),t.length>s&&t.push(hb)}return p(),a&&(Lt(s)||s.get("ssrmExpandAllAffectsAllRows"))&&(b||C>(r.isPivotMode()?1:0))&&(t.push("expandAll"),t.push("contractAll")),t}},class extends We{constructor(){super(...arguments),this.beanName="colChooserFactory"}createColumnSelectPanel(e,t,o,s){const i=e.createManagedBean(new _w),{contractColumnSelection:n,suppressColumnExpandAll:r,suppressColumnFilter:a,suppressColumnSelectAll:l,suppressSyncLayoutWithGrid:d,columnLayout:c}=s??t?.getColDef().columnChooserParams??{};return i.init(!!o,wo(this.gos,{suppressColumnMove:!1,suppressValues:!1,suppressPivots:!1,suppressRowGroups:!1,suppressPivotMode:!1,contractColumnSelection:!!n,suppressColumnExpandAll:!!r,suppressColumnFilter:!!a,suppressColumnSelectAll:!!l,suppressSyncLayoutWithGrid:!!c||!!d,onStateUpdated:()=>{}}),"columnMenu"),c&&i.setColumnLayout(c),i}showColumnChooser({column:e,chooserParams:t,eventSource:o,headerPosition:s}){this.hideActiveColumnChooser();const i=this.createColumnSelectPanel(this,e,!0,t),n=this.getLocaleTextFunc(),r=this.beans,{visibleCols:a,focusSvc:l,menuUtils:d}=r,c=a.allCols.indexOf(e),h=e?l.focusedHeader??s??null:null;this.activeColumnChooserDialog=this.createBean(new qv({title:n("chooseColumns","Choose Columns"),component:i,width:300,height:300,resizable:!0,movable:!0,centered:!0,closable:!0,afterGuiAttached:()=>{fn(r,i.getGui())?.focus({preventScroll:!0}),this.dispatchVisibleChangedEvent(!0,e)},closedCallback:t=>{const s=this.activeColumnChooser.getGui();this.destroyBean(this.activeColumnChooser),this.activeColumnChooser=void 0,this.activeColumnChooserDialog=void 0,this.dispatchVisibleChangedEvent(!1,e),e&&d.restoreFocusOnClose({column:e,headerPosition:h,columnIndex:c,eventSource:o},s,t,!0)},postProcessPopupParams:{type:"columnChooser",column:e,eventSource:o}})),this.activeColumnChooser=i}hideActiveColumnChooser(){this.destroyBean(this.activeColumnChooserDialog)}dispatchVisibleChangedEvent(e,t){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:"columnChooser",column:t??null})}}],icons:{ensureColumnVisible:"column-arrow",legacyMenu:"menu",filterTab:"filter",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate"},apiFunctions:{showColumnChooser:function(e,t){e.colChooserFactory?.showColumnChooser({chooserParams:t})},hideColumnChooser:function(e){e.colChooserFactory?.hideActiveColumnChooser()}},dependsOn:[yb,Al,Wl]};function Rb(e,t,o){return e.getCompDetails(t,xb,void 0,o,!0)}var xb={name:"statusPanel",optionalMethods:["refresh"]},Fb={agAggregationComponent:{rowModels:["clientSide","serverSide"],warnArgs:[221]},agFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[222]},agSelectedRowCountComponent:{rowModels:["clientSide","serverSide"],warnArgs:[223]},agTotalAndFilteredRowCountComponent:{rowModels:["clientSide"],warnArgs:[224]},agTotalRowCountComponent:{rowModels:["clientSide"],warnArgs:[225]}},Db={tag:"div",cls:"ag-status-bar",children:[{tag:"div",ref:"eStatusBarLeft",cls:"ag-status-bar-left",role:"status"},{tag:"div",ref:"eStatusBarCenter",cls:"ag-status-bar-center",role:"status"},{tag:"div",ref:"eStatusBarRight",cls:"ag-status-bar-right",role:"status"}]},Mb={selector:"AG-STATUS-BAR",component:class extends ni{constructor(){super(Db),this.updateQueued=!1,this.panelsPromise=Zs.resolve(),this.eStatusBarLeft=null,this.eStatusBarCenter=null,this.eStatusBarRight=null,this.compDestroyFunctions={},this.registerCSS(".ag-status-bar{border-top:var(--ag-footer-row-border);display:flex;justify-content:space-between;line-height:1.5;overflow:hidden;padding-left:calc(var(--ag-spacing)*4);padding-right:calc(var(--ag-spacing)*4)}.ag-status-panel,:where(.ag-status-panel.ag-status-panel-aggregations .ag-status-name-value){display:inline-flex}.ag-status-name-value{color:var(--ag-status-bar-label-color);font-weight:var(--ag-status-bar-label-font-weight);margin-left:var(--ag-spacing);margin-right:var(--ag-spacing);padding-bottom:var(--ag-widget-container-vertical-padding);padding-top:var(--ag-widget-container-vertical-padding);white-space:nowrap}.ag-status-name-value-value{color:var(--ag-status-bar-value-color);font-weight:var(--ag-status-bar-value-font-weight)}.ag-status-bar-left{display:inline-flex}.ag-status-bar-center{display:inline-flex;text-align:center}.ag-status-bar-right{display:inline-flex}")}wireBeans(e){this.userCompFactory=e.userCompFactory,this.statusBarSvc=e.statusBarSvc}postConstruct(){this.processStatusPanels(/* @__PURE__ */new Map),this.addManagedPropertyListeners(["statusBar"],this.handleStatusBarChanged.bind(this))}getValidPanels(){const e=this.gos,t=e.get("statusBar")?.statusPanels;return t?t.filter(t=>{const{rowModels:o,warnArgs:s}=Fb[t.statusPanel]??{};return!o||(!!o.includes(e.get("rowModelType"))||(Et(...s),!1))}):t}processStatusPanels(e){const t=this.getValidPanels();if(t){const o=t.filter(e=>"left"===e.align),s=t.filter(e=>"center"===e.align),i=t.filter(e=>!e.align||"right"===e.align);this.panelsPromise=Zs.all([this.createAndRenderComponents(o,this.eStatusBarLeft,e),this.createAndRenderComponents(s,this.eStatusBarCenter,e),this.createAndRenderComponents(i,this.eStatusBarRight,e)])}else this.setDisplayed(!1)}handleStatusBarChanged(){this.updateQueued||(this.updateQueued=!0,this.panelsPromise.then(()=>{this.updateStatusBar(),this.updateQueued=!1}))}updateStatusBar(){const e=this.getValidPanels(),t=Array.isArray(e)&&e.length>0;this.setDisplayed(t);const o=/* @__PURE__ */new Map;if(t)for(const s of e){const e=s.key??s.statusPanel,t=this.statusBarSvc.getStatusPanel(e);if(t?.refresh){const i=wo(this.gos,{...s.statusPanelParams??{},key:e});t.refresh(i)&&(o.set(e,t),delete this.compDestroyFunctions[e],ne(t.getGui()))}}this.resetStatusBar(),t&&this.processStatusPanels(o)}resetStatusBar(){ie(this.eStatusBarLeft),ie(this.eStatusBarCenter),ie(this.eStatusBarRight),this.destroyComponents(),this.statusBarSvc.unregisterAllComponents()}destroy(){this.destroyComponents(),super.destroy()}destroyComponents(){for(const e of Object.values(this.compDestroyFunctions))e();this.compDestroyFunctions={}}createAndRenderComponents(e,t,o){const s=[];for(const i of e){const e=i.key||i.statusPanel,t=o.get(e);let n;if(t)n=Zs.resolve(t);else{const t=Rb(this.userCompFactory,i,wo(this.gos,{key:e}));if(null==t)continue;n=t.newAgStackInstance()}s.push({key:e,promise:n})}return Zs.all(s.map(e=>e.promise)).then(()=>{for(const e of s)e.promise.then(o=>{const s=()=>{this.destroyBean(o)};this.isAlive()?(this.statusBarSvc.registerStatusPanel(e.key,o),t.appendChild(o.getGui()),this.compDestroyFunctions[e.key]=s):s()})})}}},Pb={tag:"div",cls:"ag-status-name-value",children:[{tag:"span",ref:"eLabel"},":Β ",{tag:"span",ref:"eValue",cls:"ag-status-name-value-value"}]},Eb=BigInt(Number.MIN_SAFE_INTEGER),Tb=BigInt(Number.MAX_SAFE_INTEGER),Ab=class extends ni{constructor(){super(Pb),this.eLabel=null,this.eValue=null}setLabel(e,t){this.setDisplayed(!1),this.eLabel.textContent=this.getLocaleTextFunc()(e,t)}setValue(e,t){let o,s=null;"bigint"==typeof e?(o=e,e>=Eb&&e<=Tb&&(s=Number(e))):s=e,this.eValue.textContent=this.valueFormatter(wo(this.gos,{value:s,bigintValue:o,totalRows:t,key:this.key}))}},Ib={selector:"AG-NAME-VALUE",component:Ab},kb=e=>{let t=0;return e.forEachNodeAfterFilter(e=>{e.data&&t++}),t},Lb=e=>{let t=0;return e.forEachNode(e=>{e.data&&t++}),t};var Gb={tag:"div",cls:"ag-status-panel ag-status-panel-aggregations",children:[{tag:"ag-name-value",ref:"avgAggregationComp"},{tag:"ag-name-value",ref:"countAggregationComp"},{tag:"ag-name-value",ref:"minAggregationComp"},{tag:"ag-name-value",ref:"maxAggregationComp"},{tag:"ag-name-value",ref:"sumAggregationComp"}]};var Nb={moduleName:"StatusBar",version:jv,beans:[class extends We{constructor(){super(),this.beanName="statusBarSvc",this.comps=/* @__PURE__ */new Map}registerStatusPanel(e,t){this.comps.set(e,t)}unregisterStatusPanel(e){this.comps.delete(e)}unregisterAllComponents(){this.comps.clear()}getStatusPanel(e){return this.comps.get(e)}destroy(){this.unregisterAllComponents(),super.destroy()}}],userComponents:{agAggregationComponent:class extends ni{constructor(){super(Gb,[Ib]),this.sumAggregationComp=null,this.countAggregationComp=null,this.minAggregationComp=null,this.maxAggregationComp=null,this.avgAggregationComp=null}postConstruct(){this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedEventListeners({cellSelectionChanged:this.onCellSelectionChanged.bind(this),modelUpdated:this.onCellSelectionChanged.bind(this)})}init(e){this.refresh(e)}refresh(e){this.params=e;const t=e.valueFormatter??(e=>{const{value:t,bigintValue:o}=e;return null!=o?o.toString():function(e,t){return"number"!=typeof e?"":Jp(Math.round(100*e)/100,t)}(t,this.getLocaleTextFunc.bind(this))});for(const o of["avg","count","min","max","sum"]){const e=this.getAllowedAggregationValueComponent(o);e&&(e.key=o,e.valueFormatter=t.bind(this))}return this.onCellSelectionChanged(),!0}setAggregationComponentValue(e,t,o){const s=this.getAllowedAggregationValueComponent(e),i=Lb(this.beans.rowModel);a(s)&&s?(s.setValue(t,i),s.setDisplayed(o)):this.getAggregationValueComponent(e)?.setDisplayed(!1)}getAllowedAggregationValueComponent(e){const{aggFuncs:t}=this.params;return!t||t.includes(e)?this.getAggregationValueComponent(e):null}getAggregationValueComponent(e){return this[`${e}AggregationComp`]}onCellSelectionChanged(){const e=this.beans,{rangeSvc:t,valueSvc:o}=e,s=t?.getCellRanges();let i=0,n=0n,r=!1,a=!1,d=0,c=0,h=null,u=null,g=null,p=null;const m=e=>{if("number"==typeof e)if(i+=e,(null===h||eu)&&(u=e),Number.isInteger(e)&&Number.isSafeInteger(e)){const t=BigInt(e);n+=t,(null===g||tp)&&(p=t)}else a=!0;else{r=!0,n+=e,(null===g||ep)&&(p=e);const t=Number(e);i+=t,(null===h||tu)&&(u=t)}c++},f={};if(s?.length&&t)for(let D=0;D{if(null===r)return;const s=Dn({rowPinned:r.rowPinned,column:t,rowIndex:r.rowIndex});if(f[s])return;f[s]=!0;const n=In(e,r);if(l(n))return;let a=o.getValue(t,n,"data");if(!l(a)&&""!==a&&(d++,"object"!=typeof a||!("value"in a)||(a=a.value,""!==a))){if("string"==typeof a){const e=a.trim();if(""===e)return;const t=Number(e);if(!Number.isFinite(t))return;i+t>=Number.MAX_SAFE_INTEGER||i+t<=Number.MIN_SAFE_INTEGER||t>=Number.MAX_SAFE_INTEGER||t<=Number.MIN_SAFE_INTEGER?(a=od(e),null===a&&(a=t)):a=t}("number"==typeof a&&!isNaN(a)||"bigint"==typeof a)&&m(a)}}),r=Nn(e,r)}const C=d>1,v=c>1,w=r&&!a;let b;b=w?n/BigInt(c):i/c;const y=v?w?n:i:null,S=v?w?g:h:null,R=v?w?p:u:null,x=v?b:null,F=v;this.setAggregationComponentValue("count",d,C),this.setAggregationComponentValue("sum",y,v),this.setAggregationComponentValue("min",S,v),this.setAggregationComponentValue("max",R,v),this.setAggregationComponentValue("avg",x,F)}},agTotalRowCountComponent:class extends Ab{postConstruct(){this.setLabel("totalRows","Total Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){const e=Lb(this.beans.rowModel);this.setValue(e,e)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e})=>Jp(e,this.getLocaleTextFunc.bind(this)))}refresh(e){const{key:t,valueFormatter:o}=e;return this.key=t,this.updateValueFormatter(o),!0}},agFilteredRowCountComponent:class extends Ab{postConstruct(){this.setLabel("filteredRows","Filtered"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);const e=this.onDataChanged.bind(this);this.addManagedEventListeners({modelUpdated:e})}onDataChanged(){const{rowModel:e}=this.beans,t=Lb(e),o=kb(e);this.setValue(o,t),this.setDisplayed(t!==o)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e})=>Jp(e,this.getLocaleTextFunc.bind(this)))}refresh(e){const{key:t,valueFormatter:o}=e;return this.key=t,this.updateValueFormatter(o),!0}},agTotalAndFilteredRowCountComponent:class extends Ab{postConstruct(){this.setLabel("totalAndFilteredRows","Rows"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedEventListeners({modelUpdated:this.onDataChanged.bind(this)})}onDataChanged(){const{rowModel:e}=this.beans,t=kb(e),o=Lb(e);this.setValue(t,o)}init(e){this.refresh(e),this.onDataChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e,totalRows:t})=>{const o=this.getLocaleTextFunc.bind(this),s=Jp(e,o),i=Jp(t??e,o);return e===t?s:`${s} ${o()("of","of")} ${i}`})}refresh(e){const{key:t,valueFormatter:o}=e;return this.key=t,this.updateValueFormatter(o),!0}},agSelectedRowCountComponent:class extends Ab{postConstruct(){this.setLabel("selectedRows","Selected"),this.addCss("ag-status-panel"),this.addCss("ag-status-panel-selected-row-count");const e=this.onRowSelectionChanged.bind(this);this.addManagedEventListeners({modelUpdated:e,selectionChanged:e})}onRowSelectionChanged(){const{selectionSvc:e,rowModel:t}=this.beans,o=e?.getSelectionCount()??0,s=Lb(t);this.setValue(o,s),o<0?this.setDisplayed(!0):this.setDisplayed(o>0)}init(e){this.refresh(e),this.onRowSelectionChanged()}updateValueFormatter(e){this.valueFormatter=e??(({value:e})=>null==e||e>=0?Jp(e,this.getLocaleTextFunc.bind(this)):this.getLocaleTextFunc()("statusBarLastRowUnknown","?"))}refresh(e){const{key:t,valueFormatter:o}=e;return this.key=t,this.updateValueFormatter(o),!0}}},selectors:[Mb],apiFunctions:{getStatusPanel:function(e,t){const o=e.statusBarSvc?.getStatusPanel(t);return Eh(o)}},dependsOn:[Kv,hu]};function Bb(e){return"MULTI_SHEET"!==e.excelCreator?.getFactoryMode()||(Et(161),!1)}var Hb={moduleName:"ExcelExport",version:jv,beans:[class extends Eg{constructor(){super(...arguments),this.beanName="excelCreator",this.workbook=new uv}getMergedParams(e){const t=this.gos.get("defaultExcelExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void Et(160);const t=()=>{const t=this.getMergedParams(e),o=this.getData(t),{fontSize:s,author:i,mimeType:n,customMetadata:r}=t,a={data:[o],fontSize:s,author:i,mimeType:n,customMetadata:r};this.packageCompressedFile(a).then(e=>{if(e){const{fileName:o}=t,s="function"==typeof o?o(wo(this.gos,{})):o;Tg(this.getFileName(s),e)}})},{overlays:o}=this.beans;o?o.showExportOverlay(t):t()}exportDataAsExcel(e){this.export(e)}getDataAsExcel(e){const t=this.getMergedParams(e),o=this.getData(t),{fontSize:s,author:i,mimeType:n,customMetadata:r}=t,a={data:[o],fontSize:s,author:i,mimeType:n,customMetadata:r};return this.packageFile(a)}setFactoryMode(e){this.workbook.setFactoryMode(e)}getFactoryMode(){return this.workbook.getFactoryMode()}getSheetDataForExcel(e){const t=this.getMergedParams(e);return this.getData(t)}getMultipleSheetsAsExcel(e){return Ev(e,this.workbook)}exportMultipleSheetsAsExcel(e){Pv(e,this.workbook).then(t=>{const{fileName:o="export.xlsx"}=e;t&&Tg("function"==typeof o?o():o,t)})}getDefaultFileExtension(){return"xlsx"}createSerializingSession(e){const{colModel:t,colNames:o,rowGroupColsSvc:s,valueSvc:i,formula:n,gos:r}=this.beans,a=r.get("excelStyles")||[],l=this.createStyleLinker(a);return new Qm({...e,colModel:t,colNames:o,rowGroupColsSvc:s,valueSvc:i,formulaSvc:n,gos:r,suppressRowOutline:e.suppressRowOutline||e.skipRowGroups,headerRowHeight:e.headerRowHeight||e.rowHeight,baseExcelStyles:a,rightToLeft:e.rightToLeft??r.get("enableRtl"),styleLinker:l,headerRowCount:zn(t),pivotModeActive:t.isPivotActive(),workbook:this.workbook})}createStyleLinker(e){const t=[],o=/* @__PURE__ */new Set,s=/* @__PURE__ */new Map;e.forEach((e,i)=>{t.push(e.id),o.add(e.id),s.set(e.id,i)});const{gos:i,cellStyles:n}=this.beans;return e=>{const{rowType:r,rowIndex:a,value:l,column:d,columnGroup:c,node:h}=e,u="HEADER"===r,g="HEADER_GROUPING"===r,p=u?d:c;let m=[];if(u||g)return m.push("header"),g&&m.push("headerGroup"),p&&(m=m.concat(ar(p.getDefinition(),i,d||null,c||null))),m;const f=["cell"];if(!t.length)return f;const C=d.getDefinition();return n?.processAllCellClasses(C,wo(i,{value:l,data:h.data,node:h,colDef:C,column:d,rowIndex:a}),e=>{o.has(e)&&f.push(e)}),f.sort((e,t)=>{const o=s.get(e)??-1,i=s.get(t)??-1;return o===i?0:o0?t:[{filter:"agTextColumnFilter"},{filter:"agSetColumnFilter"}]}function Vb(e,t){if(null!=e)for(let o=e.length-1;o>=0;o--)t(e[o],o)}function zb(e,t,o,s){const i=[],n=e?.filterModels;for(let r=0;rnull==e)?null:{filterType:"multi",filterModels:i}}function Wb(e,t){return e?.filterModels?.[t]??null}function Ub(e,t,o,s){const i=o.filterValueGetter;return i?e.colFilter.createGetValue(t,i):s}var $b=class extends sl{constructor(){super({tag:"div",cls:"ag-multi-filter ag-menu-list-compact"}),this.filterDefs=[],this.guiDestroyFuncs=[],this.filterGuis=[],this.lastActivatedMenuItem=null}postConstruct(){this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e)})}refreshGui(e){return e===this.lastOpenedInContainer?Zs.resolve():(this.tabGuardFeature.removeAllChildrenExceptTabGuards(),this.destroyChildren(),Zs.all(this.getFilterWrappers().map((t,o)=>{if(!t)return Zs.resolve(null);const s=this.getFilterFromWrapper(t),i=this.getCompFromWrapper(t),n=this.filterDefs[o],r=function(e,t){return null!=t.title?t.title:e instanceof Fn?e.getFilterTitle():"Filter"}(s,n);let a;if("subMenu"===n.display&&"toolPanel"!==e)a=this.insertFilterMenu(i,s,r).then(e=>e.getGui());else if("subMenu"===n.display||"accordion"===n.display){const e=this.insertFilterGroup(s,i,r);a=Zs.resolve(e.getGui())}else a=Zs.resolve(i.getGui());return a})).then(t=>{t.forEach((e,t)=>{e&&(t>0&&this.appendChild(Xs({tag:"div",cls:"ag-filter-separator"})),this.appendChild(e))}),this.filterGuis=t,this.lastOpenedInContainer=e}))}destroyChildren(){for(const e of this.guiDestroyFuncs)e();this.guiDestroyFuncs.length=0,this.filterGuis.length=0}insertFilterMenu(e,t,o){P(e.getGui(),"dialog");const s=this.createBean(new kw);return s.init({menuItemDef:{name:o,subMenu:[],subMenuRole:"dialog",cssClasses:["ag-multi-filter-menu-item"],menuItem:mw,menuItemParams:{cssClassPrefix:"ag-compact-menu-option",isCompact:!0}},level:0,isAnotherSubMenuOpen:()=>!1,childComponent:{getGui:()=>e.getGui(),afterGuiAttached:o=>{e.afterGuiAttached?.(o),e!==t&&t.afterGuiAttached?.(o)}},contextParams:{column:null,node:null,value:null}}).then(()=>{s.setParentComponent(this),this.guiDestroyFuncs.push(()=>this.destroyBean(s)),this.addManagedListeners(s,{menuItemActivated:e=>{this.lastActivatedMenuItem&&this.lastActivatedMenuItem!==e.menuItem&&this.lastActivatedMenuItem.deactivate(),this.lastActivatedMenuItem=e.menuItem}});const e=s.getGui();return s.addManagedElementListeners(e,{keydown:e=>{const{key:t}=e;switch(t){case ks:case Ls:case Gs:case Is:e.preventDefault(),t===Ls&&s.openSubMenu(!0)}},focusin:()=>s.activate(),focusout:()=>{s.isSubMenuOpen()||s.isSubMenuOpening()||s.deactivate()}}),s})}insertFilterGroup(e,t,o){const s=this.createBean(new Wv({title:o,cssIdentifier:"multi-filter"}));return this.guiDestroyFuncs.push(()=>this.destroyBean(s)),s.addItem(t.getGui()),s.toggleGroupExpand(!1),e.afterGuiAttached&&s.addManagedListeners(s,{expanded:()=>e.afterGuiAttached({container:this.lastOpenedInContainer,suppressFocus:!0,hidePopup:this.hidePopup})}),s}afterGuiAttached(e){let t;e?(this.hidePopup=e.hidePopup,t=this.refreshGui(e.container)):(this.hidePopup=void 0,t=Zs.resolve());const o=e?.suppressFocus;t.then(()=>{const{filterDefs:t,filterGuis:s,beans:i}=this,n=this.getFilterWrappers();let r=!!o;t&&Vb(t,(t,i)=>{const a=0===i,l=t.display&&"inline"!==t.display,d=o||!a||l,c={...e??{},suppressFocus:d},h=n[i],u=h?this.getFilterFromWrapper(h):void 0;if(h){const e=this.getCompFromWrapper(h);e!==u&&e.afterGuiAttached(c)}if(u&&(this.executeFunctionIfExistsOnFilter(u,"afterGuiAttached",c),a&&!d&&(r=!0)),!o&&a&&l){const e=s[i];e&&(mn(e)||e.focus({preventScroll:!0}),r=!0)}});const a=w(i);r||!y(i)&&!this.getGui().contains(a)||this.forceFocusOutOfContainer(!0)})}afterGuiDetached(){this.executeFunctionIfExists("afterGuiDetached")}onAnyFilterChanged(){this.executeFunctionIfExists("onAnyFilterChanged",e=>this.executeOnWrapper(e,"onAnyFilterChanged"))}onNewRowsLoaded(){this.executeFunctionIfExists("onNewRowsLoaded",e=>this.executeOnWrapper(e,"onNewRowsLoaded"))}destroy(){this.destroyChildren(),this.hidePopup=void 0,super.destroy()}executeOnWrapper(e,t){}executeFunctionIfExists(e,t){Vb(this.getFilterWrappers(),o=>{o&&(t?.(o),this.executeFunctionIfExistsOnFilter(this.getFilterFromWrapper(o),e))})}executeFunctionIfExistsOnFilter(e,t,...o){const s=e[t];"function"==typeof s&&s.apply(e,o)}onFocusIn(e){const t=this.lastActivatedMenuItem;null==t||t.getGui().contains(e.target)||(t.deactivate(),this.lastActivatedMenuItem=null)}},jb=class extends $b{constructor(){super(...arguments),this.filterType="multi",this.wrappers=[],this.activeFilterIndices=[],this.afterFiltersReadyFuncs=[]}init(e){this.params=e,this.filterDefs=Ob(e);const t=Tp(this.beans.colFilter.model,e.column.getColId()),{filterChangedCallback:o}=e;this.filterChangedCallback=o;const s=this.filterDefs.map((e,o)=>this.createFilter(e,o,t));return new Zs(e=>{Zs.all(s).then(t=>{this.wrappers=t,this.refreshGui("columnMenu").then(()=>{e()})})}).then(()=>{for(const e of this.afterFiltersReadyFuncs)e();this.afterFiltersReadyFuncs.length=0})}refresh(e){return this.params=e,!0}isFilterActive(){return this.wrappers.some(e=>{if(!e)return!1;const{filter:t,handler:o,model:s}=e;return o?null!=s:t.isFilterActive()})}getLastActiveFilterIndex(){const e=this.activeFilterIndices;return e.length>0?e[e.length-1]:null}doesFilterPass(e,t){return this.wrappers.every((o,s)=>{if(!o||null!=t&&s===t)return!0;const{handler:i,filter:n,model:r}=o;return i?null==r||i.doesFilterPass({...e,model:r,handlerParams:o.handlerParams}):!n.isFilterActive()||n.doesFilterPass(e)})}getModelFromUi(){return{filterType:this.filterType,filterModels:this.wrappers.map(e=>{if(!e)return null;const t=e.filter;return"function"==typeof t.getModelFromUi?t.getModelFromUi():null})}}getModel(){return this.isFilterActive()?{filterType:this.filterType,filterModels:this.wrappers.map(e=>{if(!e)return null;const{filter:t,handler:o,model:s}=e;return o?s:t.isFilterActive()?t.getModel():null})}:null}setModel(e){const t=[];return this.wrappers.forEach((o,s)=>{if(!o)return;const i=Wb(e,s),{filter:n,filterParams:r,handler:a,handlerParams:l,state:d}=o;if(a){const e={model:i,state:d?.state};o.state=e,o.model=i,t.push(Dp(()=>Zs.resolve({filter:n,filterParams:r}),a,l,i,e,"api").then(()=>{this.updateActiveListForHandler(s,o.model)}))}else t.push(((e,t)=>new Zs(o=>{const s=e.setModel(t);s?s.then(o):o()}))(n,i).then(()=>{this.updateActiveListForFilter(s,n)}))}),Zs.all(t).then(()=>{})}applyModel(e="api"){let t=!1;for(const o of this.wrappers)if(o){const s=o.filter;s instanceof Fn&&(t=s.applyModel(e)||t)}return t}getChildFilterInstance(e){return this.wrappers[e]?.filter}getNumChildFilters(){return this.wrappers.length}destroy(){for(const e of this.wrappers)this.destroyBean(e?.filter),this.destroyBean(e?.handler);this.wrappers.length=0,super.destroy()}getFilterWrappers(){return this.wrappers}getFilterFromWrapper(e){return e.filter}getCompFromWrapper(e){return e.comp}executeOnWrapper(e,t){e.handler?.[t]?.()}createFilter(e,t,o){const s=this.params.column;let i,n=null;const r=this.beans,a=(e,o)=>{const s=this.wrappers[t];if(!s)return;const i={model:e,state:s.state?.state};s.state=i,s.model=e,Dp(()=>Zs.resolve({filter:s.filter,filterParams:s.filterParams}),s.handler,s.handlerParams,e,i,"ui").then(()=>{this.onHandlerModelChanged(t,s.model,o)})},{compDetails:l,handler:d,handlerParams:c,createFilterUi:h}=r.colFilter.createFilterInstance(s,e,"agTextColumnFilter",(c,h)=>{const u={...c,filterChangedCallback:h?()=>{}:e=>{this.executeWhenAllFiltersReady(()=>this.onFilterModelChanged(t,e))},doesRowPassOtherFilter:e=>c.doesRowPassOtherFilter(e)&&this.doesFilterPass({node:e,data:e.data},t),getValue:Ub(r,s,e,c.getValue)};return h&&(n=Wb(o,t),i=this.updateDisplayParams(u,t,n,()=>l,()=>d,a)),u});if(!h)return Zs.resolve(null);let u;if(d){const{doesRowPassOtherFilter:o,getValue:i}=c;u={...c,onModelChange:a,doesRowPassOtherFilter:e=>o(e)&&this.doesFilterPass({node:e,data:e.data},t),getValue:Ub(r,s,e,i)},d.init?.({...u,model:n,source:"init"})}return h().then(e=>{if(!d)return{filter:e,comp:e};const t=l?.params;return{filter:e,comp:i(e),filterParams:t,handler:d,handlerParams:u,model:n}})}updateDisplayParams(e,t,o,s,i,n){const r=this.params.column,a=new u;e.model=o,e.state={model:o},e.onModelChange=n,e.getHandler=i;const l=(e,t)=>{e.state=t,a.dispatchEvent({type:"filterStateChanged",column:r,state:t})};e.onStateChange=e=>{const o=this.wrappers[t];o&&(l(o,e),Mp(o.filter,o.filterParams,o.model??null,e,"ui"))};const d=(e,o,i)=>{const n=this.wrappers[t];if(!n)return;const r=()=>n?.model??null;Ep({action:o,filterParams:n.filterParams,getFilterUi:()=>{const e=Zs.resolve(n.filter);return{created:!0,filterParams:n.filterParams,compDetails:s(),create:()=>e,promise:e}},getModel:r,getState:()=>n?.state??{model:r()},updateState:e=>l(n,e),updateModel:e=>n.filterParams?.onModelChange(e,i),processModelToApply:n.handler?.processModelToApply?.bind(n.handler)})};return e.onAction=(e,t,o)=>{d(0,e,t),a.dispatchEvent({type:"filterAction",column:r,action:e,event:o})},e=>{const t=s()?.params;return this.createManagedBean(new Ki(r,{comp:e,params:t,isHandler:!0},a,d,!1))}}executeWhenAllFiltersReady(e){(this.wrappers?.length??0)>0?e():this.afterFiltersReadyFuncs.push(e)}updateActiveListForFilter(e,t){this.updateActiveList(e,()=>t?.isFilterActive())}updateActiveListForHandler(e,t){this.updateActiveList(e,()=>null!=t)}updateActiveList(e,t){const o=this.activeFilterIndices;s(this.activeFilterIndices,e),t()&&o.push(e)}onFilterModelChanged(e,t){this.updateActiveListForFilter(e,this.wrappers[e]?.filter),this.filterChanged(e,t)}onHandlerModelChanged(e,t,o){this.updateActiveListForHandler(e,t),this.filterChanged(e,o)}filterChanged(e,t){this.filterChangedCallback(t),this.wrappers.forEach((t,o)=>{if(e===o||!t)return;const{filter:s,handler:i}=t;i?.onAnyFilterChanged?.(),"function"==typeof s.onAnyFilterChanged&&s.onAnyFilterChanged()})}getModelAsString(e){if(!e?.filterModels?.length)return"";const t=this.getLastActiveFilterIndex()??0;return(this.wrappers[t]?.filter)?.getModelAsString?.(e.filterModels[t])??""}},Kb=class extends $b{constructor(){super(...arguments),this.filterType="multi",this.filters=[],this.filterParams=[],this.validity=[]}init(e){this.params=e,this.filterDefs=Ob(e).map(t=>{if(t.filterParams?.buttons){Et(292,{colId:e.column.getColId()});const o={...t.filterParams};return delete o.buttons,{...t,filterParams:o}}return t}),this.allState=e.state;const t=this.filterDefs.map((e,t)=>this.createFilter(e,t));return new Zs(e=>{Zs.all(t).then(t=>{this.filters=t,this.refreshGui("columnMenu").then(()=>{e()})})})}refresh(e){const{model:t,state:o,source:s}=e;if("colDef"===s)return!1;this.params=e;const i=this.filterParams;if(o===this.allState)return!0;this.allState=o;const n=o.state;return this.filters.forEach((e,r)=>{const a=Wb(t,r),l={state:n?.[r],model:Wb(o.model,r)};Mp(e,i[r],a,l,s)}),!0}getLastActiveFilterIndex(){return this.getHandler().getLastActiveFilterIndex?.()??null}getChildFilterInstance(e){return this.filters[e]??void 0}getNumChildFilters(){return this.filters.length}destroy(){for(const e of this.filters)this.destroyBean(e);this.filters.length=0,super.destroy()}getFilterWrappers(){return this.filters}getFilterFromWrapper(e){return e}getCompFromWrapper(e){return e}createFilter(e,t){const o=Ti(this.beans.userCompFactory,e,this.updateParams(e,this.params,t),"agTextColumnFilter");return o?(this.filterParams[t]=o.params,o.newAgStackInstance()):Zs.resolve(null)}updateParams(e,t,o){const{doesRowPassOtherFilter:s,model:i,onModelChange:n,state:r,onStateChange:a,column:l,source:d,onAction:c,onUiChange:h,getValue:u}=t,g=Wb(i,o),p=r?{model:Wb(r.model,o),state:r.state?.[o]}:{model:g},m=()=>{const e=this.getHandler();this.filters.forEach((t,s)=>{o!==s&&(e.getHandler(s)?.onAnyFilterChanged?.(),t?.onAnyFilterChanged?.())})},f=this.beans.colFilter;return{...f.createBaseFilterParams(l),...e,doesRowPassOtherFilter:e=>s(e)&&this.getHandler().doesFilterPass({node:e,data:e.data,model:this.params.model,handlerParams:f.getHandlerParams(l)},o),model:g,state:p,onModelChange:(e,t)=>{const{filters:s,params:i}=this,r=zb(i.model,s.length,e,o);this.updateActiveList(o,e),n(r,t),m()},onStateChange:e=>this.onStateChange(a,o,e),getHandler:()=>this.getHandler().getHandler(o),onAction:(e,s,i)=>{if(Hi(t))return;const n="apply"===e||"reset"===e;n&&this.updateActiveList(o,Wb(this.params.state.model,o)),c(e,s,i),n&&m()},onUiChange:h,source:d,getValue:Ub(this.beans,l,e,u)}}updateActiveList(e,t){this.getHandler().updateActiveList?.(e,t)}getHandler(){return this.params.getHandler()}onStateChange(e,t,o){const{model:s,state:i,valid:n}=o,r=this.validity;r[t]=n;const a=this.allState,l=zb(a.model,this.filters.length,s,t),d=r.every(e=>!1!==e),c=[...a.state??[]];c[t]=i;const h={state:c,model:l,valid:d};this.allState=h,e(h)}getModelAsString(e){return this.getHandler().getModelAsString?.(e)??""}},_b={tag:"div",cls:"ag-multi-floating-filter ag-floating-filter-input"},qb={moduleName:"MultiFilter",version:jv,userComponents:{agMultiColumnFilter:{getComp:e=>e.gos.get("enableFilterHandlers")?{classImp:Kb,params:{useForm:!0}}:jb},agMultiColumnFloatingFilter:class extends ni{constructor(){super(_b),this.floatingFilters=[],this.compDetailsList=[]}init(e){this.params=e;const{compDetailsList:t}=this.getCompDetailsList(e);return this.setParams(t)}setParams(e){const t=[];return e.forEach(e=>{const o=e?.newAgStackInstance();null!=o&&(this.compDetailsList.push(e),t.push(o))}),Zs.all(t).then(e=>{e.forEach((e,t)=>{this.floatingFilters.push(e);const o=e.getGui();this.appendChild(o),t>0&&_(o,!1)})})}refresh(e){this.params=e;const{compDetailsList:t,floatingFilterParamsList:o}=this.getCompDetailsList(e);if(t.length===this.compDetailsList.length&&t.every((e,t)=>!this.beans.colFilter?.areFilterCompsDifferent(this.compDetailsList[t],e))){if(o.forEach((e,t)=>{this.floatingFilters[t].refresh?.(e)}),this.gos.get("enableFilterHandlers")){const t=e;if(null==t.model)this.floatingFilters.forEach((e,t)=>{_(e.getGui(),0===t)});else{const e=t.getHandler()?.getLastActiveFilterIndex?.();this.floatingFilters.forEach((t,o)=>{const s=null==e?0===o:o===e;_(t.getGui(),s)})}}}else ie(this.getGui()),this.destroyBeans(this.floatingFilters),this.floatingFilters=[],this.compDetailsList=[],this.setParams(t)}getCompDetailsList(e){const t=[],o=[],s=e.filterParams,i=e.currentParentModel,n=Ob(s);return n.forEach((s,r)=>{const a={...e,parentFilterInstance:e=>{this.parentMultiFilterInstance(t=>{const o=t.getChildFilterInstance(r);null!=o&&e(o)})},currentParentModel:()=>i()?.filterModels?.[r]??null};if(this.gos.get("enableFilterHandlers")){const e=a;e.model=e.model?.filterModels?.[r]??null;const{onModelChange:t,getHandler:o}=e;e.onModelChange=(e,o)=>t(zb(this.params.model,n.length,e,r),o),e.getHandler=()=>o().getHandler(r)}Xe(a.filterParams,s.filterParams);const l=this.getCompDetails(s,a);l&&(t.push(l),o.push(a))}),{compDetailsList:t,floatingFilterParamsList:o}}onParentModelChanged(e,t){t?.afterFloatingFilter||this.parentMultiFilterInstance(o=>{if(null==e)this.floatingFilters.forEach((e,o)=>{e.onParentModelChanged(null,t),_(e.getGui(),0===o)});else{const s=o.getLastActiveFilterIndex();this.floatingFilters.forEach((o,i)=>{const n=e.filterModels.length>i?e.filterModels[i]:null;o.onParentModelChanged(n,t);const r=null==s?0===i:i===s;_(o.getGui(),r)})}})}destroy(){this.destroyBeans(this.floatingFilters),this.floatingFilters.length=0,super.destroy()}getCompDetails(e,t){const{colFilter:o,frameworkOverrides:s,userCompFactory:i}=this.beans;return Ai(i,e,t,jp(s,e,()=>o.getDefaultFloatingFilter(this.params.column))??"agReadOnlyFloatingFilter")}parentMultiFilterInstance(e){this.params.parentFilterInstance(t=>{t instanceof jb||t instanceof Kb||Tt(120),e(t)})}}},beans:[class extends We{constructor(){super(...arguments),this.beanName="multiFilter"}getParamsForDataType(e,t,o,s){let i=e?.filters;const n=this.beans;i||(i=[{filter:$p(o.baseDataType)},{filter:"agSetColumnFilter"}]);const r=this.getLocaleTextFunc();return i=i.map(e=>{const{filter:i,filterParams:a,filterValueGetter:l}=e;if("string"!=typeof i)return e;const{filterParams:d,filterValueGetter:c}=zp(i,a,l??t,o,s,n,r);return{...e,filterParams:d,filterValueGetter:c}}),{filterParams:{...e,filters:i}}}}],dynamicBeans:{agMultiColumnFilterHandler:class extends We{constructor(){super(...arguments),this.filterType="multi",this.handlerWrappers=[],this.activeFilterIndices=[],this.filterDefs=[]}init(e){this.params=e;const t=Ob(e.filterParams);this.filterDefs=t,t.forEach((t,o)=>{const s=this.beans.colFilter.createHandler(e.column,t,"agTextColumnFilter");if(this.handlerWrappers.push(s),!s)return void Et(278,{colId:e.column.getColId()});const{handler:i,handlerParams:n}=s;i.init?.({...this.updateHandlerParams(n,o,!0),model:Wb(e.model,o),source:"init"})}),this.resetActiveList(e.model)}refresh(e){this.params=e;const{model:t,source:o,filterParams:s}=e,i=s?.filters;this.handlerWrappers.forEach((s,n)=>{if(s){const r=this.updateHandlerParams(e,n,!1,i?.[n].filterParams);s.handlerParams=r,s.handler.refresh?.({...r,model:Wb(t,n),source:o})}}),"floating"!==e.source&&"ui"!==e.source&&this.resetActiveList(e.model),e.additionalEventAttributes?.fromButtons&&this.onAnyFilterChanged()}updateHandlerParams(e,t,o,s){const{onModelChange:i,doesRowPassOtherFilter:n,getValue:r}=e,a={...e,onModelChange:(e,o)=>i(zb(this.params.model,this.handlerWrappers.length,e,t),o),doesRowPassOtherFilter:e=>n(e)&&this.doesFilterPass({node:e,data:e.data,model:this.params.model,handlerParams:a},t),getValue:Ub(this.beans,e.column,this.filterDefs[t],r),filterParams:this.updateFilterParams(e,o,s)};return a}updateFilterParams(e,t,o){const s=e.filterParams;o?.buttons&&t&&Et(292,{colId:e.column.getColId()});const i=o?{...s,...o}:s;if(!i.buttons)return i;if(o)return delete i.buttons,i;const{buttons:n,...r}=i;return r}doesFilterPass(e,t){const o=e.model?.filterModels;return null==o||this.handlerWrappers.every((s,i)=>{const n=o[i];if(null==n||null!=t&&i===t)return!0;const r=s?.handler;return!r||r.doesFilterPass({...e,model:n,handlerParams:s.handlerParams})})}resetActiveList(e){this.activeFilterIndices=[];const t=e?.filterModels;if(null!=t)for(let o=0;o0?e[e.length-1]:null}getModelAsString(e,t){const o="filterToolPanel"===t,s=()=>o?this.getLocaleTextFunc()("filterSummaryInactive","is (All)"):"";if(!e?.filterModels?.length)return s();const i=this.getLastActiveFilterIndex()??0;return this.handlerWrappers[i]?.handler.getModelAsString?.(e.filterModels[i],t)??s()}getHandler(e){return this.handlerWrappers[e]?.handler}onAnyFilterChanged(){Vb(this.handlerWrappers,e=>e?.handler?.onAnyFilterChanged?.())}onNewRowsLoaded(){Vb(this.handlerWrappers,e=>e?.handler?.onNewRowsLoaded?.())}destroy(){for(const e of this.handlerWrappers)this.destroyBean(e?.handler);this.handlerWrappers.length=0,super.destroy()}}},dependsOn:[Kv,Zp,fw]},Yb={sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",count:"Count",avg:"Average"};function Zb(e){const{values:t}=e;let o=null;for(let s=0;s0?e.values[0]:null}function Xb(t){return t.values.length>0?e(t.values):null}function Jb(e){const{values:t}=e;let o=null;for(let s=0;se)||(o=e)}return o}function ey(e){const{values:t}=e;let o=null;for(let s=0;s0&&(i=o/("number"==typeof o?s:BigInt(s)));const n=e.rowNode?.aggData?.[e.column?.getColId()];if(n&&n.count===s&&n.value===i)return n;const r=Object.create(sy);return r.count=s,r.value=i,r}function ny({beans:e,values:t,aggFuncOrString:o,column:s,rowNode:i,pivotResultColumn:n,aggregatedChildren:r}){const a="string"==typeof o?e.aggFuncSvc.getAggFunc(o):o;return"function"!=typeof a?(Et(109,{inputValue:o.toString(),allSuggestions:e.aggFuncSvc.getFuncNames(s)}),null):a(wo(e.gos,{values:t,column:s,colDef:s.colDef,pivotResultColumn:n,rowNode:i,data:i?.data,aggregatedChildren:r}))}var ry=(e,t,o)=>{if(!t)return[];const s=t.length,i=new Array(s);for(let n=0;n{const s=o.length,i=new Array(s);for(let r=0;r{if(!e)return[];const o=e.length,s=new Array(o);for(let i=0;i{if(!t)return;let o=e;for(let s=0;s{const o=new kr(t);for(const s of Object.keys(e))Nr.has(s)||(o[s]=e[s]);return o.oldRowTop=null,o})(e,t);o.footer=!0,o.setRowTop(null),o.setRowIndex(null),o.oldRowTop=null,o.id="rowGroupFooter_"+e.id,o.sibling=e,e.sibling=o}function hy(e){const t=e.sibling;t&&(t._destroy(!1),e.sibling=void 0,t.sibling=void 0)}var uy=class extends Pm{constructor(){super(...arguments),this.beanName="valueColsSvc",this.eventName="columnValueChanged",this.columnProcessors={set:(e,t,o)=>this.setValueActive(t,e,o),add:(e,t,o)=>this.setValueActive(!0,e,o),remove:(e,t,o)=>this.setValueActive(!1,e,o)},this.columnExtractors={setFlagFunc:(e,t,o)=>this.setColValueActive(e,t,o),getIndexFunc:()=>{},getInitialIndexFunc:()=>{},getValueFunc:e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0},getInitialValueFunc:e=>null!=e.initialAggFunc&&""!=e.initialAggFunc},this.modifyColumnsNoEventsCallbacks={addCol:e=>this.columns.push(e),removeCol:e=>s(this.columns,e)}}extractCols(e,t){this.columns=super.extractCols(e,t);for(const o of this.columns){const e=o.getColDef();null!=e.aggFunc&&""!=e.aggFunc?this.setColAggFunc(o,e.aggFunc):o.getAggFunc()||this.setColAggFunc(o,e.initialAggFunc)}return this.columns}setColumnAggFunc(e,t,o){if(!e)return;const s=this.colModel.getColDefCol(e);s&&(this.setColAggFunc(s,t),this.dispatchColumnChangedEvent(this.eventSvc,this.eventName,[s],o))}syncColumnWithState(e,t,o){const s=o("aggFunc").value1;void 0!==s&&("string"==typeof s?(this.setColAggFunc(e,s),e.isValueActive()||(this.setColValueActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e))):(a(s)&&Et(33),e.isValueActive()&&(this.setColValueActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e))))}setValueActive(e,t,o){if(e!==t.isValueActive()&&(this.setColValueActive(t,e,o),e&&!t.getAggFunc()&&this.aggFuncSvc)){const e=this.aggFuncSvc.getDefaultAggFunc(t);this.setColAggFunc(t,e)}}setColAggFunc(e,t){e.aggFunc=t,e.dispatchStateUpdatedEvent("aggFunc")}setColValueActive(e,t,o){e.aggregationActive!==t&&(e.aggregationActive=t,e.dispatchColEvent("columnValueChanged",o))}},gy={moduleName:"SharedAggregation",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="aggFuncSvc",this.aggFuncsMap={},this.initialised=!1}postConstruct(){this.init()}init(){this.initialised||(this.initialiseWithDefaultAggregations(),this.addAggFuncs(this.gos.get("aggFuncs")))}initialiseWithDefaultAggregations(){const e=this.aggFuncsMap;e.sum=Zb,e.first=Qb,e.last=Xb,e.min=Jb,e.max=ey,e.count=oy,e.avg=iy,this.initialised=!0}isAggFuncPossible(e,t){const o=this.getFuncNames(e).includes(t),s=a(this.aggFuncsMap[t]);return o&&s}getDefaultFuncLabel(e){return Yb[e]??e}getDefaultAggFunc(e){const t=e.getColDef().defaultAggFunc;if(a(t)&&this.isAggFuncPossible(e,t))return t;if(this.isAggFuncPossible(e,"sum"))return"sum";const o=this.getFuncNames(e);return o?.length?o[0]:null}addAggFuncs(e){if(this.init(),e)for(const t of Object.keys(e))e[t]&&(this.aggFuncsMap[t]=e[t])}getAggFunc(e){return this.init(),this.aggFuncsMap[e]}getFuncNames(e){const t=e.getColDef().allowedAggFuncs;return null==t?Object.keys(this.aggFuncsMap).sort():t}clear(){this.aggFuncsMap={}}},class extends We{constructor(){super(...arguments),this.beanName="aggColNameSvc"}getHeaderName(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const{valueColsSvc:o,colModel:s,rowGroupColsSvc:i}=this.beans,n=e.getColDef().pivotValueColumn;let r,l=null;if(a(n)){const s=o?.columns??[],i=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===s.length,a=void 0!==e.getColDef().pivotTotalColumnIds;if(i&&!a)return t;l=n?n.getAggFunc():null,r=!0}else{const t=e.isValueActive(),o=0!==i?.columns.length,n=s.isPivotMode()||o||this.gos.get("treeData");t&&n?(l=e.getAggFunc(),r=!0):r=!1}if(r){const e="string"==typeof l?l:"func";return`${this.getLocaleTextFunc()(e,e)}(${t})`}return t}},class extends We{constructor(){super(...arguments),this.beanName="footerSvc"}addTotalRows(e,t,o,s,i,n){let r=e;if(i)return function(e,t){switch(t){case"top":case"pinnedTop":return"top"===e;case"bottom":case"pinnedBottom":return"bottom"===e;default:return!1}}(n,s&&qt(this.gos))&&(cy(t,this.beans),o(t.sibling,r++)),r;const a=Yt(this.gos);return(s&&a({node:t}))===n&&(cy(t,this.beans),o(t.sibling,r++)),r}getTopDisplayIndex(e,t,o,s){let i=t;if(e[0].footer){if(0===t)return 0;i-=1}const n=e[e.length-1],r=i>=o.length;return n.footer&&r?n.rowIndex:s(i)}doesCellShowTotalPrefix(e,t){return!(!e.footer||!t?.getColDef().showRowGroup)&&(!!this.gos.get("treeData")||(-1===e.level?this.beans.showRowGroupCols?.columns[0]===t:!!e.rowGroupColumn&&t?.isRowGroupDisplayed(e.rowGroupColumn.getId())))}applyTotalPrefix(e,t,o,s){const i=s.getColDef().cellRendererParams?.totalValueGetter;if(i){const n=wo(this.gos,{column:s,node:o,value:e,formattedValue:t});if("function"==typeof i)return i(n);if("string"==typeof i)return this.beans.expressionSvc?.evaluate(i,n);Et(179)}return-1===o.level?this.getLocaleTextFunc()("footerTotal","Total")+" ":this.getTotalValue(t??e)??""}getTotalValue(e){return this.getLocaleTextFunc()("footerTotal","Total")+" "+(e??"")}},uy],apiFunctions:{addAggFuncs:function(e,t){e.aggFuncSvc&&e.aggFuncSvc.addAggFuncs(t)},clearAggFuncs:function(e){e.aggFuncSvc&&e.aggFuncSvc.clear()},setColumnAggFunc:function(e,t,o){e.valueColsSvc?.setColumnAggFunc?.(t,o,"api")}},dependsOn:[Kv]},py={moduleName:"Aggregation",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="aggStage",this.step="aggregate",this.refreshProps=["getGroupRowAgg","alwaysAggregateAtRootLevel","suppressAggFilteredOnly","grandTotalRow"],this.clientSide=!1}wireBeans(e){this.colModel=e.colModel,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.pivotResultCols=e.pivotResultCols,this.valueSvc=e.valueSvc,this.clientSide=Lt(e.gos)}execute(e){const t=!this.valueColsSvc?.columns?.length,o=!this.gos.getCallback("getGroupRowAgg");if(t&&o&&e?.active)return;const s=this.createAggDetails(e);this.recursivelyCreateAggData(s)}createAggDetails(e){const t=this.colModel.isPivotActive(),o=this.valueColsSvc?.columns,s=t&&this.pivotColsSvc?this.pivotColsSvc.columns:[];return{alwaysAggregateAtRootLevel:this.gos.get("alwaysAggregateAtRootLevel"),groupIncludeTotalFooter:!!qt(this.gos),changedPath:e,valueColumns:o??[],pivotColumns:s,filteredOnly:!this.isSuppressAggFilteredOnly(),userAggFunc:this.gos.getCallback("getGroupRowAgg")}}isSuppressAggFilteredOnly(){return void 0!==_t(this.gos)||this.gos.get("suppressAggFilteredOnly")}recursivelyCreateAggData(e){e.changedPath.forEachChangedNodeDepthFirst(t=>{if(t.hasChildren()){if(-1===t.level&&!e.groupIncludeTotalFooter){const o=!this.colModel.isPivotMode();if(!e.alwaysAggregateAtRootLevel&&o)return void this.setAggData(t,null)}this.aggregateRowNode(t,e)}else t.aggData&&this.setAggDataWithSiblings(t,null)},!0)}aggregateRowNode(e,t){const o=0===t.valueColumns.length,s=0===t.pivotColumns.length;let i;i=t.userAggFunc?t.userAggFunc({nodes:e.childrenAfterFilter}):o?null:s?this.aggregateRowNodeUsingValuesOnly(e,t):this.aggregateRowNodeUsingValuesAndPivot(e),this.setAggDataWithSiblings(e,i)}aggregateRowNodeUsingValuesAndPivot(e){const t={},o=this.pivotResultCols?.getPivotResultCols()?.list??[];let s=!0;const i=this.beans,n=this.valueSvc;for(let r=0;rt[e]);t[n.colId]=ny({beans:i,values:a,aggFuncOrString:n.pivotValueColumn.getAggFunc(),column:n.pivotValueColumn,rowNode:e,pivotResultColumn:s,aggregatedChildren:e.childrenAfterFilter??[]})}return t}aggregateRowNodeUsingValuesOnly(e,t){const o={},{changedPath:s,valueColumns:i,filteredOnly:n}=t,r=s.active?s.getValueColumnsForNode(e,i):i,a=s.active?s.getNotValueColumnsForNode(e,i):null,l=(n?e.childrenAfterFilter:e.childrenAfterGroup)??[],d=ay(this.valueSvc,l,r),c=e.aggData,h=this.beans;if(r.forEach((t,s)=>{o[t.getId()]=ny({beans:h,values:d[s],aggFuncOrString:t.getAggFunc(),column:t,rowNode:e,pivotResultColumn:void 0,aggregatedChildren:l})}),a&&c)for(const u of a)o[u.getId()]=c[u.getId()];return o}getAggregatedChildren(e,t){if(!e?.group||!this.clientSide)return[];if(e.rowPinned){const t=e.pinnedSibling;if(!t)return[];e=t}const o=t?.getColDef(),s=o?.pivotKeys;return s?e.leafGroup&&s.length&&!o.pivotTotalColumnIds?dy(e.childrenMapped,s)??[]:e.childrenAfterFilter??e.childrenAfterGroup??[]:this.isSuppressAggFilteredOnly()?e.childrenAfterGroup??[]:e.childrenAfterFilter??e.childrenAfterGroup??[]}setAggDataWithSiblings(e,t){this.setAggData(e,t);const o=e.pinnedSibling;o&&this.setAggData(o,t);const s=e.sibling;if(s){this.setAggData(s,t);const e=s.pinnedSibling;e&&this.setAggData(e,t)}}setAggData(e,t){const o=e.aggData;if(e.aggData=t,e.__localEventService){const s=t=>{const s=e.aggData?e.aggData[t]:void 0,i=o?o[t]:void 0;if(s===i)return;const n=this.colModel.getColById(t);n&&e.dispatchCellChangedEvent(n,s,i)};if(o)for(const e of Object.keys(o))s(e);if(t)for(const e of Object.keys(t))o&&e in o||s(e)}}},class extends We{constructor(){super(...arguments),this.beanName="filterAggStage",this.step="filter_aggregates",this.refreshProps=[]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const t=this.beans.colModel.isPivotMode(),o=this.filterManager?.isAggregateFilterPresent()||this.filterManager?.isAggregateQuickFilterPresent(),s=_t(this.gos)||(t?e=>e.node.leafGroup:e=>!e.node.group),i=(e,t=!1)=>{if(e.childrenAfterFilter){if(e.childrenAfterAggFilter=e.childrenAfterFilter,t)for(const o of e.childrenAfterAggFilter)i(o,t);this.setAllChildrenCount(e)}e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)};e.forEachChangedNodeDepthFirst(o?e=>{e.childrenAfterAggFilter=e.childrenAfterFilter?.filter(e=>s({node:e})&&this.filterManager.doesRowPassAggregateFilters({rowNode:e})?(i(e,!0),!0):e.childrenAfterAggFilter?.length)||null,this.setAllChildrenCount(e),e.sibling&&(e.sibling.childrenAfterAggFilter=e.childrenAfterAggFilter)}:i,!0)}setAllChildrenCountTreeData(e){const t=e.childrenAfterAggFilter;let o=0;if(t){const e=t.length;o=e;for(let s=0;s=0?null:o)}setAllChildrenCountGridGrouping(e){let t=0;e.childrenAfterAggFilter.forEach(e=>{e.group?t+=e.allChildrenCount:t++}),e.setAllChildrenCount(t)}setAllChildrenCount(e){e.hasChildren()?this.gos.get("treeData")?this.setAllChildrenCountTreeData(e):this.setAllChildrenCountGridGrouping(e):e.setAllChildrenCount(null)}}],rowModels:["clientSide"],dependsOn:[gy]},my=(e,t,o,s)=>i=>{const n=ad((({valueSvc:e,dataTypeSvc:t},o,s)=>{const i=e.getValue(o,s,"data");let n=null;return i instanceof Date?n=i:"string"==typeof i&&(n=(t?.getDateParserFunction(o)??cd)(i)??null),n})(e,t,i.node));return n?s?.(n[o])??n[o]:null},fy=({colNames:e},t,o)=>s=>{const i=e.getDisplayNameForColumn(t,s.location);return i?`${i} (${o})`:""},Cy=Object.fromEntries(ld.map(e=>[e,e.toLowerCase()]));function vy(e){return e.groupHierarchy??e.rowGroupingHierarchy}function wy(e,t,o){const s=e.get(t);e.set(t,(s??[]).concat(o))}var by={moduleName:"GroupHierarchy",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="groupHierarchyColSvc",this.columns=null,this.sourceColumnMap=/* @__PURE__ */new WeakMap,this.inverseColumnMap=/* @__PURE__ */new WeakMap}addColumns(e){const t=this.columns;null!=t&&(e.list=t.list.filter(t=>!e.list.some(e=>e.getColId()===t.getColId())).concat(e.list),e.tree=t.tree.filter(t=>!e.tree.some(e=>e.getId()===t.getId())).concat(e.tree),Qo(e))}createColumns(e){const t=/* @__PURE__ */new WeakMap,o=/* @__PURE__ */new WeakMap,s=this.createGroupHierarchyColumns(e,t,o);if(Zo(s,this.columns?.list??[]))return;$o(this.beans,this.columns?.tree),this.columns=null;const{colGroupSvc:i}=this.beans,n=i?.findDepth(e.tree)??0;this.columns={list:s,tree:i?.balanceTreeForAutoCols(s,n)??[],treeDepth:n,map:{}},this.sourceColumnMap=t,this.inverseColumnMap=o}updateColumns(e){}getColumn(e){return this.columns?.list.find(t=>Jo(t,e))??null}getColumns(){return this.columns?.list??null}expandColumnInto(e,t){const o=this.getVirtualColumnsForColumn(t).concat(t);for(const s of o)e.some(e=>Jo(e,s)||e.getColId()===s.getColId())||e.push(s)}compareVirtualColumns(e,t){const o=this.inverseColumnMap.get(e),s=this.inverseColumnMap.get(t);if(o&&o===s){const s=this.sourceColumnMap.get(o)??[];return s?.indexOf(e)-s?.indexOf(t)}return this.sourceColumnMap.get(e)?.includes(t)?1:this.sourceColumnMap.get(t)?.includes(e)?-1:null}insertVirtualColumnsForCol(e,t){const o=this.getVirtualColumnsForColumn(t);if(!o)return[];let s=e.indexOf(t);return s<0&&(s=e.length-1),i(e,o),e.splice(s,0,...o),o}getVirtualColumnsForColumn(e){return this.isGroupHierarchyColsEnabledForCol(e)?this.sourceColumnMap.get(e)??[]:[]}isGroupHierarchyColsEnabled(e){return e.list.some(e=>this.isGroupHierarchyColsEnabledForCol(e))}isGroupHierarchyColsEnabledForCol(e){const t=e.getColDef();return!(!vy(t)||!(t.rowGroup||t.enableRowGroup||null!=t.rowGroupIndex||t.pivot||t.enablePivot||null!=t.pivotIndex))}createGroupHierarchyColDefs(e){const t=[],o=e.getColDef(),s=vy(o);if(!s)return t;if(!this.isGroupHierarchyColsEnabledForCol(e))return t;for(const i of s){let s=null;s="string"==typeof i?this.createColDefForPart(i,e,o):i,s&&t.push(s)}return t}createGroupHierarchyColumns(e,t,o){if(!this.isGroupHierarchyColsEnabled(e))return[];const s=[];for(const i of e.list)for(const e of this.createGroupHierarchyColDefs(i)){const n=e.colId;this.gos.validateColDef(e,n,!0);const r=new Mo(e,null,n,!0);this.createBean(r),s.push(r),wy(t,i,r),o.set(r,i)}return s}createColDefForPart(e,t,o){const{beans:s,gos:i}=this,n=`ag-Grid-HierarchyColumn-${t.getColId()}-${e}`,r={enableRowGroup:o.enableRowGroup,rowGroup:o.rowGroup,enablePivot:o.enablePivot,hide:!0,editable:!1},a=i.get("groupHierarchyConfig")??{};if(e in a){const t={...r,...a[e]};return t.colId??(t.colId=n),cs(s,t,t.colId,!0)}const l=cs(s,{colId:n,...r},n,!0),d=this.getLocaleTextFunc(),c=(e,t)=>d?.(e,t)??t;switch(e){case"year":return{...l,headerValueGetter:fy(s,t,c(e,"Year")),valueGetter:my(s,t,0)};case"quarter":return{...l,headerValueGetter:fy(s,t,c(e,"Quarter")),valueGetter:my(s,t,1,e=>(Math.floor(Number(e)/4)+1).toString())};case"month":return{...l,headerValueGetter:fy(s,t,c(e,"Month")),valueGetter:my(s,t,1)};case"formattedMonth":return{...l,headerValueGetter:fy(s,t,c("month","Month")),valueGetter:my(s,t,1,e=>{const t=(e=>{const t=ld[Number.parseInt(e,10)-1]??e;return{month:t,localeKey:Cy[t]??e}})(e);return c(t.localeKey,t.month)})};case"day":return{...l,headerValueGetter:fy(s,t,c(e,"Day")),valueGetter:my(s,t,2)};case"hour":return{...l,headerValueGetter:fy(s,t,c(e,"Hour")),valueGetter:my(s,t,3)};case"minute":return{...l,headerValueGetter:fy(s,t,c(e,"Minute")),valueGetter:my(s,t,4)};case"second":return{...l,headerValueGetter:fy(s,t,c(e,"Second")),valueGetter:my(s,t,5)};default:return null}}}]},yy=class extends Pm{constructor(){super(...arguments),this.beanName="pivotColsSvc",this.eventName="columnPivotChanged",this.columnProcessors={set:(e,t,o)=>this.setColPivotActive(e,t,o),add:(e,t,o)=>this.setColPivotActive(e,!0,o),remove:(e,t,o)=>this.setColPivotActive(e,!1,o)},this.columnOrdering={enableProp:"pivot",initialEnableProp:"initialPivot",indexProp:"pivotIndex",initialIndexProp:"initialPivotIndex"},this.columnExtractors={setFlagFunc:(e,t,o)=>this.setColPivotActive(e,t,o),getIndexFunc:e=>e.pivotIndex,getInitialIndexFunc:e=>e.initialPivotIndex,getValueFunc:e=>e.pivot,getInitialValueFunc:e=>e.initialPivot},this.modifyColumnsNoEventsCallbacks={addCol:e=>{this.columns.includes(e)||this.columns.push(e)},removeCol:e=>s(this.columns,e)}}syncColumnWithState(e,t,o,s){const{value1:i,value2:n}=o("pivot","pivotIndex");void 0===i&&void 0===n||("number"==typeof n||i?(e.isPivotActive()||(this.setColPivotActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),s&&"number"==typeof n&&(s[e.getId()]=n)):e.isPivotActive()&&(this.setColPivotActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setColPivotActive(e,t,o){e.pivotActive!==t&&(e.pivotActive=t,t&&(this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e))?.forEach(e=>this.setColPivotActive(e,t,o)),e.dispatchColEvent("columnPivotChanged",o)),e.dispatchStateUpdatedEvent("pivot")}},Sy=class extends We{addExpandedCss(e,t){t.isExpandable()&&(e.push("ag-row-group"),e.push(t.expanded?"ag-row-group-expanded":"ag-row-group-contracted"))}getRowExpandedListeners(e){const{rowNode:t}=e,o=this.updateExpandedCss.bind(this,e,t);return{expandedChanged:o,hasChildrenChanged:o}}setExpanded(e,t,o,s){if(e.expanded===t)return;e.expanded=t,e.dispatchRowEvent("expandedChanged");const i={...Lr(e,this.gos,"rowGroupOpened"),expanded:t,event:o||null};this.dispatchExpandedEvent(i,s)}isExpandable(e){return!e.footer&&(this.beans.colModel.isPivotMode()?e.hasChildren()&&!e.leafGroup:e.hasChildren()||e.master)}updateExpandedCss(e,t){const o=t.isExpandable(),s=1==t.expanded;e.forEachGui(void 0,e=>{const t=e.rowComp;t.toggleCss("ag-row-group",o),t.toggleCss("ag-row-group-expanded",o&&s),t.toggleCss("ag-row-group-contracted",o&&!s),G(e.element,o&&s)})}dispatchStateUpdatedEvent(){this.eventSvc.dispatchEvent({type:"rowExpansionStateChanged"})}};function Ry(e,t,o){return!0===e.groupHideParentOfSingleChild&&o&&1===t.childrenAfterGroup.length}function xy(e,t,o){return"leafGroupsOnly"===e.groupHideParentOfSingleChild&&o&&t.leafGroup&&1===t.childrenAfterGroup.length}function Fy(e,t,o,s,i,n){const r=s&&!o,a=s&&t.leafGroup,l=e.hideOpenParents&&t.expanded&&!t.master&&!a;return!(r||l||i||n)}var Dy=()=>{const e=new Fl;return e.reordered=!0,e},My=(e,t)=>{if(!e||!t)return!1;let o=t;for(;o;){if(o===e)return!0;o=o.parent}return!1},Py=(e,t)=>{if(!t||e.parent===t)return!1;let o=t;const s=e.id;for(;o;){if(o===e)return!0;if(null!=s&&o.id===s)return!0;o=o.parent}return!1},Ey=(e,t)=>{for(let o=0,s=e.length;o{const t=e.sibling;if(!t)return null;const o=t._leafs;return void 0!==o?o:Ay(t)},Ay=e=>{const t=e.childrenAfterGroup,o=t?.length;if(e._leafs=null,!o)return null;let s;const i=1===o?t[0]:null;if(i?.group&&i.sourceRowIndex<0)s=i._leafs,void 0===s&&(s=Ay(i));else if(e.leafGroup)s=t;else{s=[];for(let e=0;e=0&&s.push(o),!o.group)continue;let i=o._leafs;if(void 0===i&&(i=Ay(o)),i)for(let e=0,t=i.length;e{const o=e._leafs,s=e.sibling;e.treeNodeFlags=0,e.childrenAfterGroup=o,e.childrenMapped=null,e._groupData=void 0,s&&(s.childrenAfterGroup=e.childrenAfterGroup,s.childrenAfterAggFilter=e.childrenAfterAggFilter,s.childrenAfterFilter=e.childrenAfterFilter,s.childrenAfterSort=e.childrenAfterSort,s.childrenMapped=null,s._groupData=void 0);for(let i=0,n=o.length??0;i{e.key=null,e.treeNodeFlags=0,e.allChildrenCount=null,e.childrenAfterGroup=null,e.childrenAfterAggFilter=null,e.childrenAfterFilter=null,e.childrenAfterSort=null,e.childrenMapped=null,e.level=0,e._groupData=void 0};function Ly(e,t,o){let s=e;const i=s.level-t.level;if(i<=0)return!1;if(!o.get("groupHideOpenParents"))return!1;for(let n=0;n{const i=e.gos,n=s&&i.get("isGroupOpenByDefault");if(!n){const e=i.get("groupDefaultExpanded");return-1===e||o{const{rowDragSvc:e}=this.beans;if(!this.params.rowDrag||!e)return;const t=e.createRowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(t),this.eGui.insertAdjacentElement("afterbegin",t.getGui())})(),this.setupCheckbox(),this.addGroupValue(),this.setupIndent()}getCellAriaRole(){const e=this.params.colDef?.cellAriaRole,t=this.params.column?.getColDef().cellAriaRole;return e||t||"gridcell"}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gos.get("embedFullWidthRows"))return!1;const{visibleCols:e}=this.beans,t="left"===this.params.pinned,o="right"===this.params.pinned,s=!t&&!o;return this.gos.get("enableRtl")?e.isPinningLeft()?!o:!s:e.isPinningLeft()?!t:!s}addGroupValue(){const{params:{value:e,valueFormatted:t}}=this,o=this.getInnerCompDetails();this.comp.setInnerRenderer(o,t??e??null)}setupExpand(){const{colModel:e}=this.beans,{eGridCell:t,column:o,suppressDoubleClickExpand:s}=this.params,i=(e,t)=>{const o=ei(e,this.beans,null);o&&(t.appendChild(o),this.addDestroyFunc(()=>o.remove()))};i("groupExpanded",this.eExpanded),i("groupContracted",this.eContracted);const n=this.comp,r=()=>{if(!this.isExpandable())return;const e=this.displayedNode.expanded;n.setExpandedDisplayed(e),n.setContractedDisplayed(!e),G(t,!!this.displayedNode.expanded)},a=()=>{const o=this.isExpandable();n.toggleCss("ag-cell-expandable",o),n.toggleCss("ag-row-group",o);const s=!o&&e.isPivotMode();n.toggleCss("ag-pivot-leaf-group",s);const i=!(e.isPivotMode()||this.displayedNode.footer&&-1===this.displayedNode.level);n.toggleCss("ag-row-group-leaf-indent",!o&&i);const a=this.getChildCount(),l=a>0?`(${a})`:"";n.setChildCount(l),o?r():(n.setExpandedDisplayed(!1),n.setContractedDisplayed(!1),D(t,"expanded"))};(()=>{o?.isCellEditable(this.displayedNode)&&this.gos.get("enableGroupEdit")||s||this.addManagedListeners(t,{dblclick:this.onCellDblClicked.bind(this)}),this.addManagedListeners(this.eExpanded,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(this.eContracted,{click:this.onExpandClicked.bind(this)}),this.addManagedListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedListeners(this.displayedNode,{allChildrenCountChanged:a,masterChanged:a,groupChanged:a,hasChildrenChanged:a,expandedChanged:r})})(),a()}getInnerCompDetails(){const{userCompFactory:e,findSvc:t}=this.beans,o=this.params;if(o.fullWidth){const s=this.gos.get("groupRowRendererParams"),i=Di(e,s,o);return i||(t?.isMatch(o.node,null)?Di(e,{...s,innerRenderer:"agFindCellRenderer"},o):void 0)}const s=e=>e&&e.componentClass==this.compClass,i=Di(e,o,o);if(i&&!s(i))return i;const{displayedNode:{rowGroupColumn:n}}=this,r=n?.colDef,a=n&&o.column?.isRowGroupDisplayed(n.getId());if(r&&a){const t=Mi(e,r,o);if(t){if(!s(t))return t;if(r?.cellRendererParams?.innerRenderer)return Di(e,r.cellRendererParams,o)}}return t?.isMatch(o.node,o.column)?Mi(e,{...r??o.colDef,cellRenderer:"agFindCellRenderer"},o):void 0}getChildCount(){const{column:e,suppressCount:t}=this.params;if(t)return 0;const{allChildrenCount:o,rowGroupColumn:s}=this.displayedNode;return!((o??0)>0)||s&&e&&!e?.isRowGroupDisplayed(s.getId())||this.gos.get("showOpenedGroup")&&this.displayedNode!==this.node&&!Ly(this.node,this.displayedNode,this.gos)?0:o??0}isExpandable(){const{node:e,column:t,colDef:o}=this.params;if(!this.displayedNode.isExpandable())return!1;if(e.rowPinned)return!1;if(!t)return!0;if(e.hasChildren()&&o){const{showRowGroup:e}=o;if(!e)return!1;if(!0===e)return!0}return e===this.displayedNode?!(!e.rowGroupColumn||!t?.isRowGroupDisplayed(e.rowGroupColumn.getId()))||!!e.master&&(!0===o?.showRowGroup||null==o?.showRowGroup):Ly(this.node,this.displayedNode,this.gos)}setupIndent(){const{suppressPadding:e,node:t,colDef:o}=this.params;if(e)return;const s=()=>{let e=t.uiLevel;o&&!0!==o.showRowGroup&&(e=0);const s="ag-row-group-indent-"+e;s!==this.indentClass&&(this.indentClass&&this.comp.toggleCss(this.indentClass,!1),this.indentClass=s,this.comp.toggleCss(s,!0),this.eGui.style.setProperty("--ag-indentation-level",String(e)))};this.addManagedListeners(t,{uiLevelChanged:s.bind(this)}),s()}setupCheckbox(){const{node:e}=this.params;e.footer||e.rowPinned||e.detail||(this.addManagedPropertyListener("rowSelection",({currentValue:e,previousValue:t})=>{const o="object"==typeof e?e:void 0,s="object"==typeof t?t:void 0;o?.checkboxLocation!==s?.checkboxLocation&&(this.destroyCheckbox(),this.addCheckbox())}),this.addCheckbox())}addCheckbox(){const{selectionSvc:e}=this.beans;if(!e||!Bt(this.gos))return;const{node:t,column:o}=this.params,s=this.gos.get("rowSelection"),i=so(s);if("selectionColumn"===i)return;if("autoGroupColumn"===i){const e=null!=o?.getColDef().showRowGroup,s=!o&&t.group;if(!e&&!s)return}const n="object"==typeof s?to(s):this.params.checkbox;if("function"!=typeof n&&!0!==n)return;if("string"==typeof o?.getColDef().showRowGroup&&!this.isExpandable())return void this.comp.setCheckboxSpacing(!0);const r=e.createCheckboxSelectionComponent();this.cbComp=r,this.createBean(r),r.init({rowNode:t,column:o,overrides:{isVisible:n,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(r.getGui()),this.comp.setCheckboxVisible(!0)}destroyCheckbox(){this.comp.setCheckboxSpacing(!1),this.comp.setCheckboxVisible(!1),this.cbComp?.getGui().remove(),this.cbComp=this.destroyBean(this.cbComp)}onExpandClicked(e){Sn(e)||(yn(e),this.onExpandOrContract(e))}onKeyDown(e){e.key!==Es||this.params.suppressEnterExpand||this.params.column?.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){Sn(e)||Te(this.eExpanded,e)||Te(this.eContracted,e)||this.onExpandOrContract(e)}onExpandOrContract(e){if(!this.isExpandable())return;const t=this.displayedNode,o=!t.expanded;!o&&t.sticky&&this.beans.ctrlsSvc.getScrollFeature().setVerticalScrollPosition(t.rowTop-t.stickyRowTop),t.setExpanded(o,e)}destroy(){super.destroy(),this.destroyCheckbox()}},By={tag:"span",cls:"ag-cell-wrapper",children:[{tag:"span",ref:"eExpanded",cls:"ag-group-expanded ag-hidden"},{tag:"span",ref:"eContracted",cls:"ag-group-contracted ag-hidden"},{tag:"span",ref:"eCheckbox",cls:"ag-group-checkbox ag-invisible"},{tag:"span",ref:"eValue",cls:"ag-group-value"},{tag:"span",ref:"eChildCount",cls:"ag-group-child-count"}]},Hy=class extends ni{constructor(){super(By),this.eExpanded=null,this.eContracted=null,this.eCheckbox=null,this.eValue=null,this.eChildCount=null}init(e){const t={setInnerRenderer:(e,t)=>this.setRenderDetails(e,t),setChildCount:e=>this.eChildCount.textContent=e,toggleCss:(e,t)=>this.toggleCss(e,t),setContractedDisplayed:e=>_(this.eContracted,e),setExpandedDisplayed:e=>_(this.eExpanded,e),setCheckboxVisible:e=>this.eCheckbox.classList.toggle("ag-invisible",!e),setCheckboxSpacing:e=>this.eCheckbox.classList.toggle("ag-group-checkbox-spacing",e)},o=this.createManagedBean(new Ny),s=!e.colDef,i=this.getGui();o.init(t,i,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),s&&P(i,o.getCellAriaRole())}setRenderDetails(e,t){e?e.newAgStackInstance().then(e=>{if(!e)return;const t=()=>this.destroyBean(e);this.isAlive()?(this.eValue.appendChild(e.getGui()),this.addDestroyFunc(t)):t()}):this.eValue.innerText=t}destroy(){this.destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}},Oy=class extends We{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.extraTopHeight=0,this.extraBottomHeight=0}postConstruct(){this.isClientSide=Lt(this.gos),this.beans.ctrlsSvc.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl}),this.resetStickyContainers()}setOffsetTop(e){this.extraTopHeight!==e&&(this.extraTopHeight=e,this.eventSvc.dispatchEvent({type:"stickyTopOffsetChanged",offset:e}))}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getLastPixelOfGroup(t){return this.isClientSide?function(t){if(t.isExpandable()||t.footer){if(t.footer&&0===t.rowIndex)return Number.MAX_SAFE_INTEGER;if(!t.sibling||1===Math.abs(t.sibling.rowIndex-t.rowIndex)){let o=t.footer?t.sibling:t;for(;o.isExpandable()&&o.expanded;)if(o.master&&o.detailNode)o=o.detailNode;else if(o.childrenAfterSort){if(0===o.childrenAfterSort.length)break;o=e(o.childrenAfterSort)}return o.rowTop+o.rowHeight}return t.footer?t.rowTop+t.rowHeight:t.sibling.rowTop+t.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}(t):function(e){if(e.isExpandable()||e.footer){if(e.master&&e.detailNode)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let t=e.childStore?.getStoreBounds();return e.footer&&(t=e.sibling.childStore?.getStoreBounds()),(t?.heightPx??0)+(t?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}(t)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}updateStickyRows(e){const t="top"===e;let o=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,/* @__PURE__ */new Set,o);const s=/* @__PURE__ */new Set,{rowModel:i,rowRenderer:n,pinnedRowModel:r,pageBounds:a,rowContainerHeight:l}=this.beans,{pageFirstPixel:d,pageLastPixel:c}=a.getCurrentPagePixelRange(),h=t?n.firstVisibleVPixel-this.extraTopHeight:n.lastVisibleVPixel-this.extraTopHeight,u=l.divStretchOffset??0,g=d+u,p=c+u,m=e=>{if(s.add(e),t){const t=this.getLastPixelOfGroup(e),s=h+o+e.rowHeight;e.stickyRowTop=ts?o-(t-s):o}o=0,s.forEach(e=>{const t=e.stickyRowTop+e.rowHeight;o{if(!t.displayed)return!1;if(t.footer){if(!0===f)return!1;if("grand"===f&&-1===t.level)return!1;if("group"===f&&t.level>-1)return!1;const o=!!t.sibling.rowIndex&&t.sibling.rowIndex+1===t.rowIndex;return("bottom"!==e||!o)&&((-1!==t.level||!r?.getGrandTotalPinned())&&!s.has(t))}return!!t.isExpandable()&&(!0!==C&&("bottom"!==e&&(!s.has(t)&&t.expanded)))};for(let w=0;w<100;w++){let e=h+o;t||(e=h-o),t&&ep&&(e=p);const s=i.getRowIndexAtPixel(e),n=i.getRow(s);if(null==n)break;const r=this.getStickyAncestors(n).find(e=>(t?e.rowIndexs)&&v(e));if(r)m(r);else{if(!(t?n.rowTope)||!v(n))break;m(n)}}return t||s.forEach(e=>{e.stickyRowTop=o-(e.stickyRowTop+e.rowHeight)}),this.refreshNodesAndContainerHeight(e,s,o)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t="group"===e,o="grand"===e;return!(!t||!o)||(o?"grand":!!t&&"group")}canRowsBeSticky(){const e=jt(this.gos),t=this.areFooterRowsStickySuppressed(),o=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!o)}getStickyAncestors(e){const t=[];let o=e.footer?e.sibling:e.parent;for(;o;)o.sibling&&t.push(o.sibling),t.push(o),o=o.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",/* @__PURE__ */new Set,0),this.refreshNodesAndContainerHeight("bottom",/* @__PURE__ */new Set,0)}refreshStickyNode(e){const t=/* @__PURE__ */new Set;if(this.stickyTopRowCtrls.some(t=>t.rowNode===e)){for(let o=0;o{a.has(e)||(e.sticky=!0,l.push(this.createRowCon(e,!1,!1)))});let d=!!l.length||r.length!==i.length;s?this.topContainerHeight!==o&&(this.topContainerHeight=o,this.gridBodyCtrl.setStickyTopHeight(o),d=!0):this.bottomContainerHeight!==o&&(this.bottomContainerHeight=o,this.gridBodyCtrl.setStickyBottomHeight(o),d=!0),this.destroyRowCtrls(n,!1);const c=[...r,...l];c.sort((e,t)=>t.rowNode.rowIndex-e.rowNode.rowIndex),s||c.reverse();for(const g of c)g.setRowTop(g.rowNode.stickyRowTop);const h=this.beans.pageBounds;let u=0;if(s){for(const e of t)e.rowIndexthis.topContainerHeight&&(u=this.topContainerHeight),this.setOffsetTop(u)}else{for(const e of t)e.rowIndex>h.getLastRow()&&(u+=e.rowHeight);u>this.bottomContainerHeight&&(u=this.bottomContainerHeight),this.setOffsetBottom(u)}return!!d&&(s?this.stickyTopRowCtrls=c:this.stickyBottomRowCtrls=c,!0)}ensureRowHeightsValid(){let e=!1;const t=t=>{const o=t.rowNode;if(o.rowHeightEstimated){const t=Ot(this.beans,o);o.setRowHeight(t.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}};var Vy={moduleName:"GroupCellRenderer",version:jv,userComponents:{agGroupRowRenderer:Hy,agGroupCellRenderer:Hy},dynamicBeans:{groupCellRendererCtrl:Ny},icons:{groupContracted:"tree-closed",groupExpanded:"tree-open"},css:[".ag-group-checkbox-spacing{width:var(--ag-icon-size)}:where(.ag-ltr) .ag-group-checkbox-spacing{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-checkbox-spacing{margin-left:var(--ag-cell-widget-spacing)}"],dependsOn:[Kv]},zy={moduleName:"GroupColumn",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="autoColSvc"}postConstruct(){this.addManagedPropertyListener("autoGroupColumnDef",this.updateColumns.bind(this))}addColumns(e){null!=this.columns&&(e.list=this.columns.list.concat(e.list),e.tree=this.columns.tree.concat(e.tree),Qo(e))}createColumns(e,t,o){const s=this.beans,{colModel:i,gos:n,rowGroupColsSvc:r,colGroupSvc:a}=s,l=i.isPivotMode(),d=Qt(n,l),c=l?n.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),h=r?.columns,u=()=>{this.columns&&($o(s,this.columns.tree),this.columns=null)};if(!(h&&h.length>0||n.get("treeData"))||c||d)return void u();const g=this.generateAutoCols(h),p=Zo(g,this.columns?.list||null),m=e.treeDepth,f=(this.columns?this.columns.treeDepth:-1)==m;if(p&&f){const e=new Map(g.map(e=>[e.getId(),e]));for(const t of this.columns?.list??[]){const s=e.get(t.getId());s&&t.setColDef(s.getColDef(),null,o)}return}u();const C=a?.findDepth(e.tree)??0;this.columns={list:g,tree:a?.balanceTreeForAutoCols(g,C)??[],treeDepth:C,map:{}};t(e=>{if(!e)return null;const t=e.filter(e=>!jo(e));return[...g,...t]})}updateColumns(e){const t=Xo(e.source);this.columns?.list.forEach((e,o)=>this.updateOneAutoCol(e,o,t))}getColumn(e){return this.columns?.list.find(t=>Jo(t,e))??null}getColumns(){return this.columns?.list??null}generateAutoCols(e=[]){const t=[],{gos:o}=this,s=o.get("treeData");let i=Zt(o);return s&&i&&(Et(182),i=!1),i?e.forEach((e,o)=>{t.push(this.createOneAutoCol(e,o))}):t.push(this.createOneAutoCol()),t}isSuppressAutoCol(){const e=this.gos;return"custom"===e.get("groupDisplayType")||"custom"===e.get("treeDataDisplayType")}createOneAutoCol(e,t){let o;o=e?`${zo}-${e.getId()}`:zo;const s=this.createAutoColDef(o,e,t);s.colId=o;const i=new Mo(s,null,o,!0);return this.createBean(i),i}updateOneAutoCol(e,t,o){const s=e.getColDef(),i="string"==typeof s.showRowGroup?s.showRowGroup:void 0,n=this.beans,r=null!=i?n.colModel.getColDefCol(i):void 0,a=e.getId(),l=this.createAutoColDef(a,r??void 0,t);e.setColDef(l,null,o),ws(n,{state:[es(l,a)]},o)}createAutoColDef(e,t,o){let s=this.createBaseColDef(t);Xe(s,this.gos.get("autoGroupColumnDef")),s=cs(this.beans,s,e,!0),this.gos.get("treeData")||l(s.field)&&l(s.valueGetter)&&l(s.filterValueGetter)&&"agGroupColumnFilter"!==s.filter&&(s.filter=!1),o&&o>0&&(s.headerCheckboxSelection=!1);const i=Kt(this.gos),n=s.valueGetter||null!=s.field;return i&&!n&&(s.sortIndex=void 0,s.initialSort=void 0),s}createBaseColDef(e){const t=this.gos.get("autoGroupColumnDef"),o={headerName:this.getLocaleTextFunc()("group","Group"),showRowGroup:e?.getColId()??!0};return t&&(t.cellRenderer||t.cellRendererSelector)||(o.cellRenderer="agGroupCellRenderer"),e&&(o.headerName=this.beans.colNames.getDisplayNameForColumn(e,"header")??void 0,o.headerValueGetter=e.colDef.headerValueGetter),o}destroy(){$o(this.beans,this.columns?.tree),super.destroy()}},class extends We{constructor(){super(...arguments),this.beanName="showRowGroupCols",this.columns=[],this.colsSet=/* @__PURE__ */new Set,this.colsMap=/* @__PURE__ */new Map}destroy(){super.destroy(),this.columns.length=0,this.colsSet.clear(),this.colsMap.clear()}refresh(){const{colModel:e,rowGroupColsSvc:t}=this.beans,o=this.columns,s=this.colsSet,i=this.colsMap;i.clear();const n=o.length;let r=0,a=!1;const l=e.getCols();for(let d=0,c=l.length;d=n||!s.has(e)),o[r++]=e}if(a||(a=r!==n),a){o.length=r,s.clear();for(let e=0;ee.level)return null;const n=this.getDisplayedNode(e,t,!0);if(n)return{displayedNode:n,value:s.getValue(t,n,"data",o)}}const n=s.getValue(t,e,"data",o);if(null==n){const i=this.getDisplayedNode(e,t);if(i)return{displayedNode:i,value:s.getValue(t,i,"data",o)}}return{displayedNode:e,value:n}}formatAndPrefixGroupColValue(e,t,o=!1){const s=this.formatGroupColValue(e,t,o),{value:i,displayedNode:n}=e,r=this.beans.footerSvc;return r?.doesCellShowTotalPrefix(n,t)?r.applyTotalPrefix(i,s,n,t):n.footer&&-1===n.level?null:s}formatGroupColValue(e,t,o=!1){const s=this.beans.valueSvc,{displayedNode:i,value:n}=e,r=i.rowGroupColumn,a=i.group&&!t;if(r&&(a||t?.isRowGroupDisplayed(r.colId))){if(o&&!1===r.colDef.useValueFormatterForExport)return null;const e=s.formatValue(r,i,n);return null==e&&""===i.key?this.getLocaleTextFunc()("blanks","(Blanks)"):e}return!t||i.group||o&&!1===t.colDef.useValueFormatterForExport?null:s.formatValue(t,i,n)}getDisplayedNode(e,t,o=!1){const s=this.gos,i=s.get("groupHideOpenParents"),n=s.get("showOpenedGroup")&&!o;if(!i&&!n)return;const r=t.colDef.showRowGroup;if(!0===r){if(e.group)return;return e.parent??void 0}let a=e;for(;a&&a.rowGroupColumn?.getId()!=r;){const e=a===a.parent?.getFirstChild();if(!n&&!e)return;a=a.parent}return a!==e?a??void 0:void 0}},class extends Pm{constructor(){super(...arguments),this.beanName="rowGroupColsSvc",this.eventName="columnRowGroupChanged",this.columnProcessors={set:(e,t,o)=>this.setActive(t,e,o),add:(e,t,o)=>this.setActive(!0,e,o),remove:(e,t,o)=>this.setActive(!1,e,o)},this.columnOrdering={enableProp:"rowGroup",initialEnableProp:"initialRowGroup",indexProp:"rowGroupIndex",initialIndexProp:"initialRowGroupIndex"},this.columnExtractors={setFlagFunc:(e,t,o)=>this.setColRowGroupActive(e,t,o),getIndexFunc:e=>e.rowGroupIndex,getInitialIndexFunc:e=>e.initialRowGroupIndex,getValueFunc:e=>e.rowGroup,getInitialValueFunc:e=>e.initialRowGroup},this.modifyColumnsNoEventsCallbacks={addCol:e=>{this.columns.includes(e)||this.columns.push(e)},removeCol:e=>s(this.columns,e)}}moveColumn(e,t,o){if(0===this.columns.length)return;const s=this.columns[e],i=this.columns.slice(e,t);this.columns.splice(e,1),this.columns.splice(t,0,s),this.updateIndexMap(),this.eventSvc.dispatchEvent({type:this.eventName,columns:i,column:1===i.length?i[0]:null,source:o})}syncColumnWithState(e,t,o,s){const{value1:i,value2:n}=o("rowGroup","rowGroupIndex");void 0===i&&void 0===n||("number"==typeof n||i?(e.isRowGroupActive()||(this.setColRowGroupActive(e,!0,t),this.modifyColumnsNoEventsCallbacks.addCol(e)),s&&"number"==typeof n&&(s[e.getId()]=n)):e.isRowGroupActive()&&(this.setColRowGroupActive(e,!1,t),this.modifyColumnsNoEventsCallbacks.removeCol(e)))}setActive(e,t,o){if(e===t.isRowGroupActive())return;this.setColRowGroupActive(t,e,o);const s=this.beans.groupHierarchyColSvc?.getColumn(t);eo(this.gos,e)&&!s&&this.colModel.setColsVisible([t],!e,o)}setColRowGroupActive(e,t,o){e.rowGroupActive!==t&&(e.rowGroupActive=t,t&&(this.beans.groupHierarchyColSvc?.insertVirtualColumnsForCol(this.columns,e))?.forEach(e=>this.setColRowGroupActive(e,t,o)),e.dispatchColEvent("columnRowGroupChanged",o)),e.dispatchStateUpdatedEvent("rowGroup")}},yy,uy],dependsOn:[Kv,Vy]},Wy={moduleName:"ClientSideRowModelHierarchy",version:jv,rowModels:["clientSide"],beans:[class extends We{constructor(){super(...arguments),this.beanName="groupStage",this.step="group",this.refreshProps=["groupAllowUnbalanced","groupDefaultExpanded","groupDisplayType","groupHideOpenParents","initialGroupOrderComparator","treeData","treeDataChildrenField","treeDataParentIdField"],this.treeData=!1,this.hasTreeData=!1,this.needReset=!1,this.nested=!1,this.strategy=void 0}postConstruct(){const e=this.gos;e.isModuleRegistered("TreeData")&&(this.hasTreeData=!0,this.treeData=e.get("treeData")),this.addManagedEventListeners({showRowGroupColsSetChanged:()=>this.strategy?.onShowRowGroupColsSetChanged()})}invalidateGroupCols(){this.strategy?.invalidateGroupCols?.()}destroy(){this.strategy=this.destroyBean(this.strategy),super.destroy()}getNonLeaf(e){return this.strategy?.nonLeafsById?.get(e)}getNestedDataGetter(){return this.getStrategy()?.nestedDataGetter}onPropChange(e){const t=this.gos,o=this.strategy?.nestedDataGetter;if(e.has("treeData")){const e=t.get("treeData")&&this.hasTreeData;this.treeData!==e&&(this.beans.rowDragSvc?.cancelRowDrag(),this.treeData=e,this.needReset=!0,this.strategy=this.destroyBean(this.strategy))}return this.strategy?.onPropChange?.(e),this.getNestedDataGetter()!==o}extractData(){const e=this.beans.rowModel.rootNode,t=this.nested?e?.childrenAfterGroup:e?._leafs;if(!t)return this.gos.get("rowData")??[];const o=t.length,s=new Array(o);let i=0;for(let n=0;n0,d=a.grandTotalRow;if(!n&&l&&d)if(cy(s,e),"pinnedBottom"===d||"pinnedTop"===d)this.beans.pinnedRowModel?.setGrandTotalPinned("pinnedBottom"===d?"bottom":"top");else{const e="top"===d;this.addRowNodeToRowsToDisplay(a,s.sibling,o,0,e)}return o}recursivelyAddToRowsToDisplay(e,t,o,s,i){if(!t?.length)return;const n=this.beans.masterDetailSvc;for(let r=0;r{const o=e.id;o&&(e.expanded=t.has(o))}),this.onGroupExpandedOrCollapsed()}getInternalExpansionState(e=!1){const t=[],o=[];return this.beans.rowModel.forEachNode(s=>{const i=s.id;i&&(s.expanded?t.push(i):e&&s.isExpandable()&&o.push(i))}),{expandedRowGroupIds:t,collapsedRowGroupIds:o}}getExpansionState(){return this.getInternalExpansionState()}expandAll(e){const{gos:t,rowModel:o,colModel:s,eventSvc:i}=this.beans,n=t.get("treeData"),r=s.isPivotActive(),l=t=>{if(t)for(const o of t){const t=()=>{o.expanded=e,l(o.childrenAfterGroup)};o.master?t():n?a(o.childrenAfterGroup)&&t():r?o.leafGroup||t():o.group&&t()}},d=o.rootNode;d&&l(d.childrenAfterGroup),this.onGroupExpandedOrCollapsed(),i.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}onGroupExpandedOrCollapsed(){this.dispatchStateUpdatedEvent(),this.beans.rowModel.reMapRows()}setDetailsExpansionState(e){const t=this.getInternalExpansionState(!0),o=0===t.collapsedRowGroupIds.length;if(0===t.expandedRowGroupIds.length!==o)return o?e.expandAll():e.collapseAll()}dispatchExpandedEvent(e,t){if((this.events??(this.events=[])).push(e),t)return void this.dispatchExpandedEvents();let o=this.dispatchExpandedDebounced;if(!o){if(!this.isAlive())return;o=this.debounce(()=>this.dispatchExpandedEvents()),this.dispatchExpandedDebounced=o}o()}dispatchExpandedEvents(){const{eventSvc:e,rowRenderer:t}=this.beans,o=this.events,s=o?.length;if(!s)return;this.events=null;const i=new Array(s);for(let n=0;nwindow.setTimeout(e,0);let o=!1;return()=>{t.active?o||(o=!0,t.addDestroyTask(()=>{o=!1,e()})):window.setTimeout(e,0)}}}],dependsOn:[Kv]},Uy={moduleName:"StickyRow",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="stickyRowSvc"}createStickyRowFeature(e,t,o){const s=this.gos;if(jt(s)&&Lt(s)||Gt(s))return e.createManagedBean(new Oy(t,o))}}]},$y={moduleName:"GroupEdit",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="groupEditSvc",this.pendingEditRefresh=null,this.dropGroupTarget=null,this.dropGroupTimer=null,this.dropGroupThrottled=!1,this.draggingGroups=null}postConstruct(){Lt(this.gos)&&this.addManagedListeners(this.eventSvc,{cellValueChanged:e=>this.onCsrmCellChange(e),batchEditingStopped:()=>this.flushGroupEdits()})}destroy(){this.stopDragging(!0),super.destroy()}isGroupingDrop(e){return!(!e.rowDragManaged||!e.sameGrid)&&(!!this.gos.get("refreshAfterGroupEdit")&&(!!this.beans.rowGroupColsSvc?.columns?.length&&!this.beans.colModel.isPivotMode()))}initDraggingGroups(e){const t=/* @__PURE__ */new Map,o=e=>{const s=e.childrenAfterGroup;if(s){if(t.has(e))return;const i=s.slice();t.set(e,i);for(const e of i)o(e)}};for(const s of e.rows)s.group&&o(s);this.draggingGroups=t}canSetParent(e){return!!e.sameGrid&&(!!this.beans.groupStage?.treeData||!(e.rowDragManaged&&!this.gos.get("refreshAfterGroupEdit"))&&!!this.beans.rowGroupColsSvc?.columns?.length)}canDropRow(e,t){if(this.beans.groupStage?.treeData)return!Py(e,t.newParent);const{position:o,target:s,newParent:i,rootNode:n}=t,r=e.parent;if(e.group&&(My(e,s)||My(e,i)))return!1;if("inside"===o)return!0;if(i&&i!==r)return i!==n||r===n;const a=i??s?.parent??n;if(a!==r)return!1;const l=e.group?e.level:r.level??-1;let d=-1;return s?d=s.group?s.level:s.parent?.level??-1:a&&(d=a.level),!(l>=0&&d>=0&&d!==l)}fixRowsDrop(e,t,o,s){const i=!!this.beans.groupStage?.treeData;if(e.treeData=i,!this.beans.rowGroupColsSvc?.columns?.length&&!this.gos.get("pivotMode")&&!i)return;this.draggingGroups||!this.isGroupingDrop(e)||e.suppressMoveWhenRowDragging||this.initDraggingGroups(e);let n=e.target,r=null,a=!1;const l=e.rootNode,d=this.beans.rowModel,c=this.canStartGroup(n,i);this.updateDropTarget(e,o,c);const h=this.beans.pageBounds?.getLastRow?.()??d.getRowCount()-1;if(t&&(!n||s>=.5&&n.rowIndex===h?r=l:e.moved&&n&&this.dropGroupThrottled&&this.shouldDropTargetBeParent(e)&&(r=n),r||(r=n?.parent??l)),o||!n||!c||n.group&&n.expanded||this.startDropGroupDelay(n),r){if(n&&r===n&&r!==l){const e=r.expanded?((e,t,o)=>{if(!o)return;let s=o.rowIndex;if(null==s)return;s+=t;const i=e.getRowCount();for(;s>=0&&s{this.dropGroupTimer=null,this.dropGroupThrottled=!0,this.beans.dragAndDrop?.nudge()},t)}resetDragGroup(){null!==this.dropGroupTimer&&(window.clearTimeout(this.dropGroupTimer),this.dropGroupTimer=null),this.dropGroupTarget=null,this.dropGroupThrottled=!1}stopDragging(e){e&&(this.draggingGroups=null),this.resetDragGroup()}shouldDropTargetBeParent({target:e,rows:t,pointerPos:o,treeData:s}){if(!e||"none"===o)return!1;if("inside"===o)return!0;if(!s&&e.group&&!e.expanded)return!0;if("above"===o)return!1;const i=this.beans.rowModel;let n,r=e.rowIndex+1;do{n=i.getRow(r++)}while(n?.footer);const a=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(n&&n.parent===e&&a?.length){const e=new Set(t);for(let t=0,o=a.length;t{d.has(e)||(d.add(e),u??(u=this.newGroupValues(n)),this.setRowGroup(e,u)&&h.add(e))},p=e=>{const t=this.draggingGroups?.get(e)??e.childrenAfterGroup,o=t?.length;if(o)for(let s=0;s=0?g(e):p(e)}};for(const v of e.rows)if(v.group)p(v);else{const e=v.sourceRowIndex>=0&&!v.destroyed?v:this.csrmFirstLeaf(v);e&&g(e)}const m="inside"===o?"above":o,f="inside"===o?this.findFirstLeafForParent(n,d)??s:s;let C=!1;if(d.size&&"none"!==m&&(C=((e,t,o,s)=>{if(!t.size||!e)return!1;let i=!1;const n=e.length??0;let r=-1;o&&(r=o.sourceRowIndex,(o=r<0?Dl(o):null)&&(r=o.sourceRowIndex)),r<0||r>=n?r=n:s||++r;let a=r,l=Math.min(r,n-1);for(const h of t){const e=h.sourceRowIndex;el&&(l=e)}let d=a;for(let h=a;h=r;--h){const o=e[h];t.has(o)||(o.sourceRowIndex!==c&&(o.sourceRowIndex=c,e[c]=o,i=!0),--c)}for(const h of t)h.sourceRowIndex!==d&&(h.sourceRowIndex=d,e[d]=h,i=!0),++d;return i})(i._leafs,d,f,"above"===m)),!h.size&&!C)return!1;c.reordered=C;for(const v of d)c.updates.add(v);return this.csrmRefresh(c),l?l.focusCell():r.clearFocusedCell(),!0}canStartGroup(e,t){return!(!e||e.level<0||e.footer||e.detail)&&(!!e.group||t)}flushGroupEdits(){const e=this.pendingEditRefresh;e&&(this.pendingEditRefresh=null,this.csrmRefresh(e))}csrmRefresh(e){const t=this.beans.rowModel,o=t.rootNode;o&&t.refreshModel({step:"group",keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedPath:new El(!1,o),changedRowNodes:e})}newGroupValues(e){const t=this.beans.rowGroupColsSvc?.columns??[],o=new Array(t.length);let s=-1,i=e;for(;i&&i.level>=0;){const e=t[i.level];if(e){const t=e.getColId(),n=i.level;o[n]=i.groupData?.[t]??i.key??void 0,n>s&&(s=n)}i=i.parent}return{values:o,columns:t,maxLevel:s}}setRowGroup(e,{values:t,columns:o,maxLevel:s}){if(s<0)return!1;const{valueSvc:i}=this.beans;let n=!1;for(let r=0;rs)continue;const l=t[r],d=i.getValue(a,e,"data");if(d===l||null==d&&null==l)continue;let c=l;const h=i.parseValue(a,e,l,d);void 0!==h&&(c=h),e.setDataValue(a,c,"rowDrag")&&(n=!0)}return n}onCsrmCellChange(e){const{column:t,node:o,source:s}=e;if(this.gos.get("refreshAfterGroupEdit")&&"rowDrag"!==s&&t?.isRowGroupActive()&&!o.group&&o.data)if(this.beans.editSvc?.isBatchEditing()){let e=this.pendingEditRefresh;e||(e=Dy(),this.pendingEditRefresh=e),e.updates.add(o)}else{const e=Dy();e.updates.add(o),this.csrmRefresh(e)}}csrmFirstLeaf(e){if(!e)return null;const t=this.draggingGroups;let o=t?.get(e)??e.childrenAfterGroup;for(;o?.length;){const e=o[0];if(e.sourceRowIndex>=0)return e.destroyed?this.firstAliveChildLeaf(e):e;o=t?.get(e)??e.childrenAfterGroup}return Dl(e)}firstAliveChildLeaf(e){const t=this.draggingGroups?.get(e)??e.childrenAfterGroup;if(t)for(const o of t)if(o.sourceRowIndex>=0&&!o.destroyed)return o;return null}findFirstLeafForParent(e,t){if(!e)return null;const o=this.draggingGroups?.get(e)??e?.childrenAfterGroup;if(!o)return null;for(let s=0,i=o.length;s=0&&!t.has(e))return e;const i=this.findFirstLeafForParent(e,t);if(null!==i)return i}return null}}],dependsOn:[Kv,Wy]};function jy(e,t){const o=e.sourceRowIndex,s=t.sourceRowIndex,i=o>=0,n=s>=0;return i&&n?o-s:!i&&!n?e.__objectId-t.__objectId:i?1:-1}var Ky=e=>{for(const t of e){const e=t?.childrenAfterGroup;if(!e)continue;const o=e.length;let s=0;for(let i=0;i{for(;void 0!==e._leafs;){const t=e.parent;if(!t)break;e._leafs=void 0,e=t}};var qy={moduleName:"SharedRowGrouping",version:jv,apiFunctions:{setRowGroupColumns:function(e,t){e.rowGroupColsSvc?.setColumns(t,"api")},removeRowGroupColumns:function(e,t){e.rowGroupColsSvc?.removeColumns(t,"api")},addRowGroupColumns:function(e,t){e.rowGroupColsSvc?.addColumns(t,"api")},getRowGroupColumns:function(e){return e.rowGroupColsSvc?.columns??[]},moveRowGroupColumn:function(e,t,o){e.rowGroupColsSvc?.moveColumn?.(t,o,"api")}},dependsOn:[Kv,gy,zy,Uy,by]},Yy={moduleName:"RowGrouping",version:jv,dynamicBeans:{groupStrategy:class extends We{constructor(){super(...arguments),this.groupCols=[],this.nonLeafsById=/* @__PURE__ */new Map,this.checkGroupCols=!0,this.pivotMode=!1,this.groupEmpty=!1}invalidateGroupCols(){this.checkGroupCols=!0}destroy(){super.destroy(),this.groupCols.length=0,this.nonLeafsById.clear()}clearNonLeafs(){const e=this.nonLeafsById;for(const t of e.values())t._destroy(!1);e.clear()}loadGroupData(e){if(!e.group)return e._groupData=null,null;const t=e.rowGroupColumn,{valueSvc:o,showRowGroupCols:s}=this.beans,i={};if(e._groupData=i,!t)return i;const n=Dl(e),r=t.getId();if(!s)return i;const a=s.columns;for(let l=0,d=a.length;l{const t=e.childrenAfterGroup,o=t?.length;if(!o)return;const s=new Array(o);let i,n=0,r=!1;for(let a=0;a{const o=e.length;if(o!==t?.length)return!0;for(let s=0;s{if(!e)return void(t.length=0);const o=e.length;t.length=o;for(let s=0;s1)}}if(i.size)for(const d of i){this.insertOneNode(e,d);const t=d.parent;l?.addParentNode(t),n||(n=(t?.childrenAfterGroup?.length??0)>1)}a.size&&(Ky(a),this.removeEmptyGroups(a,r)),n&&this.sortChildren(t)}sortChildren(e){e.forEachChangedNodeDepthFirst(t=>{(function(e){if(!e)return!1;const t=e.length;if(t<2)return!1;let o=!1;for(let s=1;s0){o=!0;break}return!!o&&(e.sort(jy),!0)})(t.childrenAfterGroup)&&e.active&&e.addParentNode(t)},!1,!0)}orderGroups(e){const t=this.gos.getCallback("initialGroupOrderComparator");if(!t)return;const o=this.beans,s=o.gridApi,i=o.gridOptions.context,n=(e,o)=>t({api:s,context:i,nodeA:e,nodeB:o}),r=e=>{const t=e.childrenAfterGroup,o=t?.length;if(o&&!e.leafGroup){o>1&&t.sort(n);for(let e=0,s=o;e=0;--a){const{col:e}=r[a];let l=o.getKeyForNode(e,t);if(null==l||""===l){if(!s)continue;l=""}if(!i?.parent||i.key!==l){n=!0;break}i=i.parent}return n||(n=!!i?.parent),!!n&&(this.removeFromParent(t),this.insertOneNode(e,t),t.setData(t.data),!0)}groupShouldBeRemoved(e){const t=this.getChildrenMappedKey(e.key,e.rowGroupColumn),o=e.parent?.childrenMapped;return!(!o||!o[t])&&(!!e.group&&0===(e.childrenAfterGroup?.length??0))}removeEmptyGroups(e,t){const o=this.beans.selectionSvc;let s;const i=Array.from(e),n=this.nonLeafsById;do{e.clear();for(let r=0;r!e.group),this.nonLeafsById.clear(),e.leafGroup=!this.groupCols?.length,e.childrenAfterGroup=[],e.childrenMapped={},e.updateHasChildren();const t=e.sibling;t&&(t.childrenAfterGroup=e.childrenAfterGroup,t.childrenMapped=e.childrenMapped);const o=e._leafs;for(let s=0,i=o.length;s=l-1,p=this.createGroup(o,e,c,u,g,t);this.addToParent(p,o),this.setExpandedInitialValue(i,p),o=p}o.group||Et(184,{parentGroupData:o.data,childNodeData:t.data}),t.parent=o,t.level=o.level+1,o.childrenAfterGroup.push(t),o.updateHasChildren(),_y(o)}createGroup(e,t,o,s,i,n){const r=t.col,a=(e.level>=0?e.id+"-":"row-group-")+r.getColId()+"-"+o,l=this.nonLeafsById;let d=l.get(a);return void 0!==d||(d=new kr(this.beans),d.group=!0,d.parent=e,d.field=t.field??null,d.rowGroupColumn=r,d.key=o,d.id=a,d.level=s,d.leafGroup=i,d.rowGroupIndex=s,d.childrenAfterGroup=[],d.childrenMapped={},l.set(a,d),d.groupValue=n&&this.beans.valueSvc.getValue(r,n,"data"),d.setAllChildrenCount(0),d.updateHasChildren()),d}getChildrenMappedKey(e,t){return t?t.getId()+"-"+e:e}setExpandedInitialValue(e,t){e&&t.leafGroup?t.expanded=!1:t.expanded=Gy(this.beans,t,t.level)}onShowRowGroupColsSetChanged(){const{rowModel:e,valueSvc:t}=this.beans;for(const s of this.nonLeafsById.values()){s._groupData=void 0;const e=s.rowGroupColumn,o=e&&Dl(s);s.groupValue=o&&t.getValue(e,o,"data")}const o=e.rootNode?._leafs;if(o)for(let s=0,i=o.length;s{this.gridCtrl=e.gridCtrl})}destroy(){super.destroy(),this.clientSideRowModel=null,this.gridCtrl=null}pasteFromClipboard(){this.gos.get("suppressClipboardApi")||this.navigatorApiFailed||!navigator.clipboard?.readText?this.pasteFromClipboardLegacy():navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(e=>{Et(40,{e:e,method:"readText"}),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()})}pasteFromClipboardLegacy(){let e=!1;const t=t=>{const o=Date.now();o-this.lastPasteOperationTime<50&&(e=!0,t.preventDefault()),this.lastPasteOperationTime=o};this.executeOnTempElement(e=>{e.addEventListener("paste",t),e.focus({preventScroll:!0})},o=>{const s=o.value;e?this.refocusLastFocusedCell():this.processClipboardData(s),o.removeEventListener("paste",t)})}refocusLastFocusedCell(){const{focusSvc:e}=this.beans,t=e.getFocusedCell();t&&e.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const e=this.gos.get("clipboardDelimiter");return a(e)?e:"\t"}processClipboardData(e){if(null==e)return;let t=function(e,t=","){const o=[],s=e=>"\r"===e||"\n"===e;let i=!1;if(""===e)return[[""]];for(let n=0,r=0,a=0;a{o[n]||(o[n]=[]),o[n][r]||(o[n][r]="")};if(h(),'"'===d&&(i?'"'===c?(o[n][r]+='"',a++):i=!1:(void 0===l||l===t||s(l))&&(i=!0)),!i&&'"'!==d){if(d===t){r++,h();continue}if(s(d)){r=0,n++,h(),"\r"===d&&"\n"===c&&a++;continue}}o[n][r]+=d}return o}(e,this.getClipboardDelimiter());const o=this.gos.getCallback("processDataFromClipboard");if(o&&(t=o({data:t})),null==t)return;this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(t);const{rangeSvc:s,editSvc:i}=this.beans;this.doPasteOperation((e,o,n,r)=>{s?.isMoreThanOneCell()&&!this.hasOnlyOneValueToPaste(t)?this.pasteIntoActiveRange(t,e,o,r):this.pasteStartingFromFocusedCell(t,e,o,n,r),i?.stopEditing(void 0,{source:Zy})})}doPasteOperation(e){const t="clipboard",{eventSvc:o,focusSvc:s,rowRenderer:i,gos:n}=this.beans;o.dispatchEvent({type:"pasteStart",source:t});const{clientSideRowModel:r}=this,a=r?.rootNode,l=a&&new El(n.get("aggregateOnlyChangedColumns"),a),d={},c=[];e(d,c,s.getFocusedCell(),l);const h=[...c];l&&(r.doAggregate(l),l.forEachChangedNodeDepthFirst(e=>{h.push(e)})),i.refreshCells({rowNodes:h}),this.dispatchFlashCells(d),this.fireRowChanged(c),this.refocusLastFocusedCell(),o.dispatchEvent({type:"pasteEnd",source:t})}getPreProcessRangeCallback(e){return t=>{const{rangeSvc:o}=this.beans;if(!o)return;const{rowDiff:s,colDiff:i}=this.getAdjustedRangeDimensionForPaste(t,e);0!==s&&o.extendRangeRowCountBy(t,s),0!==i&&o.extendRangeColumnCountBy(t,i)}}getAdjustedRangeDimensionForPaste(e,t){const o=this.beans.rangeSvc,s=t.length,i=o.getRangeRowCount(e),n=i>=s&&i%s===0,r=t[0].length,a=e.columns.length;return{rowDiff:n?0:s-i,colDiff:a>=r&&a%r===0?0:r-a}}pasteIntoActiveRange(e,t,o,s){let i=0,n=0;this.iterateActiveRanges((r,a,l,d)=>{if(d-i>=e.length){if(d%e.length!==0)return;i+=n,n=0}const c=e[d-i];o.push(a);const h=this.gos.getCallback("processCellFromClipboard"),u=l.columns,g=u.findIndex(Ko);-1!==g&&u.splice(g,1);for(let e=0;e=c.length&&(i=e%c.length);const n=this.processCell(a,o,c[i],Qy,h,!0);a.setDataValue(o,n,Zy),s?.addParentNode(a.parent,[o]);const{rowIndex:l,rowPinned:d}=r,g=Dn({rowIndex:l,column:o,rowPinned:d});t[g]=!0}n++},!1,this.getPreProcessRangeCallback(e))}getDisplayedColumnsStartingAt(e){let t=e;const o=[],{visibleCols:s}=this.beans;for(;t&&qo(t);)t=s.getColAfter(t);for(;null!=t;)o.push(t),t=s.getColAfter(t);return o}pasteStartingFromFocusedCell(e,t,o,s,i){if(!s)return;const n={rowIndex:s.rowIndex,rowPinned:s.rowPinned},r=this.getDisplayedColumnsStartingAt(s.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,o,t,i):this.pasteMultipleValues(e,n,o,r,t,Xy,i)}isPasteSingleValueIntoRange(e){const t=this.beans.rangeSvc;return this.hasOnlyOneValueToPaste(e)&&!!t&&!t.isEmpty()}pasteSingleValueIntoRange(e,t,o,s){const i=e[0][0];this.iterateActiveRanges((e,n,r)=>{t.push(n),r.columns.forEach(e=>this.updateCellValue(n,e,i,o,Xy,s))})}hasOnlyOneValueToPaste(e){return 1===e.length&&1===e[0].length}copyRangeDown(){const{rangeSvc:e,gos:t,formula:o,valueSvc:s}=this.beans;if(!e||e.isEmpty())return;const i=[];this.doPasteOperation((e,n,r,a)=>{const l=t.getCallback("processCellForClipboard"),d=t.getCallback("processCellFromClipboard");this.iterateActiveRanges((t,r,c)=>{const{columns:h}=c;i.length?(n.push(r),h.forEach((s,n)=>{if(!s.isCellEditable(r)||s.isSuppressPaste(r))return;s.isAllowFormula()&&o?.isFormula(i[n])&&(i[n]=o?.updateFormulaByOffset({value:i[n],rowDelta:1}));const l=this.processCell(r,s,i[n],Qy,d,!0);r.setDataValue(s,l,Zy),a&&a.addParentNode(r.parent,[s]);const{rowIndex:c,rowPinned:h}=t,u=Dn({rowIndex:c,column:s,rowPinned:h});e[u]=!0})):h.forEach(e=>{const t=this.processCell(r,e,s.getValue(e,r,"batch"),Qy,l,!1,!0);i.push(t)})},!0)})}removeLastLineIfBlank(t){const o=e(t);if(o&&1===o.length&&""===o[0]){if(1===t.length)return;s(t,o)}}fireRowChanged(e){if("fullRow"===this.gos.get("editType"))for(const t of e)this.eventSvc.dispatchEvent({type:"rowValueChanged",node:t,data:t.data,rowIndex:t.rowIndex,rowPinned:t.rowPinned})}pasteMultipleValues(e,t,o,s,i,n,r){let a=t;const l=this.beans,{gos:d}=l,c=null!=this.clientSideRowModel&&!d.get("enableGroupEdit")&&!d.get("treeData"),h=()=>{for(;;){if(!a)return null;const e=In(l,a);if(a=Nn(l,{rowPinned:a.rowPinned,rowIndex:a.rowIndex}),null==e)return null;if(!(e.detail||e.footer||c&&e.group))return e}};for(const u of e){const e=h();e&&(u.forEach((t,o)=>this.updateCellValue(e,s[o],t,i,n,r)),o.push(e))}}updateCellValue(e,t,o,s,i,n){if(!e||!t?.isCellEditable(e)||t?.isSuppressPaste(e))return;const r=this.processCell(e,t,o,i,this.gos.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,r,Zy);const{rowIndex:a,rowPinned:l}=e;s[Dn({rowIndex:a,column:t,rowPinned:l})]=!0,n&&n.addParentNode(e.parent,[t])}copyToClipboard(e={}){this.copyOrCutToClipboard(e)}cutToClipboard(e={},t="api"){this.gos.get("suppressCutToClipboard")||(this.eventSvc.dispatchEvent({type:"cutStart",source:t}),this.copyOrCutToClipboard(e,!0),this.eventSvc.dispatchEvent({type:"cutEnd",source:t}))}copyOrCutToClipboard(e,t){let{includeHeaders:o,includeGroupHeaders:s}=e;const{gos:i,focusSvc:n}=this.beans;null==o&&(o=i.get("copyHeadersToClipboard")),null==s&&(s=i.get("copyGroupHeadersToClipboard"));const r={includeHeaders:o,includeGroupHeaders:s},a=i.get("rowSelection"),l=i.get("cellSelection");let d=null;this.shouldCopyCells(l,a)?(this.copySelectedRangeToClipboard(r),d=0):this.shouldCopyRows(a)?(this.copySelectedRowsToClipboard(r),d=1):n.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(r),d=2),t&&null!==d&&this.clearCellsAfterCopy(d)}shouldCopyCells(e,t){const{rangeSvc:o,selectionSvc:s,gos:i}=this.beans;if(!o||o.isEmpty())return!1;if(e)return!("object"==typeof t&&t.copySelectedRows&&!s?.isEmpty());{const e=i.get("suppressCopySingleCellRanges");return!(!o.isMoreThanOneCell()&&e)}}shouldCopyRows(e){const{selectionSvc:t,gos:o}=this.beans;return!(t?.isEmpty()??1)&&(e&&"string"!=typeof e?e.copySelectedRows??!1:!o.get("suppressCopyRowsToClipboard"))}clearCellsAfterCopy(e){const t=this.beans,{rangeSvc:o,focusSvc:s,eventSvc:i}=t;if(i.dispatchEvent({type:"keyShortcutChangedCellStart"}),0===e)o.clearCellRangeCellValues({cellEventSource:"clipboardSvc"});else if(1===e)this.clearSelectedRows();else{const e=s.getFocusedCell();if(null==e)return;const o=In(t,e);o&&this.clearCellValue(o,e.column)}i.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){const{selectionSvc:e,visibleCols:t}=this.beans,o=e?.getSelectedNodes()??[],s=t.allCols;for(const i of o)for(const e of s)this.clearCellValue(i,e)}clearCellValue(e,t){if(!t.isCellEditable(e))return;const o=this.beans.valueSvc.getDeleteValue(t,e);e.setDataValue(t,o,"clipboardSvc")}iterateActiveRanges(e,t,o){const s=this.beans.rangeSvc;if(!s||s.isEmpty())return;const i=s.getCellRanges(),n=t?[i[0]]:i;for(const r of n)this.iterateActiveRange({cellRange:r,rowCallback:e,preProcessRange:o})}iterateActiveRange(e){const{cellRange:t,preProcessRange:o,rowCallback:s}=e,{beans:i}=this,{rangeSvc:n}=i;if(!n)return;o&&o(t);let r=n.getRangeStartRow(t);const a=n.getRangeEndRow(t);let l=0,d=!1;for(;!d&&null!=r;){const e=In(i,r);d=En(r,a),s(r,e,t,l++),r=Nn(i,r)}}copySelectedRangeToClipboard(e={}){const t=this.beans.rangeSvc;if(!t||t.isEmpty())return;const{data:o,cellsToFlash:s}=t.areAllRangesAbleToMerge()?this.buildDataFromMergedRanges(t,e):this.buildDataFromRanges(t,e);this.copyDataToClipboard(o),this.dispatchFlashCells(s)}buildDataFromMergedRanges(e,t){const o=/* @__PURE__ */new Set,s=e.getCellRanges(),i=/* @__PURE__ */new Map,n=[],r={},a=Lt(this.gos,this.beans.rowModel),l=/* @__PURE__ */new Set;a||this.beans.rowModel.forEachNode(e=>{l.add(e.rowIndex)});for(const h of s){h.columns.forEach(e=>o.add(e));const{rowPositions:t,cellsToFlash:s}=this.getRangeRowPositionsAndCellsToFlash(e,h);for(const e of t){const t=l.has(e.rowIndex);if(!a&&!t)continue;const o=`${e.rowIndex}-${e.rowPinned||"null"}`;i.get(o)||(i.set(o,!0),n.push(e))}Object.assign(r,s)}const d=this.beans.visibleCols.allCols,c=Array.from(o);return c.sort((e,t)=>d.indexOf(e)-d.indexOf(t)),{data:this.buildExportParams({columns:c,rowPositions:n,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}),cellsToFlash:r}}buildDataFromRanges(e,t){const o=e.getCellRanges(),s=[],i={};for(const n of o){const{rowPositions:o,cellsToFlash:r}=this.getRangeRowPositionsAndCellsToFlash(e,n);Object.assign(i,r),s.push(this.buildExportParams({columns:n.columns,rowPositions:o,includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders}))}return{data:s.join("\n"),cellsToFlash:i}}getRangeRowPositionsAndCellsToFlash(e,t){const o=[],s={},i=e.getRangeStartRow(t),n=e.getRangeEndRow(t);let r=i;for(;r;){o.push(r);for(const e of t.columns){const{rowIndex:t,rowPinned:o}=r;s[Dn({rowIndex:t,column:e,rowPinned:o})]=!0}if(En(r,n))break;r=Nn(this.beans,r)}return{rowPositions:o,cellsToFlash:s}}getCellsToFlashFromRowNodes(e){const t=this.beans.visibleCols.allCols,o={};for(let s=0;s{const{value:o,valueFormatted:s}=this.beans.valueSvc.getValueForDisplay({column:t,node:e,includeValueFormatted:!0,from:"batch"}),i=s??o??"",r=n.getCallback("processCellForClipboard");return r?r({column:t,node:e,value:i,type:Xy,formatValue:o=>this.beans.valueSvc.formatValue(t,e,o)??o,parseValue:s=>this.beans.valueSvc.parseValue(t,e,s,o)??s}):i},processHeaderCallback:n.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:n.getCallback("processGroupHeaderForClipboard")};return r.getDataAsCsv(a,!0)}dispatchFlashCells(e){window.setTimeout(()=>{this.eventSvc.dispatchEvent({type:"flashCells",cells:e})},0)}processCell(e,t,o,s,i,n,r){const{valueSvc:a,formula:l}=this.beans;return i?i({column:t,node:e,value:o,type:s,formatValue:o=>a.formatValue(t,e??null,o)??o,parseValue:o=>a.parseValue(t,e??null,o,a.getValue(t,e,"edit"))}):n&&!1!==t.getColDef().useValueParserForImport?a.parseValue(t,e??null,o,a.getValue(t,e,"edit")):r&&!1!==t.getColDef().useValueFormatterForExport?l?.isFormula(o)?o:a.formatValue(t,e??null,o)??o:o}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");t?t({data:e}):this.gos.get("suppressClipboardApi")||!navigator.clipboard?this.copyDataToClipboardLegacy(e):navigator.clipboard.writeText(e).catch(t=>{Et(40,{e:t,method:"writeText"}),this.copyDataToClipboardLegacy(e)})}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const o=b(this.beans),s=w(this.beans);t.value=e||" ",t.select(),t.focus({preventScroll:!0}),o.execCommand("copy")||Et(41),null!=s?.focus&&s.focus({preventScroll:!0})})}executeOnTempElement(e,t){if(!this.gridCtrl)return;const o=b(this.beans),s=o.createElement("textarea"),i=s.style;i.width="1px",i.height="1px";const n=o.documentElement;i.top=n.scrollTop+"px",i.left=n.scrollLeft+"px",i.position="absolute",i.opacity="0",this.gridCtrl.getGui().appendChild(s);try{e(s)}catch(r){Et(42)}t?window.setTimeout(()=>{t(s),s.remove()},100):s.remove()}}],apiFunctions:{copyToClipboard:function(e,t){e.clipboardSvc?.copyToClipboard(t)},cutToClipboard:function(e,t){e.clipboardSvc?.cutToClipboard(t)},copySelectedRowsToClipboard:function(e,t){e.clipboardSvc?.copySelectedRowsToClipboard(t)},copySelectedRangeToClipboard:function(e,t){e.clipboardSvc?.copySelectedRangeToClipboard(t)},copySelectedRangeDown:function(e){e.clipboardSvc?.copyRangeDown()},pasteFromClipboard:function(e){e.clipboardSvc?.pasteFromClipboard()}},dependsOn:[Kv,Lg,hu,om]},eS=class extends We{constructor(){super(...arguments),this.loadRowDataVersion=0}wireBeans(e){this.environment=e.environment}init(e,t){this.params=t,this.comp=e,null==t.pinned&&(this.setAutoHeightClasses(),this.setupRefreshStrategy(),this.createDetailGrid(),this.loadRowData(),this.addManagedEventListeners({fullWidthRowFocused:this.onFullWidthRowFocused.bind(this)}))}onFullWidthRowFocused(e){const t=this.params;En({rowIndex:t.node.rowIndex,rowPinned:t.node.rowPinned},{rowIndex:e.rowIndex,rowPinned:e.rowPinned})&&mn(this.comp.getGui(),e.fromBelow)}setAutoHeightClasses(){const e=this.gos.get("detailRowAutoHeight"),t=e?"ag-details-row-auto-height":"ag-details-row-fixed-height",o=e?"ag-details-grid-auto-height":"ag-details-grid-fixed-height",s=this.comp;s.toggleCss(t,!0),s.toggleDetailGridCss(o,!0)}setupRefreshStrategy(){const e=this.params.refreshStrategy;"everything"!=e&&"nothing"!=e&&"rows"!=e?(null!=e&&Et(170,{providedStrategy:e}),this.refreshStrategy="rows"):this.refreshStrategy=e}createDetailGrid(){const{params:e,gos:t}=this;if(l(e.detailGridOptions))return void Et(171);const o=t.get("theme"),s=e.detailGridOptions.theme;s&&s!==o&&Et(267);const i={themeStyleContainer:this.environment.eStyleContainer,...e.detailGridOptions,theme:o};t.get("detailRowAutoHeight")&&(i.domLayout="autoHeight"),this.comp.setDetailGrid(i)}registerDetailWithMaster(e){const{params:t,beans:{selectionSvc:o,findSvc:s,expansionSvc:i}}=this,n=t.node.id,r=t.api,a={id:n,api:e},l=t.node;if(r.isDestroyed())return;r.addDetailGridInfo(n,a),l.detailGridInfo=a;const d=l.parent;function c(){d&&o?.refreshMasterNodeState(d)}function h({source:t}){return"expandAll"===t?e.expandAll():"collapseAll"===t?e.collapseAll():void 0}function u({node:s,source:i}){s!==d||"masterDetail"===i||e.isDestroyed()||o?.setDetailSelectionState(d,t.detailGridOptions,e)}s?.registerDetailGrid(l,e),e.addEventListener("firstDataRendered",()=>{e.isDestroyed()||r.isDestroyed()||(o?.setDetailSelectionState(d,t.detailGridOptions,e),e.addEventListener("selectionChanged",c),r.addEventListener("rowSelected",u),e.isModuleRegistered("CsrmSsrmSharedApiModule")&&(r.addEventListener("expandOrCollapseAll",h),i?.setDetailsExpansionState(e)))}),this.addManagedListeners(d,{masterChanged:e=>{e.node.master||this.onDestroy(a)}}),this.addDestroyFunc(()=>this.onDestroy(a))}onDestroy(e){const{params:t}=this,o=t.node,s=t.api;o.detailGridInfo===e&&(s.isDestroyed()||s.removeDetailGridInfo(o.id),o.detailGridInfo=null)}loadRowData(){this.loadRowDataVersion++;const e=this.loadRowDataVersion,t=this.params;if("serverSide"===t.detailGridOptions?.rowModelType)return void t.node.detailGridInfo?.api?.refreshServerSide({purge:!0});const o=t.getDetailRowData;if(!o)return void Et(172);o({node:t.node,data:t.node.data,successCallback:t=>{this.loadRowDataVersion===e&&this.comp.setRowData(t)},context:wo(this.gos,{}).context})}refresh(){const e=!0;switch(this.refreshStrategy){case"nothing":return e;case"everything":return false}return this.loadRowData(),e}},tS=class{constructor(e){this.parentWrapper=e}wrap(e,t,o,s){return this.parentWrapper.wrap(e,t,o,s)}},oS={tag:"div",cls:"ag-details-row"},sS={tag:"div",cls:"ag-details-row",role:"gridcell",children:[{tag:"div",ref:"eDetailGrid",cls:"ag-details-grid",role:"presentation"}]};function iS(e,t){const o=e.masterDetailSvc?.store;return o?t(o):void 0}var nS={moduleName:"MasterDetail",version:jv,dependsOn:[{moduleName:"SharedMasterDetail",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="masterDetailSvc",this.store={}}isEnabled(){return this.gos.get("masterDetail")}postConstruct(){const e=this.gos;Lt(e)&&(this.enabled=this.isEnabled()),Gt(e)&&this.addEventListeners()}addEventListeners(){const e=e=>{this.setMaster(e.node,!1,!0)};let t;const o=()=>{if(t){for(const e of t)e();t=void 0}this.isEnabled()&&(t=this.addManagedListeners(this.beans.eventSvc,{rowNodeDataChanged:e}))};o(),this.gos.addPropertyEventListener("masterDetail",o)}refreshModel(e){if(e.changedProps){const e=this.isEnabled();if(this.enabled!==e)return void this.setMasters(null)}e.rowDataUpdated&&this.setMasters(e.changedRowNodes)}setMaster(e,t,o){const s=e.master,i=this.isEnabled();let n=i;const r=this.gos,a=r.get("isRowMaster"),l=r.get("treeData");if(i)if(t||o){if(a){const t=e.data;n=!!t&&!!a(t)}}else n=s;const d=this.beans;l||(n&&t?e.expanded=Gy(d,e,d.rowGroupColsSvc?.columns.length??0,!1):!n&&s&&(e.expanded=!1)),n!==s&&(e.master=n,e.dispatchRowEvent("masterChanged"))}setMasters(e){if(this.enabled=this.isEnabled(),e){for(const t of e.updates)this.setMaster(t,!1,!0);for(const t of e.adds)this.setMaster(t,!0,!1)}else{const e=function(e){const t=e.rowModel;return"clientSide"===t.getType()?t:void 0}(this.beans)?.rootNode?._leafs;if(e)for(let t=0,o=e.length;t{const s=t.clientHeight;if(null!=s&&s>0){const t=()=>{const{rowModel:t}=this.beans,{rowNode:i}=e;i.setRowHeight(s),(Lt(o)||Gt(o))&&t.onRowHeightChanged()};window.setTimeout(t,0)}},n=be(s,t,i);e.addDestroyFunc(n),i()}destroy(){this.store={},super.destroy()}}],userComponents:{agDetailCellRenderer:class extends ni{constructor(){super(...arguments),this.eDetailGrid=null}wireBeans(e){this.context=e.context}init(e){this.params=e,this.selectAndSetTemplate();const t={toggleCss:(e,t)=>this.toggleCss(e,t),toggleDetailGridCss:(e,t)=>this.eDetailGrid.classList.toggle(e,t),setDetailGrid:e=>this.setDetailGrid(e),setRowData:e=>this.setRowData(e),getGui:()=>this.eDetailGrid};this.ctrl=this.createManagedBean(new eS),this.ctrl.init(t,e)}refresh(){return this.ctrl?.refresh()??!1}selectAndSetTemplate(){const e=this.params;if(e.pinned)return void this.setTemplate(oS);const t=()=>{this.setTemplate(sS)};if(l(e.template))t();else if("string"==typeof e.template)this.setTemplate(e.template,[]);else if("function"==typeof e.template){const t=(0,e.template)(e);this.setTemplate(t,[])}else Et(168),t();null==this.eDetailGrid&&Et(169)}setDetailGrid(e){if(!this.eDetailGrid)return;const t=new tS(this.context.getBean("frameworkCompWrapper")),{frameworkOverrides:o}=this.beans,s=ig(this.eDetailGrid,e,{frameworkOverrides:o,providedBeanInstances:{frameworkCompWrapper:t},modules:Ct(this.params.api.getGridId(),e.rowModelType??"clientSide")});this.detailApi=s,this.ctrl?.registerDetailWithMaster(s),this.addDestroyFunc(()=>{s.destroy()})}setRowData(e){this.detailApi?.setGridOption("rowData",e)}}},dynamicBeans:{detailCellRendererCtrl:eS},apiFunctions:{addDetailGridInfo:function(e,t,o){iS(e,e=>{e[t]=o})},removeDetailGridInfo:function(e,t){iS(e,e=>{delete e[t]})},getDetailGridInfo:function(e,t){return iS(e,e=>e[t])},forEachDetailGridInfo:function(e,t){iS(e,e=>{let o=0;Object.values(e).forEach(e=>{e&&t(e,o++)})})}},dependsOn:[Kv,Vy,Uy],css:[".ag-details-row{width:100%}.ag-details-row-fixed-height{height:100%}.ag-details-grid{width:100%}.ag-details-grid-fixed-height{height:100%}"]},Wy,Xp]},rS=class extends ni{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}postConstruct(){this.beans.dragSvc.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragging:e=>{let t=!1;this.dragging||(t=!0,this.dragging=!0,R(this.beans).classList?.add(this.getDraggingCssClass())),this.updateValuesOnMove(e),t?this.changedCalculatedValues=!1:(this.beans.rangeSvc.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1))},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearDragProperties()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedEventListeners({cellSelectionChanged:this.updateLocalRangeIfNeeded.bind(this)}),this.addManagedElementListeners(this.getGui(),{pointerdown:aS,mousedown:aS})}getLastCellHovered(){return this.lastCellHovered}getDraggingCssClass(){return`ag-dragging-${0===this.type?"fill":"range"}-handle`}updateValuesOnMove(e){const t=Ml(this.gos,e);!t||this.shouldSkipCell(t)||this.lastCellHovered&&Mn(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.beans.rangeSvc.autoScrollService.ensureCleared(),R(this.beans).classList?.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging&&this.destroy()}getType(){return this.type}refresh(t,o){const s=this.cellCtrl,i=this.getGui(),n=o??e(this.beans.rangeSvc.getCellRanges()),r=n.startRow,a=n.endRow;if(r&&a&&(Pn(a,r)?(this.rangeStartRow=a,this.rangeEndRow=r):(this.rangeStartRow=r,this.rangeEndRow=a)),s!==t||!ae(i)){this.cellCtrl=t;const e=t.comp.getParentOfValue();e&&e.appendChild(i)}this.cellRange=n}clearValues(){this.lastCellHovered=void 0}destroy(){if(!this.shouldDestroyOnEndDragging&&this.dragging)return _(this.getGui(),!1),void(this.shouldDestroyOnEndDragging=!0);this.shouldDestroyOnEndDragging=!1,super.destroy(),this.getGui()?.remove()}updateLocalRangeIfNeeded(e){if(!this.cellRange)return;const{id:t,type:o}=this.cellRange;if(!t||t!==e.id)return;const s=this.beans.rangeSvc?.getCellRanges().find(e=>e.id===t&&e.type===o);s&&s!==this.cellRange&&(this.cellRange=s)}},aS=e=>{e.stopPropagation()};function lS(e){const t=e.length;let o=0;if(t<=1)return e;for(let h=0;h1?o=Math.max(o,parseInt(s[1],10)):Math.floor(t)!==t&&(o=Math.max(o,t.toString().split(".")[1].length))}let s=0,i=0,n=0,r=0,a=0;for(let h=0;h=4),e.toggleCss("ag-cell-range-chart",n),V(s,i>0||void 0),e.toggleCss("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshRangeStyleAndHandle()}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),o=!t&&e.top,s=!t&&e.right,i=!t&&e.bottom,n=!t&&e.left,r=this.cellComp;r.toggleCss("ag-cell-range-top",o),r.toggleCss("ag-cell-range-right",s),r.toggleCss("ag-cell-range-bottom",i),r.toggleCss("ag-cell-range-left",n)}isSingleCell(){const{rangeSvc:e}=this;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeSvc:e}=this;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(e=>[Hr.DIMENSION,Hr.VALUE].includes(e.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshRangeStyleAndHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,o=!1,s=!1,i=!1;const{rangeSvc:n,beans:{visibleCols:r},cellCtrl:{cellPosition:a}}=this,l=a.column,d=n.getCellRanges().filter(e=>n.isCellInSpecificRange(a,e));if(!d.length)return{top:t,right:o,bottom:s,left:i};let c,h;e?(c=r.getColAfter(l),h=r.getColBefore(l)):(c=r.getColBefore(l),h=r.getColAfter(l)),c||(i=!0),h||(o=!0);for(let u=0;u=0;s--){const t=o[s],i=t.colorClass;if(i&&e.isCellInSpecificRange(this.cellCtrl.cellPosition,t))return i}return null}refreshHandleColor(e){const t=this.selectionHandle?.getGui?.(),o=e?.colorClass??null;t?(this.handleColorClass&&this.handleColorClass!==o&&t.classList.remove(this.handleColorClass),o?t.classList.add(o):this.handleColorClass&&t.classList.remove(this.handleColorClass),this.handleColorClass=o??null):this.handleColorClass=null}getRangeForHandle(){const{gos:t,editSvc:o}=this.beans,s=this.rangeSvc,i=s.getCellRanges(),n=i.length;if(this.rangeCount<1||n<1)return null;const r=o?.isRangeSelectionEnabledWhileEditing(),a=r?i:[e(i)];for(const e of a){const{cellPosition:i,column:a}=this.cellCtrl,l=pS(t)&&!a.isSuppressFillHandle(),d=gS(t);let c=!o?.isEditing(this.cellCtrl,{withOpenEditor:!0})&&(r||1===n&&(l||d));if(this.hasChartRange&&(c=e.type===Hr.VALUE),c&&null!=e.endRow&&s.isContiguousRange(e)&&s.isBottomRightCell(e,i))return e}return null}addSelectionHandle(e){const{beans:t}=this,o=t.editSvc?.isRangeSelectionEnabledWhileEditing(),s=e.type,i=!o&&pS(t.gos)&&l(s)?0:1;if(this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=t.context.destroyBean(this.selectionHandle)),!this.selectionHandle){const e=t.registry.createDynamicBean(0===i?"fillHandle":"rangeHandle",!1);e&&(this.selectionHandle=t.context.createBean(e))}this.selectionHandle?.refresh(this.cellCtrl,e)}destroy(){this.unsetComp()}},fS=class extends We{constructor(e){super(),this.eContainer=e}postConstruct(){const{beans:e,gos:t,eContainer:o}=this,s=e.rangeSvc,i={eElement:o,onDragStart:s.onDragStart.bind(s),onDragStop:s.onDragStop.bind(s),onDragging:s.onDragging.bind(s)},n=e.dragSvc,r=n.addDragSource.bind(n,i),a=n.removeDragSource.bind(n,i);this.addManagedPropertyListeners(["enableRangeSelection","cellSelection"],()=>{no(t)?r():a()}),this.addDestroyFunc(a),no(t)&&r()}},CS=class extends We{constructor(e,t){super(),this.column=e,this.eGui=t}postConstruct(){this.addManagedElementListeners(this.eGui,{click:e=>e&&this.onClick(e)})}onClick(e){this.beans.rangeSvc?.handleColumnSelection(this.column,e)}},vS=class extends We{constructor(e,t){super(),this.column=e,this.comp=t,this.columnMap=/* @__PURE__ */new Map,this.isActive=!1,this.resetColumnMap()}postConstruct(){this.addManagedPropertyListener("cellSelection",()=>{this.refreshActive()}),this.refreshActive(),this.setupRangeHeaderHighlight()}resetColumnMap(){let e;this.columnMap.clear(),e=this.column.isColumn?[this.column]:this.column.getDisplayedLeafColumns();for(const t of e)this.columnMap.set(t,!1)}refreshActive(){const{gos:e,rangeSvc:t}=this.beans,o=e.get("cellSelection");this.isActive=!!(o&&t&&"object"==typeof o&&o.enableHeaderHighlight)}setupRangeHeaderHighlight(){const e=this.onRangeSelectionChanged.bind(this);this.addManagedEventListeners({rangeSelectionChanged:e,columnPinned:e,columnMoved:e,columnGroupOpened:e}),e()}onRangeSelectionChanged(){if(!this.isActive)return;this.resetColumnMap();const e=this.beans.rangeSvc.getCellRanges();let t=!1,o=!0;for(const s of e){if(t)break;for(const e of s.columns)this.columnMap.has(e)&&(this.columnMap.set(e,!0),t||(t=!0))}for(const s of Array.from(this.columnMap.values()))if(!1===s){o=!1;break}this.comp.toggleCss("ag-header-range-highlight",t&&o)}destroy(){super.destroy(),this.comp=null,this.column=null}};function wS(e,t){return null!=e?{rowIndex:e,rowPinned:t}:void 0}function bS(e){let t;for(const o of e)(void 0===t||Pn(t,o))&&(t=o);return t}function yS(e){let t;for(const o of e)(void 0===t||Pn(o,t))&&(t=o);return t}function SS(e,t,o){let s;s="top"===o?e.startRow&&e.endRow&&!Pn(e.startRow,e.endRow)?"endRow":"startRow":e.startRow&&e.endRow&&!Pn(e.startRow,e.endRow)?"startRow":"endRow",e[s]=t??void 0}var RS={moduleName:"CellSelection",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="rangeSvc",this.rangeSelectionExtensions=[],this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1,this.columnRangeSelectionCtx={}}wireBeans(e){this.rowModel=e.rowModel,this.dragSvc=e.dragSvc,this.colModel=e.colModel,this.visibleCols=e.visibleCols,this.cellNavigation=e.cellNavigation,this.ctrlsSvc=e.ctrlsSvc}postConstruct(){const e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),o=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:o,columnMoved:o,columnPinned:o}),this.ctrlsSvc.whenReady(this,e=>{const t=e.gridBodyCtrl;this.autoScrollService=new xl({scrollContainer:t.eBodyViewport,scrollAxis:"xy",getVerticalPosition:()=>t.scrollFeature.getVScrollPosition().top,setVerticalPosition:e=>t.scrollFeature.setVerticalScrollPosition(e),getHorizontalPosition:()=>t.scrollFeature.getHScrollPosition().left,setHorizontalPosition:e=>t.scrollFeature.setHorizontalScrollPosition(e),shouldSkipVerticalScroll:()=>!Nt(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!t.scrollFeature.isHorizontalScrollShowing()})})}registerRangeSelectionExtension(e){this.rangeSelectionExtensions.includes(e)||this.rangeSelectionExtensions.push(e)}unregisterRangeSelectionExtension(e){s(this.rangeSelectionExtensions,e)}shouldSuppressRangeSelection(e){return this.rangeSelectionExtensions.some(t=>t.shouldSuppressRangeSelection?.(e))}shouldSkipColumn(e){return this.rangeSelectionExtensions.some(t=>t.shouldSkipColumn?.(e))}isAllColumnsSelectionCell(e){return this.rangeSelectionExtensions.some(t=>t.isAllColumnsSelectionCell?.(e))}isAllColumnsRange(e,t){return this.rangeSelectionExtensions.some(o=>o.isAllColumnsRange?.(e,t))}updateSelectionModeForCell(e){this.setSelectionMode(this.isAllColumnsSelectionCell(e))}onDragStart(t){const o=this.gos,s=t.target;if(!no(o)||wa(o,s)?.isSuppressMouseEvent(t))return;if(this.shouldSuppressRangeSelection(s))return;const{shiftKey:i}=t,n=this.isMultiRange(t),r=i&&!!this.cellRanges?.length;n||r&&!a(e(this.cellRanges).type)||this.removeAllCellRanges(!0);const l=this.dragSvc.startTarget;if(l&&this.updateValuesOnMove(l),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=t,this.intersectionRange=n&&this.getCellRangeCount(this.lastCellHovered)>1,r||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=e(this.cellRanges);else{const e={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned},t=this.getColumnsFromModel([this.lastCellHovered.column]);if(!t?.length)return;this.draggingRange={startRow:e,endRow:e,columns:t,startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.addEventListener("scroll",this.bodyScrollListener,{passive:!0}),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}onDragging(e){const{dragging:t,lastCellHovered:o,newestRangeStartCell:s,autoScrollService:i,cellHasChanged:n}=this;if(!t||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const r=e=>o&&o.rowPinned===e&&s.rowPinned===e,a=r("top")||r("bottom");if(i.check(e,a),!n||!o)return;const l=s?.column,d=o?.column,c=this.calculateColumnsBetween(l,d);if(!c)return;const{rowIndex:h,rowPinned:u}=o;this.draggingRange.endRow={rowIndex:h,rowPinned:u},this.draggingRange.columns=c,this.dispatchChangedEvent(!1,!1,this.draggingRange.id)}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsSvc.getGridBodyCtrl().eBodyViewport.removeEventListener("scroll",this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}onColumnsChanged(){this.refreshLastRangeStart();const e=this.visibleCols.allCols;for(const s of this.cellRanges){const o=s.columns;s.columns=s.columns.filter(t=>t.isVisible()&&-1!==e.indexOf(t)),t(o,s.columns)||this.dispatchChangedEvent(!1,!0,s.id)}const o=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(e=>e.columns.length>0),o>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const t=e(this.cellRanges);t&&this.refreshRangeStart(t)}isContiguousRange(t){const o=t.columns;if(!o.length)return!1;const s=this.visibleCols.allCols,i=o.map(e=>s.indexOf(e)).sort((e,t)=>e-t);return e(i)-i[0]+1===o.length}getRangeStartRow(e){return e.startRow&&e.endRow?Pn(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:(this.beans.pinnedRowModel?.getPinnedTopRowCount()??0)>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return Pn(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.beans.pinnedRowModel?.getPinnedBottomRowCount()??0;return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}getRangeRowCount(e){const t=this.beans,o=this.getRangeStartRow(e),s=this.getRangeEndRow(e),i=Gn(t,o);return Gn(t,s)-i+1}handleCellMouseDown(e,t){const{beans:o}=this,s=e.target;if(this.shouldSuppressRangeSelection(s))return;const i=this.isAllColumnsSelectionCell(t);if(i&&e.preventDefault(),e.shiftKey)return this.extendLatestRangeToCell(t);if(i&&bo(o,e))return;const n=this.isMultiRange(e);this.updateSelectionModeForCell(t);const r=this.calculateColumnsBetween(t.column,t.column);if(!r)return;const a=i?this.findContainingRange({columns:r,startRow:t,endRow:t}):void 0;i&&a&&n&&(e.ctrlKey||e.metaKey)&&a?this.removeRowFromAllColumnsRange(t,a):this.setRangeToCell(t,n)}isMultiRange(e){const{ctrlKey:t,metaKey:o}=e,{editingWithRanges:s,allowMulti:i}=this.getMultiRangeContext();return s||!!i&&(t||o)}getMultiRangeContext(){const{gos:e,editSvc:t}=this.beans,o=!!t?.isEditing()&&!!t?.isRangeSelectionEnabledWhileEditing(),s=function(e){const t=e.get("cellSelection");return void 0===t?e.get("suppressMultiRangeSelection"):"boolean"!=typeof t&&(t?.suppressMultiRanges??!1)}(e)&&!o;return{editingWithRanges:o,suppressMultiRanges:s,allowMulti:!s}}removeRowFromAllColumnsRange(e,t){const{beans:o,cellRanges:i}=this,n=Tn(o),r=An(o),a=this.getRangeStartRow(t),l=this.getRangeEndRow(t);if(!a&&En(n,e))SS(t,Nn(o,n),"top");else if(!l&&En(r,e))SS(t,Ln(o,r),"bottom");else if(En(a,l))s(i,t);else if(En(a,e))SS(t,Nn(o,e),"top");else if(En(l,e))SS(t,Ln(o,e),"bottom");else{const s=Ln(o,e),n=Nn(o,e);t.startRow=a,t.endRow=s??void 0,i.push({...t,startRow:n??void 0,endRow:l})}this.dispatchChangedEvent(!0,!0)}setRangeToCell(e,t=!1){const{gos:o}=this;if(!no(o))return;this.updateSelectionModeForCell(e);const s=this.calculateColumnsBetween(e.column,e.column);if(!s)return;const{suppressMultiRanges:i}=this.getMultiRangeContext();(i||!t||l(this.cellRanges))&&this.removeAllCellRanges(!0);const n={rowIndex:e.rowIndex,rowPinned:e.rowPinned},r={startRow:n,endRow:n,columns:s,startColumn:e.column};this.cellRanges.push(r),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}getRangeLastColumn(t){const o=t.columns[0],s=e(t.columns);return this.newestRangeStartCell?.column===o?s:o}extendRangeRowCountBy(e,t){const{beans:o}=this,{startRow:s,endRow:i}=e;if(!s||!i)return;let n,r=0;const a=Pn(i,s);n=a?s:i;const l=t>0?Nn:Ln,d=Math.abs(t);for(;ro.indexOf(e)).filter(e=>e>-1).sort((e,t)=>e-t);return{left:o[s[0]],right:o[e(s)]}}extendLatestRangeInDirection(t){if(this.isEmpty()||!this.newestRangeStartCell)return;const o=t.key,s=t.ctrlKey||t.metaKey,i=e(this.cellRanges),n=this.newestRangeStartCell,r=i.endRow.rowIndex,a=i.endRow.rowPinned,l={column:this.getRangeLastColumn(i),rowIndex:r,rowPinned:a},d=this.cellNavigation.getNextCellToFocus(o,l,s);return d?(this.setCellRange({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:d.rowIndex,rowEndPinned:d.rowPinned,columnStart:n.column,columnEnd:d.column}),d):void 0}setCellRange(e){no(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){if(t(this.cellRanges,e))return;if(!this.verifyCellRanges(this.gos))return;this.setSelectionMode(!1),this.removeAllCellRanges(!0);const o=this.getColumnsFromModel(this.visibleCols.allCols)??[];let s=!1;for(const t of e){if(t.columns&&t.startRow){const e=this.getColumnsFromModel(t.columns);if(!e||0===e.length)continue;t.columns=e;const{startRow:o}=t;this.setNewestRangeStartCell({rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:t.columns[0]})}!s&&o.length>0&&this.isAllColumnsRange(t,o)&&(s=!0),this.cellRanges.push(t)}this.setSelectionMode(s),this.dispatchChangedEvent(!1,!0)}clearCellRangeCellValues(e){const{beans:t,eventSvc:o}=this,{cellEventSource:s="rangeSvc",dispatchWrapperEvents:i,wrapperEventSource:n="deleteKey",restoreSourceInBatch:r}=e;let{cellRanges:a}=e;i&&(o.dispatchEvent({type:"cellSelectionDeleteStart",source:n}),o.dispatchEvent({type:"rangeDeleteStart",source:n})),a||(a=this.cellRanges);const{valueSvc:l,editSvc:d}=t,c=!!d?.isBatchEditing();this.forEachEditableCellInRanges(a,(e,t)=>{if(r&&c)return void d?.batchResetToSourceValue({rowNode:e,column:t});const o=l.getDeleteValue(t,e);e.setDataValue(t,o,s)}),i&&(o.dispatchEvent({type:"cellSelectionDeleteEnd",source:n}),o.dispatchEvent({type:"rangeDeleteEnd",source:n}))}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(t,o){const{columns:s,columnStart:i,columnEnd:n,rowStartIndex:r,rowStartPinned:a,rowEndIndex:l,rowEndPinned:d}=t,c=this.getColumnsFromParams(s,i,n);if(!c||!o&&0===c.columns.length)return;const{columns:h,startsOnTheRight:u}=c;return{startRow:wS(r,a),endRow:wS(l,d),columns:h,startColumn:this.getColumnFromModel(i)??(u?e(h):h[0])}}addCellRange(e){const t=this.gos;if(!no(t)||!this.verifyCellRanges(t))return;this.setSelectionMode(!1);const o=this.createCellRangeFromCellRangeParams(e);return o?(o.startRow&&this.setNewestRangeStartCell({rowIndex:o.startRow.rowIndex,rowPinned:o.startRow.rowPinned,column:o.startColumn}),this.cellRanges.push(o),this.dispatchChangedEvent(!1,!0,o.id),o):void 0}getCellRanges(){return this.cellRanges}isEmpty(){return 0===this.cellRanges.length}isMoreThanOneCell(){const e=this.cellRanges.length;if(0===e)return!1;if(e>1)return!0;const t=this.cellRanges[0],o=this.getRangeStartRow(t),s=this.getRangeEndRow(t);return o.rowPinned!==s.rowPinned||o.rowIndex!==s.rowIndex||1!==t.columns.length}areAllRangesAbleToMerge(){const e=/* @__PURE__ */new Map;if(this.cellRanges.length<=1)return!0;for(const o of this.cellRanges)this.forEachRowInRange(o,t=>{const s=`${t.rowPinned||"normal"}_${t.rowIndex}`,i=e.get(s),n=o.columns.map(e=>e.getId());if(i){const e=n.filter(e=>-1===i.indexOf(e));i.push(...e)}else e.set(s,n)});let t;for(const o of e.values()){const e=o.sort().join();if(void 0!==t){if(t!==e)return!1}else t=e}return!0}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const o=t.columns?.includes(e.column),s=this.isRowInRange(e,t);return o&&s}isColumnInAnyRange(e){const{beans:t}=this,o=Tn(t),s=An(t);if(!o||!s)return!1;const i=e.isColumn?[e]:e.getDisplayedLeafColumns();return null!=this.findContainingRange({columns:i,startRow:o,endRow:s},!0)}findContainingRange({columns:e,startRow:t,endRow:o},s=!1){const i=this.cellRanges;for(let n=i.length-1;n>=0;n--){const r=i[n],a=e.every(e=>r.columns.includes(e));let l=!1;if(s)l=En(r.startRow,t)&&En(r.endRow,o);else{const e=t&&this.isRowInRange(t,r),s=o&&this.isRowInRange(o,r);l=!!e&&!!s}if(a&&l)return r}}isBottomRightCell(t,o){const s=this.visibleCols.allCols,i=t.columns.map(e=>s.indexOf(e)).sort((e,t)=>e-t),{startRow:n,endRow:a}=t,l=Pn(n,a)?a:n,d=s.indexOf(o.column)===e(i),c=o.rowIndex===l.rowIndex&&r(o.rowPinned)===r(l.rowPinned);return d&&c}getCellRangeCount(e){return this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t){const o=this.getRangeStartRow(t),s=this.getRangeEndRow(t),i=En(e,o),n=En(e,s);if(i||n)return!0;const r=!Pn(e,o),a=Pn(e,s);return r&&a}intersectLastRange(t){const{editingWithRanges:o,suppressMultiRanges:s}=this.getMultiRangeContext();if(o||s||t&&this.dragging||this.isEmpty())return;const i=e(this.cellRanges),n=this.getRangeStartRow(i),r=this.getRangeEndRow(i),a=[];for(const e of this.cellRanges.slice(0,-1)){const t=this.getRangeStartRow(e),o=this.getRangeEndRow(e),s=e.columns,l=s.filter(e=>-1===i.columns.indexOf(e));if(l.length===s.length){a.push(e);continue}if(Pn(r,t)||Pn(o,n)){a.push(e);continue}const d=a.length;if(Pn(t,n)){const e={columns:[...s],startColumn:i.startColumn,startRow:{...t},endRow:Ln(this.beans,n)};a.push(e)}if(l.length>0){const e={columns:l,startColumn:l.includes(i.startColumn)?i.startColumn:l[0],startRow:bS([{...n},{...t}]),endRow:yS([{...r},{...o}])};a.push(e)}Pn(r,o)&&a.push({columns:[...s],startColumn:i.startColumn,startRow:Nn(this.beans,r),endRow:{...o}}),a.length-d===1&&(a[a.length-1].id=e.id)}this.cellRanges=a,t&&this.dispatchChangedEvent(!1,!0)}createRangeHighlightFeature(e,t,o){e.createManagedBean(new vS(t,o))}setSelectionMode(e){this.selectionMode=e?1:0}refreshRangeStart(t){const{startColumn:o,columns:s}=t,i=(e,o)=>{const s=t.columns.filter(t=>t!==e);e?(t.startColumn=e,t.columns=o?[e,...s]:[...s,e]):t.columns=s},{left:n,right:r}=this.getRangeEdgeColumns(t);o!==s[0]||o===n?o===e(s)&&o===r&&i(r,!1):i(n,!0)}setNewestRangeStartCell(e){this.newestRangeStartCell=e}getColumnsFromParams(e,t,o){const s=!e&&!t&&!o;let i,n=!1;return s||e?i=this.getColumnsFromModel(s?void 0:e):t&&o&&(i=this.calculateColumnsBetween(t,o),i?.length&&(n=i[0]!==this.getColumnFromModel(t))),i?{columns:i,startsOnTheRight:n}:void 0}verifyCellRanges(e){const{suppressMultiRanges:t}=this.getMultiRangeContext(),o=function(e){return void 0!==e.get("cellSelection")}(e)&&t&&this.cellRanges.length>1;return o&&Et(93),!o}forEachRowInRange(e,t){const o=this.getRangeStartRow(e),s=this.getRangeEndRow(e);let i=o;for(;i&&(t(i),!En(i,s));)i=Nn(this.beans,i)}forEachEditableCellInRanges(e,t){const{beans:o}=this;for(const s of e)this.forEachRowInRange(s,e=>{const i=In(o,e);if(i)for(let o=0;o0,h=o.ctrlKey||o.metaKey,u=!d||h,g=Tn(n),p=An(n);if(!g||!p)return;if(o.key===Es&&o.preventDefault(),o.shiftKey){const o=r.root;if(!o)return;const i=t.isColumn?t:e(t.getLeafColumns()),n=this.findContainingRange({columns:[o],startRow:g,endRow:p},!0);return n?void this.updateRangeRowBoundary({cellRange:n,boundary:"end",cellPosition:{column:i,...p}}):(s(a,r.lastCellRange),void this.selectColumns(this.calculateColumnsBetween(o,i),g,p))}c&&(l||!h&&!d)&&this.removeAllCellRanges(!0);const m=(e,t)=>{const o=this.findContainingRange({columns:e,startRow:g,endRow:p},!0);if(o&&u)this.deselectColumnsFromRange(o,e);else{const t=this.selectColumns(e,g,p);t&&(r.lastCellRange=t)}r.root=t};if(t.isColumn)m([t],t);else{const e=t.getDisplayedLeafColumns();m(e,e[0])}}deselectColumnsFromRange(e,t){i(e.columns,t),t.includes(e.startColumn)&&(e.startColumn=e.columns[0]),0===e.columns.length&&s(this.cellRanges,e),this.dispatchChangedEvent(!0,!0)}selectColumns(t,o,s){return this.addCellRange({columns:t,columnStart:t[0],columnEnd:e(t),rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:s.rowIndex,rowEndPinned:s.rowPinned})}}],dynamicBeans:{fillHandle:class extends rS{constructor(){super(dS),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=0}postConstruct(){super.postConstruct(),this.addManagedElementListeners(this.getGui(),{dblclick:this.onDblClick.bind(this)})}onDblClick(t){yn(t);const{cellRange:o,rangeStartRow:s,beans:i}=this,{rangeSvc:n,visibleCols:r}=i,a=An(i);if(!a)return;const l=this.getFillHandleDirection();this.dragAxis="xy"===l?"y":l;const d=n?.createCellRangeFromCellRangeParams({rowStartIndex:s.rowIndex,rowStartPinned:s.rowPinned,columnStart:o.columns[0],rowEndIndex:"x"===this.dragAxis?o.endRow?.rowIndex??null:a.rowIndex,rowEndPinned:"x"===this.dragAxis?o.endRow?.rowPinned:a.rowPinned,columnEnd:"x"===this.dragAxis?e(r.allCols):e(o.columns)});this.isUp=!1,this.isLeft=!1,d&&this.performFill({event:t,initialRange:o,finalRange:d}),this.dragAxis=void 0}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=Pl(this.beans,e));const{x:t,y:o}=this.initialXY,{x:s,y:i}=Pl(this.beans,e),n=Math.abs(t-s),r=Math.abs(o-i),a=this.getFillHandleDirection();let l;l="xy"===a?n>r?"x":"y":a,l!==this.dragAxis&&(this.dragAxis=l,this.changedCalculatedValues=!0)}shouldSkipCell(e){return _o(e.column)}onDrag(e){if(!this.initialPosition){const e=this.cellCtrl;if(!e)return;this.initialPosition=e.cellPosition}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t="x"===this.dragAxis,{cellRange:o,rangeStartRow:s,rangeEndRow:i,beans:{rangeSvc:n}}=this,r=o.columns.length;let a;if(this.isUp||this.isLeft){const e=t?s:this.lastCellMarked;a=n.createCellRangeFromCellRangeParams({rowStartIndex:e.rowIndex,rowStartPinned:e.rowPinned,columnStart:t?this.lastCellMarked.column:o.columns[0],rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnEnd:o.columns[r-1]})}else a=n.createCellRangeFromCellRangeParams({rowStartIndex:s.rowIndex,rowStartPinned:s.rowPinned,columnStart:o.columns[0],rowEndIndex:t?i.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?i.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:o.columns[r-1]});a&&this.performFill({event:e,initialRange:o,finalRange:a,shouldUpdateRange:!0})}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}performFill({event:e,initialRange:t,finalRange:o,shouldUpdateRange:s}){const{eventSvc:i,rangeSvc:n}=this.beans;i.dispatchEvent({type:"fillStart"}),this.handleValueChanged(t,o,e),s&&n.setCellRanges([o]),i.dispatchEvent({type:"fillEnd",initialRange:t,finalRange:o})}getFillHandleDirection(){const e=ro(this.gos)?.direction;return e?"x"!==e&&"y"!==e&&"xy"!==e?(Et(177),"xy"):e:"xy"}handleValueChanged(t,o,s){const{beans:i}=this,{rangeSvc:n,gos:r,valueSvc:a}=i,l=n.getRangeEndRow(t),c=n.getRangeStartRow(t),h=n.getRangeEndRow(o),u=n.getRangeStartRow(o),g="y"===this.dragAxis;if(this.isReduce&&!ro(r)?.suppressClearOnFillReduction){const e=g?t.columns:t.columns.filter(e=>o.columns.indexOf(e)<0),s=g?Nn(i,h):u;return void(s&&this.clearCellsInRange(s,l,e))}const p=[],m=[],f=[],C=[];let v=!0,w=0;const b=()=>{p.length=0,m.length=0,f.length=0,C.length=0,w=0},y=(o,s)=>{let n=this.isUp?l:c,r=!1;for(g&&(v=!0,b());!r&&n;){const a=In(i,n);if(!a)break;if(g&&o)S(p,o,a,()=>!En(n,this.isUp?c:l));else if(s){v=!0,b();for(const o of s)S(p,o,a,()=>o!==(this.isLeft?t.columns[0]:e(t.columns)))}r=En(n,this.isUp?u:h),n=this.isUp?Ln(this.beans,n):Nn(i,n)}},S=(e,t,o,i)=>{let n,r=!1;if(v)n=a.getValue(t,o,"edit"),m.push(n),f.push(a.getValue(t,o,"edit",!0)),C.push(a.getValueForDisplay({column:t,node:o,from:"edit"}).valueFormatted),v=i();else{const{value:i,fromUserFunction:l,sourceCol:c,sourceRowNode:h}=this.processValues({event:s,values:e,initialValues:m,initialNonAggregatedValues:f,initialFormattedValues:C,col:t,rowNode:o,idx:w++});if(n=i,t.isCellEditable(o)){const e=a.getValue(t,o,"edit");if(!l){if(c){const e=c.getColDef();if(!1!==e.useValueFormatterForExport&&e.valueFormatter){const e=a.getValueForDisplay({column:c,node:h,includeValueFormatted:!0,from:"edit"}).valueFormatted;null!=e&&(n=e)}}!1!==t.getColDef().useValueParserForImport&&(n=a.parseValue(t,o,c?n:d(n),e))}l&&e===n?r=!0:o.setDataValue(t,n,"rangeSvc")}}r||e.push({value:n,column:t,rowNode:o})};g?t.columns.forEach(e=>{y(e)}):y(void 0,this.isLeft?[...o.columns].reverse():o.columns),this.beans.editSvc?.stopEditing(void 0,{source:"fillHandle"})}clearCellsInRange(e,t,o){const s={startRow:e,endRow:t,columns:o,startColumn:o[0]};this.beans.rangeSvc.clearCellRangeCellValues({cellRanges:[s],restoreSourceInBatch:!0})}processValues(t){const{formula:o,valueSvc:s}=this.beans,{event:i,values:n,initialValues:r,initialNonAggregatedValues:a,initialFormattedValues:l,col:d,rowNode:c,idx:h}=t,u=ro(this.gos)?.setFillValue;let g;if(g="y"===this.dragAxis?this.isUp?"up":"down":this.isLeft?"left":"right",u){const e=u(wo(this.gos,{event:i,values:n.map(({value:e})=>e),initialValues:r,initialNonAggregatedValues:a,initialFormattedValues:l,currentIndex:h,currentCellValue:s.getValue(d,c,"edit"),direction:g,column:d,rowNode:c}));if(!1!==e)return{value:e,fromUserFunction:!0}}const p=n.every(({value:e})=>{return"number"==typeof(t=e)&&Number.isFinite(t)||"string"==typeof t&&/^[+-]?\d+(?:\.\d+)?$/.test(t.trim());var t});if(i.altKey||!p){const t=String(e(n)?.value??"");if(p&&1===r.length){const e=this.isUp||this.isLeft?-1:1;return{value:parseFloat(t)+1*e,fromUserFunction:!1}}const{value:s,column:i,rowNode:a}=n[h%n.length];let l;const d=i.isAllowFormula()&&o?.isFormula(t);if(d){const e="up"===g?-1:"down"===g?1:0,s="left"===g?-1:"right"===g?1:0;l=o.updateFormulaByOffset({value:t,rowDelta:e,columnDelta:s})}else l=s;return{value:l,fromUserFunction:!1,sourceCol:d?void 0:i,sourceRowNode:a}}return{value:e(lS(n.map(({value:e})=>Number(e)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){for(const e of this.markedCells){if(!e.isAlive())continue;const{comp:t}=e;t.toggleCss("ag-selection-fill-top",!1),t.toggleCss("ag-selection-fill-right",!1),t.toggleCss("ag-selection-fill-bottom",!1),t.toggleCss("ag-selection-fill-left",!1)}this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),"y"===this.dragAxis){if(En(t,e))return;const o=Pn(t,e),{rangeStartRow:s,rangeEndRow:i}=this;o&&(t.rowPinned==s.rowPinned&&t.rowIndex>=s.rowIndex||s.rowPinned!=i.rowPinned&&t.rowPinned==i.rowPinned&&t.rowIndex<=i.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,o),this.isReduce=!1)}else{const o=e.column,s=t.column;if(o===s)return;const i=this.beans.visibleCols.allCols,n=i.indexOf(o),r=i.indexOf(s);r<=n&&r>=i.indexOf(this.cellRange.columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,re&&!t?1:!e&&t?-1:e||t?et?1:0:0,DS="Exceeded maximum allowed pivot column count.",MS=e=>{const t={};return e.forEach((e,o)=>t[o]=e instanceof Map?MS(e):e),t},PS={moduleName:"SharedPivot",version:jv,beans:[class extends We{constructor(){super(...arguments),this.beanName="pivotResultCols"}wireBeans(e){this.colModel=e.colModel,this.visibleCols=e.visibleCols}destroy(){$o(this.beans,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return null!=this.pivotResultCols}lookupPivotResultCol(e,o){if(null==this.pivotResultCols)return null;const s=this.colModel.getColDefCol(o);let i=null;for(const n of this.pivotResultCols.list){const o=n.getColDef().pivotKeys,r=n.getColDef().pivotValueColumn;t(o,e)&&r===s&&(i=n)}return i}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.colModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){if(this.colModel.ready&&(null!=e||null!=this.pivotResultCols)){if(e){this.processPivotResultColDef(e);const o=("api"===t?is:ss)(this.beans,e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);$o(this.beans,this.pivotResultCols?.tree,o.columnTree);const s=o.columnTree;this.pivotResultCols={tree:s,treeDepth:o.treeDepth,list:Wo(s),map:{}};for(const e of this.pivotResultCols.list)this.pivotResultCols.map[e.getId()]=e;const i=!!this.previousPivotResultCols;this.previousPivotResultCols=null,this.colModel.refreshCols(!i,t)}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null,this.colModel.refreshCols(!1,t);this.visibleCols.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),o=this.gos.get("processPivotResultColGroupDef");if(!t&&!o)return;const s=e=>{e.forEach(e=>{if(a(e.children)){const t=e;o&&o(t),s(t.children)}else{t&&t(e)}})};e&&s(e)}},class extends We{constructor(){super(...arguments),this.beanName="pivotColDefSvc"}wireBeans(e){this.colModel=e.colModel,this.pivotColsSvc=e.pivotColsSvc,this.valueColsSvc=e.valueColsSvc,this.colNames=e.colNames}postConstruct(){const e=()=>this.gos.get("serverSidePivotResultFieldSeparator")??"_";this.fieldSeparator=e(),this.addManagedPropertyListener("serverSidePivotResultFieldSeparator",()=>{this.fieldSeparator=e()});const t=()=>this.gos.get("pivotDefaultExpanded");this.pivotDefaultExpanded=t(),this.addManagedPropertyListener("pivotDefaultExpanded",()=>{this.pivotDefaultExpanded=t()})}createPivotColumnDefs(e){const t=this.createPivotColumnsFromUniqueValues(e);const o=function e(t,o=[]){return t.forEach(t=>{void 0!==t.children?e(t.children,o):o.push(t)}),o}(t);return this.addRowGroupTotals(t,o),this.addExpandablePivotGroups(t,o),this.addPivotTotalsToGroups(t,o),t}createPivotColumnsFromUniqueValues(e){const t=this.pivotColsSvc?.columns??[],o=t.length;return this.recursivelyBuildGroup(0,e,[],o,t)}recursivelyBuildGroup(e,t,o,s,i){if(e>=s)return this.buildMeasureCols(o);const{pivotComparator:n}=i[e].getColDef(),r=n?(e=>(t,o)=>e(t.headerName,o.headerName))(n):FS,a=this.valueColsSvc?.columns;if(1===a?.length&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&e===s-1){const e=[];for(const s of t.keys()){const t=[...o,s],i=this.createColDef(a[0],s,t);i.columnGroupShow="open",e.push(i)}return e.sort(r),e}const l=[];for(const d of t.keys()){const n=-1===this.pivotDefaultExpanded||e{const o=this.colNames.getDisplayNameForColumn(t,"header"),s=this.createColDef(t,o,e);return s.columnGroupShow="open",s})}addExpandablePivotGroups(e,t){const o=this.gos.get("suppressExpandablePivotGroups");if(o||this.gos.get("pivotColumnGroupTotals"))return;const s=(e,t,i)=>{if("children"in e){const{valueColsSvc:n}=this,{columns:r=[]}=n??{},a=/* @__PURE__ */new Map;e.children.forEach(e=>{s(e,t,a)});const l=!e.children.some(e=>e.children),d=l&&1===r.length&&this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(const s of r){const i=this.colNames.getDisplayNameForColumn(s,"header"),n=this.createColDef(s,i,e.pivotKeys);n.pivotTotalColumnIds=a.get(s.getColId()),n.columnGroupShow=o?"open":"closed",n.aggFunc=s.getAggFunc(),l&&!d||(e.children.push(n),t.push(n))}return void this.merge(i,a)}if(!e.pivotValueColumn)return;const n=e.pivotValueColumn.getColId();i.has(n)?i.get(n).push(e.colId):i.set(n,[e.colId])};e.forEach(e=>{s(e,t,/* @__PURE__ */new Map)})}addPivotTotalsToGroups(e,t){if(!this.gos.get("pivotColumnGroupTotals"))return;const o="after"===this.gos.get("pivotColumnGroupTotals"),s=this.valueColsSvc?.columns,i=s?.map(e=>e.getAggFunc());if(i&&!(i.length<1)&&this.sameAggFuncs(i)&&s){const i=s[0];e.forEach(e=>{this.recursivelyAddPivotTotal(e,t,i,o)})}}recursivelyAddPivotTotal(e,t,o,s){const i=e;if(!i.children){const t=e;return t.colId?[t.colId]:null}let n=[];if(i.children.forEach(e=>{const i=this.recursivelyAddPivotTotal(e,t,o,s);i&&(n=n.concat(i))}),i.children.length>1){const i=this.getLocaleTextFunc()("pivotColumnGroupTotals","Total"),r=this.createColDef(o,i,e.pivotKeys,!0);r.pivotTotalColumnIds=n,r.aggFunc=o.getAggFunc(),r.columnGroupShow=this.gos.get("suppressExpandablePivotGroups")?"open":void 0;const a=e.children;s?a.push(r):a.unshift(r),t.push(r)}return n}addRowGroupTotals(e,t){if(!this.gos.get("pivotRowTotals"))return;const o="after"===this.gos.get("pivotRowTotals"),s=(this.valueColsSvc?.columns??[]).slice();o||s.reverse();const i=s.length>1||!this.gos.get("removePivotHeaderRowWhenSingleValueColumn");for(let n=0;ne.data?.[e.colDef.field],i.pivotKeys=o,i.pivotValueColumn=e,!0===i.filter&&(i.filter="agNumberColumnFilter"),i}sameAggFuncs(e){if(1==e.length)return!0;for(let t=1;t{const s=[...e.has(o)?e.get(o):[],...t];e.set(o,s)})}generateColumnGroupId(e){return`pivotGroup_${(this.pivotColsSvc?.columns??[]).map(e=>e.getColId()).join("-")}_${e.join("-")}`}generateColumnId(e,t){return`pivot_${(this.pivotColsSvc?.columns??[]).map(e=>e.getColId()).join("-")}_${e.join("-")}_${t}`}createColDefsFromFields(e){const t=/* @__PURE__ */new Map;for(let i=0;i{const n=[];for(const[r,a]of s){const t=o(`${e}${this.fieldSeparator}${r}`,r,a,i+1);n.push(t)}if(0===n.length){const o=this.colModel.getColDefCol(t);if(o){const s=this.colNames.getDisplayNameForColumn(o,"header")??t,i=this.createColDef(o,s,void 0,!1);return i.colId=e,i.aggFunc=o.getAggFunc(),i.valueGetter=t=>t.data?.[e],i}return{colId:e,headerName:t,valueGetter:t=>t.data?.[e]}}return this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===n.length&&"colId"in n[0]?(n[0].headerName=t,n[0]):{openByDefault:-1===this.pivotDefaultExpanded||i`${e.getId()}-${e.getColDef().headerName}`).join("#"),a=n.map(e=>e.getAggFunc().toString()).join("#"),l=this.aggregationColumnsHashLastTime!==r,d=this.aggregationFuncsHashLastTime!==a;this.aggregationColumnsHashLastTime=r,this.aggregationFuncsHashLastTime=a;const c=(this.rowGroupColsSvc?.columns??[]).map(e=>e.getId()).join("#"),h=c!==this.groupColumnsHashLastTime;this.groupColumnsHashLastTime=c;const u=this.gos.get("pivotRowTotals"),g=this.gos.get("pivotColumnGroupTotals"),p=this.gos.get("suppressExpandablePivotGroups"),m=this.gos.get("removePivotHeaderRowWhenSingleValueColumn"),f=u!==this.pivotRowTotalsLastTime||g!==this.pivotColumnGroupTotalsLastTime||p!==this.suppressExpandablePivotGroupsLastTime||m!==this.removePivotHeaderRowWhenSingleValueColumnLastTime;if(this.pivotRowTotalsLastTime=u,this.pivotColumnGroupTotalsLastTime=g,this.suppressExpandablePivotGroupsLastTime=p,this.removePivotHeaderRowWhenSingleValueColumnLastTime=m,this.lastTimeFailed||i||l||h||d||f){const t=this.pivotColDefSvc.createPivotColumnDefs(this.uniqueValues);this.pivotResultCols.setPivotResultCols(t,"rowModelUpdated"),e&&(e.active=!1)}this.lastTimeFailed=!1}setUniqueValues(e){return!c(MS(this.uniqueValues),MS(e))&&(this.uniqueValues=e,!0)}bucketUpRowNodes(e){this.currentUniqueCount=0;const t=/* @__PURE__ */new Map;e.forEachChangedNodeDepthFirst(e=>{e.leafGroup&&(e.childrenMapped=null)});const o=e=>{e.leafGroup?this.bucketRowNode(e,t):e.childrenAfterFilter?.forEach(o)};return e.executeFromRootNode(o),t}bucketRowNode(e,t){const o=this.pivotColsSvc?.columns;e.childrenMapped=0===o?.length?null:MS(this.bucketChildren(e.childrenAfterFilter,o,0,t)),e.sibling&&(e.sibling.childrenMapped=e.childrenMapped)}bucketChildren(e,t=[],o,s){const i=/* @__PURE__ */new Map,n=t[o],r=-1!==this.maxUniqueValues;if(e.forEach(e=>{let t=this.valueSvc.getKeyForNode(n,e);if(l(t)&&(t=""),!s.get(t)){this.currentUniqueCount+=1,s.set(t,/* @__PURE__ */new Map);const e=this.currentUniqueCount>this.maxUniqueValues;if(r&&e)throw new Error(DS)}i.has(t)||i.set(t,[]),i.get(t).push(e)}),o===t.length-1)return i;const a=/* @__PURE__ */new Map;for(const l of i.keys())a.set(l,this.bucketChildren(i.get(l),t,o+1,s.get(l)));return a}}],dependsOn:[PS,Yy,Wy]},TS=(String.fromCodePoint(31,41150,8291),[{symbol:"%",fixity:"postfix",precedence:100},{symbol:"-",fixity:"prefix",precedence:90},{symbol:"+",fixity:"prefix",precedence:90},{symbol:"^",fixity:"infix",precedence:80,associativity:"right"},{symbol:"*",fixity:"infix",precedence:70,associativity:"left",isAssociative:!0},{symbol:"/",fixity:"infix",precedence:70,associativity:"left"},{symbol:"+",fixity:"infix",precedence:60,associativity:"left",isAssociative:!0},{symbol:"-",fixity:"infix",precedence:60,associativity:"left"},{symbol:"&",fixity:"infix",precedence:55,associativity:"left",isAssociative:!0},{symbol:"=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<>",fixity:"infix",precedence:50,associativity:"left"},{symbol:">=",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<=",fixity:"infix",precedence:50,associativity:"left"},{symbol:">",fixity:"infix",precedence:50,associativity:"left"},{symbol:"<",fixity:"infix",precedence:50,associativity:"left"}]),AS=/* @__PURE__ */new Map;for(const zS of TS){const e=AS.get(zS.symbol)??[];e.push(zS),AS.set(zS.symbol,e)}[...new Set(TS.map(e=>e.symbol))].sort((e,t)=>t.length-e.length);var IS={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",stackedLine:"line",normalizedLine:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall",funnel:"funnel",coneFunnel:"cone-funnel",pyramid:"pyramid"},kS=/* @__PURE__ */new Set(["columnLineCombo","areaColumnCombo","customCombo"]);["number","category","grouped-category","log","time"].reduce((e,t)=>({...e,[t]:{title:{_enabledFromTheme:!0}}}),{});var LS=e=>t=>null==t||e(t),GS=["doughnut"];function NS(e){return!!IS[e]||function(e){return kS.has(e)}(e)}LS(e=>{if(NS(e))return!0;if(t=e,GS.includes(t)){const t=function(e){return"doughnut"===e?"donut":e}(e);return nt(`The chart type '${e}' has been deprecated. Please use '${t}' instead.`),t}var t;return!1}),LS(e=>"object"==typeof e),LS(e=>"object"==typeof e),LS(e=>"string"==typeof e||"function"==typeof e);function BS(e){return e.map((e,t,o)=>e.map((e,s)=>o.slice(0,t+1).reduce((e,t)=>e+t[s],0)))}function HS(e){const t=e.map((t,o)=>e.reduce((e,t)=>Math.max(e,t[o]),0));return e.map(e=>e.map((e,o)=>e/t[o]*19))}var OS=[[1,3,5],[2,6,4],[5,3,1]];HS(BS(OS)),HS(BS(OS));(class{static register(e){pt(e,void 0)}static registerModules(e){for(const t of e)pt(t,void 0)}}).registerModules([Mm,Mg,mm,Qp,gm,Sp,yg,qb,RS,ES,nS,pw,ab,Sb,Nb,Hb,Jy]);var VS=e=>$c.withPart(Hc).withParams({browserColorScheme:e?"dark":"light",backgroundColor:e?"#121212":"#FDFDFD",foregroundColor:e?"#E0E0E0":"#181D1F",accentColor:e?"#4FAAFF":"#004B9C",headerBackgroundColor:e?"#2A2A2A":"#EEB111",headerTextColor:e?"#4FAAFF":"#004B9C",borderRadius:4,columnBorder:!1,headerFontSize:14,headerFontWeight:600,listItemHeight:20,iconSize:14,spacing:3,wrapperBorderRadius:4});export{ig as createGrid,VS as getAgTheme}; \ No newline at end of file diff --git a/UI/aggrid/vite.config.js b/UI/aggrid/vite.config.js new file mode 100644 index 0000000..ba68d1e --- /dev/null +++ b/UI/aggrid/vite.config.js @@ -0,0 +1,31 @@ +import { defineConfig } from "vite"; +import tailwindcss from "@tailwindcss/vite"; +import { resolve } from "path"; +import path from "node:path"; + +const __dirname = path.resolve(); + +export default defineConfig({ + plugins: [tailwindcss()], + build: { + // Usamos la configuraciΓ³n de librerΓ­a para generar el bundle limpio + lib: { + entry: resolve(__dirname, "./UI/aggrid/aggrid-lib.js"), + name: "AgGridBundle", + fileName: "aggrid", + formats: ["es"], + }, + outDir: "./UI/aggrid/dist", + minify: "terser", // MΓ‘xima compresiΓ³n + rollupOptions: { + // Si quieres que ag-grid NO se incluya y sea externo, aΓ±Γ‘delo aquΓ­. + // Pero como quieres un "Bundle", lo dejamos vacΓ­o para que empaquete todo. + external: ["sigpro"], + output: { + globals: { + sigpro: "$", + }, + }, + }, + }, +}); \ No newline at end of file diff --git a/UI/index.js b/UI/index.js new file mode 100644 index 0000000..78c0dfc --- /dev/null +++ b/UI/index.js @@ -0,0 +1,2 @@ +// /plugins/index.js +export { UI } from './sigpro-ui.js'; \ No newline at end of file diff --git a/UI/sigpro-ui.js b/UI/sigpro-ui.js new file mode 100644 index 0000000..7861362 --- /dev/null +++ b/UI/sigpro-ui.js @@ -0,0 +1,1240 @@ +/** + * SigPro UI - daisyUI v5 & Tailwind v4 Plugin + * Provides a set of reactive functional components, flow control and i18n. + */ +export const UI = ($, defaultLang = "es") => { + const ui = {}; + + // --- I18N CORE --- + const i18n = { + es: { close: "Cerrar", confirm: "Confirmar", cancel: "Cancelar", search: "Buscar...", loading: "Cargando..." }, + en: { close: "Close", confirm: "Confirm", cancel: "Cancel", search: "Search...", loading: "Loading..." }, + }; + + const currentLocale = $(defaultLang); + + /** SET LOCALE */ + ui.SetLocale = (locale) => currentLocale(locale); + + /** TRANSLATE */ + const tt = (key) => () => i18n[currentLocale()][key] || key; + + // --- INTERNAL HELPERS --- + const val = (v) => (typeof v === "function" ? v() : v); + + const joinClass = (base, extra) => { + if (typeof extra === "function") { + return () => `${base} ${extra() || ""}`.trim(); + } + return `${base} ${extra || ""}`.trim(); + }; + + /** ICONS */ + const iconShow = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADjSURBVDiN3dJNSgNBEAXgz4DZeAAVJ9tko2St3kaIFxAVt4KZeAD1GKKi7vQSydI/yHgALxAXU02GxniAFBR0v1ev+3V1sZSxjxtM8BM5wTX2/hNu4gFvOMI21iJ3cIwP3GMjF/dQ4RyraOMS34GPAmvjIrBeEnfwjoPGgSM8ooh8QtngB6Ep4BWnmaMqkY1LqqzmDC8tzNDK3/RHzLL9SloUYWfQIMuw3Yl8xrDBH6qbvZWALqbqBqVmlWF7GuKEDwPr5hbXcYdPnKBv/o39wL5wG7ULY1c9NGPzQRrjKrhli1/02zEjWyWMBwAAAABJRU5ErkJggg=="; + const iconHide = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAEDSURBVDiN1dK/K8VhFAbwD+VLGSxKcu9guSQ/Zils/gNkuaX4BxRZDTdklYU/QAaDlEVGGwu2Kz/uVbKJzWDwfuv1+jHz1Km3c85znuf0Hv4jxnD2W8MItnCJ5xAX2MQcHsOQL+jEAapYQD9aQwxiDy+B3JKSe1DHCpqQYQ0PeMJOpDyAmyAAirjGbDRwFYcoYCZSzjGP+8B1gqXEUT2QxyPlqaRnGceNeENzUswwil1MBocbSU9DCAXUUI6K25HtIo5QSVaooitP9OEO65iIbE+HXSvBVRbeNZQSR9pxGil3o83HNw5hEbfYR0dKFki5ci+u8OrzIQ1/R8xx7ocL+9t4B0HPOVXjoptxAAAAAElFTkSuQmCC"; + const iconClose = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAESSURBVDiNtdO7LoRBHAXwXyhVG5ddEq9AgbXiskS1dOJS6DyDRKLmFRCvQY9aIi6FnpDsrkuiQCWKmS/5dmW/VXCSyWTm/GfmnPzP8A8oYBc3eEMd59iKXCZW8YpDzCOHHszgAE9Ya3V4EY8YzXhgAndYaib68YxiO4kYRg290Bk3t/GAvbiuII/7uJ7CGG5RxSCGcJrceh2LEkzGwnIctTgnGMdFWtZ7IimFcrykirkmrkvokI7WVn1lcD9wpdFCKfVyYmE2xRdFC4mCY2ykCgaEfp/gTGhbX4pfx1FaQUEIyW/bWBUC1oAFIUgjGYdLWgQpwTJesC/4z6Eb00JG6lhpJzGPHVziEx/CZ9qM3N/iGy1pNoTrsd1eAAAAAElFTkSuQmCC"; + const iconCalendar = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACLSURBVDiN7dO9CQJBFEXhb38K0FwQrMNEVpuwB0NjrcYabECsQk0sQ1mTF4zIjrgmBh54MMx998AEwzOrmC5e8gJjbDHCJO7PHYI0v2JT4Ig9DljGwq5DkOZTLOCOMoIhBpknpHmFWx3ldaaUo6oTc2/ab7rl+508f8GvCC5oenTn4tM1cWg/nBNmD4fBH/Kfvt2TAAAAAElFTkSuQmCC"; + const iconLock = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAWQAAAFkBqp2phgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACQSURBVDiN7dKxDcJQDATQJ0YgXQQ1bAgDEIZBETPQwjakIjRQ8CMSyR8SiZKTrvHZd/r+JsYSNZrEI1ZR4ywzfElcJ55xwiITOECNTVDf4jDGoEEZ1Etcxxg8pmjRDiahb7BH20uKKPVUkVmL+YjQArdI+PT2bO9Pd/A34O71Rd9QeN/LAFUSckfUscWuG3oCgP8nrDH6T5AAAAAASUVORK5CYII="; + const iconAbc = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAB2AAAAdgFOeyYIAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAMRJREFUOI3t0bFKAmAUBeAPURD1HQwUTKPJEmzQoSWQcKpVfIuWdvU9WnqNhsYWBx0a2lvLSMKGbvQ7SO564HA497/3cu/92SPFAS5QDN9CftviDhZYYRpNPtH/rzATOsQT6jhCFzmc4DTJL6AX067hPiimuAr95RglzMJ/4AyyUXSMw3iEauhN6C0eUEMFAyzTFZ7xiOvwL3jbsPYSr3hPg3dB/o43SVYY+TnsPPwXztMG5SDr39dGM8kr4RKNDdPtJL4BNXEmsdKC+S4AAAAASUVORK5CYII="; + const icon123 = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAB2AAAAdgFOeyYIAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAMxJREFUOI3t0bFKwlEUBvBfmmBEr1APIDZJ9AJJQyAIvkGP0C4uQruza+DUmuIc9AC9gBG4Nmpkw/8IB3Vw1w8u95zvnvPde77LEeUUV9HAF67QRA2nmMf5A+o4x3cWOsMYy8j7WMX6jaYbLBL/mAWe8RcHm1ihs8G94gVKQQzwlAouMcQo8p/Y28HdYpYFZmsi0MVdxD1MdrxsC500wijdvgtbI1AYtDbxMwkuFAZmE1uYwkkSqOIaHyHcxEU0vUXNPSqKr37fZ6xDwD9DPS0OyHjQHQAAAABJRU5ErkJggg=="; + const iconMail = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAC4SURBVDiNxdIxagJRFIXhLzLFBNJYaJslSEylWOhq3IorMGQ16SyjYCFiZWU5pTaDFvOUyTAZ8RHID69555577oXLf/OEGaY4R3g/4IhORHg3eOXYYvSAeRQ8OWQYYoNPvDQYnxUr7zBB1grCAv3QbIlxjXmAb7Txhq+rkFUKq9NUU8vcJiizwDtOWGEdmvTKqT+61H0GXsP7jSxpEGF/R1e3wkO0FBeVRnhTSBTneBB3yvOI4D/mAnvrIwKM5s4AAAAAAElFTkSuQmCC"; + const iconInfo = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAASVJREFUOI190r0uhFEQBuBnVxaF2PUTCkFchV0SV6BQi0rEbShFlCqNktJP0Iqf3i3YVSlXVEQozojP8e2+ySSTed+ZMzNnKnpjCFPhv+C9j/YPlnCBV3TCujhHq19iFftoYxOjBa4esTb2QvsP+7jFWJ9HxnEXRf5gGU9Z8gKucBl+sUgHTahE8AJnOCoIT/AcmhmsF7gtrGINBqWFFWcmLXMUhzjIuEbk1GA+2i/DNh4wUsK1MVfFV2GUHJO4xlsPHr8j1Eu44bAcDek2agP4lDZaxWMm3MEKbrL4hjT/8U+gJc00nglnw4qYkL5xMW9rTzqSvEiefI/dMrIaRTrSPzcKXCNinUguPeUfNKWj6kqH9Bz+aVnbvb6PtKTp8F/wUSb6Bu5YN5n7ff0kAAAAAElFTkSuQmCC"; + const iconSuccess = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAQtJREFUOI2F0jFOAlEQBuAPImoFqyTa6TEEbfUihruYDYfwCAg3UDsTY20na0VjgqUWWuxgHsuy/skk82bmn/fPm9eyHXs4Cn+Br4baNZxjhk8UYUtMMWwitjHGHNfoJrlexObIo3YDY9zjoOGSQzxEkzVc4O0fctqkwCANzkJiE9LmI9ytDrvKB+tWGQnylIAsOB04VcrfdluO55CeYo6THfygVUne4jX8S1zho1LTDu7fCL2KxCe8oF8zUqb8G51VYGrzEffD6jDCJA0MY6bqnHXoK9d4Vk3kyk/S1KSPR9zUJdvRpAiJWZLLIlYEufYrrzBQ7nyJ97ClcuYN2dX1pejgOPwFvuuKfgHXiDR+HL1j1AAAAABJRU5ErkJggg=="; + const iconError = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAARZJREFUOI2V0j1KQ1EQBeDPp4lWRiMoKVyAK9AoiLgJGytxD9oJNhKyDyvBnw2IugC3YGKVRk1KRbR48yC5vjzwwIHL3DPnzp2ZGdMxj9U4D/BZoZ3ANu4wQj84xC3aVYkZuujhCItjd42I9dAJ7R908YDlikeaeAyTCezgpST5IJia9LFVlA0nOMd7It4IjuMttKeFQR17uKooPcUV9lHL0ArX0T8MPqLa1hx+MDNFWDX7LHLV4/VGiWghmGJJvhu1WXzLO5rhORGeYRf3SfwQNVwWgbZ8SZqJcD04jhX5GDfTsjryJUlN0uQnXJRdZmHSx7H8nwWWItaP5NJVLrCFG3mTXoNDXJeVPW185E1ai/MAX2WiX9S3NSPYbj+uAAAAAElFTkSuQmCC"; + const iconWarning = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAARJJREFUOI2l0r8uRFEQBvAfu9glwUYiUaxHUEl0VDpKeq+wpZBINAqFRHgTKg0tCSqVhmKDEM1u/Esodm725rq7iC+ZzMnM982ZmXP4JwpdchWsYBrXeMkj9XQQV3GEi+BMYR63v+mqiDPUUrEaTiP3I1ZxEOcySnE+jFxXVPEQPimWiCYzOdCbKbCFPe1Z+8PgBvvBycVMCIdSsY2wBEPBmcnrYBtraKRib2EJGljHjswLLuI8Z6SS9hLTl15iIR08wZLv2AzLYjk0YATP8n9lVWbrgUJohosYxCdG8Zghdvp5ldCUi6hrPd0VjvGEVzTxEYLkogGMYQ67uEtvcgKzGA8y9IV/D9/Evdb89Q7d/Q1fB8U0mpUmzV0AAAAASUVORK5CYII="; + const iconLeft = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABfSURBVDiNY2AY8oCZSHWxDAwMEgwMDHfJsaSAgYHhH9QQsjT/Z2BgKKe75gQGiLMLCSlkwiHOSI6t6ADmhYoBN6SIARIeidgkiUlIxxkYGB4xMDB8YmBguE6JSwYpAACvLRHTKwPjZgAAAABJRU5ErkJggg=="; + const iconRight = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABNSURBVDiN3dAxCoAwFATRh3fU2oAHiDbi5Y1F2jT+gKLbzyy7/DYjUo8g4cTWI8koOF6XrOqc5ifDDVGJthfsj8OLujtHYJgwR+GP5QKMxA9/SolDQgAAAABJRU5ErkJggg=="; + const iconLLeft = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABlSURBVDiN3ZLBDUBAEEUfmtCchA5woUMlOO1FCQrAwbqwf8eFhHd7mfzJn2Tg82TGvABywAmPUgOLD4XcDK9AJ/y5cOlrNsIvpCdPDL/FUbkX/t6Slv3+SjgQf6QBmIAZGAP+FzZJViOd89x8pAAAAABJRU5ErkJggg=="; + const iconRRight = + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABmSURBVDiN3dGxCoAgEMbxfz1dL1BTREJzmUv08trgDYcg6VCD3/YD7zvkoLmMgFEegLmmwAAecOJVvNeUWCAAt7IHjt9LThkyiRf9qC8oCom70u0BuDL+bngj/tNm/JqJePucW8wDvGYdzT0nMUkAAAAASUVORK5CYII="; + + // --- UTILITY FUNCTIONS --- + + /** IF */ + ui.If = (condition, thenValue, otherwiseValue = null) => { + return () => { + const isTrue = val(condition); + const result = isTrue ? thenValue : otherwiseValue; + if (typeof result === "function" && !(result instanceof HTMLElement)) { + return result(); + } + return result; + }; + }; + + /** FOR */ + ui.For = (source, render, keyFn) => { + if (typeof keyFn !== "function") throw new Error("SigPro UI: For requires a keyFn."); + + const marker = document.createTextNode(""); + const container = $.html("div", { style: "display:contents" }, [marker]); + const cache = new Map(); + + $.effect(() => { + const items = val(source) || []; + const newKeys = new Set(); + + items.forEach((item, index) => { + const key = keyFn(item, index); + newKeys.add(key); + + let runtime = cache.get(key); + if (!runtime) { + runtime = $.view(() => render(item, index)); + cache.set(key, runtime); + } + container.insertBefore(runtime.container, marker); + }); + + cache.forEach((runtime, key) => { + if (!newKeys.has(key)) { + runtime.destroy(); + cache.delete(key); + } + }); + }); + + return container; + }; + + /** JSON */ + ui.Json = (data, space = 2) => { + return Span({ class: "font-mono whitespace-pre-wrap" }, () => { + try { + return JSON.stringify(val(data), null, space); + } catch (e) { + return "[Error: Circular or Invalid JSON]"; + } + }); + }; + + /** REQ */ + ui.Request = (url, payload = null, options = {}) => { + const data = $(null), + loading = $(false), + error = $(null), + success = $(false); + let abortController = null; + + const execute = async (customPayload = null) => { + const targetUrl = val(url); + if (!targetUrl) return; + + if (abortController) abortController.abort(); + abortController = new AbortController(); + + loading(true); + error(null); + success(false); + try { + const bodyData = customPayload || payload; + const res = await fetch(targetUrl, { + method: options.method || (bodyData ? "POST" : "GET"), + headers: { "Content-Type": "application/json", ...options.headers }, + body: bodyData ? JSON.stringify(bodyData) : null, + signal: abortController.signal, + ...options, + }); + + if (!res.ok) throw new Error(`HTTP ${res.status}`); + + let json = await res.json(); + if (typeof options.transform === "function") json = options.transform(json); + + data(json); + success(true); + } catch (err) { + if (err.name !== "AbortError") error(err.message); + } finally { + loading(false); + } + }; + + $(() => { + execute(); + return () => abortController?.abort(); + }); + + return { data, loading, error, success, reload: (p) => execute(p) }; + }; + + /** RESPONSE */ + ui.Response = (reqObj, renderFn) => + $.html("div", { class: "res-container" }, [ + ui.If(reqObj.loading, $.html("div", { class: "flex justify-center p-4" }, $.html("span", { class: "loading loading-dots text-primary" }))), + ui.If(reqObj.error, () => + $.html("div", { role: "alert", class: "alert alert-error" }, [ + $.html("span", {}, reqObj.error()), + ui.Button({ class: "btn-xs btn-ghost border-current", onclick: () => reqObj.reload() }, "Retry"), + ]), + ), + ui.If(reqObj.success, () => { + const current = reqObj.data(); + return current !== null ? renderFn(current) : null; + }), + ]); + + // --- UI COMPONENTS --- + + /** BUTTON */ + ui.Button = (props, children) => { + const { badge, badgeClass, tooltip, icon, $loading, ...rest } = props; + const btn = $.html( + "button", + { + ...rest, + class: joinClass("btn", props.$class || props.class), + $disabled: () => val($loading) || val(props.$disabled) || val(props.disabled), + }, + [ + () => (val($loading) ? $.html("span", { class: "loading loading-spinner" }) : null), + icon ? $.html("span", { class: "mr-1" }, icon) : null, + children, + ], + ); + let out = btn; + if (badge) { + out = $.html("div", { class: "indicator" }, [ + $.html("span", { class: joinClass("indicator-item badge", badgeClass || "badge-secondary") }, badge), + out, + ]); + } + return tooltip ? $.html("div", { class: "tooltip", "data-tip": tooltip }, out) : out; + }; + + /** INPUT */ + ui.Input = (props) => { + const { label, tip, $value, $error, isSearch, icon, type = "text", ...rest } = props; + + const isPassword = type === "password"; + const visible = $(false); + + const iconsByType = { + text: iconAbc, + password: iconLock, + date: iconCalendar, + number: icon123, + email: iconMail, + }; + + const inputEl = $.html("input", { + ...rest, + type: () => (isPassword ? (visible() ? "text" : "password") : type), + placeholder: props.placeholder || label || (isSearch ? tt("search")() : " "), + class: joinClass("grow order-2 focus:outline-none", props.$class || props.class), + $value: $value, + oninput: (e) => { + $value?.(e.target.value); + props.oninput?.(e); + }, + $disabled: () => val(props.$disabled) || val(props.disabled), + }); + + const leftIcon = icon ? icon : iconsByType[type] ? $.html("img", { src: iconsByType[type], class: "w-5 h-5 opacity-50", alt: type }) : null; + + return $.html( + "label", + { + class: () => joinClass("input input-bordered floating-label flex items-center gap-2 w-full relative", val($error) ? "input-error" : ""), + }, + [ + leftIcon ? $.html("div", { class: "order-1 shrink-0" }, leftIcon) : null, + label ? $.html("span", { class: "text-base-content/60 order-0" }, label) : null, + inputEl, + isPassword + ? $.html( + "button", + { + type: "button", + class: "order-3 btn btn-ghost btn-xs btn-circle opacity-50 hover:opacity-100", + onclick: (e) => { + e.preventDefault(); + visible(!visible()); + }, + }, + () => + $.html("img", { + class: "w-5 h-5", + src: visible() ? iconShow : iconHide, + }), + ) + : null, + + tip + ? $.html( + "div", + { class: "tooltip tooltip-left order-4", "data-tip": tip }, + $.html("span", { class: "badge badge-ghost badge-xs cursor-help" }, "?"), + ) + : null, + + () => (val($error) ? $.html("span", { class: "text-error text-[10px] absolute -bottom-5 left-2" }, val($error)) : null), + ], + ); + }; + + /** SELECT */ + ui.Select = (props) => { + const { label, options, $value, ...rest } = props; + + const selectEl = $.html( + "select", + { + ...rest, + class: joinClass("select select-bordered w-full", props.$class || props.class), + $value: $value, + onchange: (e) => $value?.(e.target.value), + }, + ui.For( + () => val(options) || [], + (opt) => + $.html( + "option", + { + value: opt.value, + $selected: () => String(val($value)) === String(opt.value), + }, + opt.label, + ), + (opt) => opt.value, + ), + ); + + if (!label) return selectEl; + + return $.html("label", { class: "fieldset-label flex flex-col gap-1" }, [$.html("span", {}, label), selectEl]); + }; + + /** AUTOCOMPLETE */ + ui.Autocomplete = (props) => { + const { options = [], $value, onSelect, label, placeholder, ...rest } = props; + + const query = $(val($value) || ""); + const isOpen = $(false); + const cursor = $(-1); + + const list = $(() => { + const q = query().toLowerCase(); + const data = val(options) || []; + return q ? data.filter((o) => (typeof o === "string" ? o : o.label).toLowerCase().includes(q)) : data; + }); + + const pick = (opt) => { + const valStr = typeof opt === "string" ? opt : opt.value; + const labelStr = typeof opt === "string" ? opt : opt.label; + + query(labelStr); + if (typeof $value === "function") $value(valStr); + onSelect?.(opt); + + isOpen(false); + cursor(-1); + }; + + const nav = (e) => { + const items = list(); + if (e.key === "ArrowDown") { + e.preventDefault(); + isOpen(true); + cursor(Math.min(cursor() + 1, items.length - 1)); + } else if (e.key === "ArrowUp") { + e.preventDefault(); + cursor(Math.max(cursor() - 1, 0)); + } else if (e.key === "Enter" && cursor() >= 0) { + e.preventDefault(); + pick(items[cursor()]); + } else if (e.key === "Escape") { + isOpen(false); + } + }; + + return $.html("div", { class: "relative w-full" }, [ + ui.Input({ + label, + placeholder: placeholder || tt("search")(), + $value: query, + onfocus: () => isOpen(true), + onblur: () => setTimeout(() => isOpen(false), 150), + onkeydown: nav, + oninput: (e) => { + const v = e.target.value; + query(v); + if (typeof $value === "function") $value(v); + isOpen(true); + cursor(-1); + }, + ...rest, + }), + $.html( + "ul", + { + class: "absolute left-0 w-full menu bg-base-100 rounded-box mt-1 p-2 shadow-xl max-h-60 overflow-y-auto border border-base-300 z-50", + style: () => (isOpen() && list().length ? "display:block" : "display:none"), + }, + [ + ui.For( + list, + (opt, i) => + $.html("li", {}, [ + $.html( + "a", + { + class: () => `block w-full ${cursor() === i ? "active bg-primary text-primary-content" : ""}`, + onclick: () => pick(opt), + onmouseenter: () => cursor(i), + }, + typeof opt === "string" ? opt : opt.label, + ), + ]), + (opt, i) => (typeof opt === "string" ? opt : opt.value) + i, + ), + () => (list().length ? null : $.html("li", { class: "p-2 text-center opacity-50" }, "No results")), + ], + ), + ]); + }; + + /** DATEPICKER */ + ui.Datepicker = (props) => { + const { $value, range, label, placeholder, ...rest } = props; + + const isOpen = $(false); + const internalDate = $(new Date()); + const hoverDate = $(null); + const isRangeMode = () => val(range) === true; + + const now = new Date(); + const todayStr = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}`; + + const formatDate = (d) => { + const year = d.getFullYear(); + const month = String(d.getMonth() + 1).padStart(2, "0"); + const day = String(d.getDate()).padStart(2, "0"); + return `${year}-${month}-${day}`; + }; + + const selectDate = (date) => { + const dateStr = formatDate(date); + const current = val($value); + + if (isRangeMode()) { + if (!current?.start || (current.start && current.end)) { + if (typeof $value === "function") $value({ start: dateStr, end: null }); + } else { + const start = current.start; + if (typeof $value === "function") { + $value(dateStr < start ? { start: dateStr, end: start } : { start, end: dateStr }); + } + isOpen(false); + } + } else { + if (typeof $value === "function") $value(dateStr); + isOpen(false); + } + }; + + const displayValue = $(() => { + const v = val($value); + if (!v) return ""; + if (typeof v === "string") return v; + if (v.start && v.end) return `${v.start} - ${v.end}`; + if (v.start) return `${v.start}...`; + return ""; + }); + + const move = (m) => { + const d = internalDate(); + internalDate(new Date(d.getFullYear(), d.getMonth() + m, 1)); + }; + + const moveYear = (y) => { + const d = internalDate(); + internalDate(new Date(d.getFullYear() + y, d.getMonth(), 1)); + }; + + return $.html("div", { class: "relative w-full" }, [ + ui.Input({ + label, + placeholder: placeholder || (isRangeMode() ? "Seleccionar rango..." : "Seleccionar fecha..."), + $value: displayValue, + readonly: true, + icon: $.html("img", { src: iconCalendar, class: "opacity-40" }), + onclick: (e) => { + e.stopPropagation(); + isOpen(!isOpen()); + }, + ...rest, + }), + + ui.If(isOpen, () => + $.html( + "div", + { + class: "absolute left-0 mt-2 p-4 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[100] w-80 select-none", + onclick: (e) => e.stopPropagation(), + }, + [ + $.html("div", { class: "flex justify-between items-center mb-4 gap-1" }, [ + $.html("div", { class: "flex gap-0.5" }, [ + $.html( + "button", + { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => moveYear(-1) }, + $.html("img", { src: iconLLeft, class: "opacity-40" }), + ), + $.html( + "button", + { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => move(-1) }, + $.html("img", { src: iconLeft, class: "opacity-40" }), + ), + ]), + $.html("span", { class: "font-bold uppercase flex-1 text-center" }, [ + () => internalDate().toLocaleString("es-ES", { month: "short", year: "numeric" }), + ]), + $.html("div", { class: "flex gap-0.5" }, [ + $.html( + "button", + { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => move(1) }, + $.html("img", { src: iconRight, class: "opacity-40" }), + ), + $.html( + "button", + { type: "button", class: "btn btn-ghost btn-xs px-1", onclick: () => moveYear(1) }, + $.html("img", { src: iconRRight, class: "opacity-40" }), + ), + ]), + ]), + + $.html("div", { class: "grid grid-cols-7 gap-1", onmouseleave: () => hoverDate(null) }, [ + ...["L", "M", "X", "J", "V", "S", "D"].map((d) => $.html("div", { class: "text-[10px] opacity-40 font-bold text-center" }, d)), + () => { + const d = internalDate(); + const year = d.getFullYear(); + const month = d.getMonth(); + const firstDay = new Date(year, month, 1).getDay(); + const offset = firstDay === 0 ? 6 : firstDay - 1; + const daysInMonth = new Date(year, month + 1, 0).getDate(); + + const nodes = []; + for (let i = 0; i < offset; i++) nodes.push($.html("div")); + + for (let i = 1; i <= daysInMonth; i++) { + const date = new Date(year, month, i); + const dStr = formatDate(date); + + nodes.push( + $.html( + "button", + { + type: "button", + class: () => { + const v = val($value); + const h = hoverDate(); + const isStart = typeof v === "string" ? v === dStr : v?.start === dStr; + const isEnd = v?.end === dStr; + let inRange = false; + + if (isRangeMode() && v?.start) { + const start = v.start; + if (!v.end && h) { + inRange = (dStr > start && dStr <= h) || (dStr < start && dStr >= h); + } else if (v.end) { + inRange = dStr > start && dStr < v.end; + } + } + + const base = "btn btn-xs p-0 aspect-square min-h-0 h-auto font-normal relative"; + const state = isStart || isEnd ? "btn-primary z-10" : inRange ? "bg-primary/20 border-none rounded-none" : "btn-ghost"; + const today = dStr === todayStr ? "ring-1 ring-primary ring-inset font-black text-primary" : ""; + + return `${base} ${state} ${today}`; + }, + onmouseenter: () => { + if (isRangeMode()) hoverDate(dStr); + }, + onclick: () => selectDate(date), + }, + [i.toString()], + ), + ); + } + return nodes; + }, + ]), + ], + ), + ), + + ui.If(isOpen, () => $.html("div", { class: "fixed inset-0 z-[90]", onclick: () => isOpen(false) })), + ]); + }; + + /** COLORPICKER */ + ui.Colorpicker = (props) => { + const { $value, label, ...rest } = props; + const isOpen = $(false); + + const palette = [ + ...["#000", "#1A1A1A", "#333", "#4D4D4D", "#666", "#808080", "#B3B3B3", "#FFF"], + ...["#450a0a", "#7f1d1d", "#991b1b", "#b91c1c", "#dc2626", "#ef4444", "#f87171", "#fca5a5"], + ...["#431407", "#7c2d12", "#9a3412", "#c2410c", "#ea580c", "#f97316", "#fb923c", "#ffedd5"], + ...["#713f12", "#a16207", "#ca8a04", "#eab308", "#facc15", "#fde047", "#fef08a", "#fff9c4"], + ...["#064e3b", "#065f46", "#059669", "#10b981", "#34d399", "#4ade80", "#84cc16", "#d9f99d"], + ...["#082f49", "#075985", "#0284c7", "#0ea5e9", "#38bdf8", "#7dd3fc", "#22d3ee", "#cffafe"], + ...["#1e1b4b", "#312e81", "#4338ca", "#4f46e5", "#6366f1", "#818cf8", "#a5b4fc", "#e0e7ff"], + ...["#2e1065", "#4c1d95", "#6d28d9", "#7c3aed", "#8b5cf6", "#a855f7", "#d946ef", "#fae8ff"], + ]; + + const getColor = () => val($value) || "#000000"; + + return $.html("div", { class: "relative w-fit" }, [ + $.html( + "button", + { + type: "button", + class: "btn px-3 bg-base-100 border-base-300 hover:border-primary/50 flex items-center gap-2 shadow-sm font-normal normal-case", + onclick: (e) => { + e.stopPropagation(); + isOpen(!isOpen()); + }, + ...rest, + }, + [ + $.html("div", { + class: "size-5 rounded-sm shadow-inner border border-black/10 shrink-0", + style: () => `background-color: ${getColor()}`, + }), + label ? $.html("span", { class: "opacity-80" }, label) : null, + ], + ), + + ui.If(isOpen, () => + $.html( + "div", + { + class: "absolute left-0 mt-2 p-3 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[110] w-64 select-none", + onclick: (e) => e.stopPropagation(), + }, + [ + $.html( + "div", + { class: "grid grid-cols-8 gap-1" }, + palette.map((c) => + $.html("button", { + type: "button", + style: `background-color: ${c}`, + class: () => { + const active = getColor().toLowerCase() === c.toLowerCase(); + return `size-6 rounded-sm cursor-pointer transition-all hover:scale-125 hover:z-10 active:scale-95 outline-none border border-black/5 + ${active ? "ring-2 ring-offset-1 ring-primary z-10 scale-110" : ""}`; + }, + onclick: () => { + $value(c); + isOpen(false); + }, + }), + ), + ), + ], + ), + ), + + ui.If(isOpen, () => + $.html("div", { + class: "fixed inset-0 z-[100]", + onclick: () => isOpen(false), + }), + ), + ]); + }; + + /** CHECKBOX */ + ui.CheckBox = (props) => { + const { $value, tooltip, toggle, ...rest } = props; + const checkEl = $.html("input", { + ...rest, + type: "checkbox", + class: () => (val(toggle) ? "toggle" : "checkbox"), + $checked: $value, + onchange: (e) => $value?.(e.target.checked), + }); + + const layout = $.html("label", { class: "label cursor-pointer justify-start gap-3" }, [ + checkEl, + props.label ? $.html("span", { class: "label-text" }, props.label) : null, + ]); + + return tooltip ? $.html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout; + }; + + /** RADIO */ + ui.Radio = (props) => { + const { label, tooltip, $value, value, ...rest } = props; + + const radioEl = $.html("input", { + ...rest, + type: "radio", + class: joinClass("radio", props.$class || props.class), + $checked: () => val($value) === value, + $disabled: () => val(props.$disabled) || val(props.disabled), + onclick: () => typeof $value === "function" && $value(value), + }); + + if (!label && !tooltip) return radioEl; + + const layout = $.html("label", { class: "label cursor-pointer justify-start gap-3" }, [ + radioEl, + label ? $.html("span", { class: "label-text" }, label) : null, + ]); + + return tooltip ? $.html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout; + }; + + /** RANGE */ + ui.Range = (props) => { + const { label, tooltip, $value, ...rest } = props; + + const rangeEl = $.html("input", { + ...rest, + type: "range", + class: joinClass("range", props.$class || props.class), + $value: $value, + $disabled: () => val(props.$disabled) || val(props.disabled), + oninput: (e) => typeof $value === "function" && $value(e.target.value), + }); + + if (!label && !tooltip) return rangeEl; + + const layout = $.html("div", { class: "flex flex-col gap-2" }, [label ? $.html("span", { class: "label-text" }, label) : null, rangeEl]); + + return tooltip ? $.html("div", { class: "tooltip", "data-tip": tooltip }, layout) : layout; + }; + + /** MODAL */ + ui.Modal = (props, children) => { + const { title, buttons, $open, ...rest } = props; + const close = () => $open(false); + + return ui.If($open, () => + $.html("dialog", { ...rest, class: "modal modal-open" }, [ + $.html("div", { class: "modal-box" }, [ + title ? $.html("h3", { class: "text-lg font-bold mb-4" }, title) : null, + typeof children === "function" ? children() : children, + $.html("div", { class: "modal-action flex gap-2" }, [ + ...(Array.isArray(buttons) ? buttons : [buttons]).filter(Boolean), + ui.Button({ onclick: close }, tt("close")()), + ]), + ]), + $.html( + "form", + { + method: "dialog", + class: "modal-backdrop", + onclick: (e) => (e.preventDefault(), close()), + }, + [$.html("button", {}, "close")], + ), + ]), + ); + }; + + /** GRID */ + ui.Grid = (props) => { + const { data, options, class: className } = props; + let gridApi = null; + + const container = $.html("div", { + style: "height: 100%; width: 100%;", + class: className, + }); + + const observer = new MutationObserver(() => { + if (gridApi) gridApi.setGridOption("theme", getTheme(isDark())); + }); + + observer.observe(document.documentElement, { + attributes: true, + attributeFilter: ["data-theme"], + }); + + container._cleanups.add(() => observer.disconnect()); + + const stopGrid = $.effect(() => { + const dark = isDark(); + const agTheme = getTheme(dark); + const rowData = val(data) || []; + + if (!gridApi) { + gridApi = createGrid(container, { + ...(val(options) || {}), + theme: agTheme, + rowData: rowData, + }); + } else { + gridApi.setGridOption("theme", agTheme); + } + }); + container._cleanups.add(stopGrid); + + const stopData = $.effect(() => { + const rowData = val(data); + if (gridApi && Array.isArray(rowData)) { + gridApi.setGridOption("rowData", rowData); + } + }); + container._cleanups.add(stopData); + + container._cleanups.add(() => { + if (gridApi) { + gridApi.destroy(); + gridApi = null; + } + }); + + return container; + }; + + /** DROPDOWN */ + ui.Dropdown = (props, children) => { + const { label, icon, ...rest } = props; + + return $.html( + "div", + { + ...rest, + class: () => `dropdown ${val(props.$class) || props.class || ""}`, + }, + [ + $.html( + "div", + { + tabindex: 0, + role: "button", + class: "btn m-1 flex items-center gap-2", + }, + [icon ? (typeof icon === "function" ? icon() : icon) : null, label ? (typeof label === "function" ? label() : label) : null], + ), + $.html( + "ul", + { + tabindex: 0, + class: "dropdown-content z-[50] menu p-2 shadow bg-base-100 rounded-box min-w-max border border-base-300", + }, + [typeof children === "function" ? children() : children], + ), + ], + ); + }; + + /** ACCORDION */ + ui.Accordion = (props, children) => { + const { title, name, $open, open, ...rest } = props; + + return $.html( + "div", + { + ...rest, + class: joinClass("collapse collapse-arrow bg-base-200 mb-2", props.$class || props.class), + }, + [ + $.html("input", { + type: name ? "radio" : "checkbox", + name: name, + $checked: () => val($open) || val(open), + onchange: (e) => typeof $open === "function" && $open(e.target.checked), + }), + $.html("div", { class: "collapse-title text-xl font-medium" }, title), + $.html("div", { class: "collapse-content" }, children), + ], + ); + }; + + /** TABS */ + ui.Tabs = (props) => { + const { items, ...rest } = props; + const itemsSignal = typeof items === "function" ? items : () => items || []; + + return $.html("div", { ...rest, class: "flex flex-col gap-4 w-full" }, [ + $.html( + "div", + { + role: "tablist", + class: joinClass("tabs tabs-box", props.$class || props.class), + }, + ui.For( + itemsSignal, + (it) => + $.html( + "a", + { + role: "tab", + class: () => joinClass("tab", val(it.active) && "tab-active", val(it.disabled) && "tab-disabled", it.tip && "tooltip"), + "data-tip": it.tip, + onclick: (e) => !val(it.disabled) && it.onclick?.(e), + }, + it.label, + ), + (t) => t.label, + ), + ), + () => { + const active = itemsSignal().find((it) => val(it.active)); + if (!active) return null; + const content = val(active.content); + return $.html("div", { class: "p-4" }, [typeof content === "function" ? content() : content]); + }, + ]); + }; + + /** BADGE */ + ui.Badge = (props, children) => $.html("span", { ...props, class: joinClass("badge", props.$class || props.class) }, children); + + /** TOOLTIP */ + ui.Tooltip = (props, children) => + $.html("div", { ...props, class: joinClass("tooltip", props.$class || props.class), "data-tip": props.tip }, children); + + /** NAVBAR */ + ui.Navbar = (props, children) => + $.html("div", { ...props, class: joinClass("navbar bg-base-100 shadow-sm px-4", props.$class || props.class) }, children); + + /** MENU */ + ui.Menu = (props) => { + const renderItems = (items) => + ui.For( + () => items || [], + (it) => + $.html("li", {}, [ + it.children + ? $.html("details", { open: it.open }, [ + $.html("summary", {}, [it.icon && $.html("span", { class: "mr-2" }, it.icon), it.label]), + $.html("ul", {}, renderItems(it.children)), + ]) + : $.html("a", { class: () => (val(it.active) ? "active" : ""), onclick: it.onclick }, [ + it.icon && $.html("span", { class: "mr-2" }, it.icon), + it.label, + ]), + ]), + (it, i) => it.label || i, + ); + + return $.html("ul", { ...props, class: joinClass("menu bg-base-200 rounded-box", props.$class || props.class) }, renderItems(props.items)); + }; + + /** DRAWER */ + ui.Drawer = (props) => + $.html("div", { class: joinClass("drawer", props.$class || props.class) }, [ + $.html("input", { + id: props.id, + type: "checkbox", + class: "drawer-toggle", + $checked: props.$open, + }), + $.html("div", { class: "drawer-content" }, props.content), + $.html("div", { class: "drawer-side" }, [ + $.html("label", { for: props.id, class: "drawer-overlay", onclick: () => props.$open?.(false) }), + $.html("div", { class: "min-h-full bg-base-200 w-80" }, props.side), + ]), + ]); + + /** FIELDSET */ + ui.Fieldset = (props, children) => + $.html( + "fieldset", + { + ...props, + class: joinClass("fieldset bg-base-200 border border-base-300 p-4 rounded-lg", props.$class || props.class), + }, + [ + () => { + const legendText = val(props.legend); + return legendText ? $.html("legend", { class: "fieldset-legend font-bold" }, [legendText]) : null; + }, + children, + ], + ); + + /** LIST */ + ui.List = (props) => { + const { items, header, render, keyFn, class: className } = props; + + return $.html( + "ul", + { + class: joinClass("list bg-base-100 rounded-box shadow-md", className), + }, + [ + ui.If(header, () => $.html("li", { class: "p-4 pb-2 text-xs opacity-60 tracking-wide" }, [val(header)])), + ui.For(items, (item, index) => $.html("li", { class: "list-row" }, [render(item, index)]), keyFn), + ], + ); + }; + + /** STACK */ + ui.Stack = (props, children) => $.html("div", { ...props, class: joinClass("stack", props.$class || props.class) }, children); + + /** STAT */ + ui.Stat = (props) => + $.html("div", { ...props, class: joinClass("stat", props.$class || props.class) }, [ + props.icon && $.html("div", { class: "stat-figure text-secondary" }, props.icon), + props.label && $.html("div", { class: "stat-title" }, props.label), + $.html("div", { class: "stat-value" }, () => val(props.$value) ?? props.value), + props.desc && $.html("div", { class: "stat-desc" }, props.desc), + ]); + + /** SWAP */ + ui.Swap = (props) => + $.html("label", { class: joinClass("swap", props.$class || props.class) }, [ + $.html("input", { + type: "checkbox", + $checked: props.$value, + onchange: (e) => props.$value?.(e.target.checked), + }), + $.html("div", { class: "swap-on" }, props.on), + $.html("div", { class: "swap-off" }, props.off), + ]); + + /** INDICATOR */ + ui.Indicator = (props, children) => + $.html("div", { class: joinClass("indicator", props.$class || props.class) }, [ + children, + $.html("span", { class: joinClass("indicator-item badge", props.badgeClass) }, props.badge), + ]); + + /** RATING */ + ui.Rating = (props) => { + const { $value, count = 5, name = `rating-${Math.random().toString(36).slice(2, 7)}`, mask = "mask-star", readonly = false, ...rest } = props; + + return $.html( + "div", + { + ...rest, + class: () => `rating ${val(readonly) ? "pointer-events-none" : ""} ${props.class || ""}`, + }, + Array.from({ length: val(count) }, (_, i) => { + const ratingValue = i + 1; + return $.html("input", { + type: "radio", + name: name, + class: `mask ${mask}`, + "aria-label": `${ratingValue} star`, + checked: () => Math.round(val($value)) === ratingValue, + onchange: () => { + if (!val(readonly) && typeof $value === "function") { + $value(ratingValue); + } + }, + }); + }), + ); + }; + + /** ALERT */ + ui.Alert = (props, children) => { + const { type = "info", soft = true, ...rest } = props; + const icons = { + info: iconInfo, + success: iconSuccess, + warning: iconWarning, + error: iconError, + }; + + const typeClass = () => { + const t = val(type); + const map = { + info: "alert-info", + success: "alert-success", + warning: "alert-warning", + error: "alert-error", + }; + return map[t] || t; + }; + + const content = children || props.message; + + return $.html( + "div", + { + ...rest, + role: "alert", + class: () => `alert ${typeClass()} ${val(soft) ? "alert-soft" : ""} ${props.class || ""}`, + }, + [ + $.html("img", { + src: icons[val(type)] || icons.info, + class: "w-4 h-4 object-contain", + alt: val(type), + }), + $.html("div", { class: "flex-1" }, [$.html("span", {}, [typeof content === "function" ? content() : content])]), + props.actions ? $.html("div", { class: "flex-none" }, [typeof props.actions === "function" ? props.actions() : props.actions]) : null, + ], + ); + }; + + /** TIMELINE */ + ui.Timeline = (props) => { + const { items = [], vertical = true, compact = false, ...rest } = props; + + const icons = { + info: iconInfo, + success: iconSuccess, + warning: iconWarning, + error: iconError, + }; + + return $.html( + "ul", + { + ...rest, + class: () => + `timeline ${val(vertical) ? "timeline-vertical" : "timeline-horizontal"} ${val(compact) ? "timeline-compact" : ""} ${props.class || ""}`, + }, + [ + ui.For( + items, + (item, i) => { + const isFirst = i === 0; + const isLast = i === val(items).length - 1; + const itemType = item.type || "success"; + const renderSlot = (content) => (typeof content === "function" ? content() : content); + + return $.html("li", { class: "flex-1" }, [ + !isFirst ? $.html("hr", { class: item.completed ? "bg-primary" : "" }) : null, + $.html("div", { class: "timeline-start" }, [renderSlot(item.title)]), + $.html("div", { class: "timeline-middle" }, [ + $.html("img", { + src: icons[itemType] || item.icon || icons.success, + class: "w-4 h-4 object-contain mx-1", + alt: itemType, + }), + ]), + $.html("div", { class: "timeline-end timeline-box shadow-sm" }, [renderSlot(item.detail)]), + !isLast ? $.html("hr", { class: item.completed ? "bg-primary" : "" }) : null, + ]); + }, + (item, i) => item.id || i, + ), + ], + ); + }; + + /** FAB */ + ui.Fab = (props) => { + const { icon, label, actions = [], position = "bottom-6 right-6", ...rest } = props; + + return $.html( + "div", + { + ...rest, + class: () => `fab fixed ${val(position)} flex flex-col-reverse items-end gap-3 z-[100] ${props.class || ""}`, + }, + [ + $.html( + "div", + { + tabindex: 0, + role: "button", + class: "btn btn-lg btn-circle btn-primary shadow-2xl", + }, + [icon ? (typeof icon === "function" ? icon() : icon) : null, !icon && label ? label : null], + ), + + ...val(actions).map((act) => + $.html("div", { class: "flex items-center gap-3 transition-all duration-300" }, [ + act.label ? $.html("span", { class: "badge badge-ghost shadow-sm whitespace-nowrap" }, act.label) : null, + $.html( + "button", + { + type: "button", + class: `btn btn-circle shadow-lg ${act.class || ""}`, + onclick: (e) => { + e.stopPropagation(); + act.onclick?.(e); + }, + }, + [act.icon ? (typeof act.icon === "function" ? act.icon() : act.icon) : act.text || ""], + ), + ]), + ), + ], + ); + }; + + /** TOAST */ + ui.Toast = (message, type = "alert-success", duration = 3500) => { + let container = document.getElementById("sigpro-toast-container"); + if (!container) { + container = $.html("div", { + id: "sigpro-toast-container", + class: "fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2", + }); + document.body.appendChild(container); + } + + const runtime = $.view(() => { + const el = $.html( + "div", + { + class: `alert alert-soft ${type} shadow-lg transition-all duration-300 translate-x-10 opacity-0`, + }, + [ + $.html("span", typeof message === "function" ? message() : message), + ui.Button( + { + class: "btn-xs btn-circle btn-ghost", + onclick: () => remove(), + }, + "βœ•", + ), + ], + ); + + const remove = () => { + el.classList.add("translate-x-full", "opacity-0"); + setTimeout(() => { + runtime.destroy(); + if (!container.hasChildNodes()) container.remove(); + }, 300); + }; + + setTimeout(remove, duration); + return el; + }); + + container.appendChild(runtime.container); + requestAnimationFrame(() => { + const el = runtime.container.firstElementChild; + if (el) el.classList.remove("translate-x-10", "opacity-0"); + }); + }; + + /** LOADING */ + ui.Loading = (props) => { + return ui.If(props.$show, () => + $.html("div", { class: "fixed inset-0 z-[100] flex items-center justify-center backdrop-blur-sm bg-base-100/30" }, [ + $.html("span", { class: "loading loading-spinner loading-lg text-primary" }), + ]), + ); + }; + + ui.tt = tt; + Object.keys(ui).forEach((key) => { + window[key] = ui[key]; + $[key] = ui[key]; + }); + + return ui; +}; diff --git a/UI/sigpro-ui.min.js b/UI/sigpro-ui.min.js new file mode 100644 index 0000000..5d09ade --- /dev/null +++ b/UI/sigpro-ui.min.js @@ -0,0 +1 @@ +export const UI=(t,e="es")=>{const l={},a={es:{close:"Cerrar",confirm:"Confirmar",cancel:"Cancelar",search:"Buscar...",loading:"Cargando..."},en:{close:"Close",confirm:"Confirm",cancel:"Cancel",search:"Search...",loading:"Loading..."}},s=t(e);l.SetLocale=t=>s(t);const n=t=>()=>a[s()][t]||t,A=t=>"function"==typeof t?t():t,o=(t,e)=>"function"==typeof e?()=>`${t} ${e()||""}`.trim():`${t} ${e||""}`.trim(),c="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACLSURBVDiN7dO9CQJBFEXhb38K0FwQrMNEVpuwB0NjrcYabECsQk0sQ1mTF4zIjrgmBh54MMx998AEwzOrmC5e8gJjbDHCJO7PHYI0v2JT4Ig9DljGwq5DkOZTLOCOMoIhBpknpHmFWx3ldaaUo6oTc2/ab7rl+508f8GvCC5oenTn4tM1cWg/nBNmD4fBH/Kfvt2TAAAAAElFTkSuQmCC",r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAASVJREFUOI190r0uhFEQBuBnVxaF2PUTCkFchV0SV6BQi0rEbShFlCqNktJP0Iqf3i3YVSlXVEQozojP8e2+ySSTed+ZMzNnKnpjCFPhv+C9j/YPlnCBV3TCujhHq19iFftoYxOjBa4esTb2QvsP+7jFWJ9HxnEXRf5gGU9Z8gKucBl+sUgHTahE8AJnOCoIT/AcmhmsF7gtrGINBqWFFWcmLXMUhzjIuEbk1GA+2i/DNh4wUsK1MVfFV2GUHJO4xlsPHr8j1Eu44bAcDek2agP4lDZaxWMm3MEKbrL4hjT/8U+gJc00nglnw4qYkL5xMW9rTzqSvEiefI/dMrIaRTrSPzcKXCNinUguPeUfNKWj6kqH9Bz+aVnbvb6PtKTp8F/wUSb6Bu5YN5n7ff0kAAAAAElFTkSuQmCC",i="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAQtJREFUOI2F0jFOAlEQBuAPImoFqyTa6TEEbfUihruYDYfwCAg3UDsTY20na0VjgqUWWuxgHsuy/skk82bmn/fPm9eyHXs4Cn+Br4baNZxjhk8UYUtMMWwitjHGHNfoJrlexObIo3YDY9zjoOGSQzxEkzVc4O0fctqkwCANzkJiE9LmI9ytDrvKB+tWGQnylIAsOB04VcrfdluO55CeYo6THfygVUne4jX8S1zho1LTDu7fCL2KxCe8oF8zUqb8G51VYGrzEffD6jDCJA0MY6bqnHXoK9d4Vk3kyk/S1KSPR9zUJdvRpAiJWZLLIlYEufYrrzBQ7nyJ97ClcuYN2dX1pejgOPwFvuuKfgHXiDR+HL1j1AAAAABJRU5ErkJggg==",d="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAARZJREFUOI2V0j1KQ1EQBeDPp4lWRiMoKVyAK9AoiLgJGytxD9oJNhKyDyvBnw2IugC3YGKVRk1KRbR48yC5vjzwwIHL3DPnzp2ZGdMxj9U4D/BZoZ3ANu4wQj84xC3aVYkZuujhCItjd42I9dAJ7R908YDlikeaeAyTCezgpST5IJia9LFVlA0nOMd7It4IjuMttKeFQR17uKooPcUV9lHL0ArX0T8MPqLa1hx+MDNFWDX7LHLV4/VGiWghmGJJvhu1WXzLO5rhORGeYRf3SfwQNVwWgbZ8SZqJcD04jhX5GDfTsjryJUlN0uQnXJRdZmHSx7H8nwWWItaP5NJVLrCFG3mTXoNDXJeVPW185E1ai/MAX2WiX9S3NSPYbj+uAAAAAElFTkSuQmCC",m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAnXAAAJ1wGxbhe3AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAARJJREFUOI2l0r8uRFEQBvAfu9glwUYiUaxHUEl0VDpKeq+wpZBINAqFRHgTKg0tCSqVhmKDEM1u/Esodm725rq7iC+ZzMnM982ZmXP4JwpdchWsYBrXeMkj9XQQV3GEi+BMYR63v+mqiDPUUrEaTiP3I1ZxEOcySnE+jFxXVPEQPimWiCYzOdCbKbCFPe1Z+8PgBvvBycVMCIdSsY2wBEPBmcnrYBtraKRib2EJGljHjswLLuI8Z6SS9hLTl15iIR08wZLv2AzLYjk0YATP8n9lVWbrgUJohosYxCdG8Zghdvp5ldCUi6hrPd0VjvGEVzTxEYLkogGMYQ67uEtvcgKzGA8y9IV/D9/Evdb89Q7d/Q1fB8U0mpUmzV0AAAAASUVORK5CYII=";return l.If=(t,e,l=null)=>()=>{const a=A(t)?e:l;return"function"!=typeof a||a instanceof HTMLElement?a:a()},l.For=(e,l,a)=>{if("function"!=typeof a)throw new Error("SigPro UI: For requires a keyFn.");const s=document.createTextNode(""),n=t.html("div",{style:"display:contents"},[s]),o=new Map;return t.effect((()=>{const c=A(e)||[],r=new Set;c.forEach(((e,A)=>{const c=a(e,A);r.add(c);let i=o.get(c);i||(i=t.view((()=>l(e,A))),o.set(c,i)),n.insertBefore(i.container,s)})),o.forEach(((t,e)=>{r.has(e)||(t.destroy(),o.delete(e))}))})),n},l.Json=(t,e=2)=>Span({class:"font-mono whitespace-pre-wrap"},(()=>{try{return JSON.stringify(A(t),null,e)}catch(t){return"[Error: Circular or Invalid JSON]"}})),l.Request=(e,l=null,a={})=>{const s=t(null),n=t(!1),o=t(null),c=t(!1);let r=null;const i=async(t=null)=>{const i=A(e);if(i){r&&r.abort(),r=new AbortController,n(!0),o(null),c(!1);try{const e=t||l,A=await fetch(i,{method:a.method||(e?"POST":"GET"),headers:{"Content-Type":"application/json",...a.headers},body:e?JSON.stringify(e):null,signal:r.signal,...a});if(!A.ok)throw new Error(`HTTP ${A.status}`);let o=await A.json();"function"==typeof a.transform&&(o=a.transform(o)),s(o),c(!0)}catch(t){"AbortError"!==t.name&&o(t.message)}finally{n(!1)}}};return t((()=>(i(),()=>r?.abort()))),{data:s,loading:n,error:o,success:c,reload:t=>i(t)}},l.Response=(e,a)=>t.html("div",{class:"res-container"},[l.If(e.loading,t.html("div",{class:"flex justify-center p-4"},t.html("span",{class:"loading loading-dots text-primary"}))),l.If(e.error,(()=>t.html("div",{role:"alert",class:"alert alert-error"},[t.html("span",{},e.error()),l.Button({class:"btn-xs btn-ghost border-current",onclick:()=>e.reload()},"Retry")]))),l.If(e.success,(()=>{const t=e.data();return null!==t?a(t):null}))]),l.Button=(e,l)=>{const{badge:a,badgeClass:s,tooltip:n,icon:c,$loading:r,...i}=e;let d=t.html("button",{...i,class:o("btn",e.$class||e.class),$disabled:()=>A(r)||A(e.$disabled)||A(e.disabled)},[()=>A(r)?t.html("span",{class:"loading loading-spinner"}):null,c?t.html("span",{class:"mr-1"},c):null,l]);return a&&(d=t.html("div",{class:"indicator"},[t.html("span",{class:o("indicator-item badge",s||"badge-secondary")},a),d])),n?t.html("div",{class:"tooltip","data-tip":n},d):d},l.Input=e=>{const{label:l,tip:a,$value:s,$error:r,isSearch:i,icon:d,type:m="text",...h}=e,u="password"===m,g=t(!1),b={text:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAB2AAAAdgFOeyYIAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAMRJREFUOI3t0bFKAmAUBeAPURD1HQwUTKPJEmzQoSWQcKpVfIuWdvU9WnqNhsYWBx0a2lvLSMKGbvQ7SO564HA497/3cu/92SPFAS5QDN9CftviDhZYYRpNPtH/rzATOsQT6jhCFzmc4DTJL6AX067hPiimuAr95RglzMJ/4AyyUXSMw3iEauhN6C0eUEMFAyzTFZ7xiOvwL3jbsPYSr3hPg3dB/o43SVYY+TnsPPwXztMG5SDr39dGM8kr4RKNDdPtJL4BNXEmsdKC+S4AAAAASUVORK5CYII=",password:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAWQAAAFkBqp2phgAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACQSURBVDiN7dKxDcJQDATQJ0YgXQQ1bAgDEIZBETPQwjakIjRQ8CMSyR8SiZKTrvHZd/r+JsYSNZrEI1ZR4ywzfElcJ55xwiITOECNTVDf4jDGoEEZ1Etcxxg8pmjRDiahb7BH20uKKPVUkVmL+YjQArdI+PT2bO9Pd/A34O71Rd9QeN/LAFUSckfUscWuG3oCgP8nrDH6T5AAAAAASUVORK5CYII=",date:c,number:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAB2AAAAdgFOeyYIAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAMxJREFUOI3t0bFKwlEUBvBfmmBEr1APIDZJ9AJJQyAIvkGP0C4uQruza+DUmuIc9AC9gBG4Nmpkw/8IB3Vw1w8u95zvnvPde77LEeUUV9HAF67QRA2nmMf5A+o4x3cWOsMYy8j7WMX6jaYbLBL/mAWe8RcHm1ihs8G94gVKQQzwlAouMcQo8p/Y28HdYpYFZmsi0MVdxD1MdrxsC500wijdvgtbI1AYtDbxMwkuFAZmE1uYwkkSqOIaHyHcxEU0vUXNPSqKr37fZ6xDwD9DPS0OyHjQHQAAAABJRU5ErkJggg==",email:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAC4SURBVDiNxdIxagJRFIXhLzLFBNJYaJslSEylWOhq3IorMGQ16SyjYCFiZWU5pTaDFvOUyTAZ8RHID69555577oXLf/OEGaY4R3g/4IhORHg3eOXYYvSAeRQ8OWQYYoNPvDQYnxUr7zBB1grCAv3QbIlxjXmAb7Txhq+rkFUKq9NUU8vcJiizwDtOWGEdmvTKqT+61H0GXsP7jSxpEGF/R1e3wkO0FBeVRnhTSBTneBB3yvOI4D/mAnvrIwKM5s4AAAAAAElFTkSuQmCC"},p=t.html("input",{...h,type:()=>u?g()?"text":"password":m,placeholder:e.placeholder||l||(i?n("search")():" "),class:o("grow order-2 focus:outline-none",e.$class||e.class),$value:s,oninput:t=>{s?.(t.target.value),e.oninput?.(t)},$disabled:()=>A(e.$disabled)||A(e.disabled)}),f=d||(b[m]?t.html("img",{src:b[m],class:"w-5 h-5 opacity-50",alt:m}):null);return t.html("label",{class:()=>o("input input-bordered floating-label flex items-center gap-2 w-full relative",A(r)?"input-error":"")},[f?t.html("div",{class:"order-1 shrink-0"},f):null,l?t.html("span",{class:"text-base-content/60 order-0"},l):null,p,u?t.html("button",{type:"button",class:"order-3 btn btn-ghost btn-xs btn-circle opacity-50 hover:opacity-100",onclick:t=>{t.preventDefault(),g(!g())}},(()=>t.html("img",{class:"w-5 h-5",src:g()?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADjSURBVDiN3dJNSgNBEAXgz4DZeAAVJ9tko2St3kaIFxAVt4KZeAD1GKKi7vQSydI/yHgALxAXU02GxniAFBR0v1ev+3V1sZSxjxtM8BM5wTX2/hNu4gFvOMI21iJ3cIwP3GMjF/dQ4RyraOMS34GPAmvjIrBeEnfwjoPGgSM8ooh8QtngB6Ep4BWnmaMqkY1LqqzmDC8tzNDK3/RHzLL9SloUYWfQIMuw3Yl8xrDBH6qbvZWALqbqBqVmlWF7GuKEDwPr5hbXcYdPnKBv/o39wL5wG7ULY1c9NGPzQRrjKrhli1/02zEjWyWMBwAAAABJRU5ErkJggg==":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAEDSURBVDiN1dK/K8VhFAbwD+VLGSxKcu9guSQ/Zils/gNkuaX4BxRZDTdklYU/QAaDlEVGGwu2Kz/uVbKJzWDwfuv1+jHz1Km3c85znuf0Hv4jxnD2W8MItnCJ5xAX2MQcHsOQL+jEAapYQD9aQwxiDy+B3JKSe1DHCpqQYQ0PeMJOpDyAmyAAirjGbDRwFYcoYCZSzjGP+8B1gqXEUT2QxyPlqaRnGceNeENzUswwil1MBocbSU9DCAXUUI6K25HtIo5QSVaooitP9OEO65iIbE+HXSvBVRbeNZQSR9pxGil3o83HNw5hEbfYR0dKFki5ci+u8OrzIQ1/R8xx7ocL+9t4B0HPOVXjoptxAAAAAElFTkSuQmCC"}))):null,a?t.html("div",{class:"tooltip tooltip-left order-4","data-tip":a},t.html("span",{class:"badge badge-ghost badge-xs cursor-help"},"?")):null,()=>A(r)?t.html("span",{class:"text-error text-[10px] absolute -bottom-5 left-2"},A(r)):null])},l.Select=e=>{const{label:a,options:s,$value:n,...c}=e,r=t.html("select",{...c,class:o("select select-bordered w-full",e.$class||e.class),$value:n,onchange:t=>n?.(t.target.value)},l.For((()=>A(s)||[]),(e=>t.html("option",{value:e.value,$selected:()=>String(A(n))===String(e.value)},e.label)),(t=>t.value)));return a?t.html("label",{class:"fieldset-label flex flex-col gap-1"},[t.html("span",{},a),r]):r},l.Autocomplete=e=>{const{options:a=[],$value:s,onSelect:o,label:c,placeholder:r,...i}=e,d=t(A(s)||""),m=t(!1),h=t(-1),u=t((()=>{const t=d().toLowerCase(),e=A(a)||[];return t?e.filter((e=>("string"==typeof e?e:e.label).toLowerCase().includes(t))):e})),g=t=>{const e="string"==typeof t?t:t.value,l="string"==typeof t?t:t.label;d(l),"function"==typeof s&&s(e),o?.(t),m(!1),h(-1)};return t.html("div",{class:"relative w-full"},[l.Input({label:c,placeholder:r||n("search")(),$value:d,onfocus:()=>m(!0),onblur:()=>setTimeout((()=>m(!1)),150),onkeydown:t=>{const e=u();"ArrowDown"===t.key?(t.preventDefault(),m(!0),h(Math.min(h()+1,e.length-1))):"ArrowUp"===t.key?(t.preventDefault(),h(Math.max(h()-1,0))):"Enter"===t.key&&h()>=0?(t.preventDefault(),g(e[h()])):"Escape"===t.key&&m(!1)},oninput:t=>{const e=t.target.value;d(e),"function"==typeof s&&s(e),m(!0),h(-1)},...i}),t.html("ul",{class:"absolute left-0 w-full menu bg-base-100 rounded-box mt-1 p-2 shadow-xl max-h-60 overflow-y-auto border border-base-300 z-50",style:()=>m()&&u().length?"display:block":"display:none"},[l.For(u,((e,l)=>t.html("li",{},[t.html("a",{class:()=>"block w-full "+(h()===l?"active bg-primary text-primary-content":""),onclick:()=>g(e),onmouseenter:()=>h(l)},"string"==typeof e?e:e.label)])),((t,e)=>("string"==typeof t?t:t.value)+e)),()=>u().length?null:t.html("li",{class:"p-2 text-center opacity-50"},"No results")])])},l.Datepicker=e=>{const{$value:a,range:s,label:n,placeholder:o,...r}=e,i=t(!1),d=t(new Date),m=t(null),h=()=>!0===A(s),u=new Date,g=`${u.getFullYear()}-${String(u.getMonth()+1).padStart(2,"0")}-${String(u.getDate()).padStart(2,"0")}`,b=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,p=t=>{const e=b(t),l=A(a);if(h())if(!l?.start||l.start&&l.end)"function"==typeof a&&a({start:e,end:null});else{const t=l.start;"function"==typeof a&&a(e{const t=A(a);return t?"string"==typeof t?t:t.start&&t.end?`${t.start} - ${t.end}`:t.start?`${t.start}...`:"":""})),v=t=>{const e=d();d(new Date(e.getFullYear(),e.getMonth()+t,1))},B=t=>{const e=d();d(new Date(e.getFullYear()+t,e.getMonth(),1))};return t.html("div",{class:"relative w-full"},[l.Input({label:n,placeholder:o||(h()?"Seleccionar rango...":"Seleccionar fecha..."),$value:f,readonly:!0,icon:t.html("img",{src:c,class:"opacity-40"}),onclick:t=>{t.stopPropagation(),i(!i())},...r}),l.If(i,(()=>t.html("div",{class:"absolute left-0 mt-2 p-4 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[100] w-80 select-none",onclick:t=>t.stopPropagation()},[t.html("div",{class:"flex justify-between items-center mb-4 gap-1"},[t.html("div",{class:"flex gap-0.5"},[t.html("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>B(-1)},t.html("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABlSURBVDiN3ZLBDUBAEEUfmtCchA5woUMlOO1FCQrAwbqwf8eFhHd7mfzJn2Tg82TGvABywAmPUgOLD4XcDK9AJ/y5cOlrNsIvpCdPDL/FUbkX/t6Slv3+SjgQf6QBmIAZGAP+FzZJViOd89x8pAAAAABJRU5ErkJggg==",class:"opacity-40"})),t.html("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>v(-1)},t.html("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABfSURBVDiNY2AY8oCZSHWxDAwMEgwMDHfJsaSAgYHhH9QQsjT/Z2BgKKe75gQGiLMLCSlkwiHOSI6t6ADmhYoBN6SIARIeidgkiUlIxxkYGB4xMDB8YmBguE6JSwYpAACvLRHTKwPjZgAAAABJRU5ErkJggg==",class:"opacity-40"}))]),t.html("span",{class:"font-bold uppercase flex-1 text-center"},[()=>d().toLocaleString("es-ES",{month:"short",year:"numeric"})]),t.html("div",{class:"flex gap-0.5"},[t.html("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>v(1)},t.html("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABNSURBVDiN3dAxCoAwFATRh3fU2oAHiDbi5Y1F2jT+gKLbzyy7/DYjUo8g4cTWI8koOF6XrOqc5ifDDVGJthfsj8OLujtHYJgwR+GP5QKMxA9/SolDQgAAAABJRU5ErkJggg==",class:"opacity-40"})),t.html("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>B(1)},t.html("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABmSURBVDiN3dGxCoAgEMbxfz1dL1BTREJzmUv08trgDYcg6VCD3/YD7zvkoLmMgFEegLmmwAAecOJVvNeUWCAAt7IHjt9LThkyiRf9qC8oCom70u0BuDL+bngj/tNm/JqJePucW8wDvGYdzT0nMUkAAAAASUVORK5CYII=",class:"opacity-40"}))])]),t.html("div",{class:"grid grid-cols-7 gap-1",onmouseleave:()=>m(null)},[...["L","M","X","J","V","S","D"].map((e=>t.html("div",{class:"text-[10px] opacity-40 font-bold text-center"},e))),()=>{const e=d(),l=e.getFullYear(),s=e.getMonth(),n=new Date(l,s,1).getDay(),o=0===n?6:n-1,c=new Date(l,s+1,0).getDate(),r=[];for(let e=0;e{const t=A(a),e=m(),l="string"==typeof t?t===o:t?.start===o,s=t?.end===o;let n=!1;if(h()&&t?.start){const l=t.start;!t.end&&e?n=o>l&&o<=e||o=e:t.end&&(n=o>l&&o{h()&&m(o)},onclick:()=>p(n)},[e.toString()]))}return r}])]))),l.If(i,(()=>t.html("div",{class:"fixed inset-0 z-[90]",onclick:()=>i(!1)})))])},l.Colorpicker=e=>{const{$value:a,label:s,...n}=e,o=t(!1),c=["#000","#1A1A1A","#333","#4D4D4D","#666","#808080","#B3B3B3","#FFF","#450a0a","#7f1d1d","#991b1b","#b91c1c","#dc2626","#ef4444","#f87171","#fca5a5","#431407","#7c2d12","#9a3412","#c2410c","#ea580c","#f97316","#fb923c","#ffedd5","#713f12","#a16207","#ca8a04","#eab308","#facc15","#fde047","#fef08a","#fff9c4","#064e3b","#065f46","#059669","#10b981","#34d399","#4ade80","#84cc16","#d9f99d","#082f49","#075985","#0284c7","#0ea5e9","#38bdf8","#7dd3fc","#22d3ee","#cffafe","#1e1b4b","#312e81","#4338ca","#4f46e5","#6366f1","#818cf8","#a5b4fc","#e0e7ff","#2e1065","#4c1d95","#6d28d9","#7c3aed","#8b5cf6","#a855f7","#d946ef","#fae8ff"],r=()=>A(a)||"#000000";return t.html("div",{class:"relative w-fit"},[t.html("button",{type:"button",class:"btn px-3 bg-base-100 border-base-300 hover:border-primary/50 flex items-center gap-2 shadow-sm font-normal normal-case",onclick:t=>{t.stopPropagation(),o(!o())},...n},[t.html("div",{class:"size-5 rounded-sm shadow-inner border border-black/10 shrink-0",style:()=>`background-color: ${r()}`}),s?t.html("span",{class:"opacity-80"},s):null]),l.If(o,(()=>t.html("div",{class:"absolute left-0 mt-2 p-3 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[110] w-64 select-none",onclick:t=>t.stopPropagation()},[t.html("div",{class:"grid grid-cols-8 gap-1"},c.map((e=>t.html("button",{type:"button",style:`background-color: ${e}`,class:()=>"size-6 rounded-sm cursor-pointer transition-all hover:scale-125 hover:z-10 active:scale-95 outline-none border border-black/5 \n "+(r().toLowerCase()===e.toLowerCase()?"ring-2 ring-offset-1 ring-primary z-10 scale-110":""),onclick:()=>{a(e),o(!1)}}))))]))),l.If(o,(()=>t.html("div",{class:"fixed inset-0 z-[100]",onclick:()=>o(!1)})))])},l.CheckBox=e=>{const{$value:l,tooltip:a,toggle:s,...n}=e,o=t.html("input",{...n,type:"checkbox",class:()=>A(s)?"toggle":"checkbox",$checked:l,onchange:t=>l?.(t.target.checked)}),c=t.html("label",{class:"label cursor-pointer justify-start gap-3"},[o,e.label?t.html("span",{class:"label-text"},e.label):null]);return a?t.html("div",{class:"tooltip","data-tip":a},c):c},l.Radio=e=>{const{label:l,tooltip:a,$value:s,value:n,...c}=e,r=t.html("input",{...c,type:"radio",class:o("radio",e.$class||e.class),$checked:()=>A(s)===n,$disabled:()=>A(e.$disabled)||A(e.disabled),onclick:()=>"function"==typeof s&&s(n)});if(!l&&!a)return r;const i=t.html("label",{class:"label cursor-pointer justify-start gap-3"},[r,l?t.html("span",{class:"label-text"},l):null]);return a?t.html("div",{class:"tooltip","data-tip":a},i):i},l.Range=e=>{const{label:l,tooltip:a,$value:s,...n}=e,c=t.html("input",{...n,type:"range",class:o("range",e.$class||e.class),$value:s,$disabled:()=>A(e.$disabled)||A(e.disabled),oninput:t=>"function"==typeof s&&s(t.target.value)});if(!l&&!a)return c;const r=t.html("div",{class:"flex flex-col gap-2"},[l?t.html("span",{class:"label-text"},l):null,c]);return a?t.html("div",{class:"tooltip","data-tip":a},r):r},l.Modal=(e,a)=>{const{title:s,buttons:A,$open:o,...c}=e,r=()=>o(!1);return l.If(o,(()=>t.html("dialog",{...c,class:"modal modal-open"},[t.html("div",{class:"modal-box"},[s?t.html("h3",{class:"text-lg font-bold mb-4"},s):null,"function"==typeof a?a():a,t.html("div",{class:"modal-action flex gap-2"},[...(Array.isArray(A)?A:[A]).filter(Boolean),l.Button({onclick:r},n("close")())])]),t.html("form",{method:"dialog",class:"modal-backdrop",onclick:t=>(t.preventDefault(),r())},[t.html("button",{},"close")])])))},l.Grid=e=>{const{data:l,options:a,class:s}=e;let n=null;const o=t.html("div",{style:"height: 100%; width: 100%;",class:s}),c=new MutationObserver((()=>{n&&n.setGridOption("theme",getTheme(isDark()))}));c.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),o._cleanups.add((()=>c.disconnect()));const r=t.effect((()=>{const t=isDark(),e=getTheme(t),s=A(l)||[];n?n.setGridOption("theme",e):n=createGrid(o,{...A(a)||{},theme:e,rowData:s})}));o._cleanups.add(r);const i=t.effect((()=>{const t=A(l);n&&Array.isArray(t)&&n.setGridOption("rowData",t)}));return o._cleanups.add(i),o._cleanups.add((()=>{n&&(n.destroy(),n=null)})),o},l.Dropdown=(e,l)=>{const{label:a,icon:s,...n}=e;return t.html("div",{...n,class:()=>`dropdown ${A(e.$class)||e.class||""}`},[t.html("div",{tabindex:0,role:"button",class:"btn m-1 flex items-center gap-2"},[s?"function"==typeof s?s():s:null,a?"function"==typeof a?a():a:null]),t.html("ul",{tabindex:0,class:"dropdown-content z-[50] menu p-2 shadow bg-base-100 rounded-box min-w-max border border-base-300"},["function"==typeof l?l():l])])},l.Accordion=(e,l)=>{const{title:a,name:s,$open:n,open:c,...r}=e;return t.html("div",{...r,class:o("collapse collapse-arrow bg-base-200 mb-2",e.$class||e.class)},[t.html("input",{type:s?"radio":"checkbox",name:s,$checked:()=>A(n)||A(c),onchange:t=>"function"==typeof n&&n(t.target.checked)}),t.html("div",{class:"collapse-title text-xl font-medium"},a),t.html("div",{class:"collapse-content"},l)])},l.Tabs=e=>{const{items:a,...s}=e,n="function"==typeof a?a:()=>a||[];return t.html("div",{...s,class:"flex flex-col gap-4 w-full"},[t.html("div",{role:"tablist",class:o("tabs tabs-box",e.$class||e.class)},l.For(n,(e=>t.html("a",{role:"tab",class:()=>o("tab",A(e.active)&&"tab-active",A(e.disabled),e.tip),"data-tip":e.tip,onclick:t=>!A(e.disabled)&&e.onclick?.(t)},e.label)),(t=>t.label))),()=>{const e=n().find((t=>A(t.active)));if(!e)return null;const l=A(e.content);return t.html("div",{class:"p-4"},["function"==typeof l?l():l])}])},l.Badge=(e,l)=>t.html("span",{...e,class:o("badge",e.$class||e.class)},l),l.Tooltip=(e,l)=>t.html("div",{...e,class:o("tooltip",e.$class||e.class),"data-tip":e.tip},l),l.Navbar=(e,l)=>t.html("div",{...e,class:o("navbar bg-base-100 shadow-sm px-4",e.$class||e.class)},l),l.Menu=e=>{const a=e=>l.For((()=>e||[]),(e=>t.html("li",{},[e.children?t.html("details",{open:e.open},[t.html("summary",{},[e.icon&&t.html("span",{class:"mr-2"},e.icon),e.label]),t.html("ul",{},a(e.children))]):t.html("a",{class:()=>A(e.active)?"active":"",onclick:e.onclick},[e.icon&&t.html("span",{class:"mr-2"},e.icon),e.label])])),((t,e)=>t.label||e));return t.html("ul",{...e,class:o("menu bg-base-200 rounded-box",e.$class||e.class)},a(e.items))},l.Drawer=e=>t.html("div",{class:o("drawer",e.$class||e.class)},[t.html("input",{id:e.id,type:"checkbox",class:"drawer-toggle",$checked:e.$open}),t.html("div",{class:"drawer-content"},e.content),t.html("div",{class:"drawer-side"},[t.html("label",{for:e.id,class:"drawer-overlay",onclick:()=>e.$open?.(!1)}),t.html("div",{class:"min-h-full bg-base-200 w-80"},e.side)])]),l.Fieldset=(e,l)=>t.html("fieldset",{...e,class:o("fieldset bg-base-200 border border-base-300 p-4 rounded-lg",e.$class||e.class)},[()=>{const l=A(e.legend);return l?t.html("legend",{class:"fieldset-legend font-bold"},[l]):null},l]),l.List=e=>{const{items:a,header:s,render:n,keyFn:c,class:r}=e;return t.html("ul",{class:o("list bg-base-100 rounded-box shadow-md",r)},[l.If(s,(()=>t.html("li",{class:"p-4 pb-2 text-xs opacity-60 tracking-wide"},[A(s)]))),l.For(a,((e,l)=>t.html("li",{class:"list-row"},[n(e,l)])),c)])},l.Stack=(e,l)=>t.html("div",{...e,class:o("stack",e.$class||e.class)},l),l.Stat=e=>t.html("div",{...e,class:o("stat",e.$class||e.class)},[e.icon&&t.html("div",{class:"stat-figure text-secondary"},e.icon),e.label&&t.html("div",{class:"stat-title"},e.label),t.html("div",{class:"stat-value"},(()=>A(e.$value)??e.value)),e.desc&&t.html("div",{class:"stat-desc"},e.desc)]),l.Swap=e=>t.html("label",{class:o("swap",e.$class||e.class)},[t.html("input",{type:"checkbox",$checked:e.$value,onchange:t=>e.$value?.(t.target.checked)}),t.html("div",{class:"swap-on"},e.on),t.html("div",{class:"swap-off"},e.off)]),l.Indicator=(e,l)=>t.html("div",{class:o("indicator",e.$class||e.class)},[l,t.html("span",{class:o("indicator-item badge",e.badgeClass)},e.badge)]),l.Rating=e=>{const{$value:l,count:a=5,name:s=`rating-${Math.random().toString(36).slice(2,7)}`,mask:n="mask-star",readonly:o=!1,...c}=e;return t.html("div",{...c,class:()=>`rating ${A(o)?"pointer-events-none":""} ${e.class||""}`},Array.from({length:A(a)},((e,a)=>{const c=a+1;return t.html("input",{type:"radio",name:s,class:`mask ${n}`,"aria-label":`${c} star`,checked:()=>Math.round(A(l))===c,onchange:()=>{A(o)||"function"!=typeof l||l(c)}})})))},l.Alert=(e,l)=>{const{type:a="info",soft:s=!0,...n}=e,o={info:r,success:i,warning:m,error:d},c=l||e.message;return t.html("div",{...n,role:"alert",class:()=>`alert ${(()=>{const t=A(a);return{info:"alert-info",success:"alert-success",warning:"alert-warning",error:"alert-error"}[t]||t})()} ${A(s)?"alert-soft":""} ${e.class||""}`},[t.html("img",{src:o[A(a)]||o.info,class:"w-4 h-4 object-contain",alt:A(a)}),t.html("div",{class:"flex-1"},[t.html("span",{},["function"==typeof c?c():c])]),e.actions?t.html("div",{class:"flex-none"},["function"==typeof e.actions?e.actions():e.actions]):null])},l.Timeline=e=>{const{items:a=[],vertical:s=!0,compact:n=!1,...o}=e,c={info:r,success:i,warning:m,error:d};return t.html("ul",{...o,class:()=>`timeline ${A(s)?"timeline-vertical":"timeline-horizontal"} ${A(n)?"timeline-compact":""} ${e.class||""}`},[l.For(a,((e,l)=>{const s=0===l,n=l===A(a).length-1,o=e.type||"success",r=t=>"function"==typeof t?t():t;return t.html("li",{class:"flex-1"},[s?null:t.html("hr",{class:e.completed?"bg-primary":""}),t.html("div",{class:"timeline-start"},[r(e.title)]),t.html("div",{class:"timeline-middle"},[t.html("img",{src:c[o]||e.icon||c.success,class:"w-4 h-4 object-contain mx-1",alt:o})]),t.html("div",{class:"timeline-end timeline-box shadow-sm"},[r(e.detail)]),n?null:t.html("hr",{class:e.completed?"bg-primary":""})])}),((t,e)=>t.id||e))])},l.Fab=e=>{const{icon:l,label:a,actions:s=[],position:n="bottom-6 right-6",...o}=e;return t.html("div",{...o,class:()=>`fab fixed ${A(n)} flex flex-col-reverse items-end gap-3 z-[100] ${e.class||""}`},[t.html("div",{tabindex:0,role:"button",class:"btn btn-lg btn-circle btn-primary shadow-2xl"},[l?"function"==typeof l?l():l:null,!l&&a?a:null]),...A(s).map((e=>t.html("div",{class:"flex items-center gap-3 transition-all duration-300"},[e.label?t.html("span",{class:"badge badge-ghost shadow-sm whitespace-nowrap"},e.label):null,t.html("button",{type:"button",class:`btn btn-circle shadow-lg ${e.class||""}`,onclick:t=>{t.stopPropagation(),e.onclick?.(t)}},[e.icon?"function"==typeof e.icon?e.icon():e.icon:e.text||""])])))])},l.Toast=(e,a="alert-success",s=3500)=>{let n=document.getElementById("sigpro-toast-container");n||(n=t.html("div",{id:"sigpro-toast-container",class:"fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2"}),document.body.appendChild(n));const A=t.view((()=>{const o=t.html("div",{class:`alert alert-soft ${a} shadow-lg transition-all duration-300 translate-x-10 opacity-0`},[t.html("span","function"==typeof e?e():e),l.Button({class:"btn-xs btn-circle btn-ghost",onclick:()=>c()},"βœ•")]),c=()=>{o.classList.add("translate-x-full","opacity-0"),setTimeout((()=>{A.destroy(),n.hasChildNodes()||n.remove()}),300)};return setTimeout(c,s),o}));n.appendChild(A.container),requestAnimationFrame((()=>{const t=A.container.firstElementChild;t&&t.classList.remove("translate-x-10","opacity-0")}))},l.Loading=e=>l.If(e.$show,(()=>t.html("div",{class:"fixed inset-0 z-[100] flex items-center justify-center backdrop-blur-sm bg-base-100/30"},[t.html("span",{class:"loading loading-spinner loading-lg text-primary"})]))),l.tt=n,Object.keys(l).forEach((e=>{window[e]=l[e],t[e]=l[e]})),l}; \ No newline at end of file diff --git a/docs/404.html b/docs/404.html index 4ef9478..fe43e03 100644 --- a/docs/404.html +++ b/docs/404.html @@ -17,7 +17,7 @@
- + \ No newline at end of file diff --git a/docs/api/$.html b/docs/api/$.html deleted file mode 100644 index 8fe094d..0000000 --- a/docs/api/$.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - The Reactive Core: $( ) | SigPro - - - - - - - - - - - - - - - -
Skip to content

The Reactive Core: $( ) ​

The $ function is a Unified Reactive Constructor. It detects the type of input you provide and returns the appropriate reactive primitive.


1. Signals (Atomic State) ​

A Signal is the simplest form of reactivity. It holds a single value (string, number, boolean, null).

Option A: Standard Signal (RAM) ​

Ideal for volatile state that shouldn't persist after a page refresh.

javascript
const $count = $(0); 
-
-// Usage:
-$count();           // Getter: returns 0
-$count(10);         // Setter: updates to 10
-$count(c => c + 1); // Functional update: updates to 11

Option B: Persistent Signal (Disk) ​

By adding a key, SigPro links the signal to localStorage.

javascript
// Syntax: $(initialValue, "storage-key")
-const $theme = $("light", "app-theme"); 
-
-// It restores the value from disk automatically on load.
-// When you update it, it saves to disk instantly:
-$theme("dark"); // localStorage.getItem("app-theme") is now "dark"

2. Stores (Reactive Objects) ​

A Store is a proxy that wraps an Object. SigPro makes every property reactive recursively. You access and set properties as if they were individual signals.

Option A: Standard Store (RAM) ​

javascript
const user = $({ 
-  name: "Alice", 
-  profile: { bio: "Developer" } 
-});
-
-// Getter: Call the property as a function
-console.log(user.name()); // "Alice"
-
-// Setter: Pass the value to the property function
-user.name("Bob"); 
-
-// Nested updates work exactly the same:
-user.profile.bio("Architect");

Option B: Persistent Store (Disk) ​

The most powerful way to save complex state. The entire object tree is serialized to JSON and kept in sync with the disk.

javascript
const settings = $({ 
-  volume: 50, 
-  notifications: true 
-}, "user-settings");
-
-// Any change in the object triggers a disk sync:
-settings.volume(100); // The whole JSON is updated in localStorage

3. Stores (Reactive Arrays) ​

When you pass an Array, SigPro tracks changes to the list. You can use standard methods or access indexes as reactive getters.

javascript
const $list = $(["Item 1", "Item 2"]);
-
-// Get by index
-console.log($list[0]()); // "Item 1"
-
-// Update by index
-$list[0]("Updated Item");
-
-// Note: For adding/removing items, use standard array methods 
-// which SigPro makes reactive (push, pop, splice, etc.)

4. Computed (Derived Logic) ​

A Computed Signal is a read-only value that depends on other signals. It is defined by passing a function that returns a value.

javascript
const $price = $(100);
-const $tax = $(0.21);
-
-// This function HAS a return statement
-const $total = $(() => {
-  return $price() * (1 + $tax());
-});
-
-// Usage (Read-only):
-console.log($total()); // 121
-
-$price(200);
-console.log($total()); // 242 (Auto-updated)

5. Effects (Reactive Actions) ​

An Effect is used for side-effects. It is defined by passing a function that does NOT return a value. It runs once immediately and then re-runs whenever its dependencies change.

javascript
const $name = $("Alice");
-
-// This function has NO return statement (Side-effect)
-$(() => {
-  console.log("The name changed to:", $name());
-  document.title = `Profile: ${$name()}`;
-});
-
-$name("Bob"); // Triggers the console.log and updates document.title

6. Summary: Input Mapping ​

If you pass...SigPro creates a...Access Method
A ValueSignal$var() / $var(val)
An ObjectStoreobj.prop() / obj.prop(val)
An ArrayArray Storearr[i]() / arr.push()
Function (returns)Computed$comp() (Read-only)
Function (no return)EffectAutomatically executed

πŸ’‘ Naming Convention: The $ Prefix ​

To keep your code clean, always prefix your reactive variables with $. This tells you at a glance that you need to call it as a function to get its value.

javascript
const name = "Static";   // Just a string
-const $name = $("Alice"); // A Reactive Signal
- - - - \ No newline at end of file diff --git a/docs/api/effect.html b/docs/api/effect.html new file mode 100644 index 0000000..5f90ccf --- /dev/null +++ b/docs/api/effect.html @@ -0,0 +1,58 @@ + + + + + + ⚑ Side Effects: $.effect( ) | SigPro + + + + + + + + + + + + + + + +
Skip to content

⚑ Side Effects: $.effect( ) ​

The $.effect function allows you to run a piece of code whenever the signals it depends on are updated. It automatically tracks any signal called within its body.

πŸ›  Function Signature ​

typescript
$.effect(callback: Function): StopFunction
ParameterTypeRequiredDescription
callbackFunctionYesThe code to run. It will execute immediately and then re-run on dependency changes.

Returns: A StopFunction that, when called, cancels the effect and prevents further executions.


πŸ“– Usage Patterns ​

1. Basic Tracking ​

Any signal you "touch" inside the effect becomes a dependency.

javascript
const count = $(0);
+
+$.effect(() => {
+  // This runs every time 'count' changes
+  console.log(`The count is now: ${count()}`);
+});
+
+count(1); // Console: "The count is now: 1"

2. Manual Cleanup ​

If your effect creates something that needs to be destroyed (like a timer or a global event listener), you can return a cleanup function.

javascript
$.effect(() => {
+  const timer = setInterval(() => console.log("Tick"), 1000);
+
+  // SigPro will run this BEFORE the next effect execution 
+  // or when the effect is stopped.
+  return () => clearInterval(timer);
+});

3. Nesting & Automatic Cleanup ​

If you create a signal or another effect inside an effect, SigPro tracks them as "children". When the parent effect re-runs or stops, all children are automatically cleaned up to prevent memory leaks.

javascript
$.effect(() => {
+  if (isLoggedIn()) {
+    // This sub-effect is only active while 'isLoggedIn' is true
+    $.effect(() => {
+      console.log("Fetching user data...");
+    });
+  }
+});

πŸ›‘ Stopping an Effect ​

You can stop an effect manually by calling the function it returns. This is useful for one-time operations or complex logic.

javascript
const stop = $.effect(() => {
+  console.log(count());
+});
+
+// Later...
+stop(); // The effect is destroyed and will never run again.

πŸ’‘ Pro Tip: Batching ​

SigPro uses a Microtask Queue to handle updates. If you update multiple signals at once, the effect will only run once at the end of the current task.

javascript
const a = $(0);
+const b = $(0);
+
+$.effect(() => console.log(a(), b()));
+
+// This triggers only ONE re-run, not two.
+a(1);
+b(2);
+ + + + \ No newline at end of file diff --git a/docs/api/html.html b/docs/api/html.html index 15b0257..aab3d97 100644 --- a/docs/api/html.html +++ b/docs/api/html.html @@ -3,7 +3,7 @@ - Rendering Engine: $.html | SigPro + πŸ—οΈ The DOM Factory: $.html( ) | SigPro @@ -13,35 +13,37 @@ - + -
Skip to content

Rendering Engine: $.html ​

The $.html function is the architect of your UI. It creates standard HTML elements and wires them directly to your signals without the need for a Virtual DOM.

1. Syntax: $.html(tag, [props], [content]) ​

ParameterTypeRequiredDescription
tagstringYesAny valid HTML5 tag (e.g., 'div', 'button', 'input').
propsObjectNoAttributes, event listeners, and reactive bindings.
contentanyNoText, Nodes, Arrays, or Reactive Functions.

Example: ​

javascript
const myButton = $.html('button', { class: 'btn-primary' }, 'Click me');

2. Global Tag Helpers ​

To avoid repetitive $.html calls, SigPro automatically exposes common tags to the global window object. This allows for a clean, declarative syntax.

javascript
// Instead of $.html('div', ...), just use:
-div({ id: 'wrapper' }, [
-  h1("Welcome"),
-  p("This is SigPro.")
-]);

3. Handling Properties & Attributes ​

SigPro distinguishes between static attributes and reactive bindings using the $ prefix.

Static vs. Reactive Attributes ​

  • Static: Applied once during creation.
  • Reactive ($): Automatically updates the DOM when the signal changes.
PropertySyntaxResult
Attribute{ id: 'main' }id="main"
Event{ onclick: fn }Adds an event listener.
Reactive Attr{ $class: $theme }Updates class whenever $theme() changes.
Boolean Attr{ $disabled: $isBusy }Toggles the disabled attribute automatically.

4. Two-Way Data Binding ​

For form inputs, SigPro provides a powerful shortcut using $value or $checked. It automatically handles the event listening and the value synchronization.

javascript
const $text = $("Type here...");
+    
Skip to content

πŸ—οΈ The DOM Factory: $.html( ) ​

$.html is the internal engine that creates, attributes, and attaches reactivity to DOM elements. It is the foundation for all Tag Constructors in SigPro.

πŸ›  Function Signature ​

typescript
$.html(tagName: string, props?: Object, children?: any[] | any): HTMLElement
ParameterTypeRequiredDescription
tagNamestringYesValid HTML tag name (e.g., "div", "button").
propsObjectNoHTML attributes, event listeners, and reactive bindings.
childrenanyNoNested elements, text strings, or reactive functions.

πŸ“– Key Features ​

1. Attribute Handling ​

SigPro intelligently decides how to apply each property:

  • Standard Props: Applied via setAttribute or direct property assignment.
  • Boolean Props: Uses toggleAttribute (e.g., checked, disabled, hidden).
  • Class Names: Supports class or className interchangeably.

2. Event Listeners & Modifiers ​

Events are defined by the on prefix. SigPro supports Dot Notation for common event operations:

javascript
$.html("button", {
+  // e.preventDefault() is called automatically
+  "onsubmit.prevent": (e) => save(e), 
+  
+  // e.stopPropagation() is called automatically
+  "onclick.stop": () => console.log("No bubbling"),
+  
+  // { once: true } listener option
+  "onclick.once": () => console.log("Runs only once")
+}, "Click Me");

3. Reactive Attributes ​

If an attribute value is a function (like a Signal), $.html creates an internal $.effect to keep the DOM in sync with the state.

javascript
$.html("div", {
+  // Updates the class whenever 'theme()' changes
+  class: () => theme() === "dark" ? "bg-black" : "bg-white"
+});

4. Reactive Children ​

Children can be static or dynamic. When a child is a function, SigPro creates a reactive boundary for that specific part of the DOM.

javascript
$.html("div", {}, [
+  H1("Static Title"),
+  // Only this text node re-renders when 'count' changes
+  () => `Current count: ${count()}`
+]);

πŸ”„ Two-Way Binding Operator ($) ​

When a property starts with $, $.html enables bidirectional synchronization. This is primarily used for form inputs.

javascript
$.html("input", {
+  type: "text",
+  $value: username // Syncs input value <-> signal
+});

🧹 Automatic Cleanup ​

Every element created with $.html gets a hidden ._cleanups property (a Set).

  • When SigPro removes an element via $.view or $.router, it automatically executes all functions stored in this Set (stopping effects, removing listeners, etc.).

πŸ’‘ Tag Constructors (The Shortcuts) ​

Instead of writing $.html("div", ...) every time, SigPro provides PascalCase global functions:

javascript
// This:
+Div({ class: "wrapper" }, [ Span("Hello") ])
 
-input({ 
-  type: 'text', 
-  $value: $text // Syncs input -> signal and signal -> input
-});
-
-p(["You typed: ", $text]);

5. Reactive Content (Dynamic Children) ​

The content argument is incredibly flexible. If you pass a function, SigPro treats it as a reactive "portal" that re-renders only that specific part of the DOM.

Text & Nodes ​

javascript
const $count = $(0);
-
-// Text node updates surgically
-div(["Count: ", $count]); 
-
-// Conditional rendering with a function
-div(() => {
-  return $count() > 10 
-    ? h1("High Score!") 
-    : p("Keep going...");
-});

The "Guillotine" (Performance Tip) ​

When a reactive function in the content returns a new Node, SigPro uses replaceWith() to swap the old node for the new one. This ensures that:

  1. The update is nearly instantaneous.
  2. The old node is correctly garbage-collected.

6. Summary: Content Types ​

InputBehavior
String / NumberAppended as a TextNode.
HTMLElementAppended directly to the parent.
ArrayEach item is processed and appended in order.
Function () => ...Creates a live reactive zone that updates automatically.
- +// Is exactly equivalent to: +$.html("div", { class: "wrapper" }, [ $.html("span", {}, "Hello") ])
+ \ No newline at end of file diff --git a/docs/api/ignore.html b/docs/api/ignore.html new file mode 100644 index 0000000..f8cfb47 --- /dev/null +++ b/docs/api/ignore.html @@ -0,0 +1,52 @@ + + + + + + πŸ›‘ Untracking: $.ignore( ) | SigPro + + + + + + + + + + + + + + + +
Skip to content

πŸ›‘ Untracking: $.ignore( ) ​

The $.ignore function allows you to read a signal's value inside an effect or a computed signal without creating a dependency.

πŸ›  Function Signature ​

typescript
$.ignore(callback: Function): any
ParameterTypeRequiredDescription
callbackFunctionYesA function where signals can be read "silently".

Returns: Whatever the callback function returns.


πŸ“– Usage Patterns ​

1. Preventing Dependency Tracking ​

Normally, reading a signal inside $.effect makes the effect re-run when that signal changes. $.ignore breaks this link.

javascript
const count = $(0);
+const logLabel = $("System Log");
+
+$.effect(() => {
+  // This effect tracks 'count'...
+  const currentCount = count();
+  
+  // ...but NOT 'logLabel'. 
+  // Changing 'logLabel' will NOT re-run this effect.
+  const label = $.ignore(() => logLabel());
+  
+  console.log(`${label}: ${currentCount}`);
+});
+
+count(1);     // Console: "System Log: 1" (Triggers re-run)
+logLabel("UI"); // Nothing happens in console (Ignored)

2. Reading State in Event Handlers ​

Inside complex UI logic, you might want to take a "snapshot" of a signal without triggering a reactive chain.

javascript
const handleClick = () => {
+  // Accessing state without letting the caller know we touched it
+  const data = $.ignore(() => mySignal());
+  process(data);
+};

3. Avoiding Infinite Loops ​

If you need to write to a signal based on its own value inside an effect (and you aren't using the functional updater), $.ignore prevents the effect from triggering itself.

javascript
$.effect(() => {
+  const value = someSignal();
+  
+  if (value > 100) {
+    // We update the signal, but we ignore the read to avoid a loop
+    $.ignore(() => someSignal(0));
+  }
+});

πŸ’‘ Why use it? ​

  • Performance: Prevents expensive effects from running when non-essential data changes.
  • Logic Control: Allows "sampling" a signal at a specific point in time.
  • Safety: Essential for complex state orchestrations where circular dependencies might occur.
+ + + + \ No newline at end of file diff --git a/docs/api/mount.html b/docs/api/mount.html index 92b6b20..fdbde8c 100644 --- a/docs/api/mount.html +++ b/docs/api/mount.html @@ -3,7 +3,7 @@ - Application Mounter: $.mount | SigPro + πŸ”Œ Application Mounter: $.mount( ) | SigPro @@ -13,42 +13,40 @@ - + -
Skip to content

Application Mounter: $.mount ​

The $.mount function is the entry point of your reactive world. It takes a SigPro component (or a plain DOM node) and injects it into the real document, bridging the gap between your logic and the browser.

1. Syntax: $.mount(node, [target]) ​

ParameterTypeDefaultDescription
nodeHTMLElement or FunctionRequiredThe component or element to render.
targetstring or HTMLElementdocument.bodyWhere to mount the app (CSS selector or Element).

2. Usage Scenarios ​

A. The "Clean Slate" (Main Entry) ​

In a modern app, you usually want to control the entire page. By default, $.mount clears the target's existing HTML before mounting your application.

javascript
// src/main.js
-import { $ } from 'sigpro';
+    
Skip to content

πŸ”Œ Application Mounter: $.mount( ) ​

The $.mount function is the entry point of your reactive world. It bridges the gap between your SigPro logic and the browser's Real DOM by injecting a component into the document.

1. Function Signature ​

typescript
$.mount(node: Function | HTMLElement, target?: string | HTMLElement): RuntimeObject
ParameterTypeDefaultDescription
nodeFunction or NodeRequiredThe component function or DOM element to render.
targetstring or Nodedocument.bodyCSS selector or DOM element where the app will live.

Returns: A Runtime object containing the container and a destroy() method.


2. Common Usage Scenarios ​

A. The "Clean Slate" (SPA Entry) ​

In a modern Single Page Application, you typically want SigPro to manage the entire view. By default, if no target is provided, it mounts to document.body.

javascript
import { $ } from './sigpro.js';
 import App from './App.js';
 
-// SigPro: No .then() needed, global tags are ready immediately
-$.mount(App);

B. Targeting a Specific Container ​

If you have an existing HTML structure and want SigPro to manage only a specific section (like a #root div), pass a CSS selector or a reference.

html
<div id="sidebar"></div>
-<div id="app-root"></div>
javascript
// Mount to a specific ID
+// Mounts your main App component directly to the body
+$.mount(App);

B. Targeting a Specific Container ​

If your HTML has a predefined structure, you can tell SigPro exactly where to render by passing a CSS selector or a direct reference.

html
<div id="sidebar"></div>
+<main id="app-root"></main>
javascript
// Mount using a CSS selector
 $.mount(MyComponent, '#app-root');
 
-// Or using a direct DOM reference
-const sidebar = document.getElementById('sidebar');
-$.mount(SidebarComponent, sidebar);

3. Creating "Reactive Islands" ​

One of SigPro's strengths is its ability to work alongside "Old School" static HTML. You can inject a reactive widget into any part of a legacy page.

javascript
// A small reactive widget
+// Mount using a direct DOM reference
+const sidebar = document.querySelector('#sidebar');
+$.mount(SidebarComponent, sidebar);

C. Creating "Reactive Islands" ​

SigPro is excellent for "sprinkling" reactivity onto legacy or static pages. You can inject small reactive widgets into any part of an existing HTML layout.

javascript
// A small reactive widget
 const CounterWidget = () => {
-  const $c = $(0);
-  return button({ onclick: () => $c(v => v + 1) }, [
-    "Clicks: ", $c
+  const count = $(0);
+  return Button({ onclick: () => count(c => c + 1) }, [
+    "Clicks: ", count
   ]);
 };
 
-// Mount it into an existing div in your static HTML
-$.mount(CounterWidget, '#counter-container');

4. How it Works (Lifecycle) ​

When $.mount is called, it performs three critical steps:

  1. Resolution: If you passed a Function, it executes it once to generate the initial DOM node.
  2. Clearance: It sets target.innerHTML = ''. This prevents "zombie" HTML or static placeholders from interfering with your app.
  3. Injection: It appends the resulting node to the target.

5. Global vs. Local Scope ​

Global (The "Framework" Way) ​

In a standard Vite project, you initialize SigPro in your entry file. This makes $ and the tag helpers (div, button, etc.) available globally for a clean, declarative developer experience.

javascript
// src/main.js
-import { $ } from 'sigpro'; 
+// Mount it into a specific div in your static HTML
+$.mount(CounterWidget, '#counter-container');

3. How it Works (Lifecycle) ​

When $.mount is executed, it performs these critical steps:

  1. Resolution & Wrapping: If you pass a Function, SigPro wraps it in a $.view(). This starts tracking all internal signals and effects.
  2. Target Clearance: It uses target.replaceChildren(). This efficiently wipes any existing HTML or "zombie" nodes inside the target before mounting.
  3. Injection: The component's container is appended to the target.
  4. Memory Management: It stores the Runtime instance associated with that DOM element. If you call $.mount again on the same target, SigPro automatically destroys the previous app to prevent memory leaks.

4. Global vs. Local Scope ​

The "Framework" Way (Global) ​

By importing your core in your entry file, SigPro automatically initializes global Tag Constructors (Div, Span, H1, etc.). This allows for a clean, declarative DX across your entire project.

javascript
// main.js
+import './sigpro.js'; 
 
-// Any component in any file can now use:
-$.mount(() => h1("Global App"));

Local (The "Library" Way) ​

If you prefer to avoid polluting the window object, you can import and use SigPro locally within specific modules.

javascript
// widget.js
-import { $ } from 'sigpro';
+// Now any file can simply do:
+$.mount(() => H1("Global SigPro App"));

The "Library" Way (Local) ​

If you prefer to avoid global variables, you can use the low-level $.html factory to create elements locally.

javascript
import { $ } from './sigpro.js';
 
-const myNode = $.html('div', 'Local Widget');
-$.mount(myNode, '#widget-target');

6. Summary Cheat Sheet ​

GoalCode
Mount to body$.mount(App)
Mount to ID$.mount(App, '#id')
Mount to Element$.mount(App, myElement)
Direct Function$.mount(() => div("Hi"), '#widget')
- +const myNode = $.html('div', { class: 'widget' }, 'Local Instance'); +$.mount(myNode, '#widget-target');

5. Summary Cheat Sheet ​

GoalCode Pattern
Mount to body$.mount(App)
Mount to ID$.mount(App, '#root')
Mount to Element$.mount(App, myElement)
Mount raw Node$.mount(Div("Hello"), '#id')
Unmount/Destroyconst app = $.mount(App); app.destroy();
+ \ No newline at end of file diff --git a/docs/api/quick.html b/docs/api/quick.html index 0d42c06..c3a715a 100644 --- a/docs/api/quick.html +++ b/docs/api/quick.html @@ -3,7 +3,7 @@ - Quick API Reference | SigPro + ⚑ Quick API Reference | SigPro @@ -13,81 +13,14 @@ - + -
Skip to content

Quick API Reference ​

SigPro is a minimal yet powerful engine. Here is a complete overview of its capabilities.

1. Core API Summary ​

FunctionDescriptionExample
$(val, key?)Creates a Signal, Computed, or Store (with optional persistence).const $n = $(0)
$.html()The base engine to create reactive HTMLElements.$.html('div', {}, 'Hi')
TagsGlobal helpers (div, span, button, etc.) built on top of $.html.div("Hello SigPro")
$.mount()Mounts a component into a target element (clears target first).$.mount(App, '#app')
$.router()Hash-based router with dynamic params and lazy loading.$.router(routes)
$.plugin()Extends SigPro or loads external scripts/plugins.$.plugin(MyPlugin)

2. The Power of $ (Reactivity) ​

The $ function adapts to whatever you pass to it:

Signals & Persistent State ​

Reactive values in RAM or synced with localStorage.

javascript
const $count = $(0);                      // Simple Signal
-const $theme = $('dark', 'app-theme');    // Persistent Signal (Disk)
-
-$count(10);             // Update value
-console.log($count());  // Get value: 10

Computed Signals ​

Read-only signals that update automatically when their dependencies change.

javascript
const $double = $(() => $count() * 2);

Reactive Stores (Objects + Disk) ​

Transforms an object into a reactive tree. If a key is provided, the entire structure persists.

javascript
// Store in RAM + Disk (Auto-syncs nested properties)
-const state = $({ 
-  user: { name: 'Natxo' }, 
-  settings: { dark: true } 
-}, 'my-app-state');
-
-// Accessing properties (they become signals)
-state.user.name();         // Get: 'Natxo'
-state.user.name('Guest');  // Set & Sync to Disk: 'my-app-state_user_name'

3. UI Creation: Constructor vs. Direct Tags ​

SigPro provides the $.html engine for defining any element and global "Sugar Tags" for rapid development.

javascript
// 1. DEFINE: Create a custom piece of UI
-// This returns a real DOM element ready to be used.
-const MyHero = $.html('section', { class: 'hero' }, [
-  h1("Internal Title")
-]);
-
-// 2. USE: Nest it inside other elements like a standard tag
-const Page = () => div([
-  MyHero, // We just drop the variable here
-  p("This paragraph is outside the Hero section.")
-]);
-
-$.mount(Page, '#app');
javascript
// Use pre-defined global tags to compose layouts instantly.
-// No need to define them, just call them.
-
-const Page = () => div({ id: 'main' }, [
-  section({ class: 'hero' }, [
-    h1("Direct Global Tag"),
-    p("Building UI without boilerplate.")
-  ]),
-  button({ onclick: () => alert('Hi!') }, "Click Me")
-]);
-
-$.mount(Page, '#app');

Technical Breakdown ​

  • $.html(tag, props, children): This is the core factory. Use it when you need to create an element dynamically or when working with Custom Elements / Web Components.
  • Global Tags (div, p, etc.): These are shortcut functions that SigPro injects into the window object. They internally call $.html for you, making your component code much cleaner and easier to read.

Key Difference ​

  • $.html: Acts as a constructor. Use it when you want to "bake" a specific structure (like a Section that always contains an H1) into a single variable.
  • Global Tags: Act as scaffolding. Use them to wrap different contents dynamically as you build your views.

Global Tags (Standard Syntax) ​

SigPro declares standard tags in the global scope so you don't have to import them.

javascript
const Card = (title, $val) => div({ class: 'card' }, [
-  h2(title),
-  p("Reactive content below:"),
-  input({ 
-    type: 'number', 
-    $value: $val, // Automatic Two-way binding
-    $style: () => $val() > 10 ? 'color: red' : 'color: green' 
-  })
-]);

4. Mounting: $.mount ​

The entry point of your application. It links your JavaScript logic to a specific DOM element.

html
<div id="app"></div>
javascript
// In your main.js
-const App = () => main([ 
-  h1("Welcome to SigPro"),
-  p("Everything here is reactive.")
-]);
-
-// Usage: $.mount(component, selectorOrElement)
-$.mount(App, '#app');

5. Navigation: $.router ​

A robust hash-based router (#/path) that handles view switching automatically.

javascript
const routes = [
-  { path: '/', component: Home },
-  { path: '/user/:id', component: (params) => h1(`User ID: ${params.id}`) },
-  { path: '/admin', component: () => import('./Admin.js') }, // Native Lazy Loading
-  { path: '*', component: () => p("404 - Not Found") }
-];
-
-// Initialize and mount the router
-$.mount($.router(routes), '#app');
-
-// Programmatic navigation
-$.router.go('/user/42');

6. Plugins: $.plugin ​

Extend the engine or load external dependencies.

javascript
// 1. Function-based plugin
-$.plugin(($) => {
-  $.myHelper = () => console.log("Plugin active!");
-});
-
-// 2. Load external scripts
-await $.plugin('https://cdn.example.com/library.js');
- +
Skip to content

⚑ Quick API Reference ​

SigPro is a high-performance micro-framework that updates the Real DOM surgically. No Virtual DOM, no unnecessary re-renders.

🟒 Core Functions ​

FunctionSignatureDescription
$(val, key?)(any, string?) => SignalCreates a Signal. If key is provided, it persists in localStorage.
$(fn)(function) => ComputedCreates a Computed Signal that auto-updates when its dependencies change.
$.effect(fn)(function) => stopFnRuns a side-effect that tracks signals. Returns a function to manually stop it.
$.html(tag, props, children)(string, object, any) => HTMLElementThe low-level DOM factory powering all tag constructors.
$.router(routes)(Array) => HTMLElementInitializes the hash-based router for SPAs.
$.go(path)(string) => voidProgrammatic navigation (e.g., $.go('/home')).
$.mount(comp, target)(any, string|Node) => RuntimeMounts the application into the specified DOM element.
$.ignore(fn)(function) => anyExecutes code without tracking any signals inside it.

πŸ—οΈ Element Constructors (Tags) ​

SigPro provides PascalCase wrappers for all standard HTML5 tags (e.g., Div, Span, Button).

Syntax Pattern ​

javascript
Tag({ attributes }, [children])

Attribute & Content Handling ​

PatternCode ExampleBehavior
Staticclass: "text-red"Standard HTML attribute string.
Reactivedisabled: isLoadingUpdates automatically when isLoading() changes.
Two-way$value: usernameSyncs input with signal both ways (Binding Operator).
TextP({}, () => count())Updates text node whenever count changes.
Booleanhidden: isHiddenToggles the attribute based on signal truthiness.
+ \ No newline at end of file diff --git a/docs/api/router.html b/docs/api/router.html index 34432de..0a9c980 100644 --- a/docs/api/router.html +++ b/docs/api/router.html @@ -3,7 +3,7 @@ - Routing Engine: $.router | SigPro + 🚦 Routing: $.router( ) & $.go( ) | SigPro @@ -13,50 +13,35 @@ - + -
Skip to content

Routing Engine: $.router ​

The $.router is SigPro's high-performance, hash-based navigation system. It connects the browser's URL directly to your reactive signals, enabling seamless page transitions without full reloads.

1. Core Features ​

  • Hash-based: Works everywhere without special server configuration (using #/path).
  • Lazy Loading: Pages are only downloaded when the user visits the route, keeping the initial bundle under 2KB.
  • Reactive: The view updates automatically and surgically when the hash changes.
  • Dynamic Routes: Built-in support for parameters like /user/:id.

2. Syntax: $.router(routes) ​

ParameterTypeRequiredDescription
routesArray<Object>YesAn array of route definitions { path, component }.

3. Setting Up Routes ​

In your App.js (or a dedicated routes file), define your navigation map and inject it into your layout.

javascript
const routes = [
-  { path: '/', component: () => h1("Home Page") },
-  { 
-    path: '/admin', 
-    // Lazy Loading: This file is only fetched when needed
-    component: () => import('./pages/Admin.js') 
-  },
-  { path: '/user/:id', component: (params) => h2(`User ID: ${params.id}`) },
-  { path: '*', component: () => div("404 - Page Not Found") }
-];
+    
Skip to content

🚦 Routing: $.router( ) & $.go( ) ​

SigPro includes a built-in, lightweight Hash Router to create Single Page Applications (SPA). It manages the URL state, matches components to paths, and handles the lifecycle of your pages automatically.

πŸ›  Router Signature ​

typescript
$.router(routes: Route[]): HTMLElement

Route Object ​

PropertyTypeDescription
pathstringThe URL fragment (e.g., "/home", "/user/:id", or "*").
componentFunctionA function that returns a Tag or a $.view.

πŸ“– Usage Patterns ​

1. Defining Routes ​

The router returns a div element with the class .router-outlet. When the hash changes, the router destroys the previous view and mounts the new one inside this container.

javascript
const App = () => Div({ class: "app-layout" }, [
+  Navbar(),
+  // The router outlet is placed here
+  $.router([
+    { path: "/", component: Home },
+    { path: "/profile/:id", component: UserProfile },
+    { path: "*", component: NotFound }
+  ])
+]);

2. Dynamic Segments (:id) ​

When a path contains a colon (e.g., :id), the router parses that segment and passes it as an object to the component function.

javascript
// If the URL is #/profile/42
+const UserProfile = (params) => {
+  return H1(`User ID is: ${params.id}`); // Displays "User ID is: 42"
+};

🏎 Programmatic Navigation: $.go( ) ​

To navigate between pages without using an <a> tag, use $.go. This function updates the browser's hash, which in turn triggers the router to swap components.

Signature ​

typescript
$.go(path: string): void

Examples ​

javascript
// Navigate to a static path
+Button({ onclick: () => $.go("/") }, "Home")
 
-export default () => div([
-  header([
-    h1("SigPro App"),
-    nav([
-      button({ onclick: () => $.router.go('/') }, "Home"),
-      button({ onclick: () => $.router.go('/admin') }, "Admin")
-    ])
-  ]),
-  // The router returns a reactive div that swaps content
-  main($.router(routes)) 
-]);

4. Navigation ($.router.go) ​

To move between pages programmatically (e.g., inside an onclick event or after a successful fetch), use the $.router.go helper.

javascript
button({ 
-  onclick: () => $.router.go('/admin') 
-}, "Go to Admin")

5. How it Works (Under the Hood) ​

The router tracks the window.location.hash and uses a reactive signal to trigger a re-render of the specific area where $.router(routes) is placed.

  1. Match: It filters your route array to find the best fit, handling dynamic segments (:id) and fallbacks (*).
  2. Resolve: * If it's a standard function, it executes it immediately.
    • If it's a Promise (via import()), it renders a temporary Loading... state and swaps the content once the module arrives.
  3. Inject: It replaces the previous DOM node with the new page content surgically using replaceWith().

6. Integration with UI Components ​

Since the router is reactive, you can easily create "active" states in your navigation menus by checking the current hash.

javascript
// Example of a reactive navigation link
-const NavLink = (path, label) => {
-  const $active = $(() => window.location.hash === `#${path}`);
-  
-  return button({ 
-    $class: () => $active() ? 'nav-active' : 'nav-link',
-    onclick: () => $.router.go(path) 
-  }, label);
-};
-
-nav([
-  NavLink('/', 'Home'),
-  NavLink('/settings', 'Settings')
-]);

7. Summary: Route Component Types ​

Component TypeBehavior
HTMLElementRendered immediately.
Function (params) => ...Executed with URL parameters and rendered.
Promise / import()Triggers Lazy Loading with a loading state.
String / NumberRendered as simple text inside a span.
- +// Navigate to a dynamic path +Button({ + onclick: () => $.go(`/profile/${user.id}`) +}, "View Profile")

⚑ Technical Behavior ​

  • Automatic Cleanup: Every time you navigate, the router calls .destroy() on the previous $.view. This ensures that all signals, effects, and event listeners from the old page are purged from memory.
  • Hash-Based: By using window.location.hash, SigPro works out-of-the-box on any static hosting (like GitHub Pages or Vercel) without needing server-side redirects.
  • Initial Load: On the first execution, $.router automatically reads the current hash or defaults to / if empty.

🎨 Styling the Outlet ​

Since the router returns a standard DOM element, you can style the transition or the container easily:

css
.router-outlet {
+  flex: 1;
+  padding: 2rem;
+  animation: fadeIn 0.2s ease-in;
+}
+ \ No newline at end of file diff --git a/docs/api/signal.html b/docs/api/signal.html new file mode 100644 index 0000000..8dcef4b --- /dev/null +++ b/docs/api/signal.html @@ -0,0 +1,39 @@ + + + + + + πŸ’Ž The Signal Function: $( ) | SigPro + + + + + + + + + + + + + + + +
Skip to content

πŸ’Ž The Signal Function: $( ) ​

The $( ) function is the core constructor of SigPro. It defines how data is stored, computed, and persisted.

πŸ›  Function Signature ​

typescript
$(initialValue: any, key?: string): Signal
+$(computation: Function): ComputedSignal
ParameterTypeRequiredDescription
initialValueanyYes*The starting value of your signal.
computationFunctionYes*A function that returns a value based on other signals.
keystringNoA unique name to persist the signal in localStorage.

*Either an initial value or a computation function must be provided.


πŸ“– Usage Patterns ​

1. Simple State ​

$(value) Creates a writable signal. It returns a function that acts as both getter and setter.

javascript
const count = $(0); 
+
+count();    // Read (0)
+count(10);  // Write (10)

2. Persistent State ​

$(value, key) Creates a writable signal that syncs with the browser's storage.

javascript
const theme = $("light", "app-theme"); 
+
+theme("dark"); // Automatically calls localStorage.setItem("app-theme", '"dark"')

Note: On page load, SigPro will prioritize the value found in localStorage over the initialValue.

3. Computed State (Derived) ​

$(function) Creates a read-only signal that updates automatically when any signal used inside it changes.

javascript
const price = $(100);
+const tax = $(0.21);
+
+// This tracks both 'price' and 'tax' automatically
+const total = $(() => price() * (1 + tax()));

πŸ”„ Updating with Logic ​

When calling the setter, you can pass an updater function to access the current value safely.

javascript
const list = $(["A", "B"]);
+
+// Adds "C" using the previous state
+list(prev => [...prev, "C"]);
+ + + + \ No newline at end of file diff --git a/docs/api/tags.html b/docs/api/tags.html index 7cdc861..0384194 100644 --- a/docs/api/tags.html +++ b/docs/api/tags.html @@ -3,7 +3,7 @@ - Global Tag Helpers | SigPro + 🎨 Global Tag Helpers | SigPro @@ -13,44 +13,49 @@ - + -
Skip to content

Global Tag Helpers ​

In SigPro, you don't need to write $.html('div', ...) every time. To keep your code clean and readable, the engine automatically generates global helper functions for all standard HTML tags upon initialization.

1. How it Works ​

SigPro iterates through an internal manifest of standard HTML tags and attaches a wrapper function for each one directly to the window object. This creates a native "DSL" (Domain Specific Language) that looks like a template engine but is 100% standard JavaScript.

  • Under the hood: $.html('button', { onclick: ... }, 'Click')
  • SigPro Style: button({ onclick: ... }, 'Click')

2. The Complete Global Registry ​

The following tags are injected into the global scope and are ready to use as soon as SigPro loads:

CategoryAvailable Global Functions
Structurediv, span, p, section, nav, main, header, footer, article, aside
Typographyh1, h2, h3, h4, h5, h6, ul, ol, li, dl, dt, dd, strong, em, code, pre, small, i, b, u, mark
Interactivebutton, a, label, br, hr, details, summary
Formsform, input, select, option, textarea, fieldset, legend
Tablestable, thead, tbody, tr, th, td, tfoot, caption
Media & Graphicsimg, canvas, video, audio, svg, path, iframe

"In SigPro, tags are not 'magic' strings handled by a compiler. They are functional imitations of HTML elements. Every time you call div(), you are executing a standard JavaScript function that returns a real DOM element. This gives you the speed of a specialized DSL with the transparency of pure JS."

WARNING: GLOBAL NAMING COLLISIONS

Since SigPro injects these helpers directly into the window object, they are regular JavaScript functions. This means they can be overwritten.

If you declare a variable, constant, or function with the same name as an HTML tag (e.g., const div = ... or function p()), you will nullify or shadow the built-in SigPro helper for that tag in your current scope.

Best Practice: To avoid conflicts, always use PascalCase for your custom components (e.g., UserCard, AppHeader) to distinguish them from the lowercase global HTML helpers.


3. Usage Patterns (Argument Flexibility) ​

The tag functions are "smart". They detect whether you are passing attributes, content, or both.

A. Attributes + Content ​

The standard way to build complex nodes.

javascript
div({ class: 'container', id: 'main-wrapper' }, [
-  h1("Welcome"),
-  p("This is SigPro.")
-]);

B. Content Only (The "Skipper") ​

If you don't need attributes, you can pass the content (string, array, or function) as the first and only argument.

javascript
section([
-  h2("No Attributes Needed"),
-  button("Click Me")
-]);

C. Primitive Content ​

For simple tags, you can just pass a string or a number.

javascript
h1("Hello World"); 
-span(42);

4. Reactive Attributes & Content ​

These helpers fully support SigPro's reactivity. Attributes starting with $ are automatically tracked.

javascript
const $count = $(0);
+    
Skip to content

🎨 Global Tag Helpers ​

In SigPro, you don't need to manually type $.html('div', ...) for every element. To keep your code declarative and readable, the engine automatically generates Global Helper Functions for all standard HTML5 tags upon initialization.

1. How it Works ​

SigPro iterates through a manifest of standard HTML tags and attaches a wrapper function for each one directly to the window object. This creates a specialized DSL (Domain Specific Language) that looks like a template engine but is 100% standard JavaScript.

  • Under the hood: $.html('button', { onclick: ... }, 'Click')
  • SigPro Style: Button({ onclick: ... }, 'Click')

2. The Complete Global Registry ​

The following functions are injected into the global scope (using PascalCase to prevent naming collisions with common JS variables) and are ready to use:

CategoryAvailable Global Functions
StructureDiv, Span, P, Section, Nav, Main, Header, Footer, Article, Aside
TypographyH1 to H6, Ul, Ol, Li, Dl, Dt, Dd, Strong, Em, Code, Pre, Small, B, U, Mark
InteractiveButton, A, Label, Br, Hr, Details, Summary, Dialog
FormsForm, Input, Select, Option, Textarea, Fieldset, Legend
TablesTable, Thead, Tbody, Tr, Th, Td, Tfoot, Caption
MediaImg, Canvas, Video, Audio, Svg, Iframe, Picture, Source

The SigPro Philosophy: Tags are not "magic strings" handled by a compiler. They are functional constructors. Every time you call Div(), you execute a pure JS function that returns a real, reactive DOM element.


3. Usage Patterns (Smart Arguments) ​

SigPro tag helpers are flexible. They automatically detect if you are passing attributes, children, or both.

A. Attributes + Children ​

The standard way to build structured UI.

javascript
Div({ class: 'container', id: 'main' }, [
+  H1("Welcome to SigPro"),
+  P("The zero-VDOM framework.")
+]);

B. Children Only (The "Skipper") ​

If you don't need attributes, you can skip the object and pass the content (string, array, or function) directly as the first argument.

javascript
Section([
+  H2("Clean Syntax"),
+  Button("I have no props!")
+]);

C. Primitive Content ​

For simple tags, just pass a string or a number.

javascript
H1("Hello World"); 
+Span(42);

4. Reactive Power Examples ​

These helpers are natively wired into SigPro's reactivity. No manual useEffect or watch calls are needed.

Reactive Attributes ​

Simply pass a Signal (function) to any attribute. SigPro handles the rest.

javascript
const theme = $("light");
 
-div({ class: 'counter-app' }, [
-  h2(["Current Count: ", $count]), // Auto-unwrapping text content
-  
-  button({ 
-    onclick: () => $count(c => c + 1),
-    $style: () => $count() > 5 ? "color: red" : "color: green" // Reactive style
-  }, "Increment")
-]);

5. Technical Implementation ​

As seen in the SigPro core, the engine registers these tags dynamically. This means zero imports are needed for UI creation in your component files.

javascript
// Internal SigPro loop
-tags.forEach(t => window[t] = (p, c) => $.html(t, p, c));

Because they are real functions, you get full IDE autocompletion and valid JS syntax highlighting without needing special plugins like JSX.


6. Comparison: Logic to UI ​

Here is how a dynamic Task Item component translates from SigPro logic to the final DOM structure.

javascript
const Task = (title, $done) => (
-  li({ class: 'task-item' }, [
-    input({ 
-      type: 'checkbox', 
-      $checked: $done // Two-way reactive binding
+Div({ 
+  // Updates 'class' automatically when theme() changes
+  class: () => `app-box ${theme()}` 
+}, "Themeable Box");

The Binding Operator ($) ​

Use the $ prefix for Two-Way Binding on inputs.

javascript
const search = $("");
+
+Input({ 
+  type: "text", 
+  placeholder: "Search...",
+  $value: search // UI updates Signal AND Signal updates UI
+});

Dynamic Lists ​

Combine tags with ui.For for high-performance list rendering.

javascript
const items = $(["Apple", "Banana", "Cherry"]);
+
+Ul({ class: "list-disc" }, [
+  ui.For(items, (item) => Li(item), (item) => item)
+]);

DANGER

⚠️ Important: Naming Conventions ​

Since SigPro injects these helpers into the global window object, follow these rules to avoid bugs:

  1. Avoid Shadowing: Don't name your local variables like the tags (e.g., const Div = ...). This will "hide" the SigPro helper.
  2. Custom Components: Always use PascalCase, UPPERCASE, or Underscore prefixes for your own component functions (e.g., UserCard, INPUT, or _Input) to distinguish them from the built-in Tag Helpers and avoid naming collisions.

6. Logic to UI Comparison ​

Here is how a dynamic User Status component translates from SigPro logic to the final DOM structure.

javascript
// SigPro Component
+const UserStatus = (name, $online) => (
+  Div({ class: 'flex items-center gap-2' }, [
+    Span({ 
+      // Boolean toggle for 'hidden' attribute
+      hidden: () => !$online(), 
+      class: 'w-3 h-3 bg-green-500 rounded-full' 
     }),
-    span({ 
-      $style: () => $done() ? "text-decoration: line-through" : "" 
-    }, title)
+    P({ 
+      // Reactive text content
+      class: () => $online() ? "text-bold" : "text-gray-400" 
+    }, name)
   ])
-);
html
<li class="task-item">
-  <input type="checkbox" checked>
-  <style="text-decoration: line-through">Buy milk</span>
-</li>
- +);
State ($online)Rendered HTML
true<div class="flex..."><span class="w-3..."></span><p class="text-bold">John</p></div>
false<div class="flex..."><span hidden class="w-3..."></span><p class="text-gray-400">John</p></div>
+ \ No newline at end of file diff --git a/docs/api/view.html b/docs/api/view.html new file mode 100644 index 0000000..bab404f --- /dev/null +++ b/docs/api/view.html @@ -0,0 +1,51 @@ + + + + + + πŸ–ΌοΈ Component Lifecycle: $.view( ) | SigPro + + + + + + + + + + + + + + + +
Skip to content

πŸ–ΌοΈ Component Lifecycle: $.view( ) ​

The $.view function is a specialized wrapper used to manage the lifecycle of a UI component. It tracks all signals, effects, and DOM elements created within it, providing a single point of destruction to prevent memory leaks.

πŸ›  Function Signature ​

typescript
$.view(renderFn: Function): RuntimeObject
ParameterTypeRequiredDescription
renderFnFunctionYesA function that returns a DOM Node or an array of Nodes.

Returns: A Runtime object containing:

  • container: A div (with display: contents) holding the rendered content.
  • destroy(): A function that unmounts the view and cleans up all internal effects/listeners.

πŸ“– Usage Patterns ​

1. Basic Component Wrapper ​

When you wrap logic in $.view, SigPro creates a "boundary".

javascript
const myView = $.view(() => {
+  const count = $(0);
+  
+  // This effect is "owned" by this view
+  $.effect(() => console.log(count()));
+
+  return Div([
+    H1("Internal View"),
+    Button({ onclick: () => count(c => c + 1) }, "Add")
+  ]);
+});
+
+// To show it:
+document.body.appendChild(myView.container);
+
+// To kill it (removes from DOM and stops all internal effects):
+myView.destroy();

2. Manual Cleanups with onCleanup ​

The renderFn receives a helper object that allows you to register custom cleanup logic (like closing a WebSocket or a third-party library instance).

javascript
const ChartComponent = () => $.view(({ onCleanup }) => {
+  const socket = new WebSocket("ws://...");
+
+  onCleanup(() => {
+    socket.close();
+    console.log("Cleanup: WebSocket closed");
+  });
+
+  return Div({ class: "chart-container" });
+});

πŸ—οΈ Internal Architecture ​

When $.view is called, it performs the following:

  1. Isolation: It creates a new Set of cleanups.
  2. Execution: It runs your function and captures any $.effect or child $.view created during execution.
  3. Container: It wraps the result in a display: contents element (which doesn't affect your CSS layout).
  4. Disposal: When destroy() is called, it recursively calls all cleanup functions and removes the container from the DOM.

πŸ’‘ Why use $.view? ​

  • Automatic Cleanup: You don't have to manually stop every effect when a user navigates away.
  • Router Integration: The SigPro Router ($.router) uses $.view internally to swap pages and clean up the previous one automatically.
  • Performance: It ensures that background processes (like intervals or observers) stop as soon as the element is no longer visible.
+ + + + \ No newline at end of file diff --git a/docs/assets/api__.md.BV8uIOD5.js b/docs/assets/api__.md.BV8uIOD5.js deleted file mode 100644 index f70a3e5..0000000 --- a/docs/assets/api__.md.BV8uIOD5.js +++ /dev/null @@ -1,59 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"The Reactive Core: $( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/$.md","filePath":"api/$.md"}'),e={name:"api/$.md"};function l(h,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n(`

The Reactive Core: $( ) ​

The $ function is a Unified Reactive Constructor. It detects the type of input you provide and returns the appropriate reactive primitive.


1. Signals (Atomic State) ​

A Signal is the simplest form of reactivity. It holds a single value (string, number, boolean, null).

Option A: Standard Signal (RAM) ​

Ideal for volatile state that shouldn't persist after a page refresh.

javascript
const $count = $(0); 
-
-// Usage:
-$count();           // Getter: returns 0
-$count(10);         // Setter: updates to 10
-$count(c => c + 1); // Functional update: updates to 11

Option B: Persistent Signal (Disk) ​

By adding a key, SigPro links the signal to localStorage.

javascript
// Syntax: $(initialValue, "storage-key")
-const $theme = $("light", "app-theme"); 
-
-// It restores the value from disk automatically on load.
-// When you update it, it saves to disk instantly:
-$theme("dark"); // localStorage.getItem("app-theme") is now "dark"

2. Stores (Reactive Objects) ​

A Store is a proxy that wraps an Object. SigPro makes every property reactive recursively. You access and set properties as if they were individual signals.

Option A: Standard Store (RAM) ​

javascript
const user = $({ 
-  name: "Alice", 
-  profile: { bio: "Developer" } 
-});
-
-// Getter: Call the property as a function
-console.log(user.name()); // "Alice"
-
-// Setter: Pass the value to the property function
-user.name("Bob"); 
-
-// Nested updates work exactly the same:
-user.profile.bio("Architect");

Option B: Persistent Store (Disk) ​

The most powerful way to save complex state. The entire object tree is serialized to JSON and kept in sync with the disk.

javascript
const settings = $({ 
-  volume: 50, 
-  notifications: true 
-}, "user-settings");
-
-// Any change in the object triggers a disk sync:
-settings.volume(100); // The whole JSON is updated in localStorage

3. Stores (Reactive Arrays) ​

When you pass an Array, SigPro tracks changes to the list. You can use standard methods or access indexes as reactive getters.

javascript
const $list = $(["Item 1", "Item 2"]);
-
-// Get by index
-console.log($list[0]()); // "Item 1"
-
-// Update by index
-$list[0]("Updated Item");
-
-// Note: For adding/removing items, use standard array methods 
-// which SigPro makes reactive (push, pop, splice, etc.)

4. Computed (Derived Logic) ​

A Computed Signal is a read-only value that depends on other signals. It is defined by passing a function that returns a value.

javascript
const $price = $(100);
-const $tax = $(0.21);
-
-// This function HAS a return statement
-const $total = $(() => {
-  return $price() * (1 + $tax());
-});
-
-// Usage (Read-only):
-console.log($total()); // 121
-
-$price(200);
-console.log($total()); // 242 (Auto-updated)

5. Effects (Reactive Actions) ​

An Effect is used for side-effects. It is defined by passing a function that does NOT return a value. It runs once immediately and then re-runs whenever its dependencies change.

javascript
const $name = $("Alice");
-
-// This function has NO return statement (Side-effect)
-$(() => {
-  console.log("The name changed to:", $name());
-  document.title = \`Profile: \${$name()}\`;
-});
-
-$name("Bob"); // Triggers the console.log and updates document.title

6. Summary: Input Mapping ​

If you pass...SigPro creates a...Access Method
A ValueSignal$var() / $var(val)
An ObjectStoreobj.prop() / obj.prop(val)
An ArrayArray Storearr[i]() / arr.push()
Function (returns)Computed$comp() (Read-only)
Function (no return)EffectAutomatically executed

πŸ’‘ Naming Convention: The $ Prefix ​

To keep your code clean, always prefix your reactive variables with $. This tells you at a glance that you need to call it as a function to get its value.

javascript
const name = "Static";   // Just a string
-const $name = $("Alice"); // A Reactive Signal
`,38)])])}const c=i(e,[["render",l]]);export{g as __pageData,c as default}; diff --git a/docs/assets/api__.md.BV8uIOD5.lean.js b/docs/assets/api__.md.BV8uIOD5.lean.js deleted file mode 100644 index d09e3f1..0000000 --- a/docs/assets/api__.md.BV8uIOD5.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"The Reactive Core: $( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/$.md","filePath":"api/$.md"}'),e={name:"api/$.md"};function l(h,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n("",38)])])}const c=i(e,[["render",l]]);export{g as __pageData,c as default}; diff --git a/docs/assets/api_effect.md.jV8KzXq5.js b/docs/assets/api_effect.md.jV8KzXq5.js new file mode 100644 index 0000000..ccae179 --- /dev/null +++ b/docs/assets/api_effect.md.jV8KzXq5.js @@ -0,0 +1,33 @@ +import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const E=JSON.parse('{"title":"⚑ Side Effects: $.effect( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/effect.md","filePath":"api/effect.md"}'),e={name:"api/effect.md"};function h(l,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n(`

⚑ Side Effects: $.effect( ) ​

The $.effect function allows you to run a piece of code whenever the signals it depends on are updated. It automatically tracks any signal called within its body.

πŸ›  Function Signature ​

typescript
$.effect(callback: Function): StopFunction
ParameterTypeRequiredDescription
callbackFunctionYesThe code to run. It will execute immediately and then re-run on dependency changes.

Returns: A StopFunction that, when called, cancels the effect and prevents further executions.


πŸ“– Usage Patterns ​

1. Basic Tracking ​

Any signal you "touch" inside the effect becomes a dependency.

javascript
const count = $(0);
+
+$.effect(() => {
+  // This runs every time 'count' changes
+  console.log(\`The count is now: \${count()}\`);
+});
+
+count(1); // Console: "The count is now: 1"

2. Manual Cleanup ​

If your effect creates something that needs to be destroyed (like a timer or a global event listener), you can return a cleanup function.

javascript
$.effect(() => {
+  const timer = setInterval(() => console.log("Tick"), 1000);
+
+  // SigPro will run this BEFORE the next effect execution 
+  // or when the effect is stopped.
+  return () => clearInterval(timer);
+});

3. Nesting & Automatic Cleanup ​

If you create a signal or another effect inside an effect, SigPro tracks them as "children". When the parent effect re-runs or stops, all children are automatically cleaned up to prevent memory leaks.

javascript
$.effect(() => {
+  if (isLoggedIn()) {
+    // This sub-effect is only active while 'isLoggedIn' is true
+    $.effect(() => {
+      console.log("Fetching user data...");
+    });
+  }
+});

πŸ›‘ Stopping an Effect ​

You can stop an effect manually by calling the function it returns. This is useful for one-time operations or complex logic.

javascript
const stop = $.effect(() => {
+  console.log(count());
+});
+
+// Later...
+stop(); // The effect is destroyed and will never run again.

πŸ’‘ Pro Tip: Batching ​

SigPro uses a Microtask Queue to handle updates. If you update multiple signals at once, the effect will only run once at the end of the current task.

javascript
const a = $(0);
+const b = $(0);
+
+$.effect(() => console.log(a(), b()));
+
+// This triggers only ONE re-run, not two.
+a(1);
+b(2);
`,25)])])}const o=i(e,[["render",h]]);export{E as __pageData,o as default}; diff --git a/docs/assets/api_effect.md.jV8KzXq5.lean.js b/docs/assets/api_effect.md.jV8KzXq5.lean.js new file mode 100644 index 0000000..d8769e3 --- /dev/null +++ b/docs/assets/api_effect.md.jV8KzXq5.lean.js @@ -0,0 +1 @@ +import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const E=JSON.parse('{"title":"⚑ Side Effects: $.effect( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/effect.md","filePath":"api/effect.md"}'),e={name:"api/effect.md"};function h(l,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n("",25)])])}const o=i(e,[["render",h]]);export{E as __pageData,o as default}; diff --git a/docs/assets/api_html.md.-lEpgX-Z.js b/docs/assets/api_html.md.-lEpgX-Z.js deleted file mode 100644 index 0925874..0000000 --- a/docs/assets/api_html.md.-lEpgX-Z.js +++ /dev/null @@ -1,22 +0,0 @@ -import{_ as s,o as i,c as a,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Rendering Engine: $.html","description":"","frontmatter":{},"headers":[],"relativePath":"api/html.md","filePath":"api/html.md"}'),n={name:"api/html.md"};function l(h,t,r,d,p,o){return i(),a("div",null,[...t[0]||(t[0]=[e(`

Rendering Engine: $.html ​

The $.html function is the architect of your UI. It creates standard HTML elements and wires them directly to your signals without the need for a Virtual DOM.

1. Syntax: $.html(tag, [props], [content]) ​

ParameterTypeRequiredDescription
tagstringYesAny valid HTML5 tag (e.g., 'div', 'button', 'input').
propsObjectNoAttributes, event listeners, and reactive bindings.
contentanyNoText, Nodes, Arrays, or Reactive Functions.

Example: ​

javascript
const myButton = $.html('button', { class: 'btn-primary' }, 'Click me');

2. Global Tag Helpers ​

To avoid repetitive $.html calls, SigPro automatically exposes common tags to the global window object. This allows for a clean, declarative syntax.

javascript
// Instead of $.html('div', ...), just use:
-div({ id: 'wrapper' }, [
-  h1("Welcome"),
-  p("This is SigPro.")
-]);

3. Handling Properties & Attributes ​

SigPro distinguishes between static attributes and reactive bindings using the $ prefix.

Static vs. Reactive Attributes ​

  • Static: Applied once during creation.
  • Reactive ($): Automatically updates the DOM when the signal changes.
PropertySyntaxResult
Attribute{ id: 'main' }id="main"
Event{ onclick: fn }Adds an event listener.
Reactive Attr{ $class: $theme }Updates class whenever $theme() changes.
Boolean Attr{ $disabled: $isBusy }Toggles the disabled attribute automatically.

4. Two-Way Data Binding ​

For form inputs, SigPro provides a powerful shortcut using $value or $checked. It automatically handles the event listening and the value synchronization.

javascript
const $text = $("Type here...");
-
-input({ 
-  type: 'text', 
-  $value: $text // Syncs input -> signal and signal -> input
-});
-
-p(["You typed: ", $text]);

5. Reactive Content (Dynamic Children) ​

The content argument is incredibly flexible. If you pass a function, SigPro treats it as a reactive "portal" that re-renders only that specific part of the DOM.

Text & Nodes ​

javascript
const $count = $(0);
-
-// Text node updates surgically
-div(["Count: ", $count]); 
-
-// Conditional rendering with a function
-div(() => {
-  return $count() > 10 
-    ? h1("High Score!") 
-    : p("Keep going...");
-});

The "Guillotine" (Performance Tip) ​

When a reactive function in the content returns a new Node, SigPro uses replaceWith() to swap the old node for the new one. This ensures that:

  1. The update is nearly instantaneous.
  2. The old node is correctly garbage-collected.

6. Summary: Content Types ​

InputBehavior
String / NumberAppended as a TextNode.
HTMLElementAppended directly to the parent.
ArrayEach item is processed and appended in order.
Function () => ...Creates a live reactive zone that updates automatically.
`,31)])])}const g=s(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_html.md.-lEpgX-Z.lean.js b/docs/assets/api_html.md.-lEpgX-Z.lean.js deleted file mode 100644 index 8f9d825..0000000 --- a/docs/assets/api_html.md.-lEpgX-Z.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,o as i,c as a,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Rendering Engine: $.html","description":"","frontmatter":{},"headers":[],"relativePath":"api/html.md","filePath":"api/html.md"}'),n={name:"api/html.md"};function l(h,t,r,d,p,o){return i(),a("div",null,[...t[0]||(t[0]=[e("",31)])])}const g=s(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_html.md.COPskx0H.js b/docs/assets/api_html.md.COPskx0H.js new file mode 100644 index 0000000..90717ae --- /dev/null +++ b/docs/assets/api_html.md.COPskx0H.js @@ -0,0 +1,24 @@ +import{_ as i,o as t,c as a,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"πŸ—οΈ The DOM Factory: $.html( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/html.md","filePath":"api/html.md"}'),n={name:"api/html.md"};function l(h,s,p,r,k,o){return t(),a("div",null,[...s[0]||(s[0]=[e(`

πŸ—οΈ The DOM Factory: $.html( ) ​

$.html is the internal engine that creates, attributes, and attaches reactivity to DOM elements. It is the foundation for all Tag Constructors in SigPro.

πŸ›  Function Signature ​

typescript
$.html(tagName: string, props?: Object, children?: any[] | any): HTMLElement
ParameterTypeRequiredDescription
tagNamestringYesValid HTML tag name (e.g., "div", "button").
propsObjectNoHTML attributes, event listeners, and reactive bindings.
childrenanyNoNested elements, text strings, or reactive functions.

πŸ“– Key Features ​

1. Attribute Handling ​

SigPro intelligently decides how to apply each property:

  • Standard Props: Applied via setAttribute or direct property assignment.
  • Boolean Props: Uses toggleAttribute (e.g., checked, disabled, hidden).
  • Class Names: Supports class or className interchangeably.

2. Event Listeners & Modifiers ​

Events are defined by the on prefix. SigPro supports Dot Notation for common event operations:

javascript
$.html("button", {
+  // e.preventDefault() is called automatically
+  "onsubmit.prevent": (e) => save(e), 
+  
+  // e.stopPropagation() is called automatically
+  "onclick.stop": () => console.log("No bubbling"),
+  
+  // { once: true } listener option
+  "onclick.once": () => console.log("Runs only once")
+}, "Click Me");

3. Reactive Attributes ​

If an attribute value is a function (like a Signal), $.html creates an internal $.effect to keep the DOM in sync with the state.

javascript
$.html("div", {
+  // Updates the class whenever 'theme()' changes
+  class: () => theme() === "dark" ? "bg-black" : "bg-white"
+});

4. Reactive Children ​

Children can be static or dynamic. When a child is a function, SigPro creates a reactive boundary for that specific part of the DOM.

javascript
$.html("div", {}, [
+  H1("Static Title"),
+  // Only this text node re-renders when 'count' changes
+  () => \`Current count: \${count()}\`
+]);

πŸ”„ Two-Way Binding Operator ($) ​

When a property starts with $, $.html enables bidirectional synchronization. This is primarily used for form inputs.

javascript
$.html("input", {
+  type: "text",
+  $value: username // Syncs input value <-> signal
+});

🧹 Automatic Cleanup ​

Every element created with $.html gets a hidden ._cleanups property (a Set).

  • When SigPro removes an element via $.view or $.router, it automatically executes all functions stored in this Set (stopping effects, removing listeners, etc.).

πŸ’‘ Tag Constructors (The Shortcuts) ​

Instead of writing $.html("div", ...) every time, SigPro provides PascalCase global functions:

javascript
// This:
+Div({ class: "wrapper" }, [ Span("Hello") ])
+
+// Is exactly equivalent to:
+$.html("div", { class: "wrapper" }, [ $.html("span", {}, "Hello") ])
`,30)])])}const E=i(n,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/assets/api_html.md.COPskx0H.lean.js b/docs/assets/api_html.md.COPskx0H.lean.js new file mode 100644 index 0000000..f4b5067 --- /dev/null +++ b/docs/assets/api_html.md.COPskx0H.lean.js @@ -0,0 +1 @@ +import{_ as i,o as t,c as a,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"πŸ—οΈ The DOM Factory: $.html( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/html.md","filePath":"api/html.md"}'),n={name:"api/html.md"};function l(h,s,p,r,k,o){return t(),a("div",null,[...s[0]||(s[0]=[e("",30)])])}const E=i(n,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/assets/api_ignore.md.CxKek-H-.js b/docs/assets/api_ignore.md.CxKek-H-.js new file mode 100644 index 0000000..4bf442b --- /dev/null +++ b/docs/assets/api_ignore.md.CxKek-H-.js @@ -0,0 +1,27 @@ +import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"πŸ›‘ Untracking: $.ignore( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/ignore.md","filePath":"api/ignore.md"}'),e={name:"api/ignore.md"};function l(h,s,p,k,r,g){return a(),n("div",null,[...s[0]||(s[0]=[t(`

πŸ›‘ Untracking: $.ignore( ) ​

The $.ignore function allows you to read a signal's value inside an effect or a computed signal without creating a dependency.

πŸ›  Function Signature ​

typescript
$.ignore(callback: Function): any
ParameterTypeRequiredDescription
callbackFunctionYesA function where signals can be read "silently".

Returns: Whatever the callback function returns.


πŸ“– Usage Patterns ​

1. Preventing Dependency Tracking ​

Normally, reading a signal inside $.effect makes the effect re-run when that signal changes. $.ignore breaks this link.

javascript
const count = $(0);
+const logLabel = $("System Log");
+
+$.effect(() => {
+  // This effect tracks 'count'...
+  const currentCount = count();
+  
+  // ...but NOT 'logLabel'. 
+  // Changing 'logLabel' will NOT re-run this effect.
+  const label = $.ignore(() => logLabel());
+  
+  console.log(\`\${label}: \${currentCount}\`);
+});
+
+count(1);     // Console: "System Log: 1" (Triggers re-run)
+logLabel("UI"); // Nothing happens in console (Ignored)

2. Reading State in Event Handlers ​

Inside complex UI logic, you might want to take a "snapshot" of a signal without triggering a reactive chain.

javascript
const handleClick = () => {
+  // Accessing state without letting the caller know we touched it
+  const data = $.ignore(() => mySignal());
+  process(data);
+};

3. Avoiding Infinite Loops ​

If you need to write to a signal based on its own value inside an effect (and you aren't using the functional updater), $.ignore prevents the effect from triggering itself.

javascript
$.effect(() => {
+  const value = someSignal();
+  
+  if (value > 100) {
+    // We update the signal, but we ignore the read to avoid a loop
+    $.ignore(() => someSignal(0));
+  }
+});

πŸ’‘ Why use it? ​

  • Performance: Prevents expensive effects from running when non-essential data changes.
  • Logic Control: Allows "sampling" a signal at a specific point in time.
  • Safety: Essential for complex state orchestrations where circular dependencies might occur.
`,20)])])}const c=i(e,[["render",l]]);export{o as __pageData,c as default}; diff --git a/docs/assets/api_ignore.md.CxKek-H-.lean.js b/docs/assets/api_ignore.md.CxKek-H-.lean.js new file mode 100644 index 0000000..2ce2684 --- /dev/null +++ b/docs/assets/api_ignore.md.CxKek-H-.lean.js @@ -0,0 +1 @@ +import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"πŸ›‘ Untracking: $.ignore( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/ignore.md","filePath":"api/ignore.md"}'),e={name:"api/ignore.md"};function l(h,s,p,k,r,g){return a(),n("div",null,[...s[0]||(s[0]=[t("",20)])])}const c=i(e,[["render",l]]);export{o as __pageData,c as default}; diff --git a/docs/assets/api_mount.md.B9mWME6o.js b/docs/assets/api_mount.md.B9mWME6o.js deleted file mode 100644 index 45cf2cb..0000000 --- a/docs/assets/api_mount.md.B9mWME6o.js +++ /dev/null @@ -1,29 +0,0 @@ -import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Application Mounter: $.mount","description":"","frontmatter":{},"headers":[],"relativePath":"api/mount.md","filePath":"api/mount.md"}'),n={name:"api/mount.md"};function l(h,s,p,o,r,k){return a(),t("div",null,[...s[0]||(s[0]=[e(`

Application Mounter: $.mount ​

The $.mount function is the entry point of your reactive world. It takes a SigPro component (or a plain DOM node) and injects it into the real document, bridging the gap between your logic and the browser.

1. Syntax: $.mount(node, [target]) ​

ParameterTypeDefaultDescription
nodeHTMLElement or FunctionRequiredThe component or element to render.
targetstring or HTMLElementdocument.bodyWhere to mount the app (CSS selector or Element).

2. Usage Scenarios ​

A. The "Clean Slate" (Main Entry) ​

In a modern app, you usually want to control the entire page. By default, $.mount clears the target's existing HTML before mounting your application.

javascript
// src/main.js
-import { $ } from 'sigpro';
-import App from './App.js';
-
-// SigPro: No .then() needed, global tags are ready immediately
-$.mount(App);

B. Targeting a Specific Container ​

If you have an existing HTML structure and want SigPro to manage only a specific section (like a #root div), pass a CSS selector or a reference.

html
<div id="sidebar"></div>
-<div id="app-root"></div>
javascript
// Mount to a specific ID
-$.mount(MyComponent, '#app-root');
-
-// Or using a direct DOM reference
-const sidebar = document.getElementById('sidebar');
-$.mount(SidebarComponent, sidebar);

3. Creating "Reactive Islands" ​

One of SigPro's strengths is its ability to work alongside "Old School" static HTML. You can inject a reactive widget into any part of a legacy page.

javascript
// A small reactive widget
-const CounterWidget = () => {
-  const $c = $(0);
-  return button({ onclick: () => $c(v => v + 1) }, [
-    "Clicks: ", $c
-  ]);
-};
-
-// Mount it into an existing div in your static HTML
-$.mount(CounterWidget, '#counter-container');

4. How it Works (Lifecycle) ​

When $.mount is called, it performs three critical steps:

  1. Resolution: If you passed a Function, it executes it once to generate the initial DOM node.
  2. Clearance: It sets target.innerHTML = ''. This prevents "zombie" HTML or static placeholders from interfering with your app.
  3. Injection: It appends the resulting node to the target.

5. Global vs. Local Scope ​

Global (The "Framework" Way) ​

In a standard Vite project, you initialize SigPro in your entry file. This makes $ and the tag helpers (div, button, etc.) available globally for a clean, declarative developer experience.

javascript
// src/main.js
-import { $ } from 'sigpro'; 
-
-// Any component in any file can now use:
-$.mount(() => h1("Global App"));

Local (The "Library" Way) ​

If you prefer to avoid polluting the window object, you can import and use SigPro locally within specific modules.

javascript
// widget.js
-import { $ } from 'sigpro';
-
-const myNode = $.html('div', 'Local Widget');
-$.mount(myNode, '#widget-target');

6. Summary Cheat Sheet ​

GoalCode
Mount to body$.mount(App)
Mount to ID$.mount(App, '#id')
Mount to Element$.mount(App, myElement)
Direct Function$.mount(() => div("Hi"), '#widget')
`,32)])])}const g=i(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_mount.md.B9mWME6o.lean.js b/docs/assets/api_mount.md.B9mWME6o.lean.js deleted file mode 100644 index 63c3b19..0000000 --- a/docs/assets/api_mount.md.B9mWME6o.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Application Mounter: $.mount","description":"","frontmatter":{},"headers":[],"relativePath":"api/mount.md","filePath":"api/mount.md"}'),n={name:"api/mount.md"};function l(h,s,p,o,r,k){return a(),t("div",null,[...s[0]||(s[0]=[e("",32)])])}const g=i(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_mount.md.CRwLyxt8.js b/docs/assets/api_mount.md.CRwLyxt8.js new file mode 100644 index 0000000..12cd788 --- /dev/null +++ b/docs/assets/api_mount.md.CRwLyxt8.js @@ -0,0 +1,27 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"πŸ”Œ Application Mounter: $.mount( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/mount.md","filePath":"api/mount.md"}'),n={name:"api/mount.md"};function l(h,s,p,o,r,k){return a(),t("div",null,[...s[0]||(s[0]=[e(`

πŸ”Œ Application Mounter: $.mount( ) ​

The $.mount function is the entry point of your reactive world. It bridges the gap between your SigPro logic and the browser's Real DOM by injecting a component into the document.

1. Function Signature ​

typescript
$.mount(node: Function | HTMLElement, target?: string | HTMLElement): RuntimeObject
ParameterTypeDefaultDescription
nodeFunction or NodeRequiredThe component function or DOM element to render.
targetstring or Nodedocument.bodyCSS selector or DOM element where the app will live.

Returns: A Runtime object containing the container and a destroy() method.


2. Common Usage Scenarios ​

A. The "Clean Slate" (SPA Entry) ​

In a modern Single Page Application, you typically want SigPro to manage the entire view. By default, if no target is provided, it mounts to document.body.

javascript
import { $ } from './sigpro.js';
+import App from './App.js';
+
+// Mounts your main App component directly to the body
+$.mount(App);

B. Targeting a Specific Container ​

If your HTML has a predefined structure, you can tell SigPro exactly where to render by passing a CSS selector or a direct reference.

html
<div id="sidebar"></div>
+<main id="app-root"></main>
javascript
// Mount using a CSS selector
+$.mount(MyComponent, '#app-root');
+
+// Mount using a direct DOM reference
+const sidebar = document.querySelector('#sidebar');
+$.mount(SidebarComponent, sidebar);

C. Creating "Reactive Islands" ​

SigPro is excellent for "sprinkling" reactivity onto legacy or static pages. You can inject small reactive widgets into any part of an existing HTML layout.

javascript
// A small reactive widget
+const CounterWidget = () => {
+  const count = $(0);
+  return Button({ onclick: () => count(c => c + 1) }, [
+    "Clicks: ", count
+  ]);
+};
+
+// Mount it into a specific div in your static HTML
+$.mount(CounterWidget, '#counter-container');

3. How it Works (Lifecycle) ​

When $.mount is executed, it performs these critical steps:

  1. Resolution & Wrapping: If you pass a Function, SigPro wraps it in a $.view(). This starts tracking all internal signals and effects.
  2. Target Clearance: It uses target.replaceChildren(). This efficiently wipes any existing HTML or "zombie" nodes inside the target before mounting.
  3. Injection: The component's container is appended to the target.
  4. Memory Management: It stores the Runtime instance associated with that DOM element. If you call $.mount again on the same target, SigPro automatically destroys the previous app to prevent memory leaks.

4. Global vs. Local Scope ​

The "Framework" Way (Global) ​

By importing your core in your entry file, SigPro automatically initializes global Tag Constructors (Div, Span, H1, etc.). This allows for a clean, declarative DX across your entire project.

javascript
// main.js
+import './sigpro.js'; 
+
+// Now any file can simply do:
+$.mount(() => H1("Global SigPro App"));

The "Library" Way (Local) ​

If you prefer to avoid global variables, you can use the low-level $.html factory to create elements locally.

javascript
import { $ } from './sigpro.js';
+
+const myNode = $.html('div', { class: 'widget' }, 'Local Instance');
+$.mount(myNode, '#widget-target');

5. Summary Cheat Sheet ​

GoalCode Pattern
Mount to body$.mount(App)
Mount to ID$.mount(App, '#root')
Mount to Element$.mount(App, myElement)
Mount raw Node$.mount(Div("Hello"), '#id')
Unmount/Destroyconst app = $.mount(App); app.destroy();
`,33)])])}const g=i(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_mount.md.CRwLyxt8.lean.js b/docs/assets/api_mount.md.CRwLyxt8.lean.js new file mode 100644 index 0000000..56af600 --- /dev/null +++ b/docs/assets/api_mount.md.CRwLyxt8.lean.js @@ -0,0 +1 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"πŸ”Œ Application Mounter: $.mount( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/mount.md","filePath":"api/mount.md"}'),n={name:"api/mount.md"};function l(h,s,p,o,r,k){return a(),t("div",null,[...s[0]||(s[0]=[e("",33)])])}const g=i(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_quick.md.4axUqmd3.js b/docs/assets/api_quick.md.4axUqmd3.js new file mode 100644 index 0000000..d93ab24 --- /dev/null +++ b/docs/assets/api_quick.md.4axUqmd3.js @@ -0,0 +1 @@ +import{_ as e,o as a,c as n,ae as l}from"./chunks/framework.C8AWLET_.js";const f=JSON.parse('{"title":"⚑ Quick API Reference","description":"","frontmatter":{},"headers":[],"relativePath":"api/quick.md","filePath":"api/quick.md"}'),d={name:"api/quick.md"};function o(i,t,s,r,c,g){return a(),n("div",null,[...t[0]||(t[0]=[l('

⚑ Quick API Reference ​

SigPro is a high-performance micro-framework that updates the Real DOM surgically. No Virtual DOM, no unnecessary re-renders.

🟒 Core Functions ​

FunctionSignatureDescription
$(val, key?)(any, string?) => SignalCreates a Signal. If key is provided, it persists in localStorage.
$(fn)(function) => ComputedCreates a Computed Signal that auto-updates when its dependencies change.
$.effect(fn)(function) => stopFnRuns a side-effect that tracks signals. Returns a function to manually stop it.
$.html(tag, props, children)(string, object, any) => HTMLElementThe low-level DOM factory powering all tag constructors.
$.router(routes)(Array) => HTMLElementInitializes the hash-based router for SPAs.
$.go(path)(string) => voidProgrammatic navigation (e.g., $.go('/home')).
$.mount(comp, target)(any, string|Node) => RuntimeMounts the application into the specified DOM element.
$.ignore(fn)(function) => anyExecutes code without tracking any signals inside it.

πŸ—οΈ Element Constructors (Tags) ​

SigPro provides PascalCase wrappers for all standard HTML5 tags (e.g., Div, Span, Button).

Syntax Pattern ​

javascript
Tag({ attributes }, [children])

Attribute & Content Handling ​

PatternCode ExampleBehavior
Staticclass: "text-red"Standard HTML attribute string.
Reactivedisabled: isLoadingUpdates automatically when isLoading() changes.
Two-way$value: usernameSyncs input with signal both ways (Binding Operator).
TextP({}, () => count())Updates text node whenever count changes.
Booleanhidden: isHiddenToggles the attribute based on signal truthiness.
',11)])])}const u=e(d,[["render",o]]);export{f as __pageData,u as default}; diff --git a/docs/assets/api_quick.md.4axUqmd3.lean.js b/docs/assets/api_quick.md.4axUqmd3.lean.js new file mode 100644 index 0000000..3b1b7c5 --- /dev/null +++ b/docs/assets/api_quick.md.4axUqmd3.lean.js @@ -0,0 +1 @@ +import{_ as e,o as a,c as n,ae as l}from"./chunks/framework.C8AWLET_.js";const f=JSON.parse('{"title":"⚑ Quick API Reference","description":"","frontmatter":{},"headers":[],"relativePath":"api/quick.md","filePath":"api/quick.md"}'),d={name:"api/quick.md"};function o(i,t,s,r,c,g){return a(),n("div",null,[...t[0]||(t[0]=[l("",11)])])}const u=e(d,[["render",o]]);export{f as __pageData,u as default}; diff --git a/docs/assets/api_quick.md.OAEBn6rS.js b/docs/assets/api_quick.md.OAEBn6rS.js deleted file mode 100644 index 8d175ca..0000000 --- a/docs/assets/api_quick.md.OAEBn6rS.js +++ /dev/null @@ -1,68 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"Quick API Reference","description":"","frontmatter":{},"headers":[],"relativePath":"api/quick.md","filePath":"api/quick.md"}'),e={name:"api/quick.md"};function l(h,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n(`

Quick API Reference ​

SigPro is a minimal yet powerful engine. Here is a complete overview of its capabilities.

1. Core API Summary ​

FunctionDescriptionExample
$(val, key?)Creates a Signal, Computed, or Store (with optional persistence).const $n = $(0)
$.html()The base engine to create reactive HTMLElements.$.html('div', {}, 'Hi')
TagsGlobal helpers (div, span, button, etc.) built on top of $.html.div("Hello SigPro")
$.mount()Mounts a component into a target element (clears target first).$.mount(App, '#app')
$.router()Hash-based router with dynamic params and lazy loading.$.router(routes)
$.plugin()Extends SigPro or loads external scripts/plugins.$.plugin(MyPlugin)

2. The Power of $ (Reactivity) ​

The $ function adapts to whatever you pass to it:

Signals & Persistent State ​

Reactive values in RAM or synced with localStorage.

javascript
const $count = $(0);                      // Simple Signal
-const $theme = $('dark', 'app-theme');    // Persistent Signal (Disk)
-
-$count(10);             // Update value
-console.log($count());  // Get value: 10

Computed Signals ​

Read-only signals that update automatically when their dependencies change.

javascript
const $double = $(() => $count() * 2);

Reactive Stores (Objects + Disk) ​

Transforms an object into a reactive tree. If a key is provided, the entire structure persists.

javascript
// Store in RAM + Disk (Auto-syncs nested properties)
-const state = $({ 
-  user: { name: 'Natxo' }, 
-  settings: { dark: true } 
-}, 'my-app-state');
-
-// Accessing properties (they become signals)
-state.user.name();         // Get: 'Natxo'
-state.user.name('Guest');  // Set & Sync to Disk: 'my-app-state_user_name'

3. UI Creation: Constructor vs. Direct Tags ​

SigPro provides the $.html engine for defining any element and global "Sugar Tags" for rapid development.

javascript
// 1. DEFINE: Create a custom piece of UI
-// This returns a real DOM element ready to be used.
-const MyHero = $.html('section', { class: 'hero' }, [
-  h1("Internal Title")
-]);
-
-// 2. USE: Nest it inside other elements like a standard tag
-const Page = () => div([
-  MyHero, // We just drop the variable here
-  p("This paragraph is outside the Hero section.")
-]);
-
-$.mount(Page, '#app');
javascript
// Use pre-defined global tags to compose layouts instantly.
-// No need to define them, just call them.
-
-const Page = () => div({ id: 'main' }, [
-  section({ class: 'hero' }, [
-    h1("Direct Global Tag"),
-    p("Building UI without boilerplate.")
-  ]),
-  button({ onclick: () => alert('Hi!') }, "Click Me")
-]);
-
-$.mount(Page, '#app');

Technical Breakdown ​

  • $.html(tag, props, children): This is the core factory. Use it when you need to create an element dynamically or when working with Custom Elements / Web Components.
  • Global Tags (div, p, etc.): These are shortcut functions that SigPro injects into the window object. They internally call $.html for you, making your component code much cleaner and easier to read.

Key Difference ​

  • $.html: Acts as a constructor. Use it when you want to "bake" a specific structure (like a Section that always contains an H1) into a single variable.
  • Global Tags: Act as scaffolding. Use them to wrap different contents dynamically as you build your views.

Global Tags (Standard Syntax) ​

SigPro declares standard tags in the global scope so you don't have to import them.

javascript
const Card = (title, $val) => div({ class: 'card' }, [
-  h2(title),
-  p("Reactive content below:"),
-  input({ 
-    type: 'number', 
-    $value: $val, // Automatic Two-way binding
-    $style: () => $val() > 10 ? 'color: red' : 'color: green' 
-  })
-]);

4. Mounting: $.mount ​

The entry point of your application. It links your JavaScript logic to a specific DOM element.

html
<div id="app"></div>
javascript
// In your main.js
-const App = () => main([ 
-  h1("Welcome to SigPro"),
-  p("Everything here is reactive.")
-]);
-
-// Usage: $.mount(component, selectorOrElement)
-$.mount(App, '#app');

5. Navigation: $.router ​

A robust hash-based router (#/path) that handles view switching automatically.

javascript
const routes = [
-  { path: '/', component: Home },
-  { path: '/user/:id', component: (params) => h1(\`User ID: \${params.id}\`) },
-  { path: '/admin', component: () => import('./Admin.js') }, // Native Lazy Loading
-  { path: '*', component: () => p("404 - Not Found") }
-];
-
-// Initialize and mount the router
-$.mount($.router(routes), '#app');
-
-// Programmatic navigation
-$.router.go('/user/42');

6. Plugins: $.plugin ​

Extend the engine or load external dependencies.

javascript
// 1. Function-based plugin
-$.plugin(($) => {
-  $.myHelper = () => console.log("Plugin active!");
-});
-
-// 2. Load external scripts
-await $.plugin('https://cdn.example.com/library.js');
`,42)])])}const g=i(e,[["render",l]]);export{o as __pageData,g as default}; diff --git a/docs/assets/api_quick.md.OAEBn6rS.lean.js b/docs/assets/api_quick.md.OAEBn6rS.lean.js deleted file mode 100644 index 0d822dc..0000000 --- a/docs/assets/api_quick.md.OAEBn6rS.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"Quick API Reference","description":"","frontmatter":{},"headers":[],"relativePath":"api/quick.md","filePath":"api/quick.md"}'),e={name:"api/quick.md"};function l(h,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n("",42)])])}const g=i(e,[["render",l]]);export{o as __pageData,g as default}; diff --git a/docs/assets/api_router.md.BV6vPWg-.js b/docs/assets/api_router.md.BV6vPWg-.js deleted file mode 100644 index 2514d34..0000000 --- a/docs/assets/api_router.md.BV6vPWg-.js +++ /dev/null @@ -1,37 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const E=JSON.parse('{"title":"Routing Engine: $.router","description":"","frontmatter":{},"headers":[],"relativePath":"api/router.md","filePath":"api/router.md"}'),e={name:"api/router.md"};function h(l,s,k,p,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n(`

Routing Engine: $.router ​

The $.router is SigPro's high-performance, hash-based navigation system. It connects the browser's URL directly to your reactive signals, enabling seamless page transitions without full reloads.

1. Core Features ​

  • Hash-based: Works everywhere without special server configuration (using #/path).
  • Lazy Loading: Pages are only downloaded when the user visits the route, keeping the initial bundle under 2KB.
  • Reactive: The view updates automatically and surgically when the hash changes.
  • Dynamic Routes: Built-in support for parameters like /user/:id.

2. Syntax: $.router(routes) ​

ParameterTypeRequiredDescription
routesArray<Object>YesAn array of route definitions { path, component }.

3. Setting Up Routes ​

In your App.js (or a dedicated routes file), define your navigation map and inject it into your layout.

javascript
const routes = [
-  { path: '/', component: () => h1("Home Page") },
-  { 
-    path: '/admin', 
-    // Lazy Loading: This file is only fetched when needed
-    component: () => import('./pages/Admin.js') 
-  },
-  { path: '/user/:id', component: (params) => h2(\`User ID: \${params.id}\`) },
-  { path: '*', component: () => div("404 - Page Not Found") }
-];
-
-export default () => div([
-  header([
-    h1("SigPro App"),
-    nav([
-      button({ onclick: () => $.router.go('/') }, "Home"),
-      button({ onclick: () => $.router.go('/admin') }, "Admin")
-    ])
-  ]),
-  // The router returns a reactive div that swaps content
-  main($.router(routes)) 
-]);

4. Navigation ($.router.go) ​

To move between pages programmatically (e.g., inside an onclick event or after a successful fetch), use the $.router.go helper.

javascript
button({ 
-  onclick: () => $.router.go('/admin') 
-}, "Go to Admin")

5. How it Works (Under the Hood) ​

The router tracks the window.location.hash and uses a reactive signal to trigger a re-render of the specific area where $.router(routes) is placed.

  1. Match: It filters your route array to find the best fit, handling dynamic segments (:id) and fallbacks (*).
  2. Resolve: * If it's a standard function, it executes it immediately.
    • If it's a Promise (via import()), it renders a temporary Loading... state and swaps the content once the module arrives.
  3. Inject: It replaces the previous DOM node with the new page content surgically using replaceWith().

6. Integration with UI Components ​

Since the router is reactive, you can easily create "active" states in your navigation menus by checking the current hash.

javascript
// Example of a reactive navigation link
-const NavLink = (path, label) => {
-  const $active = $(() => window.location.hash === \`#\${path}\`);
-  
-  return button({ 
-    $class: () => $active() ? 'nav-active' : 'nav-link',
-    onclick: () => $.router.go(path) 
-  }, label);
-};
-
-nav([
-  NavLink('/', 'Home'),
-  NavLink('/settings', 'Settings')
-]);

7. Summary: Route Component Types ​

Component TypeBehavior
HTMLElementRendered immediately.
Function (params) => ...Executed with URL parameters and rendered.
Promise / import()Triggers Lazy Loading with a loading state.
String / NumberRendered as simple text inside a span.
`,26)])])}const g=i(e,[["render",h]]);export{E as __pageData,g as default}; diff --git a/docs/assets/api_router.md.BV6vPWg-.lean.js b/docs/assets/api_router.md.BV6vPWg-.lean.js deleted file mode 100644 index 92a0835..0000000 --- a/docs/assets/api_router.md.BV6vPWg-.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const E=JSON.parse('{"title":"Routing Engine: $.router","description":"","frontmatter":{},"headers":[],"relativePath":"api/router.md","filePath":"api/router.md"}'),e={name:"api/router.md"};function h(l,s,k,p,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n("",26)])])}const g=i(e,[["render",h]]);export{E as __pageData,g as default}; diff --git a/docs/assets/api_router.md.Cn98LjXO.js b/docs/assets/api_router.md.Cn98LjXO.js new file mode 100644 index 0000000..0c4a9bd --- /dev/null +++ b/docs/assets/api_router.md.Cn98LjXO.js @@ -0,0 +1,22 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"🚦 Routing: $.router( ) & $.go( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/router.md","filePath":"api/router.md"}'),n={name:"api/router.md"};function h(l,s,p,r,o,k){return a(),t("div",null,[...s[0]||(s[0]=[e(`

🚦 Routing: $.router( ) & $.go( ) ​

SigPro includes a built-in, lightweight Hash Router to create Single Page Applications (SPA). It manages the URL state, matches components to paths, and handles the lifecycle of your pages automatically.

πŸ›  Router Signature ​

typescript
$.router(routes: Route[]): HTMLElement

Route Object ​

PropertyTypeDescription
pathstringThe URL fragment (e.g., "/home", "/user/:id", or "*").
componentFunctionA function that returns a Tag or a $.view.

πŸ“– Usage Patterns ​

1. Defining Routes ​

The router returns a div element with the class .router-outlet. When the hash changes, the router destroys the previous view and mounts the new one inside this container.

javascript
const App = () => Div({ class: "app-layout" }, [
+  Navbar(),
+  // The router outlet is placed here
+  $.router([
+    { path: "/", component: Home },
+    { path: "/profile/:id", component: UserProfile },
+    { path: "*", component: NotFound }
+  ])
+]);

2. Dynamic Segments (:id) ​

When a path contains a colon (e.g., :id), the router parses that segment and passes it as an object to the component function.

javascript
// If the URL is #/profile/42
+const UserProfile = (params) => {
+  return H1(\`User ID is: \${params.id}\`); // Displays "User ID is: 42"
+};

🏎 Programmatic Navigation: $.go( ) ​

To navigate between pages without using an <a> tag, use $.go. This function updates the browser's hash, which in turn triggers the router to swap components.

Signature ​

typescript
$.go(path: string): void

Examples ​

javascript
// Navigate to a static path
+Button({ onclick: () => $.go("/") }, "Home")
+
+// Navigate to a dynamic path
+Button({ 
+  onclick: () => $.go(\`/profile/\${user.id}\`) 
+}, "View Profile")

⚑ Technical Behavior ​

  • Automatic Cleanup: Every time you navigate, the router calls .destroy() on the previous $.view. This ensures that all signals, effects, and event listeners from the old page are purged from memory.
  • Hash-Based: By using window.location.hash, SigPro works out-of-the-box on any static hosting (like GitHub Pages or Vercel) without needing server-side redirects.
  • Initial Load: On the first execution, $.router automatically reads the current hash or defaults to / if empty.

🎨 Styling the Outlet ​

Since the router returns a standard DOM element, you can style the transition or the container easily:

css
.router-outlet {
+  flex: 1;
+  padding: 2rem;
+  animation: fadeIn 0.2s ease-in;
+}
`,28)])])}const c=i(n,[["render",h]]);export{g as __pageData,c as default}; diff --git a/docs/assets/api_router.md.Cn98LjXO.lean.js b/docs/assets/api_router.md.Cn98LjXO.lean.js new file mode 100644 index 0000000..9e5fc68 --- /dev/null +++ b/docs/assets/api_router.md.Cn98LjXO.lean.js @@ -0,0 +1 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"🚦 Routing: $.router( ) & $.go( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/router.md","filePath":"api/router.md"}'),n={name:"api/router.md"};function h(l,s,p,r,o,k){return a(),t("div",null,[...s[0]||(s[0]=[e("",28)])])}const c=i(n,[["render",h]]);export{g as __pageData,c as default}; diff --git a/docs/assets/api_signal.md.BmorvARW.js b/docs/assets/api_signal.md.BmorvARW.js new file mode 100644 index 0000000..085a5b4 --- /dev/null +++ b/docs/assets/api_signal.md.BmorvARW.js @@ -0,0 +1,14 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"πŸ’Ž The Signal Function: $( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/signal.md","filePath":"api/signal.md"}'),n={name:"api/signal.md"};function l(h,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[e(`

πŸ’Ž The Signal Function: $( ) ​

The $( ) function is the core constructor of SigPro. It defines how data is stored, computed, and persisted.

πŸ›  Function Signature ​

typescript
$(initialValue: any, key?: string): Signal
+$(computation: Function): ComputedSignal
ParameterTypeRequiredDescription
initialValueanyYes*The starting value of your signal.
computationFunctionYes*A function that returns a value based on other signals.
keystringNoA unique name to persist the signal in localStorage.

*Either an initial value or a computation function must be provided.


πŸ“– Usage Patterns ​

1. Simple State ​

$(value) Creates a writable signal. It returns a function that acts as both getter and setter.

javascript
const count = $(0); 
+
+count();    // Read (0)
+count(10);  // Write (10)

2. Persistent State ​

$(value, key) Creates a writable signal that syncs with the browser's storage.

javascript
const theme = $("light", "app-theme"); 
+
+theme("dark"); // Automatically calls localStorage.setItem("app-theme", '"dark"')

Note: On page load, SigPro will prioritize the value found in localStorage over the initialValue.

3. Computed State (Derived) ​

$(function) Creates a read-only signal that updates automatically when any signal used inside it changes.

javascript
const price = $(100);
+const tax = $(0.21);
+
+// This tracks both 'price' and 'tax' automatically
+const total = $(() => price() * (1 + tax()));

πŸ”„ Updating with Logic ​

When calling the setter, you can pass an updater function to access the current value safely.

javascript
const list = $(["A", "B"]);
+
+// Adds "C" using the previous state
+list(prev => [...prev, "C"]);
`,22)])])}const c=i(n,[["render",l]]);export{g as __pageData,c as default}; diff --git a/docs/assets/api_signal.md.BmorvARW.lean.js b/docs/assets/api_signal.md.BmorvARW.lean.js new file mode 100644 index 0000000..2b191c2 --- /dev/null +++ b/docs/assets/api_signal.md.BmorvARW.lean.js @@ -0,0 +1 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"πŸ’Ž The Signal Function: $( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/signal.md","filePath":"api/signal.md"}'),n={name:"api/signal.md"};function l(h,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[e("",22)])])}const c=i(n,[["render",l]]);export{g as __pageData,c as default}; diff --git a/docs/assets/api_tags.md.VliNqepa.js b/docs/assets/api_tags.md.VliNqepa.js new file mode 100644 index 0000000..ad52efb --- /dev/null +++ b/docs/assets/api_tags.md.VliNqepa.js @@ -0,0 +1,36 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"🎨 Global Tag Helpers","description":"","frontmatter":{},"headers":[],"relativePath":"api/tags.md","filePath":"api/tags.md"}'),n={name:"api/tags.md"};function l(h,s,o,p,r,d){return a(),t("div",null,[...s[0]||(s[0]=[e(`

🎨 Global Tag Helpers ​

In SigPro, you don't need to manually type $.html('div', ...) for every element. To keep your code declarative and readable, the engine automatically generates Global Helper Functions for all standard HTML5 tags upon initialization.

1. How it Works ​

SigPro iterates through a manifest of standard HTML tags and attaches a wrapper function for each one directly to the window object. This creates a specialized DSL (Domain Specific Language) that looks like a template engine but is 100% standard JavaScript.

  • Under the hood: $.html('button', { onclick: ... }, 'Click')
  • SigPro Style: Button({ onclick: ... }, 'Click')

2. The Complete Global Registry ​

The following functions are injected into the global scope (using PascalCase to prevent naming collisions with common JS variables) and are ready to use:

CategoryAvailable Global Functions
StructureDiv, Span, P, Section, Nav, Main, Header, Footer, Article, Aside
TypographyH1 to H6, Ul, Ol, Li, Dl, Dt, Dd, Strong, Em, Code, Pre, Small, B, U, Mark
InteractiveButton, A, Label, Br, Hr, Details, Summary, Dialog
FormsForm, Input, Select, Option, Textarea, Fieldset, Legend
TablesTable, Thead, Tbody, Tr, Th, Td, Tfoot, Caption
MediaImg, Canvas, Video, Audio, Svg, Iframe, Picture, Source

The SigPro Philosophy: Tags are not "magic strings" handled by a compiler. They are functional constructors. Every time you call Div(), you execute a pure JS function that returns a real, reactive DOM element.


3. Usage Patterns (Smart Arguments) ​

SigPro tag helpers are flexible. They automatically detect if you are passing attributes, children, or both.

A. Attributes + Children ​

The standard way to build structured UI.

javascript
Div({ class: 'container', id: 'main' }, [
+  H1("Welcome to SigPro"),
+  P("The zero-VDOM framework.")
+]);

B. Children Only (The "Skipper") ​

If you don't need attributes, you can skip the object and pass the content (string, array, or function) directly as the first argument.

javascript
Section([
+  H2("Clean Syntax"),
+  Button("I have no props!")
+]);

C. Primitive Content ​

For simple tags, just pass a string or a number.

javascript
H1("Hello World"); 
+Span(42);

4. Reactive Power Examples ​

These helpers are natively wired into SigPro's reactivity. No manual useEffect or watch calls are needed.

Reactive Attributes ​

Simply pass a Signal (function) to any attribute. SigPro handles the rest.

javascript
const theme = $("light");
+
+Div({ 
+  // Updates 'class' automatically when theme() changes
+  class: () => \`app-box \${theme()}\` 
+}, "Themeable Box");

The Binding Operator ($) ​

Use the $ prefix for Two-Way Binding on inputs.

javascript
const search = $("");
+
+Input({ 
+  type: "text", 
+  placeholder: "Search...",
+  $value: search // UI updates Signal AND Signal updates UI
+});

Dynamic Lists ​

Combine tags with ui.For for high-performance list rendering.

javascript
const items = $(["Apple", "Banana", "Cherry"]);
+
+Ul({ class: "list-disc" }, [
+  ui.For(items, (item) => Li(item), (item) => item)
+]);

DANGER

⚠️ Important: Naming Conventions ​

Since SigPro injects these helpers into the global window object, follow these rules to avoid bugs:

  1. Avoid Shadowing: Don't name your local variables like the tags (e.g., const Div = ...). This will "hide" the SigPro helper.
  2. Custom Components: Always use PascalCase, UPPERCASE, or Underscore prefixes for your own component functions (e.g., UserCard, INPUT, or _Input) to distinguish them from the built-in Tag Helpers and avoid naming collisions.

6. Logic to UI Comparison ​

Here is how a dynamic User Status component translates from SigPro logic to the final DOM structure.

javascript
// SigPro Component
+const UserStatus = (name, $online) => (
+  Div({ class: 'flex items-center gap-2' }, [
+    Span({ 
+      // Boolean toggle for 'hidden' attribute
+      hidden: () => !$online(), 
+      class: 'w-3 h-3 bg-green-500 rounded-full' 
+    }),
+    P({ 
+      // Reactive text content
+      class: () => $online() ? "text-bold" : "text-gray-400" 
+    }, name)
+  ])
+);
State ($online)Rendered HTML
true<div class="flex..."><span class="w-3..."></span><p class="text-bold">John</p></div>
false<div class="flex..."><span hidden class="w-3..."></span><p class="text-gray-400">John</p></div>
`,41)])])}const g=i(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_tags.md.VliNqepa.lean.js b/docs/assets/api_tags.md.VliNqepa.lean.js new file mode 100644 index 0000000..b1d338e --- /dev/null +++ b/docs/assets/api_tags.md.VliNqepa.lean.js @@ -0,0 +1 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"🎨 Global Tag Helpers","description":"","frontmatter":{},"headers":[],"relativePath":"api/tags.md","filePath":"api/tags.md"}'),n={name:"api/tags.md"};function l(h,s,o,p,r,d){return a(),t("div",null,[...s[0]||(s[0]=[e("",41)])])}const g=i(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_tags.md.YLRdMyid.js b/docs/assets/api_tags.md.YLRdMyid.js deleted file mode 100644 index 0b18c15..0000000 --- a/docs/assets/api_tags.md.YLRdMyid.js +++ /dev/null @@ -1,31 +0,0 @@ -import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Global Tag Helpers","description":"","frontmatter":{},"headers":[],"relativePath":"api/tags.md","filePath":"api/tags.md"}'),n={name:"api/tags.md"};function l(h,s,o,p,d,k){return a(),t("div",null,[...s[0]||(s[0]=[e(`

Global Tag Helpers ​

In SigPro, you don't need to write $.html('div', ...) every time. To keep your code clean and readable, the engine automatically generates global helper functions for all standard HTML tags upon initialization.

1. How it Works ​

SigPro iterates through an internal manifest of standard HTML tags and attaches a wrapper function for each one directly to the window object. This creates a native "DSL" (Domain Specific Language) that looks like a template engine but is 100% standard JavaScript.

  • Under the hood: $.html('button', { onclick: ... }, 'Click')
  • SigPro Style: button({ onclick: ... }, 'Click')

2. The Complete Global Registry ​

The following tags are injected into the global scope and are ready to use as soon as SigPro loads:

CategoryAvailable Global Functions
Structurediv, span, p, section, nav, main, header, footer, article, aside
Typographyh1, h2, h3, h4, h5, h6, ul, ol, li, dl, dt, dd, strong, em, code, pre, small, i, b, u, mark
Interactivebutton, a, label, br, hr, details, summary
Formsform, input, select, option, textarea, fieldset, legend
Tablestable, thead, tbody, tr, th, td, tfoot, caption
Media & Graphicsimg, canvas, video, audio, svg, path, iframe

"In SigPro, tags are not 'magic' strings handled by a compiler. They are functional imitations of HTML elements. Every time you call div(), you are executing a standard JavaScript function that returns a real DOM element. This gives you the speed of a specialized DSL with the transparency of pure JS."

WARNING: GLOBAL NAMING COLLISIONS

Since SigPro injects these helpers directly into the window object, they are regular JavaScript functions. This means they can be overwritten.

If you declare a variable, constant, or function with the same name as an HTML tag (e.g., const div = ... or function p()), you will nullify or shadow the built-in SigPro helper for that tag in your current scope.

Best Practice: To avoid conflicts, always use PascalCase for your custom components (e.g., UserCard, AppHeader) to distinguish them from the lowercase global HTML helpers.


3. Usage Patterns (Argument Flexibility) ​

The tag functions are "smart". They detect whether you are passing attributes, content, or both.

A. Attributes + Content ​

The standard way to build complex nodes.

javascript
div({ class: 'container', id: 'main-wrapper' }, [
-  h1("Welcome"),
-  p("This is SigPro.")
-]);

B. Content Only (The "Skipper") ​

If you don't need attributes, you can pass the content (string, array, or function) as the first and only argument.

javascript
section([
-  h2("No Attributes Needed"),
-  button("Click Me")
-]);

C. Primitive Content ​

For simple tags, you can just pass a string or a number.

javascript
h1("Hello World"); 
-span(42);

4. Reactive Attributes & Content ​

These helpers fully support SigPro's reactivity. Attributes starting with $ are automatically tracked.

javascript
const $count = $(0);
-
-div({ class: 'counter-app' }, [
-  h2(["Current Count: ", $count]), // Auto-unwrapping text content
-  
-  button({ 
-    onclick: () => $count(c => c + 1),
-    $style: () => $count() > 5 ? "color: red" : "color: green" // Reactive style
-  }, "Increment")
-]);

5. Technical Implementation ​

As seen in the SigPro core, the engine registers these tags dynamically. This means zero imports are needed for UI creation in your component files.

javascript
// Internal SigPro loop
-tags.forEach(t => window[t] = (p, c) => $.html(t, p, c));

Because they are real functions, you get full IDE autocompletion and valid JS syntax highlighting without needing special plugins like JSX.


6. Comparison: Logic to UI ​

Here is how a dynamic Task Item component translates from SigPro logic to the final DOM structure.

javascript
const Task = (title, $done) => (
-  li({ class: 'task-item' }, [
-    input({ 
-      type: 'checkbox', 
-      $checked: $done // Two-way reactive binding
-    }),
-    span({ 
-      $style: () => $done() ? "text-decoration: line-through" : "" 
-    }, title)
-  ])
-);
html
<li class="task-item">
-  <input type="checkbox" checked>
-  <style="text-decoration: line-through">Buy milk</span>
-</li>
`,36)])])}const g=i(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_tags.md.YLRdMyid.lean.js b/docs/assets/api_tags.md.YLRdMyid.lean.js deleted file mode 100644 index 2c5cd6a..0000000 --- a/docs/assets/api_tags.md.YLRdMyid.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Global Tag Helpers","description":"","frontmatter":{},"headers":[],"relativePath":"api/tags.md","filePath":"api/tags.md"}'),n={name:"api/tags.md"};function l(h,s,o,p,d,k){return a(),t("div",null,[...s[0]||(s[0]=[e("",36)])])}const g=i(n,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/api_view.md.Bv8Rlx9s.js b/docs/assets/api_view.md.Bv8Rlx9s.js new file mode 100644 index 0000000..896a1b2 --- /dev/null +++ b/docs/assets/api_view.md.Bv8Rlx9s.js @@ -0,0 +1,26 @@ +import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"πŸ–ΌοΈ Component Lifecycle: $.view( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/view.md","filePath":"api/view.md"}'),e={name:"api/view.md"};function l(h,s,p,k,r,o){return a(),n("div",null,[...s[0]||(s[0]=[t(`

πŸ–ΌοΈ Component Lifecycle: $.view( ) ​

The $.view function is a specialized wrapper used to manage the lifecycle of a UI component. It tracks all signals, effects, and DOM elements created within it, providing a single point of destruction to prevent memory leaks.

πŸ›  Function Signature ​

typescript
$.view(renderFn: Function): RuntimeObject
ParameterTypeRequiredDescription
renderFnFunctionYesA function that returns a DOM Node or an array of Nodes.

Returns: A Runtime object containing:

  • container: A div (with display: contents) holding the rendered content.
  • destroy(): A function that unmounts the view and cleans up all internal effects/listeners.

πŸ“– Usage Patterns ​

1. Basic Component Wrapper ​

When you wrap logic in $.view, SigPro creates a "boundary".

javascript
const myView = $.view(() => {
+  const count = $(0);
+  
+  // This effect is "owned" by this view
+  $.effect(() => console.log(count()));
+
+  return Div([
+    H1("Internal View"),
+    Button({ onclick: () => count(c => c + 1) }, "Add")
+  ]);
+});
+
+// To show it:
+document.body.appendChild(myView.container);
+
+// To kill it (removes from DOM and stops all internal effects):
+myView.destroy();

2. Manual Cleanups with onCleanup ​

The renderFn receives a helper object that allows you to register custom cleanup logic (like closing a WebSocket or a third-party library instance).

javascript
const ChartComponent = () => $.view(({ onCleanup }) => {
+  const socket = new WebSocket("ws://...");
+
+  onCleanup(() => {
+    socket.close();
+    console.log("Cleanup: WebSocket closed");
+  });
+
+  return Div({ class: "chart-container" });
+});

πŸ—οΈ Internal Architecture ​

When $.view is called, it performs the following:

  1. Isolation: It creates a new Set of cleanups.
  2. Execution: It runs your function and captures any $.effect or child $.view created during execution.
  3. Container: It wraps the result in a display: contents element (which doesn't affect your CSS layout).
  4. Disposal: When destroy() is called, it recursively calls all cleanup functions and removes the container from the DOM.

πŸ’‘ Why use $.view? ​

  • Automatic Cleanup: You don't have to manually stop every effect when a user navigates away.
  • Router Integration: The SigPro Router ($.router) uses $.view internally to swap pages and clean up the previous one automatically.
  • Performance: It ensures that background processes (like intervals or observers) stop as soon as the element is no longer visible.
`,22)])])}const E=i(e,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/assets/api_view.md.Bv8Rlx9s.lean.js b/docs/assets/api_view.md.Bv8Rlx9s.lean.js new file mode 100644 index 0000000..a703845 --- /dev/null +++ b/docs/assets/api_view.md.Bv8Rlx9s.lean.js @@ -0,0 +1 @@ +import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"πŸ–ΌοΈ Component Lifecycle: $.view( )","description":"","frontmatter":{},"headers":[],"relativePath":"api/view.md","filePath":"api/view.md"}'),e={name:"api/view.md"};function l(h,s,p,k,r,o){return a(),n("div",null,[...s[0]||(s[0]=[t("",22)])])}const E=i(e,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/assets/install.md.pJydCe65.js b/docs/assets/install.md.DmlvO98W.js similarity index 57% rename from docs/assets/install.md.pJydCe65.js rename to docs/assets/install.md.DmlvO98W.js index 39df70b..5f996a7 100644 --- a/docs/assets/install.md.pJydCe65.js +++ b/docs/assets/install.md.DmlvO98W.js @@ -1,16 +1,23 @@ -import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"Installation & Setup","description":"","frontmatter":{},"headers":[],"relativePath":"install.md","filePath":"install.md"}'),l={name:"install.md"};function p(h,s,e,k,r,d){return a(),n("div",null,[...s[0]||(s[0]=[t(`

Installation & Setup ​

SigPro is designed to be drop-in ready. Whether you are building a complex application with a bundler or a simple reactive widget in a single HTML file, SigPro scales with your needs.

1. Installation ​

Choose the method that best fits your workflow:

bash
npm install sigpro
bash
pnpm add sigpro
bash
yarn add sigpro
bash
bun add sigpro
html
<script type="module">
+import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Installation & Setup","description":"","frontmatter":{},"headers":[],"relativePath":"install.md","filePath":"install.md"}'),l={name:"install.md"};function e(h,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n(`

Installation & Setup ​

SigPro is designed to be drop-in ready. Whether you are building a complex application with a bundler or a simple reactive widget in a single HTML file, SigPro scales with your needs.

1. Installation ​

Choose the method that best fits your workflow:

bash
npm install sigpro
bash
pnpm add sigpro
bash
yarn add sigpro
bash
bun add sigpro
html
<script type="module">
+  // Import the core and UI components
   import { $ } from 'https://cdn.jsdelivr.net/npm/sigpro@latest/+esm';
-</script>

2. Quick Start Examples ​

Depending on your installation method, here is how you can get SigPro running in seconds.

javascript
// File: App.js
+  import { UI } from 'https://cdn.jsdelivr.net/npm/sigpro@latest/ui/+esm';
+  
+  // Initialize UI components globally
+  UI($);
+</script>

2. Quick Start Examples ​

SigPro uses PascalCase for Tag Helpers (e.g., Div, Button) to provide a clean, component-like syntax without needing JSX.

javascript
// File: App.js
 import { $ } from 'sigpro'; 
 
 export const App = () => {
-  // $ is global, but we import it for better IDE intellisense
   const $count = $(0);
   
-  // Tags like div, h1, button are available globally
-  return div({ class: 'card' }, [
-    h1(["Count is: ", $count]),
-    button({ onclick: () => $count(c => c + 1) }, "Increment")
+  // Tag Helpers like Div, H1, Button are available globally
+  return Div({ class: 'card p-4' }, [
+    H1(["Count is: ", $count]),
+    Button({ 
+      class: 'btn btn-primary',
+      onclick: () => $count(c => c + 1) 
+    }, "Increment")
   ]);
 };
 
@@ -24,16 +31,16 @@ import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const o
   <div id="app"></div>
 
   <script type="module">
-    // Import directly from CDN
     import { $ } from 'https://cdn.jsdelivr.net/npm/sigpro@latest/+esm';
 
     const $name = $("Developer");
 
-    // No need to import div, section, h2, input... they are global!
-    const App = () => section([
-      h2(["Welcome, ", $name]),
-      input({ 
+    // No need to import Div, Section, H2, Input... they are global!
+    const App = () => Section({ class: 'container' }, [
+      H2(["Welcome, ", $name]),
+      Input({ 
         type: 'text', 
+        class: 'input input-bordered',
         $value: $name, // Automatic two-way binding
         placeholder: 'Type your name...' 
       })
@@ -42,4 +49,4 @@ import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const o
     $.mount(App, '#app');
   </script>
 </body>
-</html>

3. Global by Design ​

One of SigPro's core strengths is its Global API.

  • The $ Function: Once loaded, it attaches itself to window.$. While you can use import for better IDE support and type checking, it is accessible everywhere.
  • HTML Tags: Common tags (div, span, button, etc.) are automatically registered in the global scope. This eliminates "Import Hell" and keeps your components clean and readable.

4. Why no build step? ​

Because SigPro uses native ES Modules and standard JavaScript functions to generate the DOM, you don't actually need a compiler like Babel or a loader for JSX.

  • Development: Just save and refresh. No complex HMR issues.
  • Production: Use any bundler (Vite, esbuild, Rollup) to tree-shake and minify your final code for maximum performance.
`,16)])])}const g=i(l,[["render",p]]);export{o as __pageData,g as default}; +</html>

3. Global by Design ​

One of SigPro's core strengths is its Global API, which eliminates "Import Hell".

  • The $ Function: Once loaded, it attaches itself to window.$. It handles state, effects, and DOM mounting.
  • Tag Helpers (PascalCase): Common HTML tags (Div, Span, Button, Input, etc.) are automatically registered in the global scope.
  • Custom Components: We recommend using PascalCase (e.g., UserCard) or prefixes like _Input to keep your code organized and distinguish your logic from standard tags.

4. Why no build step? ​

Because SigPro uses native ES Modules and standard JavaScript functions to generate the DOM, you don't actually need a compiler like Babel or a transformer for JSX.

  • Development: Just save and refresh. Pure JS, no "transpilation" required.
  • Performance: Extremely lightweight. Use any modern bundler (Vite, esbuild) only when you are ready to minify and tree-shake for production.

5. Why SigPro? (The Competitive Edge) ​

SigPro stands out by removing the "Build Step" tax and the "Virtual DOM" overhead. It is the closest you can get to writing raw HTML/JS while maintaining modern reactivity.

FeatureSigProSolidJSSvelteReactVue
Bundle Size~2KB~7KB~4KB~40KB+~30KB
DOM StrategyDirect DOMDirect DOMCompiled DOMVirtual DOMVirtual DOM
ReactivityFine-grainedFine-grainedCompiledRe-rendersProxies
Build StepOptionalRequiredRequiredRequiredOptional
Learning CurveMinimalMediumLowHighMedium
InitializationUltra-FastVery FastFastSlowMedium

6. Key Advantages ​

  • Extreme Performance: No Virtual DOM reconciliation. SigPro updates the specific node or attribute instantly when a Signal changes.
  • Fine-Grained Reactivity: State changes only trigger updates where the data is actually used, not on the entire component.
  • Native Web Standards: Everything is a standard JS function. No custom template syntax to learn.
  • Zero Magic: No hidden compilers. What you write is what runs in the browser.
  • Global by Design: Tag Helpers and the $ function are available globally to eliminate "Import Hell" and keep your code clean.

7. Summary ​

SigPro isn't just another framework; it's a bridge to the native web. By using standard ES Modules and functional DOM generation, you gain the benefits of a modern library with the weight of a utility script.

Because, in the end... why fight the web when we can embrace it?

`,25)])])}const E=i(l,[["render",e]]);export{g as __pageData,E as default}; diff --git a/docs/assets/install.md.DmlvO98W.lean.js b/docs/assets/install.md.DmlvO98W.lean.js new file mode 100644 index 0000000..e81059a --- /dev/null +++ b/docs/assets/install.md.DmlvO98W.lean.js @@ -0,0 +1 @@ +import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Installation & Setup","description":"","frontmatter":{},"headers":[],"relativePath":"install.md","filePath":"install.md"}'),l={name:"install.md"};function e(h,s,p,k,r,d){return a(),t("div",null,[...s[0]||(s[0]=[n("",25)])])}const E=i(l,[["render",e]]);export{g as __pageData,E as default}; diff --git a/docs/assets/install.md.pJydCe65.lean.js b/docs/assets/install.md.pJydCe65.lean.js deleted file mode 100644 index 1176be3..0000000 --- a/docs/assets/install.md.pJydCe65.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"Installation & Setup","description":"","frontmatter":{},"headers":[],"relativePath":"install.md","filePath":"install.md"}'),l={name:"install.md"};function p(h,s,e,k,r,d){return a(),n("div",null,[...s[0]||(s[0]=[t("",16)])])}const g=i(l,[["render",p]]);export{o as __pageData,g as default}; diff --git a/docs/assets/plugins_custom.md.BuhVOLjH.js b/docs/assets/plugins_custom.md.BuhVOLjH.js deleted file mode 100644 index ab4b39f..0000000 --- a/docs/assets/plugins_custom.md.BuhVOLjH.js +++ /dev/null @@ -1,48 +0,0 @@ -import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Creating Custom Plugins","description":"","frontmatter":{},"headers":[],"relativePath":"plugins/custom.md","filePath":"plugins/custom.md"}'),h={name:"plugins/custom.md"};function l(p,s,e,k,r,d){return a(),n("div",null,[...s[0]||(s[0]=[t(`

Creating Custom Plugins ​

There are two main ways to expose a plugin's functionality: Static/Manual Imports (cleaner for large projects) or Global/Automatic Window Injection (easier for quick scripts and global helpers).

1. The Anatomy of a Plugin ​

A plugin is a standard JavaScript function. By convention, if a plugin adds a global helper or component, it should be prefixed with an underscore (_).

javascript
// plugins/my-utils.js
-export const MyUtils = ($) => {
-  
-  // 1. Attach to the SigPro instance
-  $.capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
-
-  // 2. Attach to the Window (Global access)
-  window._hello = (name) => div(\`Hello, \${$.capitalize(name)}!\`);
-  
-  // 3. You can also return values if needed
-  return { version: '1.0.0' };
-};

2. Integration Strategies ​

This approach keeps your global namespace clean. You import the logic only where you need it, but the plugin still initializes the core $ extensions.

javascript
// main.js
-import { $ } from 'sigpro';
-import { MyUtils } from './plugins/my-utils.js';
-
-$.plugin(MyUtils);
-
-// App.js
-export default () => {
-  const name = "sigpro";
-  // $.capitalize was added by the plugin
-  return h1($.capitalize(name)); 
-};

Option B: Automatic Window Injection ​

If your plugin defines global tags (like _button or _hello), you should attach them to the window object inside the plugin function. This makes them available everywhere without imports.

javascript
// plugins/theme.js
-export const Theme = ($) => {
-  const $dark = $(false);
-
-  window._themeToggle = () => button({
-    onclick: () => $dark(v => !v),
-    class: () => $dark() ? 'bg-black text-white' : 'bg-white text-black'
-  }, "Toggle Mode");
-};
-
-// main.js
-$.plugin(Theme).then(() => {
-   // _themeToggle is now a global function
-   $.mount(App);
-});

3. Asynchronous Plugins ​

If your plugin needs to load external data or scripts before the app starts, make it async. SigPro will wait for it.

javascript
export const ConfigLoader = async ($) => {
-  const res = await fetch('/config.json');
-  const config = await res.json();
-  
-  $.config = config; // Attach loaded config to SigPro
-};
-
-// Usage
-$.plugin(ConfigLoader).then(() => {
-  console.log("Config loaded:", $.config);
-  $.mount(App);
-});

4. Best Practices for Plugin Authors ​

RuleDescription
PrefixingUse _ for UI components (_modal) and $. for logic ($.fetch).
IdempotencyEnsure calling $.plugin(MyPlugin) twice doesn't break the app.
EncapsulationUse the $ instance passed as an argument rather than importing it again inside the plugin.
ReactivityAlways use $(...) for internal state so the app stays reactive.
`,20)])])}const o=i(h,[["render",l]]);export{g as __pageData,o as default}; diff --git a/docs/assets/plugins_custom.md.BuhVOLjH.lean.js b/docs/assets/plugins_custom.md.BuhVOLjH.lean.js deleted file mode 100644 index eed5e50..0000000 --- a/docs/assets/plugins_custom.md.BuhVOLjH.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Creating Custom Plugins","description":"","frontmatter":{},"headers":[],"relativePath":"plugins/custom.md","filePath":"plugins/custom.md"}'),h={name:"plugins/custom.md"};function l(p,s,e,k,r,d){return a(),n("div",null,[...s[0]||(s[0]=[t("",20)])])}const o=i(h,[["render",l]]);export{g as __pageData,o as default}; diff --git a/docs/assets/plugins_quick.md.DOyIUaNj.js b/docs/assets/plugins_quick.md.DOyIUaNj.js deleted file mode 100644 index 5f0253b..0000000 --- a/docs/assets/plugins_quick.md.DOyIUaNj.js +++ /dev/null @@ -1,27 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Extending SigPro: $.plugin","description":"","frontmatter":{},"headers":[],"relativePath":"plugins/quick.md","filePath":"plugins/quick.md"}'),e={name:"plugins/quick.md"};function l(h,s,p,r,o,k){return a(),t("div",null,[...s[0]||(s[0]=[n(`

Extending SigPro: $.plugin ​

The plugin system is the engine's modular backbone. It allows you to inject new functionality directly into the $ object, register custom global tags, or load external libraries seamlessly.

1. How Plugins Work ​

A plugin in SigPro is a function that receives the core instance. When you call $.plugin(MyPlugin), the engine hands over the $ object so the plugin can attach new methods or extend the reactive system.

Functional Plugin Example ​

javascript
// A plugin that adds a simple watcher to any signal
-const Logger = ($) => {
-  $.watch = (target, label = "Log") => {
-    $(() => console.log(\`[\${label}]:\`, target()));
-  };
-};
-
-// Activation
-$.plugin(Logger);
-const $count = $(0);
-$.watch($count, "Counter"); // Now available globally via $

2. Initialization Patterns (SigPro) ​

Thanks to the Synchronous Tag Engine, you no longer need complex import() nesting. Global tags like div(), span(), and button() are ready the moment you import the Core.

This is the standard way to build apps. It's clean, readable, and supports standard ESM imports.

javascript
// main.js
-import { $ } from 'sigpro';
-import { Fetch } from 'sigpro/plugins';
-import App from './App.js'; // Static import works perfectly!
-
-// 1. Register plugins
-$.plugin(Fetch);
-
-// 2. Mount your app directly
-$.mount(App, '#app');

3. Resource Plugins (External Scripts) ​

You can pass a URL or an Array of URLs. SigPro will inject them as <script> tags and return a Promise that resolves when the scripts are fully loaded. This is perfect for integrating heavy third-party libraries only when needed.

javascript
// Loading external libraries as plugins
-$.plugin([
-  'https://cdn.jsdelivr.net/npm/chart.js',
-  'https://cdn.example.com/custom-ui-lib.js'
-]).then(() => {
-  console.log("External resources are ready to use!");
-  $.mount(DashboardApp);
-});

4. Polymorphic Loading Reference ​

The $.plugin method is smart; it adapts its behavior based on the input type:

Input TypeActionBehavior
FunctionExecutes fn($)Synchronous: Immediate availability.
String (URL)Injects <script src="...">Asynchronous: Returns a Promise.
ArrayProcesses each item in the listReturns a Promise if any item is a URL.

πŸ’‘ Pro Tip: When to use .then()? ​

In SigPro, you only need .then() in two specific cases:

  1. External Assets: When loading a plugin via a URL (CDN).
  2. Strict Dependency: If your App.js requires a variable that is strictly defined inside an asynchronous external script (like window.Chart).

For everything else (UI components, Router, Local State), just call $.plugin() and continue with your code. It's that simple.


Summary Cheat Sheet ​

GoalCode
Local Plugin$.plugin(myPlugin)
Multiple Plugins$.plugin([UI, Router])
External Library$.plugin('https://...').then(...)
Hybrid Load$.plugin([UI, 'https://...']).then(...)
`,28)])])}const c=i(e,[["render",l]]);export{g as __pageData,c as default}; diff --git a/docs/assets/plugins_quick.md.DOyIUaNj.lean.js b/docs/assets/plugins_quick.md.DOyIUaNj.lean.js deleted file mode 100644 index 88c117b..0000000 --- a/docs/assets/plugins_quick.md.DOyIUaNj.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Extending SigPro: $.plugin","description":"","frontmatter":{},"headers":[],"relativePath":"plugins/quick.md","filePath":"plugins/quick.md"}'),e={name:"plugins/quick.md"};function l(h,s,p,r,o,k){return a(),t("div",null,[...s[0]||(s[0]=[n("",28)])])}const c=i(e,[["render",l]]);export{g as __pageData,c as default}; diff --git a/docs/assets/ui_button.md.B087poC6.js b/docs/assets/ui_button.md.B087poC6.js deleted file mode 100644 index 484e8ef..0000000 --- a/docs/assets/ui_button.md.B087poC6.js +++ /dev/null @@ -1,34 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"Button Component","description":"","frontmatter":{},"headers":[],"relativePath":"ui/button.md","filePath":"ui/button.md"}'),h={name:"ui/button.md"};function l(e,s,k,p,d,E){return a(),t("div",null,[...s[0]||(s[0]=[n(`

Button Component ​

The _button component creates reactive buttons with built-in support for loading states, icons, badges, and disabled states.

Basic Usage ​

javascript
_button({ onclick: () => alert('Clicked!') }, 'Click Me')

Loading State ​

The $loading signal automatically shows a spinner and disables the button.

javascript
const $loading = $(false)
-
-_button({ 
-  $loading: $loading,
-  onclick: async () => {
-    $loading(true)
-    await saveData()
-    $loading(false)
-  }
-}, 'Save')

Icons ​

Add icons to buttons using the icon prop.

javascript
_button({ icon: '⭐' }, 'Favorite')
-_button({ icon: 'πŸ’Ύ' }, 'Save')
-_button({ icon: 'πŸ—‘οΈ', class: 'btn-error' }, 'Delete')

Badges ​

Add badges to buttons for notifications or status indicators.

javascript
_button({ badge: '3' }, 'Notifications')
-_button({ badge: 'New', badgeClass: 'badge-secondary' }, 'Update Available')

Button Variants ​

Use daisyUI classes to style your buttons.

javascript
_button({ class: 'btn-primary' }, 'Primary')
-_button({ class: 'btn-secondary' }, 'Secondary')
-_button({ class: 'btn-outline' }, 'Outline')
-_button({ class: 'btn-sm' }, 'Small')

Counter Example ​

javascript
const $count = $(0)
-
-_button({ 
-  onclick: () => $count($count() + 1),
-  icon: 'πŸ”’'
-}, () => \`Count: \${$count()}\`)

Async Action Example ​

javascript
const $saving = $(false)
-const $success = $(false)
-
-_button({ 
-  $loading: $saving,
-  icon: 'πŸ’Ύ',
-  onclick: async () => {
-    $saving(true)
-    await saveToDatabase()
-    $saving(false)
-    $success(true)
-    setTimeout(() => $success(false), 2000)
-  }
-}, 'Save')

API Reference ​

PropTypeDescription
$loadingSignal<boolean>Shows spinner and disables button
$disabledSignal<boolean>Disables the button
iconstring | NodeIcon to display before text
badgestringBadge text to display
badgeClassstringAdditional CSS classes for badge
classstring | functionAdditional CSS classes
onclickfunctionClick event handler
typestringButton type ('button', 'submit', etc.)
`,29)])])}const g=i(h,[["render",l]]);export{o as __pageData,g as default}; diff --git a/docs/assets/ui_button.md.B087poC6.lean.js b/docs/assets/ui_button.md.B087poC6.lean.js deleted file mode 100644 index fc55151..0000000 --- a/docs/assets/ui_button.md.B087poC6.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"Button Component","description":"","frontmatter":{},"headers":[],"relativePath":"ui/button.md","filePath":"ui/button.md"}'),h={name:"ui/button.md"};function l(e,s,k,p,d,E){return a(),t("div",null,[...s[0]||(s[0]=[n("",29)])])}const g=i(h,[["render",l]]);export{o as __pageData,g as default}; diff --git a/docs/assets/ui_form.md.CZVTxszG.js b/docs/assets/ui_form.md.CZVTxszG.js deleted file mode 100644 index c90abf1..0000000 --- a/docs/assets/ui_form.md.CZVTxszG.js +++ /dev/null @@ -1,28 +0,0 @@ -import{_ as a,o as i,c as e,ae as t}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Form Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/form.md","filePath":"ui/form.md"}'),n={name:"ui/form.md"};function l(h,s,d,p,r,k){return i(),e("div",null,[...s[0]||(s[0]=[t(`

Form Components ​

SigPro UI provides a complete set of reactive form components including select dropdowns, checkboxes, radio buttons, and range sliders.

Select Dropdown (_select) ​

Creates a reactive dropdown select with options.

javascript
const $role = $('user')
-
-_select({
-  label: 'User Role',
-  options: [
-    { value: 'admin', label: 'Administrator' },
-    { value: 'user', label: 'Standard User' },
-    { value: 'guest', label: 'Guest' }
-  ],
-  $value: $role
-})

Checkbox (_checkbox) ​

Reactive checkbox with label.

javascript
const $agreed = $(false)
-
-_checkbox({
-  label: 'I agree to the terms and conditions',
-  $value: $agreed
-})

Radio Button (_radio) ​

Radio buttons for selecting one option from a group.

javascript
const $payment = $('credit')
-
-_radio({ name: 'payment', label: 'Credit Card', value: 'credit', $value: $payment })
-_radio({ name: 'payment', label: 'PayPal', value: 'paypal', $value: $payment })
-_radio({ name: 'payment', label: 'Crypto', value: 'crypto', $value: $payment })

Range Slider (_range) ​

Reactive range slider for numeric values.

javascript
const $volume = $(50)
-
-_range({
-  label: 'Volume',
-  min: 0,
-  max: 100,
-  step: 1,
-  $value: $volume
-})

Complete Form Example ​

API Reference ​

_select ​

PropTypeDescription
labelstringField label
optionsArray<{value: any, label: string}>Select options
$valueSignal<any>Selected value signal

_checkbox ​

PropTypeDescription
labelstringCheckbox label
$valueSignal<boolean>Checked state signal

_radio ​

PropTypeDescription
namestringRadio group name
labelstringRadio option label
valueanyValue for this option
$valueSignal<any>Group selected value signal

_range ​

PropTypeDescription
labelstringSlider label
minnumberMinimum value
maxnumberMaximum value
stepnumberStep increment
$valueSignal<number>Current value signal
`,29)])])}const E=a(n,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/assets/ui_form.md.CZVTxszG.lean.js b/docs/assets/ui_form.md.CZVTxszG.lean.js deleted file mode 100644 index 24312ad..0000000 --- a/docs/assets/ui_form.md.CZVTxszG.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a,o as i,c as e,ae as t}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Form Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/form.md","filePath":"ui/form.md"}'),n={name:"ui/form.md"};function l(h,s,d,p,r,k){return i(),e("div",null,[...s[0]||(s[0]=[t("",29)])])}const E=a(n,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/assets/ui_input.md.mJqBxkG3.js b/docs/assets/ui_input.md.mJqBxkG3.js deleted file mode 100644 index 56c1375..0000000 --- a/docs/assets/ui_input.md.mJqBxkG3.js +++ /dev/null @@ -1,60 +0,0 @@ -import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Input Component","description":"","frontmatter":{},"headers":[],"relativePath":"ui/input.md","filePath":"ui/input.md"}'),l={name:"ui/input.md"};function h(e,s,p,k,d,E){return a(),n("div",null,[...s[0]||(s[0]=[t(`

Input Component ​

The _input component creates reactive form inputs with built-in support for labels, tooltips, error messages, and two-way binding.

Basic Usage ​

javascript
const $name = $('')
-
-_input({
-  label: 'Name',
-  placeholder: 'Enter your name',
-  $value: $name
-})

With Tooltip ​

The tip prop adds an info badge with a tooltip.

javascript
_input({
-  label: 'Username',
-  tip: 'Choose a unique username (min. 3 characters)',
-  placeholder: 'johndoe123',
-  $value: $username
-})

With Error Handling ​

The $error signal displays an error message and styles the input accordingly.

javascript
const $email = $('')
-const $error = $(null)
-
-const validate = (value) => {
-  if (value && !value.includes('@')) {
-    $error('Please enter a valid email address')
-  } else {
-    $error(null)
-  }
-}
-
-_input({
-  label: 'Email',
-  type: 'email',
-  placeholder: 'user@example.com',
-  $value: $email,
-  $error: $error,
-  oninput: (e) => validate(e.target.value)
-})

Input Types ​

The component supports all standard HTML input types.

javascript
_input({ label: 'Text', placeholder: 'Text input', $value: $text })
-_input({ label: 'Password', type: 'password', placeholder: 'β€’β€’β€’β€’β€’β€’β€’β€’', $value: $password })
-_input({ label: 'Number', type: 'number', placeholder: '0', $value: $number })

Two-Way Binding ​

The $value prop creates two-way binding between the input and the signal.

javascript
const $message = $('Hello World')
-
-_input({
-  label: 'Message',
-  $value: $message
-})
-
-// The input updates when signal changes, and vice versa
-_button({ onclick: () => $message('Reset!') }, 'Reset Signal')

API Reference ​

PropTypeDescription
labelstringField label text
tipstringTooltip text shown on hover
$valueSignal<any>Two-way bound value signal
$errorSignal<string|null>Error message signal
typestringInput type (text, email, password, number, etc.)
placeholderstringPlaceholder text
classstring | functionAdditional CSS classes
oninputfunctionInput event handler
onchangefunctionChange event handler
disabledbooleanDisabled state

Examples ​

Registration Form Field ​

javascript
const $username = $('')
-const $usernameError = $(null)
-const $email = $('')
-const $emailError = $(null)
-
-_input({
-  label: 'Username',
-  placeholder: 'johndoe',
-  $value: $username,
-  $error: $usernameError,
-  oninput: (e) => validateUsername(e.target.value)
-})
-
-_input({
-  label: 'Email',
-  type: 'email',
-  placeholder: 'john@example.com',
-  $value: $email,
-  $error: $emailError,
-  oninput: (e) => validateEmail(e.target.value)
-})
`,27)])])}const o=i(l,[["render",h]]);export{g as __pageData,o as default}; diff --git a/docs/assets/ui_input.md.mJqBxkG3.lean.js b/docs/assets/ui_input.md.mJqBxkG3.lean.js deleted file mode 100644 index a43c16a..0000000 --- a/docs/assets/ui_input.md.mJqBxkG3.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Input Component","description":"","frontmatter":{},"headers":[],"relativePath":"ui/input.md","filePath":"ui/input.md"}'),l={name:"ui/input.md"};function h(e,s,p,k,d,E){return a(),n("div",null,[...s[0]||(s[0]=[t("",27)])])}const o=i(l,[["render",h]]);export{g as __pageData,o as default}; diff --git a/docs/assets/ui_installation.md.C7ubLVYa.js b/docs/assets/ui_installation.md.C7ubLVYa.js deleted file mode 100644 index 45bba36..0000000 --- a/docs/assets/ui_installation.md.C7ubLVYa.js +++ /dev/null @@ -1,10 +0,0 @@ -import{_ as s,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Installation","description":"","frontmatter":{},"headers":[],"relativePath":"ui/installation.md","filePath":"ui/installation.md"}'),e={name:"ui/installation.md"};function l(p,i,h,r,o,k){return a(),t("div",null,[...i[0]||(i[0]=[n(`

Installation ​

Prerequisites ​

  • Node.js 18 or higher
  • A project with SigPro already installed

Step 1: Install Dependencies ​

bash
npm install -D tailwindcss @tailwindcss/vite daisyui@next

Step 2: Configure Tailwind CSS v4 ​

Create a CSS file (e.g., src/app.css):

css
@import "tailwindcss";
-@plugin "daisyui";

Step 3: Import CSS in Your Entry Point ​

javascript
// main.js
-import './app.css';
-import { $ } from 'sigpro';
-import { UI } from 'sigpro/plugins';
-
-$.plugin(UI).then(() => {
-  console.log('βœ… UI Components ready');
-  import('./App.js').then(app => $.mount(app.default));
-});

Step 4: Verify Installation ​

Troubleshooting ​

Styles not applying? ​

  • Make sure app.css is imported before any other code
  • Check that Tailwind is properly configured in your build tool

Components not found? ​

  • Ensure $.plugin(UI) has completed before using components
  • Check browser console for any loading errors

Reactive updates not working? ​

  • Make sure you're passing signals, not primitive values
  • Use $value prop for two-way binding
`,19)])])}const g=s(e,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/ui_installation.md.C7ubLVYa.lean.js b/docs/assets/ui_installation.md.C7ubLVYa.lean.js deleted file mode 100644 index c776321..0000000 --- a/docs/assets/ui_installation.md.C7ubLVYa.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Installation","description":"","frontmatter":{},"headers":[],"relativePath":"ui/installation.md","filePath":"ui/installation.md"}'),e={name:"ui/installation.md"};function l(p,i,h,r,o,k){return a(),t("div",null,[...i[0]||(i[0]=[n("",19)])])}const g=s(e,[["render",l]]);export{c as __pageData,g as default}; diff --git a/docs/assets/ui_introduction.md.CpBz5t8n.js b/docs/assets/ui_introduction.md.CpBz5t8n.js deleted file mode 100644 index ae61593..0000000 --- a/docs/assets/ui_introduction.md.CpBz5t8n.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,o,c as a,ae as r}from"./chunks/framework.C8AWLET_.js";const p=JSON.parse('{"title":"UI Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/introduction.md","filePath":"ui/introduction.md"}'),n={name:"ui/introduction.md"};function d(i,t,s,c,l,u){return o(),a("div",null,[...t[0]||(t[0]=[r('

UI Components ​

The SigPro UI plugin is a high-level component library built on top of the reactive core. It leverages Tailwind CSS v4 for utility styling and daisyUI v5 for semantic, themeable components.

Features ​

  • πŸš€ Fully Reactive: Every component automatically updates with signals
  • 🎨 Themeable: Supports all daisyUI themes out of the box
  • πŸ“± Responsive: Designed to work on all devices
  • πŸ”§ Zero Dependencies: Pure SigPro with no framework overhead

Quick Demo ​

What's Included ​

The UI plugin provides a comprehensive set of reactive components:

CategoryComponents
Actions_button
Forms_input, _select, _checkbox, _radio, _range
Layout_fieldset, _accordion, _drawer
Navigation_navbar, _menu, _tabs
Overlays_modal, _dropdown
Feedback_badge, _tooltip

Next Steps ​

',11)])])}const m=e(n,[["render",d]]);export{p as __pageData,m as default}; diff --git a/docs/assets/ui_introduction.md.CpBz5t8n.lean.js b/docs/assets/ui_introduction.md.CpBz5t8n.lean.js deleted file mode 100644 index 911091b..0000000 --- a/docs/assets/ui_introduction.md.CpBz5t8n.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as e,o,c as a,ae as r}from"./chunks/framework.C8AWLET_.js";const p=JSON.parse('{"title":"UI Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/introduction.md","filePath":"ui/introduction.md"}'),n={name:"ui/introduction.md"};function d(i,t,s,c,l,u){return o(),a("div",null,[...t[0]||(t[0]=[r("",11)])])}const m=e(n,[["render",d]]);export{p as __pageData,m as default}; diff --git a/docs/assets/ui_layout.md.DLaYXca7.js b/docs/assets/ui_layout.md.DLaYXca7.js deleted file mode 100644 index 8b9d7b5..0000000 --- a/docs/assets/ui_layout.md.DLaYXca7.js +++ /dev/null @@ -1,29 +0,0 @@ -import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Layout Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/layout.md","filePath":"ui/layout.md"}'),n={name:"ui/layout.md"};function l(h,s,p,d,o,k){return a(),t("div",null,[...s[0]||(s[0]=[e(`

Layout Components ​

Layout components for structuring your application with containers, sections, and collapsible panels.

Fieldset (_fieldset) ​

Groups related form fields with a legend.

javascript
_fieldset({ legend: 'Personal Information' }, [
-  _input({ label: 'Full Name', $value: $name }),
-  _input({ label: 'Email Address', type: 'email', $value: $email }),
-  _select({ label: 'Role', options: [...], $value: $role })
-])

Accordion (_accordion) ​

Collapsible content panels. Can be used as standalone or grouped.

Single Accordion ​

javascript
_accordion({ title: 'What is SigPro UI?' }, [
-  $.html('p', {}, 'SigPro UI is a reactive component library...')
-])

Grouped Accordions (Radio Behavior) ​

When multiple accordions share the same name, only one can be open at a time.

javascript
// Grouped accordions - only one open at a time
-_accordion({ title: 'Getting Started', name: 'faq' }, content1)
-_accordion({ title: 'Installation', name: 'faq' }, content2)
-_accordion({ title: 'Customization', name: 'faq' }, content3)

Accordion with Open State ​

Control the initial open state with the open prop.

javascript
_accordion({ title: 'Open by Default', open: true }, [
-  $.html('p', {}, 'This accordion starts open.')
-])

Complete Layout Example ​

API Reference ​

_fieldset ​

PropTypeDescription
legendstringFieldset title/legend text
classstring | functionAdditional CSS classes

_accordion ​

PropTypeDescription
titlestringAccordion header text
namestringGroup name for radio behavior (optional)
openbooleanInitially open state (default: false)

Styling Tips ​

Custom Fieldset Styling ​

javascript
_fieldset({ 
-  legend: 'Custom Styled',
-  class: 'bg-primary/10 border-primary' 
-}, [
-  // content
-])

Custom Accordion Styling ​

javascript
_accordion({ 
-  title: 'Styled Accordion',
-  class: 'bg-base-200' 
-}, [
-  // content
-])

Nested Layouts ​

Layout components can be nested to create complex structures:

javascript
_fieldset({ legend: 'Main Section' }, [
-  _accordion({ title: 'Subsection 1' }, [
-    _input({ label: 'Field 1', $value: $field1 })
-  ]),
-  _accordion({ title: 'Subsection 2' }, [
-    _input({ label: 'Field 2', $value: $field2 })
-  ])
-])
`,34)])])}const E=i(n,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/assets/ui_layout.md.DLaYXca7.lean.js b/docs/assets/ui_layout.md.DLaYXca7.lean.js deleted file mode 100644 index 8964d8e..0000000 --- a/docs/assets/ui_layout.md.DLaYXca7.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"Layout Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/layout.md","filePath":"ui/layout.md"}'),n={name:"ui/layout.md"};function l(h,s,p,d,o,k){return a(),t("div",null,[...s[0]||(s[0]=[e("",34)])])}const E=i(n,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/assets/ui_modal.md.Hjip_i1A.js b/docs/assets/ui_modal.md.Hjip_i1A.js deleted file mode 100644 index c66465e..0000000 --- a/docs/assets/ui_modal.md.Hjip_i1A.js +++ /dev/null @@ -1,29 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"Modal & Drawer Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/modal.md","filePath":"ui/modal.md"}'),h={name:"ui/modal.md"};function l(e,s,k,p,d,r){return a(),t("div",null,[...s[0]||(s[0]=[n(`

Modal & Drawer Components ​

Overlay components for dialogs, side panels, and popups with reactive control.

A dialog component that appears on top of the page. The modal is completely removed from the DOM when closed, optimizing performance.

Basic Modal ​

javascript
const $open = $(false)
-
-_button({ onclick: () => $open(true) }, 'Open Modal')
-
-_modal({ $open: $open, title: 'Welcome' }, [
-  $.html('p', {}, 'This is a simple modal dialog.'),
-  _button({ onclick: () => $open(false) }, 'Close')
-])
javascript
const $open = $(false)
-const $result = $(null)
-
-_modal({ $open: $open, title: 'Confirm Delete' }, [
-  $.html('p', {}, 'Are you sure you want to delete this item?'),
-  _button({ class: 'btn-error', onclick: () => {
-    $result('Item deleted')
-    $open(false)
-  } }, 'Delete')
-])

Drawer (_drawer) ​

A sidebar panel that slides in from the side.

Basic Drawer ​

javascript
const $open = $(false)
-
-_drawer({
-  id: 'my-drawer',
-  $open: $open,
-  content: $.html('div', {}, 'Main content'),
-  side: $.html('div', { class: 'p-4' }, [
-    $.html('h3', {}, 'Menu'),
-    $.html('ul', { class: 'menu' }, [
-      $.html('li', {}, [$.html('a', { onclick: () => $open(false) }, 'Close')])
-    ])
-  ])
-})

Drawer with Navigation Menu ​

API Reference ​

PropTypeDescription
$openSignal<boolean>Controls modal visibility
titlestringModal title text

_drawer ​

PropTypeDescription
idstringUnique identifier for the drawer
$openSignal<boolean>Controls drawer visibility
contentHTMLElementMain content area
sideHTMLElementSidebar content
`,24)])])}const g=i(h,[["render",l]]);export{o as __pageData,g as default}; diff --git a/docs/assets/ui_modal.md.Hjip_i1A.lean.js b/docs/assets/ui_modal.md.Hjip_i1A.lean.js deleted file mode 100644 index f2caf03..0000000 --- a/docs/assets/ui_modal.md.Hjip_i1A.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as t,ae as n}from"./chunks/framework.C8AWLET_.js";const o=JSON.parse('{"title":"Modal & Drawer Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/modal.md","filePath":"ui/modal.md"}'),h={name:"ui/modal.md"};function l(e,s,k,p,d,r){return a(),t("div",null,[...s[0]||(s[0]=[n("",24)])])}const g=i(h,[["render",l]]);export{o as __pageData,g as default}; diff --git a/docs/assets/ui_navigation.md.CK3sbH-I.js b/docs/assets/ui_navigation.md.CK3sbH-I.js deleted file mode 100644 index 8f1e904..0000000 --- a/docs/assets/ui_navigation.md.CK3sbH-I.js +++ /dev/null @@ -1,51 +0,0 @@ -import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Navigation Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/navigation.md","filePath":"ui/navigation.md"}'),h={name:"ui/navigation.md"};function l(k,s,p,e,d,E){return a(),n("div",null,[...s[0]||(s[0]=[t(`

Navigation Components ​

Navigation components for building menus, navbars, and tabs with reactive active states.

A responsive navigation bar with built-in styling.

javascript
const $active = $('Home')
-
-_navbar({ class: 'shadow-md' }, [
-  div({ class: 'flex-1' }, [
-    a({ class: 'text-xl font-bold' }, 'MyApp')
-  ]),
-  div({ class: 'flex-none gap-2' }, [
-    _button({ 
-      class: () => $active() === 'Home' ? 'btn-primary btn-sm' : 'btn-ghost btn-sm',
-      onclick: () => $active('Home')
-    }, 'Home'),
-    _button({ 
-      class: () => $active() === 'About' ? 'btn-primary btn-sm' : 'btn-ghost btn-sm',
-      onclick: () => $active('About')
-    }, 'About')
-  ])
-])

Vertical navigation menu with active state highlighting.

javascript
const $selected = $('dashboard')
-
-_menu({ items: [
-  { 
-    label: 'Dashboard', 
-    icon: 'πŸ“Š',
-    active: () => $selected() === 'dashboard',
-    onclick: () => $selected('dashboard')
-  },
-  { 
-    label: 'Analytics', 
-    icon: 'πŸ“ˆ',
-    active: () => $selected() === 'analytics',
-    onclick: () => $selected('analytics')
-  }
-]})

Tabs (_tabs) ​

Horizontal tabs with lifted styling and active state.

javascript
const $activeTab = $('profile')
-
-_tabs({ items: [
-  { 
-    label: 'Profile', 
-    active: () => $activeTab() === 'profile',
-    onclick: () => $activeTab('profile')
-  },
-  { 
-    label: 'Settings', 
-    active: () => $activeTab() === 'settings',
-    onclick: () => $activeTab('settings')
-  }
-]})

A dropdown menu that appears on click.

javascript
const $selected = $(null)
-
-_dropdown({ label: 'Options' }, [
-  li([a({ onclick: () => $selected('Edit') }, '✏️ Edit')]),
-  li([a({ onclick: () => $selected('Duplicate') }, 'πŸ“‹ Duplicate')]),
-  li([a({ onclick: () => $selected('Delete') }, 'πŸ—‘οΈ Delete')])
-])

Complete Navigation Example ​

API Reference ​

PropTypeDescription
classstring | functionAdditional CSS classes
PropTypeDescription
itemsArray<{label: string, icon?: any, active?: boolean|function, onclick: function}>Menu items

_tabs ​

PropTypeDescription
itemsArray<{label: string, active: boolean|function, onclick: function}>Tab items
PropTypeDescription
labelstringDropdown trigger text
classstring | functionAdditional CSS classes
`,29)])])}const o=i(h,[["render",l]]);export{g as __pageData,o as default}; diff --git a/docs/assets/ui_navigation.md.CK3sbH-I.lean.js b/docs/assets/ui_navigation.md.CK3sbH-I.lean.js deleted file mode 100644 index 6c13f24..0000000 --- a/docs/assets/ui_navigation.md.CK3sbH-I.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i,o as a,c as n,ae as t}from"./chunks/framework.C8AWLET_.js";const g=JSON.parse('{"title":"Navigation Components","description":"","frontmatter":{},"headers":[],"relativePath":"ui/navigation.md","filePath":"ui/navigation.md"}'),h={name:"ui/navigation.md"};function l(k,s,p,e,d,E){return a(),n("div",null,[...s[0]||(s[0]=[t("",29)])])}const o=i(h,[["render",l]]);export{g as __pageData,o as default}; diff --git a/docs/assets/ui_quick.md.Bzj-nQ2u.js b/docs/assets/ui_quick.md.Bzj-nQ2u.js new file mode 100644 index 0000000..3d156a9 --- /dev/null +++ b/docs/assets/ui_quick.md.Bzj-nQ2u.js @@ -0,0 +1,44 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"🧩 UI Components (WIP)","description":"","frontmatter":{},"headers":[],"relativePath":"ui/quick.md","filePath":"ui/quick.md"}'),n={name:"ui/quick.md"};function l(h,s,p,o,k,r){return a(),t("div",null,[...s[0]||(s[0]=[e(`

🧩 UI Components (WIP) ​

Status: Work In Progress. > These are high-level, complex visual components designed to speed up development. They often replace native HTML elements with "superpowered" versions that handle their own internal logic, reactivity, and accessibility.

1. What are UI Components? ​

Unlike Tag Helpers (which are just functional mirrors of HTML tags), SigPro UI Components are smart abstractions.

  • Stateful: They manage complex internal states (like date ranges, search filtering, or API lifecycles).
  • Reactive: Attributes prefixed with $ are automatically tracked.
  • Self-Cleaning: They automatically use _cleanups to destroy observers or event listeners when removed from the DOM.
  • Themed: Fully compatible with Tailwind CSS and DaisyUI themes.

2. The UI Registry (Available Now) ​

CategoryComponents
Logic & FlowIf, For, Json
Forms & InputsButton, Input, Select, Autocomplete, Datepicker, Colorpicker, CheckBox, Radio, Range, Rating, Swap
FeedbackAlert, Toast, Modal, Loading, Badge, Tooltip, Indicator
NavigationNavbar, Menu, Drawer, Tabs, Accordion, Dropdown
Data & LayoutRequest, Response, Grid (AG-Grid), List, Stack, Timeline, Stat, Fieldset, Fab

3. Examples with "Superpowers" ​

A. The Declarative API Flow (Request & Response) ​

Instead of manually managing loading and error flags, use these two together to handle data fetching elegantly.

javascript
// 1. Define the request (it tracks dependencies automatically)
+const userProfile = Request(
+  () => \`https://api.example.com/user/\${userId()}\`
+);
+
+// 2. Render the UI based on the request state
+Div({ class: "p-4" }, [
+  Response(userProfile, (data) => 
+    Div([
+      H1(data.name),
+      P(data.email)
+    ])
+  )
+]);

B. Smart Inputs & Autocomplete ​

Native inputs are boring. SigPro UI inputs handle labels, icons, password toggles, and validation states out of the box.

javascript
const searchQuery = $("");
+
+Autocomplete({
+  label: "Find a Country",
+  placeholder: "Start typing...",
+  options: ["Spain", "France", "Germany", "Italy", "Portugal"],
+  $value: searchQuery,
+  onSelect: (val) => console.log("Selected:", val)
+});

C. The Reactive Datepicker ​

Handles single dates or ranges with a clean, reactive interface.

javascript
const myDate = $(""); // or { start: "", end: "" } for range
+
+Datepicker({
+  label: "Select Expiry Date",
+  $value: myDate,
+  range: false // Set to true for range selection
+});

D. Imperative Toasts & Modals ​

Sometimes you just need to trigger a message without cluttering your template.

javascript
// Show a notification from anywhere in your logic
+Toast("Settings saved successfully!", "alert-success", 3000);
+
+// Control a modal with a simple signal
+const isModalOpen = $(false);
+
+Modal({ 
+  $open: isModalOpen, 
+  title: "Delete Account",
+  buttons: [
+    Button({ class: "btn-error", onclick: doDelete }, "Confirm")
+  ]
+}, "This action cannot be undone.");

4. Internationalization (i18n) ​

The UI library comes with a built-in locale system. It currently supports es and en.

javascript
// Set the global UI language
+SetLocale("en");
+
+// Access translated strings in your own components
+const t = tt("confirm"); // Returns a signal that tracks the current locale

5. Best Practices ​

  • Use $ for Reactivity: If a property starts with $, it expects a Signal (e.g., $value: mySignal).
  • Key your Lists: When using For, always provide a keyFn to ensure high-performance DOM reconciliation.
  • Cleanups: If you build custom components that use setInterval or observers, add them to the element's _cleanups Set.
`,29)])])}const E=i(n,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/assets/ui_quick.md.Bzj-nQ2u.lean.js b/docs/assets/ui_quick.md.Bzj-nQ2u.lean.js new file mode 100644 index 0000000..1f4d722 --- /dev/null +++ b/docs/assets/ui_quick.md.Bzj-nQ2u.lean.js @@ -0,0 +1 @@ +import{_ as i,o as a,c as t,ae as e}from"./chunks/framework.C8AWLET_.js";const c=JSON.parse('{"title":"🧩 UI Components (WIP)","description":"","frontmatter":{},"headers":[],"relativePath":"ui/quick.md","filePath":"ui/quick.md"}'),n={name:"ui/quick.md"};function l(h,s,p,o,k,r){return a(),t("div",null,[...s[0]||(s[0]=[e("",29)])])}const E=i(n,[["render",l]]);export{c as __pageData,E as default}; diff --git a/docs/examples.html b/docs/examples.html index 4c5d7a9..f604105 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -19,7 +19,7 @@ -
Skip to content

Live Playground ​

Experience SigPro's fine-grained reactivity in real-time. Feel free to tweak the signal values in the editor!

```

2. Best Practices for Documentation ​

  • Tab Selection: You can control which tabs are active by default by changing the URL segment after /embedded/.
    • js,result: Shows the logic and the output.
    • html,js,result: Shows the base structure, the logic, and the output.
  • Height Management: For complex Store examples, increase the height attribute to 500 or 600 so the code is readable without internal scrolling.
  • Responsive Width: Keeping width="100%" ensures the fiddle scales correctly on tablets and mobile devices.

3. Advanced: The "Fiddle" Component (Optional) ​

If you plan to have 10+ examples, you can create a global Vue component in VitePress. This keeps your Markdown files clean and allows you to change the theme or default height for all fiddles at once.

Create .vitepress/theme/components/Fiddle.vue:

vue
<template>
+    
Skip to content

Live Playground ​

Experience SigPro's fine-grained reactivity in real-time. Feel free to tweak the signal values in the editor!

```

2. Best Practices for Documentation ​

  • Tab Selection: You can control which tabs are active by default by changing the URL segment after /embedded/.
    • js,result: Shows the logic and the output.
    • html,js,result: Shows the base structure, the logic, and the output.
  • Height Management: For complex Store examples, increase the height attribute to 500 or 600 so the code is readable without internal scrolling.
  • Responsive Width: Keeping width="100%" ensures the fiddle scales correctly on tablets and mobile devices.

3. Advanced: The "Fiddle" Component (Optional) ​

If you plan to have 10+ examples, you can create a global Vue component in VitePress. This keeps your Markdown files clean and allows you to change the theme or default height for all fiddles at once.

Create .vitepress/theme/components/Fiddle.vue:

vue
<template>
   <div class="fiddle-wrapper" style="margin: 20px 0;">
     <iframe 
       width="100%" 
@@ -38,8 +38,8 @@
   tabs: { default: 'js,result' }
 })
 </script>

Usage in Markdown:

markdown
Check out this store example:
-<Fiddle id="spwran02/4" height="500" />

Why this is perfect for SigPro: ​

Because SigPro is zero-dependency and runs directly in the browser, your JSFiddle code will be exactly what the user copies into their own index.html. There is no hidden "build step" confusing the learner.

- +<Fiddle id="spwran02/4" height="500" />

Why this is perfect for SigPro: ​

Because SigPro is zero-dependency and runs directly in the browser, your JSFiddle code will be exactly what the user copies into their own index.html. There is no hidden "build step" confusing the learner.

+ \ No newline at end of file diff --git a/docs/hashmap.json b/docs/hashmap.json index 3165fd7..6bde688 100644 --- a/docs/hashmap.json +++ b/docs/hashmap.json @@ -1 +1 @@ -{"api__.md":"BV8uIOD5","api_html.md":"-lEpgX-Z","api_mount.md":"B9mWME6o","api_quick.md":"OAEBn6rS","api_router.md":"BV6vPWg-","api_tags.md":"YLRdMyid","examples.md":"Cy97nBRw","index.md":"By6smViD","install.md":"pJydCe65","plugins_custom.md":"BuhVOLjH","plugins_quick.md":"DOyIUaNj","ui_button.md":"B087poC6","ui_form.md":"CZVTxszG","ui_input.md":"mJqBxkG3","ui_installation.md":"C7ubLVYa","ui_introduction.md":"CpBz5t8n","ui_layout.md":"DLaYXca7","ui_modal.md":"Hjip_i1A","ui_navigation.md":"CK3sbH-I","vite_plugin.md":"CTs8LDIL"} +{"api_effect.md":"jV8KzXq5","api_html.md":"COPskx0H","api_ignore.md":"CxKek-H-","api_mount.md":"CRwLyxt8","api_quick.md":"4axUqmd3","api_router.md":"Cn98LjXO","api_signal.md":"BmorvARW","api_tags.md":"VliNqepa","api_view.md":"Bv8Rlx9s","examples.md":"Cy97nBRw","index.md":"By6smViD","install.md":"DmlvO98W","ui_quick.md":"Bzj-nQ2u","vite_plugin.md":"CTs8LDIL"} diff --git a/docs/index.html b/docs/index.html index 1fb2b6c..20b2f8d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,7 +20,7 @@
Skip to content

SigProAtomic Unified Reactive Engine

High-precision atomic reactivity. No Virtual DOM. No compiler. No dependencies.

SigPro Logo

Redefining Modern Reactivity ​

SigPro is not just another framework; it is a high-performance engine. While other libraries add layers of abstraction that slow down execution, SigPro returns to the essence of the web, leveraging the power of modern browser engines.

Why SigPro? ​

⚑️ Surgical DOM Efficiency ​

Unlike React or Vue, SigPro doesn't compare element trees. When a signal changes, SigPro knows exactly which DOM node depends on it and updates it instantly. It is reactive precision at its finest.

πŸ”Œ Modular Plugin System ​

The core is sacred. Any extra functionalityβ€”Routing, UI Helpers, or State Persistenceβ€”is integrated through a polymorphic plugin system. Load only what your application truly needs.

πŸ’Ύ Native Persistence ​

SigPro features first-class support for localStorage. Synchronizing your application state with persistent storage is as simple as providing a key when initializing your Signal.

🚦 Built-in Hash Routing ​

A robust routing system that supports Native Lazy Loading out of the box. Load your components only when the user navigates to them, keeping initial load times near zero.


The "No-Build" Philosophy ​

In an ecosystem obsessed with compilers, SigPro bets on standardization. Write code today that will still run 10 years from now, without depending on build tools that will eventually become obsolete.

"The best way to optimize code is to not have to process it at all."


Community & Vision ​

SigPro is an open-source project focused on simplicity and extreme speed. Designed for developers who love the web platform and hate unnecessary "bloatware".

text
Built with ❀️ by NatxoCC for the Modern Web.
- + \ No newline at end of file diff --git a/docs/install.html b/docs/install.html index 0553c85..ecefeb7 100644 --- a/docs/install.html +++ b/docs/install.html @@ -13,25 +13,32 @@ - + -
Skip to content

Installation & Setup ​

SigPro is designed to be drop-in ready. Whether you are building a complex application with a bundler or a simple reactive widget in a single HTML file, SigPro scales with your needs.

1. Installation ​

Choose the method that best fits your workflow:

bash
npm install sigpro
bash
pnpm add sigpro
bash
yarn add sigpro
bash
bun add sigpro
html
<script type="module">
+    
Skip to content

Installation & Setup ​

SigPro is designed to be drop-in ready. Whether you are building a complex application with a bundler or a simple reactive widget in a single HTML file, SigPro scales with your needs.

1. Installation ​

Choose the method that best fits your workflow:

bash
npm install sigpro
bash
pnpm add sigpro
bash
yarn add sigpro
bash
bun add sigpro
html
<script type="module">
+  // Import the core and UI components
   import { $ } from 'https://cdn.jsdelivr.net/npm/sigpro@latest/+esm';
-</script>

2. Quick Start Examples ​

Depending on your installation method, here is how you can get SigPro running in seconds.

javascript
// File: App.js
+  import { UI } from 'https://cdn.jsdelivr.net/npm/sigpro@latest/ui/+esm';
+  
+  // Initialize UI components globally
+  UI($);
+</script>

2. Quick Start Examples ​

SigPro uses PascalCase for Tag Helpers (e.g., Div, Button) to provide a clean, component-like syntax without needing JSX.

javascript
// File: App.js
 import { $ } from 'sigpro'; 
 
 export const App = () => {
-  // $ is global, but we import it for better IDE intellisense
   const $count = $(0);
   
-  // Tags like div, h1, button are available globally
-  return div({ class: 'card' }, [
-    h1(["Count is: ", $count]),
-    button({ onclick: () => $count(c => c + 1) }, "Increment")
+  // Tag Helpers like Div, H1, Button are available globally
+  return Div({ class: 'card p-4' }, [
+    H1(["Count is: ", $count]),
+    Button({ 
+      class: 'btn btn-primary',
+      onclick: () => $count(c => c + 1) 
+    }, "Increment")
   ]);
 };
 
@@ -45,16 +52,16 @@
   <div id="app"></div>
 
   <script type="module">
-    // Import directly from CDN
     import { $ } from 'https://cdn.jsdelivr.net/npm/sigpro@latest/+esm';
 
     const $name = $("Developer");
 
-    // No need to import div, section, h2, input... they are global!
-    const App = () => section([
-      h2(["Welcome, ", $name]),
-      input({ 
+    // No need to import Div, Section, H2, Input... they are global!
+    const App = () => Section({ class: 'container' }, [
+      H2(["Welcome, ", $name]),
+      Input({ 
         type: 'text', 
+        class: 'input input-bordered',
         $value: $name, // Automatic two-way binding
         placeholder: 'Type your name...' 
       })
@@ -63,8 +70,8 @@
     $.mount(App, '#app');
   </script>
 </body>
-</html>

3. Global by Design ​

One of SigPro's core strengths is its Global API.

  • The $ Function: Once loaded, it attaches itself to window.$. While you can use import for better IDE support and type checking, it is accessible everywhere.
  • HTML Tags: Common tags (div, span, button, etc.) are automatically registered in the global scope. This eliminates "Import Hell" and keeps your components clean and readable.

4. Why no build step? ​

Because SigPro uses native ES Modules and standard JavaScript functions to generate the DOM, you don't actually need a compiler like Babel or a loader for JSX.

  • Development: Just save and refresh. No complex HMR issues.
  • Production: Use any bundler (Vite, esbuild, Rollup) to tree-shake and minify your final code for maximum performance.
- +</html>

3. Global by Design ​

One of SigPro's core strengths is its Global API, which eliminates "Import Hell".

  • The $ Function: Once loaded, it attaches itself to window.$. It handles state, effects, and DOM mounting.
  • Tag Helpers (PascalCase): Common HTML tags (Div, Span, Button, Input, etc.) are automatically registered in the global scope.
  • Custom Components: We recommend using PascalCase (e.g., UserCard) or prefixes like _Input to keep your code organized and distinguish your logic from standard tags.

4. Why no build step? ​

Because SigPro uses native ES Modules and standard JavaScript functions to generate the DOM, you don't actually need a compiler like Babel or a transformer for JSX.

  • Development: Just save and refresh. Pure JS, no "transpilation" required.
  • Performance: Extremely lightweight. Use any modern bundler (Vite, esbuild) only when you are ready to minify and tree-shake for production.

5. Why SigPro? (The Competitive Edge) ​

SigPro stands out by removing the "Build Step" tax and the "Virtual DOM" overhead. It is the closest you can get to writing raw HTML/JS while maintaining modern reactivity.

FeatureSigProSolidJSSvelteReactVue
Bundle Size~2KB~7KB~4KB~40KB+~30KB
DOM StrategyDirect DOMDirect DOMCompiled DOMVirtual DOMVirtual DOM
ReactivityFine-grainedFine-grainedCompiledRe-rendersProxies
Build StepOptionalRequiredRequiredRequiredOptional
Learning CurveMinimalMediumLowHighMedium
InitializationUltra-FastVery FastFastSlowMedium

6. Key Advantages ​

  • Extreme Performance: No Virtual DOM reconciliation. SigPro updates the specific node or attribute instantly when a Signal changes.
  • Fine-Grained Reactivity: State changes only trigger updates where the data is actually used, not on the entire component.
  • Native Web Standards: Everything is a standard JS function. No custom template syntax to learn.
  • Zero Magic: No hidden compilers. What you write is what runs in the browser.
  • Global by Design: Tag Helpers and the $ function are available globally to eliminate "Import Hell" and keep your code clean.

7. Summary ​

SigPro isn't just another framework; it's a bridge to the native web. By using standard ES Modules and functional DOM generation, you gain the benefits of a modern library with the weight of a utility script.

Because, in the end... why fight the web when we can embrace it?

+ \ No newline at end of file diff --git a/docs/plugins/custom.html b/docs/plugins/custom.html deleted file mode 100644 index 8de2a78..0000000 --- a/docs/plugins/custom.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - Creating Custom Plugins | SigPro - - - - - - - - - - - - - - - -
Skip to content

Creating Custom Plugins ​

There are two main ways to expose a plugin's functionality: Static/Manual Imports (cleaner for large projects) or Global/Automatic Window Injection (easier for quick scripts and global helpers).

1. The Anatomy of a Plugin ​

A plugin is a standard JavaScript function. By convention, if a plugin adds a global helper or component, it should be prefixed with an underscore (_).

javascript
// plugins/my-utils.js
-export const MyUtils = ($) => {
-  
-  // 1. Attach to the SigPro instance
-  $.capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
-
-  // 2. Attach to the Window (Global access)
-  window._hello = (name) => div(`Hello, ${$.capitalize(name)}!`);
-  
-  // 3. You can also return values if needed
-  return { version: '1.0.0' };
-};

2. Integration Strategies ​

This approach keeps your global namespace clean. You import the logic only where you need it, but the plugin still initializes the core $ extensions.

javascript
// main.js
-import { $ } from 'sigpro';
-import { MyUtils } from './plugins/my-utils.js';
-
-$.plugin(MyUtils);
-
-// App.js
-export default () => {
-  const name = "sigpro";
-  // $.capitalize was added by the plugin
-  return h1($.capitalize(name)); 
-};

Option B: Automatic Window Injection ​

If your plugin defines global tags (like _button or _hello), you should attach them to the window object inside the plugin function. This makes them available everywhere without imports.

javascript
// plugins/theme.js
-export const Theme = ($) => {
-  const $dark = $(false);
-
-  window._themeToggle = () => button({
-    onclick: () => $dark(v => !v),
-    class: () => $dark() ? 'bg-black text-white' : 'bg-white text-black'
-  }, "Toggle Mode");
-};
-
-// main.js
-$.plugin(Theme).then(() => {
-   // _themeToggle is now a global function
-   $.mount(App);
-});

3. Asynchronous Plugins ​

If your plugin needs to load external data or scripts before the app starts, make it async. SigPro will wait for it.

javascript
export const ConfigLoader = async ($) => {
-  const res = await fetch('/config.json');
-  const config = await res.json();
-  
-  $.config = config; // Attach loaded config to SigPro
-};
-
-// Usage
-$.plugin(ConfigLoader).then(() => {
-  console.log("Config loaded:", $.config);
-  $.mount(App);
-});

4. Best Practices for Plugin Authors ​

RuleDescription
PrefixingUse _ for UI components (_modal) and $. for logic ($.fetch).
IdempotencyEnsure calling $.plugin(MyPlugin) twice doesn't break the app.
EncapsulationUse the $ instance passed as an argument rather than importing it again inside the plugin.
ReactivityAlways use $(...) for internal state so the app stays reactive.
- - - - \ No newline at end of file diff --git a/docs/plugins/quick.html b/docs/plugins/quick.html deleted file mode 100644 index cd40972..0000000 --- a/docs/plugins/quick.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - Extending SigPro: $.plugin | SigPro - - - - - - - - - - - - - - - -
Skip to content

Extending SigPro: $.plugin ​

The plugin system is the engine's modular backbone. It allows you to inject new functionality directly into the $ object, register custom global tags, or load external libraries seamlessly.

1. How Plugins Work ​

A plugin in SigPro is a function that receives the core instance. When you call $.plugin(MyPlugin), the engine hands over the $ object so the plugin can attach new methods or extend the reactive system.

Functional Plugin Example ​

javascript
// A plugin that adds a simple watcher to any signal
-const Logger = ($) => {
-  $.watch = (target, label = "Log") => {
-    $(() => console.log(`[${label}]:`, target()));
-  };
-};
-
-// Activation
-$.plugin(Logger);
-const $count = $(0);
-$.watch($count, "Counter"); // Now available globally via $

2. Initialization Patterns (SigPro) ​

Thanks to the Synchronous Tag Engine, you no longer need complex import() nesting. Global tags like div(), span(), and button() are ready the moment you import the Core.

This is the standard way to build apps. It's clean, readable, and supports standard ESM imports.

javascript
// main.js
-import { $ } from 'sigpro';
-import { Fetch } from 'sigpro/plugins';
-import App from './App.js'; // Static import works perfectly!
-
-// 1. Register plugins
-$.plugin(Fetch);
-
-// 2. Mount your app directly
-$.mount(App, '#app');

3. Resource Plugins (External Scripts) ​

You can pass a URL or an Array of URLs. SigPro will inject them as <script> tags and return a Promise that resolves when the scripts are fully loaded. This is perfect for integrating heavy third-party libraries only when needed.

javascript
// Loading external libraries as plugins
-$.plugin([
-  'https://cdn.jsdelivr.net/npm/chart.js',
-  'https://cdn.example.com/custom-ui-lib.js'
-]).then(() => {
-  console.log("External resources are ready to use!");
-  $.mount(DashboardApp);
-});

4. Polymorphic Loading Reference ​

The $.plugin method is smart; it adapts its behavior based on the input type:

Input TypeActionBehavior
FunctionExecutes fn($)Synchronous: Immediate availability.
String (URL)Injects <script src="...">Asynchronous: Returns a Promise.
ArrayProcesses each item in the listReturns a Promise if any item is a URL.

πŸ’‘ Pro Tip: When to use .then()? ​

In SigPro, you only need .then() in two specific cases:

  1. External Assets: When loading a plugin via a URL (CDN).
  2. Strict Dependency: If your App.js requires a variable that is strictly defined inside an asynchronous external script (like window.Chart).

For everything else (UI components, Router, Local State), just call $.plugin() and continue with your code. It's that simple.


Summary Cheat Sheet ​

GoalCode
Local Plugin$.plugin(myPlugin)
Multiple Plugins$.plugin([UI, Router])
External Library$.plugin('https://...').then(...)
Hybrid Load$.plugin([UI, 'https://...']).then(...)
- - - - \ No newline at end of file diff --git a/docs/ui/button.html b/docs/ui/button.html deleted file mode 100644 index d52657e..0000000 --- a/docs/ui/button.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - Button Component | SigPro - - - - - - - - - - - - - - - -
Skip to content

Button Component ​

The _button component creates reactive buttons with built-in support for loading states, icons, badges, and disabled states.

Basic Usage ​

javascript
_button({ onclick: () => alert('Clicked!') }, 'Click Me')

Loading State ​

The $loading signal automatically shows a spinner and disables the button.

javascript
const $loading = $(false)
-
-_button({ 
-  $loading: $loading,
-  onclick: async () => {
-    $loading(true)
-    await saveData()
-    $loading(false)
-  }
-}, 'Save')

Icons ​

Add icons to buttons using the icon prop.

javascript
_button({ icon: '⭐' }, 'Favorite')
-_button({ icon: 'πŸ’Ύ' }, 'Save')
-_button({ icon: 'πŸ—‘οΈ', class: 'btn-error' }, 'Delete')

Badges ​

Add badges to buttons for notifications or status indicators.

javascript
_button({ badge: '3' }, 'Notifications')
-_button({ badge: 'New', badgeClass: 'badge-secondary' }, 'Update Available')

Button Variants ​

Use daisyUI classes to style your buttons.

javascript
_button({ class: 'btn-primary' }, 'Primary')
-_button({ class: 'btn-secondary' }, 'Secondary')
-_button({ class: 'btn-outline' }, 'Outline')
-_button({ class: 'btn-sm' }, 'Small')

Counter Example ​

javascript
const $count = $(0)
-
-_button({ 
-  onclick: () => $count($count() + 1),
-  icon: 'πŸ”’'
-}, () => `Count: ${$count()}`)

Async Action Example ​

javascript
const $saving = $(false)
-const $success = $(false)
-
-_button({ 
-  $loading: $saving,
-  icon: 'πŸ’Ύ',
-  onclick: async () => {
-    $saving(true)
-    await saveToDatabase()
-    $saving(false)
-    $success(true)
-    setTimeout(() => $success(false), 2000)
-  }
-}, 'Save')

API Reference ​

PropTypeDescription
$loadingSignal<boolean>Shows spinner and disables button
$disabledSignal<boolean>Disables the button
iconstring | NodeIcon to display before text
badgestringBadge text to display
badgeClassstringAdditional CSS classes for badge
classstring | functionAdditional CSS classes
onclickfunctionClick event handler
typestringButton type ('button', 'submit', etc.)
- - - - \ No newline at end of file diff --git a/docs/ui/form.html b/docs/ui/form.html deleted file mode 100644 index 8ef9b5a..0000000 --- a/docs/ui/form.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Form Components | SigPro - - - - - - - - - - - - - - - -
Skip to content

Form Components ​

SigPro UI provides a complete set of reactive form components including select dropdowns, checkboxes, radio buttons, and range sliders.

Select Dropdown (_select) ​

Creates a reactive dropdown select with options.

javascript
const $role = $('user')
-
-_select({
-  label: 'User Role',
-  options: [
-    { value: 'admin', label: 'Administrator' },
-    { value: 'user', label: 'Standard User' },
-    { value: 'guest', label: 'Guest' }
-  ],
-  $value: $role
-})

Checkbox (_checkbox) ​

Reactive checkbox with label.

javascript
const $agreed = $(false)
-
-_checkbox({
-  label: 'I agree to the terms and conditions',
-  $value: $agreed
-})

Radio Button (_radio) ​

Radio buttons for selecting one option from a group.

javascript
const $payment = $('credit')
-
-_radio({ name: 'payment', label: 'Credit Card', value: 'credit', $value: $payment })
-_radio({ name: 'payment', label: 'PayPal', value: 'paypal', $value: $payment })
-_radio({ name: 'payment', label: 'Crypto', value: 'crypto', $value: $payment })

Range Slider (_range) ​

Reactive range slider for numeric values.

javascript
const $volume = $(50)
-
-_range({
-  label: 'Volume',
-  min: 0,
-  max: 100,
-  step: 1,
-  $value: $volume
-})

Complete Form Example ​

API Reference ​

_select ​

PropTypeDescription
labelstringField label
optionsArray<{value: any, label: string}>Select options
$valueSignal<any>Selected value signal

_checkbox ​

PropTypeDescription
labelstringCheckbox label
$valueSignal<boolean>Checked state signal

_radio ​

PropTypeDescription
namestringRadio group name
labelstringRadio option label
valueanyValue for this option
$valueSignal<any>Group selected value signal

_range ​

PropTypeDescription
labelstringSlider label
minnumberMinimum value
maxnumberMaximum value
stepnumberStep increment
$valueSignal<number>Current value signal
- - - - \ No newline at end of file diff --git a/docs/ui/input.html b/docs/ui/input.html deleted file mode 100644 index 6dd2a16..0000000 --- a/docs/ui/input.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - Input Component | SigPro - - - - - - - - - - - - - - - -
Skip to content

Input Component ​

The _input component creates reactive form inputs with built-in support for labels, tooltips, error messages, and two-way binding.

Basic Usage ​

javascript
const $name = $('')
-
-_input({
-  label: 'Name',
-  placeholder: 'Enter your name',
-  $value: $name
-})

With Tooltip ​

The tip prop adds an info badge with a tooltip.

javascript
_input({
-  label: 'Username',
-  tip: 'Choose a unique username (min. 3 characters)',
-  placeholder: 'johndoe123',
-  $value: $username
-})

With Error Handling ​

The $error signal displays an error message and styles the input accordingly.

javascript
const $email = $('')
-const $error = $(null)
-
-const validate = (value) => {
-  if (value && !value.includes('@')) {
-    $error('Please enter a valid email address')
-  } else {
-    $error(null)
-  }
-}
-
-_input({
-  label: 'Email',
-  type: 'email',
-  placeholder: 'user@example.com',
-  $value: $email,
-  $error: $error,
-  oninput: (e) => validate(e.target.value)
-})

Input Types ​

The component supports all standard HTML input types.

javascript
_input({ label: 'Text', placeholder: 'Text input', $value: $text })
-_input({ label: 'Password', type: 'password', placeholder: 'β€’β€’β€’β€’β€’β€’β€’β€’', $value: $password })
-_input({ label: 'Number', type: 'number', placeholder: '0', $value: $number })

Two-Way Binding ​

The $value prop creates two-way binding between the input and the signal.

javascript
const $message = $('Hello World')
-
-_input({
-  label: 'Message',
-  $value: $message
-})
-
-// The input updates when signal changes, and vice versa
-_button({ onclick: () => $message('Reset!') }, 'Reset Signal')

API Reference ​

PropTypeDescription
labelstringField label text
tipstringTooltip text shown on hover
$valueSignal<any>Two-way bound value signal
$errorSignal<string|null>Error message signal
typestringInput type (text, email, password, number, etc.)
placeholderstringPlaceholder text
classstring | functionAdditional CSS classes
oninputfunctionInput event handler
onchangefunctionChange event handler
disabledbooleanDisabled state

Examples ​

Registration Form Field ​

javascript
const $username = $('')
-const $usernameError = $(null)
-const $email = $('')
-const $emailError = $(null)
-
-_input({
-  label: 'Username',
-  placeholder: 'johndoe',
-  $value: $username,
-  $error: $usernameError,
-  oninput: (e) => validateUsername(e.target.value)
-})
-
-_input({
-  label: 'Email',
-  type: 'email',
-  placeholder: 'john@example.com',
-  $value: $email,
-  $error: $emailError,
-  oninput: (e) => validateEmail(e.target.value)
-})
- - - - \ No newline at end of file diff --git a/docs/ui/installation.html b/docs/ui/installation.html deleted file mode 100644 index 1260cf3..0000000 --- a/docs/ui/installation.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - Installation | SigPro - - - - - - - - - - - - - - - -
Skip to content

Installation ​

Prerequisites ​

  • Node.js 18 or higher
  • A project with SigPro already installed

Step 1: Install Dependencies ​

bash
npm install -D tailwindcss @tailwindcss/vite daisyui@next

Step 2: Configure Tailwind CSS v4 ​

Create a CSS file (e.g., src/app.css):

css
@import "tailwindcss";
-@plugin "daisyui";

Step 3: Import CSS in Your Entry Point ​

javascript
// main.js
-import './app.css';
-import { $ } from 'sigpro';
-import { UI } from 'sigpro/plugins';
-
-$.plugin(UI).then(() => {
-  console.log('βœ… UI Components ready');
-  import('./App.js').then(app => $.mount(app.default));
-});

Step 4: Verify Installation ​

Troubleshooting ​

Styles not applying? ​

  • Make sure app.css is imported before any other code
  • Check that Tailwind is properly configured in your build tool

Components not found? ​

  • Ensure $.plugin(UI) has completed before using components
  • Check browser console for any loading errors

Reactive updates not working? ​

  • Make sure you're passing signals, not primitive values
  • Use $value prop for two-way binding
- - - - \ No newline at end of file diff --git a/docs/ui/introduction.html b/docs/ui/introduction.html deleted file mode 100644 index 6882c85..0000000 --- a/docs/ui/introduction.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - UI Components | SigPro - - - - - - - - - - - - - - - -
Skip to content

UI Components ​

The SigPro UI plugin is a high-level component library built on top of the reactive core. It leverages Tailwind CSS v4 for utility styling and daisyUI v5 for semantic, themeable components.

Features ​

  • πŸš€ Fully Reactive: Every component automatically updates with signals
  • 🎨 Themeable: Supports all daisyUI themes out of the box
  • πŸ“± Responsive: Designed to work on all devices
  • πŸ”§ Zero Dependencies: Pure SigPro with no framework overhead

Quick Demo ​

What's Included ​

The UI plugin provides a comprehensive set of reactive components:

CategoryComponents
Actions_button
Forms_input, _select, _checkbox, _radio, _range
Layout_fieldset, _accordion, _drawer
Navigation_navbar, _menu, _tabs
Overlays_modal, _dropdown
Feedback_badge, _tooltip

Next Steps ​

- - - - \ No newline at end of file diff --git a/docs/ui/layout.html b/docs/ui/layout.html deleted file mode 100644 index b2272ec..0000000 --- a/docs/ui/layout.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Layout Components | SigPro - - - - - - - - - - - - - - - -
Skip to content

Layout Components ​

Layout components for structuring your application with containers, sections, and collapsible panels.

Fieldset (_fieldset) ​

Groups related form fields with a legend.

javascript
_fieldset({ legend: 'Personal Information' }, [
-  _input({ label: 'Full Name', $value: $name }),
-  _input({ label: 'Email Address', type: 'email', $value: $email }),
-  _select({ label: 'Role', options: [...], $value: $role })
-])

Accordion (_accordion) ​

Collapsible content panels. Can be used as standalone or grouped.

Single Accordion ​

javascript
_accordion({ title: 'What is SigPro UI?' }, [
-  $.html('p', {}, 'SigPro UI is a reactive component library...')
-])

Grouped Accordions (Radio Behavior) ​

When multiple accordions share the same name, only one can be open at a time.

javascript
// Grouped accordions - only one open at a time
-_accordion({ title: 'Getting Started', name: 'faq' }, content1)
-_accordion({ title: 'Installation', name: 'faq' }, content2)
-_accordion({ title: 'Customization', name: 'faq' }, content3)

Accordion with Open State ​

Control the initial open state with the open prop.

javascript
_accordion({ title: 'Open by Default', open: true }, [
-  $.html('p', {}, 'This accordion starts open.')
-])

Complete Layout Example ​

API Reference ​

_fieldset ​

PropTypeDescription
legendstringFieldset title/legend text
classstring | functionAdditional CSS classes

_accordion ​

PropTypeDescription
titlestringAccordion header text
namestringGroup name for radio behavior (optional)
openbooleanInitially open state (default: false)

Styling Tips ​

Custom Fieldset Styling ​

javascript
_fieldset({ 
-  legend: 'Custom Styled',
-  class: 'bg-primary/10 border-primary' 
-}, [
-  // content
-])

Custom Accordion Styling ​

javascript
_accordion({ 
-  title: 'Styled Accordion',
-  class: 'bg-base-200' 
-}, [
-  // content
-])

Nested Layouts ​

Layout components can be nested to create complex structures:

javascript
_fieldset({ legend: 'Main Section' }, [
-  _accordion({ title: 'Subsection 1' }, [
-    _input({ label: 'Field 1', $value: $field1 })
-  ]),
-  _accordion({ title: 'Subsection 2' }, [
-    _input({ label: 'Field 2', $value: $field2 })
-  ])
-])
- - - - \ No newline at end of file diff --git a/docs/ui/modal.html b/docs/ui/modal.html deleted file mode 100644 index 009db05..0000000 --- a/docs/ui/modal.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Modal & Drawer Components | SigPro - - - - - - - - - - - - - - - -
Skip to content

Modal & Drawer Components ​

Overlay components for dialogs, side panels, and popups with reactive control.

A dialog component that appears on top of the page. The modal is completely removed from the DOM when closed, optimizing performance.

Basic Modal ​

javascript
const $open = $(false)
-
-_button({ onclick: () => $open(true) }, 'Open Modal')
-
-_modal({ $open: $open, title: 'Welcome' }, [
-  $.html('p', {}, 'This is a simple modal dialog.'),
-  _button({ onclick: () => $open(false) }, 'Close')
-])
javascript
const $open = $(false)
-const $result = $(null)
-
-_modal({ $open: $open, title: 'Confirm Delete' }, [
-  $.html('p', {}, 'Are you sure you want to delete this item?'),
-  _button({ class: 'btn-error', onclick: () => {
-    $result('Item deleted')
-    $open(false)
-  } }, 'Delete')
-])

Drawer (_drawer) ​

A sidebar panel that slides in from the side.

Basic Drawer ​

javascript
const $open = $(false)
-
-_drawer({
-  id: 'my-drawer',
-  $open: $open,
-  content: $.html('div', {}, 'Main content'),
-  side: $.html('div', { class: 'p-4' }, [
-    $.html('h3', {}, 'Menu'),
-    $.html('ul', { class: 'menu' }, [
-      $.html('li', {}, [$.html('a', { onclick: () => $open(false) }, 'Close')])
-    ])
-  ])
-})

Drawer with Navigation Menu ​

API Reference ​

PropTypeDescription
$openSignal<boolean>Controls modal visibility
titlestringModal title text

_drawer ​

PropTypeDescription
idstringUnique identifier for the drawer
$openSignal<boolean>Controls drawer visibility
contentHTMLElementMain content area
sideHTMLElementSidebar content
- - - - \ No newline at end of file diff --git a/docs/ui/navigation.html b/docs/ui/navigation.html deleted file mode 100644 index afd9cbb..0000000 --- a/docs/ui/navigation.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - Navigation Components | SigPro - - - - - - - - - - - - - - - -
Skip to content

Navigation Components ​

Navigation components for building menus, navbars, and tabs with reactive active states.

A responsive navigation bar with built-in styling.

javascript
const $active = $('Home')
-
-_navbar({ class: 'shadow-md' }, [
-  div({ class: 'flex-1' }, [
-    a({ class: 'text-xl font-bold' }, 'MyApp')
-  ]),
-  div({ class: 'flex-none gap-2' }, [
-    _button({ 
-      class: () => $active() === 'Home' ? 'btn-primary btn-sm' : 'btn-ghost btn-sm',
-      onclick: () => $active('Home')
-    }, 'Home'),
-    _button({ 
-      class: () => $active() === 'About' ? 'btn-primary btn-sm' : 'btn-ghost btn-sm',
-      onclick: () => $active('About')
-    }, 'About')
-  ])
-])

Vertical navigation menu with active state highlighting.

javascript
const $selected = $('dashboard')
-
-_menu({ items: [
-  { 
-    label: 'Dashboard', 
-    icon: 'πŸ“Š',
-    active: () => $selected() === 'dashboard',
-    onclick: () => $selected('dashboard')
-  },
-  { 
-    label: 'Analytics', 
-    icon: 'πŸ“ˆ',
-    active: () => $selected() === 'analytics',
-    onclick: () => $selected('analytics')
-  }
-]})

Tabs (_tabs) ​

Horizontal tabs with lifted styling and active state.

javascript
const $activeTab = $('profile')
-
-_tabs({ items: [
-  { 
-    label: 'Profile', 
-    active: () => $activeTab() === 'profile',
-    onclick: () => $activeTab('profile')
-  },
-  { 
-    label: 'Settings', 
-    active: () => $activeTab() === 'settings',
-    onclick: () => $activeTab('settings')
-  }
-]})

A dropdown menu that appears on click.

javascript
const $selected = $(null)
-
-_dropdown({ label: 'Options' }, [
-  li([a({ onclick: () => $selected('Edit') }, '✏️ Edit')]),
-  li([a({ onclick: () => $selected('Duplicate') }, 'πŸ“‹ Duplicate')]),
-  li([a({ onclick: () => $selected('Delete') }, 'πŸ—‘οΈ Delete')])
-])

Complete Navigation Example ​

API Reference ​

PropTypeDescription
classstring | functionAdditional CSS classes
PropTypeDescription
itemsArray<{label: string, icon?: any, active?: boolean|function, onclick: function}>Menu items

_tabs ​

PropTypeDescription
itemsArray<{label: string, active: boolean|function, onclick: function}>Tab items
PropTypeDescription
labelstringDropdown trigger text
classstring | functionAdditional CSS classes
- - - - \ No newline at end of file diff --git a/docs/ui/quick.html b/docs/ui/quick.html new file mode 100644 index 0000000..feb48d8 --- /dev/null +++ b/docs/ui/quick.html @@ -0,0 +1,69 @@ + + + + + + 🧩 UI Components (WIP) | SigPro + + + + + + + + + + + + + + + +
Skip to content

🧩 UI Components (WIP) ​

Status: Work In Progress. > These are high-level, complex visual components designed to speed up development. They often replace native HTML elements with "superpowered" versions that handle their own internal logic, reactivity, and accessibility.

1. What are UI Components? ​

Unlike Tag Helpers (which are just functional mirrors of HTML tags), SigPro UI Components are smart abstractions.

  • Stateful: They manage complex internal states (like date ranges, search filtering, or API lifecycles).
  • Reactive: Attributes prefixed with $ are automatically tracked.
  • Self-Cleaning: They automatically use _cleanups to destroy observers or event listeners when removed from the DOM.
  • Themed: Fully compatible with Tailwind CSS and DaisyUI themes.

2. The UI Registry (Available Now) ​

CategoryComponents
Logic & FlowIf, For, Json
Forms & InputsButton, Input, Select, Autocomplete, Datepicker, Colorpicker, CheckBox, Radio, Range, Rating, Swap
FeedbackAlert, Toast, Modal, Loading, Badge, Tooltip, Indicator
NavigationNavbar, Menu, Drawer, Tabs, Accordion, Dropdown
Data & LayoutRequest, Response, Grid (AG-Grid), List, Stack, Timeline, Stat, Fieldset, Fab

3. Examples with "Superpowers" ​

A. The Declarative API Flow (Request & Response) ​

Instead of manually managing loading and error flags, use these two together to handle data fetching elegantly.

javascript
// 1. Define the request (it tracks dependencies automatically)
+const userProfile = Request(
+  () => `https://api.example.com/user/${userId()}`
+);
+
+// 2. Render the UI based on the request state
+Div({ class: "p-4" }, [
+  Response(userProfile, (data) => 
+    Div([
+      H1(data.name),
+      P(data.email)
+    ])
+  )
+]);

B. Smart Inputs & Autocomplete ​

Native inputs are boring. SigPro UI inputs handle labels, icons, password toggles, and validation states out of the box.

javascript
const searchQuery = $("");
+
+Autocomplete({
+  label: "Find a Country",
+  placeholder: "Start typing...",
+  options: ["Spain", "France", "Germany", "Italy", "Portugal"],
+  $value: searchQuery,
+  onSelect: (val) => console.log("Selected:", val)
+});

C. The Reactive Datepicker ​

Handles single dates or ranges with a clean, reactive interface.

javascript
const myDate = $(""); // or { start: "", end: "" } for range
+
+Datepicker({
+  label: "Select Expiry Date",
+  $value: myDate,
+  range: false // Set to true for range selection
+});

D. Imperative Toasts & Modals ​

Sometimes you just need to trigger a message without cluttering your template.

javascript
// Show a notification from anywhere in your logic
+Toast("Settings saved successfully!", "alert-success", 3000);
+
+// Control a modal with a simple signal
+const isModalOpen = $(false);
+
+Modal({ 
+  $open: isModalOpen, 
+  title: "Delete Account",
+  buttons: [
+    Button({ class: "btn-error", onclick: doDelete }, "Confirm")
+  ]
+}, "This action cannot be undone.");

4. Internationalization (i18n) ​

The UI library comes with a built-in locale system. It currently supports es and en.

javascript
// Set the global UI language
+SetLocale("en");
+
+// Access translated strings in your own components
+const t = tt("confirm"); // Returns a signal that tracks the current locale

5. Best Practices ​

  • Use $ for Reactivity: If a property starts with $, it expects a Signal (e.g., $value: mySignal).
  • Key your Lists: When using For, always provide a keyFn to ensure high-performance DOM reconciliation.
  • Cleanups: If you build custom components that use setInterval or observers, add them to the element's _cleanups Set.
+ + + + \ No newline at end of file diff --git a/docs/vite/plugin.html b/docs/vite/plugin.html index 7b0b036..88d938d 100644 --- a/docs/vite/plugin.html +++ b/docs/vite/plugin.html @@ -19,7 +19,7 @@ -
Skip to content

Vite Plugin: File-based Routing ​

The sigproRouter plugin for Vite automates route generation by scanning your pages directory. It creates a virtual module that you can import directly into your code, eliminating the need to maintain a manual routes array.

1. Project Structure ​

To use the plugin, organize your files within the src/pages directory. The folder hierarchy directly determines your application's URL structure. SigPro uses brackets [param] for dynamic segments.

text
my-sigpro-app/
+    
Skip to content

Vite Plugin: File-based Routing ​

The sigproRouter plugin for Vite automates route generation by scanning your pages directory. It creates a virtual module that you can import directly into your code, eliminating the need to maintain a manual routes array.

1. Project Structure ​

To use the plugin, organize your files within the src/pages directory. The folder hierarchy directly determines your application's URL structure. SigPro uses brackets [param] for dynamic segments.

text
my-sigpro-app/
 β”œβ”€β”€ src/
 β”‚   β”œβ”€β”€ pages/
 β”‚   β”‚   β”œβ”€β”€ index.js          β†’  #/
@@ -68,7 +68,7 @@
   { path: '/users/:id', component: () => import('/src/pages/users/[id].js') },
   // ...
 ];

Because it uses dynamic import(), Vite automatically performs Code Splitting, meaning each page is its own small JS file that only loads when the user navigates to it.

- + \ No newline at end of file diff --git a/package.json b/package.json index 74601b3..40f5c0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sigpro", - "version": "1.1.2", + "version": "1.1.3", "type": "module", "license": "MIT", "exports": { @@ -41,12 +41,14 @@ "url": "https://github.com/natxocc/sigpro/issues" }, "scripts": { - "docs:dev": "vitepress dev src/docs", - "docs:build": "vitepress build src/docs", - "docs:preview": "vitepress preview src/docs" + "dev:docs": "vitepress dev src/docs", + "build:docs": "vitepress build src/docs", + "preview:docs": "vitepress preview src/docs", + "build:aggrid": "vite build --config UI/aggrid/vite.config.js" }, "devDependencies": { - "vitepress": "^1.6.4" + "vitepress": "^1.6.4", + "terser": "^5.46.1" }, "keywords": [ "signals", diff --git a/plugins/debug.js b/plugins/debug.js deleted file mode 100644 index eb19d8e..0000000 --- a/plugins/debug.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * SigPro Debug Plugin - * Reactive state logger for signals and computed values. - */ -export const Debug = ($) => { - /** - * Tracks a signal and logs every state change to the browser console. - * @param {Function} $sig - The reactive signal or computed function to monitor. - * @param {string} [name="Signal"] - A custom label to identify the log entry. - * @example - * const $count = $(0); - * $.debug($count, "Counter"); - * $count(1); // Logs: Counter | Old: 0 | New: 1 - */ - _debug = ($sig, name = "Signal") => { - if (typeof $sig !== 'function') { - return console.warn(`[SigPro Debug] Cannot track "${name}": Not a function/signal.`); - } - - let prev = $sig(); - - $(() => { - const next = $sig(); - - if (Object.is(prev, next)) return; - - console.group(`%c SigPro Debug: ${name} `, "background: #1a1a1a; color: #bada55; font-weight: bold; border-radius: 3px; padding: 2px;"); - - console.log("%c Previous Value:", "color: #ff6b6b; font-weight: bold;", prev); - console.log("%c Current Value: ", "color: #51cf66; font-weight: bold;", next); - - if (next && typeof next === 'object') { - console.table(next); - } - - console.groupEnd(); - - prev = next; - }); - }; -}; \ No newline at end of file diff --git a/plugins/fetch.js b/plugins/fetch.js deleted file mode 100644 index 1e7cc90..0000000 --- a/plugins/fetch.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * SigPro Fetch Plugin - * Adds reactive data fetching capabilities to the SigPro instance. - * @param {SigPro} $ - The SigPro core instance. - */ -export const Fetch = ($) => { - /** - * Performs a reactive asynchronous fetch request. - * @param {string} url - The URL of the resource to fetch. - * @param {RequestInit} [options] - Optional settings for the fetch request (method, headers, body, etc.). - * @returns {{ $data: Function, $loading: Function, $error: Function }} - * An object containing reactive signals for the response data, loading state, and error message. - * * @example - * const { $data, $loading, $error } = $.fetch('https://api.example.com/users'); - * return div([ - * () => $loading() ? "Loading..." : ul($data().map(user => li(user.name))), - * () => $error() && span({ class: 'text-red' }, $error()) - * ]); - */ - _fetch = (url, options = {}) => { - const $data = $(null); - const $loading = $(true); - const $error = $(null); - - fetch(url, options) - .then(res => { - if (!res.ok) throw new Error(`HTTP error! Status: ${res.status}`); - return res.json(); - }) - .then(json => $data(json)) - .catch(err => { - console.error("[SigPro Fetch Error]:", err); - $error(err.message); - }) - .finally(() => $loading(false)); - - return { $data, $loading, $error }; - }; -}; \ No newline at end of file diff --git a/plugins/index.d.ts b/plugins/index.d.ts deleted file mode 100644 index 2e6a0da..0000000 --- a/plugins/index.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * SigPro Plugins - * Official plugins for SigPro reactive framework - * - * @module sigpro/plugins - */ - -import type { SigPro } from '../sigpro/sigpro'; - -/** - * Plugin context passed to all plugins - */ -export interface PluginContext { - $: SigPro; -} - -/** - * Base plugin interface - */ -export interface SigProPlugin { - /** Plugin name for debugging */ - name: string; - /** Plugin version */ - version?: string; - /** Initialize plugin with SigPro instance */ - install: (context: PluginContext) => void | Promise; -} - -/** - * UI Plugin - Creates reactive UI components - * - * @example - * ```javascript - * import { UI } from 'sigpro/plugins'; - * - * $.plugin(UI); - * - * // Now you can use UI components - * const modal = UI.modal({ - * title: 'Hello', - * content: 'This is a modal' - * }); - * ``` - */ -export const UI: SigProPlugin; - -/** - * Fetch Plugin - Reactive data fetching - * - * @example - * ```javascript - * import { Fetch } from 'sigpro/plugins'; - * - * $.plugin(Fetch); - * - * // Reactive data fetching - * const users = $.fetch('/api/users'); - * const user = $.fetch(() => `/api/users/${userId()}`); - * ``` - */ -export const Fetch: SigProPlugin; - -/** - * Debug Plugin - Development tools and logging - * - * @example - * ```javascript - * import { Debug } from 'sigpro/plugins'; - * - * $.plugin(Debug); - * - * // Debug signals in console - * $.debug(count); // Logs changes to console - * ``` - */ -export const Debug: SigProPlugin; - -/** - * Plugin options for each plugin - */ -export namespace PluginOptions { - interface UIOptions { - /** Prefix for CSS classes */ - classPrefix?: string; - /** Default animation duration */ - animationDuration?: number; - } - - interface FetchOptions { - /** Base URL for all requests */ - baseURL?: string; - /** Default headers */ - headers?: Record; - /** Timeout in milliseconds */ - timeout?: number; - } - - interface DebugOptions { - /** Enable verbose logging */ - verbose?: boolean; - /** Log to console */ - logToConsole?: boolean; - /** Enable time travel debugging */ - timeTravel?: boolean; - } -} \ No newline at end of file diff --git a/plugins/index.js b/plugins/index.js deleted file mode 100644 index 06fd422..0000000 --- a/plugins/index.js +++ /dev/null @@ -1,4 +0,0 @@ -// /plugins/index.js -export { UI } from './ui.js'; -export { Fetch } from './fetch.js'; -export { Debug } from './debug.js'; diff --git a/plugins/ui.js b/plugins/ui.js deleted file mode 100644 index fd73b25..0000000 --- a/plugins/ui.js +++ /dev/null @@ -1,583 +0,0 @@ -/** - * SigPro UI - daisyUI v5 & Tailwind v4 Plugin - * Provides a set of reactive functional components, flow control and i18n. - */ -export const UI = ($, defaultLang = 'es') => { - const ui = {}; - - // --- I18N CORE --- - const i18n = { - es: { close: "Cerrar", confirm: "Confirmar", cancel: "Cancelar", search: "Buscar...", loading: "Cargando..." }, - en: { close: "Close", confirm: "Confirm", cancel: "Cancel", search: "Search...", loading: "Loading..." } - }; - - const currentLocale = $(defaultLang); - - /** - * Sets the current locale for internationalization - * @param {string} locale - The locale code to set (e.g., 'es', 'en') - */ - ui._setLocale = (locale) => currentLocale(locale); - - /** - * Returns a function that retrieves a translated string for the current locale - * @param {string} key - The translation key to look up - * @returns {Function} Function that returns the translated string - */ - const translate = (key) => () => i18n[currentLocale()][key] || key; - - // --- UTILITY FUNCTIONS --- - - /** - * Normalized conditional rendering. - * @param {Function} condition - Signal returning boolean. - * @param {*} thenValue - Content if true. - * @param {*} otherwiseValue - Content if false. - * @returns {Function} Normalized accessor. - */ - ui._if = (condition, thenValue, otherwiseValue = null) => { - return () => { - const isTrue = condition(); - const result = isTrue ? thenValue : otherwiseValue; - if (typeof result === 'function' && !(result instanceof HTMLElement)) { - return result(); - } - return result; - }; - }; - - /** - * FOR (List Rendering): Efficient keyed reconciliation with movement optimization. - * @param {Function} source - Signal function returning an array of items. - * @param {Function} render - (item, index) => HTMLElement. - * @param {Function} keyFn - (item, index) => string|number. Required. - * @returns {HTMLElement} Container with fragment-like behavior and automatic item cleanup. - */ - ui._for = (source, render, keyFn) => { - if (typeof keyFn !== 'function') throw new Error('SigPro UI: _for requires a keyFn.'); - - const marker = document.createTextNode(''); - const container = $.html('div', { style: 'display:contents' }, [marker]); - const cache = new Map(); - - $(() => { - const items = source() || []; - const newKeys = new Set(); - - items.forEach((item, index) => { - const key = keyFn(item, index); - newKeys.add(key); - - if (cache.has(key)) { - const runtime = cache.get(key); - container.insertBefore(runtime.container, marker); - } else { - const runtime = $.createRuntime(() => { - return $.html('div', { style: 'display:contents' }, [render(item, index)]); - }); - cache.set(key, runtime); - container.insertBefore(runtime.container, marker); - } - }); - - cache.forEach((runtime, key) => { - if (!newKeys.has(key)) { - runtime.destroy(); - runtime.container.remove(); - cache.delete(key); - } - }); - }); - - return container; - }; - - /** - * REQ (Request): Reactive fetch handler with auto-abort on re-executions or component destruction. - * @param {string|Function} url - Target URL or Signal function returning a URL. - * @param {Object} [payload] - Data to send in the body. - * @param {Object} [options] - Fetch options including method, headers, and transform function. - * @returns {{data: Function, loading: Function, error: Function, success: Function, reload: Function}} - */ - ui._req = (url, payload = null, options = {}) => { - const data = $(null), loading = $(false), error = $(null), success = $(false); - let abortController = null; - - const execute = async (customPayload = null) => { - const targetUrl = typeof url === 'function' ? url() : url; - if (!targetUrl) return; - - if (abortController) abortController.abort(); - abortController = new AbortController(); - - loading(true); error(null); success(false); - try { - const bodyData = customPayload || payload; - const res = await fetch(targetUrl, { - method: options.method || (bodyData ? 'POST' : 'GET'), - headers: { 'Content-Type': 'application/json', ...options.headers }, - body: bodyData ? JSON.stringify(bodyData) : null, - signal: abortController.signal, - ...options - }); - - if (!res.ok) throw new Error(`HTTP ${res.status}`); - - let json = await res.json(); - if (typeof options.transform === 'function') json = options.transform(json); - - data(json); - success(true); - } catch (err) { - if (err.name !== 'AbortError') error(err.message); - } finally { - loading(false); - } - }; - - $(() => { - execute(); - return () => abortController?.abort(); - }); - - return { data, loading, error, success, reload: (p) => execute(p) }; - }; - -/** - * RES (Resource/Response): UI handler for a Request object. - * @param {Object} reqObj - The object returned by _req. - * @param {Function} renderFn - (data) => HTMLElement. Executed only on success. - * @returns {HTMLElement} A reactive container handling loading, error, and success states. - */ -ui._res = (reqObj, renderFn) => div({ class: 'res-container' }, [ - ui._if(reqObj.loading, - div({ class: 'flex justify-center p-4' }, span({ class: 'loading loading-dots text-primary' })) - ), - ui._if(reqObj.error, () => - div({ role: 'alert', class: 'alert alert-error' }, [ - span(reqObj.error()), - ui._button({ class: 'btn-xs btn-ghost border-current', onclick: () => reqObj.reload() }, 'Retry') - ]) - ), - ui._if(reqObj.success, () => { - const current = reqObj.data(); - return current !== null ? renderFn(current) : null; - }) -]); - -// --- INTERNAL HELPERS --- - -/** - * Combines base CSS classes with conditional or static extra classes - * @param {string} baseClasses - Base class names to always include - * @param {string|Function} extraClasses - Additional classes or function returning classes - * @returns {string|Function} Combined classes or function that returns combined classes - */ -const combineClasses = (base, extra) => { - if (typeof extra === 'function') { - return () => `${base} ${extra() || ''}`.trim(); - } - return `${base} ${extra || ''}`.trim(); -}; - -// --- UI COMPONENTS --- - -/** - * Button component with loading state, icon, indicator badge, and tooltip support - * @param {Object} props - Button properties - * @param {string|number|Function} [props.badge] - Content for the indicator badge - * @param {string} [props.badgeClass] - daisyUI classes for the badge (e.g., 'badge-primary') - * @param {HTMLElement|string} [props.icon] - Icon element or string to place before children - * @param {string} [props.tooltip] - Text to display in the daisyUI tooltip - * @param {Function} [props.$loading] - SigPro Signal: if true, shows spinner and disables button - * @param {Function} [props.$disabled] - SigPro Signal: if true, disables the button - * @param {string|Function} [props.$class] - Additional reactive or static CSS classes for the button - * @param {Function} [props.onclick] - Click event handler - * @param {*} children - Button text or inner content - * @returns {HTMLElement} Button element (wrapped in indicator/tooltip containers if props are present) - */ -ui._button = (props, children) => { - const btnEl = button({ - ...props, - badge: undefined, - badgeClass: undefined, - tooltip: undefined, - class: combineClasses('btn', props.$class || props.class), - $disabled: () => props.$disabled?.() || props.$loading?.() - }, [ - ui._if(() => props.$loading?.(), span({ class: 'loading loading-spinner' })), - props.icon && span({ class: 'mr-1' }, props.icon), - children - ]); - - let out = btnEl; - - if (props.badge) { - out = div({ class: 'indicator' }, [ - span({ class: combineClasses(`indicator-item badge ${props.badgeClass || 'badge-secondary'}`) }, props.badge), - out - ]); - } - - if (props.tooltip) { - out = div({ class: 'tooltip', 'data-tip': props.tooltip }, out); - } - - return out; -}; - -/** - * Input component with label, tooltip, error state, and search placeholder support - * @param {Object} props - Input properties - * @param {string} [props.label] - Text for the input label - * @param {string} [props.tip] - Contextual help text displayed in a tooltip next to the label - * @param {boolean} [props.isSearch] - If true, uses internationalized "search" placeholder if none provided - * @param {Function} [props.$value] - SigPro Signal for two-way data binding - * @param {Function} [props.$error] - SigPro Signal returning an error message string to display - * @param {string|Function} [props.$class] - Additional reactive or static CSS classes for the input - * @param {string} [props.placeholder] - Standard HTML placeholder attribute - * @param {string} [props.type] - Standard HTML input type (text, password, email, etc.) - * @param {Function} [props.oninput] - Event handler for input changes (handled automatically if $value is a signal) - * @returns {HTMLElement} Label wrapper containing the label, tooltip, input, and error message - */ -ui._input = (props) => label({ class: 'fieldset-label flex flex-col gap-1' }, [ - ui._if(() => props.label, div({ class: 'flex items-center gap-2' }, [ - span(props.label), - ui._if(() => props.tip, div({ class: 'tooltip tooltip-right', 'data-tip': props.tip }, - span({ class: 'badge badge-ghost badge-xs' }, '?'))) - ])), - $.html('input', { - ...props, - placeholder: props.placeholder || (props.isSearch ? translate('search') : ''), - class: combineClasses('input input-bordered w-full', props.$class || props.class), - $value: props.$value - }), - ui._if(() => props.$error?.(), span({ class: 'text-error text-xs' }, () => props.$error())) -]); - -/** - * SELECT: Dropdown component with native SigPro $value binding and keyed options. - * @param {Object} props - Select properties including $value signal and options array. - * @returns {HTMLElement} Styled select element within a label wrapper. - */ -ui._select = (props) => label({ class: 'fieldset-label flex flex-col gap-1' }, [ - ui._if(() => props.label, span(props.label)), - $.html('select', { - ...props, - class: combineClasses('select select-bordered', props.$class || props.class), - $value: props.$value, - onchange: (e) => props.$value?.(e.target.value) - }, ui._for(() => props.options || [], opt => - $.html('option', { value: opt.value }, opt.label), - opt => opt.value - )) -]); - -/** - * Checkbox component with reactive value binding - * @param {Object} props - Checkbox properties - * @returns {HTMLElement} Checkbox wrapper element - */ -ui._checkbox = (props) => label({ class: 'label cursor-pointer justify-start gap-3' }, [ - $.html('input', { type: 'checkbox', ...props, class: combineClasses('checkbox', props.$class || props.class), $checked: props.$value }), - ui._if(() => props.label, span({ class: 'label-text' }, props.label)) -]); - -/** - * Radio button component with reactive value binding and group support - * @param {Object} props - Radio properties - * @returns {HTMLElement} Radio wrapper element - */ -ui._radio = (props) => label({ class: 'label cursor-pointer justify-start gap-3' }, [ - $.html('input', { - type: 'radio', ...props, - class: combineClasses('radio', props.$class || props.class), - $checked: () => props.$value?.() === props.value, - onclick: () => props.$value?.(props.value) - }), - ui._if(() => props.label, span({ class: 'label-text' }, props.label)) -]); - -/** - * Range slider component with reactive value binding - * @param {Object} props - Range properties - * @returns {HTMLElement} Range wrapper element - */ -ui._range = (props) => div({ class: 'flex flex-col gap-2' }, [ - ui._if(() => props.label, span({ class: 'label-text' }, props.label)), - $.html('input', { type: 'range', ...props, class: combineClasses('range', props.$class || props.class), $value: props.$value }) -]); - -/** - * MODAL: Dialog component with explicit runtime destruction via watcher. - * @param {Object} props - Modal properties including $open signal and title. - * @param {*} children - Inner modal content. - * @returns {Function} Conditional modal renderer. - */ -ui._modal = (props, children) => { - let activeRuntime = null; - - return ui._if(props.$open, () => { - activeRuntime = $.createRuntime(() => dialog({ - class: 'modal modal-open' - }, [ - div({ class: 'modal-box' }, [ - ui._if(() => props.title, h3({ class: 'text-lg font-bold mb-4' }, props.title)), - children, - div({ class: 'modal-action' }, ui._button({ onclick: () => props.$open(false) }, translate('close'))) - ]), - form({ method: 'dialog', class: 'modal-backdrop', onclick: () => props.$open(false) }, button(translate('close'))) - ])); - - const stopWatcher = $(() => { - if (!props.$open()) { - activeRuntime?.destroy(); - stopWatcher(); - } - }); - - return activeRuntime.container; - }); -}; - -/** - * Generic Dropdown component for menus, pickers (color/date), or custom lists - * @param {Object} props - Dropdown properties - * @param {string|HTMLElement} props.label - Trigger element content (button text/icon) - * @param {string|Function} [props.$class] - daisyUI classes (e.g., 'dropdown-end', 'dropdown-hover') - * @param {boolean} [props.isAction] - If true, adds 'dropdown-open' or similar for programmatic control - * @param {*} children - Dropdown content (ul/li for menus, or custom picker/input components) - * @returns {HTMLElement} Dropdown container with keyboard focus support - */ -ui._dropdown = (props, children) => div({ - ...props, - class: combineClasses('dropdown', props.$class || props.class) -}, [ - div({ tabindex: 0, role: 'button', class: 'btn m-1' }, props.label), - div({ - tabindex: 0, - class: 'dropdown-content z-[50] p-2 shadow bg-base-100 rounded-box min-w-max' - }, children) -]); - -/** - * Accordion component with radio/checkbox toggle support - * @param {Object} props - Accordion properties - * @param {*} children - Accordion content - * @returns {HTMLElement} Accordion container - */ -ui._accordion = (props, children) => div({ class: 'collapse collapse-arrow bg-base-200 mb-2' }, [ - $.html('input', { type: props.name ? 'radio' : 'checkbox', name: props.name, checked: props.open }), - div({ class: 'collapse-title text-xl font-medium' }, props.title), - div({ class: 'collapse-content' }, children) -]); - -/** - * TABS: Navigation component with reactive items and content slots. - * @param {Object} props - Tabs properties including items array or signal. - * @returns {HTMLElement} Tabs container with navigation and content area. - */ -ui._tabs = (props) => { - const itemsSignal = typeof props.items === 'function' ? props.items : () => props.items || []; - - return div({ class: 'flex flex-col gap-4 w-full' }, [ - div({ - role: 'tablist', - class: combineClasses('tabs tabs-lifted', props.$class || props.class) - }, ui._for(itemsSignal, tabItem => a({ - role: 'tab', - class: () => `tab ${(typeof tabItem.active === 'function' ? tabItem.active() : tabItem.active) ? 'tab-active' : ''}`, - onclick: tabItem.onclick - }, tabItem.label), t => t.label)), - - div({ class: 'tab-content-area' }, () => { - const activeItem = itemsSignal().find(it => - typeof it.active === 'function' ? it.active() : it.active - ); - if (!activeItem) return null; - return typeof activeItem.content === 'function' ? activeItem.content() : activeItem.content; - }) - ]); -}; - -/** - * Badge component for status indicators - * @param {Object} props - Badge properties - * @param {*} children - Badge content - * @returns {HTMLElement} Badge element - */ -ui._badge = (props, children) => span({ ...props, class: combineClasses('badge', props.$class || props.class) }, children); - -/** - * Tooltip component that shows help text on hover - * @param {Object} props - Tooltip properties - * @param {*} children - Tooltip trigger content - * @returns {HTMLElement} Tooltip container - */ -ui._tooltip = (props, children) => div({ ...props, class: combineClasses('tooltip', props.$class || props.class), 'data-tip': props.tip }, children); - -/** - * Navigation bar component - * @param {Object} props - Navbar properties - * @param {*} children - Navbar content - * @returns {HTMLElement} Navbar container - */ -ui._navbar = (props, children) => div({ ...props, class: combineClasses('navbar bg-base-100 shadow-sm px-4', props.$class || props.class) }, children); - -/** - * Menu component with support for icons, active states, and nested sub-menus - * @param {Object} props - Menu properties - * @param {Array<{label: string, icon: HTMLElement, active: Signal/Fn, onclick: Fn, children: Array}>} props.items - Menu items - * @param {string|Function} [props.$class] - daisyUI classes (e.g., 'menu-horizontal', 'w-56') - * @returns {HTMLElement} List element with support for multi-level nesting - */ -ui._menu = (props) => { - const renderItems = (items) => ui._for(() => items || [], it => li({}, [ - it.children ? [ - details({ open: it.open }, [ - summary({}, [ - it.icon && span({ class: 'mr-2' }, it.icon), - it.label - ]), - ul({}, renderItems(it.children)) - ]) - ] : - a({ - class: () => (typeof it.active === 'function' ? it.active() : it.active) ? 'active' : '', - onclick: it.onclick - }, [ - it.icon && span({ class: 'mr-2' }, it.icon), - it.label - ]) - ])); - - return ul({ - ...props, - class: combineClasses('menu bg-base-200 rounded-box', props.$class || props.class) - }, renderItems(props.items)); -}; - -/** - * Drawer/sidebar component that slides in from the side - * @param {Object} props - Drawer properties - * @returns {HTMLElement} Drawer container - */ -ui._drawer = (props) => div({ class: 'drawer' }, [ - $.html('input', { id: props.id, type: 'checkbox', class: 'drawer-toggle', $checked: props.$open }), - div({ class: 'drawer-content' }, props.content), - div({ class: 'drawer-side' }, [ - label({ for: props.id, class: 'drawer-overlay', onclick: () => props.$open?.(false) }), - div({ class: 'min-h-full bg-base-200 w-80' }, props.side) - ]) -]); - -/** - * Form fieldset component with legend support - * @param {Object} props - Fieldset properties - * @param {*} children - Fieldset content - * @returns {HTMLElement} Fieldset container - */ -ui._fieldset = (props, children) => fieldset({ - ...props, - class: combineClasses('fieldset bg-base-200 border border-base-300 p-4 rounded-lg', props.$class || props.class) -}, [ - ui._if(() => props.legend, legend({ class: 'fieldset-legend font-bold' }, props.legend)), - children -]); - -/** - * Stack component for overlapping elements - * @param {Object} props - Stack properties - * @param {*} children - Stack content - * @returns {HTMLElement} Stack container - */ -ui._stack = (props, children) => div({ ...props, class: combineClasses('stack', props.$class || props.class) }, children); - -/** - * Statistics card component for displaying metrics - * @param {Object} props - Stat properties - * @returns {HTMLElement} Stat card element - */ -ui._stat = (props) => div({ class: 'stat' }, [ - props.icon && div({ class: 'stat-figure text-secondary' }, props.icon), - props.label && div({ class: 'stat-title' }, props.label), - div({ class: 'stat-value' }, typeof props.$value === 'function' ? props.$value : props.value), - props.desc && div({ class: 'stat-desc' }, props.desc) -]); - -/** - * Toggle switch component that swaps between two states - * @param {Object} props - Swap properties - * @returns {HTMLElement} Swap container - */ -ui._swap = (props) => label({ class: 'swap' }, [ - $.html('input', { - type: 'checkbox', - $checked: props.$value, - onchange: (event) => props.$value?.(event.target.checked) - }), - div({ class: 'swap-on' }, props.on), - div({ class: 'swap-off' }, props.off) -]); - -let toastContainer = null; - -/** - * TOAST: Notification system with direct reference management and runtime cleanup. - * @param {string} message - Text to display. - * @param {string} [type] - daisyUI alert class. - * @param {number} [duration] - Expiry time in ms. - */ -ui._toast = (message, type = "alert-success", duration = 3500) => { - let container = document.getElementById('sigpro-toast-container'); - if (!container) { - container = $.html('div', { id: 'sigpro-toast-container', class: 'fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2' }); - document.body.appendChild(container); - } - - const runtime = $.createRuntime(() => { - const el = div({ class: `alert ${type} shadow-lg transition-all duration-300 translate-x-10 opacity-0` }, [ - span(message), - ui._button({ class: 'btn-xs btn-circle btn-ghost', onclick: () => remove() }, 'βœ•') - ]); - - const remove = () => { - el.classList.add('translate-x-full', 'opacity-0'); - setTimeout(() => { - runtime.destroy(); - el.remove(); - if (!container.hasChildNodes()) container.remove(); - }, 300); - }; - - setTimeout(remove, duration); - return el; - }); - - const toastEl = runtime.container.firstChild; - container.appendChild(runtime.container); - requestAnimationFrame(() => toastEl.classList.remove('translate-x-10', 'opacity-0')); -}; -/** - * Confirmation dialog component with cancel and confirm actions - * @param {string} title - Dialog title - * @param {string} message - Dialog message - * @param {Function} onConfirm - Callback function when confirm is clicked - */ -ui._confirm = (title, message, onConfirm) => { - const isOpen = $(true); - const root = div(); - document.body.appendChild(root); - $.mount(root, () => ui._modal({ $open: isOpen, title }, [ - p({ class: 'py-4' }, message), - div({ class: 'modal-action gap-2' }, [ - ui._button({ class: 'btn-ghost', onclick: () => isOpen(false) }, translate('cancel')), - ui._button({ class: 'btn-primary', onclick: () => { onConfirm(); isOpen(false); } }, translate('confirm')) - ]) - ])); - $(() => { if (!isOpen()) setTimeout(() => root.remove(), 400); }); -}; - -ui._t = translate; -Object.keys(ui).forEach(key => { window[key] = ui[key]; $[key] = ui[key]; }); -}; \ No newline at end of file diff --git a/sigpro/llms.txt b/sigpro/llms.txt deleted file mode 100644 index 6362552..0000000 --- a/sigpro/llms.txt +++ /dev/null @@ -1,355 +0,0 @@ -```txt -# SigPro Core – Complete Reference for AI - -SigPro is a reactive UI library built on signals, with no virtual DOM and no compiler. It provides fine-grained reactivity, automatic cleanup, and direct DOM manipulation. This document describes the core API as exposed by the `$` global. - ---- - -## The `$` Function - -The `$` function creates **signals**, **computed values**, **effects**, and **persistent state**. Its behavior depends on the argument type. - -### 1. Primitive Signal - -```js -const count = $(0); // create with initial value -count(); // read β†’ 0 -count(5); // write β†’ 5 -count(v => v + 1); // update (increment) -``` - -### 2. Reactive Object (Proxy) - -If the argument is a plain object or array, a reactive proxy is returned. All properties become reactive, including nested objects. - -```js -const user = $({ name: 'Juan', age: 30 }); -user().name; // read property β†’ 'Juan' -user.name = 'Carlos'; // write property β†’ triggers updates -user.age = 31; // also reactive -``` - -Nested objects are automatically wrapped in proxies when accessed. - -### 3. Computed Signal - -If the argument is a **function**, it creates a computed signal. The function is executed lazily and caches its result. Dependencies are automatically tracked. - -```js -const count = $(0); -const double = $(() => count() * 2); -double(); // β†’ 0 -count(5); -double(); // β†’ 10 (automatically updated) -``` - -Computed signals are read‑only. - -### 4. Effect - -If you call `$` with a function **inside a component or runtime**, it becomes an effect that runs immediately and re‑runs whenever any of its dependencies change. The effect can return a cleanup function. - -```js -$(() => { - console.log('Count changed:', count()); -}); - -$(() => { - const timer = setInterval(() => console.log('tick'), 1000); - return () => clearInterval(timer); // cleanup on each re‑run or unmount -}); -``` - -Effects are automatically stopped when the component is unmounted (see `$.mount`). - -### 5. Persistent Signal - -If you pass a second argument (a string key), the signal is synchronized with `localStorage`. The initial value is loaded from storage, and every write is saved. - -```js -const theme = $('light', 'theme-key'); -const settings = $({ volume: 50 }, 'app-settings'); -``` - ---- - -## DOM Creation - -### `$.html(tag, props, children)` - -Creates a DOM element with the given tag, properties, and children. - -```js -const el = $.html('div', { class: 'container' }, 'Hello'); -``` - -If the second argument is not an object, it is treated as children: - -```js -$.html('div', 'Hello'); // no props -$.html('div', [h1('Title'), p('Text')]); // children array -``` - -### Tag Shortcuts - -Common tags are directly available as functions: - -```js -div(props, children) -span(props, children) -p() -h1(), h2(), h3() -ul(), li() -button() -input() -label() -form() -section() -a() -img() -nav() -hr() -``` - -All tag functions call `$.html` internally. - ---- - -## Props - -Props are objects passed to `$.html` or tag functions. - -### Static Attributes - -Standard HTML attributes are set as strings or booleans. - -```js -div({ class: 'btn', id: 'submit', disabled: true }, 'Click'); -``` - -### Reactive Attributes (prefixed with `$`) - -Attributes starting with `$` are reactive. Their value can be a static value, a signal, or a function returning a value. The attribute is updated automatically when the value changes. - -```js -const isActive = $(false); -div({ $class: () => isActive() ? 'active' : 'inactive' }); -``` - -Special reactive attributes: -- `$value` – two‑way binding for ``, `