@platforma-sdk/ui-vue 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.json +56 -0
  3. package/.prettierrc +6 -0
  4. package/CHANGELOG.md +9 -0
  5. package/README.md +5 -0
  6. package/dist/lib.js +50299 -0
  7. package/dist/lib.umd.cjs +248 -0
  8. package/dist/src/components/BlockLayout.vue.d.ts +5 -0
  9. package/dist/src/components/BlockLayout.vue.d.ts.map +1 -0
  10. package/dist/src/components/LoaderPage.vue.d.ts +3 -0
  11. package/dist/src/components/LoaderPage.vue.d.ts.map +1 -0
  12. package/dist/src/components/NotFound.vue.d.ts +3 -0
  13. package/dist/src/components/NotFound.vue.d.ts.map +1 -0
  14. package/dist/src/components/PlAgDataTable/OverlayLoading.vue.d.ts +11 -0
  15. package/dist/src/components/PlAgDataTable/OverlayLoading.vue.d.ts.map +1 -0
  16. package/dist/src/components/PlAgDataTable/OverlayNoRows.vue.d.ts +3 -0
  17. package/dist/src/components/PlAgDataTable/OverlayNoRows.vue.d.ts.map +1 -0
  18. package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts +16 -0
  19. package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts.map +1 -0
  20. package/dist/src/components/PlAgDataTable/index.d.ts +3 -0
  21. package/dist/src/components/PlAgDataTable/index.d.ts.map +1 -0
  22. package/dist/src/components/PlAgDataTable/sources/file-source.d.ts +7 -0
  23. package/dist/src/components/PlAgDataTable/sources/file-source.d.ts.map +1 -0
  24. package/dist/src/components/PlAgDataTable/sources/table-source.d.ts +15 -0
  25. package/dist/src/components/PlAgDataTable/sources/table-source.d.ts.map +1 -0
  26. package/dist/src/components/PlAgDataTable/types.d.ts +35 -0
  27. package/dist/src/components/PlAgDataTable/types.d.ts.map +1 -0
  28. package/dist/src/components/ValueOrErrorsComponent.vue.d.ts +27 -0
  29. package/dist/src/components/ValueOrErrorsComponent.vue.d.ts.map +1 -0
  30. package/dist/src/composition/useWatchResult.d.ts +7 -0
  31. package/dist/src/composition/useWatchResult.d.ts.map +1 -0
  32. package/dist/src/computedResult.d.ts +35 -0
  33. package/dist/src/computedResult.d.ts.map +1 -0
  34. package/dist/src/createApp.d.ts +27 -0
  35. package/dist/src/createApp.d.ts.map +1 -0
  36. package/dist/src/createModel.d.ts +3 -0
  37. package/dist/src/createModel.d.ts.map +1 -0
  38. package/dist/src/defineApp.d.ts +14 -0
  39. package/dist/src/defineApp.d.ts.map +1 -0
  40. package/dist/src/defineStore.d.ts +2 -0
  41. package/dist/src/defineStore.d.ts.map +1 -0
  42. package/dist/src/lib.d.ts +16 -0
  43. package/dist/src/lib.d.ts.map +1 -0
  44. package/dist/src/types.d.ts +73 -0
  45. package/dist/src/types.d.ts.map +1 -0
  46. package/dist/src/types.static-test.d.ts +7 -0
  47. package/dist/src/types.static-test.d.ts.map +1 -0
  48. package/dist/src/urls.d.ts +4 -0
  49. package/dist/src/urls.d.ts.map +1 -0
  50. package/dist/src/utils.d.ts +20 -0
  51. package/dist/src/utils.d.ts.map +1 -0
  52. package/dist/style.css +1 -0
  53. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  54. package/index.html +13 -0
  55. package/package.json +64 -0
  56. package/src/assets/base.scss +9 -0
  57. package/src/assets/block.scss +71 -0
  58. package/src/assets/file-dialog.scss +181 -0
  59. package/src/assets/icons/empty-cat.svg +21 -0
  60. package/src/assets/icons/no-data-cat.svg +40 -0
  61. package/src/assets/ui.scss +9 -0
  62. package/src/components/BlockLayout.vue +40 -0
  63. package/src/components/LoaderPage.vue +7 -0
  64. package/src/components/NotFound.vue +21 -0
  65. package/src/components/PlAgDataTable/OverlayLoading.vue +47 -0
  66. package/src/components/PlAgDataTable/OverlayNoRows.vue +29 -0
  67. package/src/components/PlAgDataTable/PlAgDataTable.vue +293 -0
  68. package/src/components/PlAgDataTable/ag-theme.css +403 -0
  69. package/src/components/PlAgDataTable/assets/cat-in-bag.png +0 -0
  70. package/src/components/PlAgDataTable/assets/sad-cat.png +0 -0
  71. package/src/components/PlAgDataTable/index.ts +3 -0
  72. package/src/components/PlAgDataTable/sources/file-source.ts +25 -0
  73. package/src/components/PlAgDataTable/sources/table-source.ts +235 -0
  74. package/src/components/PlAgDataTable/types.ts +38 -0
  75. package/src/components/ValueOrErrorsComponent.vue +28 -0
  76. package/src/composition/useWatchResult.ts +42 -0
  77. package/src/computedResult.ts +47 -0
  78. package/src/createApp.ts +213 -0
  79. package/src/createModel.ts +108 -0
  80. package/src/defineApp.ts +78 -0
  81. package/src/defineStore.ts +32 -0
  82. package/src/lib.ts +26 -0
  83. package/src/types.static-test.ts +80 -0
  84. package/src/types.ts +106 -0
  85. package/src/urls.ts +14 -0
  86. package/src/utils.ts +75 -0
  87. package/src/vite-env.d.ts +8 -0
  88. package/tsconfig.json +11 -0
  89. package/tsconfig.lib.json +27 -0
  90. package/tsconfig.node.json +13 -0
  91. package/vite.config.ts +26 -0
@@ -0,0 +1,248 @@
1
+ (function(Y,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(Y=typeof globalThis<"u"?globalThis:Y||self,c(Y.SdkVueLib={},Y.Vue))})(this,function(Y,c){"use strict";function Hw(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value");return e}function ac(e){return e!==null&&typeof e=="object"}function cc(e,t){return ac(e)&&ac(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(i=>cc(e[i],t[i])):e===t}function Cs(e){if(Array.isArray(e)){const t=[];for(let i=0;i<e.length;i++)t[i]=Cs(e[i]);return t}else if(ac(e)){const t={};return Object.keys(e).forEach(i=>{t[i]=Cs(e[i])}),t}else return e}const Ww=e=>e,zw=e=>e instanceof Error?e:Error(String(e)),Uw=e=>e.name==="ZodError",$w=e=>{const{formErrors:t,fieldErrors:i}=e.flatten(),s=Object.entries(i).map(([n,o])=>n+":"+(o==null?void 0:o.join(",")));return t.concat(s).join("; ")};function dc(e){const t=e.validate??Ww,{autoSave:i}=e,s=c.ref(),n=c.ref();c.watch(()=>e.get(),C=>{n.value=Cs(C)},{immediate:!0});const o=()=>{e.onSave(t(Cs(n.value)))},r=()=>{n.value=Cs(e.get()),s.value=void 0},a=C=>{s.value=void 0;try{t(C),i&&o()}catch(v){const S=zw(v);Uw(S)?s.value=Error($w(S)):s.value=S}},d=c.computed({get:()=>n.value,set(C){n.value=C,a(C)}});c.watch(n,C=>{cc(e.get(),C)||a(C)},{deep:!0});const h=c.computed(()=>!s.value),g=c.computed(()=>!cc(e.get(),c.unref(n))),f=c.computed(()=>s.value?s.value.message:"");return c.reactive({model:d,valid:h,isChanged:g,error:s,errorString:f,save:o,revert:r})}const Kw=e=>Object.fromEntries(new URL(e,"http://dummy").searchParams);class uc extends Error{}class hc extends Error{constructor(t){super(),this.errors=t}toString(){return this.errors.join(",")}}function jw(e){return{ok:!0,value:e}}function ep(e){if(!e)throw new uc;if(!e.ok)throw Error(e.errors.join(";"));return e.value}function tp(e){return{value:e,errors:void 0}}function Zw(e){if(e.errors)throw new hc(e.errors);if(!e.value)throw new uc;return e.value}function qw(e){return e!==void 0}function Yw(e){const t=e.split("/"),i=[];for(let s=0;s<t.length;s++)i.push({index:s,name:s===0?"Root":t[s],path:t.slice(0,s+1).join("/")});return i}function Qw(e,t){const i=c.reactive({args:Object.freeze(e.args),outputs:Object.freeze(e.outputs),ui:Object.freeze(e.ui),navigationState:Object.freeze(e.navigationState)});t.onStateUpdates(async d=>{d.forEach(h=>{h.key==="args"&&(i.args=Object.freeze(h.value)),h.key==="ui"&&(i.ui=Object.freeze(h.value)),h.key==="outputs"&&(i.outputs=Object.freeze(h.value)),h.key==="navigationState"&&(i.navigationState=Object.freeze(h.value))}),await c.nextTick()});const s=()=>Cs(i.args),n=()=>Cs(i.ui),o=()=>Cs(i.navigationState),r={createArgsModel(d={}){return dc({get(){return d.transform?d.transform(i.args):i.args},validate:d.validate,autoSave:!0,onSave(h){t.setBlockArgs(h)}})},createUiModel(d={},h){return dc({get(){return d.transform?d.transform(i.ui):i.ui??h()},validate:d.validate,autoSave:!0,onSave(g){t.setBlockUiState(g)}})},useOutputs(...d){const h=c.reactive({errors:void 0,value:void 0});return c.watch(()=>i.outputs,()=>{try{Object.assign(h,{value:this.unwrapOutputs(...d),errors:void 0})}catch(g){Object.assign(h,{value:void 0,errors:[String(g)]})}},{immediate:!0,deep:!0}),h},unwrapOutputs(...d){const h=i.outputs,g=d.map(f=>[f,ep(h[f])]);return Object.fromEntries(g)},getOutputField(d){return i.outputs[d]},getOutputFieldOkOptional(d){const h=this.getOutputField(d);if(h&&h.ok)return h.value},getOutputFieldErrorsOptional(d){const h=this.getOutputField(d);if(h&&!h.ok)return h.errors},updateArgs(d){const h=s();return d(h),t.setBlockArgs(h)},updateUiState(d){const h=n();return t.setBlockUiState(d(h))},updateNavigationState(d){const h=o();return d(h),t.setNavigationState(h)},navigateTo(d){const h=o();return h.href=d,t.setNavigationState(h)}},a={args:c.computed(()=>i.args),outputs:c.computed(()=>i.outputs),ui:c.computed(()=>i.ui),navigationState:c.computed(()=>i.navigationState),href:c.computed(()=>i.navigationState.href),outputValues:c.computed(()=>{const d=Object.entries(i.outputs).map(([h,g])=>[h,g.ok&&g.value!==void 0?g.value:void 0]);return Object.fromEntries(d)}),outputErrors:c.computed(()=>{const d=Object.entries(i.outputs).map(([h,g])=>[h,g&&!g.ok?new hc(g.errors):void 0]);return Object.fromEntries(d)}),queryParams:c.computed(()=>Kw(i.navigationState.href)),hasErrors:c.computed(()=>Object.values(i.outputs).some(d=>!(d!=null&&d.ok)))};return c.reactive(Object.assign(r,a))}const ip=Symbol("sdk-vue");function pc(){return c.inject(ip)}function Xw(e,t){let i;const s=()=>{e.loadBlockState().then(o=>{n.loaded=!0;const r=Qw(o,e),a=t(r);i=Object.assign(r,{...a,routes:Object.fromEntries(Object.entries(a.routes).map(([d,h])=>[d,c.markRaw(h)]))})}).catch(o=>{n.error=o})},n=c.reactive({loaded:!1,error:void 0,useApp(){return Hw(i,"App is not loaded")},install(o){o.provide(ip,this),s()}});return n}var Jw=Object.defineProperty,eS=(e,t,i)=>t in e?Jw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,tS=(e,t,i)=>eS(e,t+"",i);const iS=10,sS=30,nS=[{text:"Delete row",value:"delete:row"},{text:"Update value",value:"update:value"}],oS=[{text:"Delete column",value:"delete:column"},{text:"Fit content",value:"expand:column"}],rS=["^data-row-index"],lS=["value"],aS=c.defineComponent({__name:"TdCell",props:{cell:{},showContextOptions:{type:Function},cellEvents:{}},emits:["delete:row","update:value"],setup(e,{emit:t}){const i=t,s=e,n=c.reactive({edit:!1});function o(h){i("update:value",{rowIndex:s.cell.rowIndex,name:s.cell.colName,value:h.target.value}),n.edit=!1}function r(){const h=s.cellEvents??[];if(!s.showContextOptions){console.warn("inject showContextOptions interface for the table");return}const g=nS.filter(f=>h.includes(f.value));g.length&&s.showContextOptions(g,f=>{i(f,s.cell.rowIndex)})}const a=c.ref();function d(){s.cell.editable&&(n.edit=!0,requestAnimationFrame(()=>{var h,g;(g=(h=a.value)==null?void 0:h.querySelector("input"))==null||g.focus()}))}return(h,g)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"cellRef",ref:a,class:c.normalizeClass(["cell",{[h.cell.class]:!0,edit:n.edit}]),"^data-row-index":h.cell.rowIndex,onContextmenu:r,onClick:c.withModifiers(d,["stop"])},[n.edit?(c.openBlock(),c.createElementBlock("input",{key:0,value:h.cell.value,onFocusout:g[0]||(g[0]=f=>n.edit=!1),onChange:o},null,40,lS)):c.renderSlot(h.$slots,"default",{key:1})],42,rS))}});function st(e,t,i,s=!1){c.onMounted(()=>{var n;return(n=c.unref(e))==null?void 0:n.addEventListener(t,i,s)}),c.onUnmounted(()=>{var n;return(n=c.unref(e))==null?void 0:n.removeEventListener(t,i,s)})}function cS(e){c.onMounted(()=>window.addEventListener("mouseup",e)),c.onUnmounted(()=>window.removeEventListener("mouseup",e))}function sp(e){let t=!1;return function(...i){t?console.log("handle pressure"):(requestAnimationFrame(()=>{e(...i),t=!1}),t=!0)}}function dS(e,t){let i;function s(o){i={...o}}cS(()=>{i=void 0,t()});const n=sp(e);return st(window,"mousemove",o=>{i&&n({x:i.x,width:i.width,diff:o.x-i.x})}),{start:s}}var uS=Object.defineProperty,hS=(e,t,i)=>t in e?uS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,gc=(e,t,i)=>hS(e,typeof t!="symbol"?t+"":t,i);function fc(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value");return e}function pS(e,t){if(e===void 0)throw Error(t??"Undefined value");return e}function gS(e=void 0){return e}function fS(e){return e}function mS(e){return[...new Set(e)]}function CS(e,t){if(e==null)throw Error(t??"Empty (null | undefined) value")}function vS(e,t){if(e===void 0)throw Error(t??"Undefined value")}function np(e,t,i){const s=Math.min(t,i),n=Math.max(t,i);return e>=s&&e<=n}function wS(e){return e.map(t=>({text:String(t),value:t}))}function SS(e){return function(...t){const i=e(...t);async function s(n){return n.done?Promise.resolve(n.value):Promise.resolve(n.value).then(o=>s(i.next(o))).catch(o=>s(i.throw(o)))}try{return s(i.next())}catch(n){return Promise.reject(n)}}}class yS{constructor(){gc(this,"promise"),gc(this,"resolve",()=>{}),gc(this,"reject",()=>{}),this.promise=new Promise((t,i)=>{this.resolve=t,this.reject=i})}}function ol(e){return new Promise(t=>setTimeout(t,e))}function bS(){return new Promise(e=>queueMicrotask(e))}function RS(){const e=new Date().getTime();return function(){return new Date().getTime()-e}}function FS(){const e=performance.now();return function(){return performance.now()-e}}function op(e){return e()}function Eo(e,t,i){return t>e?t:e>i?i:e}function mc(e,t){return t(e)}function Js(e,t){if(e!=null)return t(e)}function xS(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function*rp(e,t,i=1){for(let s=e;s<t;s+=i)yield s}function lp(e){const t=[];for(const i of e)t.push(i);return t}function ES(e,t){return lp(rp(0,e)).map(t)}class PS{constructor(t){this._delay=t}async*generate(){let t=0;for(;;)await ol(this._delay),yield t++}async*[Symbol.asyncIterator](){let t=0;for(;;)await ol(this._delay),yield t++}}function DS(e,t){return Array.from({length:e},(i,s)=>t(s))}function TS(e,t){throw Error(t)}function AS(e){return t=>e[t]()}function MS(e){if(e&&e.ok)return e.value}function kS(e){if(e&&!e.ok)return e.error}function IS(e){if(e.ok)return e.value;throw Error(e.error)}function LS(e){return Array.isArray(e)?e:[e]}async function ap(e){return Object.fromEntries(await Promise.all(Object.entries(e).map(async([t,i])=>[t,await i])))}function _S(e,t){return Object.keys(t).every(i=>e[i]===t[i])}const Cc=e=>e;function OS(e){return e}function VS(e){return Object.entries(e).map(([t,i])=>({key:t,value:i}))}const rl=Object.freeze(Object.defineProperty({__proto__:null,Deferred:yS,Interval:PS,alike:_S,arrayFrom:DS,asConst:OS,async:SS,between:np,bool:fS,call:op,checkIfDefined:vS,checkIfNotEmpty:CS,clamp:Eo,delay:ol,errorOptional:kS,exhaustive:TS,flatValue:LS,identity:Cc,listToOptions:wS,match:AS,notEmpty:fc,notUndef:pS,okOptional:MS,performanceTimer:FS,randomInt:xS,range:rp,resolveAwaited:ap,tap:mc,tapIf:Js,tear:bS,timer:RS,times:ES,toList:lp,undef:gS,unionize:VS,uniqueValues:mS,unwrap:IS},Symbol.toStringTag,{value:"Module"}));function NS(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function BS(e){return e=e.replace(" ","-"),(e[0]||"").toLowerCase()+e.slice(1).replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function GS(e,t=[]){for(e=e?String(e):"";t.includes(e.charAt(0));)e=e.substr(1);for(;t.includes(e.charAt(e.length-1));)e=e.substr(0,e.length-1);return e}function cp(e){return e.replace(/^.*[\\/]/,"")}function dp(e){return e.replace(/^.*?[.]/,"")}function HS(e,t){const i=[];if(e.dataTransfer)for(let s=0;s<e.dataTransfer.items.length;s++){if(e.dataTransfer.items[s].kind!=="file")continue;const n=e.dataTransfer.items[s].getAsFile();n&&n.path&&i.push(n.path)}return t?i.filter(s=>t.includes(dp(cp(s)))):i}const WS=(e,t,i="s")=>`${e} ${t}${e!==1?i:""}`;function zS(e){try{return new RegExp(e),!0}catch{return!1}}function US(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function $S(e){return e?e.charAt(0).toLowerCase()+e.slice(1):""}function up(e){let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(NS(65,91));return t}function hp(){return up(42)}function KS(e,t){return e.substring(0,e.indexOf(t))}function jS(e,t){return e.substring(0,e.lastIndexOf(t))}function ZS(e,t){return e.substring(e.indexOf(t)+t.length,e.length)}function qS(e){if(typeof e!="string")throw Error("Expect string value, got: "+typeof e)}function YS(e){let t=0,i,s;if(e.length===0)return t;for(i=0;i<e.length;i++)s=e.charCodeAt(i),t=(t<<5)-t+s,t|=0;return t}const QS=Object.freeze(Object.defineProperty({__proto__:null,after:ZS,assertString:qS,before:KS,beforeLast:jS,camelToKebab:BS,extractExtension:dp,extractFileName:cp,extractPaths:HS,hashCode:YS,isRegexpValid:zS,lcFirst:$S,pluralize:WS,randomString:up,trimChars:GS,ucFirst:US,uniqueId:hp},Symbol.toStringTag,{value:"Module"}));function Po(e){return e!==null&&typeof e=="object"}function XS(e,t){return Object.keys(e).map(i=>t(e[i],i))}function vc(e,t){return Po(e)&&Po(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(i=>vc(e[i],t[i])):e===t}function Do(e){if(Array.isArray(e)){const t=[];for(let i=0;i<e.length;i++)t[i]=Do(e[i]);return t}else if(Po(e)){const t={};return Object.keys(e).forEach(i=>{t[i]=Do(e[i])}),t}else return e}function JS(e){return Array.isArray(e)?Object.assign([],e):Po(e)?Object.assign({},e):e}function ey(e,t){const i={};for(const s in t)t[s]!==e[s]&&(i[s]=e[s]);return i}function ty(e,t,i){return Object.assign({},e,{[t]:i})}function iy(e){return Object.entries(e).forEach(([t,i])=>{i instanceof Function&&(e[t]=i.bind(e))}),e}function sy(e,t,i){return e[t]=i,e}function ny(e,t){return e[t]}function oy(e,t){e={...e};const i=e[t];return delete e[t],[i,e]}function ry(e,...t){return Object.assign({},...t.map(i=>({[i]:e[i]})))}function ly(e,...t){return t.map(i=>e[i])}function ay(e,...t){const i=Object.assign({},e);return t.forEach(s=>delete i[s]),i}const wc=Object.freeze(Object.defineProperty({__proto__:null,bindMethods:iy,deepClone:Do,deepEqual:vc,getProp:ny,iSet:ty,isObject:Po,map:XS,omit:ay,pick:ry,pickValues:ly,setProp:sy,shallowClone:JS,shallowDiff:ey,shiftProp:oy},Symbol.toStringTag,{value:"Module"}));function cy(e,t){const i=e.findIndex(t);if(i<0)return[];const s=(()=>{for(let n=i;n<e.length;n++)if(!t(e[n],n))return n;return e.length})();return e.slice(i,s)}function pp(e,t,i){let s;return function(...n){s&&clearTimeout(s),s=setTimeout(()=>{s=void 0,e.apply(this,n)},t)}}const dy=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],uy=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],hy=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],py=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],gp=(e,t)=>{let i=String(e);return typeof t=="string"||Array.isArray(t)?i=e.toLocaleString(t):t===!0&&(i=e.toLocaleString(void 0)),i};function Sc(e,t){if(e=typeof e=="bigint"?Number(e):e,!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);Object.assign(t,{bits:!1,binary:!1});const i=t.bits?t.binary?py:hy:t.binary?uy:dy;if(t.signed&&e===0)return` 0 ${i[0]}`;const s=e<0,n=s?"-":t.signed?"+":"";if(s&&(e=-e),e<1){const d=gp(e,t.locale);return n+d+" "+i[0]}const o=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),i.length-1);e/=(t.binary?1024:1e3)**o,e=Number(e.toPrecision(3));const r=gp(Number(e),t.locale),a=i[o];return n+r+" "+a}function gy(e){var t;const i=rl.tapIf((t=c.unref(e))==null?void 0:t.querySelectorAll(".th-cell"),s=>[...s])??[];return i.map((s,n)=>{const{width:o,x:r}=s.getBoundingClientRect();return{index:n,width:o,x:r,right:r+o}}).slice(0,i.length-1)}function yc(){const e=c.reactive({x:0,y:0});function t(i){e.x=i.pageX,e.y=i.pageY}return c.onMounted(()=>window.addEventListener("mousemove",t)),c.onUnmounted(()=>window.removeEventListener("mousemove",t)),e}function bc(e,t={}){const{delayEnter:i=0,delayLeave:s=0}=t,n=c.ref(!1);let o;const r=a=>{const d=a?i:s;o&&(clearTimeout(o),o=void 0),d?o=setTimeout(()=>n.value=a,d):n.value=a};return window&&(st(e,"mouseenter",()=>r(!0)),st(e,"mouseleave",()=>r(!1))),n}const{tapIf:fy,clamp:my}=rl;function Cy(e,t){const i=yc(),s=bc(t,{}),n=dS(r=>{fy(e.resizeTh,a=>{e.columnsMeta[a.index]={width:my(r.width+r.diff,sS,1e4)}})},()=>{e.resize=!1,e.resizeTh=void 0,document.body.style.cursor=""});function o(r){e.resizeTh&&(e.resize=!0,n.start({x:r.x,width:e.resizeTh.width}))}return c.watchEffect(()=>{if(!s.value){document.body.style.cursor="";return}if(e.resize)return;const r=gy(t).find(a=>Math.abs(i.x-a.right)<iS);r?(document.body.style.cursor="col-resize",e.resizeTh=r):(e.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:o}}const vs=(e,t)=>{const i=e.__vccOpts||e;for(const[s,n]of t)i[s]=n;return i},vy={},wy={class:"add-column-btn"};function Sy(e,t){return c.openBlock(),c.createElementBlock("div",wy,t[0]||(t[0]=[c.createElementVNode("div",null,null,-1)]))}const yy=vs(vy,[["render",Sy]]),by={},Ry={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Fy(e,t){return c.openBlock(),c.createElementBlock("svg",Ry,t[0]||(t[0]=[c.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 41.5H9C7.61929 41.5 6.5 40.3807 6.5 39V24H9.5V38.5H24V41.5Z",fill:"#CFD1DB"},null,-1),c.createTextVNode(),c.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M41.5 9C41.5 7.61929 40.3807 6.5 39 6.5H9C7.61929 6.5 6.5 7.61929 6.5 9V19.5H9.5H28.5V38.5V41.5H39C40.3807 41.5 41.5 40.3807 41.5 39V9ZM38.5 9.5V16.5H31.5V9.5H38.5ZM38.5 38.5V19.5H31.5V38.5H38.5ZM9.5 9.5V16.5H28.5V9.5H9.5Z",fill:"#CFD1DB"},null,-1)]))}const xy=vs(by,[["render",Fy]]),Ey=c.defineComponent({__name:"ThCell",props:{col:{},showContextOptions:{type:Function},columnEvents:{}},emits:["delete:column","expand:column","change:sort"],setup(e,{emit:t}){const i=t,s=e;function n(a,d){const h=d.indexOf(a)+1;return d[h>=d.length?0:h]}function o(){const a=s.columnEvents??[];if(!s.showContextOptions){console.warn("inject showContextOptions interface for the table");return}const d=oS.filter(h=>a.includes(h.value));d.length&&s.showContextOptions(d,h=>{i(h,s.col.name)})}function r(a,d){i("change:sort",{colName:a,direction:n(d??"DESC",["DESC","ASC"])})}return(a,d)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["cell th-cell",{"justify-center":a.col.justify}]),onContextmenu:o},[a.col.valueType?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(a.col.valueType)},null,2)):c.createCommentVNode("",!0),c.createTextVNode(" "+c.toDisplayString(a.col.text)+" ",1),a.col.sort?(c.openBlock(),c.createElementBlock("div",{key:1,class:c.normalizeClass(["sort",a.col.sort.direction]),onClick:d[0]||(d[0]=c.withModifiers(()=>{var h;return r(a.col.name,(h=a.col.sort)==null?void 0:h.direction)},["stop"]))},null,2)):c.createCommentVNode("",!0)],34))}}),Py=c.defineComponent({__name:"TRow",props:{index:{},visible:{type:Boolean},height:{}},setup(e){return(t,i)=>(c.openBlock(),c.createElementBlock("div",{class:"t-row",style:c.normalizeStyle(`height: ${t.height}px`)},[t.visible?c.renderSlot(t.$slots,"default",{key:0}):c.createCommentVNode("",!0)],4))}});function fp(e){return typeof e=="number"||typeof e=="string"?e:String(e)}function Dy(e,t,i){for(const[s,n]of Object.entries(e)){const o=fp(t[s]),r=fp(i[s]),a=n==="DESC"?-1:1;if(o!==r)return(o>r?1:-1)*a}return 0}function mp(e){return e()}function Rc(e,t){if(e==null)throw Error(t);return e}function Fc(e){let t=!1;return function(...i){t||(requestAnimationFrame(()=>{e(...i),t=!1}),t=!0)}}function Cp(e){return new Promise(t=>setTimeout(t,e))}function vp(e,t){const i=setTimeout(e,t);return()=>{clearTimeout(i)}}function wp(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e}function Ty(e){let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(wp(65,91));return t}function Sp(e){return function(t){return 1-e(1-t)}}function Ay(e){return function(t){return t<.5?e(2*t)/2:(2-e(2*(1-t)))/2}}function yp(e){const{duration:t,draw:i,timing:s}=e,n=performance.now();let o=!1;return requestAnimationFrame(function r(a){let d=(a-n)/t;(d>1||o)&&(d=1);const h=s(d);i(h),d<1&&requestAnimationFrame(r)}),function(){o=!0}}function My(e){const{getFraction:t,draw:i,timing:s}=e,n=performance.now();let o=!1;return requestAnimationFrame(function r(a){let d=t(a-n);if(o)return;d>1&&(d=1);const h=s(d);i(h),d<1&&requestAnimationFrame(r)}),function(){o=!0}}function bp(e,t){let i=-1;return(...s)=>{i!==-1&&(clearTimeout(i),i=-1),i=window.setTimeout(()=>e(...s),t)}}function xc(e,t,i=!0){let s=0,n;return function(...o){n=()=>{e.apply(this,o),s=new Date().getTime()+t,n=null,i&&setTimeout(()=>{n&&n()},t)},new Date().getTime()>s&&n()}}function ky(e){return e.map(t=>({text:String(t),value:t}))}const Ec=40,Iy=c.defineComponent({__name:"index",props:{settings:{}},emits:["click:cell","delete:row","delete:column","change:sort","update:value"],setup(e){const{tapIf:t,tap:i}=rl,{uniqueId:s}=QS,n=e,o=c.reactive({rowIndex:-1,columnsMeta:{},resize:!1,resizeTh:void 0,bodyHeight:0,scrollTop:0}),r=c.ref(),a=c.ref(),d=c.ref(),h=()=>{t(d.value,I=>{o.bodyHeight=I.getBoundingClientRect().height})},g=c.computed(()=>n.settings.autoLastColumn?[...n.settings.columns,{name:s(),text:"_"}]:n.settings.columns),f=c.computed(()=>{const{columnsMeta:I}=o,V=c.unref(g),_=Object.keys(I).length;return V.map((O,M)=>M==V.length-1?_?"minmax(100px, 1fr)":O.width??"minmax(100px, 1fr)":I[M]?I[M].width+"px":O.width??"140px").join(" ")}),C=c.computed(()=>({gridColumn:"1 / "+c.unref(g).length+1})),v=c.computed(()=>c.unref(g).reduce((I,V)=>(I[V.name]=V.justify?"justify-"+V.justify:"",I),{})),S=c.computed(()=>{const I=c.unref(g),V=n.settings.rows.slice(),{bodyHeight:_,scrollTop:O}=o;if(n.settings.selfSort){const z=I.reduce((H,Z)=>{var ie;return(ie=Z.sort)!=null&&ie.direction&&(H[Z.name]=Z.sort.direction),H},{});Object.keys(z).length&&V.sort((H,Z)=>Dy(z,H,Z))}const M=160;let A=0;return V.map((z,H)=>{const Z=i(z.__height?Number(z.__height):Ec,ae=>!Number.isFinite(ae)||ae<Ec?Ec:ae),ie=I.map(ae=>{const ee=ae.name;return{colName:ee,rowIndex:H,value:z[ee],class:v.value[ee]+(H===o.rowIndex?" hovered":""),slot:ae.slot,editable:ae.editable}}),pe=_?O<A+Z+M&&A<_+O+M:!1;return A+=Z+1,{visible:pe,height:Z,cells:ie}})}),{mouseDown:R}=Cy(o,r);function y(){t(a.value,I=>{var V;I.scrollLeft=((V=d.value)==null?void 0:V.scrollLeft)??0})}const x=xc(()=>{var I;o.scrollTop=((I=d.value)==null?void 0:I.scrollTop)??0},10),P=()=>{y(),x()};function T(I){const V=g.value.findIndex(O=>O.name===I);if(V<0)return;const _=n.settings.rows.reduce((O,M)=>{const A=9.52*rl.call(()=>{const z=M[I];return z&&typeof z=="object"&&"segments"in z?z.segments.map(H=>H.sequence).join("").length:String(z??"").length});return A>O?A:O},0);o.columnsMeta[V]={width:_}}return c.onMounted(()=>{c.nextTick(h)}),c.watchPostEffect(()=>{c.unref(n.settings),c.nextTick(h)}),st(window,"resize",()=>c.nextTick(h)),(I,V)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"tableRef",ref:r,class:"grid-table",onMousedown:V[5]||(V[5]=(..._)=>c.unref(R)&&c.unref(R)(..._))},[I.settings.addColumn?(c.openBlock(),c.createBlock(yy,{key:0,onClick:c.withModifiers(I.settings.addColumn,["stop"])},null,8,["onClick"])):c.createCommentVNode("",!0),V[9]||(V[9]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"headRef",ref:a,class:"table-head",style:c.normalizeStyle({gridTemplateColumns:f.value})},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(g.value,(_,O)=>(c.openBlock(),c.createBlock(Ey,{key:O,col:_,"show-context-options":I.settings.showContextOptions,"column-events":I.settings.columnEvents,"onDelete:column":V[0]||(V[0]=M=>I.$emit("delete:column",M)),"onChange:sort":V[1]||(V[1]=M=>I.$emit("change:sort",M)),"onExpand:column":V[2]||(V[2]=M=>T(M))},null,8,["col","show-context-options","column-events"]))),128))],4),V[10]||(V[10]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"bodyRef",ref:d,class:"table-body",onScroll:P},[S.value.length===0?(c.openBlock(),c.createElementBlock("div",{key:0,class:"table-body__no-data",style:c.normalizeStyle(C.value)},[c.createElementVNode("div",null,[c.createVNode(xy),V[6]||(V[6]=c.createTextVNode()),V[7]||(V[7]=c.createElementVNode("div",null,"No Data To Show",-1))])],4)):c.createCommentVNode("",!0),V[8]||(V[8]=c.createTextVNode()),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(S.value,(_,O)=>(c.openBlock(),c.createBlock(Py,{key:O,visible:_.visible,height:_.height,index:O,style:c.normalizeStyle({gridTemplateColumns:f.value})},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(_.cells,(M,A)=>(c.openBlock(),c.createBlock(aS,{key:A,cell:M,"show-context-options":I.settings.showContextOptions,"cell-events":I.settings.cellEvents,onClick:c.withModifiers(z=>I.$emit("click:cell",M),["stop"]),"onDelete:row":V[3]||(V[3]=z=>I.$emit("delete:row",z)),"onUpdate:value":V[4]||(V[4]=z=>I.$emit("update:value",z))},{default:c.withCtx(()=>[M.slot?c.renderSlot(I.$slots,M.colName,c.mergeProps({key:0,ref_for:!0},M),()=>[c.createTextVNode(c.toDisplayString(M.value),1)]):c.renderSlot(I.$slots,"default",c.mergeProps({key:1,ref_for:!0},M),()=>[c.createTextVNode(c.toDisplayString(M.value),1)])]),_:2},1032,["cell","show-context-options","cell-events","onClick"]))),128))]),_:2},1032,["visible","height","index","style"]))),128))],544)],544))}}),Ly={class:"context-menu"},_y=["onClick"],Oy=c.defineComponent({__name:"Menu",props:{options:{}},emits:["close"],setup(e,{emit:t}){const i=t,s=n=>{n.cb(),i("close")};return(n,o)=>(c.openBlock(),c.createElementBlock("div",Ly,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(n.options,(r,a)=>(c.openBlock(),c.createElementBlock("div",{key:a,onClick:c.withModifiers(d=>s(r),["stop"])},[c.createElementVNode("span",null,c.toDisplayString(r.text),1)],8,_y))),128))]))}}),Vy=vs(Oy,[["__scopeId","data-v-11cad871"]]);function Pc(e,t){e.preventDefault();const i=()=>{c.render(null,document.body)},s=c.h(Vy,{options:t,onClose:()=>{i()}});c.render(s,document.body);const n=s.el;return n.style.top=e.clientY+"px",n.style.left=e.clientX+"px",document.addEventListener("click",o=>{n.contains(o.target)||i()}),i}const Rp=Symbol(),ll=()=>c.inject(Rp),Ny=["value"],By={key:1},Gy=c.defineComponent({__name:"BaseCellComponent",props:{modelValue:{},valueType:{},editable:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=e,n=c.reactive({edit:!1}),o=c.computed(()=>s.valueType),r=h=>{var g;let f=(g=h.target)==null?void 0:g.value;const C=c.unref(o),v=op(()=>C==="integer"?parseInt(f,10):C==="float"?Number(f):f);i("update:modelValue",v),n.edit=!1},a=c.ref(),d=h=>{!h.metaKey&&s.editable&&(n.edit=!0,requestAnimationFrame(()=>{var g,f;(f=(g=a.value)==null?void 0:g.querySelector("input"))==null||f.focus()}))};return(h,g)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"baseRef",ref:a,class:c.normalizeClass(["base-cell",{"base-cell__edit":n.edit}]),onClick:d},[n.edit?(c.openBlock(),c.createElementBlock("input",{key:0,value:h.modelValue,onFocusout:g[0]||(g[0]=f=>n.edit=!1),onChange:r},null,40,Ny)):(c.openBlock(),c.createElementBlock("div",By,c.toDisplayString(h.modelValue),1))],2))}}),Hy=["^data-row-index"],Wy={key:0,class:"control-cell"},zy=c.defineComponent({__name:"TdCell",props:{cell:{}},setup(e){const t=e,i=ll(),s=c.computed(()=>t.cell.column.valueType),n=h=>{Js(i.settings.value.onUpdatedRow,g=>{const f=t.cell.row,C={...f.dataRow,[t.cell.id]:h};g({...f,dataRow:C})})},o=h=>{h.metaKey&&i.selectRow(t.cell.row.primaryKey)},r=(h,g)=>{if(h.type==="contextmenu")h.preventDefault();else return;const f=i.settings??{},C=[],{onSelectedRows:v,onSelectedColumns:S}=f.value,R=i.data.selectedRows.has(g.primaryKey);v&&v.length&&(R?C.push({text:"Deselect row",cb(){i.data.selectedRows.delete(t.cell.row.primaryKey)}}):C.push({text:"Select row",cb(){i.selectRow(t.cell.row.primaryKey)}})),S&&S.length&&(C.push({text:"Select column",cb(){i.selectColumn(t.cell.column.id)}}),C.push({text:"Unselect column",cb(){i.unselectColumn(t.cell.column.id)}})),C.length&&Pc(h,C)},a=c.ref(),d=c.computed(()=>t.cell.column.component?t.cell.column.component():void 0);return(h,g)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"cellRef",ref:a,class:c.normalizeClass(["td-cell",{[h.cell.class]:!0}]),"^data-row-index":h.cell.row.index,onClick:o,onContextmenu:g[0]||(g[0]=f=>r(f,h.cell.row))},[h.cell.control?(c.openBlock(),c.createElementBlock("div",Wy,c.toDisplayString(h.cell.row.index),1)):d.value?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(d.value),{key:1,"model-value":h.cell.value,"onUpdate:modelValue":n},null,8,["model-value"])):(c.openBlock(),c.createBlock(Gy,{key:2,"model-value":h.cell.value,"value-type":s.value,editable:h.cell.column.editable,"onUpdate:modelValue":n},null,8,["model-value","value-type","editable"]))],42,Hy))}}),Uy={},$y={width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ky(e,t){return c.openBlock(),c.createElementBlock("svg",$y,t[0]||(t[0]=[c.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 41.5H9C7.61929 41.5 6.5 40.3807 6.5 39V24H9.5V38.5H24V41.5Z",fill:"#CFD1DB"},null,-1),c.createTextVNode(),c.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M41.5 9C41.5 7.61929 40.3807 6.5 39 6.5H9C7.61929 6.5 6.5 7.61929 6.5 9V19.5H9.5H28.5V38.5V41.5H39C40.3807 41.5 41.5 40.3807 41.5 39V9ZM38.5 9.5V16.5H31.5V9.5H38.5ZM38.5 38.5V19.5H31.5V38.5H38.5ZM9.5 9.5V16.5H28.5V9.5H9.5Z",fill:"#CFD1DB"},null,-1)]))}const jy=vs(Uy,[["render",Ky]]),Zy={class:"tr-head"},qy=c.defineComponent({__name:"TrHead",setup(e){return(t,i)=>(c.openBlock(),c.createElementBlock("div",Zy,[c.renderSlot(t.$slots,"default")]))}});function Yy(e,t){const i=t.indexOf(e)+1;return t[i>=t.length?0:i]}function Qy(e,t){const i=e.findIndex(t);if(i<0)return[];const s=(()=>{for(let n=i;n<e.length;n++)if(!t(e[n],n))return n;return e.length})();return e.slice(i,s)}const Xy=["^data-col-id"],Jy=c.defineComponent({__name:"ThCell",props:{col:{}},emits:["delete:column","expand:column","change:sort"],setup(e,{emit:t}){const i=t;function s(o){o.preventDefault();const r=[];r.length&&Pc(o,r)}function n(o){var r;const a=((r=o.sort)==null?void 0:r.direction)??"DESC";i("change:sort",{colId:o.id,direction:Yy(a,["DESC","ASC"])})}return(o,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["cell th-cell",{"justify-center":o.col.justify,frozen:o.col.frozen}]),"^data-col-id":o.col.id,onContextmenu:s},[o.col.valueType?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(o.col.valueType)},null,2)):c.createCommentVNode("",!0),c.createTextVNode(" "+c.toDisplayString(o.col.label)+" ",1),o.col.sort?(c.openBlock(),c.createElementBlock("div",{key:1,class:c.normalizeClass(["sort",o.col.sort.direction]),onClick:r[0]||(r[0]=c.withModifiers(()=>n(o.col),["stop"]))},null,2)):c.createCommentVNode("",!0)],42,Xy))}}),eb=c.defineComponent({__name:"TrBody",props:{row:{}},setup(e){const t=c.ref(),i=()=>{c.nextTick().then(()=>{Js(t.value,s=>s.scrollLeft=0)})};return(s,n)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"trRef",ref:t,class:c.normalizeClass(["tr-body",{selected:s.row.selected}]),scroll:"no",style:c.normalizeStyle(s.row.style),onScroll:i},[c.renderSlot(s.$slots,"default")],38))}}),tb=c.defineComponent({__name:"ColumnCaret",props:{column:{}},setup(e){const t=ll(),i=e,s=c.computed(()=>t.data.selectedColumns.has(i.column.id));return(n,o)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["column-caret",{selected:s.value,frozen:n.column.frozen}])},null,2))}});function ib(e){c.onMounted(()=>window.addEventListener("mouseup",e)),c.onUnmounted(()=>window.removeEventListener("mouseup",e))}function sb(e,t){let i;function s(o){i={...o}}ib(()=>{i=void 0,t()});const n=sp(e);return st(window,"mousemove",o=>{i&&n({x:i.x,width:i.width,diff:o.x-i.x})}),{start:s}}const Mn=1,nb=10,ob=30,Fp=60;function rb(e){var t;const i=Js((t=c.unref(e))==null?void 0:t.querySelectorAll(".th-cell"),s=>[...s])??[];return i.map(s=>{const{width:n,x:o}=s.getBoundingClientRect(),r=s.getAttribute("data-col-id");return Cc({colId:r,width:n,x:o,right:o+n})}).slice(0,i.length-1)}function lb(e,t){const i=yc(),s=bc(t,{}),{data:n}=e,o=sb(a=>{Js(n.resizeTh,d=>{const h=n.columns.find(g=>g.id===d.colId);h&&(h.width=Eo(a.width+a.diff,ob,1e4),e.adjustWidth())})},()=>{n.resize=!1,n.resizeTh=void 0,document.body.style.cursor=""}),r=a=>{n.resizeTh&&(n.resize=!0,o.start({x:a.x,width:n.resizeTh.width}))};return c.watchEffect(()=>{if(!s.value){document.body.style.cursor="";return}if(n.resize)return;const a=rb(t).find(d=>Math.abs(i.x-d.right)<nb);a?(document.body.style.cursor="col-resize",n.resizeTh=a):(n.resizeTh=void 0,document.body.style.cursor="")}),{mouseDown:r}}const ab={key:0,class:"command-menu"},cb={key:0},db=["onClick"],ub=c.defineComponent({__name:"RowsCommandMenu",setup(e){const t=ll(),i=c.computed(()=>t.getSelectedRows()),s=c.computed(()=>i.value.length>0),n=c.computed(()=>{var r;return((r=t.settings)==null?void 0:r.value.onSelectedRows)??[]}),o=c.computed(()=>n.value.map(r=>({label:r.label,cb:()=>{r.cb(i.value),t.data.selectedRows.clear(),t.data.rows=[]}})));return(r,a)=>s.value?(c.openBlock(),c.createElementBlock("div",ab,[i.value.length?(c.openBlock(),c.createElementBlock("span",cb,c.toDisplayString(i.value.length)+" rows selected",1)):c.createCommentVNode("",!0),a[0]||(a[0]=c.createTextVNode()),a[1]||(a[1]=c.createElementVNode("hr",null,null,-1)),a[2]||(a[2]=c.createTextVNode()),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.value,(d,h)=>(c.openBlock(),c.createElementBlock("span",{key:h,class:"command",onClick:c.withModifiers(d.cb,["stop"])},c.toDisplayString(d.label),9,db))),128))])):c.createCommentVNode("",!0)}}),hb={key:0,class:"command-menu"},pb={key:0},gb=["onClick"],fb=c.defineComponent({__name:"ColumnsCommandMenu",setup(e){const t=ll(),i=c.computed(()=>t.getSelectedColumns()),s=c.computed(()=>i.value.length>0),n=c.computed(()=>{var r;return((r=t.settings)==null?void 0:r.value.onSelectedColumns)??[]}),o=c.computed(()=>n.value.map(r=>({label:r.label,cb:()=>{r.cb(i.value),t.data.selectedColumns.clear()}})));return(r,a)=>s.value?(c.openBlock(),c.createElementBlock("div",hb,[i.value.length?(c.openBlock(),c.createElementBlock("span",pb,"selected columns "+c.toDisplayString(i.value.length),1)):c.createCommentVNode("",!0),a[0]||(a[0]=c.createTextVNode()),a[1]||(a[1]=c.createElementVNode("hr",null,null,-1)),a[2]||(a[2]=c.createTextVNode()),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.value,(d,h)=>(c.openBlock(),c.createElementBlock("span",{key:h,class:"command",onClick:c.withModifiers(d.cb,["stop"])},c.toDisplayString(d.label),9,gb))),128))])):c.createCommentVNode("",!0)}});function ws(e,t){const i={el:void 0,x:0,y:0},s=n=>({x:n.x,y:n.y,dx:n.x-i.x,dy:n.y-i.y});st(document,"mousedown",n=>{n.target===c.unref(e)&&(n.stopPropagation&&n.stopPropagation(),n.preventDefault&&n.preventDefault(),i.el=c.unref(e),i.x=n.x,i.y=n.y)}),st(document,"mouseup",n=>{i.el&&(i.el=void 0,t({...s(n),stop:!0},i))}),st(document,"mousemove",n=>{i.el&&t(s(n),i)})}const mb=c.defineComponent({__name:"TScroll",props:{offset:{},windowSize:{},dataSize:{}},emits:["change:offset"],setup(e,{emit:t}){const i=t,s=e,n=c.ref(),o=c.computed(()=>s.windowSize-12),r=c.computed(()=>s.windowSize<s.dataSize),a=c.computed(()=>Math.ceil(s.offset*(o.value/s.dataSize))),d=c.computed(()=>Math.ceil(o.value*o.value/s.dataSize)),h=c.computed(()=>({top:`${a.value}px`,height:`${d.value}px`}));return ws(n,(g,f)=>{const C=(a.value+g.dy)*s.dataSize/o.value;i("change:offset",C),f.x=g.x,f.y=g.y}),(g,f)=>(c.openBlock(),c.createElementBlock("div",{class:"t-scroll",style:c.normalizeStyle({height:`${g.windowSize}px`})},[c.createElementVNode("div",null,[r.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"handleRef",ref:n,class:"t-scroll__handle",style:c.normalizeStyle(h.value)},null,4)):c.createCommentVNode("",!0)])],4))}});function Cb(e){return c.computed(()=>{const{data:t,settings:i}=e,{bodyWidth:s,scrollLeft:n}=t,o=[...t.columns],r=hp();i.value.controlColumn&&o.unshift({id:r,label:"#",width:60,frozen:!0});let a=0;const d=o.map(g=>{const f={...g,offset:a};return a+=g.width+Mn,f}),h=d.filter(g=>g.frozen);return cy(d,g=>g.frozen?!1:n<g.offset+g.width&&g.offset<s+n).concat(h).map(g=>({...g,style:{left:g.frozen?`${g.offset}px`:`${g.offset-t.scrollLeft}px`,width:`${g.width}px`},control:g.id===r}))})}function vb(e,t){const i=c.computed(()=>t.value.reduce((s,n)=>(s[n.id]=n.justify?"justify-"+n.justify:"",s),{}));return c.computed(()=>e.rows.map(s=>{const n=i.value,{primaryKey:o,offset:r,dataRow:a,height:d}=s,h=t.value.map(g=>({id:g.id,column:g,row:s,value:a[g.id],class:n[g.id],editable:g.editable,width:g.width,style:g.style,control:g.control}));return Cc({style:{top:`${r-e.scrollTop}px`,height:`${s.height}px`},primaryKey:o,offset:r,height:d,cells:h,selected:e.selectedRows.has(o)})}))}const wb=async(e,t)=>{const{scrollTop:i,bodyHeight:s}=e;return await ol(0),ap({rows:t.getRows(i,s),dataWindow:e})};function Sb(e){const t=c.reactive({rowIndex:-1,columns:[],pendingLoads:0,currentWindow:void 0,rows:[],resize:!1,resizeTh:void 0,dataHeight:0,bodyHeight:e.settings.height,bodyWidth:0,scrollTop:0,scrollLeft:0,selectedRows:new Set,selectedColumns:new Set});c.watch(()=>e.settings,g=>{t.columns=Do(g.columns),t.currentWindow=void 0,g.dataSource.getHeight().then(f=>{t.dataHeight=f,h.updateBodyHeight()}).catch(f=>t.error=f)},{immediate:!0});const i=c.computed(()=>e.settings),s=c.computed(()=>t.columns.reduce((g,f)=>g+f.width+Mn,0)),n=c.computed(()=>mc(h.data.dataHeight-h.data.bodyHeight,g=>g>0?g:0)),o=c.computed(()=>mc(s.value-h.data.bodyWidth,g=>g>0?g:0)),r=c.computed(()=>({bodyHeight:t.bodyHeight,scrollTop:t.scrollTop,current:t.currentWindow})),a=Cb({data:t,settings:i}),d=vb(t,a),h={data:t,settings:i,tableColumns:a,tableRows:d,adjustWidth:()=>{const g=t.columns.reduce((C,v)=>C+v.width+Mn,0),f=t.bodyWidth+t.scrollLeft;if(g<f){const C=t.columns[t.columns.length-1];C.width=C.width+(f-g)}},updateOffsets(g){this.updateScrollTop(t.scrollTop+g.deltaY),this.updateScrollLeft(t.scrollLeft+g.deltaX)},getSelectedRows(){return t.rows.filter(g=>t.selectedRows.has(g.primaryKey))},getSelectedColumns(){return t.columns.filter(g=>t.selectedColumns.has(g.id))},selectRow(g){t.selectedRows.add(g)},unselectRow(g){t.selectedRows.delete(g)},selectColumn(g){t.selectedColumns.add(g)},unselectColumn(g){t.selectedColumns.delete(g)},updateScrollTop(g){t.scrollTop=Eo(g,0,n.value)},updateScrollLeft(g){t.scrollLeft=Eo(g,0,o.value)},updateBodyHeight(){const{height:g}=e.settings,{dataHeight:f}=t,C=g>f?f:g;t.bodyHeight=C},updateDimensions(g){this.updateBodyHeight(),h.data.bodyWidth=g.width,h.adjustWidth(),t.rows=[],t.currentWindow=void 0}};return c.watch(r,(g,f)=>{const C=g.current;(!C||g.scrollTop<C.scrollTop||g.scrollTop+g.bodyHeight>C.bodyHeight+C.scrollTop)&&(t.currentWindow={scrollTop:g.scrollTop-Fp,bodyHeight:g.bodyHeight+Fp*2},wb(Do(t.currentWindow),i.value.dataSource).then(({rows:v,dataWindow:S})=>{vc(t.currentWindow,S)&&(t.rows=v)}))},{deep:!0,immediate:!0}),c.provide(Rp,h),h}const yb={class:"command-menu__container"},bb={key:0,class:"table-body__no-data"},Rb={class:"carets"},Dc=c.defineComponent({__name:"TableComponent",props:{settings:{}},emits:["update:data","change:sort"],setup(e,{emit:t}){const i=t,s=e,n=Sb(s),o=c.computed(()=>n.data.rows.length===0),r=c.computed(()=>({height:o.value?"212px":n.data.bodyHeight+"px"}));c.watch(n.data,R=>i("update:data",R),{deep:!0}),c.watch(s,()=>g);const a=c.ref(),d=c.ref(),h=c.ref(),g=()=>{Js(h.value,R=>{n.updateDimensions(R.getBoundingClientRect())})},f=n.tableColumns,C=n.tableRows,{mouseDown:v}=lb(n,a);c.onMounted(()=>{c.nextTick(g)}),c.watchPostEffect(()=>{c.unref(s.settings),c.nextTick(g)}),st(window,"resize",()=>c.nextTick(g));const S=R=>{R.preventDefault(),n.updateOffsets(R)};return(R,y)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"tableRef",ref:a,class:"data-table",onMousedown:y[2]||(y[2]=(...x)=>c.unref(v)&&c.unref(v)(...x))},[c.createElementVNode("div",yb,[c.createVNode(ub),y[3]||(y[3]=c.createTextVNode()),c.createVNode(fb)]),y[7]||(y[7]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"headRef",ref:d,class:"table-head"},[c.createVNode(qy,null,{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(f),(x,P)=>(c.openBlock(),c.createBlock(Jy,{key:P,col:x,style:c.normalizeStyle(x.style),"onChange:sort":y[0]||(y[0]=T=>R.$emit("change:sort",T))},null,8,["col","style"]))),128))]),_:1})],512),y[8]||(y[8]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"bodyRef",ref:h,class:"table-body",style:c.normalizeStyle(r.value),onWheel:S},[o.value?(c.openBlock(),c.createElementBlock("div",bb,[c.createElementVNode("div",null,[c.createVNode(jy),y[4]||(y[4]=c.createTextVNode()),y[5]||(y[5]=c.createElementVNode("div",null,"No Data To Show",-1))])])):c.createCommentVNode("",!0),y[6]||(y[6]=c.createTextVNode()),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(C),(x,P)=>(c.openBlock(),c.createBlock(eb,{key:P,row:x},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(x.cells,T=>(c.openBlock(),c.createBlock(zy,{key:T.column.id+":"+P,cell:T,style:c.normalizeStyle(T.style)},null,8,["cell","style"]))),128))]),_:2},1032,["row"]))),128))],36),y[9]||(y[9]=c.createTextVNode()),c.createElementVNode("div",Rb,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(f),(x,P)=>(c.openBlock(),c.createBlock(tb,{key:P,column:x,style:c.normalizeStyle(x.style),"onChange:sort":y[1]||(y[1]=T=>R.$emit("change:sort",T))},null,8,["column","style"]))),128))]),y[10]||(y[10]=c.createTextVNode()),c.createVNode(mb,{offset:c.unref(n).data.scrollTop,"window-size":c.unref(n).data.bodyHeight,"data-size":c.unref(n).data.dataHeight,"onChange:offset":c.unref(n).updateScrollTop},null,8,["offset","window-size","data-size","onChange:offset"])],544))}}),xp=new WeakMap;class Fb{constructor(t,i,s){tS(this,"dataHeight"),this.datum=t,this.resolveHeight=i,this.resolvePrimaryKey=s;const n=t.reduce((r,a,d)=>(r.indices.set(d,r.total),r.total+=this.resolveHeight(a,d)+Mn,r),{total:0,indices:new Map});this.dataHeight=n.total;const o=t.map((r,a)=>({dataRow:r,index:a,primaryKey:this.resolvePrimaryKey(r,a),offset:fc(n.indices.get(a)),height:this.resolveHeight(r,a)}));xp.set(this,o)}get rows(){return xp.get(this)}async getHeight(){return this.dataHeight}async getRows(t,i){return Qy(this.rows,s=>{const n=s.offset;return t<n+s.height&&n<i+t})}}class xb{constructor(t,i,s){this.api=t,this.rowHeight=i,this.resolvePrimaryKey=s}get height(){return this.rowHeight+Mn}async getHeight(){return await this.api.count()*this.height}async getRows(t,i){const s=Eo(Math.floor(t/this.height),0,Number.POSITIVE_INFINITY),n=Math.ceil(i+40/this.height);return(await this.api.query({offset:s,limit:n})).map((o,r)=>({dataRow:o,index:s+r,primaryKey:this.resolvePrimaryKey(o,s+r),offset:(s+r)*(this.rowHeight+Mn),height:this.rowHeight}))}}function Eb(e){return Object.freeze(e)}function Pb(e){return c.h(Dc,{settings:Object.freeze(e)})}function Tc(e,t){const i=new Fb(e,t.resolveRowHeight,t.resolvePrimaryKey);return{...t,dataSource:i}}function Db(e,t){return c.computed(()=>{const i=c.unref(e);return Tc(i,c.unref(t))})}function Tb(e,t){const i=c.computed(()=>{const n=c.unref(e);return Tc(n,c.unref(t))}),s=c.reactive({settings:i});return c.computed(()=>c.h(Dc,s))}const Ab=Object.freeze(Object.defineProperty({__proto__:null,AsyncData:xb,Component:Dc,factory:Pb,rawDataSettings:Tc,settings:Eb,useRawData:Db,useRawDataComponent:Tb},Symbol.toStringTag,{value:"Module"}));function*Mb(e,t){for(const i of e)yield t(i)}function kb(e){const t=[];for(const i of e)t.push(i);return t}const Ac=new Map;function Ib(e){return Ac.has(e)||Ac.set(e,c.ref(localStorage.getItem(e))),Rc(Ac.get(e),"...")}function Lb(e,t){t==null?localStorage.removeItem(e):localStorage.setItem(e,t)}function Ep(e){const t=Ib(e);return c.watch(t,i=>Lb(e,i)),t}const Mc=new Set;window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{kb(Mb(Mc.values(),t=>t(e.matches?"dark":"light")))});const _b=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",Pp=c.ref(_b),kc=Ep("theme");function Dp(e){const t=c.computed(()=>kc.value?kc.value:Pp.value),i=n=>{Pp.value=n,e&&e(n)};function s(){kc.value=t.value==="light"?"dark":(t.value,"light")}return c.watch(t,n=>{e&&e(c.unref(n))}),c.onMounted(()=>{Mc.add(i)}),c.onUnmounted(()=>{Mc.delete(i)}),[t,s]}const Ob=c.defineComponent({__name:"ThemeSwitcher",setup(e){const[t,i]=Dp();return(s,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["ui-theme-switcher",c.unref(t)]),onClick:n[0]||(n[0]=(...o)=>c.unref(i)&&c.unref(i)(...o))},n[1]||(n[1]=[c.createElementVNode("div",null,null,-1)]),2))}}),Vb={class:"pl-layout-component pl-block-page"},Nb={key:0,class:"pl-block-page__title"},Bb={class:"pl-block-page__title__append"},Gb={key:1},Hb={class:"pl-block-page__body"},Wb={name:"PlBlockPage"},zb=c.defineComponent({...Wb,setup(e){const t=c.useSlots();return(i,s)=>(c.openBlock(),c.createElementBlock("div",Vb,[c.unref(t).title?(c.openBlock(),c.createElementBlock("div",Nb,[c.createElementVNode("h1",null,[c.renderSlot(i.$slots,"title")]),s[0]||(s[0]=c.createTextVNode()),c.createElementVNode("div",Bb,[c.renderSlot(i.$slots,"append")])])):(c.openBlock(),c.createElementBlock("div",Gb)),s[1]||(s[1]=c.createTextVNode()),c.createElementVNode("div",Hb,[c.renderSlot(i.$slots,"default")])]))}}),Ub={name:"PlContainer"},$b=c.defineComponent({...Ub,props:{width:{}},setup(e){const t=e,i=c.computed(()=>({width:t.width}));return(s,n)=>(c.openBlock(),c.createElementBlock("div",{class:"pl-container pl-layout-component",style:c.normalizeStyle(i.value)},[c.renderSlot(s.$slots,"default")],4))}}),Kb={name:"PlRow"},jb=c.defineComponent({...Kb,props:{wrap:{type:Boolean},alignCenter:{type:Boolean}},setup(e){return(t,i)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["pl-layout-component pl-row",{wrap:t.wrap,"align-center":t.alignCenter}])},[c.renderSlot(t.$slots,"default")],2))}}),Zb={class:"pl-layout-component",style:{"flex-grow":"1"}},qb={name:"PlSpacer"},Yb=c.defineComponent({...qb,setup(e){return(t,i)=>(c.openBlock(),c.createElementBlock("div",Zb))}}),Qb={name:"PlGrid"},Xb=c.defineComponent({...Qb,props:{columns:{}},setup(e){const t=e,i=c.computed(()=>({gridTemplateColumns:`repeat(${t.columns}, minmax(0, 1fr))`}));return(s,n)=>(c.openBlock(),c.createElementBlock("div",{class:"pl-layout-component pl-grid",style:c.normalizeStyle(i.value)},[c.renderSlot(s.$slots,"default")],4))}}),Jb={key:0,class:"pl-alert__icon"},eR={class:"pl-alert__main"},tR={key:0},iR={class:"pl-alert__main__text"},sR={name:"PlAlert"},nR=c.defineComponent({...sR,props:{modelValue:{type:Boolean,default:!0},type:{default:void 0},label:{default:void 0},icon:{type:Boolean,default:void 0},closeable:{type:Boolean,default:void 0},monospace:{type:Boolean,default:void 0},whiteSpacePre:{type:Boolean,default:void 0},maxHeight:{default:void 0}},emits:["update:modelValue"],setup(e){const t={success:"success",warn:"warning",info:"edit",error:"error"};return(i,s)=>i.modelValue?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["pl-alert",[{monospace:i.monospace,whiteSpacePre:i.whiteSpacePre},i.type?`pl-alert__${i.type}`:""]]),style:c.normalizeStyle({maxHeight:i.maxHeight})},[i.icon&&i.type?(c.openBlock(),c.createElementBlock("div",Jb,[c.createElementVNode("div",{class:c.normalizeClass(`icon-24 icon-${t[i.type]}`)},null,2)])):c.createCommentVNode("",!0),s[2]||(s[2]=c.createTextVNode()),c.createElementVNode("div",eR,[i.label?(c.openBlock(),c.createElementBlock("label",tR,c.toDisplayString(i.label),1)):c.createCommentVNode("",!0),s[1]||(s[1]=c.createTextVNode()),c.createElementVNode("div",iR,[c.renderSlot(i.$slots,"default")])]),s[3]||(s[3]=c.createTextVNode()),i.closeable?(c.openBlock(),c.createElementBlock("div",{key:1,class:"pl-alert__close-btn","aria-label":"Close alert",role:"button",onClick:s[0]||(s[0]=n=>i.$emit("update:modelValue",!1))})):c.createCommentVNode("",!0)],6)):c.createCommentVNode("",!0)}}),To=c.defineComponent({__name:"MaskIcon16",props:{name:{},size:{}},setup(e){const t=e,i=c.computed(()=>t.size==="large"?"--mask-size: 24px":""),s=c.computed(()=>`mask-16 mask-${t.name}`);return(n,o)=>(c.openBlock(),c.createElementBlock("i",{style:c.normalizeStyle(i.value),class:c.normalizeClass(s.value)},null,6))}});function Tp(e){function t(i){const s=i.currentTarget,n=document.createElement("span"),o=Math.max(s.clientWidth,s.clientHeight),r=o/2;n.style.width=n.style.height=`${o}px`,n.style.left=`${i.clientX-s.offsetLeft-r}px`,n.style.top=`${i.clientY-s.offsetTop-r}px`,n.classList.add("ripple");const a=s.getElementsByClassName("ripple")[0];a&&a.remove(),s.appendChild(n)}c.onMounted(()=>{var i;(i=e.value)==null||i.addEventListener("click",t)})}const oR={key:0},rR={inheritAttrs:!1},Ic=c.defineComponent({...rR,__name:"BtnBase",props:{loading:{type:Boolean},small:{type:Boolean},large:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e,i=c.ref(),s=c.computed(()=>t.small||t.size==="small"),n=c.computed(()=>t.large||t.size==="large");return Tp(i),(o,r)=>(c.openBlock(),c.createElementBlock("button",c.mergeProps({ref_key:"btn",ref:i,tabindex:"0",class:{loading:o.loading,small:s.value,large:n.value,round:o.round,reverse:o.reverse,justifyCenter:o.justifyCenter,[o.$attrs.class+""]:!0}},{...o.$attrs,disabled:!!o.$attrs.disabled||o.loading}),[o.round?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("span",oR,[c.renderSlot(o.$slots,"default")])),r[0]||(r[0]=c.createTextVNode()),o.loading?(c.openBlock(),c.createBlock(To,{key:1,name:"loading",size:o.size},null,8,["size"])):o.icon?(c.openBlock(),c.createBlock(To,{key:2,name:o.icon,size:o.size},null,8,["name","size"])):c.createCommentVNode("",!0)],16))}}),lR={name:"PlBtnPrimary"},Ap=c.defineComponent({...lR,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(i,s)=>(c.openBlock(),c.createBlock(Ic,c.mergeProps({class:"ui-btn-primary"},t),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"default")]),_:3},16))}}),aR={name:"PlBtnAccent"},cR=c.defineComponent({...aR,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(i,s)=>(c.openBlock(),c.createBlock(Ic,c.mergeProps({class:"ui-btn-accent"},t),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"default")]),_:3},16))}}),dR={name:"PlBtnSecondary"},Lc=c.defineComponent({...dR,props:{loading:{type:Boolean},size:{},round:{type:Boolean},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean}},setup(e){const t=e;return(i,s)=>(c.openBlock(),c.createBlock(Ic,c.mergeProps(t,{class:"ui-btn-secondary"}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"default")]),_:3},16))}}),uR={key:0},hR={name:"PlBtnGhost"},Mp=c.defineComponent({...hR,props:{loading:{type:Boolean},size:{default:void 0},round:{type:Boolean},icon:{default:void 0},reverse:{type:Boolean},justifyCenter:{type:Boolean,default:!0}},setup(e){const t=e,i=c.computed(()=>t.size==="small"),s=c.computed(()=>t.size==="large"),n=c.ref(),o=c.useSlots();return Tp(n),(r,a)=>(c.openBlock(),c.createElementBlock("button",c.mergeProps({ref_key:"btnRef",ref:n,tabindex:"0",class:["ui-btn-ghost",{loading:r.loading,small:i.value,large:s.value,round:r.round,reverse:r.reverse,justifyCenter:r.justifyCenter,[r.$attrs.class+""]:!0}]},{...r.$attrs,disabled:!!r.$attrs.disabled||r.loading}),[c.unref(o).default&&!r.round?(c.openBlock(),c.createElementBlock("span",uR,[c.renderSlot(r.$slots,"default")])):c.createCommentVNode("",!0),a[0]||(a[0]=c.createTextVNode()),r.loading?(c.openBlock(),c.createBlock(To,{key:1,name:"loading",size:r.size},null,8,["size"])):r.icon?(c.openBlock(),c.createBlock(To,{key:2,name:r.icon,size:r.size},null,8,["name","size"])):c.createCommentVNode("",!0)],16))}}),pR=c.defineComponent({__name:"PlBtnLink",props:{loading:{type:Boolean},size:{},icon:{},reverse:{type:Boolean},justifyCenter:{type:Boolean},disabled:{type:Boolean}},setup(e){const t=e,i=c.ref(!1);return(s,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["ui-btn-link",{disabled:s.disabled,loading:s.loading,hover:i.value}]),onMouseover:n[0]||(n[0]=o=>i.value=!0),onMouseleave:n[1]||(n[1]=o=>i.value=!1)},[c.createVNode(Lc,c.mergeProps({round:"",hover:i.value},t),null,16,["hover"]),n[2]||(n[2]=c.createTextVNode()),c.renderSlot(s.$slots,"default")],34))}});function kp(e,t){const i=Fc(()=>{if(e.value){const{scrollTop:s,scrollLeft:n,scrollHeight:o,scrollWidth:r,clientHeight:a,clientWidth:d}=document.documentElement,h=e.value.getBoundingClientRect();t({scrollTop:s,scrollLeft:n,scrollHeight:o,scrollWidth:r,clientHeight:a,clientWidth:d,offsetY:s+h.y,offsetX:n+h.x,top:h.top,right:h.right,bottom:h.bottom,left:h.left,width:h.width,height:h.height,x:h.x,y:h.y})}});c.onMounted(i),st(window,"scroll",i,!0),st(window,"resize",i,!0),st(window,"adjust",i,!0)}function gR(e,t){const i=c.ref();return kp(e,s=>{i.value=s}),c.computed(()=>{const s=c.unref(i),n=c.unref(t),o=n.position??"top",r=n.gap??8;if(!s)return"";const a=s.offsetY+Math.floor(s.height/2),d=s.offsetX+Math.floor(s.width/2);return o==="top-left"?`left: ${s.offsetX}px; top: ${s.offsetY-r}px;`:o==="top"?`left: ${d}px; top: ${s.offsetY-r}px;`:o==="right"?`left: ${s.offsetX+s.width+r}px; top: ${a}px;`:o==="left"?`right: ${s.scrollWidth-s.x+r}px; top: ${a}px;`:""})}function al(e,t){return t(e)}function dt(e,t){if(e!=null)return t(e)}function fR(e){return Array.isArray(e)?e:[e]}function mR(e,t,...i){i.forEach(s=>{e[s]=t[s]})}function cl(e,t){st(document,"click",i=>{fR(e).map(s=>s.value).filter(s=>!!s).some(s=>s==null?void 0:s.contains(i.target))||t()})}const CR={},vR={class:"beak",width:"5",height:"9",viewBox:"0 0 3 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function wR(e,t){return c.openBlock(),c.createElementBlock("svg",vR,t[0]||(t[0]=[c.createElementVNode("path",{d:"M4.00222 8.00933L0 4.00711L4.00222 0.00488281L4.00222 8.00933Z",fill:"#24223D"},null,-1)]))}const SR=vs(CR,[["render",wR]]),_c=new Map,yR={name:"PlTooltip"},ii=c.defineComponent({...yR,props:{openDelay:{default:100},closeDelay:{default:1e3},position:{default:"top"},hide:{type:Boolean},gap:{default:8},element:{default:"div"}},emits:["tooltip:close"],setup(e,{emit:t}){const i=t,s=Symbol(),n=e,o=c.reactive({open:!1,over:!1,tooltipOpen:!1,key:Symbol()});_c.set(s,()=>h()),c.watch(()=>o.open,R=>{requestAnimationFrame(()=>{o.tooltipOpen=R})});let r=()=>{};const a=xc(()=>window.dispatchEvent(new CustomEvent("adjust")),1e3),d=()=>{o.open=!0;for(let[R,y]of _c.entries())R!==s&&y()},h=()=>{o.open=!1,i("tooltip:close")},g=async()=>{n.hide||(a(),o.over=!0,r(),await Cp(100),o.over&&d())},f=()=>{o.over=!1,r=vp(()=>{o.over||h()},n.closeDelay)};c.watch(()=>n.hide,R=>{R&&h()});const C=c.ref(),v=c.ref(),S=gR(C,c.toRef(n));return cl([C,v],()=>h()),c.onUnmounted(()=>{_c.delete(s)}),(R,y)=>(c.openBlock(),c.createBlock(c.resolveDynamicComponent(R.element),c.mergeProps(R.$attrs,{ref_key:"rootRef",ref:C,onClick:g,onMouseover:g,onMouseleave:f}),{default:c.withCtx(()=>[c.renderSlot(R.$slots,"default"),y[1]||(y[1]=c.createTextVNode()),R.$slots.tooltip&&o.open?(c.openBlock(),c.createBlock(c.Teleport,{key:0,to:"body"},[c.createVNode(c.Transition,{name:"tooltip-transition"},{default:c.withCtx(()=>[o.tooltipOpen?(c.openBlock(),c.createElementBlock("div",{key:0,class:"pl-tooltip__container",style:c.normalizeStyle(c.unref(S))},[c.createElementVNode("div",{ref_key:"tooltip",ref:v,class:c.normalizeClass(["pl-tooltip",R.position]),onMouseover:g,onMouseleave:f},[c.createElementVNode("div",null,[c.renderSlot(R.$slots,"tooltip")]),y[0]||(y[0]=c.createTextVNode()),c.createVNode(SR)],34)],4)):c.createCommentVNode("",!0)]),_:3})])):c.createCommentVNode("",!0)]),_:3},16))}}),bR={},RR={class:"inner-border"};function FR(e,t,i,s,n,o){return c.openBlock(),c.createElementBlock("div",RR,[c.renderSlot(e.$slots,"default")])}const xR=vs(bR,[["render",FR]]),ER={key:0},PR=["tabindex","onKeydown","onClick"],DR={key:1,class:"ui-btn-group__helper"},TR={key:2,class:"ui-btn-group__error"},AR={name:"PlBtnGroup"},MR=c.defineComponent({...AR,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean},helper:{},error:{}},emits:["update:modelValue"],setup(e,{emit:t}){const i=c.useSlots(),s=t,n=o=>s("update:modelValue",o);return(o,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["ui-btn-group",{disabled:o.disabled}])},[o.label?(c.openBlock(),c.createElementBlock("label",ER,[c.createElementVNode("span",null,c.toDisplayString(o.label),1),r[0]||(r[0]=c.createTextVNode()),c.unref(i).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:0,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(o.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),r[1]||(r[1]=c.createTextVNode()),c.createVNode(xR,{class:"ui-btn-group__container"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.options,(a,d)=>(c.openBlock(),c.createElementBlock("div",{key:d,class:c.normalizeClass(["ui-btn-group__option",{active:o.modelValue===a.value}]),tabindex:o.modelValue===a.value||o.disabled?void 0:0,onKeydown:c.withKeys(h=>n(a.value),["enter"]),onClick:h=>n(a.value)},c.toDisplayString(a.text),43,PR))),128))]),_:1}),r[2]||(r[2]=c.createTextVNode()),o.helper?(c.openBlock(),c.createElementBlock("div",DR,c.toDisplayString(o.helper),1)):o.error?(c.openBlock(),c.createElementBlock("div",TR,c.toDisplayString(o.error),1)):c.createCommentVNode("",!0)],2))}}),kR={inheritAttrs:!1},IR={class:"double-contour"};function LR(e,t,i,s,n,o){return c.openBlock(),c.createElementBlock("div",IR,[c.createElementVNode("div",c.normalizeProps(c.guardReactiveProps(e.$attrs)),[c.renderSlot(e.$slots,"default")],16)])}const kn=vs(kR,[["render",LR]]);function Ip(e){c.onMounted(e),c.onUpdated(e)}const Oc=new WeakMap,Vc=new ResizeObserver(e=>{for(const t of e)dt(Oc.get(t.target),i=>i(t))});function Lp(e,t){Oc.set(e,t),Vc.unobserve(e),Vc.observe(e)}function _p(e){Vc.unobserve(e),Oc.delete(e)}const _R=8,Op=4;function In(e,t="label"){const i=new Set;Ip(()=>{dt(e==null?void 0:e.value,s=>{const n=s.querySelector(t);n&&(i.add(n),Lp(n,()=>{const o=mp(()=>n.getBoundingClientRect().width+al(_R,r=>Number.isNaN(r)?Op:r+Op));s.style.getPropertyValue("--label-offset-right-x")!==`${o}px`&&s.style.setProperty("--label-offset-right-x",`${o}px`)}))})}),c.onBeforeUnmount(()=>{Array.from(i.values()).map(s=>_p(s))})}function OR(e,t){const i=[];return t&&t.length>0&&t.forEach(s=>{const n=s(e);typeof n=="string"&&i.push(n)}),{isValid:i.length===0,errors:i}}function Vp(e,t){return c.computed(()=>OR(e.value,t))}const VR={class:"ui-text-field__envelope"},NR={key:0,ref:"label"},BR={key:0,class:"required-icon"},GR={key:1,class:"ui-text-field__prefix"},HR=["disabled","placeholder"],WR={class:"ui-text-field__append"},zR={key:0,class:"ui-text-field__error"},UR={key:1,class:"ui-text-field__helper"},$R={name:"PlTextField"},Np=c.defineComponent({...$R,props:{modelValue:{},label:{},clearable:{type:[Boolean,Function]},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},dashed:{type:Boolean},prefix:{},rules:{}},emits:["update:modelValue"],setup(e,{emit:t}){const i=c.useSlots(),s=t,n=e,o=c.ref(void 0),r=c.ref(),a=c.computed({get(){return n.modelValue??""},set(S){s("update:modelValue",S)}}),d=()=>{n.clearable&&s("update:modelValue",n.clearable===!0?"":n.clearable())},h=Vp(a,n.rules||[]),g=c.computed(()=>n.clearable?n.clearable===!0?n.modelValue==="":n.modelValue===n.clearable():n.modelValue===""),f=c.computed(()=>!g.value),C=c.computed(()=>{const S=[];return n.error&&S.push(n.error),h.value.isValid||S.push(...h.value.errors),S}),v=c.computed(()=>C.value.length>0);return In(o),(S,R)=>(c.openBlock(),c.createElementBlock("div",VR,[c.createElementVNode("div",{ref_key:"rootRef",ref:o,class:c.normalizeClass(["ui-text-field",{error:v.value,disabled:S.disabled,dashed:S.dashed,nonEmpty:f.value}])},[S.label?(c.openBlock(),c.createElementBlock("label",NR,[S.required?(c.openBlock(),c.createElementBlock("i",BR)):c.createCommentVNode("",!0),R[1]||(R[1]=c.createTextVNode()),c.createElementVNode("span",null,c.toDisplayString(S.label),1),R[2]||(R[2]=c.createTextVNode()),c.unref(i).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:1,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(S.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)],512)):c.createCommentVNode("",!0),R[4]||(R[4]=c.createTextVNode()),S.prefix?(c.openBlock(),c.createElementBlock("div",GR,c.toDisplayString(S.prefix),1)):c.createCommentVNode("",!0),R[5]||(R[5]=c.createTextVNode()),c.withDirectives(c.createElementVNode("input",{ref_key:"inputRef",ref:r,"onUpdate:modelValue":R[0]||(R[0]=y=>a.value=y),disabled:S.disabled,placeholder:S.placeholder||"...",type:"text",spellcheck:"false"},null,8,HR),[[c.vModelText,a.value]]),R[6]||(R[6]=c.createTextVNode()),c.createElementVNode("div",WR,[S.clearable&&f.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"icon icon--clear",onClick:d})):c.createCommentVNode("",!0),R[3]||(R[3]=c.createTextVNode()),c.renderSlot(S.$slots,"append")]),R[7]||(R[7]=c.createTextVNode()),c.createVNode(kn,{class:"ui-text-field__contour"})],2),R[8]||(R[8]=c.createTextVNode()),v.value?(c.openBlock(),c.createElementBlock("div",zR,c.toDisplayString(C.value.join(" ")),1)):S.helper?(c.openBlock(),c.createElementBlock("div",UR,c.toDisplayString(S.helper),1)):c.createCommentVNode("",!0)]))}}),KR={class:"ui-text-area__envelope"},jR={key:0,ref:"label"},ZR={key:0,class:"required-icon"},qR=["readonly","rows","disabled","placeholder"],YR={class:"ui-text-area__append"},QR={key:0,class:"ui-text-area__error"},XR={key:1,class:"ui-text-area__helper"},JR={name:"PlTextArea"},eF=c.defineComponent({...JR,props:{modelValue:{},label:{},required:{type:Boolean},error:{},helper:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},dashed:{type:Boolean},rows:{},autogrow:{type:Boolean},rules:{}},emits:["update:modelValue"],setup(e,{emit:t}){const i=c.useSlots(),s=t,n=e,o=c.ref(),r=c.ref(),a=c.computed({get(){return n.modelValue??""},set(v){s("update:modelValue",v)}}),d=c.computed(()=>!!n.modelValue),h=Vp(a,n.rules||[]);In(o);const g=c.computed(()=>{const v=[];return n.error&&v.push(n.error),v.push(...h.value.errors),v}),f=c.computed(()=>g.value.length>0),C=()=>{if(!n.autogrow)return;const v=r.value;v&&(v.style.height="auto",v.style.height=`${v.scrollHeight}px`)};return c.onMounted(()=>{C()}),(v,S)=>(c.openBlock(),c.createElementBlock("div",KR,[c.createElementVNode("div",{ref_key:"root",ref:o,class:c.normalizeClass(["ui-text-area",{error:f.value,disabled:v.disabled,dashed:v.dashed,nonEmpty:d.value}])},[v.label?(c.openBlock(),c.createElementBlock("label",jR,[v.required?(c.openBlock(),c.createElementBlock("i",ZR)):c.createCommentVNode("",!0),S[1]||(S[1]=c.createTextVNode()),c.createElementVNode("span",null,c.toDisplayString(v.label),1),S[2]||(S[2]=c.createTextVNode()),c.unref(i).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:1,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(v.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)],512)):c.createCommentVNode("",!0),S[3]||(S[3]=c.createTextVNode()),c.withDirectives(c.createElementVNode("textarea",{ref_key:"input",ref:r,"onUpdate:modelValue":S[0]||(S[0]=R=>a.value=R),readonly:v.readonly,rows:v.rows,disabled:v.disabled,placeholder:v.placeholder??"...",spellcheck:"false",onInput:C},null,40,qR),[[c.vModelText,a.value]]),S[4]||(S[4]=c.createTextVNode()),c.createElementVNode("div",YR,[c.renderSlot(v.$slots,"append")]),S[5]||(S[5]=c.createTextVNode()),c.createVNode(kn,{class:"ui-text-area__contour"})],2),S[6]||(S[6]=c.createTextVNode()),f.value?(c.openBlock(),c.createElementBlock("div",QR,c.toDisplayString(g.value.join(" ")),1)):v.helper?(c.openBlock(),c.createElementBlock("div",XR,c.toDisplayString(v.helper),1)):c.createCommentVNode("",!0)]))}});function Bp(e,t){const i=e.scrollTop,s=e.getBoundingClientRect().height,n=t.offsetTop,o=t.getBoundingClientRect().height;return n+o<s+i&&n>i}function Gp(e,t){const i=e.scrollTop,s=e.getBoundingClientRect().height,n=t.offsetTop,o=t.getBoundingClientRect().height;return n+o<s+i?"ceil":n>i?"floor":"visible"}function dl(e,t,i={}){const s=e.scrollTop,n=e.getBoundingClientRect().height,o=t.getBoundingClientRect().height,r=t.offsetTop,a=Gp(e,t);if(a==="visible")return;const d=h=>{const g=a==="floor"?r-(n-o):r;e.scrollTop=s+h*(g-s)};Bp(e,t)||yp({duration:i.duration||100,timing:Sp(h=>h),draw:d})}function Nc(e,t,i,s){return e.addEventListener(t,i,s),function(){e.removeEventListener(t,i)}}function tF(e,t){const i=t.getBoundingClientRect();return e.x<i.x||e.x>i.x+i.width||e.y<i.y||e.y>i.y+i.height}function Hp(e){return e!==null&&typeof e=="object"}function Ci(e,t){return Hp(e)&&Hp(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(i=>Ci(e[i],t[i])):e===t}function Bc(e,t){return e.some(i=>Ci(i,t))}const iF=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5 4.5H4.5L4.5 19.5H19.5V4.5ZM4.5 3C3.67157 3 3 3.67157 3 4.5V19.5C3 20.3284 3.67157 21 4.5 21H19.5C20.3284 21 21 20.3284 21 19.5V4.5C21 3.67157 20.3284 3 19.5 3H4.5Z" fill="#110529"/>
3
+ </svg>
4
+ `,sF=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
5
+ <rect x="3" y="3" width="18" height="18" rx="2" fill="#110529"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M17.5431 8.51724L10.3333 16.0875L6.45691 12.0172L7.54312 10.9828L10.3333 13.9125L16.4569 7.48276L17.5431 8.51724Z" fill="white"/>
7
+ </svg>
8
+ `,nF=["innerHTML"],oF={class:"dropdown-list-item__title-container"},rF={class:"dropdown-list-item__title text-s"},lF={key:0,class:"dropdown-list-item__description text-description"},aF={key:1,class:"dropdown-list-item__icon flex-self-start"},ul=c.defineComponent({__name:"DropdownListItem",props:{option:{},isSelected:{type:Boolean,default:!1},size:{default:"small"},isHovered:{type:Boolean,default:!1},useCheckbox:{type:Boolean,default:!1}},setup(e){const t=e,i=c.computed(()=>{const o=[];return t.size==="small"&&o.push("dropdown-list-item__small"),t.isSelected&&o.push("dropdown-list-item__selected"),t.isHovered&&o.push("hovered-item"),o.join(" ")}),s=c.computed(()=>{const o=["dropdown-list-item__checkbox","flex-self-start"];return t.isSelected&&o.push("checked"),o.join(" ")}),n=c.computed(()=>t.isSelected?sF:iF);return(o,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([i.value,"dropdown-list-item"])},[t.useCheckbox?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(s.value),innerHTML:n.value},null,10,nF)):c.createCommentVNode("",!0),r[1]||(r[1]=c.createTextVNode()),c.createElementVNode("div",oF,[c.createElementVNode("div",rF,c.toDisplayString(o.option.text),1),r[0]||(r[0]=c.createTextVNode()),o.option.description?(c.openBlock(),c.createElementBlock("div",lF,c.toDisplayString(o.option.description),1)):c.createCommentVNode("",!0)]),r[2]||(r[2]=c.createTextVNode()),!t.useCheckbox&&t.isSelected?(c.openBlock(),c.createElementBlock("div",aF)):c.createCommentVNode("",!0)],2))}}),Wp=c.defineComponent({__name:"LongText",setup(e){c.useCssVars(g=>({"8d68520c":r.value}));const t=c.ref(!1),i=c.ref(),s=c.ref(!1),n=c.computed(()=>s.value&&t.value?"ui-lt-animate":""),o=bp(g=>s.value=g,500),r=c.computed(()=>{var g;return i.value?`${((g=i.value)==null?void 0:g.innerHTML.length)*.4}s`:"5s"});function a(){const g=Rc(i.value,"span cannot be empty");t.value=g.clientWidth<g.scrollWidth}function d(){a(),o(!0)}function h(){o(!1)}return(g,f)=>(c.openBlock(),c.createElementBlock("div",c.mergeProps(g.$attrs,{class:"ui-lt-container"}),[c.createElementVNode("span",{onMouseover:d,onMouseleave:h},[c.createElementVNode("span",{ref_key:"span",ref:i,class:c.normalizeClass(n.value)},[c.renderSlot(g.$slots,"default")],2)],32)],16))}}),cF={class:"ui-dropdown__envelope"},dF=["tabindex"],uF={class:"ui-dropdown__container"},hF={class:"ui-dropdown__field"},pF=["disabled","placeholder"],gF={class:"ui-dropdown__append"},fF={key:0},mF={key:0,class:"required-icon"},CF={key:0,class:"nothing-found"},vF={key:0,class:"ui-dropdown__error"},wF={key:1,class:"ui-dropdown__helper"},SF={name:"PlDropdown"},zp=c.defineComponent({...SF,props:{modelValue:{},label:{default:""},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},arrowIcon:{default:void 0},optionSize:{default:"small"}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=e,n=c.useSlots(),o=c.ref(),r=c.ref(),a=c.ref(),d=c.reactive({search:"",activeIndex:-1,open:!1}),h=()=>al(x.value.findIndex(H=>Ci(H.value,s.modelValue)),H=>H<0?0:H),g=()=>d.activeIndex=h(),f=c.computed(()=>s.options.findIndex(H=>Ci(H.value,s.modelValue))),C=c.computed(()=>{if(s.error)return s.error;if(s.modelValue!==void 0&&f.value===-1)return"The selected value is not one of the options"}),v=c.computed(()=>{const H=s.options.find(Z=>Ci(Z.value,s.modelValue));return(H==null?void 0:H.text)||s.modelValue}),S=c.computed(()=>!d.open&&s.modelValue?"":s.modelValue?String(v.value):s.placeholder),R=c.computed(()=>s.modelValue!==void 0&&s.modelValue!==null),y=c.computed(()=>s.options.map((H,Z)=>({...H,index:Z,isSelected:Z===f.value,isActive:Z===d.activeIndex}))),x=c.computed(()=>{const H=y.value;return d.search?H.filter(Z=>{const ie=d.search.toLowerCase();return Z.text.toLowerCase().includes(ie)||Z.description&&Z.description.toLowerCase().includes(ie)?!0:typeof Z.value=="string"?Z.value.toLowerCase().includes(ie):Z.value===d.search}):H}),P=c.computed(()=>s.disabled?void 0:"0"),T=H=>{var Z;i("update:modelValue",H),d.search="",d.open=!1,(Z=o==null?void 0:o.value)==null||Z.focus()},I=()=>i("update:modelValue",void 0),V=()=>{var H;return(H=a.value)==null?void 0:H.focus()},_=()=>d.open=!d.open,O=()=>d.open=!0,M=H=>{var Z;(Z=o==null?void 0:o.value)!=null&&Z.contains(H.relatedTarget)||(d.search="",d.open=!1)},A=()=>{const H=r.value;H&&dt(H.querySelector(".hovered-item"),Z=>{dl(H,Z)})},z=H=>{var Z,ie;if(["ArrowDown","ArrowUp","Enter","Escape"].includes(H.code))H.preventDefault();else return;const{open:pe,activeIndex:ae}=d;if(!pe){H.code==="Enter"&&(d.open=!0);return}H.code==="Escape"&&(d.open=!1,(Z=o.value)==null||Z.focus());const ee=c.unref(x),{length:Ee}=ee;if(!Ee)return;H.code==="Enter"&&T((ie=ee.find(Gt=>Gt.index===ae))==null?void 0:ie.value);const _e=ee.findIndex(Gt=>Gt.index===ae)??-1,wn=H.code==="ArrowDown"?1:H.code==="ArrowUp"?-1:0,Ws=Math.abs(_e+wn+Ee)%Ee;d.activeIndex=x.value[Ws].index??-1};return In(o),c.watch(()=>s.modelValue,g,{immediate:!0}),c.watch(()=>d.open,H=>{var Z;return H?(Z=a.value)==null?void 0:Z.focus():""}),c.watchPostEffect(()=>{d.search,d.activeIndex>=0&&d.open&&A()}),(H,Z)=>(c.openBlock(),c.createElementBlock("div",cF,[c.createElementVNode("div",{ref_key:"root",ref:o,tabindex:P.value,class:c.normalizeClass(["ui-dropdown",{open:d.open,error:H.error,disabled:H.disabled}]),onKeydown:z,onFocusout:M},[c.createElementVNode("div",uF,[c.createElementVNode("div",hF,[c.withDirectives(c.createElementVNode("input",{ref_key:"input",ref:a,"onUpdate:modelValue":Z[0]||(Z[0]=ie=>d.search=ie),type:"text",tabindex:"-1",disabled:H.disabled,placeholder:S.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:O},null,40,pF),[[c.vModelText,d.search]]),Z[3]||(Z[3]=c.createTextVNode()),d.open?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",{key:0,onClick:V},[c.createVNode(Wp,{class:"input-value"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(v.value),1)]),_:1}),Z[1]||(Z[1]=c.createTextVNode()),H.clearable?(c.openBlock(),c.createElementBlock("div",{key:0,class:"close",onClick:c.withModifiers(I,["stop"])})):c.createCommentVNode("",!0)])),Z[4]||(Z[4]=c.createTextVNode()),H.arrowIcon?(c.openBlock(),c.createElementBlock("div",{key:1,class:c.normalizeClass(["arrow-altered icon",[`icon--${H.arrowIcon}`]]),onClick:c.withModifiers(_,["stop"])},null,2)):(c.openBlock(),c.createElementBlock("div",{key:2,class:"arrow",onClick:c.withModifiers(_,["stop"])})),Z[5]||(Z[5]=c.createTextVNode()),c.createElementVNode("div",gF,[H.clearable&&R.value?(c.openBlock(),c.createElementBlock("div",{key:0,class:"icon icon--clear",onClick:c.withModifiers(I,["stop"])})):c.createCommentVNode("",!0),Z[2]||(Z[2]=c.createTextVNode()),c.renderSlot(H.$slots,"append")])]),Z[9]||(Z[9]=c.createTextVNode()),H.label?(c.openBlock(),c.createElementBlock("label",fF,[H.required?(c.openBlock(),c.createElementBlock("i",mF)):c.createCommentVNode("",!0),Z[6]||(Z[6]=c.createTextVNode()),c.createElementVNode("span",null,c.toDisplayString(H.label),1),Z[7]||(Z[7]=c.createTextVNode()),c.unref(n).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:1,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(H.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),Z[10]||(Z[10]=c.createTextVNode()),d.open?(c.openBlock(),c.createElementBlock("div",{key:1,ref_key:"list",ref:r,class:"ui-dropdown__options"},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(x.value,(ie,pe)=>(c.openBlock(),c.createBlock(ul,{key:pe,option:ie,"is-selected":ie.isSelected,"is-hovered":ie.isActive,size:H.optionSize,onClick:c.withModifiers(ae=>T(ie.value),["stop"])},null,8,["option","is-selected","is-hovered","size","onClick"]))),128)),Z[8]||(Z[8]=c.createTextVNode()),x.value.length?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",CF,"Nothing found"))],512)):c.createCommentVNode("",!0),Z[11]||(Z[11]=c.createTextVNode()),c.createVNode(kn,{class:"ui-dropdown__contour"})])],42,dF),Z[12]||(Z[12]=c.createTextVNode()),C.value?(c.openBlock(),c.createElementBlock("div",vF,c.toDisplayString(C.value),1)):H.helper?(c.openBlock(),c.createElementBlock("div",wF,c.toDisplayString(H.helper),1)):c.createCommentVNode("",!0)]))}});function yF(e,t){return c.computed(()=>t.value?e.value.filter(i=>i.text.toLowerCase().includes(t.value.toLowerCase())):e.value)}const bF={class:"resizable-input"},RF=["placeholder","value","disabled"],FF=c.defineComponent({__name:"ResizableInput",props:{modelValue:{},placeholder:{},value:{},disabled:{type:Boolean},maxWidth:{},width:{}},emits:["input","update:modelValue"],setup(e,{emit:t}){const i=e,s=t,n=c.computed(()=>{var a;return i.placeholder?i.placeholder:(a=i.modelValue||i.value)==null?void 0:a.replace('"',"")}),o=c.computed(()=>{const a={};return i.width&&(a.width=i.width),i.maxWidth&&(a.maxWidth=i.maxWidth),a});function r(a){const d=a.target.value;s("update:modelValue",d)}return(a,d)=>(c.openBlock(),c.createElementBlock("div",bF,[c.createElementVNode("span",{style:c.normalizeStyle(o.value),class:"resizable-input__size-span"},c.toDisplayString(n.value),5),d[0]||(d[0]=c.createTextVNode()),c.createElementVNode("input",c.mergeProps(a.$attrs,{placeholder:a.placeholder,value:i.modelValue,disabled:i.disabled,style:o.value,onInput:r}),null,16,RF)]))}}),xF={class:"dropdown-tab-item__title text-caps13"},EF=c.defineComponent({__name:"TabItem",props:{item:{},isSelected:{type:Boolean,default:!1},isHovered:{type:Boolean,default:!1}},setup(e){const t=e,i=c.computed(()=>{const s=[];return t.isSelected&&s.push("dropdown-tab-item__selected"),t.isHovered&&s.push("hovered-item"),s.join(" ")});return(s,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([i.value,"dropdown-tab-item"])},[c.createElementVNode("div",xF,c.toDisplayString(t.item.text),1)],2))}}),PF={class:"ui-line-dropdown__prefix"},DF={class:"ui-line-dropdown__icon-wrapper"},TF={class:"ui-line-dropdown__icon"},AF={key:0,class:"ui-line-dropdown__no-item"},MF={key:0,class:"ui-line-dropdown__no-item"},Up=c.defineComponent({__name:"PlDropdownLine",props:{modelValue:{},disabled:{type:Boolean},prefix:{default:""},options:{},placeholder:{default:"Select.."},mode:{default:"list"},tabsContainerStyles:{type:[Boolean,null,String,Object,Array],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=e,n=c.reactive({isOpen:!1,activeOption:-1}),o=c.ref(),r=c.ref(),a=c.computed(()=>{const A=[];return n.isOpen&&A.push("open"),s.disabled&&A.push("disabled"),A.join(" ")}),d=c.ref(""),h=yF(c.toRef(s,"options"),d),g=c.computed(()=>!!(s.clearable&&n.isOpen&&s.modelValue&&f.value)),f=c.computed(()=>{if(s.modelValue){const A=S();if(A!==-1){const z=s.options[A];return typeof z.text=="object"?z.text.title:z.text}}return""}),C=c.ref(f.value),v=c.computed(()=>n.isOpen&&d.value&&d.value.length>=f.value.length-1?d.value:f.value||"...");cl(o,()=>{s.mode==="list"&&(n.isOpen=!1)}),c.watch(()=>C.value,A=>{f.value!==A?d.value=A:d.value=""}),c.watch(()=>n.isOpen,A=>{var z;A&&o.value&&((z=o.value.querySelector("input"))==null||z.focus(),c.nextTick(()=>O()))}),c.watch(()=>s.modelValue,()=>R(),{immediate:!0});function S(){return s.options.findIndex(A=>Ci(A.value,s.modelValue))}function R(){n.activeOption=al(h.value.findIndex(A=>Ci(A.value,s.modelValue)),A=>A<0?0:A),C.value=f.value}function y(){d.value=""}function x(){s.disabled?n.isOpen=!1:c.nextTick(()=>{n.isOpen=!n.isOpen})}function P(){s.mode==="list"&&(n.isOpen=!1)}function T(A){A&&(i("update:modelValue",A.value),P(),y())}function I(A){return Ci(A.value,s.modelValue)}function V(A){var z;(z=o==null?void 0:o.value)!=null&&z.contains(A.relatedTarget)||(n.isOpen=!1,d.value="")}function _(A){const{activeOption:z}=n;if(!n.isOpen&&A.code==="Enter"){n.isOpen=!0;return}const{length:H}=h.value;if(!H)return;["ArrowDown","ArrowUp","Enter"].includes(A.code)&&A.preventDefault(),A.code==="Enter"&&T(h.value[z]);const Z=A.code==="ArrowDown"?1:A.code==="ArrowUp"?-1:0;n.activeOption=Math.abs(z+Z+H)%H,requestAnimationFrame(O)}function O(){const A=r.value;A&&dt(A.querySelector(".hovered-item"),z=>{s.mode==="list"?dl(A,z):z.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}function M(){i("update:modelValue",void 0)}return(A,z)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"container",ref:o,tabindex:"0",class:c.normalizeClass([a.value,"ui-line-dropdown uc-pointer"]),onKeydown:_,onFocusout:V,onClick:x},[c.createElementVNode("div",PF,c.toDisplayString(s==null?void 0:s.prefix),1),z[6]||(z[6]=c.createTextVNode()),c.createVNode(FF,{modelValue:C.value,"onUpdate:modelValue":z[0]||(z[0]=H=>C.value=H),placeholder:v.value,disabled:s.disabled,class:"ui-line-dropdown__input"},null,8,["modelValue","placeholder","disabled"]),z[7]||(z[7]=c.createTextVNode()),c.createElementVNode("div",DF,[c.withDirectives(c.createElementVNode("div",TF,null,512),[[c.vShow,!g.value]]),z[1]||(z[1]=c.createTextVNode()),c.withDirectives(c.createElementVNode("div",{class:"ui-line-dropdown__icon-clear",onClick:M},null,512),[[c.vShow,g.value]])]),z[8]||(z[8]=c.createTextVNode()),s.mode==="list"?c.withDirectives((c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"list",ref:r,class:"ui-line-dropdown__items"},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(h),(H,Z)=>c.renderSlot(A.$slots,"item",{key:Z,item:H,textItem:"text",isSelected:I(H),isHovered:n.activeOption==Z,onClick:c.withModifiers(ie=>T(H),["stop"])},()=>[c.createVNode(ul,{option:H,"text-item":"text","is-selected":I(H),"is-hovered":n.activeOption==Z,size:"medium",onClick:c.withModifiers(ie=>T(H),["stop"])},null,8,["option","is-selected","is-hovered","onClick"])])),128)),z[3]||(z[3]=c.createTextVNode()),c.unref(h).length===0?(c.openBlock(),c.createElementBlock("div",AF,z[2]||(z[2]=[c.createElementVNode("div",{class:"ui-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):c.createCommentVNode("",!0)],512)),[[c.vShow,n.isOpen]]):c.createCommentVNode("",!0),z[9]||(z[9]=c.createTextVNode()),s.mode==="tabs"?c.withDirectives((c.openBlock(),c.createElementBlock("div",{key:1,ref_key:"list",ref:r,style:c.normalizeStyle(s.tabsContainerStyles),class:"ui-line-dropdown__items-tabs"},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(h),(H,Z)=>c.renderSlot(A.$slots,"item",{key:Z,item:H,isSelected:I(H),isHovered:n.activeOption==Z,onClick:c.withModifiers(ie=>T(H),["stop"])},()=>[c.createVNode(EF,{item:H,"is-selected":I(H),"is-hovered":n.activeOption==Z,onClick:c.withModifiers(ie=>T(H),["stop"])},null,8,["item","is-selected","is-hovered","onClick"])])),128)),z[5]||(z[5]=c.createTextVNode()),c.unref(h).length===0?(c.openBlock(),c.createElementBlock("div",MF,z[4]||(z[4]=[c.createElementVNode("div",{class:"ui-line-dropdown__no-item-title text-s"},"Didn't find anything that matched",-1)]))):c.createCommentVNode("",!0)],4)),[[c.vShow,n.isOpen]]):c.createCommentVNode("",!0)],34))}}),kF={key:0,class:"ui-progress-bar"},IF={class:"ui-progress-bar__messages d-flex align-center pl-6 pr-6"},LF={class:"ui-progress-bar__message flex-grow-1"},_F={class:"ui-progress-bar__percent"},OF=c.defineComponent({__name:"PlProgressBar",props:{loading:{type:Boolean},progress:{default:0},completeMessage:{default:"Completed"}},setup(e){const t=e,i=c.computed(()=>t.progress===100?t.completeMessage:"");return(s,n)=>s.loading?(c.openBlock(),c.createElementBlock("div",kF,[c.createElementVNode("div",{class:"ui-progress-bar__indicator",style:c.normalizeStyle({width:s.progress+"%"})},null,4),n[1]||(n[1]=c.createTextVNode()),c.createElementVNode("div",IF,[c.createElementVNode("div",LF,c.toDisplayString(i.value),1),n[0]||(n[0]=c.createTextVNode()),c.createElementVNode("div",_F,c.toDisplayString(s.progress+"%"),1)])])):c.createCommentVNode("",!0)}}),VF={class:"mi-number-field__main-wrapper d-flex"},NF={class:"mi-number-field__wrapper flex-grow d-flex flex-align-center"},BF={key:0,class:"text-description"},GF=["disabled","placeholder"],HF={class:"mi-number-field__icons d-flex-column"},WF={key:0,class:"mi-number-field__hint text-description"},zF=c.defineComponent({__name:"PlNumberField",props:{modelValue:{},disabled:{type:Boolean},label:{default:void 0},placeholder:{default:void 0},step:{default:1},minValue:{default:void 0},maxValue:{default:void 0},errorMessage:{default:void 0},validate:{type:Function,default:void 0}},emits:["update:modelValue"],setup(e,{emit:t}){const i=e,s=t,n=c.ref(),o=c.useSlots(),r=c.ref();In(n);const a=c.ref(!0),d=c.computed({get(){return a.value&&i.modelValue!==void 0?new Number(i.modelValue).toString():""},set(y){var x;y=y.replace(/,/g,""),C(y)?(s("update:modelValue",+y),y.toString()!==((x=i.modelValue)==null?void 0:x.toString())&&+y===i.modelValue&&y[y.length-1]!=="."&&(a.value=!1,c.nextTick(()=>{a.value=!0}))):(y.trim()===""&&s("update:modelValue",void 0),a.value=!1,c.nextTick(()=>{a.value=!0}))}}),h=c.computed(()=>{let y=[];return i.errorMessage&&y.push(i.errorMessage),C(i.modelValue)?(i.minValue!==void 0&&i.modelValue!==void 0&&i.modelValue<i.minValue&&y.push(`Model value must be higher than ${i.minValue}`),i.maxValue!==void 0&&i.modelValue!==void 0&&i.modelValue>i.maxValue&&y.push(`Model value must be less than ${i.maxValue}`)):y.push("Model value is not a number."),y=[...y],y.join(" ")}),g=c.computed(()=>!!(i.maxValue&&i.modelValue!==void 0&&(i.modelValue||0)+i.step>i.maxValue)),f=c.computed(()=>!!(i.minValue&&i.modelValue!==void 0&&(i.modelValue||0)-i.step<i.minValue));function C(y){return y!==void 0?(y=y==null?void 0:y.toString(),!isNaN(+y)&&!isNaN(parseFloat(y))):!1}function v(){if(!g.value){let y=0;i.modelValue===void 0?y=i.minValue?i.minValue:0:y=+(i.modelValue||0)+i.step,d.value=y.toString()}}function S(){if(!f.value){let y=0;i.modelValue===void 0?y=0:y=+(i.modelValue||0)-i.step,d.value=i.minValue?Math.max(i.minValue,y).toString():y.toString()}}function R(y){["ArrowDown","ArrowUp"].includes(y.code)&&y.preventDefault(),y.code==="ArrowUp"?v():y.code==="ArrowDown"&&S()}return(y,x)=>(c.openBlock(),c.createElementBlock("div",{ref_key:"root",ref:n,class:c.normalizeClass([{error:!!h.value.trim(),disabled:y.disabled},"mi-number-field d-flex-column"]),onKeydown:x[1]||(x[1]=P=>R(P))},[c.createElementVNode("div",VF,[c.createVNode(kn,{class:"mi-number-field__contour"}),x[6]||(x[6]=c.createTextVNode()),c.createElementVNode("div",NF,[y.label?(c.openBlock(),c.createElementBlock("label",BF,[c.createTextVNode(c.toDisplayString(y.label)+" ",1),c.unref(o).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:0,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(y.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),x[2]||(x[2]=c.createTextVNode()),c.withDirectives(c.createElementVNode("input",{ref_key:"input",ref:r,"onUpdate:modelValue":x[0]||(x[0]=P=>d.value=P),disabled:y.disabled,placeholder:y.placeholder,class:"text-s flex-grow"},null,8,GF),[[c.vModelText,d.value]])]),x[7]||(x[7]=c.createTextVNode()),c.createElementVNode("div",HF,[c.createElementVNode("div",{class:c.normalizeClass([{disabled:g.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:v},x[3]||(x[3]=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[c.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8 4.93933L13.5303 10.4697L12.4697 11.5303L8 7.06065L3.53033 11.5303L2.46967 10.4697L8 4.93933Z",fill:"#110529"})],-1)]),2),x[5]||(x[5]=c.createTextVNode()),c.createElementVNode("div",{class:c.normalizeClass([{disabled:f.value},"mi-number-field__icon d-flex flex-justify-center uc-pointer flex-grow flex-align-center"]),onClick:S},x[4]||(x[4]=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[c.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.46967 6.53033L3.53033 5.46967L8 9.93934L12.4697 5.46967L13.5303 6.53033L8 12.0607L2.46967 6.53033Z",fill:"#110529"})],-1)]),2)])]),x[8]||(x[8]=c.createTextVNode()),h.value.trim()?(c.openBlock(),c.createElementBlock("div",WF,c.toDisplayString(h.value),1)):c.createCommentVNode("",!0)],34))}}),UF={class:"ui-chip__text"},Gc=c.defineComponent({__name:"PlChip",props:{closeable:{type:Boolean},small:{type:Boolean}},emits:["close"],setup(e){const t=c.ref(),i=c.ref(!1);return c.onMounted(()=>{var s;t.value&&(i.value=((s=t.value)==null?void 0:s.clientWidth)>=256)}),(s,n)=>(c.openBlock(),c.createBlock(c.unref(ii),{position:"top",class:"ui-chip-tooltip",delay:500},c.createSlots({default:c.withCtx(()=>[n[4]||(n[4]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"chip",ref:t,class:c.normalizeClass(["ui-chip",{small:s.small}])},[c.createElementVNode("div",UF,[c.renderSlot(s.$slots,"default")]),n[3]||(n[3]=c.createTextVNode()),s.closeable?(c.openBlock(),c.createElementBlock("div",{key:0,tabindex:"0",class:"ui-chip__close",onKeydown:n[0]||(n[0]=c.withKeys(o=>s.$emit("close"),["enter"])),onClick:n[1]||(n[1]=c.withModifiers(o=>s.$emit("close"),["stop"]))},n[2]||(n[2]=[c.createElementVNode("div",{class:"ui-chip__close--icon"},null,-1)]),32)):c.createCommentVNode("",!0)],2)]),_:2},[i.value?{name:"tooltip",fn:c.withCtx(()=>[c.renderSlot(s.$slots,"default")]),key:"0"}:void 0]),1024))}}),$F={class:"ui-multi-dropdown__envelope"},KF=["tabindex"],jF={class:"ui-multi-dropdown__container"},ZF={class:"ui-multi-dropdown__field"},qF=["disabled","placeholder"],YF={class:"ui-multi-dropdown__append"},QF={key:0},XF={key:0,class:"required-icon"},JF={class:"ui-multi-dropdown__open-chips-conteiner"},ex={key:0,class:"nothing-found"},tx={key:0,class:"ui-multi-dropdown__error"},ix={key:1,class:"ui-multi-dropdown__helper"},sx={name:"PlDropdownMulti"},nx=c.defineComponent({...sx,props:{modelValue:{default:()=>[]},label:{default:void 0},options:{},helper:{default:void 0},error:{default:void 0},placeholder:{default:"..."},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=O=>i("update:modelValue",O),n=c.useSlots(),o=e,r=c.ref(),a=c.ref(),d=c.ref(),h=c.reactive({search:"",activeOption:-1,open:!1}),g=c.computed(()=>Array.isArray(o.modelValue)?o.modelValue:[]),f=c.computed(()=>h.open&&o.modelValue.length>0?o.placeholder:o.modelValue.length>0?"":o.placeholder),C=c.computed(()=>o.options.filter(O=>Bc(g.value,O.value))),v=c.computed(()=>{const O=c.unref(g);return(h.search?o.options.filter(M=>{const A=h.search.toLowerCase();return M.text.toLowerCase().includes(A)?!0:typeof M.value=="string"?M.value.toLowerCase().includes(A):M.value===h.search}):[...o.options]).map(M=>({...M,selected:Bc(O,M.value)}))}),S=c.computed(()=>o.disabled?void 0:"0"),R=()=>{h.activeOption=al(v.value.findIndex(O=>Ci(O.value,o.modelValue)),O=>O<0?0:O)},y=O=>{var M;const A=c.unref(g);s(Bc(A,O)?A.filter(z=>!Ci(z,O)):[...A,O]),h.search="",(M=r==null?void 0:r.value)==null||M.focus()},x=O=>s(c.unref(g).filter(M=>!Ci(M,O))),P=()=>{var O;return(O=d.value)==null?void 0:O.focus()},T=()=>h.open=!h.open,I=O=>{var M;(M=r==null?void 0:r.value)!=null&&M.contains(O.relatedTarget)||(h.search="",h.open=!1)},V=()=>{const O=a.value;O&&dt(O.querySelector(".hovered-item"),M=>{dl(O,M)})},_=O=>{var M;const{open:A,activeOption:z}=h;if(!A){O.code==="Enter"&&(h.open=!0);return}O.code==="Escape"&&(h.open=!1,(M=r.value)==null||M.focus());const H=c.unref(v),{length:Z}=H;if(!Z)return;["ArrowDown","ArrowUp","Enter"].includes(O.code)&&O.preventDefault(),O.code==="Enter"&&y(H[z].value);const ie=O.code==="ArrowDown"?1:O.code==="ArrowUp"?-1:0;h.activeOption=Math.abs(z+ie+Z)%Z,requestAnimationFrame(V)};return In(r),c.watch(()=>o.modelValue,()=>R(),{immediate:!0}),c.watchPostEffect(()=>{h.search,h.open&&V()}),(O,M)=>(c.openBlock(),c.createElementBlock("div",$F,[c.createElementVNode("div",{ref_key:"rootRef",ref:r,tabindex:S.value,class:c.normalizeClass(["ui-multi-dropdown",{open:h.open,error:O.error,disabled:O.disabled}]),onKeydown:_,onFocusout:I},[c.createElementVNode("div",jF,[c.createElementVNode("div",ZF,[c.withDirectives(c.createElementVNode("input",{ref_key:"input",ref:d,"onUpdate:modelValue":M[0]||(M[0]=A=>h.search=A),type:"text",tabindex:"-1",disabled:O.disabled,placeholder:f.value,spellcheck:"false",autocomplete:"chrome-off",onFocus:M[1]||(M[1]=A=>h.open=!0)},null,40,qF),[[c.vModelText,h.search]]),M[3]||(M[3]=c.createTextVNode()),h.open?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",{key:0,class:"chips-container",onClick:P},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(C.value,(A,z)=>(c.openBlock(),c.createBlock(c.unref(Gc),{key:z,closeable:"",small:"",onClick:M[2]||(M[2]=c.withModifiers(H=>h.open=!0,["stop"])),onClose:H=>x(A.value)},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(A.text||A.value),1)]),_:2},1032,["onClose"]))),128))])),M[4]||(M[4]=c.createTextVNode()),c.createElementVNode("div",{class:"arrow",onClick:c.withModifiers(T,["stop"])}),M[5]||(M[5]=c.createTextVNode()),c.createElementVNode("div",YF,[c.renderSlot(O.$slots,"append")])]),M[10]||(M[10]=c.createTextVNode()),O.label?(c.openBlock(),c.createElementBlock("label",QF,[O.required?(c.openBlock(),c.createElementBlock("i",XF)):c.createCommentVNode("",!0),M[6]||(M[6]=c.createTextVNode()),c.createElementVNode("span",null,c.toDisplayString(O.label),1),M[7]||(M[7]=c.createTextVNode()),c.unref(n).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:1,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(O.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),M[11]||(M[11]=c.createTextVNode()),h.open?(c.openBlock(),c.createElementBlock("div",{key:1,ref_key:"list",ref:a,class:"ui-multi-dropdown__options"},[c.createElementVNode("div",JF,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(C.value,(A,z)=>(c.openBlock(),c.createBlock(c.unref(Gc),{key:z,closeable:"",small:"",onClose:H=>x(A.value)},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(A.text||A.value),1)]),_:2},1032,["onClose"]))),128))]),M[8]||(M[8]=c.createTextVNode()),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(v.value,(A,z)=>(c.openBlock(),c.createBlock(ul,{key:z,option:A,"text-item":"text","is-selected":A.selected,"is-hovered":h.activeOption==z,size:"medium","use-checkbox":"",onClick:c.withModifiers(H=>y(A.value),["stop"])},null,8,["option","is-selected","is-hovered","onClick"]))),128)),M[9]||(M[9]=c.createTextVNode()),v.value.length?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",ex,"Nothing found"))],512)):c.createCommentVNode("",!0),M[12]||(M[12]=c.createTextVNode()),c.createVNode(kn,{class:"ui-multi-dropdown__contour"})])],42,KF),M[13]||(M[13]=c.createTextVNode()),O.error?(c.openBlock(),c.createElementBlock("div",tx,c.toDisplayString(O.error),1)):O.helper?(c.openBlock(),c.createElementBlock("div",ix,c.toDisplayString(O.helper),1)):c.createCommentVNode("",!0)]))}}),Hc=c.defineComponent({__name:"PlCheckboxBase",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=e,i=c.computed(()=>t.modelValue);return(s,n)=>(c.openBlock(),c.createElementBlock("div",{tabindex:"0",class:c.normalizeClass(["pl-checkbox-base",{checked:i.value,disabled:s.disabled}]),onClick:n[0]||(n[0]=o=>s.$emit("update:modelValue",!s.modelValue)),onKeydown:n[1]||(n[1]=c.withKeys(o=>s.$emit("update:modelValue",!s.modelValue),["enter"]))},null,34))}}),ox={name:"PlCheckbox"},rx=c.defineComponent({...ox,props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=e,i=c.useSlots();return(s,n)=>c.unref(i).default?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["pl-checkbox",{disabled:s.disabled}])},[c.createVNode(Hc,c.mergeProps(t,{"onUpdate:modelValue":n[0]||(n[0]=o=>s.$emit("update:modelValue",o))}),null,16),n[3]||(n[3]=c.createTextVNode()),c.createElementVNode("label",{onClick:n[1]||(n[1]=o=>s.$emit("update:modelValue",!s.$props.modelValue))},[c.renderSlot(s.$slots,"default")])],2)):(c.openBlock(),c.createBlock(Hc,c.mergeProps({key:1},t,{"onUpdate:modelValue":n[2]||(n[2]=o=>s.$emit("update:modelValue",o))}),null,16))}}),lx={key:0},ax=["onClick"],cx={name:"PlCheckboxGroup"},dx=c.defineComponent({...cx,props:{modelValue:{},label:{},options:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=e,n=r=>s.modelValue.includes(r),o=r=>{const a=s.modelValue??[];i("update:modelValue",n(r)?a.filter(d=>d!==r):[...a,r])};return(r,a)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["ui-checkbox-group",{disabled:r.disabled}])},[r.label?(c.openBlock(),c.createElementBlock("label",lx,c.toDisplayString(r.label),1)):c.createCommentVNode("",!0),a[1]||(a[1]=c.createTextVNode()),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(r.options,(d,h)=>(c.openBlock(),c.createElementBlock("div",{key:h},[c.createVNode(Hc,{disabled:r.disabled,label:d.text,"model-value":n(d.value),"onUpdate:modelValue":()=>o(d.value)},null,8,["disabled","label","model-value","onUpdate:modelValue"]),a[0]||(a[0]=c.createTextVNode()),c.createElementVNode("label",{onClick:c.withModifiers(()=>o(d.value),["stop"])},c.toDisplayString(d.text),9,ax)]))),128))],2))}}),ux={inheritAttrs:!1},$p=c.defineComponent({...ux,__name:"PlDialogModal",props:{modelValue:{type:Boolean},width:{default:"448px"},height:{default:"auto"},minHeight:{default:"auto"},type:{default:"A"},closable:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=c.ref(),n=c.useAttrs();function o(r){s.value&&!s.value.contains(r.target)&&i("update:modelValue",!1)}return(r,a)=>(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[c.createVNode(c.Transition,{name:"dialog"},{default:c.withCtx(()=>[r.modelValue?(c.openBlock(),c.createElementBlock("div",{key:0,class:"pl-dialog-modal__shadow",onClick:o,onKeyup:a[1]||(a[1]=c.withKeys(d=>i("update:modelValue",!1),["esc"]))},[c.createElementVNode("div",c.mergeProps(c.unref(n),{ref_key:"modal",ref:s,class:["pl-dialog-modal",[r.type]],style:{width:r.width,height:r.height,minHeight:r.minHeight}}),[r.closable?(c.openBlock(),c.createElementBlock("div",{key:0,class:"close-dialog-btn",onClick:a[0]||(a[0]=c.withModifiers(d=>i("update:modelValue",!1),["stop"]))})):c.createCommentVNode("",!0),a[2]||(a[2]=c.createTextVNode()),c.renderSlot(r.$slots,"default")],16)],32)):c.createCommentVNode("",!0)]),_:3})]))}}),hx=c.defineComponent({__name:"TransitionSlidePanel",setup(e){function t(){window.dispatchEvent(new CustomEvent("adjust"))}function i(){window.dispatchEvent(new CustomEvent("adjust"))}return(s,n)=>(c.openBlock(),c.createBlock(c.Transition,{name:"slide-panel",onAfterEnter:t,onAfterLeave:i},{default:c.withCtx(()=>[c.renderSlot(s.$slots,"default")]),_:3}))}}),px={class:"slide-modal__content"},gx={inheritAttrs:!1},fx=c.defineComponent({...gx,__name:"PlSlideModal",props:{modelValue:{type:Boolean,default:!1},width:{default:void 0},shadow:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const i=t,s=e,n=c.computed(()=>s.width??"100%"),o=c.ref(),r=c.useAttrs();return cl(o,()=>{s.modelValue&&i("update:modelValue",!1)}),st(document,"keydown",a=>{a.key==="Escape"&&i("update:modelValue",!1)}),(a,d)=>(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[c.createVNode(hx,null,{default:c.withCtx(()=>[a.modelValue?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0,ref_key:"modal",ref:o,style:{width:n.value}},c.unref(r),{class:"slide-modal",onKeyup:d[1]||(d[1]=c.withKeys(h=>i("update:modelValue",!1),["esc"]))}),[c.createElementVNode("div",{class:"close-dialog-btn",onClick:d[0]||(d[0]=h=>i("update:modelValue",!1))}),d[3]||(d[3]=c.createTextVNode()),c.createElementVNode("div",px,[c.renderSlot(a.$slots,"default",{},void 0,!0)])],16)):c.createCommentVNode("",!0)]),_:3}),d[4]||(d[4]=c.createTextVNode()),a.modelValue&&a.shadow?(c.openBlock(),c.createElementBlock("div",{key:0,class:"dialog-modal__shadow",onKeyup:d[2]||(d[2]=c.withKeys(h=>i("update:modelValue",!1),["esc"]))},null,32)):c.createCommentVNode("",!0)]))}}),mx=vs(fx,[["__scopeId","data-v-ad6acdbc"]]),Cx={key:0,class:"label"},vx={name:"PlToggleSwitch"},wx=c.defineComponent({...vx,props:{label:{},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,i)=>(c.openBlock(),c.createElementBlock("div",{tabindex:"0",class:c.normalizeClass(["ui-toggle-switch",{active:t.modelValue}]),onClick:i[0]||(i[0]=s=>t.$emit("update:modelValue",!t.modelValue)),onKeydown:i[1]||(i[1]=c.withKeys(s=>t.$emit("update:modelValue",!t.modelValue),["enter"]))},[i[2]||(i[2]=c.createElementVNode("div",{class:"ui-toggle-switch__body"},[c.createElementVNode("div",{class:"ui-toggle-switch__handle"})],-1)),i[3]||(i[3]=c.createTextVNode()),t.label?(c.openBlock(),c.createElementBlock("span",Cx,c.toDisplayString(t.label),1)):c.createCommentVNode("",!0)],34))}});function Sx(e){const t=e.split("/"),i=[];for(let s=0;s<t.length;s++)i.push({index:s,name:s===0?"Root":t[s],path:t.slice(0,s+1).join("/")});return i}const yx={class:"file-dialog__title"},bx={class:"file-dialog__search"},Rx={class:"ls-container"},Fx={class:"ls-head"},xx={class:"ls-head__breadcrumbs"},Ex=["title","onClick"],Px={key:0,class:"icon-16 icon-chevron-right"},Dx={class:"d-flex ml-auto align-center gap-12"},Tx={class:"ls-head__selected"},Ax={key:0,class:"ls-loader"},Mx={key:1,class:"ls-empty"},kx={key:2,class:"ls-error"},Ix={class:"ls-error__message"},Lx={key:3,class:"ls-body"},_x=["onClick"],Ox=["title"],Vx=["onClick"],Nx=["title"],Bx={style:{"padding-top":"24px",display:"flex",gap:"12px","border-top":"1px solid rgb(225, 227, 235)"},class:"form-modal__actions bordered"},Kp=c.defineComponent({__name:"PlFileDialog",props:{modelValue:{type:Boolean},extensions:{default:void 0},multi:{type:Boolean},title:{default:void 0},autoSelectStorage:{type:Boolean,default:!0}},emits:["update:modelValue","import:files"],setup(e,{emit:t}){const i={mounted:M=>{var A;(A=M.querySelector("button.ui-btn-primary"))==null||A.focus()}},s=t,n=e,o=()=>({dirPath:"",storageEntry:void 0,items:[],error:"",storageOptions:[],selected:[],lastSelected:void 0,currentLoadingPath:void 0,showHiddenItems:!1}),r=c.reactive(o()),a=c.computed(()=>r.showHiddenItems?r.items:r.items.filter(M=>!M.name.startsWith("."))),d=c.computed(()=>{var M;return{modelValue:n.modelValue,dirPath:r.dirPath,storageHandle:(M=r.storageEntry)==null?void 0:M.handle}}),h=(M,A)=>{window.platforma&&r.currentLoadingPath!==A&&(r.error="",r.items=[],r.lastSelected=void 0,r.currentLoadingPath=A,window.platforma.lsDriver.listFiles(M,A).then(z=>{A===r.dirPath&&(r.items=fc(z).entries.map(H=>({path:H.fullPath,name:H.name,isDir:H.type==="dir",canBeSelected:H.type==="file"&&(!n.extensions||n.extensions.some(Z=>H.fullPath.endsWith(Z))),handle:H.type==="file"?H.handle:void 0,selected:!1})).sort((H,Z)=>H.isDir&&!Z.isDir?-1:!H.isDir&&Z.isDir?1:H.name.localeCompare(Z.name)).map((H,Z)=>({id:Z,...H})),r.lastSelected=void 0)}).catch(z=>r.error=String(z)).finally(()=>{r.currentLoadingPath=void 0}))},g=()=>{const{storageHandle:M,dirPath:A,modelValue:z}=d.value;M&&z&&h(M,A)},f=pp(M=>{M&&(r.dirPath=M)},1e3),C=c.computed(()=>Sx(r.dirPath)),v=c.computed(()=>r.items.filter(M=>M.canBeSelected&&M.selected&&!M.isDir)),S=c.computed(()=>v.value.length>0),R=()=>{s("update:modelValue",!1)},y=()=>{var M;S.value&&(M=r.storageEntry)!=null&&M.handle&&(s("import:files",{storageHandle:r.storageEntry.handle,files:v.value.map(A=>A.handle)}),R())},x=M=>{r.dirPath=M,r.storageEntry&&g()},P=(M,A)=>{const{shiftKey:z,metaKey:H}=M,{lastSelected:Z}=r;if(M.preventDefault(),A.canBeSelected){if(n.multi||r.items.forEach(ie=>ie.selected=!1),A.selected=!0,!n.multi)return;!H&&!z&&r.items.forEach(ie=>{ie.id!==A.id&&(ie.selected=!1)}),z&&Z!==void 0&&r.items.forEach(ie=>{np(ie.id,Z,A.id)&&(ie.selected=!0)}),A.selected&&(r.lastSelected=A.id)}},T=M=>{M&&!n.multi||r.items.filter(A=>A.canBeSelected).forEach(A=>{A.selected=M})},I=()=>T(!0),V=()=>T(!1),_=()=>{if(r.error="",r.lastSelected=void 0,V(),!window.platforma){console.warn("platforma API is not found");return}window.platforma.lsDriver.getStorageList().then(M=>{r.storageOptions=M.map(A=>({text:A.name,value:A})),n.autoSelectStorage&&Js(M.find(A=>A.name==="local"),A=>{r.storageEntry=A,r.dirPath=A.initialFullPath})}).catch(M=>r.error=String(M))};c.watch(c.toRef(r,"storageEntry"),M=>{r.dirPath=(M==null?void 0:M.initialFullPath)??""}),c.watch([()=>r.dirPath,()=>r.storageEntry],()=>{g()}),c.watch(()=>n.modelValue,M=>{M?_():Object.assign(r,o())},{immediate:!0}),st(document,"keydown",M=>{n.modelValue&&M.target===document.body&&(M.metaKey&&M.code==="KeyA"&&(M.preventDefault(),I()),M.metaKey&&M.shiftKey&&M.code==="Period"&&(M.preventDefault(),r.showHiddenItems=!r.showHiddenItems))}),c.onUpdated(_);const O={mounted:M=>{if(M.clientWidth<M.scrollWidth){const A=M.innerText;M.innerText=A.substring(0,57)+"..."+A.substring(A.length-10)}}};return(M,A)=>(c.openBlock(),c.createBlock(c.unref($p),{class:"split","model-value":M.modelValue,width:"688px",height:"720px","onUpdate:modelValue":R,onClick:c.withModifiers(V,["stop"])},{default:c.withCtx(()=>[c.withDirectives((c.openBlock(),c.createElementBlock("div",{class:"file-dialog",onKeyup:c.withKeys(y,["enter"])},[c.createElementVNode("div",yx,c.toDisplayString(M.title??"Select files"),1),A[13]||(A[13]=c.createTextVNode()),c.createElementVNode("div",bx,[c.createVNode(c.unref(zp),{modelValue:r.storageEntry,"onUpdate:modelValue":A[0]||(A[0]=z=>r.storageEntry=z),label:"Select storage",options:r.storageOptions},null,8,["modelValue","options"]),A[1]||(A[1]=c.createTextVNode()),c.createVNode(c.unref(Np),{"model-value":r.dirPath,label:"Enter path","onUpdate:modelValue":c.unref(f)},null,8,["model-value","onUpdate:modelValue"])]),A[14]||(A[14]=c.createTextVNode()),c.createElementVNode("div",Rx,[c.createElementVNode("div",Fx,[c.createElementVNode("div",xx,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(C.value,(z,H)=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:H},[c.createElementVNode("div",{title:z.path,onClick:Z=>x(z.path)},c.toDisplayString(z.name),9,Ex),A[2]||(A[2]=c.createTextVNode()),z.index!==C.value.length-1?(c.openBlock(),c.createElementBlock("i",Px)):c.createCommentVNode("",!0)],64))),128))]),A[3]||(A[3]=c.createTextVNode()),c.createElementVNode("div",Dx,[c.createElementVNode("span",Tx,"Selected: "+c.toDisplayString(v.value.length),1)])]),A[12]||(A[12]=c.createTextVNode()),r.currentLoadingPath!==void 0?(c.openBlock(),c.createElementBlock("div",Ax,A[4]||(A[4]=[c.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"},null,-1)]))):r.storageEntry?r.error?(c.openBlock(),c.createElementBlock("div",kx,[A[6]||(A[6]=c.createElementVNode("div",{class:"ls-error__cat"},null,-1)),A[7]||(A[7]=c.createTextVNode()),c.createElementVNode("div",Ix,c.toDisplayString(r.error),1)])):(c.openBlock(),c.createElementBlock("div",Lx,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(a.value,z=>(c.openBlock(),c.createElementBlock(c.Fragment,{key:z.id},[z.isDir?(c.openBlock(),c.createElementBlock("div",{key:0,class:"isDir",onClick:H=>x(z.path)},[A[8]||(A[8]=c.createElementVNode("i",{class:"icon-16 icon-chevron-right"},null,-1)),A[9]||(A[9]=c.createTextVNode()),c.withDirectives((c.openBlock(),c.createElementBlock("span",{title:z.name},[c.createTextVNode(c.toDisplayString(z.name),1)],8,Ox)),[[O]])],8,_x)):(c.openBlock(),c.createElementBlock("div",{key:1,class:c.normalizeClass({canBeSelected:z.canBeSelected,selected:z.selected}),onClick:c.withModifiers(H=>P(H,z),["stop"])},[A[10]||(A[10]=c.createElementVNode("i",{class:"mask-16 mask-comp isFile"},null,-1)),A[11]||(A[11]=c.createTextVNode()),c.withDirectives((c.openBlock(),c.createElementBlock("span",{title:z.name},[c.createTextVNode(c.toDisplayString(z.name),1)],8,Nx)),[[O]])],10,Vx))],64))),128))])):(c.openBlock(),c.createElementBlock("div",Mx,A[5]||(A[5]=[c.createElementVNode("div",{class:"ls-empty__cat"},null,-1),c.createTextVNode(),c.createElementVNode("div",{class:"ls-empty__message"},"Select storage to preview",-1)])))])],32)),[[i]]),A[18]||(A[18]=c.createTextVNode()),c.createElementVNode("div",Bx,[c.createVNode(c.unref(Ap),{style:{"min-width":"160px"},disabled:!S.value,onClick:c.withModifiers(y,["stop"])},{default:c.withCtx(()=>A[15]||(A[15]=[c.createTextVNode("Import")])),_:1},8,["disabled"]),A[17]||(A[17]=c.createTextVNode()),c.createVNode(c.unref(Mp),{"justify-center":!1,onClick:c.withModifiers(R,["stop"])},{default:c.withCtx(()=>A[16]||(A[16]=[c.createTextVNode("Cancel")])),_:1})])]),_:1},8,["model-value"]))}}),Ln=c.defineComponent({__name:"MaskIcon24",props:{name:{},size:{}},setup(e){const t=e,i=c.computed(()=>`mask-24 mask-${t.name}`);return(s,n)=>(c.openBlock(),c.createElementBlock("i",{class:c.normalizeClass(i.value)},null,2))}});var Ge;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function i(n){throw new Error}e.assertNever=i,e.arrayToEnum=n=>{const o={};for(const r of n)o[r]=r;return o},e.getValidEnumValues=n=>{const o=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),r={};for(const a of o)r[a]=n[a];return e.objectValues(r)},e.objectValues=n=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const o=[];for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&o.push(r);return o},e.find=(n,o)=>{for(const r of n)if(o(r))return r},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,o=" | "){return n.map(r=>typeof r=="string"?`'${r}'`:r).join(o)}e.joinValues=s,e.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(Ge||(Ge={}));var Wc;(function(e){e.mergeShapes=(t,i)=>({...t,...i})})(Wc||(Wc={}));const oe=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ss=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},Q=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Gx=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Kt extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const i=t||function(o){return o.message},s={_errors:[]},n=o=>{for(const r of o.issues)if(r.code==="invalid_union")r.unionErrors.map(n);else if(r.code==="invalid_return_type")n(r.returnTypeError);else if(r.code==="invalid_arguments")n(r.argumentsError);else if(r.path.length===0)s._errors.push(i(r));else{let a=s,d=0;for(;d<r.path.length;){const h=r.path[d];d===r.path.length-1?(a[h]=a[h]||{_errors:[]},a[h]._errors.push(i(r))):a[h]=a[h]||{_errors:[]},a=a[h],d++}}};return n(this),s}static assert(t){if(!(t instanceof Kt))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=i=>i.message){const i={},s=[];for(const n of this.issues)n.path.length>0?(i[n.path[0]]=i[n.path[0]]||[],i[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}}Kt.create=e=>new Kt(e);const _n=(e,t)=>{let i;switch(e.code){case Q.invalid_type:e.received===oe.undefined?i="Required":i=`Expected ${e.expected}, received ${e.received}`;break;case Q.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(e.expected,Ge.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:i=`Unrecognized key(s) in object: ${Ge.joinValues(e.keys,", ")}`;break;case Q.invalid_union:i="Invalid input";break;case Q.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${Ge.joinValues(e.options)}`;break;case Q.invalid_enum_value:i=`Invalid enum value. Expected ${Ge.joinValues(e.options)}, received '${e.received}'`;break;case Q.invalid_arguments:i="Invalid function arguments";break;case Q.invalid_return_type:i="Invalid function return type";break;case Q.invalid_date:i="Invalid date";break;case Q.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:Ge.assertNever(e.validation):e.validation!=="regex"?i=`Invalid ${e.validation}`:i="Invalid";break;case Q.too_small:e.type==="array"?i=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?i=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?i=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?i=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:i="Invalid input";break;case Q.too_big:e.type==="array"?i=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?i=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?i=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?i=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?i=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:i="Invalid input";break;case Q.custom:i="Invalid input";break;case Q.invalid_intersection_types:i="Intersection results could not be merged";break;case Q.not_multiple_of:i=`Number must be a multiple of ${e.multipleOf}`;break;case Q.not_finite:i="Number must be finite";break;default:i=t.defaultError,Ge.assertNever(e)}return{message:i}};let jp=_n;function Hx(e){jp=e}function hl(){return jp}const pl=e=>{const{data:t,path:i,errorMaps:s,issueData:n}=e,o=[...i,...n.path||[]],r={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let a="";const d=s.filter(h=>!!h).slice().reverse();for(const h of d)a=h(r,{data:t,defaultError:a}).message;return{...n,path:o,message:a}},Wx=[];function se(e,t){const i=hl(),s=pl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===_n?void 0:_n].filter(n=>!!n)});e.common.issues.push(s)}class Ct{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,i){const s=[];for(const n of i){if(n.status==="aborted")return ye;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,i){const s=[];for(const n of i){const o=await n.key,r=await n.value;s.push({key:o,value:r})}return Ct.mergeObjectSync(t,s)}static mergeObjectSync(t,i){const s={};for(const n of i){const{key:o,value:r}=n;if(o.status==="aborted"||r.status==="aborted")return ye;o.status==="dirty"&&t.dirty(),r.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof r.value<"u"||n.alwaysSet)&&(s[o.value]=r.value)}return{status:t.value,value:s}}}const ye=Object.freeze({status:"aborted"}),gl=e=>({status:"dirty",value:e}),Et=e=>({status:"valid",value:e}),zc=e=>e.status==="aborted",Uc=e=>e.status==="dirty",Ao=e=>e.status==="valid",Mo=e=>typeof Promise<"u"&&e instanceof Promise;function fl(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Zp(e,t,i,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var ue;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ue||(ue={}));var ko,Io;class Li{constructor(t,i,s,n){this._cachedPath=[],this.parent=t,this.data=i,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const qp=(e,t)=>{if(Ao(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new Kt(e.common.issues);return this._error=i,this._error}}};function Fe(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:s,description:n}=e;if(t&&(i||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(o,r)=>{var a,d;const{message:h}=e;return o.code==="invalid_enum_value"?{message:h??r.defaultError}:typeof r.data>"u"?{message:(a=h??s)!==null&&a!==void 0?a:r.defaultError}:o.code!=="invalid_type"?{message:r.defaultError}:{message:(d=h??i)!==null&&d!==void 0?d:r.defaultError}},description:n}}class Te{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Ss(t.data)}_getOrReturnCtx(t,i){return i||{common:t.parent.common,data:t.data,parsedType:Ss(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ct,ctx:{common:t.parent.common,data:t.data,parsedType:Ss(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const i=this._parse(t);if(Mo(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(t){const i=this._parse(t);return Promise.resolve(i)}parse(t,i){const s=this.safeParse(t,i);if(s.success)return s.data;throw s.error}safeParse(t,i){var s;const n={common:{issues:[],async:(s=i==null?void 0:i.async)!==null&&s!==void 0?s:!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ss(t)},o=this._parseSync({data:t,path:n.path,parent:n});return qp(n,o)}async parseAsync(t,i){const s=await this.safeParseAsync(t,i);if(s.success)return s.data;throw s.error}async safeParseAsync(t,i){const s={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ss(t)},n=this._parse({data:t,path:s.path,parent:s}),o=await(Mo(n)?n:Promise.resolve(n));return qp(s,o)}refine(t,i){const s=n=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(n):i;return this._refinement((n,o)=>{const r=t(n),a=()=>o.addIssue({code:Q.custom,...s(n)});return typeof Promise<"u"&&r instanceof Promise?r.then(d=>d?!0:(a(),!1)):r?!0:(a(),!1)})}refinement(t,i){return this._refinement((s,n)=>t(s)?!0:(n.addIssue(typeof i=="function"?i(s,n):i),!1))}_refinement(t){return new Si({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Oi.create(this,this._def)}nullable(){return xs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wi.create(this,this._def)}promise(){return Bn.create(this,this._def)}or(t){return Vo.create([this,t],this._def)}and(t){return No.create(this,t,this._def)}transform(t){return new Si({...Fe(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const i=typeof t=="function"?t:()=>t;return new zo({...Fe(this._def),innerType:this,defaultValue:i,typeName:ve.ZodDefault})}brand(){return new jc({typeName:ve.ZodBranded,type:this,...Fe(this._def)})}catch(t){const i=typeof t=="function"?t:()=>t;return new Uo({...Fe(this._def),innerType:this,catchValue:i,typeName:ve.ZodCatch})}describe(t){const i=this.constructor;return new i({...this._def,description:t})}pipe(t){return $o.create(this,t)}readonly(){return Ko.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const zx=/^c[^\s-]{8,}$/i,Ux=/^[0-9a-z]+$/,$x=/^[0-9A-HJKMNP-TV-Z]{26}$/,Kx=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jx=/^[a-z0-9_-]{21}$/i,Zx=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qx=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $c;const Qx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Xx=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Jx=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yp="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",eE=new RegExp(`^${Yp}$`);function Qp(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function tE(e){return new RegExp(`^${Qp(e)}$`)}function Xp(e){let t=`${Yp}T${Qp(e)}`;const i=[];return i.push(e.local?"Z?":"Z"),e.offset&&i.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${i.join("|")})`,new RegExp(`^${t}$`)}function iE(e,t){return!!((t==="v4"||!t)&&Qx.test(e)||(t==="v6"||!t)&&Xx.test(e))}class vi extends Te{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const n=this._getOrReturnCtx(t);return se(n,{code:Q.invalid_type,expected:oe.string,received:n.parsedType}),ye}const i=new Ct;let s;for(const n of this._def.checks)if(n.kind==="min")t.data.length<n.value&&(s=this._getOrReturnCtx(t,s),se(s,{code:Q.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="max")t.data.length>n.value&&(s=this._getOrReturnCtx(t,s),se(s,{code:Q.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="length"){const o=t.data.length>n.value,r=t.data.length<n.value;(o||r)&&(s=this._getOrReturnCtx(t,s),o?se(s,{code:Q.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):r&&se(s,{code:Q.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),i.dirty())}else if(n.kind==="email")qx.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"email",code:Q.invalid_string,message:n.message}),i.dirty());else if(n.kind==="emoji")$c||($c=new RegExp(Yx,"u")),$c.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"emoji",code:Q.invalid_string,message:n.message}),i.dirty());else if(n.kind==="uuid")Kx.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"uuid",code:Q.invalid_string,message:n.message}),i.dirty());else if(n.kind==="nanoid")jx.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"nanoid",code:Q.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid")zx.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"cuid",code:Q.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid2")Ux.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"cuid2",code:Q.invalid_string,message:n.message}),i.dirty());else if(n.kind==="ulid")$x.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"ulid",code:Q.invalid_string,message:n.message}),i.dirty());else if(n.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),se(s,{validation:"url",code:Q.invalid_string,message:n.message}),i.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"regex",code:Q.invalid_string,message:n.message}),i.dirty())):n.kind==="trim"?t.data=t.data.trim():n.kind==="includes"?t.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(t,s),se(s,{code:Q.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),i.dirty()):n.kind==="toLowerCase"?t.data=t.data.toLowerCase():n.kind==="toUpperCase"?t.data=t.data.toUpperCase():n.kind==="startsWith"?t.data.startsWith(n.value)||(s=this._getOrReturnCtx(t,s),se(s,{code:Q.invalid_string,validation:{startsWith:n.value},message:n.message}),i.dirty()):n.kind==="endsWith"?t.data.endsWith(n.value)||(s=this._getOrReturnCtx(t,s),se(s,{code:Q.invalid_string,validation:{endsWith:n.value},message:n.message}),i.dirty()):n.kind==="datetime"?Xp(n).test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{code:Q.invalid_string,validation:"datetime",message:n.message}),i.dirty()):n.kind==="date"?eE.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{code:Q.invalid_string,validation:"date",message:n.message}),i.dirty()):n.kind==="time"?tE(n).test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{code:Q.invalid_string,validation:"time",message:n.message}),i.dirty()):n.kind==="duration"?Zx.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"duration",code:Q.invalid_string,message:n.message}),i.dirty()):n.kind==="ip"?iE(t.data,n.version)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"ip",code:Q.invalid_string,message:n.message}),i.dirty()):n.kind==="base64"?Jx.test(t.data)||(s=this._getOrReturnCtx(t,s),se(s,{validation:"base64",code:Q.invalid_string,message:n.message}),i.dirty()):Ge.assertNever(n);return{status:i.value,value:t.data}}_regex(t,i,s){return this.refinement(n=>t.test(n),{validation:i,code:Q.invalid_string,...ue.errToObj(s)})}_addCheck(t){return new vi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ue.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ue.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ue.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ue.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ue.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ue.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ue.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ue.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ue.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ue.errToObj(t)})}datetime(t){var i,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(i=t==null?void 0:t.offset)!==null&&i!==void 0?i:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...ue.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ue.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ue.errToObj(t)})}regex(t,i){return this._addCheck({kind:"regex",regex:t,...ue.errToObj(i)})}includes(t,i){return this._addCheck({kind:"includes",value:t,position:i==null?void 0:i.position,...ue.errToObj(i==null?void 0:i.message)})}startsWith(t,i){return this._addCheck({kind:"startsWith",value:t,...ue.errToObj(i)})}endsWith(t,i){return this._addCheck({kind:"endsWith",value:t,...ue.errToObj(i)})}min(t,i){return this._addCheck({kind:"min",value:t,...ue.errToObj(i)})}max(t,i){return this._addCheck({kind:"max",value:t,...ue.errToObj(i)})}length(t,i){return this._addCheck({kind:"length",value:t,...ue.errToObj(i)})}nonempty(t){return this.min(1,ue.errToObj(t))}trim(){return new vi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new vi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new vi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxLength(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}}vi.create=e=>{var t;return new vi({checks:[],typeName:ve.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Fe(e)})};function sE(e,t){const i=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=i>s?i:s,o=parseInt(e.toFixed(n).replace(".","")),r=parseInt(t.toFixed(n).replace(".",""));return o%r/Math.pow(10,n)}class ys extends Te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==oe.number){const n=this._getOrReturnCtx(t);return se(n,{code:Q.invalid_type,expected:oe.number,received:n.parsedType}),ye}let i;const s=new Ct;for(const n of this._def.checks)n.kind==="int"?Ge.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),se(i,{code:Q.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(i=this._getOrReturnCtx(t,i),se(i,{code:Q.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(i=this._getOrReturnCtx(t,i),se(i,{code:Q.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="multipleOf"?sE(t.data,n.value)!==0&&(i=this._getOrReturnCtx(t,i),se(i,{code:Q.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):n.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),se(i,{code:Q.not_finite,message:n.message}),s.dirty()):Ge.assertNever(n);return{status:s.value,value:t.data}}gte(t,i){return this.setLimit("min",t,!0,ue.toString(i))}gt(t,i){return this.setLimit("min",t,!1,ue.toString(i))}lte(t,i){return this.setLimit("max",t,!0,ue.toString(i))}lt(t,i){return this.setLimit("max",t,!1,ue.toString(i))}setLimit(t,i,s,n){return new ys({...this._def,checks:[...this._def.checks,{kind:t,value:i,inclusive:s,message:ue.toString(n)}]})}_addCheck(t){return new ys({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ue.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(t)})}multipleOf(t,i){return this._addCheck({kind:"multipleOf",value:t,message:ue.toString(i)})}finite(t){return this._addCheck({kind:"finite",message:ue.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.toString(t)})}get minValue(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxValue(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ge.isInteger(t.value))}get isFinite(){let t=null,i=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(i===null||s.value>i)&&(i=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(i)&&Number.isFinite(t)}}ys.create=e=>new ys({checks:[],typeName:ve.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Fe(e)});class bs extends Te{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==oe.bigint){const n=this._getOrReturnCtx(t);return se(n,{code:Q.invalid_type,expected:oe.bigint,received:n.parsedType}),ye}let i;const s=new Ct;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?t.data<n.value:t.data<=n.value)&&(i=this._getOrReturnCtx(t,i),se(i,{code:Q.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?t.data>n.value:t.data>=n.value)&&(i=this._getOrReturnCtx(t,i),se(i,{code:Q.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="multipleOf"?t.data%n.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),se(i,{code:Q.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):Ge.assertNever(n);return{status:s.value,value:t.data}}gte(t,i){return this.setLimit("min",t,!0,ue.toString(i))}gt(t,i){return this.setLimit("min",t,!1,ue.toString(i))}lte(t,i){return this.setLimit("max",t,!0,ue.toString(i))}lt(t,i){return this.setLimit("max",t,!1,ue.toString(i))}setLimit(t,i,s,n){return new bs({...this._def,checks:[...this._def.checks,{kind:t,value:i,inclusive:s,message:ue.toString(n)}]})}_addCheck(t){return new bs({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(t)})}multipleOf(t,i){return this._addCheck({kind:"multipleOf",value:t,message:ue.toString(i)})}get minValue(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxValue(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}}bs.create=e=>{var t;return new bs({checks:[],typeName:ve.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Fe(e)})};class Lo extends Te{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const i=this._getOrReturnCtx(t);return se(i,{code:Q.invalid_type,expected:oe.boolean,received:i.parsedType}),ye}return Et(t.data)}}Lo.create=e=>new Lo({typeName:ve.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Fe(e)});class en extends Te{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const n=this._getOrReturnCtx(t);return se(n,{code:Q.invalid_type,expected:oe.date,received:n.parsedType}),ye}if(isNaN(t.data.getTime())){const n=this._getOrReturnCtx(t);return se(n,{code:Q.invalid_date}),ye}const i=new Ct;let s;for(const n of this._def.checks)n.kind==="min"?t.data.getTime()<n.value&&(s=this._getOrReturnCtx(t,s),se(s,{code:Q.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),i.dirty()):n.kind==="max"?t.data.getTime()>n.value&&(s=this._getOrReturnCtx(t,s),se(s,{code:Q.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),i.dirty()):Ge.assertNever(n);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new en({...this._def,checks:[...this._def.checks,t]})}min(t,i){return this._addCheck({kind:"min",value:t.getTime(),message:ue.toString(i)})}max(t,i){return this._addCheck({kind:"max",value:t.getTime(),message:ue.toString(i)})}get minDate(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t!=null?new Date(t):null}}en.create=e=>new en({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ve.ZodDate,...Fe(e)});class ml extends Te{_parse(t){if(this._getType(t)!==oe.symbol){const i=this._getOrReturnCtx(t);return se(i,{code:Q.invalid_type,expected:oe.symbol,received:i.parsedType}),ye}return Et(t.data)}}ml.create=e=>new ml({typeName:ve.ZodSymbol,...Fe(e)});class _o extends Te{_parse(t){if(this._getType(t)!==oe.undefined){const i=this._getOrReturnCtx(t);return se(i,{code:Q.invalid_type,expected:oe.undefined,received:i.parsedType}),ye}return Et(t.data)}}_o.create=e=>new _o({typeName:ve.ZodUndefined,...Fe(e)});class Oo extends Te{_parse(t){if(this._getType(t)!==oe.null){const i=this._getOrReturnCtx(t);return se(i,{code:Q.invalid_type,expected:oe.null,received:i.parsedType}),ye}return Et(t.data)}}Oo.create=e=>new Oo({typeName:ve.ZodNull,...Fe(e)});class On extends Te{constructor(){super(...arguments),this._any=!0}_parse(t){return Et(t.data)}}On.create=e=>new On({typeName:ve.ZodAny,...Fe(e)});class tn extends Te{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Et(t.data)}}tn.create=e=>new tn({typeName:ve.ZodUnknown,...Fe(e)});class qi extends Te{_parse(t){const i=this._getOrReturnCtx(t);return se(i,{code:Q.invalid_type,expected:oe.never,received:i.parsedType}),ye}}qi.create=e=>new qi({typeName:ve.ZodNever,...Fe(e)});class Cl extends Te{_parse(t){if(this._getType(t)!==oe.undefined){const i=this._getOrReturnCtx(t);return se(i,{code:Q.invalid_type,expected:oe.void,received:i.parsedType}),ye}return Et(t.data)}}Cl.create=e=>new Cl({typeName:ve.ZodVoid,...Fe(e)});class wi extends Te{_parse(t){const{ctx:i,status:s}=this._processInputParams(t),n=this._def;if(i.parsedType!==oe.array)return se(i,{code:Q.invalid_type,expected:oe.array,received:i.parsedType}),ye;if(n.exactLength!==null){const r=i.data.length>n.exactLength.value,a=i.data.length<n.exactLength.value;(r||a)&&(se(i,{code:r?Q.too_big:Q.too_small,minimum:a?n.exactLength.value:void 0,maximum:r?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&i.data.length<n.minLength.value&&(se(i,{code:Q.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&i.data.length>n.maxLength.value&&(se(i,{code:Q.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((r,a)=>n.type._parseAsync(new Li(i,r,i.path,a)))).then(r=>Ct.mergeArray(s,r));const o=[...i.data].map((r,a)=>n.type._parseSync(new Li(i,r,i.path,a)));return Ct.mergeArray(s,o)}get element(){return this._def.type}min(t,i){return new wi({...this._def,minLength:{value:t,message:ue.toString(i)}})}max(t,i){return new wi({...this._def,maxLength:{value:t,message:ue.toString(i)}})}length(t,i){return new wi({...this._def,exactLength:{value:t,message:ue.toString(i)}})}nonempty(t){return this.min(1,t)}}wi.create=(e,t)=>new wi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Fe(t)});function Vn(e){if(e instanceof et){const t={};for(const i in e.shape){const s=e.shape[i];t[i]=Oi.create(Vn(s))}return new et({...e._def,shape:()=>t})}else return e instanceof wi?new wi({...e._def,type:Vn(e.element)}):e instanceof Oi?Oi.create(Vn(e.unwrap())):e instanceof xs?xs.create(Vn(e.unwrap())):e instanceof _i?_i.create(e.items.map(t=>Vn(t))):e}class et extends Te{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),i=Ge.objectKeys(t);return this._cached={shape:t,keys:i}}_parse(t){if(this._getType(t)!==oe.object){const d=this._getOrReturnCtx(t);return se(d,{code:Q.invalid_type,expected:oe.object,received:d.parsedType}),ye}const{status:i,ctx:s}=this._processInputParams(t),{shape:n,keys:o}=this._getCached(),r=[];if(!(this._def.catchall instanceof qi&&this._def.unknownKeys==="strip"))for(const d in s.data)o.includes(d)||r.push(d);const a=[];for(const d of o){const h=n[d],g=s.data[d];a.push({key:{status:"valid",value:d},value:h._parse(new Li(s,g,s.path,d)),alwaysSet:d in s.data})}if(this._def.catchall instanceof qi){const d=this._def.unknownKeys;if(d==="passthrough")for(const h of r)a.push({key:{status:"valid",value:h},value:{status:"valid",value:s.data[h]}});else if(d==="strict")r.length>0&&(se(s,{code:Q.unrecognized_keys,keys:r}),i.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const h of r){const g=s.data[h];a.push({key:{status:"valid",value:h},value:d._parse(new Li(s,g,s.path,h)),alwaysSet:h in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const d=[];for(const h of a){const g=await h.key,f=await h.value;d.push({key:g,value:f,alwaysSet:h.alwaysSet})}return d}).then(d=>Ct.mergeObjectSync(i,d)):Ct.mergeObjectSync(i,a)}get shape(){return this._def.shape()}strict(t){return ue.errToObj,new et({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(i,s)=>{var n,o,r,a;const d=(r=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,i,s).message)!==null&&r!==void 0?r:s.defaultError;return i.code==="unrecognized_keys"?{message:(a=ue.errToObj(t).message)!==null&&a!==void 0?a:d}:{message:d}}}:{}})}strip(){return new et({...this._def,unknownKeys:"strip"})}passthrough(){return new et({...this._def,unknownKeys:"passthrough"})}extend(t){return new et({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new et({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ve.ZodObject})}setKey(t,i){return this.augment({[t]:i})}catchall(t){return new et({...this._def,catchall:t})}pick(t){const i={};return Ge.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(i[s]=this.shape[s])}),new et({...this._def,shape:()=>i})}omit(t){const i={};return Ge.objectKeys(this.shape).forEach(s=>{t[s]||(i[s]=this.shape[s])}),new et({...this._def,shape:()=>i})}deepPartial(){return Vn(this)}partial(t){const i={};return Ge.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?i[s]=n:i[s]=n.optional()}),new et({...this._def,shape:()=>i})}required(t){const i={};return Ge.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])i[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof Oi;)n=n._def.innerType;i[s]=n}}),new et({...this._def,shape:()=>i})}keyof(){return Jp(Ge.objectKeys(this.shape))}}et.create=(e,t)=>new et({shape:()=>e,unknownKeys:"strip",catchall:qi.create(),typeName:ve.ZodObject,...Fe(t)}),et.strictCreate=(e,t)=>new et({shape:()=>e,unknownKeys:"strict",catchall:qi.create(),typeName:ve.ZodObject,...Fe(t)}),et.lazycreate=(e,t)=>new et({shape:e,unknownKeys:"strip",catchall:qi.create(),typeName:ve.ZodObject,...Fe(t)});class Vo extends Te{_parse(t){const{ctx:i}=this._processInputParams(t),s=this._def.options;function n(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return i.common.issues.push(...a.ctx.common.issues),a.result;const r=o.map(a=>new Kt(a.ctx.common.issues));return se(i,{code:Q.invalid_union,unionErrors:r}),ye}if(i.common.async)return Promise.all(s.map(async o=>{const r={...i,common:{...i.common,issues:[]},parent:null};return{result:await o._parseAsync({data:i.data,path:i.path,parent:r}),ctx:r}})).then(n);{let o;const r=[];for(const d of s){const h={...i,common:{...i.common,issues:[]},parent:null},g=d._parseSync({data:i.data,path:i.path,parent:h});if(g.status==="valid")return g;g.status==="dirty"&&!o&&(o={result:g,ctx:h}),h.common.issues.length&&r.push(h.common.issues)}if(o)return i.common.issues.push(...o.ctx.common.issues),o.result;const a=r.map(d=>new Kt(d));return se(i,{code:Q.invalid_union,unionErrors:a}),ye}}get options(){return this._def.options}}Vo.create=(e,t)=>new Vo({options:e,typeName:ve.ZodUnion,...Fe(t)});const Rs=e=>e instanceof Go?Rs(e.schema):e instanceof Si?Rs(e.innerType()):e instanceof Ho?[e.value]:e instanceof Fs?e.options:e instanceof Wo?Ge.objectValues(e.enum):e instanceof zo?Rs(e._def.innerType):e instanceof _o?[void 0]:e instanceof Oo?[null]:e instanceof Oi?[void 0,...Rs(e.unwrap())]:e instanceof xs?[null,...Rs(e.unwrap())]:e instanceof jc||e instanceof Ko?Rs(e.unwrap()):e instanceof Uo?Rs(e._def.innerType):[];class vl extends Te{_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==oe.object)return se(i,{code:Q.invalid_type,expected:oe.object,received:i.parsedType}),ye;const s=this.discriminator,n=i.data[s],o=this.optionsMap.get(n);return o?i.common.async?o._parseAsync({data:i.data,path:i.path,parent:i}):o._parseSync({data:i.data,path:i.path,parent:i}):(se(i,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),ye)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,i,s){const n=new Map;for(const o of i){const r=Rs(o.shape[t]);if(!r.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of r){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,o)}}return new vl({typeName:ve.ZodDiscriminatedUnion,discriminator:t,options:i,optionsMap:n,...Fe(s)})}}function Kc(e,t){const i=Ss(e),s=Ss(t);if(e===t)return{valid:!0,data:e};if(i===oe.object&&s===oe.object){const n=Ge.objectKeys(t),o=Ge.objectKeys(e).filter(a=>n.indexOf(a)!==-1),r={...e,...t};for(const a of o){const d=Kc(e[a],t[a]);if(!d.valid)return{valid:!1};r[a]=d.data}return{valid:!0,data:r}}else if(i===oe.array&&s===oe.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let o=0;o<e.length;o++){const r=e[o],a=t[o],d=Kc(r,a);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return i===oe.date&&s===oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class No extends Te{_parse(t){const{status:i,ctx:s}=this._processInputParams(t),n=(o,r)=>{if(zc(o)||zc(r))return ye;const a=Kc(o.value,r.value);return a.valid?((Uc(o)||Uc(r))&&i.dirty(),{status:i.value,value:a.data}):(se(s,{code:Q.invalid_intersection_types}),ye)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([o,r])=>n(o,r)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}No.create=(e,t,i)=>new No({left:e,right:t,typeName:ve.ZodIntersection,...Fe(i)});class _i extends Te{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==oe.array)return se(s,{code:Q.invalid_type,expected:oe.array,received:s.parsedType}),ye;if(s.data.length<this._def.items.length)return se(s,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ye;!this._def.rest&&s.data.length>this._def.items.length&&(se(s,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const n=[...s.data].map((o,r)=>{const a=this._def.items[r]||this._def.rest;return a?a._parse(new Li(s,o,s.path,r)):null}).filter(o=>!!o);return s.common.async?Promise.all(n).then(o=>Ct.mergeArray(i,o)):Ct.mergeArray(i,n)}get items(){return this._def.items}rest(t){return new _i({...this._def,rest:t})}}_i.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _i({items:e,typeName:ve.ZodTuple,rest:null,...Fe(t)})};class Bo extends Te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==oe.object)return se(s,{code:Q.invalid_type,expected:oe.object,received:s.parsedType}),ye;const n=[],o=this._def.keyType,r=this._def.valueType;for(const a in s.data)n.push({key:o._parse(new Li(s,a,s.path,a)),value:r._parse(new Li(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?Ct.mergeObjectAsync(i,n):Ct.mergeObjectSync(i,n)}get element(){return this._def.valueType}static create(t,i,s){return i instanceof Te?new Bo({keyType:t,valueType:i,typeName:ve.ZodRecord,...Fe(s)}):new Bo({keyType:vi.create(),valueType:t,typeName:ve.ZodRecord,...Fe(i)})}}class wl extends Te{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==oe.map)return se(s,{code:Q.invalid_type,expected:oe.map,received:s.parsedType}),ye;const n=this._def.keyType,o=this._def.valueType,r=[...s.data.entries()].map(([a,d],h)=>({key:n._parse(new Li(s,a,s.path,[h,"key"])),value:o._parse(new Li(s,d,s.path,[h,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const d of r){const h=await d.key,g=await d.value;if(h.status==="aborted"||g.status==="aborted")return ye;(h.status==="dirty"||g.status==="dirty")&&i.dirty(),a.set(h.value,g.value)}return{status:i.value,value:a}})}else{const a=new Map;for(const d of r){const h=d.key,g=d.value;if(h.status==="aborted"||g.status==="aborted")return ye;(h.status==="dirty"||g.status==="dirty")&&i.dirty(),a.set(h.value,g.value)}return{status:i.value,value:a}}}}wl.create=(e,t,i)=>new wl({valueType:t,keyType:e,typeName:ve.ZodMap,...Fe(i)});class sn extends Te{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==oe.set)return se(s,{code:Q.invalid_type,expected:oe.set,received:s.parsedType}),ye;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(se(s,{code:Q.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),i.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(se(s,{code:Q.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),i.dirty());const o=this._def.valueType;function r(d){const h=new Set;for(const g of d){if(g.status==="aborted")return ye;g.status==="dirty"&&i.dirty(),h.add(g.value)}return{status:i.value,value:h}}const a=[...s.data.values()].map((d,h)=>o._parse(new Li(s,d,s.path,h)));return s.common.async?Promise.all(a).then(d=>r(d)):r(a)}min(t,i){return new sn({...this._def,minSize:{value:t,message:ue.toString(i)}})}max(t,i){return new sn({...this._def,maxSize:{value:t,message:ue.toString(i)}})}size(t,i){return this.min(t,i).max(t,i)}nonempty(t){return this.min(1,t)}}sn.create=(e,t)=>new sn({valueType:e,minSize:null,maxSize:null,typeName:ve.ZodSet,...Fe(t)});class Nn extends Te{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==oe.function)return se(i,{code:Q.invalid_type,expected:oe.function,received:i.parsedType}),ye;function s(a,d){return pl({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,hl(),_n].filter(h=>!!h),issueData:{code:Q.invalid_arguments,argumentsError:d}})}function n(a,d){return pl({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,hl(),_n].filter(h=>!!h),issueData:{code:Q.invalid_return_type,returnTypeError:d}})}const o={errorMap:i.common.contextualErrorMap},r=i.data;if(this._def.returns instanceof Bn){const a=this;return Et(async function(...d){const h=new Kt([]),g=await a._def.args.parseAsync(d,o).catch(C=>{throw h.addIssue(s(d,C)),h}),f=await Reflect.apply(r,this,g);return await a._def.returns._def.type.parseAsync(f,o).catch(C=>{throw h.addIssue(n(f,C)),h})})}else{const a=this;return Et(function(...d){const h=a._def.args.safeParse(d,o);if(!h.success)throw new Kt([s(d,h.error)]);const g=Reflect.apply(r,this,h.data),f=a._def.returns.safeParse(g,o);if(!f.success)throw new Kt([n(g,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Nn({...this._def,args:_i.create(t).rest(tn.create())})}returns(t){return new Nn({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,i,s){return new Nn({args:t||_i.create([]).rest(tn.create()),returns:i||tn.create(),typeName:ve.ZodFunction,...Fe(s)})}}class Go extends Te{get schema(){return this._def.getter()}_parse(t){const{ctx:i}=this._processInputParams(t);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Go.create=(e,t)=>new Go({getter:e,typeName:ve.ZodLazy,...Fe(t)});class Ho extends Te{_parse(t){if(t.data!==this._def.value){const i=this._getOrReturnCtx(t);return se(i,{received:i.data,code:Q.invalid_literal,expected:this._def.value}),ye}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ho.create=(e,t)=>new Ho({value:e,typeName:ve.ZodLiteral,...Fe(t)});function Jp(e,t){return new Fs({values:e,typeName:ve.ZodEnum,...Fe(t)})}class Fs extends Te{constructor(){super(...arguments),ko.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const i=this._getOrReturnCtx(t),s=this._def.values;return se(i,{expected:Ge.joinValues(s),received:i.parsedType,code:Q.invalid_type}),ye}if(fl(this,ko)||Zp(this,ko,new Set(this._def.values)),!fl(this,ko).has(t.data)){const i=this._getOrReturnCtx(t),s=this._def.values;return se(i,{received:i.data,code:Q.invalid_enum_value,options:s}),ye}return Et(t.data)}get options(){return this._def.values}get enum(){const t={};for(const i of this._def.values)t[i]=i;return t}get Values(){const t={};for(const i of this._def.values)t[i]=i;return t}get Enum(){const t={};for(const i of this._def.values)t[i]=i;return t}extract(t,i=this._def){return Fs.create(t,{...this._def,...i})}exclude(t,i=this._def){return Fs.create(this.options.filter(s=>!t.includes(s)),{...this._def,...i})}}ko=new WeakMap,Fs.create=Jp;class Wo extends Te{constructor(){super(...arguments),Io.set(this,void 0)}_parse(t){const i=Ge.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==oe.string&&s.parsedType!==oe.number){const n=Ge.objectValues(i);return se(s,{expected:Ge.joinValues(n),received:s.parsedType,code:Q.invalid_type}),ye}if(fl(this,Io)||Zp(this,Io,new Set(Ge.getValidEnumValues(this._def.values))),!fl(this,Io).has(t.data)){const n=Ge.objectValues(i);return se(s,{received:s.data,code:Q.invalid_enum_value,options:n}),ye}return Et(t.data)}get enum(){return this._def.values}}Io=new WeakMap,Wo.create=(e,t)=>new Wo({values:e,typeName:ve.ZodNativeEnum,...Fe(t)});class Bn extends Te{unwrap(){return this._def.type}_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==oe.promise&&i.common.async===!1)return se(i,{code:Q.invalid_type,expected:oe.promise,received:i.parsedType}),ye;const s=i.parsedType===oe.promise?i.data:Promise.resolve(i.data);return Et(s.then(n=>this._def.type.parseAsync(n,{path:i.path,errorMap:i.common.contextualErrorMap})))}}Bn.create=(e,t)=>new Bn({type:e,typeName:ve.ZodPromise,...Fe(t)});class Si extends Te{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:i,ctx:s}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:r=>{se(s,r),r.fatal?i.abort():i.dirty()},get path(){return s.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){const r=n.transform(s.data,o);if(s.common.async)return Promise.resolve(r).then(async a=>{if(i.value==="aborted")return ye;const d=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return d.status==="aborted"?ye:d.status==="dirty"||i.value==="dirty"?gl(d.value):d});{if(i.value==="aborted")return ye;const a=this._def.schema._parseSync({data:r,path:s.path,parent:s});return a.status==="aborted"?ye:a.status==="dirty"||i.value==="dirty"?gl(a.value):a}}if(n.type==="refinement"){const r=a=>{const d=n.refinement(a,o);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?ye:(a.status==="dirty"&&i.dirty(),r(a.value),{status:i.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?ye:(a.status==="dirty"&&i.dirty(),r(a.value).then(()=>({status:i.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const r=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Ao(r))return r;const a=n.transform(r.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(r=>Ao(r)?Promise.resolve(n.transform(r.value,o)).then(a=>({status:i.value,value:a})):r);Ge.assertNever(n)}}Si.create=(e,t,i)=>new Si({schema:e,typeName:ve.ZodEffects,effect:t,...Fe(i)}),Si.createWithPreprocess=(e,t,i)=>new Si({schema:t,effect:{type:"preprocess",transform:e},typeName:ve.ZodEffects,...Fe(i)});class Oi extends Te{_parse(t){return this._getType(t)===oe.undefined?Et(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Oi.create=(e,t)=>new Oi({innerType:e,typeName:ve.ZodOptional,...Fe(t)});class xs extends Te{_parse(t){return this._getType(t)===oe.null?Et(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}xs.create=(e,t)=>new xs({innerType:e,typeName:ve.ZodNullable,...Fe(t)});class zo extends Te{_parse(t){const{ctx:i}=this._processInputParams(t);let s=i.data;return i.parsedType===oe.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}zo.create=(e,t)=>new zo({innerType:e,typeName:ve.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});class Uo extends Te{_parse(t){const{ctx:i}=this._processInputParams(t),s={...i,common:{...i.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Mo(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Kt(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Kt(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Uo.create=(e,t)=>new Uo({innerType:e,typeName:ve.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});class Sl extends Te{_parse(t){if(this._getType(t)!==oe.nan){const i=this._getOrReturnCtx(t);return se(i,{code:Q.invalid_type,expected:oe.nan,received:i.parsedType}),ye}return{status:"valid",value:t.data}}}Sl.create=e=>new Sl({typeName:ve.ZodNaN,...Fe(e)});const nE=Symbol("zod_brand");class jc extends Te{_parse(t){const{ctx:i}=this._processInputParams(t),s=i.data;return this._def.type._parse({data:s,path:i.path,parent:i})}unwrap(){return this._def.type}}class $o extends Te{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?ye:n.status==="dirty"?(i.dirty(),gl(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?ye:n.status==="dirty"?(i.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,i){return new $o({in:t,out:i,typeName:ve.ZodPipeline})}}class Ko extends Te{_parse(t){const i=this._def.innerType._parse(t),s=n=>(Ao(n)&&(n.value=Object.freeze(n.value)),n);return Mo(i)?i.then(n=>s(n)):s(i)}unwrap(){return this._def.innerType}}Ko.create=(e,t)=>new Ko({innerType:e,typeName:ve.ZodReadonly,...Fe(t)});function eg(e,t={},i){return e?On.create().superRefine((s,n)=>{var o,r;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,d=(r=(o=a.fatal)!==null&&o!==void 0?o:i)!==null&&r!==void 0?r:!0,h=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...h,fatal:d})}}):On.create()}const oE={object:et.lazycreate};var ve;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ve||(ve={}));const rE=(e,t={message:`Input not instance of ${e.name}`})=>eg(i=>i instanceof e,t),tg=vi.create,ig=ys.create,lE=Sl.create,aE=bs.create,sg=Lo.create,cE=en.create,dE=ml.create,uE=_o.create,hE=Oo.create,pE=On.create,gE=tn.create,fE=qi.create,mE=Cl.create,CE=wi.create,vE=et.create,wE=et.strictCreate,SE=Vo.create,yE=vl.create,bE=No.create,RE=_i.create,FE=Bo.create,xE=wl.create,EE=sn.create,PE=Nn.create,DE=Go.create,TE=Ho.create,AE=Fs.create,ME=Wo.create,kE=Bn.create,ng=Si.create,IE=Oi.create,LE=xs.create,_E=Si.createWithPreprocess,OE=$o.create;var yl=Object.freeze({__proto__:null,defaultErrorMap:_n,setErrorMap:Hx,getErrorMap:hl,makeIssue:pl,EMPTY_PATH:Wx,addIssueToContext:se,ParseStatus:Ct,INVALID:ye,DIRTY:gl,OK:Et,isAborted:zc,isDirty:Uc,isValid:Ao,isAsync:Mo,get util(){return Ge},get objectUtil(){return Wc},ZodParsedType:oe,getParsedType:Ss,ZodType:Te,datetimeRegex:Xp,ZodString:vi,ZodNumber:ys,ZodBigInt:bs,ZodBoolean:Lo,ZodDate:en,ZodSymbol:ml,ZodUndefined:_o,ZodNull:Oo,ZodAny:On,ZodUnknown:tn,ZodNever:qi,ZodVoid:Cl,ZodArray:wi,ZodObject:et,ZodUnion:Vo,ZodDiscriminatedUnion:vl,ZodIntersection:No,ZodTuple:_i,ZodRecord:Bo,ZodMap:wl,ZodSet:sn,ZodFunction:Nn,ZodLazy:Go,ZodLiteral:Ho,ZodEnum:Fs,ZodNativeEnum:Wo,ZodPromise:Bn,ZodEffects:Si,ZodTransformer:Si,ZodOptional:Oi,ZodNullable:xs,ZodDefault:zo,ZodCatch:Uo,ZodNaN:Sl,BRAND:nE,ZodBranded:jc,ZodPipeline:$o,ZodReadonly:Ko,custom:eg,Schema:Te,ZodSchema:Te,late:oE,get ZodFirstPartyTypeKind(){return ve},coerce:{string:e=>vi.create({...e,coerce:!0}),number:e=>ys.create({...e,coerce:!0}),boolean:e=>Lo.create({...e,coerce:!0}),bigint:e=>bs.create({...e,coerce:!0}),date:e=>en.create({...e,coerce:!0})},any:pE,array:CE,bigint:aE,boolean:sg,date:cE,discriminatedUnion:yE,effect:ng,enum:AE,function:PE,instanceof:rE,intersection:bE,lazy:DE,literal:TE,map:xE,nan:lE,nativeEnum:ME,never:fE,null:hE,nullable:LE,number:ig,object:vE,oboolean:()=>sg().optional(),onumber:()=>ig().optional(),optional:IE,ostring:()=>tg().optional(),pipeline:OE,preprocess:_E,promise:kE,record:FE,set:EE,strictObject:wE,string:tg,symbol:dE,transformer:ng,tuple:RE,undefined:uE,union:SE,unknown:gE,void:mE,NEVER:ye,ZodIssueCode:Q,quotelessJson:Gx,ZodError:Kt});function VE(e){throw new Error("Unexpected object: "+e)}const og="upload://upload/",rg="index://index/";function NE(e){return e.startsWith(og)}function BE(e){return e.startsWith(rg)}function GE(e){if(BE(e)){const t=e.slice(rg.length);return JSON.parse(decodeURIComponent(t)).path}else if(NE(e)){const t=e.slice(og.length);return JSON.parse(decodeURIComponent(t)).localPath}VE(e)}yl.object({__isRef:yl.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:yl.string().describe("Upstream block id"),name:yl.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function HE(e){return e.replace(/^.*[\\/]/,"")}const WE={class:"pl-file-input__envelope"},zE={key:0,ref:"label"},UE={key:0,class:"required-icon"},$E=["data-placeholder"],KE={key:5,class:"pl-file-input__stats"},jE={key:0,class:"pl-file-input__error"},ZE={key:1,class:"upl-file-input__helper"},qE=c.defineComponent({__name:"PlFileInput",props:{modelValue:{},label:{default:void 0},required:{type:Boolean},dashed:{type:Boolean},extensions:{default:void 0},fileDialogTitle:{default:void 0},placeholder:{default:void 0},progress:{default:void 0},error:{default:void 0},helper:{default:void 0},showFilenameOnly:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const i=c.reactive({fileDialogOpen:!1}),s=c.useSlots(),n=t,o=e,r=c.computed(()=>{if(o.modelValue)try{const x=GE(o.modelValue).trim();return o.showFilenameOnly?HE(x):x}catch(x){return console.error(x),o.modelValue}return""}),a=c.computed(()=>o.progress&&!o.progress.done),d=c.computed(()=>o.progress&&o.progress.done),h=c.computed(()=>{var x;return o.error||((x=o.progress)==null?void 0:x.lastError)}),g=c.computed(()=>{var x;return o.error??((x=o.progress)==null?void 0:x.lastError)}),f=c.computed(()=>{const{status:x,done:P}=o.progress??{};return!x||!x.bytesTotal?"":x.bytesProcessed&&!P?Sc(x.bytesProcessed,{})+" / "+Sc(x.bytesTotal,{}):Sc(x.bytesTotal,{})}),C=c.computed(()=>{var x;const{progress:P}=o;return P?{width:P.done?"100%":Math.round((((x=P.status)==null?void 0:x.progress)??0)*100)+"%"}:{}}),v=()=>{i.fileDialogOpen=!0},S=x=>{x.files.length&&n("update:modelValue",x.files[0])},R=()=>n("update:modelValue",void 0),y=c.ref();return In(y),(x,P)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",WE,[c.createElementVNode("div",{ref_key:"rootRef",ref:y,class:c.normalizeClass(["pl-file-input",{dashed:x.dashed,error:h.value}])},[c.createElementVNode("div",{class:"pl-file-input__progress",style:c.normalizeStyle(C.value)},null,4),P[3]||(P[3]=c.createTextVNode()),x.label?(c.openBlock(),c.createElementBlock("label",zE,[x.required?(c.openBlock(),c.createElementBlock("i",UE)):c.createCommentVNode("",!0),P[1]||(P[1]=c.createTextVNode()),c.createElementVNode("span",null,c.toDisplayString(x.label),1),P[2]||(P[2]=c.createTextVNode()),c.unref(s).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:1,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(x.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)],512)):c.createCommentVNode("",!0),P[4]||(P[4]=c.createTextVNode()),h.value?(c.openBlock(),c.createBlock(Ln,{key:1,name:"restart"})):a.value?(c.openBlock(),c.createBlock(Ln,{key:2,name:"cloud-up"})):d.value?(c.openBlock(),c.createBlock(Ln,{key:3,name:"success"})):(c.openBlock(),c.createBlock(Ln,{key:4,name:"paper-clip"})),P[5]||(P[5]=c.createTextVNode()),c.createElementVNode("div",{"data-placeholder":x.placeholder??"Choose file",class:"pl-file-input__filename",onClick:c.withModifiers(v,["stop"])},c.toDisplayString(r.value),9,$E),P[6]||(P[6]=c.createTextVNode()),f.value?(c.openBlock(),c.createElementBlock("div",KE,c.toDisplayString(f.value),1)):c.createCommentVNode("",!0),P[7]||(P[7]=c.createTextVNode()),x.modelValue?(c.openBlock(),c.createBlock(Ln,{key:6,name:"close",onClick:c.withModifiers(R,["stop"])})):c.createCommentVNode("",!0),P[8]||(P[8]=c.createTextVNode()),c.createVNode(kn,{class:"pl-file-input__contour"})],2),P[9]||(P[9]=c.createTextVNode()),h.value?(c.openBlock(),c.createElementBlock("div",jE,c.toDisplayString(g.value),1)):x.helper?(c.openBlock(),c.createElementBlock("div",ZE,c.toDisplayString(x.helper),1)):c.createCommentVNode("",!0)]),P[10]||(P[10]=c.createTextVNode()),c.createVNode(c.unref(Kp),{modelValue:i.fileDialogOpen,"onUpdate:modelValue":P[0]||(P[0]=T=>i.fileDialogOpen=T),extensions:x.extensions,title:x.fileDialogTitle,"onImport:files":S},null,8,["modelValue","extensions","title"])],64))}}),YE=c.defineComponent({__name:"ContextProvider",props:{context:{},contextKey:{}},setup(e){const t=e;return c.provide(t.contextKey,c.computed(()=>t.context)),(i,s)=>c.renderSlot(i.$slots,"default")}});function vt(e,t,i){return t>e?t:e>i?i:e}const Zc=e=>c.computed(()=>{const t=[100],{min:i,max:s,step:n}=e.value;let o=i;for(;o<s;){o+=n;const r=(1-(vt(o,i,s)-i)/(s-i))*100;t.push(r)}return t}),QE={class:"ui-slider__wrapper"},XE={class:"ui-slider__label-section"},JE={key:0,class:"text-s"},eP={key:1,class:"ui-slider__value-static text-s"},tP={class:"ui-slider__base"},iP={class:"ui-slider__container"},sP={class:"ui-slider__container ui-slider__container-thumb"},nP={class:"ui-slider__input-wrapper d-flex"},oP=["value"],rP={key:0,class:"ui-slider__error"},lP=c.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const i=c.useSlots(),s=t,n=e,o=c.reactive({deltaValue:0}),r=c.computed(()=>n.max-n.min),a=c.computed(()=>vt((n.modelValue??0)+o.deltaValue,n.min,n.max)),d=c.ref(n.modelValue),h=c.computed(()=>{const V=n.modelValue;return Number.isFinite(V)?V<n.min?`Min value: ${n.min}`:V>n.max?`Max value: ${n.max}`:n.error:"Not a number"}),g=c.computed(()=>n),f=Zc(g),C=c.computed(()=>(a.value-n.min)/r.value),v=c.computed(()=>({right:Math.ceil((1-C.value)*100)+"%"})),S=c.computed(()=>({right:`calc(${Math.ceil((1-C.value)*100)}%) `})),R=c.ref(),y=c.ref();c.watch(()=>n.modelValue,V=>{d.value=V});function x(V){const _=vt(V,n.min,n.max);return Math.round((_+Number.EPSILON)*(1/n.step))/(1/n.step)}ws(y,V=>{var _;dt((_=c.unref(R))==null?void 0:_.getBoundingClientRect(),O=>{const{dx:M}=V;o.deltaValue=M/O.width*r.value,d.value=x(vt((n.modelValue??0)+o.deltaValue,n.min,n.max)),V.stop&&(s("update:modelValue",x(a.value)),o.deltaValue=0)})});function P(V){s("update:modelValue",x(V))}function T(V){P(+V.target.value)}function I(V){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(V.code)&&V.preventDefault();const _=V.code==="ArrowUp"||V.code==="ArrowRight"?n.step*1:V.code==="ArrowDown"||V.code==="ArrowLeft"?n.step*-1:0;P(n.modelValue+_)}return(V,_)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([n.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[c.createElementVNode("div",{class:c.normalizeClass([`ui-slider__mode-${n.mode}`,"ui-slider"])},[c.createElementVNode("div",QE,[c.createElementVNode("div",XE,[V.label?(c.openBlock(),c.createElementBlock("label",JE,[c.createElementVNode("span",null,c.toDisplayString(V.label),1),_[1]||(_[1]=c.createTextVNode()),c.unref(i).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:0,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(V.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),_[2]||(_[2]=c.createTextVNode()),n.mode==="text"?(c.openBlock(),c.createElementBlock("div",eP,c.toDisplayString(d.value)+c.toDisplayString(V.measure),1)):c.createCommentVNode("",!0)]),_[6]||(_[6]=c.createTextVNode()),c.createElementVNode("div",tP,[c.createElementVNode("div",iP,[c.createElementVNode("div",{ref_key:"barRef",ref:R,class:"ui-slider__bar"},[c.createElementVNode("div",{class:"ui-slider__progress",style:c.normalizeStyle(v.value)},null,4)],512)]),_[5]||(_[5]=c.createTextVNode()),c.createElementVNode("div",sP,[n.breakpoints?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(c.unref(f),(O,M)=>(c.openBlock(),c.createElementBlock("div",{key:M,style:c.normalizeStyle({right:`${O}%`}),class:"ui-slider__thumb-step"},null,4))),128)):c.createCommentVNode("",!0),_[4]||(_[4]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"thumbRef",ref:y,tabindex:"0",class:"ui-slider__thumb ui-slider__thumb-active",style:c.normalizeStyle(S.value),onKeydown:I},_[3]||(_[3]=[c.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),_[7]||(_[7]=c.createTextVNode()),c.createElementVNode("div",nP,[n.mode==="input"?(c.openBlock(),c.createElementBlock("input",{key:0,value:d.value,class:"ui-slider__value text-s",onChange:_[0]||(_[0]=O=>T(O))},null,40,oP)):c.createCommentVNode("",!0)])],2),_[8]||(_[8]=c.createTextVNode()),h.value?(c.openBlock(),c.createElementBlock("div",rP,c.toDisplayString(h.value),1)):c.createCommentVNode("",!0)],2))}});function aP(e,t=null,i=null){function s(a){const{scrollTop:d,scrollHeight:h,clientHeight:g}=a;if(!(h>g)||!t)return null;const f=h-d-g,C=d>t?t:0,v=f>t?g-t-C:g;return`linear-gradient(
9
+ to bottom,
10
+ transparent,
11
+ black ${C}px,
12
+ black ${v}px,
13
+ transparent 100%
14
+ )`}function n(a){const{scrollLeft:d,scrollWidth:h,clientWidth:g}=a;if(!(h>g)||!i)return null;const f=h-d-g,C=d>i?i:0,v=f>i?g-i-C:g;return`linear-gradient(
15
+ to right,
16
+ transparent,
17
+ black ${C}px,
18
+ black ${v}px,
19
+ transparent 100%
20
+ )`}function o(){const a=e.value;if(!a)return;const d=[s(a),n(a)].filter(h=>h!==null);a.style.setProperty("-webkit-mask-image",d.join(",")),a.style.setProperty("mask-image",d.join(",")),d.length>1&&(a.style.setProperty("-webkit-mask-composite","source-in"),a.style.setProperty("mask-composite","source-in"))}const r=Fc(o);c.onMounted(o),st(window,"scroll",r,!0),st(window,"resize",r,!0)}function lg(e,t){Ip(()=>{dt(c.unref(e),i=>{Lp(i,()=>t(i))})}),c.onUnmounted(()=>{dt(c.unref(e),i=>{_p(i)})})}const Es={item:"sortable__item",animate:"sortable__animate"},jo=e=>e.getBoundingClientRect().y,ag=e=>{const{y:t,height:i}=e.getBoundingClientRect();return t+Math.ceil(i/2)},cP=e=>{const{y:t,height:i}=e.getBoundingClientRect();return t+i};function dP(e,t){const i={item:void 0,options(){var v;return[...((v=e.value)==null?void 0:v.children)??[]]}},s=c.computed(()=>i.options()),n=t.shakeBuffer??10,o=t.reorderDelay??100;function r(v){const S=t.handle?this.querySelector(t.handle):null;S&&!S.contains(v.target)||(this.classList.remove(Es.animate),this.classList.add(Es.item),i.item={el:this,y:v.y,dy:0,orderChanged:!1})}function a(v){const S=i.options();return S.slice(0,S.indexOf(v))}function d(v){const S=i.options();return S.slice(S.indexOf(v)+1)}function h(v,S){const R=i.options().filter(x=>x!==S),y=R.indexOf(v);return R.splice(y,0,S),R}function g(v,S){const R=i.options().filter(x=>x!==S),y=R.indexOf(v);return R.splice(y+1,0,S),R}function f(v,S){v.dy=S-v.y,v.el.style.setProperty("transform",`translateY(${v.dy}px)`)}function C(v){var S;if(!i.item)return;const{el:R}=i.item;if(!R.isConnected){i.item=void 0;return}const y=v.map(_=>jo(_)),x=jo(R);(S=e.value)==null||S.replaceChildren(...v);const P=jo(R),T=v.map(_=>jo(_)),I=[];for(let _=0;_<T.length;_++){const O=v[_];if(O===i.item.el)continue;const M=T[_],A=y[_]-M;O.style.transform=`translateY(${A}px)`,I.push(O)}const V=P-x;i.item.y=i.item.y+V,i.item.dy=i.item.dy-V,i.item.orderChanged=!0,i.item.el.style.setProperty("transform",`translateY(${i.item.dy}px)`),I.forEach(_=>_.classList.remove(Es.animate)),requestAnimationFrame(function(){I.forEach(_=>{_.classList.add(Es.animate),_.style.transform="",_.addEventListener("transitionend",()=>{_.classList.remove(Es.animate)})})})}st(window,"mousemove",v=>{if(!i.item)return;const{el:S}=i.item;f(i.item,v.y);const R=jo(i.item.el),y=cP(i.item.el),x=a(S),P=d(S);x.forEach(T=>{const I=ag(T);R+n<I&&C(h(T,S))}),P.forEach(T=>{const I=ag(T);y-n>I&&C(g(T,S))})}),st(window,"mouseup",()=>{if(!i.item)return;const{el:v,orderChanged:S}=i.item;v.classList.add(Es.animate),v.style.removeProperty("transform"),v.addEventListener("transitionend",()=>{v.classList.remove(Es.animate,Es.item)}),setTimeout(()=>{if(!S)return;const R=i.options().map(x=>Number(x.getAttribute("data-index"))),y=e.value;if(y){for(const x of i.options())y.removeChild(x);s.value.forEach(x=>{y.appendChild(x)})}t.onChange(R)},o),i.item=void 0}),c.watchEffect(()=>{s.value.forEach((v,S)=>{v.removeEventListener("mousedown",r),v.addEventListener("mousedown",r),v.setAttribute("data-index",String(S))})})}function uP(e,t){let i;c.onMounted(()=>{i=setInterval(e,t)}),c.onUnmounted(()=>clearInterval(i))}function hP(e,t,i){const s=c.reactive({data:wc.deepClone(t(e.value)),changed:!1});return c.watch(()=>s.data,n=>{s.changed?i(wc.deepClone(n)):s.changed=!0},{deep:!0}),c.watch(e,n=>{Object.assign(s,{data:wc.deepClone(t(n)),changed:!1})},{deep:!0,immediate:!0}),s}function pP(e){const t=c.reactive({isLoading:!1,result:void 0,error:void 0,async run(...i){this.isLoading=!0,this.error=void 0;try{this.result=await e(...i)}catch(s){this.error=s}finally{this.isLoading=!1}},debounce(i,s=1e3){return pp(()=>{const n=i();this.run(...n).catch(console.error)},s)}});return t.run=t.run.bind(t),t}function gP(e,t){function i(r,a){const d=c.unref(e);if(!d)return;const h=`translate(${a.x-r.x}px, ${a.y-r.y}px)`;d.style.setProperty("transform",h),t(a)}function s(r){const a=d=>i(r,d);document.addEventListener("mousemove",a),document.addEventListener("mouseup",()=>{const d=c.unref(e);document.removeEventListener("mousemove",a),d&&(d.style.setProperty("transition","all .3s ease-in-out"),d.style.removeProperty("transform"),d.addEventListener("transitionend",()=>{d.style.removeProperty("transition")}))},{once:!0})}function n(){var r;(r=c.unref(e))==null||r.addEventListener("mousedown",s)}function o(){var r;(r=c.unref(e))==null||r.removeEventListener("mousedown",s)}c.onMounted(n),c.onUnmounted(o)}const fP={class:"ui-slider__wrapper"},mP={class:"ui-slider__label-section"},CP={key:0,class:"text-s"},vP={class:"ui-slider__base"},wP={class:"ui-slider__container"},SP={class:"ui-slider__container ui-slider__container-thumb"},yP=["data-percent"],bP=["data-percent"],RP=["data-percent"],FP={key:0,class:"ui-slider__error"},xP=c.defineComponent({__name:"SliderRangeTriple",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:"%"},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const i=c.useSlots(),s=t,n=e,o=c.reactive({deltaValue1:0,deltaValue2:0,deltaValue3:0}),r=c.ref(),a=c.ref(),d=c.ref(),h=c.ref(),g=c.computed(()=>n.max-n.min),f=c.computed(()=>n),C=Zc(f),v=c.computed(()=>vt((n.modelValue[0]??0)+o.deltaValue1,n.min,n.max)),S=c.computed(()=>vt((n.modelValue[1]??0)+o.deltaValue2,n.min,n.max)),R=c.computed(()=>vt((n.modelValue[2]??0)+o.deltaValue3,n.min,n.max)),y=c.computed(()=>{const ae=n.modelValue;if(!(Array.isArray(ae)&&ae.length===3&&ae.every(Ee=>Number.isFinite(Ee))))return"Expected model [number, number, number]";const ee=[];return[...n.modelValue].forEach(Ee=>{Ee>n.max&&ee.push(`Max model value must be lower than max props ${n.max}.`),Ee<n.min&&ee.push("Min model value must be greater than max props.")}),ee.length>0?ee.join(" "):n.error}),x=c.computed(()=>(v.value-n.min)/g.value),P=c.computed(()=>(S.value-n.min)/g.value),T=c.computed(()=>(R.value-n.min)/g.value),I=c.computed(()=>z()),V=c.computed(()=>({right:I.value[0]+"%",left:100-I.value[2]+"%"})),_=c.computed(()=>({right:Math.ceil((1-x.value)*100)+"%"})),O=c.computed(()=>({right:Math.ceil((1-P.value)*100)+"%"})),M=c.computed(()=>({right:Math.ceil((1-T.value)*100)+"%"}));ws(a,ae=>{var ee;dt((ee=c.unref(r))==null?void 0:ee.getBoundingClientRect(),Ee=>{const{dx:_e}=ae;o.deltaValue1=_e/Ee.width*g.value,a.value&&A(a.value,n.modelValue[0],o.deltaValue1),ae.stop&&(Z([H(v.value),H(S.value),H(R.value)]),o.deltaValue1=0)})}),ws(d,ae=>{var ee;dt((ee=c.unref(r))==null?void 0:ee.getBoundingClientRect(),Ee=>{const{dx:_e}=ae;o.deltaValue2=_e/Ee.width*g.value,d.value&&A(d.value,n.modelValue[1],o.deltaValue2),ae.stop&&(Z([H(v.value),H(S.value),H(R.value)]),o.deltaValue2=0)})}),ws(h,ae=>{var ee;dt((ee=c.unref(r))==null?void 0:ee.getBoundingClientRect(),Ee=>{const{dx:_e}=ae;o.deltaValue3=_e/Ee.width*g.value,h.value&&A(h.value,n.modelValue[2],o.deltaValue3),ae.stop&&(Z([H(v.value),H(S.value),H(R.value)]),o.deltaValue3=0)})});function A(ae,ee,Ee){const _e=H(vt((ee??0)+Ee,n.min,n.max));ae.dataset.percent=`${_e}${n.measure}`,ie()}function z(){const ae=Math.ceil((1-x.value)*100),ee=Math.ceil((1-P.value)*100),Ee=Math.ceil((1-T.value)*100);return[ae,ee,Ee].sort((_e,wn)=>_e-wn)}function H(ae){const ee=vt(ae,n.min,n.max);return Math.round((ee+Number.EPSILON)*(1/n.step))/(1/n.step)}function Z(ae){s("update:modelValue",ae)}function ie(){const ae=Number(_.value.right.substring(0,_.value.right.length-1)),ee=Number(O.value.right.substring(0,O.value.right.length-1)),Ee=Number(M.value.right.substring(0,M.value.right.length-1)),_e=[{r:ae,th:a},{r:ee,th:d},{r:Ee,th:h}].sort((wn,Ws)=>wn.r-Ws.r);_e[0].th.value&&(_e[0].th.value.dataset.hint="high"),_e[1].th.value&&(_e[1].th.value.dataset.hint="mid"),_e[2].th.value&&(_e[2].th.value.dataset.hint="low")}function pe(ae,ee){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(ae.code)&&ae.preventDefault();const Ee=ae.code==="ArrowUp"||ae.code==="ArrowRight"?n.step*1:ae.code==="ArrowDown"||ae.code==="ArrowLeft"?n.step*-1:0,_e=[...n.modelValue];_e[ee]=vt(_e[ee]+Ee,n.min,n.max),Z(_e),ie()}return c.onMounted(()=>{ie()}),(ae,ee)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([n.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope ui-slider__triple"])},[c.createElementVNode("div",{class:c.normalizeClass([`ui-slider__mode-${n.mode}`,"ui-slider"])},[c.createElementVNode("div",fP,[c.createElementVNode("div",mP,[ae.label?(c.openBlock(),c.createElementBlock("label",CP,[c.createElementVNode("span",null,c.toDisplayString(ae.label),1),ee[3]||(ee[3]=c.createTextVNode()),c.unref(i).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:0,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(ae.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0)]),ee[11]||(ee[11]=c.createTextVNode()),c.createElementVNode("div",vP,[c.createElementVNode("div",wP,[c.createElementVNode("div",{ref_key:"barRef",ref:r,class:"ui-slider__bar"},[c.createElementVNode("div",{class:"ui-slider__progress",style:c.normalizeStyle(V.value)},null,4)],512)]),ee[10]||(ee[10]=c.createTextVNode()),c.createElementVNode("div",SP,[n.breakpoints?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(c.unref(C),(Ee,_e)=>(c.openBlock(),c.createElementBlock("div",{key:_e,style:c.normalizeStyle({right:`${Ee}%`}),class:"ui-slider__thumb-step"},null,4))),128)):c.createCommentVNode("",!0),ee[7]||(ee[7]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"thumbRef1",ref:a,style:c.normalizeStyle(_.value),"data-percent":n.modelValue[0]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r1:"",tabindex:"0",onKeydown:ee[0]||(ee[0]=Ee=>pe(Ee,0))},ee[4]||(ee[4]=[c.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,yP),ee[8]||(ee[8]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"thumbRef2",ref:d,style:c.normalizeStyle(O.value),"data-percent":n.modelValue[1]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r2:"",tabindex:"0",onKeydown:ee[1]||(ee[1]=Ee=>pe(Ee,1))},ee[5]||(ee[5]=[c.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,bP),ee[9]||(ee[9]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"thumbRef3",ref:h,style:c.normalizeStyle(M.value),"data-percent":n.modelValue[2]+"%",class:"ui-slider__thumb ui-slider__triple-thumb",r3:"",tabindex:"0",onKeydown:ee[2]||(ee[2]=Ee=>pe(Ee,2))},ee[6]||(ee[6]=[c.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),44,RP)])])]),ee[12]||(ee[12]=c.createTextVNode()),ee[13]||(ee[13]=c.createElementVNode("div",{class:"ui-slider__input-wrapper d-flex"},null,-1))],2),ee[14]||(ee[14]=c.createTextVNode()),y.value?(c.openBlock(),c.createElementBlock("div",FP,c.toDisplayString(y.value),1)):c.createCommentVNode("",!0)],2))}}),EP={class:"ui-input-range__separator"},PP=c.defineComponent({__name:"InputRange",props:{modelValue:{},separator:{default:"-"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const i=e,s=t,n=c.reactive({left:i.modelValue[0],right:i.modelValue[1]}),o=c.ref(!1),r=c.computed(()=>(o.value,"ui-input-range-focused")),a=c.computed({get(){return{left:Math.min(...i.modelValue),right:Math.max(...i.modelValue)}},set(){}});c.watch(()=>a.value,g=>(n.left=g.left)&&(n.right=g.right));function d(){s("update:modelValue",[+n.left,+n.right]),s("change",[+n.left,+n.right])}function h(g,f){const C=f.target.value;/^[0-9]{0,2}$/.test(C)?g?n.left=+C:n.right=+C:g?n.left=+C.slice(0,C.length-1):n.right=+C.slice(0,C.length-1)}return(g,f)=>(c.openBlock(),c.createElementBlock("div",c.mergeProps({class:[r.value,"ui-input-range"]},g.$attrs),[c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=C=>a.value.left=C),class:"text-s",type:"text",onChange:d,onFocus:f[1]||(f[1]=C=>o.value=!0),onFocusout:f[2]||(f[2]=C=>o.value=!1),onInput:f[3]||(f[3]=C=>h(!0,C))},null,544),[[c.vModelText,a.value.left]]),f[8]||(f[8]=c.createTextVNode()),c.createElementVNode("div",EP,c.toDisplayString(i.separator),1),f[9]||(f[9]=c.createTextVNode()),c.withDirectives(c.createElementVNode("input",{"onUpdate:modelValue":f[4]||(f[4]=C=>a.value.right=C),class:"text-s",type:"text",onChange:d,onFocus:f[5]||(f[5]=C=>o.value=!0),onFocusout:f[6]||(f[6]=C=>o.value=!1),onInput:f[7]||(f[7]=C=>h(!1,C))},null,544),[[c.vModelText,a.value.right]])],16))}}),DP={class:"ui-slider__wrapper"},TP={class:"ui-slider__label-section"},AP={key:0,class:"text-s"},MP={key:1,class:"ui-slider__value-static text-s"},kP={class:"ui-slider__base"},IP={class:"ui-slider__container"},LP={class:"ui-slider__container ui-slider__container-thumb"},_P={class:"ui-slider__input-wrapper d-flex"},OP={key:0,class:"ui-slider__error"},VP=c.defineComponent({__name:"SliderRange",props:{modelValue:{},min:{default:0},max:{},step:{default:1},label:{default:void 0},helper:{default:void 0},error:{default:void 0},mode:{default:"text"},measure:{default:""},breakpoints:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const i=c.useSlots(),s=t,n=e,o=c.reactive({deltaValue1:0,deltaValue2:0}),r=c.ref(),a=c.ref(),d=c.ref(),h=c.ref(n.modelValue),g=c.ref(n.modelValue[0]),f=c.ref(n.modelValue[1]),C=c.computed(()=>n),v=Zc(C),S=c.computed(()=>[g.value,f.value].sort((ie,pe)=>ie-pe).join("-")),R=c.computed(()=>n.max-n.min),y=c.computed(()=>vt((n.modelValue[0]??0)+o.deltaValue1,n.min,n.max)),x=c.computed(()=>vt((n.modelValue[1]??0)+o.deltaValue2,n.min,n.max)),P=c.computed(()=>{const ie=n.modelValue;return Array.isArray(ie)&&ie.length===2&&ie.every(pe=>Number.isFinite(pe))?n.error:"Expected model [number, number]"}),T=c.computed(()=>(y.value-n.min)/R.value),I=c.computed(()=>(x.value-n.min)/R.value),V=c.computed(()=>A()),_=c.computed(()=>({right:V.value[0]+"%",left:100-V.value[1]+"%"})),O=c.computed(()=>({right:Math.ceil((1-T.value)*100)+"%"})),M=c.computed(()=>({right:Math.ceil((1-I.value)*100)+"%"}));c.watch(()=>n.modelValue,ie=>{h.value=ie,g.value=+ie[0],f.value=+ie[1]},{immediate:!0}),ws(a,ie=>{var pe;dt((pe=c.unref(r))==null?void 0:pe.getBoundingClientRect(),ae=>{const{dx:ee}=ie;o.deltaValue1=ee/ae.width*R.value,g.value=z(vt((n.modelValue[0]??0)+o.deltaValue1,n.min,n.max)),h.value=[g.value,f.value].sort((Ee,_e)=>Ee-_e),ie.stop&&(H([z(y.value),z(x.value)]),o.deltaValue1=0)})}),ws(d,ie=>{var pe;dt((pe=c.unref(r))==null?void 0:pe.getBoundingClientRect(),ae=>{const{dx:ee}=ie;o.deltaValue2=ee/ae.width*R.value,f.value=z(vt((n.modelValue[1]??0)+o.deltaValue2,n.min,n.max)),h.value=[g.value,f.value].sort((Ee,_e)=>Ee-_e),ie.stop&&(H([z(y.value),z(x.value)]),o.deltaValue2=0)})});function A(){const ie=Math.ceil((1-T.value)*100),pe=Math.ceil((1-I.value)*100);return[ie,pe].sort((ae,ee)=>ae-ee)}function z(ie){const pe=vt(ie,n.min,n.max);return Math.round((pe+Number.EPSILON)*(1/n.step))/(1/n.step)}function H(ie){s("update:modelValue",ie)}function Z(ie,pe){["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(ie.code)&&ie.preventDefault();const ae=ie.code==="ArrowUp"||ie.code==="ArrowRight"?n.step*1:ie.code==="ArrowDown"||ie.code==="ArrowLeft"?n.step*-1:0,ee=[...n.modelValue];ee[pe]=vt(ee[pe]+ae,n.min,n.max),H(ee)}return(ie,pe)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([n.disabled?"ui-slider__disabled":void 0,"ui-slider__envelope"])},[c.createElementVNode("div",{class:c.normalizeClass([`ui-slider__mode-${n.mode}`,"ui-slider"])},[c.createElementVNode("div",DP,[c.createElementVNode("div",TP,[ie.label?(c.openBlock(),c.createElementBlock("label",AP,[c.createElementVNode("span",null,c.toDisplayString(ie.label),1),pe[3]||(pe[3]=c.createTextVNode()),c.unref(i).tooltip?(c.openBlock(),c.createBlock(c.unref(ii),{key:0,class:"info",position:"top"},{tooltip:c.withCtx(()=>[c.renderSlot(ie.$slots,"tooltip")]),_:3})):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),pe[4]||(pe[4]=c.createTextVNode()),n.mode==="text"?(c.openBlock(),c.createElementBlock("div",MP,c.toDisplayString(S.value),1)):c.createCommentVNode("",!0)]),pe[10]||(pe[10]=c.createTextVNode()),c.createElementVNode("div",kP,[c.createElementVNode("div",IP,[c.createElementVNode("div",{ref_key:"barRef",ref:r,class:"ui-slider__bar"},[c.createElementVNode("div",{class:"ui-slider__progress",style:c.normalizeStyle(_.value)},null,4)],512)]),pe[9]||(pe[9]=c.createTextVNode()),c.createElementVNode("div",LP,[n.breakpoints?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(c.unref(v),(ae,ee)=>(c.openBlock(),c.createElementBlock("div",{key:ee,style:c.normalizeStyle({right:`${ae}%`}),class:"ui-slider__thumb-step"},null,4))),128)):c.createCommentVNode("",!0),pe[7]||(pe[7]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"thumbRef1",ref:a,style:c.normalizeStyle(O.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:pe[0]||(pe[0]=ae=>Z(ae,0))},pe[5]||(pe[5]=[c.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36),pe[8]||(pe[8]=c.createTextVNode()),c.createElementVNode("div",{ref_key:"thumbRef2",ref:d,style:c.normalizeStyle(M.value),class:"ui-slider__thumb",tabindex:"0",onKeydown:pe[1]||(pe[1]=ae=>Z(ae,1))},pe[6]||(pe[6]=[c.createElementVNode("div",{class:"ui-slider__thumb-focused-contour"},null,-1)]),36)])])]),pe[11]||(pe[11]=c.createTextVNode()),c.createElementVNode("div",_P,[n.mode==="input"?(c.openBlock(),c.createBlock(PP,{key:0,modelValue:h.value,"onUpdate:modelValue":pe[2]||(pe[2]=ae=>h.value=ae),class:"ui-focused-border",onChange:H},null,8,["modelValue"])):c.createCommentVNode("",!0)])],2),pe[12]||(pe[12]=c.createTextVNode()),P.value?(c.openBlock(),c.createElementBlock("div",OP,c.toDisplayString(P.value),1)):c.createCommentVNode("",!0)],2))}}),NP=c.defineComponent({__name:"VScroll",props:{scrollTop:{},clientHeight:{},scrollHeight:{}},emits:["update:scrollTop"],setup(e,{emit:t}){const i=t,s=e,n=c.ref(),o=c.computed(()=>s.clientHeight/(s.scrollHeight||1)),r=c.computed(()=>o.value<1),a=c.computed(()=>{const d=c.unref(o);return{top:s.scrollTop*d+"px",height:Math.floor(s.clientHeight*d)+"px"}});return st(n,"pointerdown",d=>{const h={clientY:d.clientY},g=Nc(document,"mousemove",f=>{const C=(f.clientY-h.clientY)/o.value;i("update:scrollTop",s.scrollTop+C),h.clientY=f.clientY});["mouseup","pointercancel"].forEach(f=>{document.addEventListener(f,g,{once:!0})})}),(d,h)=>r.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:n,class:"v-scroll"},[c.createElementVNode("div",{class:"v-scroll__scrollbar",style:c.normalizeStyle(a.value)},null,4)],512)):c.createCommentVNode("",!0)}}),BP=c.defineComponent({__name:"HScroll",props:{scrollLeft:{},clientWidth:{},scrollWidth:{}},emits:["update:scrollLeft"],setup(e,{emit:t}){const i=t,s=e,n=c.ref(),o=c.computed(()=>s.clientWidth/(s.scrollWidth||1)),r=c.computed(()=>o.value<1),a=c.computed(()=>{const d=c.unref(o);return{left:s.scrollLeft*d+"px",width:Math.floor(s.clientWidth*d)+"px"}});return st(n,"pointerdown",d=>{const h={clientX:d.clientX},g=Nc(document,"mousemove",f=>{const C=(f.clientX-h.clientX)/o.value;i("update:scrollLeft",s.scrollLeft+C),h.clientX=f.clientX});["mouseup","pointercancel"].forEach(f=>{document.addEventListener(f,g,{once:!0})})}),(d,h)=>r.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:n,class:"h-scroll"},[c.createElementVNode("div",{class:"h-scroll__scrollbar",style:c.normalizeStyle(a.value)},null,4)],512)):c.createCommentVNode("",!0)}}),GP={class:"ui-scrollable"},HP=c.defineComponent({__name:"Scrollable",setup(e){const t=c.ref(),i=c.reactive({scrollTop:0,scrollLeft:0,clientHeight:0,clientWidth:0,scrollHeight:0,scrollWidth:0});function s(a){mR(i,a,"scrollTop","scrollLeft","clientHeight","clientWidth","scrollHeight","scrollWidth")}const n=a=>{a.preventDefault();const d=a.currentTarget;d.scrollTop+=a.deltaY,d.scrollLeft+=a.deltaX,s(d)};function o(a){dt(c.unref(t),d=>{d.scrollTop=a,s(d)})}function r(a){dt(c.unref(t),d=>{d.scrollLeft=a,s(d)})}return lg(t,a=>{dt(a,d=>s(d))}),c.onMounted(()=>{dt(c.unref(t),a=>{s(a),a.addEventListener("wheel",n)})}),c.onUnmounted(()=>{dt(c.unref(t),a=>a.removeEventListener("wheel",n))}),(a,d)=>(c.openBlock(),c.createElementBlock("div",GP,[c.createElementVNode("div",{ref_key:"containerRef",ref:t,class:"ui-scrollable__container",onWheel:n},[c.renderSlot(a.$slots,"default")],544),d[2]||(d[2]=c.createTextVNode()),c.createVNode(NP,{"scroll-top":i.scrollTop,"client-height":i.clientHeight,"scroll-height":i.scrollHeight,onWheel:d[0]||(d[0]=c.withModifiers(()=>{},["stop"])),"onUpdate:scrollTop":o},null,8,["scroll-top","client-height","scroll-height"]),d[3]||(d[3]=c.createTextVNode()),c.createVNode(BP,{"scroll-left":i.scrollLeft,"client-width":i.clientWidth,"scroll-width":i.scrollWidth,onWheel:d[1]||(d[1]=c.withModifiers(()=>{},["stop"])),"onUpdate:scrollLeft":r},null,8,["scroll-left","client-width","scroll-width"])]))}}),WP="add.svg",zP="checkmark.svg",UP="clear.svg",$P="clipboard.svg",KP="close.svg",jP="comp.svg",ZP="compare.svg",qP="copy.svg",YP="edit.svg",QP="error.svg",XP="filter.svg",JP="help.svg",e0="info.svg",t0="link.svg",i0="loading.svg",s0="lock.svg",n0="maximize.svg",o0="minimize.svg",r0="minus.svg",l0="open.svg",a0="pause.svg",c0="play.svg",d0="required.svg",u0="restart.svg",h0="sort.svg",p0="sorter.svg",g0="stop.svg",f0="success.svg",m0="warning.svg",C0="zip.svg",v0={add:WP,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg","cell-type-num":"cell-type-num.svg","cell-type-txt":"cell-type-txt.svg",checkmark:zP,"chevron-down":"chevron-down.svg","chevron-first":"chevron-first.svg","chevron-last":"chevron-last.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-up":"chevron-up.svg",clear:UP,"clipboard-copied":"clipboard-copied.svg",clipboard:$P,close:KP,comp:jP,compare:ZP,copy:qP,"data-dimentions":"data-dimentions.svg",delete:"delete.svg","drag-dots":"drag-dots.svg",edit:YP,error:QP,export:"export.svg","filter-2":"filter-2.svg",filter:XP,help:JP,import:"import.svg",info:e0,"link-arrow":"link-arrow.svg",link:t0,loading:i0,lock:s0,maximize:n0,minimize:o0,minus:r0,"more-horizontal":"more-horizontal.svg",open:l0,pause:a0,play:c0,required:d0,restart:u0,sort:h0,sorter:p0,stop:g0,success:f0,warning:m0,"x-axis":"x-axis.svg","y-axis":"y-axis.svg",zip:C0},w0="add.svg",S0="annotate.svg",y0="annotation.svg",b0="area.svg",R0="axes.svg",F0="bar.svg",x0="bindot.svg",E0="boxplot.svg",P0="bubble.svg",D0="canvas.svg",T0="checkbox.svg",A0="checkmark.svg",M0="clipboard.svg",k0="close.svg",I0="code.svg",L0="color.svg",_0="columns.svg",O0="copy.svg",V0="cpu.svg",N0="dna.svg",B0="duplicate.svg",G0="edit.svg",H0="error.svg",W0="filter.svg",z0="generate.svg",U0="graph.svg",$0="heatmap.svg",K0="help.svg",j0="hide.svg",Z0="jitter.svg",q0="layers.svg",Y0="learn.svg",Q0="legend.svg",X0="line.svg",J0="linetype.svg",eD="link.svg",tD="loading.svg",iD="local.svg",sD="logout.svg",nD="menu.svg",oD="minus.svg",rD="pin.svg",lD="position.svg",aD="progress.svg",cD="publications.svg",dD="restart.svg",uD="reverse.svg",hD="rotation.svg",pD="save.svg",gD="search.svg",fD="show.svg",mD="sina.svg",CD="skatterplot.svg",vD="sort.svg",wD="statistics.svg",SD="stroke.svg",yD="success.svg",bD="table.svg",RD="template.svg",FD="venn.svg",xD="violin.svg",ED="warning.svg",PD="wetlab.svg",DD={"add-layer":"add-layer.svg",add:w0,annotate:S0,annotation:y0,area:b0,"arrow-down":"arrow-down.svg","arrow-left":"arrow-left.svg","arrow-right":"arrow-right.svg","arrow-up":"arrow-up.svg",axes:R0,"bar-error":"bar-error.svg","bar-trend":"bar-trend.svg",bar:F0,bindot:x0,"box-dot":"box-dot.svg","boxplot-1":"boxplot-1.svg","boxplot-binned":"boxplot-binned.svg","boxplot-jitter":"boxplot-jitter.svg","boxplot-notched":"boxplot-notched.svg",boxplot:E0,bubble:P0,canvas:D0,checkbox:T0,checkmark:A0,"chevron-down":"chevron-down.svg","chevron-left":"chevron-left.svg","chevron-right":"chevron-right.svg","chevron-sort":"chevron-sort.svg","chevron-up":"chevron-up.svg","clipboard-copied":"clipboard-copied.svg",clipboard:M0,close:k0,"cloud-down":"cloud-down.svg","cloud-offline":"cloud-offline.svg","cloud-online":"cloud-online.svg","cloud-up":"cloud-up.svg","code-2":"code-2.svg",code:I0,color:L0,columns:_0,"connected-points":"connected-points.svg",copy:O0,cpu:V0,"cross-bars":"cross-bars.svg","dark-mode":"dark-mode.svg",delete:"delete.svg","dendrogram-X-1":"dendrogram-X-1.svg","dendrogram-X":"dendrogram-X.svg","dendrogram-Y-1":"dendrogram-Y-1.svg","dendrogram-Y":"dendrogram-Y.svg",dna:N0,"download-files":"download-files.svg",duplicate:B0,edit:G0,"error-bar":"error-bar.svg",error:H0,"expand-left":"expand-left.svg","expand-right":"expand-right.svg","export-2":"export-2.svg",export:"export.svg","external-link":"external-link.svg","fill-color":"fill-color.svg","filter-on":"filter-on.svg",filter:W0,"filters-gate":"filters-gate.svg","fire-tips":"fire-tips.svg","folder-parent":"folder-parent.svg","frame-type":"frame-type.svg",generate:z0,graph:U0,heatmap:$0,help:K0,hide:j0,"import-2":"import-2.svg","import-download":"import-download.svg","info-circle-outline":"info-circle-outline.svg",jitter:Z0,layers:q0,learn:Y0,legend:Q0,"light-mode":"light-mode.svg","line-binned":"line-binned.svg","line-error":"line-error.svg","line-jitter":"line-jitter.svg",line:X0,linetype:J0,link:eD,loading:tD,local:iD,logout:sD,menu:nD,minus:oD,"more-horizontal":"more-horizontal.svg","outlier-shape":"outlier-shape.svg","paper-clip":"paper-clip.svg",pin:rD,position:lD,"progress-2":"progress-2.svg",progress:aD,publications:cD,"radio-btn":"radio-btn.svg",restart:dD,reverse:uD,rotation:hD,save:pD,search:gD,"server-2":"server-2.svg","settings-2":"settings-2.svg",show:fD,sina:mD,skatterplot:CD,"social-media":"social-media.svg",sort:vD,"stacked-bar":"stacked-bar.svg",statistics:wD,"strip-plot":"strip-plot.svg","stroke-non":"stroke-non.svg",stroke:SD,success:yD,"table-upload":"table-upload.svg",table:bD,template:RD,"title-position":"title-position.svg","upload-files":"upload-files.svg",venn:FD,"violin-binned":"violin-binned.svg","violin-jitter":"violin-jitter.svg",violin:xD,warning:ED,wetlab:PD,"zoom-in":"zoom-in.svg"};function TD(){return{txtSec:{title:"Text",data:{"--txt-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Text on the colored elements"},"--txt-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary text layer"},"--txt-02":{light:[!0,!1],value:["#231842","#ADAEB8"],description:"Secondary text layer - large arrays of text"},"--txt-03":{light:[!0,!0],value:["#9D9EAE","#60616B"],description:"Tetritary text layer - hints and descriptions"},"--txt-mask":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Text mask in inputs, icons, etc."},"--txt-focus":{light:[!0,!0],value:["#07AD3E","#87E087"],description:"Colored text in active/focus elements"},"--txt-error":{light:[!0,!0],value:["#F1222F","#FF5C5C"],description:"Colored text in error elements"},"--txt-link":{light:[!0,!0],value:["#5F31CC","#9470FF"],description:"Colored text in links"}}},iconSec:{title:"Icon",data:{"--ic-00":{light:[!1,!1],value:["#FFFFFF","#FFFFFF"],description:"Icons on colored elements"},"--ic-01":{light:[!0,!1],value:["#110529","#FFFFFF"],description:"Primary elements"},"--ic-02":{light:[!1,!0],value:["#CFD1DB","#60616B"],description:"Secondary & tetritary elements"},"--ic-accent":{light:[!0,!1],value:["#07AD3E","#87E087"],description:"Focus/active elements"}}},borderSec:{title:"Border",data:{"--border-color-default":{light:[!0,!0],value:["#110529","#60616B"],description:"Main border for components"},"--border-color-hover":{light:[!0,!0],value:["#231842","#ADAEB8"],description:"Hover on main border"},"--border-color-focus":{light:[!1,!1],value:["#49CC49","#49CC49"],description:"Active border for components"},"--border-color-error":{light:[!1,!1],value:["#FF5C5C","#FF5C5C"],description:"Error border for components"},"--border-color-div-grey":{light:[!1,!0],value:["#E1E3EB","#232329"],description:"Divider lines low contrast"},"--border-color-div-bw":{light:[!1,!0],value:["#FFFFFF","#000000"],description:"Divider lines hight contrast"}}},btnSec:{title:"Button",data:{"--btn-accent-default":{light:[!0,!0],value:["#845CFF"," #5F31CC"],description:"Accent coloured button"},"--btn-accent-hover":{light:[!0,!0],value:["#9470FF"," #5F31CC"],description:"Hover on accent coloured button"},"--btn-accent-press":{light:[!0,!0],value:["#6F4DD6","#5F31CC"],description:"Pressed on accent coloured button"},"--btn-primary-default":{light:[!0,!0],value:["#110529","#5F31CC"],description:"Primary button"},"--btn-primary-hover":{light:[!0,!0],value:["#231842","#6D3DDB"],description:"Hover on primary button"},"--btn-primary-press":{light:[!0,!0],value:["#080214","#5328B8"],description:"Hover on primary button"},"--btn-sec-hover-white":{light:[!1,!0],value:["rgba(255, 255, 255, 0.50)","rgba(131, 131, 163, 0.16)"],description:"Hover background on transparent button"},"--btn-sec-hover-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.16)","rgba(131, 131, 163, 0.16)"],description:"Hover background on ghost button & icons"},"--btn-sec-press-grey":{light:[!1,!0],value:["rgba(155, 171, 204, 0.24)","rgba(131, 131, 163, 0.24)"],description:"Hover background on ghost button & icons"},"--btn-active-select":{light:[!1,!0],value:["rgba(99, 224, 36, 0.24)","rgba(99, 224, 36, 0.24)"],description:"Fill on selected elements"},"--btn-switcher":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","#5E5E70"],description:"Gradient on active controll/switcher element"}}},disSec:{title:"Disable",data:{"--dis-00":{light:[!1,!0],value:["#FFFFFF","#65656B"],description:"Elements on dis-01, labels, texts, icons"},"--dis-01":{light:[!1,!0],value:["#CFD1DB","#3D3D42"],description:"Buttons, borders, labels, texts, icons"}}},bgSec:{title:"Background",data:{"--bg-base-dark":{light:[!0,!0],value:["#110529","#0D0D0F"],description:"Default dark block background"},"--bg-base-light":{light:[!1,!0],value:["#F7F8FA","#0D0D0F"],description:"Default light block background"},"--bg-elevated-01":{light:[!1,!0],value:["#FFFFFF","#1B1B1F"],description:"Default block background"},"--bg-elevated-02":{light:[!1,!0],value:["#E1E3EB","#2D2D33"],description:"Secondary block background"}}},filledSec:{title:"Filled",data:{"--filled-V-BG":{light:[!1,!0],value:["#D0F0C0","rgba(66, 184, 66, 0.40)"],description:"Text background selection on V-read"},"--filled-D-BG":{light:[!1,!0],value:["#FFCECC","rgba(229, 83, 229, 0.40)"],description:"Text background selection on D-read"},"--filled-N-BG":{light:[!1,!0],value:["#FAF5AA","rgba(83, 82, 102, 0.40)"],description:"Text background selection on C/N-read"},"--filled-J-BG":{light:[!1,!0],value:["#DEDBFF","rgba(132, 92, 255, 0.40)"],description:"Text background selection on J-read"}}},notificationSec:{title:"Notification",data:{"--notification-neutral":{light:[!1,!0],value:["linear-gradient(90deg, #D6D9FF 0%, #FFF 100%)","linear-gradient(90deg, #4D4D8F 0%, #292933 100%)"],description:"Background on neutral blocks"},"--notification-success":{light:[!1,!0],value:["linear-gradient(90deg, #C9F0B6 0%, #FFF 100%)","linear-gradient(90deg, #305C3E 0%, #292933 100%)"],description:"Background on success blocks"},"--notification-warning":{light:[!1,!0],value:["linear-gradient(90deg, #FEE0A3 0%, #FFF 100%)","linear-gradient(90deg, #754F2D 0%, #292933 100%)"],description:"Background on warning blocks"},"--notification-error":{light:[!1,!0],value:["linear-gradient(90deg, #FFB8B8 0%, #FFF 100%)","linear-gradient(90deg, #8F3343 0%, #292933 100%)"],description:"Background on error blocks"}}},gradientSec:{title:"Gradient",data:{"--gradient-blue-green":{light:[!0,!0],value:["linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand dark gradient"},"--gradient-green-lime":{light:[!1,!0],value:["linear-gradient(180deg, #A1E59C 0%, #D0F5B0 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-violet":{light:[!1,!0],value:["linear-gradient(180deg, #ADB8FF 0%, #D6E9FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Main brand light gradient"},"--gradient-blue-clear":{light:[!1,!0],value:["linear-gradient(180deg, #85BEFF 0%, #CEF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-orange":{light:[!1,!0],value:["linear-gradient(180deg, #FFB766 0%, #FFEAA3 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-mint":{light:[!1,!0],value:["linear-gradient(180deg, #7DD1D1 0%, #C8FAE9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-lime":{light:[!1,!0],value:["linear-gradient(180deg, #BFE062 0%, #E4FFAD 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-rose":{light:[!1,!0],value:["linear-gradient(0deg, #FFDDD6 0%, #FF99C9 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-red":{light:[!1,!0],value:["linear-gradient(0deg, #FFD5CC 0%, #FF9494 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"},"--gradient-violet":{light:[!1,!0],value:["linear-gradient(180deg, #BCA3FF 0%, #E5E5FF 100%)","linear-gradient(0deg, #478063 0%, #2E4652 45.93%, #24223D 91.63%)"],description:"Additional brand gradient"}}}}}const AD=["checkmark","import","clear","chevron-right","add","play","loading","arrow-right","clipboard","link","comp","close","restart","stop"],MD=["paper-clip","cloud-up","success","restart","close"],kD={allCssVariables:TD(),icons16:v0,icons24:DD},ID={class:"block__not-found"},LD=c.defineComponent({__name:"NotFound",setup(e){const i=pc().useApp(),s=()=>{i.updateNavigationState(n=>{n.href="/"})};return(n,o)=>(c.openBlock(),c.createElementBlock("div",ID,[c.createElementVNode("h1",null,"Not found route: "+c.toDisplayString(c.unref(i).navigationState.href),1),c.createVNode(c.unref(Lc),{onClick:c.withModifiers(s,["stop"])},{default:c.withCtx(()=>o[0]||(o[0]=[c.createTextVNode("Return to main page")])),_:1})]))}}),qc=(e,t)=>{const i=e.__vccOpts||e;for(const[s,n]of t)i[s]=n;return i},_D={},OD={class:"block__loader-page"};function VD(e,t){return c.openBlock(),c.createElementBlock("div",OD,t[0]||(t[0]=[c.createElementVNode("div",{class:"loader-container"},[c.createElementVNode("i",{class:"mask-24 mask-loading loader-icon"})],-1)]))}const ND=qc(_D,[["render",VD]]),BD={class:"block block__layout"},GD={key:0},HD=c.defineComponent({__name:"BlockLayout",setup(e){const t=pc(),i=o=>{try{return new URL(o,"http://dummy").pathname}catch{console.error("Invalid href",o);return}},s=c.computed(()=>t.loaded?t.useApp().href:void 0),n=c.computed(()=>{if(t.loaded){const o=t.useApp(),r=i(o.navigationState.href);return r?o.routes[r]:void 0}});return(o,r)=>(c.openBlock(),c.createElementBlock("div",BD,[c.unref(t).error?(c.openBlock(),c.createElementBlock("div",GD,c.toDisplayString(c.unref(t).error),1)):c.unref(t).loaded?n.value?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.value),{key:s.value})):(c.openBlock(),c.createBlock(LD,{key:3})):(c.openBlock(),c.createBlock(ND,{key:1},{default:c.withCtx(()=>r[0]||(r[0]=[c.createTextVNode("Loading...")])),_:1}))]))}});var Gn=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let n=s.get(e);return!n&&i&&(n=new Set,s.set(e,n)),n}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),s.size===0&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){const t=e;this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const i=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const s=(a,d)=>a.forEach(h=>{if(!d.has(h))return;const g=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>h(e)):()=>h(e);t?this.dispatchAsync(g):g()}),n=this.getListeners(i,t,!1)??new Set,o=new Set(n);o.size>0&&s(o,n),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(a=>{const d=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>a(i,e)):()=>a(i,e);t?this.dispatchAsync(d):d()})}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}},ut=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(ut||{}),cg={};function Yc(e,t){cg[t]||(e(),cg[t]=!0)}function si(e,...t){console.log("AG Grid: "+e,...t)}function W(e,...t){Yc(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function Ve(e,...t){Yc(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function Qc(e){return!!(e&&e.constructor&&e.call&&e.apply)}function WD(e){zD(e,400)}var Xc=[],Jc=!1;function dg(e){Xc.push(e),!Jc&&(Jc=!0,window.setTimeout(()=>{const t=Xc.slice();Xc.length=0,Jc=!1,t.forEach(i=>i())},0))}function zD(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(i=>i()),t)}function Pt(e,t){let i;return function(...s){const n=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(n,s)},t)}}function ug(e,t){let i=0;return function(...s){const n=this,o=new Date().getTime();o-i<t||(i=o,e.apply(n,s))}}function UD(e,t,i=100,s){const n=new Date().getTime();let o=null,r=!1;const a=()=>{const d=new Date().getTime()-n>i;(e()||d)&&(t(),r=!0,o!=null&&(window.clearInterval(o),o=null),d&&s&&W(s))};a(),r||(o=window.setInterval(a,10))}function $D(...e){return t=>e.reduce((i,s)=>s(i),t)}function yi(e){return e==null||e===""?null:e}function j(e,t=!1){return e!=null&&(e!==""||t)}function ke(e){return!j(e)}function gt(e){return e==null||e.length===0}function bl(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function nn(e){if(e===void 0)return;if(e===null||e==="")return null;if(typeof e=="number")return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function ed(e){if(e!==void 0)return e===null||e===""?!1:td(e)}function td(e){return typeof e=="boolean"?e:typeof e=="string"?e.toUpperCase()==="TRUE"||e=="":!1}function Zo(e,t){const i=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return i===s}function KD(e,t,i=!1){const s=e==null,n=t==null;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&n)return 0;if(s)return-1;if(n)return 1;function o(r,a){return r>a?1:r<a?-1:0}if(typeof e!="string"||!i)return o(e,t);try{return e.localeCompare(t)}catch{return o(e,t)}}function Rl(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(i=>t.push(i)),t}return Object.values(e)}function hg(e,t){return e.get("rowModelType")===t}function Ye(e){return hg(e,"clientSide")}function Yi(e){return hg(e,"serverSide")}function ht(e,t){return e.get("domLayout")===t}function id(e){return Xo(e)!==void 0}function Fl(e){return!e.get("suppressAsyncEvents")}function pg(e){return typeof e.get("getRowHeight")=="function"}function jD(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function Ps(e,t,i=!1,s){if(s==null&&(s=e.environment.getDefaultRowHeight()),pg(e)){if(i)return{height:s,estimated:!0};const r={node:t,data:t.data},a=e.getCallback("getRowHeight")(r);if(sd(a))return a===0&&W("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,a),estimated:!1}}if(t.detail&&e.get("masterDetail"))return ZD(e);const n=e.get("rowHeight");return{height:n&&sd(n)?n:s,estimated:!1}}function ZD(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return sd(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function on(e){const{environment:t}=e,i=e.get("rowHeight");if(!i||ke(i))return t.getDefaultRowHeight();const s=t.refreshRowHeightVariable();return s!==-1?s:(W("row height must be a number if not using standard row model"),t.getDefaultRowHeight())}function sd(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function qo(e,t,i){const s=t[e.getDomDataKey()];return s?s[i]:void 0}function rn(e,t,i,s){const n=e.getDomDataKey();let o=t[n];ke(o)&&(o={},t[n]=o),o[i]=s}function Xe(e){let t=null;const i=e.get("getDocument");return i&&j(i)?t=i():e.eGridDiv&&(t=e.eGridDiv.ownerDocument),t&&j(t)?t:document}function gg(e){return Xe(e).defaultView||window}function Yo(e){return e.eGridDiv.getRootNode()}function Ke(e){return Yo(e).activeElement}function fg(e){const t=Xe(e),i=Ke(e);return i===null||i===t.body}function Hn(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function xl(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||ht(e,"print"))}function Vi(e){const t=e.get("autoGroupColumnDef");return!(t!=null&&t.comparator)&&!e.get("treeData")}function nd(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function mg(e){const t=e.get("grandTotalRow");if(t)return t;if(e.get("groupIncludeTotalFooter"))return"bottom"}function Cg(e){const t=e.get("groupTotalRow");if(typeof t=="function")return e.getCallback("groupTotalRow");if(t)return()=>t;const i=e.get("groupIncludeFooter");if(typeof i=="function"){const s=e.getCallback("groupIncludeFooter");return n=>s(n)?"bottom":void 0}return()=>i?"bottom":void 0}function vg(e){return e.exists("groupDisplayType")?e.get("groupDisplayType")==="multipleColumns":e.get("groupHideOpenParents")}function El(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function Wn(e){const t=e.getCallback("getRowId");return t===void 0?t:i=>{let s=t(i);return typeof s!="string"&&(W("The getRowId callback must return a string. The ID ",s," is being cast to a string."),s=String(s)),s}}function zn(e){return((e==null?void 0:e.mode)!=="cell"&&(e==null?void 0:e.checkboxes))??!0}function Pl(e){return(e==null?void 0:e.mode)==="multiRow"&&(e.headerCheckbox??!0)}function qD(e){return((e==null?void 0:e.mode)!=="cell"&&(e==null?void 0:e.hideDisabledCheckboxes))??!1}function od(e){return e.get("selection")!==void 0}function Qo(e){const t=e.get("selection");return t!==void 0?t.mode==="cell"?t.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function Ot(e){const t=e.get("selection");return t!==void 0?t.mode==="cell":e.get("enableRangeSelection")}function YD(e){var s;const t=e.get("selection");return t!==void 0?t.mode==="cell"?((s=t.handle)==null?void 0:s.mode)==="range":!1:e.get("enableRangeHandle")}function wg(e){var s;const t=e.get("selection");return t!==void 0?t.mode==="cell"?((s=t.handle)==null?void 0:s.mode)==="fill":!1:e.get("enableFillHandle")}function rd(e){var s;const t=e.get("selection");return t!==void 0?t.mode==="cell"&&((s=t.handle)==null?void 0:s.mode)==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function Sg(e){const t=e.get("selection");if(!(t!==void 0)){const s=e.get("suppressRowClickSelection"),n=e.get("suppressRowDeselection");return s&&n?!1:s?"enableDeselection":n?"enableSelection":!0}return(t==null?void 0:t.mode)!=="cell"?(t==null?void 0:t.enableClickSelection)??!1:!1}function QD(e){const t=Sg(e);return t===!0||t==="enableSelection"}function ld(e){const t=Sg(e);return t===!0||t==="enableDeselection"}function ad(e){const t=e.get("selection");return t!==void 0?t.mode!=="cell"?t.isRowSelectable:void 0:e.get("isRowSelectable")}function Xo(e){const t=e.get("selection");if(!(t!==void 0))switch(e.get("rowSelection")){case"multiple":return"multiRow";case"single":return"singleRow";default:return}return t.mode!=="cell"?t.mode:void 0}function cd(e){return Xo(e)==="multiRow"}function XD(e){const t=e.get("selection");return t!==void 0?t.mode==="multiRow"?t.enableMultiSelectWithClick??!1:!1:e.get("rowMultiSelectWithClick")}function dd(e){const t=e.get("selection");if(!(t!==void 0)){const s=e.get("groupSelectsChildren"),n=e.get("groupSelectsFiltered");return s&&n?"filteredDescendants":s?"descendants":"self"}return t.mode==="multiRow"?t.groupSelects:void 0}function ln(e){const t=dd(e);return t==="descendants"||t==="filteredDescendants"}function ud(e){return e.isModuleRegistered("@ag-grid-enterprise/set-filter")&&!e.get("suppressSetFilterByDefault")}function JD(e){return e!=null&&e.length>0}function ce(e){if(!(!e||!e.length))return e[e.length-1]}function Ni(e,t,i){return e==null&&t==null?!0:e!=null&&t!=null&&e.length===t.length&&e.every((s,n)=>i?i(s,t[n]):t[n]===s)}function eT(e,t){return Ni(e,t)}function tT(e){return e.sort((t,i)=>t-i)}function yg(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function wt(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function iT(e,t){for(let i=0;i<t.length;i++)yg(e,t[i])}function sT(e,t){for(let i=0;i<t.length;i++)wt(e,t[i])}function Dl(e,t,i){e.splice(i,0,t)}function bg(e,t,i){sT(e,t),t.slice().reverse().forEach(s=>Dl(e,s,i))}function Qi(e,t){return e.indexOf(t)>-1}function nT(e){return(e==null?void 0:e.flatMap(t=>t))??[]}function Rg(e,t){t==null||e==null||t.forEach(i=>e.push(i))}var Fg="__ag_Grid_Stop_Propagation",oT=["touchstart","touchend","touchmove","touchcancel","scroll"],hd={};function Un(e){e[Fg]=!0}function Xi(e){return e[Fg]===!0}var xg=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if(typeof hd[i]=="boolean")return hd[i];const s=document.createElement(e[i]||"div");return i="on"+i,hd[i]=i in s}})();function Tl(e,t,i){let s=t;for(;s;){const n=qo(e,s,i);if(n)return n;s=s.parentElement}return null}function rT(e,t){return!t||!e?!1:aT(t).indexOf(e)>=0}function lT(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function aT(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():lT(t)}function cT(e,t,i,s){const o=Qi(oT,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,o)}var B=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.frameworkOverrides=e.frameworkOverrides,this.stubContext=e.context,this.eventService=e.eventService,this.gos=e.gos,this.localeService=e.localeService}getFrameworkOverrides(){return this.frameworkOverrides}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t,i){this.localEventService||(this.localEventService=new Gn),this.localEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.localEventService&&this.localEventService.removeEventListener(e,t,i)}dispatchLocalEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventService,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const i=[];for(const s in t){const n=t[s];n&&i.push(this._setupListener(e,s,n))}return i}_setupListener(e,t,i){if(this.destroyed)return()=>null;e instanceof HTMLElement?cT(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(n=>n!==s),null)}setupGridOptionListener(e,t){this.gos.addPropertyEventListener(e,t);const i=()=>(this.gos.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=n=>{if(n.changeSet){if(n.changeSet&&n.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=n.changeSet.id}const o={type:"gridPropertyChanged",changeSet:n.changeSet,source:n.source};t(o)};e.forEach(n=>this.setupGridOptionListener(n,s))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.stubContext).createBean(e,i)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}};function Dt(e){return e instanceof Al}var Al=class extends B{constructor(e,t,i,s){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=Dg(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}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}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach(t=>{As(t)?e.push(t):Dt(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);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const s=this.findChildrenRemovingPadding();for(let o=0,r=s.length;o<r;o++){const a=s[o];if(!a.isVisible())continue;const d=a.getColumnGroupShow();d==="open"?(e=!0,i=!0):d==="closed"?(t=!0,i=!0):(e=!0,t=!0)}const n=e&&t&&i;this.expandable!==n&&(this.expandable=n,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(s=>{Dt(s)&&s.isPadding()?t(s.children):e.push(s)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},Eg="ag-Grid-ControlsColumn",dT=class extends B{constructor(){super(...arguments),this.beanName="controlsColService"}createControlsCols(){const e=this.gos.get("selection");if(!e)return[];if(e.mode==="cell")return[];const t=zn(e),i=Pl(e);if(t||i){const s=this.gos.get("selectionColumnDef"),o={maxWidth:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:this.gos.get("enableRtl")?"right":"left",comparator(a,d,h,g){const f=h.isSelected(),C=g.isSelected();return f&&C?0:f?1:-1},editable:!1,suppressFillHandle:!0,...s,colId:`${Eg}`},r=new wd(o,null,o.colId,!1);return this.createBean(r),[r]}return[]}},Ml="ag-Grid-AutoColumn";function pd(e){const t=[],i=s=>{for(let n=0;n<s.length;n++){const o=s[n];As(o)?t.push(o):Dt(o)&&i(o.getChildren())}};return i(e),t}function Ji(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}function Ds(e,t,i){const s={};if(!t)return;es(null,t,o=>{s[o.getInstanceId()]=o}),i&&es(null,i,o=>{s[o.getInstanceId()]=null});const n=Object.values(s).filter(o=>o!=null);e.destroyBeans(n)}function gd(e){return e.getId().startsWith(Ml)}function $n(e){return e.getColId().startsWith(Eg)}function kl(e){let t=[];return e instanceof Array?e.some(s=>typeof s!="string")?W("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:typeof e=="string"?t=e.split(","):W("colDef.type should be of type 'string' | 'string[]'"),t}var fd=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=i=>{this.frameworkOverrides.wrapOutgoing(()=>e(i))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(i,s)=>{this.frameworkOverrides.wrapOutgoing(()=>e(i,s))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){return this.wrappedListeners.get(e)??e}unwrapGlobal(e){return this.wrappedGlobalListeners.get(e)??e}},md=new Set(["__proto__","constructor","prototype"]);function ni(e,t){if(e!=null){if(Array.isArray(e)){for(let i=0;i<e.length;i++)t(i.toString(),e[i]);return}for(const[i,s]of Object.entries(e))t(i,s)}}function Pg(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){if(md.has(i[s]))continue;const n=i[s],o=e[n];t[n]=o}return t}function Cd(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(n=>{if(t&&t.indexOf(n)>=0||md.has(n))return;const o=i[n];vd(o)&&o.constructor===Object?s[n]=Cd(o):s[n]=o}),s}function Ts(e){if(!e)return[];const t=Object;if(typeof t.values=="function")return t.values(e);const i=[];for(const s in e)e.hasOwnProperty(s)&&e.propertyIsEnumerable(s)&&i.push(e[s]);return i}function Tt(e,t,i=!0,s=!1){j(t)&&ni(t,(n,o)=>{if(md.has(n))return;let r=e[n];r!==o&&(s&&r==null&&o!=null&&typeof o=="object"&&o.constructor===Object&&(r={},e[n]=r),vd(o)&&vd(r)&&!Array.isArray(r)?Tt(r,o,i,s):(i||o!==void 0)&&(e[n]=o))})}function Jo(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let n=e;for(let o=0;o<s.length;o++){if(n==null)return;n=n[s[o]]}return n}function vd(e){return typeof e=="object"&&e!==null}var uT={resizable:!0,sortable:!0},hT=0;function Dg(){return hT++}function As(e){return e instanceof wd}var wd=class extends B{constructor(e,t,i,s){super(),this.isColumn=!0,this.instanceId=Dg(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.columnEventService=new Gn,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}wireBeans(e){this.columnHoverService=e.columnHoverService}getInstanceId(){return this.instanceId}setState(e){e.sort!==void 0?(e.sort==="asc"||e.sort==="desc")&&(this.sort=e.sort):(e.initialSort==="asc"||e.initialSort==="desc")&&(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;t!==void 0?t!==null&&(this.sortIndex=t):i!==null&&(this.sortIndex=i);const s=e.hide,n=e.initialHide;s!==void 0?this.visible=!s:this.visible=!n,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const o=e.flex,r=e.initialFlex;o!==void 0?this.flex=o:r!==void 0&&(this.flex=r)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.columnEventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}postConstruct(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=j(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=j(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.gos.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=j(this.colDef.tooltipField)||j(this.colDef.tooltipValueGetter)||j(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const i=nn(e.width),s=nn(e.initialWidth);return i!=null?t=i:s!=null?t=s:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(ke(this.colDef)||ke(this.colDef.showRowGroup))return!1;const t=this.colDef.showRowGroup===!0,i=this.colDef.showRowGroup===e;return t||i}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){var s;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new fd(this.frameworkOverrides));const i=((s=this.frameworkEventListenerService)==null?void 0:s.wrap(t))??t;this.columnEventService.addEventListener(e,i)}removeEventListener(e,t){var s;const i=((s=this.frameworkEventListenerService)==null?void 0:s.unwrap(t))??t;this.columnEventService.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const t=this.createColumnFunctionCallbackParams(e),i=this.colDef.suppressNavigable;return i(t)}return!1}isCellEditable(e){if(e.group){if(this.gos.get("treeData")){if(!e.data&&!this.gos.get("enableGroupEdit"))return!1}else if(!this.gos.get("enableGroupEdit"))return!1}return this.isColumnFunc(e,this.colDef.editable)}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){const t=this.gos.get("selection");if(t){const i=$n(this)&&zn(t);return this.isColumnFunc(e,i)}else return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??uT[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const i=this.createColumnFunctionCallbackParams(e);return t(i)}return!1}setHighlighted(e){this.highlighted!==e&&(this.highlighted=e,this.columnEventService.dispatchEvent(this.createColumnEvent("headerHighlightChanged","uiColumnMoved")))}setMoving(e,t){this.moving=e,this.columnEventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.columnEventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return ke(this.sort)}isSorting(){return j(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.columnEventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}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.columnEventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&Tt(s,i),this.columnEventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){e===!0||e==="left"?this.pinned="left":e==="right"?this.pinned="right":this.pinned=null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const i=e===!0;this.visible!==i&&(this.visible=i,this.columnEventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}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 this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(ke(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(ke(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.columnEventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchStateUpdatedEvent(e){this.columnEventService.dispatchEvent({type:"columnStateUpdated",key:e})}},pT={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},gT=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=bl(e);let i=0;for(;;){let s;if(e?(s=e,i!==0&&(s+="_"+i)):t?(s=t,i!==0&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},fT=class extends B{constructor(){super(...arguments),this.beanName="columnFactory"}wireBeans(e){this.dataTypeService=e.dataTypeService}createColumnTree(e,t,i,s){const n=new gT,{existingCols:o,existingGroups:r,existingColKeys:a}=this.extractExistingTreeData(i);n.addExistingKeys(a);const d=this.recursivelyCreateColumns(e,0,t,o,n,r,s),h=this.findMaxDept(d,0),g=this.balanceColumnTree(d,0,h,n);return es(null,g,(C,v)=>{Dt(C)&&C.setupExpandable(),C.setOriginalParent(v)}),{columnTree:g,treeDept:h}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&es(null,e,n=>{if(Dt(n)){const o=n;i.push(o)}else{const o=n;s.push(o.getId()),t.push(o)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}balanceTreeForAutoCols(e,t){const i=[],s=this.findDepth(t);return e.forEach(n=>{let o=n;for(let r=s-1;r>=0;r--){const a=new Al(null,`FAKE_PATH_${n.getId()}}_${r}`,!0,r);this.createBean(a),a.setChildren([o]),o.setOriginalParent(a),o=a}s===0&&n.setOriginalParent(null),i.push(o)}),[i,s]}findDepth(e){let t=0,i=e;for(;i&&i[0]&&Dt(i[0]);)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const n=[];for(let o=0;o<e.length;o++){const r=e[o];if(Dt(r)){const a=r,d=this.balanceColumnTree(a.getChildren(),t+1,i,s);a.setChildren(d),n.push(a)}else{let a,d;for(let h=i-1;h>=t;h--){const g=s.getUniqueKey(null,null),f=this.createMergedColGroupDef(null),C=new Al(f,g,!0,t);this.createBean(C),d&&d.setChildren([C]),d=C,a||(a=d)}if(a&&d)if(n.push(a),e.some(g=>Dt(g))){d.setChildren([r]);continue}else{d.setChildren(e);break}n.push(r)}}return n}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const n=e[s];if(Dt(n)){const o=n,r=this.findMaxDept(o.getChildren(),t+1);i<r&&(i=r)}}return i}recursivelyCreateColumns(e,t,i,s,n,o,r){if(!e)return[];const a=new Array(e.length);for(let d=0;d<a.length;d++){const h=e[d];this.isColumnGroup(h)?a[d]=this.createColumnGroup(i,h,t,s,n,o,r):a[d]=this.createColumn(i,h,s,n,r)}return a}createColumnGroup(e,t,i,s,n,o,r){const a=this.createMergedColGroupDef(t),d=n.getUniqueKey(a.groupId||null,null),h=new Al(a,d,!1,i);this.createBean(h);const g=this.findExistingGroup(t,o);g&&o.splice(g.idx,1);const f=g==null?void 0:g.group;f&&h.setExpanded(f.isExpanded());const C=this.recursivelyCreateColumns(a.children,i+1,e,s,n,o,r);return h.setChildren(C),h}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,n){var a;const o=this.findExistingColumn(t,i);o&&(i==null||i.splice(o.idx,1));let r=o==null?void 0:o.column;if(r){const d=this.addColumnDefaultAndTypes(t,r.getColId());r.setColDef(d,t,n),this.applyColumnState(r,d,n)}else{const d=s.getUniqueKey(t.colId,t.field),h=this.addColumnDefaultAndTypes(t,d);r=new wd(h,t,d,e),this.createBean(r)}return(a=this.dataTypeService)==null||a.addColumnListeners(r),r}applyColumnState(e,t,i){const s=nn(t.flex);if(s!==void 0&&e.setFlex(s),e.getFlex()<=0){const a=nn(t.width);if(a!=null)e.setActualWidth(a,i);else{const d=e.getActualWidth();e.setActualWidth(d,i)}}t.sort!==void 0&&(t.sort=="asc"||t.sort=="desc"?e.setSort(t.sort,i):e.setSort(void 0,i));const o=nn(t.sortIndex);o!==void 0&&e.setSortIndex(o);const r=ed(t.hide);r!==void 0&&e.setVisible(!r,i),t.pinned!==void 0&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(!s)continue;if(e.colId!=null){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(e.field!=null){if(s.field===e.field)return{idx:i,column:t[i]};continue}if(s===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(e.groupId!=null)for(let s=0;s<t.length;s++){const n=t[s];if(n.getColGroupDef()&&n.getId()===e.groupId)return{idx:s,group:n}}}addColumnDefaultAndTypes(e,t){var a;const i={},s=this.gos.get("defaultColDef");Tt(i,s,!1,!0);const n=this.updateColDefAndGetColumnType(i,e,t);n&&this.assignColumnTypes(n,i),Tt(i,e,!1,!0);const o=this.gos.get("autoGroupColumnDef"),r=Vi(this.gos);return e.rowGroup&&o&&r&&Tt(i,{sort:o.sort,initialSort:o.initialSort},!1,!0),(a=this.dataTypeService)==null||a.validateColDef(i),i}updateColDefAndGetColumnType(e,t,i){var o;const s=(o=this.dataTypeService)==null?void 0:o.updateColDefAndGetColumnType(e,t,i),n=t.type??s??e.type;return e.type=n,n?kl(n):void 0}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},pT),s=this.gos.get("columnTypes")||{};ni(s,(n,o)=>{n in i?W(`the column type '${n}' is a default column type and cannot be overridden.`):(o.type&&W("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."),i[n]=o)}),e.forEach(n=>{const o=i[n.trim()];o?Tt(t,o,!1,!0):W("colDef.type '"+n+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};function es(e,t,i){if(t)for(let s=0;s<t.length;s++){const n=t[s];Dt(n)&&es(n,n.getChildren(),i),i(n,e)}}var mT=class extends B{constructor(){super(...arguments),this.beanName="columnModel",this.pivotMode=!1,this.autoHeightActiveAtLeastOnce=!1,this.ready=!1,this.changeEventsDispatching=!1,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}wireBeans(e){this.context=e.context,this.ctrlsService=e.ctrlsService,this.columnFactory=e.columnFactory,this.columnSizeService=e.columnSizeService,this.visibleColsService=e.visibleColsService,this.columnViewportService=e.columnViewportService,this.pivotResultColsService=e.pivotResultColsService,this.columnAnimationService=e.columnAnimationService,this.autoColService=e.autoColService,this.controlsColService=e.controlsColService,this.valueCache=e.valueCache,this.columnDefFactory=e.columnDefFactory,this.columnApplyStateService=e.columnApplyStateService,this.columnGroupStateService=e.columnGroupStateService,this.eventDispatcher=e.columnEventDispatcher,this.columnMoveService=e.columnMoveService,this.columnAutosizeService=e.columnAutosizeService,this.funcColsService=e.funcColsService,this.quickFilterService=e.quickFilterService,this.showRowGroupColsService=e.showRowGroupColsService,this.environment=e.environment}postConstruct(){const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],t=>this.refreshAll(an(t.source))),this.addManagedPropertyListener("selection",t=>{this.onSelectionOptionsChanged(t.currentValue,t.previousValue,an(t.source))}),this.addManagedPropertyListener("autoGroupColumnDef",t=>this.onAutoGroupColumnDefChanged(an(t.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],t=>this.recreateColumnDefs(an(t.source))),this.addManagedPropertyListener("pivotMode",t=>this.setPivotMode(this.gos.get("pivotMode"),an(t.source))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e){var h,g,f;const t=this.colDefs?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(e):void 0;this.valueCache.expire();const i=(h=this.colDefCols)==null?void 0:h.list,s=(g=this.colDefCols)==null?void 0:g.tree,n=this.columnFactory.createColumnTree(this.colDefs,!0,s,e);Ds(this.context,(f=this.colDefCols)==null?void 0:f.tree,n.columnTree);const o=n.columnTree,r=n.treeDept,a=pd(o),d={};a.forEach(C=>d[C.getId()]=C),this.colDefCols={tree:o,treeDepth:r,list:a,map:d},this.funcColsService.extractCols(e,i),this.ready=!0,this.refreshCols(!0),this.visibleColsService.refresh(e),this.columnViewportService.checkViewportColumns(),this.eventDispatcher.everythingChanged(e),t&&(this.changeEventsDispatching=!0,t(),this.changeEventsDispatching=!1),this.eventDispatcher.newColumnsLoaded(e),e==="gridInitializing"&&this.columnSizeService.applyAutosizeStrategy()}refreshCols(e){var n,o,r;if(!this.colDefCols)return;const t=(n=this.cols)==null?void 0:n.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.createControlsCols(),this.addControlsCols();const i=jD(this.gos,this.showingPivotResult);(!e||i)&&this.restoreColOrder(),this.positionLockedCols(),(o=this.showRowGroupColsService)==null||o.refresh(),(r=this.quickFilterService)==null||r.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear(),!Ni(t,this.cols.tree)&&this.eventDispatcher.gridColumns()}selectCols(){const e=this.pivotResultColsService.getPivotResultCols();if(this.showingPivotResult=e!=null,e){const{map:t,list:i,tree:s,treeDepth:n}=e;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:n},e.list.some(r=>{var a;return((a=this.cols)==null?void 0:a.map[r.getColId()])!==void 0})||(this.lastPivotOrder=null)}else{const{map:t,list:i,tree:s,treeDepth:n}=this.colDefCols;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:n}}}getColsToShow(){const e=this.isPivotMode()&&!this.isShowingPivotResult(),t=this.funcColsService.getValueColumns();return this.cols.list.filter(s=>{const n=gd(s);if(e){const o=t&&Qi(t,s);return n||o}else return n||s.isVisible()})}addAutoCols(){this.autoCols!=null&&(this.cols.list=this.autoCols.list.concat(this.cols.list),this.cols.tree=this.autoCols.tree.concat(this.cols.tree),Tg(this.cols))}createAutoCols(){var S,R;const e=El(this.gos,this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),i=this.funcColsService.getRowGroupColumns(),n=!(i.length>0||this.gos.get("treeData"))||t||e,o=()=>{this.autoCols&&(Ds(this.context,this.autoCols.tree),this.autoCols=null)};if(n||!this.autoColService){o();return}const r=this.autoColService.createAutoCols(i)??[],a=CT(r,((S=this.autoCols)==null?void 0:S.list)||null),d=this.cols.treeDepth,g=(this.autoCols?this.autoCols.treeDepth:-1)==d;if(a&&g)return;o();const[f,C]=this.columnFactory.balanceTreeForAutoCols(r,(R=this.cols)==null?void 0:R.tree);this.autoCols={list:r,tree:f,treeDepth:C,map:{}};const v=y=>{if(!y)return null;const x=y.filter(P=>!gd(P));return[...r,...x]};this.lastOrder=v(this.lastOrder),this.lastPivotOrder=v(this.lastPivotOrder)}createControlsCols(){var n,o,r,a;Ds(this.context,(n=this.controlsCols)==null?void 0:n.tree),this.controlsCols=null;const e=((o=this.controlsColService)==null?void 0:o.createControlsCols())??[],[t,i]=this.columnFactory.balanceTreeForAutoCols(e,this.cols.tree);this.controlsCols={list:e,tree:t,treeDepth:i,map:{}};function s(d,h){const g=$n(d),f=$n(h);return g&&!f?-1:!g&&f?1:0}(r=this.lastOrder)==null||r.sort(s),(a=this.lastPivotOrder)==null||a.sort(s)}addControlsCols(){this.controlsCols!=null&&(this.cols.list=this.controlsCols.list.concat(this.cols.list),this.cols.tree=this.controlsCols.tree.concat(this.cols.tree),Tg(this.cols))}refreshAll(e){this.isReady()&&(this.refreshCols(!1),this.visibleColsService.refresh(e))}setColsVisible(e,t=!1,i){this.columnApplyStateService.applyColumnState({state:e.map(s=>({colId:typeof s=="string"?s:s.getColId(),hide:!t}))},i)}setColsPinned(e,t,i){if(!this.cols||gt(e))return;if(ht(this.gos,"print")){W("Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();let s;t===!0||t==="left"?s="left":t==="right"?s="right":s=null;const n=[];e.forEach(o=>{if(!o)return;const r=this.getCol(o);r&&r.getPinned()!==s&&(r.setPinned(s),n.push(r))}),n.length&&(this.visibleColsService.refresh(i),this.eventDispatcher.columnPinned(n,i)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;Dt(e)?s=e.getId():s=e||"",this.columnGroupStateService.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColGroup(e){var i;let t=null;return es(null,(i=this.cols)==null?void 0:i.tree,s=>{Dt(s)&&s.getId()===e&&(t=s)}),t}isColGroupLocked(e){const t=this.gos.get("groupLockGroupColumns");if(!e.isRowGroupActive()||t===0)return!1;if(t===-1)return!0;const s=this.funcColsService.getRowGroupColumns().findIndex(n=>n.getColId()===e.getColId());return t>s}isSuppressAutoCol(){return this.gos.get("groupDisplayType")==="custom"?!0:this.gos.get("treeDataDisplayType")==="custom"}setAutoHeightActive(){this.autoHeightActive=this.cols.list.some(e=>e.isVisible()&&e.isAutoHeight()),this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,Ye(this.gos)||Yi(this.gos)||W("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}restoreColOrder(){const e=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!e)return;const t=new Map(e.map((d,h)=>[d,h]));if(!this.cols.list.some(d=>t.has(d)))return;const s=new Map(this.cols.list.map(d=>[d,!0])),n=e.filter(d=>s.has(d)),o=new Map(n.map(d=>[d,!0])),r=this.cols.list.filter(d=>!o.has(d)),a=n.slice();r.forEach(d=>{let h=d.getOriginalParent();if(!h){a.push(d);return}const g=[];for(;!g.length&&h;)h.getLeafColumns().forEach(S=>{const R=a.indexOf(S)>=0,y=g.indexOf(S)<0;R&&y&&g.push(S)}),h=h.getOriginalParent();if(!g.length){a.push(d);return}const f=g.map(v=>a.indexOf(v)),C=Math.max(...f);Dl(a,d,C+1)}),this.cols.list=a}sortColsLikeKeys(e){if(this.cols==null)return;let t=[];const i={};e.forEach(n=>{if(i[n])return;const o=this.cols.map[n];o&&(t.push(o),i[n]=!0)});let s=0;if(this.cols.list.forEach(n=>{const o=n.getColId();if(i[o]!=null)return;o.startsWith(Ml)?Dl(t,n,s++):t.push(n)}),t=this.columnMoveService.placeLockedColumns(t),!this.columnMoveService.doesMovePassMarryChildren(t)){W("Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.cols.list=t}sortColsLikeCols(e){!e||e.length<=1||e.filter(i=>this.cols.list.indexOf(i)<0).length>0||e.sort((i,s)=>{const n=this.cols.list.indexOf(i),o=this.cols.list.indexOf(s);return n-o})}resetColDefIntoCol(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}queueResizeOperations(){this.shouldQueueResizeOperations=!0}isShouldQueueResizeOperations(){return this.shouldQueueResizeOperations}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}moveInCols(e,t,i){var s;bg((s=this.cols)==null?void 0:s.list,e,t),this.visibleColsService.refresh(i)}positionLockedCols(){this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}saveColOrder(){var e,t;this.showingPivotResult?this.lastPivotOrder=(e=this.cols)==null?void 0:e.list:this.lastOrder=(t=this.cols)==null?void 0:t.list}getColumnDefs(){if(!this.colDefCols)return;const e=this.colDefCols.list.slice();this.showingPivotResult?e.sort((s,n)=>this.lastOrder.indexOf(s)-this.lastOrder.indexOf(n)):this.lastOrder&&e.sort((s,n)=>this.cols.list.indexOf(s)-this.cols.list.indexOf(n));const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns();return this.columnDefFactory.buildColumnDefs(e,t,i)}isShowingPivotResult(){return this.showingPivotResult}isChangeEventsDispatching(){return this.changeEventsDispatching}isColSpanActive(){return this.colSpanActive}isProvidedColGroupsPresent(){var e;return((e=this.colDefCols)==null?void 0:e.treeDepth)>0}setColSpanActive(){this.colSpanActive=this.cols.list.some(e=>e.getColDef().colSpan!=null)}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}getHeaderRowCount(){return this.cols?this.cols.treeDepth+1:-1}isReady(){return this.ready}isPivotMode(){return this.pivotMode}setPivotMode(e,t){e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode)||(this.pivotMode=e,this.ready&&(this.refreshCols(!1),this.visibleColsService.refresh(t),this.eventDispatcher.pivotModeChanged()))}isPivotSettingAllowed(e){return e&&this.gos.get("treeData")?(W("Pivot mode not available with treeData."),!1):!0}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!gt(e)}recreateColumnDefs(e){this.cols&&(this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e),this.createColsFromColDefs(e))}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){var e,t,i;Ds(this.context,(e=this.colDefCols)==null?void 0:e.tree),Ds(this.context,(t=this.autoCols)==null?void 0:t.tree),Ds(this.context,(i=this.controlsCols)==null?void 0:i.tree),super.destroy()}getColTree(){return this.cols.tree}getColDefColTree(){return this.colDefCols.tree}getColDefCols(){var e;return(e=this.colDefCols)!=null&&e.list?this.colDefCols.list:null}getCols(){var e;return((e=this.cols)==null?void 0:e.list)??[]}getAllCols(){var i,s,n;const e=this.pivotResultColsService.getPivotResultCols(),t=e==null?void 0:e.list;return[((i=this.colDefCols)==null?void 0:i.list)??[],((s=this.autoCols)==null?void 0:s.list)??[],((n=this.controlsCols)==null?void 0:n.list)??[],t??[]].flat()}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){var t;return(t=this.colDefCols)!=null&&t.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColFromCollection(e,t){if(t==null)return null;const{map:i,list:s}=t;if(typeof e=="string"&&i[e])return i[e];for(let n=0;n<s.length;n++)if(Ag(s[n],e))return s[n];return this.getAutoCol(e)}getAutoCol(e){var t;return((t=this.autoCols)==null?void 0:t.list.find(i=>Ag(i,e)))??null}getAutoCols(){var e;return((e=this.autoCols)==null?void 0:e.list)??null}setColHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&(e.isColumn?this.eventDispatcher.headerHeight(e):this.eventDispatcher.groupHeaderHeight(e))}getGroupRowsHeight(){const e=[],t=this.ctrlsService.getHeaderRowContainerCtrls();for(const i of t){if(!i)continue;const s=i.getGroupRowCount()||0;for(let n=0;n<s;n++){const o=i.getGroupRowCtrlAtIndex(n),r=e[n];if(o){const a=this.getColumnGroupHeaderRowHeight(o);(r==null||a>r)&&(e[n]=a)}}}return e}getColumnGroupHeaderRowHeight(e){const t=this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight();let i=0;const s=e.getHeaderCtrls();for(const n of s){const o=n.getColumn();if(o.isAutoHeaderHeight()){const r=o.getAutoHeaderHeight();r!=null&&r>i&&(i=r)}}return Math.max(t,i)}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),i=this.visibleColsService.getAllCols().filter(s=>s.isAutoHeaderHeight()).map(s=>s.getAutoHeaderHeight()||0);return Math.max(e,...i)}getHeaderHeight(){return this.gos.get("headerHeight")??this.environment.getDefaultHeaderHeight()}getFloatingFiltersHeight(){return this.gos.get("floatingFiltersHeight")??this.getHeaderHeight()}getGroupHeaderHeight(){return this.gos.get("groupHeaderHeight")??this.getHeaderHeight()}getPivotHeaderHeight(){return this.gos.get("pivotHeaderHeight")??this.getHeaderHeight()}getPivotGroupHeaderHeight(){return this.gos.get("pivotGroupHeaderHeight")??this.getGroupHeaderHeight()}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if((e==null?void 0:e.type)!=="fitCellContents")return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"autosizeColumns"}):this.columnAutosizeService.autoSizeAllColumns("autosizeColumns",i)})}onAutoGroupColumnDefChanged(e){this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e)}onSelectionOptionsChanged(e,t,i){const s=t?zn(t):void 0,n=e?zn(e):void 0,o=s!==n,r=t?Pl(t):void 0,a=e?Pl(e):void 0;(o||r!==a)&&this.refreshAll(i)}};function an(e){return e==="gridOptionsUpdated"?"gridOptionsChanged":e}function Tg(e){e.map={},e.list.forEach(t=>e.map[t.getId()]=t)}function Ag(e,t){const i=e===t,s=e.getColDef()===t,n=e.getColId()==t;return i||s||n}function CT(e,t){return Ni(e,t,(i,s)=>i.getColId()===s.getColId())}var vT=class extends B{constructor(){super(...arguments),this.beanName="columnAutosizeService",this.timesDelayed=0}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.animationFrameService=e.animationFrameService,this.autoWidthCalculator=e.autoWidthCalculator,this.eventDispatcher=e.columnEventDispatcher,this.ctrlsService=e.ctrlsService,this.renderStatusService=e.renderStatusService}autoSizeCols(e){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeCols(e));return}const{colKeys:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:n,source:o="api"}=e;if(this.animationFrameService.flushAllFrames(),this.timesDelayed<5&&this.renderStatusService&&!this.renderStatusService.areHeaderCellsRendered()){this.timesDelayed++,setTimeout(()=>this.autoSizeCols(e));return}this.timesDelayed=0;const r=[];let a=-1;const d=i??this.gos.get("skipHeaderOnAutoSize"),h=s??d;for(;a!==0;){a=0;const g=[];t.forEach(f=>{if(!f)return;const C=this.columnModel.getCol(f);if(!C||r.indexOf(C)>=0)return;const v=this.autoWidthCalculator.getPreferredWidthForColumn(C,d);if(v>0){const S=this.normaliseColumnWidth(C,v);C.setActualWidth(S,o),r.push(C),a++}g.push(C)}),g.length&&this.visibleColsService.refresh(o)}h||this.autoSizeColumnGroupsByColumns(t,o,n),this.eventDispatcher.columnResized(r,!0,"autosizeColumns")}autoSizeColumn(e,t,i){e&&this.autoSizeCols({colKeys:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;this.columnModel.getColsForKeys(e).forEach(a=>{let d=a.getParent();for(;d&&d!=i;)d.isPadding()||s.add(d),d=d.getParent()});let o;const r=[];for(const a of s){for(const d of this.ctrlsService.getHeaderRowContainerCtrls())if(o=d.getHeaderCtrlForColumn(a),o)break;o&&o.resizeLeafColumnsToFit(t)}return r}autoSizeAllColumns(e,t){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeAllColumns(e,t));return}const i=this.visibleColsService.getAllCols();this.autoSizeCols({colKeys:i,skipHeader:t,source:e})}normaliseColumnWidth(e,t){const i=e.getMinWidth();t<i&&(t=i);const s=e.getMaxWidth();return e.isGreaterThanMax(t)&&(t=s),t}},wT=class extends B{constructor(){super(...arguments),this.beanName="funcColsService",this.rowGroupCols=[],this.valueCols=[],this.pivotCols=[]}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.aggFuncService=e.aggFuncService,this.visibleColsService=e.visibleColsService}getModifyColumnsNoEventsCallbacks(){return{addGroupCol:e=>this.rowGroupCols.push(e),removeGroupCol:e=>wt(this.rowGroupCols,e),addPivotCol:e=>this.pivotCols.push(e),removePivotCol:e=>wt(this.pivotCols,e),addValueCol:e=>this.valueCols.push(e),removeValueCol:e=>wt(this.valueCols,e)}}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(t===!0)return this.rowGroupCols.slice(0);const i=this.columnModel.getColDefCol(t);return i?[i]:null}sortRowGroupColumns(e){this.rowGroupCols.sort(e)}sortPivotColumns(e){this.pivotCols.sort(e)}getValueColumns(){return this.valueCols?this.valueCols:[]}getPivotColumns(){return this.pivotCols?this.pivotCols:[]}getRowGroupColumns(){return this.rowGroupCols?this.rowGroupCols:[]}isRowGroupEmpty(){return gt(this.rowGroupCols)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.columnModel.getColDefCol(e);s&&(s.setAggFunc(t),this.eventDispatcher.columnChanged("columnValueChanged",[s],i))}setRowGroupColumns(e,t){this.setColList(e,this.rowGroupCols,"columnRowGroupChanged",!0,!0,(i,s)=>this.setRowGroupActive(i,s,t),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.columnModel.setColsVisible([t],!1,i),!e&&!this.gos.get("suppressMakeColumnVisibleAfterUnGroup")&&this.columnModel.setColsVisible([t],!0,i))}addRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!0,!0,i=>this.setRowGroupActive(!0,i,t),"columnRowGroupChanged",t)}removeRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!1,!0,i=>this.setRowGroupActive(!1,i,t),"columnRowGroupChanged",t)}addPivotColumns(e,t){this.updateColList(e,this.pivotCols,!0,!1,i=>i.setPivotActive(!0,t),"columnPivotChanged",t)}setPivotColumns(e,t){this.setColList(e,this.pivotCols,"columnPivotChanged",!0,!1,(i,s)=>{s.setPivotActive(i,t)},t)}removePivotColumns(e,t){this.updateColList(e,this.pivotCols,!1,!1,i=>i.setPivotActive(!1,t),"columnPivotChanged",t)}setValueColumns(e,t){this.setColList(e,this.valueCols,"columnValueChanged",!1,!1,(i,s)=>this.setValueActive(i,s,t),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const s=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(s)}}addValueColumns(e,t){this.updateColList(e,this.valueCols,!0,!1,i=>this.setValueActive(!0,i,t),"columnValueChanged",t)}removeValueColumns(e,t){this.updateColList(e,this.valueCols,!1,!1,i=>this.setValueActive(!1,i,t),"columnValueChanged",t)}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupCols[e],n=this.rowGroupCols.slice(e,t);this.rowGroupCols.splice(e,1),this.rowGroupCols.splice(t,0,s),this.eventDispatcher.rowGroupChanged(n,i)}setColList(e,t,i,s,n,o,r){const a=this.columnModel.getCols();if(gt(a))return;const d=new Map;t.forEach((g,f)=>d.set(g,f)),t.length=0,j(e)&&e.forEach(g=>{const f=this.columnModel.getColDefCol(g);f&&t.push(f)}),t.forEach((g,f)=>{const C=d.get(g);if(C===void 0){d.set(g,0);return}s&&C!==f||d.delete(g)}),(this.columnModel.getColDefCols()||[]).forEach(g=>{const f=t.indexOf(g)>=0;o(f,g)}),n&&this.columnModel.refreshCols(!1),this.visibleColsService.refresh(r),this.eventDispatcher.columnChanged(i,[...d.keys()],r)}updateColList(e,t,i,s,n,o,r){if(!e||gt(e))return;let a=!1;const d=new Set;e.forEach(h=>{if(!h)return;const g=this.columnModel.getColDefCol(h);if(g){if(d.add(g),i){if(t.indexOf(g)>=0)return;t.push(g)}else{const f=t.indexOf(g);if(f<0)return;for(let C=f+1;C<t.length;C++)d.add(t[C]);wt(t,g)}n(g),a=!0}}),a&&(s&&this.columnModel.refreshCols(!1),this.visibleColsService.refresh(r),this.eventDispatcher.genericColumnEvent(o,Array.from(d),r))}extractCols(e,t){this.extractRowGroupCols(e,t),this.extractPivotCols(e,t),this.extractValueCols(e,t)}extractValueCols(e,t){this.valueCols=this.extractColsCommon(t,this.valueCols,(i,s)=>i.setValueActive(s,e),()=>{},()=>{},i=>{const s=i.aggFunc;if(s===null||s==="")return null;if(s!==void 0)return!!s},i=>i.initialAggFunc!=null&&i.initialAggFunc!=""),this.valueCols.forEach(i=>{const s=i.getColDef();s.aggFunc!=null&&s.aggFunc!=""?i.setAggFunc(s.aggFunc):i.getAggFunc()||i.setAggFunc(s.initialAggFunc)})}extractRowGroupCols(e,t){this.rowGroupCols=this.extractColsCommon(t,this.rowGroupCols,(i,s)=>i.setRowGroupActive(s,e),i=>i.rowGroupIndex,i=>i.initialRowGroupIndex,i=>i.rowGroup,i=>i.initialRowGroup)}extractPivotCols(e,t){this.pivotCols=this.extractColsCommon(t,this.pivotCols,(i,s)=>i.setPivotActive(s,e),i=>i.pivotIndex,i=>i.initialPivotIndex,i=>i.pivot,i=>i.initialPivot)}extractColsCommon(e=[],t=[],i,s,n,o,r){const a=[],d=[];(this.columnModel.getColDefCols()||[]).forEach(C=>{const v=e.indexOf(C)<0,S=C.getColDef(),R=ed(o(S)),y=ed(r(S)),x=nn(s(S)),P=nn(n(S));let T;R!==void 0?T=R:x!==void 0?x===null?T=!1:T=x>=0:v?y!==void 0?T=y:P!==void 0?T=P!=null&&P>=0:T=!1:T=t.indexOf(C)>=0,T&&((v?x!=null||P!=null:x!=null)?a.push(C):d.push(C))});const g=C=>{const v=s(C.getColDef()),S=n(C.getColDef());return v??S};a.sort((C,v)=>{const S=g(C),R=g(v);return S===R?0:S<R?-1:1});const f=[].concat(a);return t.forEach(C=>{d.indexOf(C)>=0&&f.push(C)}),d.forEach(C=>{f.indexOf(C)<0&&f.push(C)}),t.forEach(C=>{f.indexOf(C)<0&&i(C,!1)}),f.forEach(C=>{t.indexOf(C)<0&&i(C,!0)}),f}generateColumnStateForRowGroupAndPivotIndexes(e,t){const i={},s=(n,o,r,a,d,h)=>{const g=this.columnModel.getColDefCols();if(!o.length||!g)return[];const f=Object.keys(n),C=new Set(f),v=new Set(f),S=new Set(o.map(_=>{const O=_.getColId();return v.delete(O),O}).concat(f)),R=[],y={};let x=0;for(let _=0;_<g.length;_++){const O=g[_].getColId();S.has(O)&&(R.push(O),y[O]=x++)}let P=1e3,T=!1,I=0;const V=_=>{const O=y[_];for(let M=I;M<O;M++){const A=R[M];v.has(A)&&(n[A][d]=P++,v.delete(A))}I=O};o.forEach(_=>{const O=_.getColId();if(C.has(O))V(O),n[O][d]=P++;else{const M=_.getColDef();(M[d]===null||M[d]===void 0&&M[h]==null)&&(T||(M[r]||M[r]===void 0&&M[a]?V(O):(v.forEach(H=>{n[H][d]=P+y[H]}),P+=R.length,T=!0)),i[O]||(i[O]={colId:O}),i[O][d]=P++)}})};return s(e,this.rowGroupCols,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotCols,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}},ST=class extends B{constructor(){super(...arguments),this.beanName="columnApplyStateService"}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.sortController=e.sortController,this.columnGetStateService=e.columnGetStateService,this.funcColsService=e.funcColsService,this.visibleColsService=e.visibleColsService,this.columnAnimationService=e.columnAnimationService,this.pivotResultColsService=e.pivotResultColsService}applyColumnState(e,t){const i=this.columnModel.getColDefCols()||[];if(gt(i))return!1;if(e&&e.state&&!e.state.forEach)return W("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."),!1;const s=this.funcColsService.getModifyColumnsNoEventsCallbacks(),n=(a,d,h)=>{const g=this.compareColumnStatesAndDispatchEvents(t),f=d.slice(),C={},v={},S=[],R=[];let y=0;const x=this.funcColsService.getRowGroupColumns().slice(),P=this.funcColsService.getPivotColumns().slice();a.forEach(_=>{const O=_.colId||"";if(O.startsWith(Ml)){S.push(_),R.push(_);return}const A=h(O);A?(this.syncColumnWithStateItem(A,_,e.defaultState,C,v,!1,t,s),wt(f,A)):(R.push(_),y+=1)});const T=_=>this.syncColumnWithStateItem(_,null,e.defaultState,C,v,!1,t,s);f.forEach(T),this.funcColsService.sortRowGroupColumns(Mg.bind(this,C,x)),this.funcColsService.sortPivotColumns(Mg.bind(this,v,P)),this.columnModel.refreshCols(!1);const V=(this.columnModel.getAutoCols()||[]).slice();return S.forEach(_=>{const O=this.columnModel.getAutoCol(_.colId);wt(V,O),this.syncColumnWithStateItem(O,_,e.defaultState,null,null,!0,t,s)}),V.forEach(T),this.orderLiveColsLikeState(e),this.visibleColsService.refresh(t),this.eventDispatcher.everythingChanged(t),g(),{unmatchedAndAutoStates:R,unmatchedCount:y}};this.columnAnimationService.start();let{unmatchedAndAutoStates:o,unmatchedCount:r}=n(e.state||[],i,a=>this.columnModel.getColDefCol(a));if(o.length>0||j(e.defaultState)){const a=this.pivotResultColsService.getPivotResultCols(),d=a==null?void 0:a.list;r=n(o,d||[],h=>this.pivotResultColsService.getPivotResultCol(h)).unmatchedCount}return this.columnAnimationService.finish(),r===0}resetColumnState(e){const t=this.columnModel.getColDefCols();if(gt(t))return;const i=this.columnModel.getColDefColTree(),s=pd(i),n=[];let o=1e3,r=1e3,a=[];const d=this.columnModel.getAutoCols();d&&(a=a.concat(d)),s&&(a=a.concat(s)),a.forEach(h=>{const g=this.getColumnStateFromColDef(h);ke(g.rowGroupIndex)&&g.rowGroup&&(g.rowGroupIndex=o++),ke(g.pivotIndex)&&g.pivot&&(g.pivotIndex=r++),n.push(g)}),this.applyColumnState({state:n,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(S,R)=>S??R??null,i=e.getColDef(),s=t(i.sort,i.initialSort),n=t(i.sortIndex,i.initialSortIndex),o=t(i.hide,i.initialHide),r=t(i.pinned,i.initialPinned),a=t(i.width,i.initialWidth),d=t(i.flex,i.initialFlex);let h=t(i.rowGroupIndex,i.initialRowGroupIndex),g=t(i.rowGroup,i.initialRowGroup);h==null&&(g==null||g==!1)&&(h=null,g=null);let f=t(i.pivotIndex,i.initialPivotIndex),C=t(i.pivot,i.initialPivot);f==null&&(C==null||C==!1)&&(f=null,C=null);const v=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:n,hide:o,pinned:r,width:a,flex:d,rowGroup:g,rowGroupIndex:h,pivot:C,pivotIndex:f,aggFunc:v}}syncColumnWithStateItem(e,t,i,s,n,o,r,a){if(!e)return;const d=(I,V)=>{const _={value1:void 0,value2:void 0};let O=!1;return t&&(t[I]!==void 0&&(_.value1=t[I],O=!0),j(V)&&t[V]!==void 0&&(_.value2=t[V],O=!0)),!O&&i&&(i[I]!==void 0&&(_.value1=i[I]),j(V)&&i[V]!==void 0&&(_.value2=i[V])),_},h=d("hide").value1;h!==void 0&&e.setVisible(!h,r);const g=d("pinned").value1;g!==void 0&&e.setPinned(g);const f=e.getColDef().minWidth??this.gos.environment.getDefaultColumnMinWidth(),C=d("flex").value1;if(C!==void 0&&e.setFlex(C),C==null){const I=d("width").value1;I!=null&&f!=null&&I>=f&&e.setActualWidth(I,r)}const v=d("sort").value1;v!==void 0&&(v==="desc"||v==="asc"?e.setSort(v,r):e.setSort(void 0,r));const S=d("sortIndex").value1;if(S!==void 0&&e.setSortIndex(S),o||!e.isPrimary())return;const R=d("aggFunc").value1;R!==void 0&&(typeof R=="string"?(e.setAggFunc(R),e.isValueActive()||(e.setValueActive(!0,r),a.addValueCol(e))):(j(R)&&W("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."),e.isValueActive()&&(e.setValueActive(!1,r),a.removeValueCol(e))));const{value1:y,value2:x}=d("rowGroup","rowGroupIndex");(y!==void 0||x!==void 0)&&(typeof x=="number"||y?(e.isRowGroupActive()||(e.setRowGroupActive(!0,r),a.addGroupCol(e)),s&&typeof x=="number"&&(s[e.getId()]=x)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,r),a.removeGroupCol(e)));const{value1:P,value2:T}=d("pivot","pivotIndex");(P!==void 0||T!==void 0)&&(typeof T=="number"||P?(e.isPivotActive()||(e.setPivotActive(!0,r),a.addPivotCol(e)),n&&typeof T=="number"&&(n[e.getId()]=T)):e.isPivotActive()&&(e.setPivotActive(!1,r),a.removePivotCol(e)))}orderLiveColsLikeState(e){if(!e.applyOrder||!e.state)return;const t=[];e.state.forEach(i=>{i.colId!=null&&t.push(i.colId)}),this.columnModel.sortColsLikeKeys(t)}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.funcColsService.getRowGroupColumns().slice(),pivotColumns:this.funcColsService.getPivotColumns().slice(),valueColumns:this.funcColsService.getValueColumns().slice()},i=this.columnGetStateService.getColumnState(),s={};return i.forEach(n=>{s[n.colId]=n}),()=>{const n=this.columnModel.getAllCols(),o=(R,y,x,P)=>{const T=y.map(P),I=x.map(P);if(Ni(T,I))return;const _=new Set(y);x.forEach(M=>{_.delete(M)||_.add(M)});const O=[..._];this.eventService.dispatchEvent({type:R,columns:O,column:O.length===1?O[0]:null,source:e})},r=R=>{const y=[];return n.forEach(x=>{const P=s[x.getColId()];P&&R(P,x)&&y.push(x)}),y},a=R=>R.getColId();o("columnRowGroupChanged",t.rowGroupColumns,this.funcColsService.getRowGroupColumns(),a),o("columnPivotChanged",t.pivotColumns,this.funcColsService.getPivotColumns(),a);const h=r((R,y)=>{const x=R.aggFunc!=null,P=x!=y.isValueActive(),T=x&&R.aggFunc!=y.getAggFunc();return P||T});h.length>0&&this.eventDispatcher.columnChanged("columnValueChanged",h,e);const g=(R,y)=>R.width!=y.getActualWidth();this.eventDispatcher.columnResized(r(g),!0,e);const f=(R,y)=>R.pinned!=y.getPinned();this.eventDispatcher.columnPinned(r(f),e);const C=(R,y)=>R.hide==y.isVisible();this.eventDispatcher.columnVisible(r(C),e);const S=r((R,y)=>R.sort!=y.getSort()||R.sortIndex!=y.getSortIndex());S.length>0&&this.sortController.dispatchSortChangedEvents(e,S),this.normaliseColumnMovedEventForColumnState(i,e)}}normaliseColumnMovedEventForColumnState(e,t){const i=this.columnGetStateService.getColumnState(),s={};i.forEach(d=>s[d.colId]=d);const n={};e.forEach(d=>{s[d.colId]&&(n[d.colId]=!0)});const o=e.filter(d=>n[d.colId]),r=i.filter(d=>n[d.colId]),a=[];r.forEach((d,h)=>{const g=o&&o[h];if(g&&g.colId!==d.colId){const f=this.columnModel.getCol(g.colId);f&&a.push(f)}}),a.length&&this.eventDispatcher.columnMoved({movedColumns:a,source:t,finished:!0})}},Mg=(e,t,i,s)=>{const n=e[i.getId()],o=e[s.getId()],r=n!=null,a=o!=null;if(r&&a)return n-o;if(r)return-1;if(a)return 1;const d=t.indexOf(i),h=t.indexOf(s),g=d>=0,f=h>=0;return g&&f?d-h:g?-1:1},yT=class extends B{constructor(){super(...arguments),this.beanName="columnMoveService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher}moveColumnByIndex(e,t,i){const s=this.columnModel.getCols();if(!s)return;const n=s[e];this.moveColumns([n],t,i)}moveColumns(e,t,i,s=!0){const n=this.columnModel.getCols();if(!n)return;if(t>n.length-e.length){W("tried to insert columns in invalid location, toIndex = ",t),W("remember that you should not count the moving columns when calculating the new index");return}this.columnAnimationService.start();const o=this.columnModel.getColsForKeys(e);this.doesMovePassRules(o,t)&&(this.columnModel.moveInCols(o,t,i),this.eventDispatcher.columnMoved({movedColumns:o,source:i,toIndex:t,finished:s})),this.columnAnimationService.finish()}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!(!this.doesMovePassMarryChildren(e)||!this.doesMovePassLockedPositions(e))}getProposedColumnOrder(e,t){const s=this.columnModel.getCols().slice();return bg(s,e,t),s}doesMovePassLockedPositions(e){const t=o=>o?o==="left"||o===!0?-1:1:0,i=this.gos.get("enableRtl");let s=i?1:-1,n=!0;return e.forEach(o=>{const r=t(o.getColDef().lockPosition);i?r>s&&(n=!1):r<s&&(n=!1),s=r}),n}doesMovePassMarryChildren(e){let t=!0;const i=this.columnModel.getColTree();return es(null,i,s=>{if(!Dt(s))return;const n=s,o=n.getColGroupDef();if(!(o&&o.marryChildren))return;const a=[];n.getLeafColumns().forEach(C=>{const v=e.indexOf(C);a.push(v)});const d=Math.max.apply(Math,a),h=Math.min.apply(Math,a),g=d-h,f=n.getLeafColumns().length-1;g>f&&(t=!1)}),t}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(o=>{const r=o.getColDef().lockPosition;r==="right"?s.push(o):r==="left"||r===!0?t.push(o):i.push(o)}),this.gos.get("enableRtl")?[...s,...i,...t]:[...t,...i,...s]}},bT=/[&<>"']/g,RT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Bi(e,t){if(e==null)return null;const i=e.toString().toString();return t?i:i.replace(bT,s=>RT[s])}function FT(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,i=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(i,"$1 $2$3").replace(/\./g," ").split(" ").map(n=>n.substring(0,1).toUpperCase()+(n.length>1?n.substring(1,n.length):"")).join(" ")}function xT(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}var ET=class extends B{constructor(){super(...arguments),this.beanName="columnNameService"}wireBeans(e){this.expressionService=e.expressionService,this.funcColsService=e.funcColsService,this.columnModel=e.columnModel}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,n){const o=e.headerValueGetter;if(o){const r=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:n});return typeof o=="function"?o(r):typeof o=="string"?this.expressionService.evaluate(o,r):(W("headerValueGetter must be a function or a string"),"")}else{if(e.headerName!=null)return e.headerName;if(e.field)return FT(e.field)}return""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn,s=j(i);let n=null,o;if(s){const r=this.funcColsService.getValueColumns(),a=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&r.length===1,d=e.getColDef().pivotTotalColumnIds!==void 0;if(a&&!d)return t;n=i?i.getAggFunc():null,o=!0}else{const r=e.isValueActive(),a=this.columnModel.isPivotMode()||!this.funcColsService.isRowGroupEmpty();r&&a?(n=e.getAggFunc(),o=!0):o=!1}if(o){const r=typeof n=="string"?n:"func";return`${this.localeService.getLocaleTextFunc()(r,r)}(${t})`}return t}},PT=class extends B{constructor(){super(...arguments),this.beanName="pivotResultColsService"}wireBeans(e){this.context=e.context,this.columnModel=e.columnModel,this.columnFactory=e.columnFactory,this.visibleColsService=e.visibleColsService}destroy(){var e;Ds(this.context,(e=this.pivotResultCols)==null?void 0:e.tree),super.destroy()}isPivotResultColsPresent(){return this.pivotResultCols!=null}lookupPivotResultCol(e,t){if(this.pivotResultCols==null)return null;const i=this.columnModel.getColDefCol(t);let s=null;return this.pivotResultCols.list.forEach(n=>{const o=n.getColDef().pivotKeys,r=n.getColDef().pivotValueColumn;Ni(o,e)&&r===i&&(s=n)}),s}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.columnModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){var i,s;if(this.columnModel.isReady()&&!(e==null&&this.pivotResultCols==null)){if(e){this.processPivotResultColDef(e);const n=this.columnFactory.createColumnTree(e,!1,((i=this.pivotResultCols)==null?void 0:i.tree)||this.previousPivotResultCols||void 0,t);Ds(this.context,(s=this.pivotResultCols)==null?void 0:s.tree,n.columnTree);const o=n.columnTree,r=n.treeDept,a=pd(o),d={};this.pivotResultCols={tree:o,treeDepth:r,list:a,map:d},this.pivotResultCols.list.forEach(g=>this.pivotResultCols.map[g.getId()]=g);const h=!!this.previousPivotResultCols;this.previousPivotResultCols=null,this.columnModel.refreshCols(!h)}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null,this.columnModel.refreshCols(!1);this.visibleColsService.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=n=>{n.forEach(o=>{if(j(o.children)){const a=o;i&&i(a),s(a.children)}else t&&t(o)})};e&&s(e)}},DT=class extends B{constructor(){super(...arguments),this.beanName="columnSizeService"}wireBeans(e){this.columnModel=e.columnModel,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}setColumnWidths(e,t,i,s){const n=[];e.forEach(o=>{const r=this.columnModel.getColDefCol(o.key)||this.columnModel.getCol(o.key);if(!r)return;if(n.push({width:o.newWidth,ratios:[1],columns:[r]}),this.gos.get("colResizeDefault")==="shift"&&(t=!t),t){const d=this.visibleColsService.getColAfter(r);if(!d)return;const h=r.getActualWidth()-o.newWidth,g=d.getActualWidth()+h;n.push({width:g,ratios:[1],columns:[d]})}}),n.length!==0&&this.resizeColumnSets({resizeSets:n,finished:i,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(!(!t||t.every(g=>this.checkMinAndMaxWidthsForSet(g)))){if(i){const g=t&&t.length>0?t[0].columns:null;this.eventDispatcher.columnResized(g,i,s)}return}const o=[],r=[];t.forEach(g=>{const{width:f,columns:C,ratios:v}=g,S={},R={};C.forEach(P=>r.push(P));let y=!0,x=0;for(;y;){if(x++,x>1e3){Ve("infinite loop in resizeColumnSets");break}y=!1;const P=[];let T=0,I=f;C.forEach((_,O)=>{if(R[_.getId()])I-=S[_.getId()];else{P.push(_);const A=v[O];T+=A}});const V=1/T;P.forEach((_,O)=>{const M=O===P.length-1;let A;M?A=I:(A=Math.round(v[O]*f*V),I-=A);const z=_.getMinWidth(),H=_.getMaxWidth();A<z?(A=z,R[_.getId()]=!0,y=!0):H>0&&A>H&&(A=H,R[_.getId()]=!0,y=!0),S[_.getId()]=A})}C.forEach(P=>{const T=S[P.getId()];P.getActualWidth()!==T&&(P.setActualWidth(T,s),o.push(P))})});const a=o.length>0;let d=[];a&&(d=this.refreshFlexedColumns({resizingCols:r,skipSetLeft:!0}),this.visibleColsService.setLeftValues(s),this.visibleColsService.updateBodyWidths(),this.columnViewportService.checkViewportColumns());const h=r.concat(d);(a||i)&&this.eventDispatcher.columnResized(h,i,s,d)}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,n=0,o=!0;t.forEach(d=>{const h=d.getMinWidth();s+=h||0;const g=d.getMaxWidth();g>0?n+=g:o=!1});const r=i>=s,a=!o||i<=n;return r&&a}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];const i=this.visibleColsService.getCenterCols();let s=-1;if(e.resizingCols){const C=new Set(e.resizingCols);for(let v=i.length-1;v>=0;v--)if(C.has(i[v])){s=v;break}}let n=0,o=[],r=0,a=0;for(let C=0;C<i.length;C++)i[C].getFlex()&&C>s?(o.push(i[C]),a+=i[C].getFlex(),r+=i[C].getMinWidth()):n+=i[C].getActualWidth();if(!o.length)return[];let d=[];n+r>this.flexViewportWidth&&(o.forEach(C=>C.setActualWidth(C.getMinWidth(),t)),d=o,o=[]);const h=[];let g;e:for(;;){g=this.flexViewportWidth-n;const C=g/a;for(let v=0;v<o.length;v++){const S=o[v],R=C*S.getFlex();let y=0;const x=S.getMinWidth(),P=S.getMaxWidth();if(R<x?y=x:R>P&&(y=P),y){S.setActualWidth(y,t),yg(o,S),a-=S.getFlex(),d.push(S),n+=S.getActualWidth();continue e}h[v]=Math.floor(R)}break}let f=g;return o.forEach((C,v)=>{const S=v<o.length-1?Math.min(h[v],f):Math.max(h[v],f);C.setActualWidth(S,t),d.push(C),f-=h[v]}),e.skipSetLeft||this.visibleColsService.setLeftValues(t),e.updateBodyWidths&&this.visibleColsService.updateBodyWidths(),e.fireResizedEvent&&this.eventDispatcher.columnResized(d,!0,t,o),o}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){var C;if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,i,s));return}const n={};s&&((C=s==null?void 0:s.columnLimits)==null||C.forEach(({key:v,...S})=>{n[typeof v=="string"?v:v.getColId()]=S}));const o=this.visibleColsService.getAllCols(),r=e===Ji(o);if(e<=0||!o.length||r)return;const a=[],d=[];o.forEach(v=>{v.getColDef().suppressSizeToFit===!0?d.push(v):a.push(v)});const h=a.slice(0);let g=!1;const f=v=>{wt(a,v),d.push(v)};for(a.forEach(v=>{v.resetActualWidth(t);const S=n==null?void 0:n[v.getId()],R=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),y=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),x=v.getActualWidth();typeof R=="number"&&x<R?v.setActualWidth(R,t,!0):typeof y=="number"&&x>y&&v.setActualWidth(y,t,!0)});!g;){g=!0;const v=e-Ji(d);if(v<=0)a.forEach(S=>{var y;const R=((y=n==null?void 0:n[S.getId()])==null?void 0:y.minWidth)??(s==null?void 0:s.defaultMinWidth);if(typeof R=="number"){S.setActualWidth(R,t,!0);return}S.setMinimum(t)});else{const S=v/Ji(a);let R=v;for(let y=a.length-1;y>=0;y--){const x=a[y],P=n==null?void 0:n[x.getId()],T=(P==null?void 0:P.minWidth)??(s==null?void 0:s.defaultMinWidth),I=(P==null?void 0:P.maxWidth)??(s==null?void 0:s.defaultMaxWidth),V=x.getMinWidth(),_=x.getMaxWidth(),O=typeof T=="number"&&T>V?T:V,M=typeof I=="number"&&I<_?I:_;let A=Math.round(x.getActualWidth()*S);A<O?(A=O,f(x),g=!1):A>M?(A=M,f(x),g=!1):y===0&&(A=R),x.setActualWidth(A,t,!0),R-=A}}}h.forEach(v=>{v.fireColumnWidthChangedEvent(t)}),this.visibleColsService.setLeftValues(t),this.visibleColsService.updateBodyWidths(),!i&&this.eventDispatcher.columnResized(h,!0,t)}applyAutosizeStrategy(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if(t==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:s,defaultMaxWidth:n}=e,o=i==null?void 0:i.map(({colId:r,minWidth:a,maxWidth:d})=>({key:r,minWidth:a,maxWidth:d}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:s,defaultMaxWidth:n,columnLimits:o})}else t==="fitProvidedWidth"&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}};function kg(e,t){return e+"_"+t}function ot(e){return e instanceof Ig}var Ig=class extends B{constructor(e,t,i,s){super(),this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return kg(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{ot(e)&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=ce(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;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()}),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(){var e;return!!((e=this.getColGroupDef())!=null&&e.autoHeaderHeight)}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{As(t)?e.push(t):ot(t)&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{As(t)?e.push(t):ot(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||!e.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e!=null&&e.isPadding();)e=e.getParent();if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}this.children.forEach(i=>{if(ot(i)&&(!i.displayedChildren||!i.displayedChildren.length))return;switch(i.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(i);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i);break}}),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},Lg=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return typeof t!="number"?i=0:i=t+1,this.existingIds[e]=i,i}},TT=class extends B{constructor(){super(...arguments),this.beanName="visibleColsService",this.colsAndGroupsMap={},this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher}refresh(e,t=!1){t||this.buildTrees(),this.updateOpenClosedVisibilityInColumnGroups(),this.columnsLeft=Sd(this.treeLeft),this.columnsCenter=Sd(this.treeCenter),this.columnsRight=Sd(this.treeRight),this.joinColsAriaOrder(),this.joinCols(),this.setLeftValues(e),this.autoHeightCols=this.columns.filter(i=>i.isAutoHeight()),this.columnSizeService.refreshFlexedColumns(),this.updateBodyWidths(),this.columnViewportService.checkViewportColumns(!1),this.setFirstRightAndLastLeftPinned(e),this.eventDispatcher.visibleCols(e)}updateBodyWidths(){const e=Ji(this.columnsCenter),t=Ji(this.columnsLeft),i=Ji(this.columnsRight);this.bodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i,this.eventService.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventService.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.columnsLeft?this.columnsLeft[0]:null,i=this.columnsRight?ce(this.columnsRight):null):(t=this.columnsLeft?ce(this.columnsLeft):null,i=this.columnsRight?this.columnsRight[0]:null),this.columnModel.getCols().forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}buildTrees(){const e=this.columnModel.getColsToShow(),t=e.filter(o=>o.getPinned()=="left"),i=e.filter(o=>o.getPinned()=="right"),s=e.filter(o=>o.getPinned()!="left"&&o.getPinned()!="right"),n=new Lg;this.treeLeft=this.createGroups({columns:t,idCreator:n,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=this.createGroups({columns:i,idCreator:n,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=this.createGroups({columns:s,idCreator:n,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.ariaOrderColumns=[]}joinColsAriaOrder(){const e=this.columnModel.getCols(),t=[],i=[],s=[];for(const n of e){const o=n.getPinned();o?o===!0||o==="left"?t.push(n):s.push(n):i.push(n)}this.ariaOrderColumns=t.concat(i).concat(s)}getAriaColIndex(e){let t;return ot(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}getAllAutoHeightCols(){return this.autoHeightCols}setLeftValuesOfGroups(){[this.treeLeft,this.treeRight,this.treeCenter].forEach(e=>{e.forEach(t=>{ot(t)&&t.checkLeft()})})}setLeftValuesOfCols(e){if(!this.columnModel.getColDefCols())return;const i=this.columnModel.getCols().slice(0),s=this.gos.get("enableRtl");[this.columnsLeft,this.columnsRight,this.columnsCenter].forEach(n=>{if(s){let o=Ji(n);n.forEach(r=>{o-=r.getActualWidth(),r.setLeft(o,e)})}else{let o=0;n.forEach(r=>{r.setLeft(o,e),o+=r.getActualWidth()})}iT(i,n)}),i.forEach(n=>{n.setLeft(null,e)})}joinCols(){this.gos.get("enableRtl")?this.columns=this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft):this.columns=this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight)}getColsCenter(){return this.columnsCenter}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}getTreeLeft(){return this.treeLeft}getTreeRight(){return this.treeRight}getTreeCenter(){return this.treeCenter}getAllCols(){return this.columns}isColDisplayed(e){return this.getAllCols().indexOf(e)>=0}getLeftColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsLeft):this.columnsLeft}getRightColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsRight):this.columnsRight}getColsForRow(e,t,i,s){const n=[];let o=null;for(let r=0;r<t.length;r++){const a=t[r],d=t.length-r,h=Math.min(a.getColSpan(e),d),g=[a];if(h>1){const C=h-1;for(let v=1;v<=C;v++)g.push(t[r+v]);r+=C}let f;i?(f=!1,g.forEach(C=>{i(C)&&(f=!0)})):f=!0,f&&(n.length===0&&o&&(s&&s(a))&&n.push(o),n.push(a)),o=a}return n}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getCenterCols(){return this.columnsCenter}getLeftCols(){return this.columnsLeft}getRightCols(){return this.columnsRight}getColBefore(e){const t=this.getAllCols(),i=t.indexOf(e);return i>0?t[i-1]:null}getGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),n=t==="After"?ce(s):s[0],o=`getCol${t}`;for(;;){const r=this[o](n);if(!r)return null;const a=this.getColGroupAtLevel(r,i);if(a!==e)return a}}getColGroupAtLevel(e,t){let i=e.getParent(),s,n;for(;s=i.getProvidedColumnGroup().getLevel(),n=i.getPaddingLevel(),!(s+n<=t);)i=i.getParent();return i}isPinningLeft(){return this.columnsLeft.length>0}isPinningRight(){return this.columnsRight.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};cn(this.treeCenter,!1,e),cn(this.treeLeft,!1,e),cn(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllTrees();cn(e,!1,t=>{ot(t)&&t.calculateDisplayedColumns()})}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["getLeftCols","getCenterCols","getRightCols"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?ce(s):s[0]}return null}getColumnGroup(e,t){if(!e)return null;if(ot(e))return e;const i=this.getAllTrees(),s=typeof t=="number";let n=null;return cn(i,!1,o=>{if(ot(o)){const r=o;let a;s?a=e===r.getGroupId()&&t===r.getPartId():a=e===r.getGroupId(),a&&(n=r)}}),n}getColAfter(e){const t=this.getAllCols(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}isBodyWidthDirty(){return this.bodyWidthDirty}setBodyWidthDirty(){this.bodyWidthDirty=!0}getColsLeftWidth(){return Ji(this.columnsLeft)}getDisplayedColumnsRightWidth(){return Ji(this.columnsRight)}isColAtEdge(e,t){const i=this.getAllCols();if(!i.length)return!1;const s=t==="first";let n;if(ot(e)){const o=e.getDisplayedLeafColumns();if(!o.length)return!1;n=s?o[0]:ce(o)}else n=e;return(s?i[0]:ce(i))===n}createGroups(e){const{columns:t,idCreator:i,pinned:s,oldDisplayedGroups:n,isStandaloneStructure:o}=e,r=this.mapOldGroupsById(n),a=[];let d=t;for(;d.length;){const h=d;d=[];let g=0;const f=C=>{const v=g;g=C;const S=h[v],y=(ot(S)?S.getProvidedColumnGroup():S).getOriginalParent();if(y==null){for(let P=v;P<C;P++)a.push(h[P]);return}const x=this.createColGroup(y,i,r,s,o);for(let P=v;P<C;P++)x.addChild(h[P]);d.push(x)};for(let C=1;C<h.length;C++){const v=h[C],R=(ot(v)?v.getProvidedColumnGroup():v).getOriginalParent(),y=h[g],P=(ot(y)?y.getProvidedColumnGroup():y).getOriginalParent();R!==P&&f(C)}g<h.length&&f(h.length)}return o||this.setupParentsIntoCols(a,null),a}createColGroup(e,t,i,s,n){const o=e.getGroupId(),r=t.getInstanceIdForKey(o),a=kg(o,r);let d=i[a];return d&&d.getProvidedColumnGroup()!==e&&(d=null),j(d)?d.reset():(d=new Ig(e,o,r,s),n||this.createBean(d)),d}mapOldGroupsById(e){const t={},i=s=>{s.forEach(n=>{if(ot(n)){const o=n;t[n.getUniqueId()]=o,i(o.getChildren())}})};return e&&i(e),t}setupParentsIntoCols(e,t){e.forEach(i=>{if(i.setParent(t),ot(i)){const s=i;this.setupParentsIntoCols(s.getChildren(),s)}})}};function cn(e,t,i){if(e)for(let s=0;s<e.length;s++){const n=e[s];if(ot(n)){const o=t?n.getDisplayedChildren():n.getChildren();cn(o,t,i)}i(n)}}function Sd(e){const t=[];return cn(e,!0,i=>{As(i)&&t.push(i)}),t}var _g=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","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","filterOpened","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"],AT=["scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","scrollGapChanged","columnHoverChanged","flashCells","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnGroupHeaderHeightChanged","columnHeaderHeightChanged","gridStylesChanged","storeUpdated","filterDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged","overlayExclusiveChanged"],MT=[..._g,...AT],kT={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,advancedFilterModel:!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,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!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,columnMenu:!0,suppressSetFilterByDefault:!0},St=class{};St.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],St.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","theme","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy","selection","selectionColumnDef"],St.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],St.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],St.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","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","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault"],St.OTHER_PROPERTIES=["suppressStickyTotalRow","loadThemeGoogleFonts"],St.FUNCTION_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","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","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],St.ALL_PROPERTIES=[...St.ARRAY_PROPERTIES,...St.OBJECT_PROPERTIES,...St.STRING_PROPERTIES,...St.NUMBER_PROPERTIES,...St.FUNCTION_PROPERTIES,...St.BOOLEAN_PROPERTIES,...St.OTHER_PROPERTIES];var er=St,oi=class{static getCallbackForEvent(t){return!t||t.length<2?t:"on"+t[0].toUpperCase()+t.substring(1)}};oi.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",oi.PUBLIC_EVENTS=_g,oi.EVENT_CALLBACKS=MT.map(e=>oi.getCallbackForEvent(e)),oi.BOOLEAN_PROPERTIES=er.BOOLEAN_PROPERTIES,oi.ALL_PROPERTIES=er.ALL_PROPERTIES,oi.ALL_PROPERTIES_AND_CALLBACKS=[...oi.ALL_PROPERTIES,...oi.EVENT_CALLBACKS],oi.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(oi.ALL_PROPERTIES_AND_CALLBACKS);var bi=oi;function IT(e,t){typeof e!="object"&&(e={});const i={...e};return bi.ALL_PROPERTIES_AND_CALLBACKS.forEach(n=>{const o=t[n];typeof o<"u"&&o!==bi.VUE_OMITTED_PROPERTY&&(i[n]=o)}),i}function yd(e,t){if(!e)return;const i={};let s=!1;if(Object.keys(e).filter(r=>bi.ALL_PROPERTIES_AND_CALLBACKS_SET.has(r)).forEach(r=>{i[r]=e[r],s=!0}),!s)return;const n={type:"gridOptionsChanged",options:i};t.dispatchEvent(n);const o={type:"componentStateChanged"};ni(i,(r,a)=>{o[r]=a}),t.dispatchEvent(o)}function tr(e,t,i){return i&&e.addDestroyFunc(()=>t.destroyBean(i)),i??e}var LT=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.addCssClass(s));return}if(this.cssClassStates[e]!==!0&&e.length){const s=this.getGui();s&&s.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.removeCssClass(s));return}if(this.cssClassStates[e]!==!1&&e.length){const s=this.getGui();s&&s.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return t?t.classList.contains(e):!1}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const s=(e||"").split(" ");if(s.length>1){s.forEach(n=>this.addOrRemoveCssClass(n,t));return}}if(this.cssClassStates[e]!==t&&e.length){const s=this.getGui();s&&s.classList.toggle(e,t),this.cssClassStates[e]=t}}};function ts(e,t,i){i==null||typeof i=="string"&&i==""?Og(e,t):Ri(e,t,i)}function Ri(e,t,i){e.setAttribute(Vg(t),i.toString())}function Og(e,t){e.removeAttribute(Vg(t))}function Vg(e){return`aria-${e}`}function Vt(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function _T(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function OT(e){return e.getAttribute("aria-label")}function Kn(e,t){ts(e,"label",t)}function ir(e,t){ts(e,"labelledby",t)}function Ng(e,t){ts(e,"live",t)}function VT(e,t){ts(e,"atomic",t)}function NT(e,t){ts(e,"relevant",t)}function BT(e,t){ts(e,"disabled",t)}function bd(e,t){ts(e,"hidden",t)}function sr(e,t){Ri(e,"expanded",t)}function GT(e,t){Ri(e,"setsize",t)}function HT(e,t){Ri(e,"posinset",t)}function WT(e,t){Ri(e,"multiselectable",t)}function zT(e,t){Ri(e,"rowcount",t)}function Bg(e,t){Ri(e,"rowindex",t)}function UT(e,t){Ri(e,"colcount",t)}function Gg(e,t){Ri(e,"colindex",t)}function $T(e,t){Ri(e,"colspan",t)}function KT(e,t){Ri(e,"sort",t)}function jT(e){Og(e,"sort")}function Il(e,t){ts(e,"selected",t)}function ZT(e,t){ts(e,"controls",t.id),ir(t,e.id)}function Rd(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var Fd,Ll,xd,Ed,Pd,Dd,Td,Ad,Md;function Gi(){return Fd===void 0&&(Fd=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Fd}function Hg(){if(Ll===void 0)if(Gi()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(Ll=e[1]!=null?parseFloat(e[1]):0)}else Ll=0;return Ll}function kd(){if(xd===void 0){const e=window;xd=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return xd}function Id(){return Ed===void 0&&(Ed=/(firefox)/i.test(navigator.userAgent)),Ed}function Wg(){return Pd===void 0&&(Pd=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Pd}function Ms(){return Dd===void 0&&(Dd=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),Dd}function Ld(){return!Gi()||Hg()>=15}function _d(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return t===-1&&(i===null||i===""&&!Id())?null:t.toString()}function qT(){if(Md!==void 0)return Md;if(!document.body)return-1;let e=1e6;const t=Id()?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=e*2;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),Md=e,e}function YT(){var e,t;return((e=document.body)==null?void 0:e.clientWidth)??(window.innerHeight||((t=document.documentElement)==null?void 0:t.clientWidth)||-1)}function QT(){var e,t;return((e=document.body)==null?void 0:e.clientHeight)??(window.innerHeight||((t=document.documentElement)==null?void 0:t.clientHeight)||-1)}function XT(){return Ad==null&&zg(),Ad}function zg(){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 i=t.offsetWidth-t.clientWidth;i===0&&t.clientWidth===0&&(i=null),t.parentNode&&t.parentNode.removeChild(t),i!=null&&(Ad=i,Td=i===0)}function Ug(){return Td==null&&zg(),Td}var _l,JT="[tabindex], input, select, button, textarea, [href]",$g="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function Od(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,s=t.call(e,"input, select, button, textarea"),n=t.call(e,$g),o=jt(e);return s&&!n&&o}function je(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||bd(e,!t)}function eA(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||bd(e,!t)}function nr(e,t){const i="disabled",s=t?n=>n.setAttribute(i,""):n=>n.removeAttribute(i);s(e),Xg(e.querySelectorAll("input"),n=>s(n))}function jn(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof i=="number"){if(++s>i)break}else if(e===i)break}return!1}function dn(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:n,borderBottomWidth:o,borderLeftWidth:r,paddingTop:a,paddingRight:d,paddingBottom:h,paddingLeft:g,marginTop:f,marginRight:C,marginBottom:v,marginLeft:S,boxSizing:R}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(n||"0"),borderBottomWidth:parseFloat(o||"0"),borderLeftWidth:parseFloat(r||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(d||"0"),paddingBottom:parseFloat(h||"0"),paddingLeft:parseFloat(g||"0"),marginTop:parseFloat(f||"0"),marginRight:parseFloat(C||"0"),marginBottom:parseFloat(v||"0"),marginLeft:parseFloat(S||"0"),boxSizing:R}}function Ol(e){const t=dn(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom:t.height}function Zn(e){const t=dn(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight:t.width}function Kg(e){const{height:t,marginBottom:i,marginTop:s}=dn(e);return Math.floor(t+i+s)}function Vl(e){const{width:t,marginLeft:i,marginRight:s}=dn(e);return Math.floor(t+i+s)}function jg(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:n,borderBottomWidth:o}=dn(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(n||0),bottom:t.bottom+(o||0)}}function Nl(){if(typeof _l=="boolean")return _l;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML=`<div style="width: 2px">
21
+ <span style="display: inline-block; width: 1px"></span>
22
+ <span style="display: inline-block; width: 1px"></span>
23
+ </div>`,document.body.appendChild(e),e.scrollLeft=1,_l=Math.floor(e.scrollLeft)===0,document.body.removeChild(e),_l}function Bl(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),kd()&&!Nl()&&(i=e.scrollWidth-e.clientWidth-i)),i}function Gl(e,t,i){i&&(Nl()?t*=-1:(Gi()||kd())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function yt(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function Hi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Zg(e){return!!e.offsetParent}function jt(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!Zg(e)||window.getComputedStyle(e).visibility!=="visible")}function is(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function qg(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function Yg(e,t){for(let i=0;i<t.length;i++){const s=t[i],n=e.children[i];n!==s&&e.insertBefore(s,n)}}function tA(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function Qg(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||s==null)continue;const n=xT(i),o=s.toString(),r=o.replace(/\s*!important/g,""),a=r.length!=o.length?"important":void 0;e.style.setProperty(n,r,a)}}function iA(e){return e.clientWidth<e.scrollWidth}function sA(e){return e.clientHeight<e.scrollHeight}function Hl(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Fi(e,t)}function Fi(e,t){t=Vd(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function or(e,t){t=Vd(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function Vd(e){return typeof e=="number"?`${e}px`:e}function Wl(e){return e instanceof Node||e instanceof HTMLElement}function nA(e){if(e==null)return[];const t=[];return Xg(e,i=>t.push(i)),t}function oA(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function ri(e,t,i){i==null||i===""?e.removeAttribute(t):e.setAttribute(t,i.toString())}function Xg(e,t){if(e!=null)for(let i=0;i<e.length;i++)t(e[i])}var qn=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},rA=1e3,lA=1e3,Jg=100,ef=class Tn extends B{constructor(t,i,s,n){super(),this.parentComp=t,this.tooltipShowDelayOverride=i,this.tooltipHideDelayOverride=s,this.shouldDisplayTooltip=n,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(t){this.popupService=t.popupService,this.userComponentFactory=t.userComponentFactory}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const t=this.parentComp.getGui();this.tooltipTrigger===0&&this.addManagedListeners(t,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),this.tooltipTrigger===1&&this.addManagedListeners(t,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(t,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(t,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(t){const i=this.gos.get(t);return i<0&&W(`${t} should not be lower than 0`),Math.max(200,i)}getTooltipDelay(t){return t==="show"?this.tooltipShowDelayOverride??this.getGridOptionsTooltipDelay("tooltipShowDelay"):this.tooltipHideDelayOverride??this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const t=this.gos.get("tooltipTrigger");return!t||t==="hover"?0:1}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!Ms()&&(Tn.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},Jg):this.prepareToShowTooltip(t))}onMouseMove(t){this.lastMouseEvent&&(this.lastMouseEvent=t),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(t){var o;const i=t.relatedTarget,s=this.parentComp.getGui(),n=(o=this.tooltipComp)==null?void 0:o.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&(n!=null&&n.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(this.state!=0||Tn.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){const t=new Date().getTime(),i=Tn.lastTooltipHideTime;return t-i<rA}setToDoNothing(t){!t&&this.state===2&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const t={...this.parentComp.getTooltipParams()};if(!j(t.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip()){this.setToDoNothing();return}this.state=2,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(t).newAgStackInstance().then(i)}hideTooltip(t){!t&&this.isInteractingWithTooltip||(this.tooltipComp&&(this.destroyTooltipComp(),Tn.lastTooltipHideTime=new Date().getTime()),this.eventService.dispatchEvent({type:"tooltipHide",parentGui:this.parentComp.getGui()}),t&&(this.isInteractingWithTooltip=!1),this.setToDoNothing(!0))}newTooltipComponentCallback(t,i){if(this.state!==2||this.tooltipInstanceCount!==t){this.destroyBean(i);return}const n=i.getGui();this.tooltipComp=i,n.classList.contains("ag-tooltip")||n.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&n.classList.add("ag-tooltip-animate"),this.interactionEnabled&&n.classList.add("ag-tooltip-interactive");const o=this.localeService.getLocaleTextFunc(),r=this.popupService.addPopup({eChild:n,ariaLabel:o("ariaLabelTooltip","Tooltip")});if(r&&(this.tooltipPopupDestroyFunc=r.hideFunc),this.positionTooltip(),this.tooltipTrigger===1){const a=()=>this.setToDoNothing();[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:a,columnMoved:a})}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(n,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),this.tooltipTrigger===1&&([this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(n,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}))),this.eventService.dispatchEvent({type:"tooltipShow",tooltipGui:n,parentGui:this.parentComp.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,this.lockService())}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){var s;const t=(s=this.tooltipComp)==null?void 0:s.getGui(),i=Ke(this.gos);return!!t&&t.contains(i)}onTooltipFocusOut(t){const i=this.parentComp.getGui();this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,i.contains(t.relatedTarget)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const t={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent({...t,mouseEvent:this.lastMouseEvent}):this.popupService.positionPopupByComponent({...t,eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const t=this.tooltipPopupDestroyFunc,i=this.tooltipComp,s=this.tooltipTrigger===0?lA:0;window.setTimeout(()=>{t(),this.destroyBean(i)},s),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(t=>{t&&t()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){Tn.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},Jg)}unlockService(){Tn.isLocked=!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()}};ef.isLocked=!1;var aA=ef,Yn=class extends B{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}wireBeans(e){this.beans=e}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(e!=null&&e!=""?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var t,i,s,n;if(this.tooltipManager!=null)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new aA(e,(i=(t=this.ctrl).getTooltipShowDelayOverride)==null?void 0:i.call(t),(n=(s=this.ctrl).getTooltipHideDelayOverride)==null?void 0:n.call(s),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){var n,o,r,a,d;const e=this.ctrl,t=(n=e.getColumn)==null?void 0:n.call(e),i=(o=e.getColDef)==null?void 0:o.call(e),s=(r=e.getRowNode)==null?void 0:r.call(e);return{location:e.getLocation(),colDef:i,column:t,rowIndex:(a=e.getRowIndex)==null?void 0:a.call(e),node:s,data:s==null?void 0:s.data,value:this.getTooltipText(),valueFormatted:(d=e.getValueFormatted)==null?void 0:d.call(e),hideTooltipCallback:()=>{var h;return(h=this.tooltipManager)==null?void 0:h.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}},cA=new qn,J=null,Pe=class kw extends B{constructor(t,i){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=cA.next(),this.cssClassManager=new LT(()=>this.eGui),this.componentSelectors=new Map((i??[]).map(s=>[s.selector,s])),t&&this.setTemplate(t)}preWireBeans(t){super.preWireBeans(t)}preConstruct(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips"),this.wireTemplate(this.getGui())}wireTemplate(t,i){t&&this.gos&&(this.applyElementsToComponent(t),this.createChildComponentsFromTags(t,i))}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(t){const{newTooltipText:i,showDelayOverride:s,hideDelayOverride:n,location:o,shouldDisplayTooltip:r}=t||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==i&&(this.tooltipText=i);const a=()=>this.tooltipText;i!=null&&(this.tooltipFeature=this.createBean(new Yn({getTooltipValue:a,getGui:()=>this.getGui(),getLocation:()=>o??"UNKNOWN",getColDef:t==null?void 0:t.getColDef,getColumn:t==null?void 0:t.getColumn,getTooltipShowDelayOverride:s!=null?()=>s:void 0,getTooltipHideDelayOverride:n!=null?()=>n:void 0,shouldDisplayTooltip:r})))}getDataRefAttribute(t){return t.getAttribute?t.getAttribute("data-ref"):null}applyElementsToComponent(t,i,s,n=null){if(i===void 0&&(i=this.getDataRefAttribute(t)),i){const o=this[i];if(o===J)this[i]=n??t;else{const r=s&&s[i];!this.suppressDataRefValidation&&!r&&W(`Issue with data-ref: ${i} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(t,i){nA(t.childNodes).forEach(n=>{if(!(n instanceof HTMLElement))return;const o=this.createComponentFromElement(n,r=>{r.getGui()&&this.copyAttributesFromNode(n,r.getGui())},i);if(o){if(o.addItems&&n.children.length){this.createChildComponentsFromTags(n,i);const r=Array.prototype.slice.call(n.children);o.addItems(r)}this.swapComponentForNode(o,t,n)}else n.childNodes&&this.createChildComponentsFromTags(n,i)})}createComponentFromElement(t,i,s){const n=t.nodeName,o=this.getDataRefAttribute(t),r=n.indexOf("AG-")===0,a=r?this.componentSelectors.get(n):null;let d=null;if(a){kw.elementGettingCreated=t;const h=s&&o?s[o]:void 0;d=new a.component(h),d.setParentComponent(this),this.createBean(d,null,i)}else r&&W(`Missing selector: ${n}`);return this.applyElementsToComponent(t,o,s,d),d}copyAttributesFromNode(t,i){oA(t.attributes,(s,n)=>i.setAttribute(s,n))}swapComponentForNode(t,i,s){const n=t.getGui();i.replaceChild(n,s),i.insertBefore(document.createComment(s.nodeName),n),this.addDestroyFunc(this.destroyBean.bind(this,t))}activateTabIndex(t){const i=this.gos.get("tabIndex");t||(t=[]),t.length||t.push(this.getGui()),t.forEach(s=>s.setAttribute("tabindex",i.toString()))}setTemplate(t,i,s){const n=is(t);this.setTemplateFromElement(n,i,s)}setTemplateFromElement(t,i,s,n=!1){if(this.eGui=t,this.suppressDataRefValidation=n,i)for(let o=0;o<i.length;o++){const r=i[o];this.componentSelectors.set(r.selector,r)}this.wireTemplate(t,s)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(t){this.parentComponent=t}getParentComponent(){return this.parentComponent}setGui(t){this.eGui=t}queryForHtmlElement(t){return this.eGui.querySelector(t)}getContainerAndElement(t,i){let s=i;return t==null?null:(s||(s=this.eGui),Wl(t)?{element:t,parent:s}:{element:t.getGui(),parent:s})}prependChild(t,i){const{element:s,parent:n}=this.getContainerAndElement(t,i)||{};!s||!n||n.insertAdjacentElement("afterbegin",s)}appendChild(t,i){const{element:s,parent:n}=this.getContainerAndElement(t,i)||{};!s||!n||n.appendChild(s)}isDisplayed(){return this.displayed}setVisible(t,i={}){if(t!==this.visible){this.visible=t;const{skipAriaHidden:s}=i;eA(this.eGui,t,{skipAriaHidden:s})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:s}=i;je(this.eGui,t,{skipAriaHidden:s});const n={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(n)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}addGuiEventListener(t,i,s){this.eGui.addEventListener(t,i,s),this.addDestroyFunc(()=>this.eGui.removeEventListener(t,i))}addCssClass(t){this.cssClassManager.addCssClass(t)}removeCssClass(t){this.cssClassManager.removeCssClass(t)}containsCssClass(t){return this.cssClassManager.containsCssClass(t)}addOrRemoveCssClass(t,i){this.cssClassManager.addOrRemoveCssClass(t,i)}},tf={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",checkboxChecked:"checkbox-checked",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off"},dA=(()=>{const e=new Set(Object.values(tf));return e.add("eye"),e})();function uA(e,t,i){const s=bt(e,t,i);if(s){const{className:o}=s;if(typeof o=="string"&&o.indexOf("ag-icon")>-1||typeof o=="object"&&o["ag-icon"])return s}const n=document.createElement("span");return n.appendChild(s),n}function bt(e,t,i,s){let n=null;const o=i&&i.getColDef().icons;if(o&&(n=o[e]),t&&!n){const r=t.get("icons");r&&(n=r[e])}if(n){let r;if(typeof n=="function")r=n();else if(typeof n=="string")r=n;else throw new Error("icon from grid options needs to be a string or a function");if(typeof r=="string")return is(r);if(Wl(r))return r;W("iconRenderer should return back a string or a dom object")}else{const r=document.createElement("span");let a=tf[e]??(dA.has(e)?e:void 0);return a||(W(`Did not find icon ${e}`),a=""),r.setAttribute("class",`ag-icon ag-icon-${a}`),r.setAttribute("unselectable","on"),Vt(r,"presentation"),r}}var hA=class extends Pe{constructor(){super(...arguments),this.dragSource=null,this.eIcon=J,this.eLabel=J}postConstruct(){const e=t=>uA(t,this.gos,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(`<div class="ag-dnd-ghost ag-unselectable">
24
+ <span data-ref="eIcon" class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>
25
+ <div data-ref="eLabel" class="ag-dnd-ghost-label"></div>
26
+ </div>`)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t=!1){var s,n;yt(this.eIcon);let i=null;e||(e=(s=this.dragSource)!=null&&s.getDefaultIconName?(n=this.dragSource)==null?void 0:n.getDefaultIconName():"notAllowed"),i=this.dropIconMap[e],this.eIcon.classList.toggle("ag-shake-left-to-right",t),!(i===this.dropIconMap.hide&&this.gos.get("suppressDragLeaveHidesColumns"))&&i&&this.eIcon.appendChild(i)}setLabel(e){this.eLabel.textContent=Bi(e)}};function sf(e,t,i){if(i===0)return!1;const s=Math.abs(e.clientX-t.clientX),n=Math.abs(e.clientY-t.clientY);return Math.max(s,n)<=i}var ks=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new Gn,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),n=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",n,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",n,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout(()=>{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const s={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(s)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!sf(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const t={type:"tap",touchStart:this.touchStart};this.localEventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=new Date().getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>this.DOUBLE_TAP_MILLIS){const i={type:"doubleTap",touchStart:this.touchStart};this.localEventService.dispatchEvent(i),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}};function rr(e,t){return`<span data-ref="eSort${e}" class="ag-sort-indicator-icon ag-sort-${t} ag-hidden" aria-hidden="true"></span>`}var pA=`<span class="ag-sort-indicator-container">
27
+ ${rr("Order","order")}
28
+ ${rr("Asc","ascending-icon")}
29
+ ${rr("Desc","descending-icon")}
30
+ ${rr("Mixed","mixed-icon")}
31
+ ${rr("None","none-icon")}
32
+ </span>`,Nd=class extends Pe{constructor(e){super(),this.eSortOrder=J,this.eSortAsc=J,this.eSortDesc=J,this.eSortMixed=J,this.eSortNone=J,e||this.setTemplate(pA)}wireBeans(e){this.sortController=e.sortController}attachCustomElements(e,t,i,s,n){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=n}setupSort(e,t=!1){if(this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),!this.column.isSortable()&&!this.column.getColDef().showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e);const i=this.updateIcons.bind(this),s=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",i),this.addManagedEventListeners({newColumnsLoaded:i,sortChanged:s,columnRowGroupChanged:s}),this.onSortChanged()}addInIcon(e,t,i){if(t==null)return;const s=bt(e,this.gos,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t=e==="asc";je(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t=e==="desc";je(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=e==null;je(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;Vi(this.gos)&&e&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e=this.sortController.getDisplaySortForColumn(this.column)==="mixed";je(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){if(!this.eSortOrder)return;const e=this.sortController.getColumnsWithSortingOrdered(),t=this.sortController.getDisplaySortIndexForColumn(this.column)??-1,i=e.some(n=>this.sortController.getDisplaySortIndexForColumn(n)??!1),s=t>=0&&i;je(this.eSortOrder,s,{skipAriaHidden:!0}),t>=0?this.eSortOrder.textContent=(t+1).toString():yt(this.eSortOrder)}},gA={selector:"AG-SORT-INDICATOR",component:Nd},fA=`<div class="ag-cell-label-container" role="presentation">
33
+ <span data-ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
34
+ <span data-ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>
35
+ <div data-ref="eLabel" class="ag-header-cell-label" role="presentation">
36
+ <span data-ref="eText" class="ag-header-cell-text"></span>
37
+ <span data-ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
38
+ <ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>
39
+ </div>
40
+ </div>`,Bd=class extends Pe{constructor(){super(...arguments),this.eFilter=J,this.eFilterButton=J,this.eSortIndicator=J,this.eMenu=J,this.eLabel=J,this.eText=J,this.eSortOrder=J,this.eSortAsc=J,this.eSortDesc=J,this.eSortMixed=J,this.eSortNone=J,this.lastMovingChanged=0}wireBeans(e){this.sortController=e.sortController,this.menuService=e.menuService,this.funcColsService=e.funcColsService}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||this.workOutSort()!=this.currentSort||this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon?!1:(this.setDisplayName(e),!0)}workOutTemplate(){let e=this.params.template??fA;return e=e&&e.trim?e.trim():e,e}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate,[gA]),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=Bi(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(t==null)return;const s=bt(e,this.gos,i);s&&t.appendChild(s)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new ks(this.getGui(),!0),i=this.shouldSuppressMenuHide(),s=i&&j(this.eMenu),n=s?new ks(this.eMenu,!0):t;if(this.params.enableMenu){const o=s?"tap":"longTap",r=a=>this.params.showColumnMenuAfterMouseClick(a.touchStart);this.addManagedListeners(n,{[o]:r})}if(this.params.enableSorting){const o=r=>{var d,h;const a=r.touchStart.target;i&&((d=this.eMenu)!=null&&d.contains(a)||(h=this.eFilterButton)!=null&&h.contains(a))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListeners(t,{tap:o})}if(this.params.enableFilterButton){const o=new ks(this.eFilterButton,!0);this.addManagedListeners(o,{tap:()=>this.params.showFilter(this.eFilterButton)}),this.addDestroyFunc(()=>o.destroy())}this.addDestroyFunc(()=>t.destroy()),s&&this.addDestroyFunc(()=>n.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){Hi(this.eMenu),this.eMenu=void 0;return}const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedElementListeners(this.eMenu,{click:()=>this.params.showColumnMenu(this.eMenu)}),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){const t=this.params.column,i=this.menuService.isLegacyMenuEnabled();if(e&&!i){if(this.menuService.isFilterMenuInHeaderEnabled(t))return this.params.showFilter(this.eFilterButton??this.eMenu??this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(this.eMenu??this.eFilterButton??this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.createBean(new Nd(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListeners(this.params.column,{movingChanged:()=>{this.lastMovingChanged=new Date().getTime()}}),this.eLabel&&this.addManagedElementListeners(this.eLabel,{click:t=>{const i=this.params.column.isMoving(),n=new Date().getTime()-this.lastMovingChanged<50;if(!(i||n)){const a=this.gos.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey;this.params.progressSort(a)}}});const e=()=>{const t=this.params.column.getSort();if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",t==="asc"),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",t==="desc"),this.addOrRemoveCssClass("ag-header-cell-sorted-none",!t),this.params.column.getColDef().showRowGroup){const i=this.funcColsService.getSourceColumnsForGroupColumn(this.params.column),n=!(i==null?void 0:i.every(o=>this.params.column.getSort()==o.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",n)}};this.addManagedEventListeners({sortChanged:e,columnRowGroupChanged:e})}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedElementListeners(this.eFilterButton,{click:()=>this.params.showFilter(this.eFilterButton)}):this.eFilterButton=void 0}configureFilter(e,t,i){if(!e)return Hi(t),!1;const s=this.params.column;return this.addInIcon("filter",t,s),this.addManagedListeners(s,{filterChanged:i}),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();je(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){return e?this.eFilterButton??this.eMenu??this.getGui():this.eMenu??this.eFilterButton??this.getGui()}},mA=class extends Pe{constructor(){super(`<div class="ag-header-group-cell-label" role="presentation">
41
+ <span data-ref="agLabel" class="ag-header-group-text" role="presentation"></span>
42
+ <span data-ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>
43
+ <span data-ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>
44
+ </div>`),this.agOpened=J,this.agClosed=J,this.agLabel=J}wireBeans(e){this.columnModel=e.columnModel}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&W("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened",this.agOpened),this.addInIcon("columnGroupClosed",this.agClosed);const e=n=>{if(Xi(n))return;const o=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),o,"uiColumnExpanded")};this.addTouchAndClickListeners(this.agClosed,e),this.addTouchAndClickListeners(this.agOpened,e);const t=n=>{Un(n)};this.addManagedElementListeners(this.agClosed,{dblclick:t}),this.addManagedElementListeners(this.agOpened,{dblclick:t}),this.addManagedElementListeners(this.getGui(),{dblclick:e}),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup(),s=this.updateIconVisibility.bind(this);this.addManagedListeners(i,{expandedChanged:s,expandableChanged:s})}addTouchAndClickListeners(e,t){const i=new ks(e,!0);this.addManagedListeners(i,{tap:t}),this.addDestroyFunc(()=>i.destroy()),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const t=this.params.columnGroup.isExpanded();je(this.agOpened,t),je(this.agClosed,!t)}else je(this.agOpened,!1),je(this.agClosed,!1)}addInIcon(e,t){const i=bt(e,this.gos,null);i&&t.appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable()){je(this.agOpened,!1),je(this.agClosed,!1);return}}setupLabel(){var i;const{displayName:e,columnGroup:t}=this.params;if(j(e)){const s=Bi(e,!0);this.agLabel.textContent=s}this.addOrRemoveCssClass("ag-sticky-label",!((i=t.getColGroupDef())!=null&&i.suppressStickyLabel))}},CA="↑",vA="↓",wA=class extends Pe{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}wireBeans(e){this.filterManager=e.filterManager}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),n=j(s)?s:i,o=t>=0;o?this.eDelta.textContent=CA+n:this.eDelta.textContent=vA+n,this.eDelta.classList.toggle("ag-value-change-delta-up",o),this.eDelta.classList.toggle("ag-value-change-delta-down",!o)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),yt(this.eDelta)}refresh(e,t=!1){var s;const i=e.value;if(i===this.lastValue||(j(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:j(e.value)?this.eValue.textContent=i:yt(this.eValue),(s=this.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof i=="number"&&typeof this.lastValue=="number"){const n=i-this.lastValue;this.showDelta(e,n)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}},SA=class extends Pe{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}wireBeans(e){this.filterManager=e.filterManager}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let i=e.value;return ke(i)&&(i=""),i===this.lastValue||(s=this.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering()?!1:(t||this.addSlideAnimation(),this.lastValue=i,j(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:j(e.value)?this.eCurrent.textContent=i:yt(this.eCurrent),!0)}},N=class{};N.BACKSPACE="Backspace",N.TAB="Tab",N.ENTER="Enter",N.ESCAPE="Escape",N.SPACE=" ",N.LEFT="ArrowLeft",N.UP="ArrowUp",N.RIGHT="ArrowRight",N.DOWN="ArrowDown",N.DELETE="Delete",N.F2="F2",N.PAGE_UP="PageUp",N.PAGE_DOWN="PageDown",N.PAGE_HOME="Home",N.PAGE_END="End",N.A="KeyA",N.C="KeyC",N.D="KeyD",N.V="KeyV",N.X="KeyX",N.Y="KeyY",N.Z="KeyZ";var yA=class extends Pe{constructor(e,t,i){super(t,i),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:n}=this.config;n!=null&&this.setDisabled(n),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),i!=null&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){yt(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(je(this.eLabel,!1),Vt(this.eLabel,"presentation")):(je(this.eLabel,!0),Vt(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const i=this.getGui().classList;return i.toggle("ag-label-align-left",e==="left"),i.toggle("ag-label-align-right",e==="right"),i.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(Hl(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return nr(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},nf=class extends yA{constructor(e,t,i,s){super(e,t,i),this.className=s}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),i!=null&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),i=this.getLabel();i==null||i==""||OT(e)!==null?ir(e,""):ir(e,t??"")}setAriaLabel(e){return Kn(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 Fi(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}},un=class extends nf{constructor(e,t,i="text",s="input"){super(e,(e==null?void 0:e.template)??`
45
+ <div role="presentation">
46
+ <div data-ref="eLabel" class="ag-input-field-label"></div>
47
+ <div data-ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">
48
+ <${s} data-ref="eInput" class="ag-input-field-input"></${s}>
49
+ </div>
50
+ </div>`,[],t),this.inputType=i,this.displayFieldTag=s,this.eLabel=J,this.eWrapper=J,this.eInput=J}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;e!=null&&this.setInputName(e),t!=null&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(){this.displayFieldTag==="input"&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return Hl(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return ri(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Kn(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return nr(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)ri(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";ri(this.eInput,"autocomplete",t)}return this}},Gd=class extends un{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:i});const s=this.getInputElement();this.eventService.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(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",e===!0),this.eWrapper.classList.toggle("ag-indeterminate",e==null)}},Hd={selector:"AG-CHECKBOX",component:Gd},bA=class extends Pe{constructor(){super(`
51
+ <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">
52
+ <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
53
+ </div>`,[Hd]),this.eCheckbox=J}init(e){this.refresh(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),Ng(t,"polite"),this.addManagedListeners(t,{click:i=>{if(Un(i),this.eCheckbox.isDisabled())return;const s=this.eCheckbox.getValue();this.onCheckboxChanged(s)},dblclick:i=>{Un(i)}}),this.addManagedElementListeners(this.params.eGridCell,{keydown:i=>{if(i.key===N.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===Ke(this.gos)&&this.eCheckbox.toggle();const s=this.eCheckbox.getValue();this.onCheckboxChanged(s),i.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var a;let t,i=!0;if(e.node.group&&e.column)if(typeof e.value=="boolean")t=e.value;else{const d=e.column.getColId();d.startsWith(Ml)?t=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[d]!==void 0?t=e.value??void 0:i=!1}else t=e.value??void 0;if(!i){this.eCheckbox.setDisplayed(!1);return}this.eCheckbox.setValue(t);const s=e.disabled!=null?e.disabled:!((a=e.column)!=null&&a.isCellEditable(e.node));this.eCheckbox.setDisabled(s);const n=this.localeService.getLocaleTextFunc(),o=Rd(n,t),r=s?o:`${n("ariaToggleCellValue","Press SPACE to toggle cell value")} (${o})`;this.eCheckbox.setInputAriaLabel(r)}onCheckboxChanged(e){const{column:t,node:i,value:s}=this.params;this.eventService.dispatchEvent({type:"cellEditingStarted",column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s});const n=this.params.node.setDataValue(this.params.column,e,"edit");this.eventService.dispatchEvent({type:"cellEditingStopped",column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s,oldValue:s,newValue:e,valueChanged:n}),n||this.updateCheckbox(this.params)}},RA=class extends Pe{constructor(){super(`<div class="ag-loading">
54
+ <span class="ag-loading-icon" data-ref="eLoadingIcon"></span>
55
+ <span class="ag-loading-text" data-ref="eLoadingText"></span>
56
+ </div>`),this.eLoadingIcon=J,this.eLoadingText=J}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=bt("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}},FA=class extends Pe{constructor(){super('<div class="ag-skeleton-container"></div>')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>ir(e.eParentOfValue)),ir(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Kn(this.getGui(),t)}setupLoading(e){const i=Xe(this.gos).createElement("div");i.classList.add("ag-skeleton-effect");const s=e.node.rowIndex;if(s!=null){const r=75+25*(s%2===0?Math.sin(s):Math.cos(s));i.style.width=`${r}%`}this.getGui().appendChild(i);const o=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");Kn(this.getGui(),o)}refresh(e){return!1}destroy(){super.destroy()}},of=class extends Pe{constructor(){super()}destroy(){super.destroy()}},xA=class extends of{init(){var t;const e=yi((t=this.gos.get("overlayLoadingTemplate"))==null?void 0:t.trim());if(this.setTemplate(e??'<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>'),!e){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("loadingOoo","Loading...")})}}},EA=class extends of{init(){var t;const e=yi((t=this.gos.get("overlayNoRowsTemplate"))==null?void 0:t.trim());if(this.setTemplate(e??'<span class="ag-overlay-no-rows-center"></span>'),!e){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("noRowsToShow","No Rows To Show")})}}},Qn=class extends Pe{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},PA=class extends Qn{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=Bi(t,!0)}};function DA(e,t,i){const s={},n=e.filter(o=>!t.some(r=>r===o));return n.length>0&&n.forEach(o=>s[o]=rf(o,i).values),s}function rf(e,t,i,s){let n=t.map((a,d)=>({value:a,relevance:TA(e.toLowerCase(),a.toLocaleLowerCase()),idx:d}));if(n.sort((a,d)=>d.relevance-a.relevance),i&&(n=n.filter(a=>a.relevance!==0)),n.length>0&&s&&s>0){const d=n[0].relevance*s;n=n.filter(h=>d-h.relevance<0)}const o=[],r=[];for(const a of n)o.push(a.value),r.push(a.idx);return{values:o,indices:r}}function TA(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let n=0,o=-1;for(let r=0;r<i.length;r++){const a=s.indexOf(i[r],o+1);a!==-1&&(o=a,n+=100-o*100/1e4*100)}return n}var AA=class extends B{constructor(){super(...arguments),this.beanName="userComponentRegistry",this.agGridDefaults={agDragAndDropImage:hA,agColumnHeader:Bd,agColumnGroupHeader:mA,agSortIndicator:Nd,agAnimateShowChangeCellRenderer:wA,agAnimateSlideCellRenderer:SA,agLoadingCellRenderer:RA,agSkeletonCellRenderer:FA,agCheckboxCellRenderer:bA,agLoadingOverlay:xA,agNoRowsOverlay:EA,agTooltipComponent:PA},this.agGridDefaultParams={},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agGroupCellRenderer:"@ag-grid-enterprise/row-grouping",agGroupRowRenderer:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}postConstruct(){const e=this.gos.get("components");e!=null&&ni(e,(t,i)=>this.registerJsComponent(t,i))}registerDefaultComponent(e,t,i){this.agGridDefaults[e]=t,i&&(this.agGridDefaultParams[e]=i)}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(a,d,h)=>({componentFromFramework:d,component:a,params:h}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(s!=null)return i(s,!0);const n=this.jsComps[t];if(n){const a=this.getFrameworkOverrides().isFrameworkComponent(n);return i(n,a)}const o=this.agGridDefaults[t];if(o)return i(o,!1,this.agGridDefaultParams[t]);const r=this.enterpriseAgDefaultCompsModule[t];return r?this.gos.assertModuleRegistered(r,`AG Grid '${e}' component: ${t}`):Yc(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=[...Object.keys(this.agGridDefaults).filter(n=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(n)),...Object.keys(this.jsComps)],s=rf(t,i,!0,.8).values;W(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),s.length>0&&W(` Did you mean: [${s.slice(0,3)}]?`),W(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}},Zt=class nl{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(i=>this.onDone(i),i=>this.onReject(i))}static all(t){return t.length?new nl(i=>{let s=t.length;const n=new Array(s);t.forEach((o,r)=>{o.then(a=>{n[r]=a,s--,s===0&&i(n)})})}):nl.resolve()}static resolve(t=null){return new nl(i=>i(t))}then(t){return new nl(i=>{this.status===1?i(t(this.resolution)):this.waiters.push(s=>i(t(s)))})}onDone(t){this.status=1,this.resolution=t,this.waiters.forEach(i=>i(t))}onReject(t){}},MA={propertyName:"dateComponent",cellRenderer:!1},kA={propertyName:"dragAndDropImageComponent",cellRenderer:!1},IA={propertyName:"headerComponent",cellRenderer:!1},LA={propertyName:"headerGroupComponent",cellRenderer:!1},lf={propertyName:"cellRenderer",cellRenderer:!0},_A={propertyName:"cellRenderer",cellRenderer:!1},OA={propertyName:"loadingCellRenderer",cellRenderer:!0},VA={propertyName:"cellEditor",cellRenderer:!1},af={propertyName:"innerRenderer",cellRenderer:!0},NA={propertyName:"loadingOverlayComponent",cellRenderer:!1},BA={propertyName:"noRowsOverlayComponent",cellRenderer:!1},GA={propertyName:"tooltipComponent",cellRenderer:!1},Wd={propertyName:"filter",cellRenderer:!1},HA={propertyName:"floatingFilterComponent",cellRenderer:!1},WA={propertyName:"toolPanel",cellRenderer:!1},zA={propertyName:"statusPanel",cellRenderer:!1},UA={propertyName:"fullWidthCellRenderer",cellRenderer:!0},$A={propertyName:"loadingCellRenderer",cellRenderer:!0},KA={propertyName:"groupRowRenderer",cellRenderer:!0},jA={propertyName:"detailCellRenderer",cellRenderer:!0},ZA={propertyName:"menuItem",cellRenderer:!1},cf=class Iw extends B{constructor(){super(...arguments),this.beanName="userComponentFactory"}wireBeans(t){this.agComponentUtils=t.agComponentUtils,this.componentMetadataProvider=t.componentMetadataProvider,this.userComponentRegistry=t.userComponentRegistry,this.frameworkComponentWrapper=t.frameworkComponentWrapper,this.gridOptions=t.gridOptions}getDragAndDropImageCompDetails(t){return this.getCompDetails(this.gridOptions,kA,"agDragAndDropImage",t,!0)}getHeaderCompDetails(t,i){return this.getCompDetails(t,IA,"agColumnHeader",i)}getHeaderGroupCompDetails(t){const i=t.columnGroup.getColGroupDef();return this.getCompDetails(i,LA,"agColumnGroupHeader",t)}getFullWidthCellRendererDetails(t){return this.getCompDetails(this.gridOptions,UA,null,t,!0)}getFullWidthLoadingCellRendererDetails(t){return this.getCompDetails(this.gridOptions,$A,"agLoadingCellRenderer",t,!0)}getFullWidthGroupCellRendererDetails(t){return this.getCompDetails(this.gridOptions,KA,"agGroupRowRenderer",t,!0)}getFullWidthDetailCellRendererDetails(t){return this.getCompDetails(this.gridOptions,jA,"agDetailCellRenderer",t,!0)}getInnerRendererDetails(t,i){return this.getCompDetails(t,af,null,i)}getFullWidthGroupRowInnerCellRenderer(t,i){return this.getCompDetails(t,af,null,i)}getCellRendererDetails(t,i){return this.getCompDetails(t,lf,null,i)}getEditorRendererDetails(t,i){return this.getCompDetails(t,_A,null,i)}getLoadingCellRendererDetails(t,i){return this.getCompDetails(t,OA,"agSkeletonCellRenderer",i,!0)}getCellEditorDetails(t,i){return this.getCompDetails(t,VA,"agCellEditor",i,!0)}getFilterDetails(t,i,s){return this.getCompDetails(t,Wd,s,i,!0)}getDateCompDetails(t){return this.getCompDetails(this.gridOptions,MA,"agDateInput",t,!0)}getLoadingOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,NA,"agLoadingOverlay",t,!0)}getNoRowsOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,BA,"agNoRowsOverlay",t,!0)}getTooltipCompDetails(t){return this.getCompDetails(t.colDef,GA,"agTooltipComponent",t,!0)}getSetFilterCellRendererDetails(t,i){return this.getCompDetails(t,lf,null,i)}getFloatingFilterCompDetails(t,i,s){return this.getCompDetails(t,HA,s,i)}getToolPanelCompDetails(t,i){return this.getCompDetails(t,WA,null,i,!0)}getStatusPanelCompDetails(t,i){return this.getCompDetails(t,zA,null,i,!0)}getMenuItemCompDetails(t,i){return this.getCompDetails(t,ZA,"agMenuItem",i,!0)}getCompDetails(t,i,s,n,o=!1){const{propertyName:r,cellRenderer:a}=i;let{compName:d,jsComp:h,fwComp:g,paramsFromSelector:f,popupFromSelector:C,popupPositionFromSelector:v}=Iw.getCompKeys(this.frameworkOverrides,t,i,n),S;const R=T=>{const I=this.userComponentRegistry.retrieve(r,T);I&&(h=I.componentFromFramework?void 0:I.component,g=I.componentFromFramework?I.component:void 0,S=I.params)};if(d!=null&&R(d),h==null&&g==null&&s!=null&&R(s),h&&a&&!this.agComponentUtils.doesImplementIComponent(h)&&(h=this.agComponentUtils.adaptFunction(r,h)),!h&&!g){o&&Ve(`Could not find component ${d}, did you forget to configure this component?`);return}const y=this.mergeParamsWithApplicationProvidedParams(t,i,n,f,S),x=h==null,P=h||g;return{componentFromFramework:x,componentClass:P,params:y,type:i,popupFromSelector:C,popupPositionFromSelector:v,newAgStackInstance:()=>this.newAgStackInstance(P,x,y,i)}}static getCompKeys(t,i,s,n){const{propertyName:o}=s;let r,a,d,h,g,f;if(i){const C=i,v=C[o+"Selector"],S=v?v(n):null,R=y=>{typeof y=="string"?r=y:y!=null&&y!==!0&&(t.isFrameworkComponent(y)?d=y:a=y)};S?(R(S.component),h=S.params,g=S.popup,f=S.popupPosition):R(C[o])}return{compName:r,jsComp:a,fwComp:d,paramsFromSelector:h,popupFromSelector:g,popupPositionFromSelector:f}}newAgStackInstance(t,i,s,n){const o=n.propertyName,r=!i;let a;if(r)a=new t;else{const h=this.componentMetadataProvider.retrieve(o);a=this.frameworkComponentWrapper.wrap(t,h.mandatoryMethodList,h.optionalMethodList,n)}const d=this.initComponent(a,s);return d==null?Zt.resolve(a):d.then(()=>a)}mergeParamsWithApplicationProvidedParams(t,i,s,n=null,o){const r=this.gos.getGridCommonParams();Tt(r,s),o&&Tt(r,o);const a=t,d=a&&a[i.propertyName+"Params"];if(typeof d=="function"){const h=d(s);Tt(r,h)}else typeof d=="object"&&Tt(r,d);return Tt(r,n),r}initComponent(t,i){if(this.createBean(t),t.init!=null)return t.init(i)}};function lr(e){const t=e;return t!=null&&t.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}var zl=class We{static register(t){We.__register(t,!0,void 0)}static registerModules(t){We.__registerModules(t,!0,void 0)}static __register(t,i,s){We.runVersionChecks(t),s!==void 0?(We.areGridScopedModules=!0,We.gridModulesMap[s]===void 0&&(We.gridModulesMap[s]={}),We.gridModulesMap[s][t.moduleName]=t):We.globalModulesMap[t.moduleName]=t,We.setModuleBased(i)}static __unRegisterGridModules(t){delete We.gridModulesMap[t]}static __registerModules(t,i,s){We.setModuleBased(i),t&&t.forEach(n=>We.__register(n,i,s))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[n,o]=We.currentModuleVersion.split(".")||[];return i===n&&s===o}static runVersionChecks(t){We.currentModuleVersion||(We.currentModuleVersion=t.version);const i=s=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${s} Please update all modules to the same version.`;if(t.version?We.isValidModuleVersion(t)||Ve(i(`'${t.moduleName}' is version ${t.version} but the other modules are version ${We.currentModuleVersion}.`)):Ve(i(`'${t.moduleName}' is incompatible.`)),t.validate){const s=t.validate();s.isValid||Ve(`${s.message}`)}}static setModuleBased(t){We.moduleBased===void 0?We.moduleBased=t:We.moduleBased!==t&&(Ve("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),Ve("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information."))}static __setIsBundled(){We.isBundled=!0}static __assertRegistered(t,i,s){var o;if(this.__isRegistered(t,s))return!0;let n;if(We.isBundled)n=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:
57
+
58
+ <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>
59
+
60
+ For more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(We.moduleBased||We.moduleBased===void 0){const r=(o=Object.entries(ut).find(([a,d])=>d===t))==null?void 0:o[0];n=`AG Grid: unable to use ${i} as the ${r} is not registered${We.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module:
61
+
62
+ import { ModuleRegistry } from '@ag-grid-community/core';
63
+ import { ${r} } from '${t}';
64
+
65
+ ModuleRegistry.registerModules([ ${r} ]);
66
+
67
+ For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else n=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:
68
+
69
+ import 'ag-grid-enterprise';`;return Ve(n),!1}static __isRegistered(t,i){var s;return!!We.globalModulesMap[t]||!!((s=We.gridModulesMap[i])!=null&&s[t])}static __getRegisteredModules(t){return[...Rl(We.globalModulesMap),...Rl(We.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){return Rl(We.gridModulesMap[t]??{})||[]}static __isPackageBased(){return!We.moduleBased}};zl.globalModulesMap={},zl.gridModulesMap={},zl.areGridScopedModules=!1;var ss=zl,qA=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,!(!e||!e.beanClasses)&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){var t;Object.entries(e.providedBeanInstances).forEach(([i,s])=>{this.beans[i]=s}),e.beanClasses.forEach(i=>{const s=new i;s.beanName?this.beans[s.beanName]=s:console.error(`Bean ${i.name} is missing beanName`),this.createdBeans.push(s)}),(t=e.derivedBeans)==null||t.forEach(i=>{const{beanName:s,bean:n}=i(this);this.beans[s]=n,this.createdBeans.push(n)}),e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.initBeans([e],t),e}initBeans(e,t){e.forEach(i=>{var s,n;(s=i.preWireBeans)==null||s.call(i,this.beans),(n=i.wireBeans)==null||n.call(i,this.beans)}),e.forEach(i=>{var s;return(s=i.preConstruct)==null?void 0:s.call(i)}),t&&e.forEach(t),e.forEach(i=>{var s;return(s=i.postConstruct)==null?void 0:s.call(i)})}getBeans(){return this.beans}getBean(e){return this.beans[e]}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=[]}destroyBean(e){var t;(t=e==null?void 0:e.destroy)==null||t.call(e)}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}},YA=class extends qA{init(e){this.gridId=e.gridId,this.beans.context=this,super.init(e)}destroy(){super.destroy(),ss.__unRegisterGridModules(this.gridId)}getGridId(){return this.gridId}},df=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(df||{}),QA=class extends B{constructor(){super(...arguments),this.beanName="dragAndDropService",this.dragSourceAndParamsList=[],this.dropTargets=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.dragService=e.dragService,this.mouseEventService=e.mouseEventService,this.environment=e.environment,this.userComponentFactory=e.userComponentFactory}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),onDragCancel:this.onDragCancel.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}getDragAndDropImageComponent(){const{dragAndDropImageComp:e}=this;return!e||!e.comp?null:e.comp}removeDragSource(e){const t=this.dragSourceAndParamsList.find(i=>i.dragSource===e);t&&(this.dragService.removeDragSource(t.params),wt(this.dragSourceAndParamsList,t))}destroy(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0,this.clearDragAndDropProperties(),super.destroy()}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){var i,s;this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),(s=(i=this.dragSource).onDragStarted)==null||s.call(i),this.createDragAndDropImageComponent()}onDragStop(e){var t,i,s;if((i=(t=this.dragSource)==null?void 0:t.onDragStopped)==null||i.call(t),(s=this.lastDropTarget)!=null&&s.onDragStop){const n=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(n)}this.clearDragAndDropProperties()}onDragCancel(){var e,t,i;(t=(e=this.dragSource)==null?void 0:e.onDragCancelled)==null||t.call(e),(i=this.lastDropTarget)!=null&&i.onDragCancel&&this.lastDropTarget.onDragCancel(this.createDropTargetEvent(this.lastDropTarget,this.eventLastTime,null,null,!1)),this.clearDragAndDropProperties()}clearDragAndDropProperties(){this.eventLastTime=null,this.dragging=!1,this.lastDropTarget=void 0,this.dragItem=null,this.dragSource=null,this.removeDragAndDropImageComponent()}onDragging(e,t=!1){var r,a,d,h;const i=this.getHorizontalDirection(e),s=this.getVerticalDirection(e);this.eventLastTime=e,this.positionDragAndDropImageComp(e);const n=this.dropTargets.filter(g=>this.isMouseOnDropTarget(e,g)),o=this.findCurrentDropTarget(e,n);if(o!==this.lastDropTarget){if(this.leaveLastTargetIfExists(e,i,s,t),this.lastDropTarget!==null&&o===null&&((a=(r=this.dragSource)==null?void 0:r.onGridExit)==null||a.call(r,this.dragItem)),this.lastDropTarget===null&&o!==null&&((h=(d=this.dragSource)==null?void 0:d.onGridEnter)==null||h.call(d,this.dragItem)),this.enterDragTargetIfExists(o,e,i,s,t),o&&this.dragAndDropImageComp){const{comp:g,promise:f}=this.dragAndDropImageComp;g?g.setIcon(o.getIconName?o.getIconName():null):f.then(C=>{C&&C.setIcon(o.getIconName?o.getIconName():null)})}this.lastDropTarget=o}else if(o&&o.onDragging){const g=this.createDropTargetEvent(o,e,i,s,t);o.onDragging(g)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const{width:s,height:n,left:o,right:r,top:a,bottom:d}=i.getBoundingClientRect();if(s===0||n===0)return!1;const h=e.clientX>=o&&e.clientX<r,g=e.clientY>=a&&e.clientY<d;if(!h||!g)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const r of i)if(this.allContainersIntersect(e,r)){s=!0;break}const{eElement:n,type:o}=this.dragSource;return t.targetContainsSource&&!t.getContainer().contains(n)?!1:s&&t.isInterestedIn(o,n)}findCurrentDropTarget(e,t){const i=t.length;if(i===0)return null;if(i===1)return t[0];const n=Yo(this.gos).elementsFromPoint(e.clientX,e.clientY);for(const o of n)for(const r of t)if(nT(this.getAllContainersFromDropTarget(r)).indexOf(o)!==-1)return r;return null}enterDragTargetIfExists(e,t,i,s,n){if(e&&e.onDragEnter){const o=this.createDropTargetEvent(e,t,i,s,n);e.onDragEnter(o)}}leaveLastTargetIfExists(e,t,i,s){if(!this.lastDropTarget)return;if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}const n=this.getDragAndDropImageComponent();n&&n.setIcon(null)}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(i=>i.external).find(i=>i.getContainer()===e.getContainer())||null}isDropZoneWithinThisGrid(e){const i=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:s}=e;return i.contains(s)}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,n){const o=e.getContainer(),r=o.getBoundingClientRect(),{dragItem:a,dragSource:d}=this,h=t.clientX-r.left,g=t.clientY-r.top;return this.gos.addGridCommonParams({event:t,x:h,y:g,vDirection:s,hDirection:i,dragSource:d,fromNudge:n,dragItem:a,dropZoneTarget:o})}positionDragAndDropImageComp(e){const t=this.getDragAndDropImageComponent();if(!t)return;const i=t.getGui(),n=i.getBoundingClientRect().height,o=YT()-2,r=QT()-2;if(!i.offsetParent)return;const d=jg(i.offsetParent),{clientY:h,clientX:g}=e;let f=h-d.top-n/2,C=g-d.left-10;const v=Xe(this.gos),S=v.defaultView||window,R=S.pageYOffset||v.documentElement.scrollTop,y=S.pageXOffset||v.documentElement.scrollLeft;o>0&&C+i.clientWidth>o+y&&(C=o+y-i.clientWidth),C<0&&(C=0),r>0&&f+i.clientHeight>r+R&&(f=r+R-i.clientHeight),f<0&&(f=0),i.style.left=`${C}px`,i.style.top=`${f}px`}removeDragAndDropImageComponent(){if(this.dragAndDropImageComp){const{comp:e}=this.dragAndDropImageComp;if(e){const t=e.getGui();this.dragAndDropImageParent&&this.dragAndDropImageParent.removeChild(t),this.destroyBean(e)}}this.dragAndDropImageComp=null}createDragAndDropImageComponent(){const{dragSource:e}=this;if(!e)return;const i=this.userComponentFactory.getDragAndDropImageCompDetails({dragSource:e}).newAgStackInstance();this.dragAndDropImageComp={promise:i},i.then(s=>{!s||!this.isAlive()||(this.processDragAndDropImageComponent(s),this.dragAndDropImageComp.comp=s)})}processDragAndDropImageComponent(e){const{dragSource:t,mouseEventService:i,environment:s}=this;if(!t)return;const n=e.getGui();n.style.setProperty("position","absolute"),n.style.setProperty("z-index","9999"),i.stampTopLevelGridCompWithGridInstance(n),s.applyThemeClasses(n),e.setIcon(null);let{dragItemName:o}=t;Qc(o)&&(o=o()),e.setLabel(o||""),n.style.top="20px",n.style.left="20px";const r=Xe(this.gos);let a=null,d=null;try{a=r.fullscreenElement}catch{}finally{a||(a=Yo(this.gos));const h=a.querySelector("body");h?d=h:a instanceof ShadowRoot?d=a:a instanceof Document?d=a==null?void 0:a.documentElement:d=a}this.dragAndDropImageParent=d,d?d.appendChild(n):W("Could not find document body, it is needed for drag and drop.")}},uf=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.indexOf("x")!==-1,this.scrollVertically=e.scrollAxis.indexOf("y")!==-1,this.scrollByTick=e.scrollByTick!=null?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)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),n=this.scrollByTick;this.tickLeft=e.clientX<s.left+n,this.tickRight=e.clientX>s.right-n,this.tickUp=e.clientY<s.top+n&&!i,this.tickDown=e.clientY>s.bottom-n&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Ul=(e=>(e[e.Above=0]="Above",e[e.Below=1]="Below",e))(Ul||{}),XA=class extends B{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.sortController=e.sortController,this.filterManager=e.filterManager,this.selectionService=e.selectionService,this.mouseEventService=e.mouseEventService,this.ctrlsService=e.ctrlsService,this.funcColsService=e.funcColsService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){Ye(this.gos)&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(this,e=>{const t=e.gridBodyCtrl;this.autoScrollService=new uf({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:i=>t.getScrollFeature().setVerticalScrollPosition(i),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?"notAllowed":"move"}shouldPreventRowMove(){var s;return!!(this.funcColsService.getRowGroupColumns().length||((s=this.filterManager)==null?void 0:s.isAnyFilterPresent())||this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const s=[...this.selectionService.getSelectedNodes()].sort((n,o)=>n.rowIndex==null||o.rowIndex==null?0:this.getRowIndexNumber(n)-this.getRowIndexNumber(o));if(s.indexOf(t)!==-1)return s}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent("rowDragEnter",e),this.getRowNodes(e).forEach(t=>{t.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}onEnterOrDragging(e){this.dispatchGridEvent("rowDragMove",e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),n=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.dragAndDropService.isDropZoneWithinThisGrid(e)&&this.clientSideRowModel.highlightRowAtPixel(n[0],t):this.moveRows(n,t))}getRowIndexNumber(e){const t=e.getRowIndexString();return parseInt(ce(t.split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&t.highlighted===1,s=this.mouseEventService.getNormalisedPosition(e).y,n=e.dragItem.rowNodes;let o=i?1:0;if(this.isFromThisGrid(e))n.forEach(r=>{r.rowTop<s&&(o-=1)}),this.moveRows(n,s,o);else{const r=Wn(this.gos);let a=this.clientSideRowModel.getRowIndexAtPixel(s)+1;this.clientSideRowModel.getHighlightPosition(s)===0&&a--,this.clientSideRowModel.updateRowData({add:n.filter(d=>!this.clientSideRowModel.getRowNode((r==null?void 0:r({data:d.data,level:0,rowPinned:d.rowPinned}))??d.data.id)).map(d=>d.data),addIndex:a})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){var n;this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),(n=this.rangeService)==null||n.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer()){W("addRowDropZone - A container target needs to be provided");return}if(this.dragAndDropService.findExternalZone(e)){W("addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");return}let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=s=>{e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",s))}),e.onDragLeave&&(t.onDragLeave=s=>{e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",s))}),e.onDragging&&(t.onDragging=s=>{e.onDragging(this.draggingToRowDragEvent("rowDragMove",s))}),e.onDragStop&&(t.onDragStop=s=>{e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",s))}),e.onDragCancel&&(t.onDragCancel=s=>{e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel",s))}));const i={isInterestedIn:s=>s===2,getIconName:()=>"move",external:!0,...t};this.dragAndDropService.addDropTarget(i),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(i))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),n=this.onDragging.bind(this),o=this.onDragStop.bind(this),r=this.onDragCancel.bind(this);let a;return e?a={getContainer:t,onDragEnter:e.onDragEnter?d=>{i(d),e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",d))}:i,onDragLeave:e.onDragLeave?d=>{s(d),e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",d))}:s,onDragging:e.onDragging?d=>{n(d),e.onDragging(this.draggingToRowDragEvent("rowDragMove",d))}:n,onDragStop:e.onDragStop?d=>{o(d),e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",d))}:o,onDragCancel:e.onDragCancel?d=>{r(d),e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel",d))}:r,fromGrid:!0}:a={getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:n,onDragStop:o,onDragCancel:r,fromGrid:!0},a}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y,s=i>this.pageBoundsService.getCurrentPageHeight();let n=-1,o;s||(n=this.rowModel.getRowIndexAtPixel(i),o=this.rowModel.getRow(n));let r;switch(t.vDirection){case 1:r="down";break;case 0:r="up";break;default:r=null;break}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:n,overNode:o,y:i,vDirection:r})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent("rowDragEnd",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&this.dragAndDropService.isDropZoneWithinThisGrid(e)&&this.moveRowAndClearHighlight(e)}onDragCancel(e){this.dispatchGridEvent("rowDragCancel",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&this.dragAndDropService.isDropZoneWithinThisGrid(e)&&this.clearRowHighlight()}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(t=>{t.setDragging(!1)})}},JA=class extends B{constructor(){super(...arguments),this.beanName="dragService",this.dragEndFunctions=[],this.dragSources=[]}wireBeans(e){this.mouseEventService=e.mouseEventService}destroy(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0,super.destroy()}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const s=e.touchStartListener;t.removeEventListener("touchstart",s,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(i=>i.dragSource===e);t&&(this.removeListener(t),wt(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:n}=e;i.addEventListener("mousedown",t);let o=null;const r=this.gos.get("suppressTouch");s&&!r&&(o=a=>{Od(a.target)||(n&&a.stopPropagation(),this.onTouchStart(e,a))},i.addEventListener("touchstart",o,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:o,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=d=>this.onTouchMove(d,e.eElement),n=d=>this.onTouchUp(d,e.eElement),o=d=>{d.cancelable&&d.preventDefault()},r=t.target,a=[{target:Yo(this.gos),type:"touchmove",listener:o,options:{passive:!1}},{target:r,type:"touchmove",listener:s,options:{passive:!0}},{target:r,type:"touchend",listener:n,options:{passive:!0}},{target:r,type:"touchcancel",listener:n,options:{passive:!0}}];this.addTemporaryEvents(a),e.dragStartPixels===0&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t)||i._alreadyProcessedByDragService||(i._alreadyProcessedByDragService=!0,t.button!==0))return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=h=>this.onMouseMove(h,e.eElement),n=h=>this.onMouseUp(h,e.eElement),o=h=>h.preventDefault(),r=h=>{h.key===N.ESCAPE&&this.cancelDrag(e.eElement)},a=Yo(this.gos),d=[{target:a,type:"mousemove",listener:s},{target:a,type:"mouseup",listener:n},{target:a,type:"contextmenu",listener:o},{target:a,type:"keydown",listener:r}];this.addTemporaryEvents(d),e.dragStartPixels===0&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(t=>{const{target:i,type:s,listener:n,options:o}=t;i.addEventListener(s,n,o)}),this.dragEndFunctions.push(()=>{e.forEach(t=>{const{target:i,type:s,listener:n,options:o}=t;i.removeEventListener(s,n,o)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams,s=j(i)?i:4;return sf(e,t,s)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(this.isEventNearStartEvent(e,t))return;this.dragging=!0,this.eventService.dispatchEvent({type:"dragStarted",target:i}),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;Gi()&&((i=Xe(this.gos).getSelection())==null||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i=e.type==="mousemove";return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=t==null?void 0:t.tagName.toLocaleLowerCase();return!!(i!=null&&i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){this.dragging&&(this.dragging=!1,this.currentDragParams.onDragStop(e),this.eventService.dispatchEvent({type:"dragStopped",target:t})),this.resetDragProperties()}cancelDrag(e){var t,i;this.eventService.dispatchEvent({type:"dragCancelled",target:e}),(i=(t=this.currentDragParams)==null?void 0:t.onDragCancel)==null||i.call(t),this.resetDragProperties()}resetDragProperties(){this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(e=>e()),this.dragEndFunctions.length=0}},zd=class extends Pe{constructor(e,t,i,s,n,o){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=n,this.suppressVisibilityChange=o,this.dragSource=null}wireBeans(e){this.beans=e}isCustomGui(){return this.customGui!=null}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(bt("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new tM(this,this.beans,this.rowNode,this.column):new eM(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e,void 0,void 0,!0),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const t=this.beans.selectionService.getSelectedNodes();return t.indexOf(this.rowNode)!==-1?t:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&W("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.getGui();this.gos.get("enableCellTextSelection")&&(this.removeMouseDownListener(),this.mouseDownListener=this.addManagedElementListeners(t,{mousedown:s=>{s==null||s.preventDefault()}})[0]);const i=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:()=>{var r;const s=this.getDragItem(),n=((r=s.rowNodes)==null?void 0:r.length)||1,o=this.getRowDragText(this.column);return o?o(s,n):n===1?this.cellValueFn():`${n} ${i("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},hf=class extends B{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let i=!0,s=!1;this.column&&(i=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),s=Qc(this.column.getColDef().rowDrag)),s?(this.parent.setDisplayed(!0,t),this.parent.setVisible(i,t)):(this.parent.setDisplayed(i,t),this.parent.setVisible(!0,t))}}},eM=class extends hf{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this));const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:e}),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}},tM=class extends hf{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.beans.eventService,{sortChanged:e,filterChanged:e,columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const t=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),i=t&&t.shouldPreventRowMove(),s=this.gos.get("suppressRowDrag"),n=this.beans.dragAndDropService.hasExternalDropZones(),o=i&&!n||s;this.setDisplayedOrVisible(o)}},iM=new Set(["localEventService","__objectId","sticky","__autoHeights","checkAutoHeightsDebounced"]),ar=class Xs{constructor(t){this.rowIndex=null,this.key=null,this.sourceRowIndex=-1,this.childrenMapped={},this.treeNode=null,this.treeNodeFlags=0,this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=Xs.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(t){this.setDataCommon(t,!1)}updateData(t){this.setDataCommon(t,!0)}setDataCommon(t,i){var o;const s=this.data;this.data=t,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(t,s,i);(o=this.localEventService)==null||o.dispatchEvent(n)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,s){return{type:"dataChanged",node:this,oldData:i,newData:t,update:s}}getRowIndexString(){return this.rowIndex==null?(Ve("Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid."),null):this.rowPinned==="top"?Xs.ID_PREFIX_TOP_PINNED+this.rowIndex:this.rowPinned==="bottom"?Xs.ID_PREFIX_BOTTOM_PINNED+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new Xs(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(t,i){var r;const s=j(this.id)?this.createDaemonNode():null,n=this.data;this.data=t,this.updateDataOnDetailNode(),this.setId(i),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,s);const o=this.createDataChangedEvent(t,n,!1);(r=this.localEventService)==null||r.dispatchEvent(o)}checkRowSelectable(){const t=ad(this.beans.gos);this.setRowSelectable(t?t(this):!0)}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.dispatchRowEvent("selectableChanged"),i)return;if(ln(this.beans.gos)){const n=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:n??!1,source:"selectableChanged"});return}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){var s;const i=Wn(this.beans.gos);if(i)if(this.data){const n=((s=this.parent)==null?void 0:s.getRoute())??[];this.id=i({data:this.data,parentKeys:n.length>0?n:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(Xs.ID_PREFIX_ROW_GROUP)&&Ve(`Row IDs cannot start with ${Xs.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`)}else this.id=void 0;else this.id=t}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.dispatchRowEvent("topChanged"),this.setDisplayed(t!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setHovered(t){this.hovered=t}isHovered(){return this.hovered}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.dispatchRowEvent("masterChanged"))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.checkRowSelectable(),this.dispatchRowEvent("groupChanged"))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.dispatchRowEvent("heightChanged")}setRowAutoHeight(t,i){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[i.getId()]=t,t!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=Pt(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){var a;let t=!1,i=!0,s=0;const n=this.__autoHeights;if(n==null||(this.beans.visibleColsService.getAllAutoHeightCols().forEach(d=>{let h=n[d.getId()];if(h==null)if(this.beans.columnModel.isColSpanActive()){let g=[];switch(d.getPinned()){case"left":g=this.beans.visibleColsService.getLeftColsForRow(this);break;case"right":g=this.beans.visibleColsService.getRightColsForRow(this);break;case null:g=this.beans.columnViewportService.getColsWithinViewport(this);break}if(g.includes(d)){t=!0;return}h=-1}else{t=!0;return}else i=!1;h>s&&(s=h)}),t)||((i||s<10)&&(s=Ps(this.beans.gos,this).height),s==this.rowHeight))return;this.setRowHeight(s);const r=this.beans.rowModel;(a=r.onRowHeightChangedDebounced)==null||a.call(r)}setExpanded(t,i,s){if(this.expanded===t)return;this.expanded=t,this.dispatchRowEvent("expandedChanged");const n={...this.createGlobalRowEvent("rowGroupOpened"),expanded:t,event:i||null};this.beans.rowNodeEventThrottle.dispatchExpanded(n,s),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(t){return this.beans.gos.addGridCommonParams({type:t,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}setDataValue(t,i,s){const o=typeof t!="string"?t:this.beans.columnModel.getCol(t)??this.beans.columnModel.getColDefCol(t),r=this.beans.valueService.getValueForDisplay(o,this);if(this.beans.gos.get("readOnlyEdit"))return this.beans.eventService.dispatchEvent({type:"cellEditRequest",event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:o,colDef:o.getColDef(),data:this.data,node:this,oldValue:r,newValue:i,value:i,source:s}),!1;const a=this.beans.valueService.setValue(this,o,i,s);return this.dispatchCellChangedEvent(o,i,r),this.checkRowSelectable(),a}setGroupValue(t,i){const s=this.beans.columnModel.getCol(t);ke(this.groupData)&&(this.groupData={});const n=s.getColId(),o=this.groupData[n];o!==i&&(this.groupData[n]=i,this.dispatchCellChangedEvent(s,i,o))}setAggData(t){const i=this.aggData;if(this.aggData=t,this.localEventService){const s=n=>{const o=this.aggData?this.aggData[n]:void 0,r=i?i[n]:void 0;if(o===r)return;const a=this.beans.columnModel.getCol(n);a&&this.dispatchCellChangedEvent(a,o,r)};for(const n in i)s(n);for(const n in t)(!i||!(n in i))&&s(n)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(Yi(this.beans.gos)){const s=this.beans.gos.get("treeData"),n=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(s?!!n&&n(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}dispatchCellChangedEvent(t,i,s){var o;const n={type:"cellChanged",node:this,column:t,newValue:i,oldValue:s};(o=this.localEventService)==null||o.dispatchEvent(n)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.footer?!1:this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(t){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(i=>i.depthFirstSearch(t)),t(this)}calculateSelectedFromChildren(){var s;let t=!1,i=!1;if(!((s=this.childrenAfterGroup)!=null&&s.length))return this.selectable?this.selected:null;for(let n=0;n<this.childrenAfterGroup.length;n++){const o=this.childrenAfterGroup[n];let r=o.isSelected();if(!o.selectable){const a=o.calculateSelectedFromChildren();if(a===null)continue;r=a}switch(r){case!0:t=!0;break;case!1:i=!0;break;default:return}}if(!(t&&i))return t?!0:i?!1:this.selectable?this.selected:null}setSelectedInitialValue(t){this.selected=t}dispatchRowEvent(t){var i;(i=this.localEventService)==null||i.dispatchEvent({type:t,node:this})}selectThisNode(t,i,s="api"){const n=!this.selectable&&t,o=this.selected===t;if(n||o)return!1;this.selected=t,this.dispatchRowEvent("rowSelected");const r=this.sibling;return r&&r.footer&&r.localEventService&&r.dispatchRowEvent("rowSelected"),this.beans.eventService.dispatchEvent({...this.createGlobalRowEvent("rowSelected"),event:i||null,source:s}),!0}setSelected(t,i=!1,s="api"){if(typeof s=="boolean"){W("since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.");return}this.setSelectedParams({newValue:t,clearSelection:i,rangeSelect:!1,source:s})}setSelectedParams(t){return this.rowPinned?(W("cannot select pinned rows"),0):this.id===void 0?(W("cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected({...t,nodes:[this.footer?this.sibling:this]})}isRowPinned(){return!!this.rowPinned}addEventListener(t,i){var n;this.localEventService||(this.localEventService=new Gn),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.localEventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new fd(this.beans.frameworkOverrides));const s=((n=this.frameworkEventListenerService)==null?void 0:n.wrap(i))??i;this.localEventService.addEventListener(t,s)}removeEventListener(t,i){var n;if(!this.localEventService)return;const s=((n=this.frameworkEventListenerService)==null?void 0:n.unwrap(i))??i;this.localEventService.removeEventListener(t,s),this.localEventService.noRegisteredListenersExist()&&(this.localEventService=null)}onMouseEnter(){this.dispatchRowEvent("mouseEnter")}onMouseLeave(){this.dispatchRowEvent("mouseLeave")}isFullWidthCell(){if(W("since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option."),this.detail)return!0;const t=this.beans.gos.getCallback("isFullWidthRow");return t?t({rowNode:this}):!1}getRoute(){if(this.level===-1)return[];if(this.key==null)return;const t=[];let i=this;for(;i&&i.key!=null;)t.push(i.key),i=i.parent;return t.reverse()}createFooter(){if(this.sibling)return;const t=new Xs(this.beans);Object.keys(this).forEach(i=>{iM.has(i)||(t[i]=this[i])}),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,t.id="rowGroupFooter_"+this.id,t.sibling=this,this.sibling=t}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}setFirstChild(t){this.firstChild!==t&&(this.firstChild=t,this.dispatchRowEvent("firstChildChanged"))}setLastChild(t){this.lastChild!==t&&(this.lastChild=t,this.dispatchRowEvent("lastChildChanged"))}setChildIndex(t){this.childIndex!==t&&(this.childIndex=t,this.dispatchRowEvent("childIndexChanged"))}setDisplayed(t){this.displayed!==t&&(this.displayed=t,this.dispatchRowEvent("displayedChanged"))}setDragging(t){this.dragging!==t&&(this.dragging=t,this.dispatchRowEvent("draggingChanged"))}setHighlighted(t){this.highlighted!==t&&(this.highlighted=t,this.dispatchRowEvent("rowHighlightChanged"))}setAllChildrenCount(t){this.allChildrenCount!==t&&(this.allChildrenCount=t,this.dispatchRowEvent("allChildrenCountChanged"))}setRowIndex(t){this.rowIndex!==t&&(this.rowIndex=t,this.dispatchRowEvent("rowIndexChanged"))}setUiLevel(t){this.uiLevel!==t&&(this.uiLevel=t,this.dispatchRowEvent("uiLevelChanged"))}};ar.ID_PREFIX_ROW_GROUP="row-group-",ar.ID_PREFIX_TOP_PINNED="t-",ar.ID_PREFIX_BOTTOM_PINNED="b-",ar.OBJECT_ID_SEQUENCE=0;var ns=ar,sM=class extends B{constructor(){super(...arguments),this.beanName="filterManager",this.advancedFilterModelUpdateQueue=[]}wireBeans(e){this.columnModel=e.columnModel,this.dataTypeService=e.dataTypeService,this.quickFilterService=e.quickFilterService,this.advancedFilterService=e.advancedFilterService,this.columnFilterService=e.columnFilterService}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvancedFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:i})=>this.onAdvancedFilterEnabledChanged(i),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",i=>this.setAdvancedFilterModel(i.currentValue)),this.quickFilterService&&this.addManagedListeners(this.quickFilterService,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"?e({}):!1}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"?t(e):!1}setFilterModel(e,t="api"){var i;if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}(i=this.columnFilterService)==null||i.setFilterModel(e,t)}getFilterModel(){var e;return((e=this.columnFilterService)==null?void 0:e.getFilterModel())??{}}isColumnFilterPresent(){var e;return!!((e=this.columnFilterService)!=null&&e.isColumnFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.columnFilterService)!=null&&e.isAggregateFilterPresent())}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t,i;e?(t=this.columnFilterService)!=null&&t.disableColumnFilters()&&this.onFilterChanged({source:"advancedFilter"}):(i=this.advancedFilterService)!=null&&i.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return!!((e=this.advancedFilterService)!=null&&e.isEnabled())}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}resetQuickFilterCache(){var e;(e=this.quickFilterService)==null||e.resetQuickFilterCache()}refreshFiltersForAggregations(){nd(this.gos)&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:i,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.columnFilterService?this.columnFilterService.updateBeforeFilterChanged(e):Zt.resolve()).then(()=>{var o;const n={source:t,type:"filterChanged",columns:s};i&&Tt(n,i),this.eventService.dispatchEvent(n),(o=this.columnFilterService)==null||o.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.columnFilterService)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilterService)!=null&&e.isQuickFilterPresent())}updateAggFiltering(){this.aggFiltering=!!nd(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.columnFilterService.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.columnFilterService.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}isFilterActive(e){var t;return!!((t=this.columnFilterService)!=null&&t.isFilterActive(e))}getOrCreateFilterWrapper(e){var t;return((t=this.columnFilterService)==null?void 0:t.getOrCreateFilterWrapper(e))??null}getDefaultFloatingFilter(e){return this.columnFilterService.getDefaultFloatingFilter(e)}createFilterParams(e,t){return this.columnFilterService.createFilterParams(e,t)}isFilterAllowed(e){var t;return this.isAdvancedFilterEnabled()?!1:!!((t=this.columnFilterService)!=null&&t.isFilterAllowed(e))}getFloatingFilterCompDetails(e,t){var i;return(i=this.columnFilterService)==null?void 0:i.getFloatingFilterCompDetails(e,t)}getCurrentFloatingFilterParentModel(e){var t;return(t=this.columnFilterService)==null?void 0:t.getCurrentFloatingFilterParentModel(e)}destroyFilter(e,t="api"){var i;(i=this.columnFilterService)==null||i.destroyFilter(e,t)}areFilterCompsDifferent(e,t){var i;return!!((i=this.columnFilterService)!=null&&i.areFilterCompsDifferent(e,t))}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){var t;if(this.isAdvancedFilterEnabled()){if((t=this.dataTypeService)!=null&&t.isPendingInference()){this.advancedFilterModelUpdateQueue.push(e);return}this.advancedFilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})}}toggleAdvancedFilterBuilder(e,t){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvancedFilterEnabled()?!1:!!((e=this.columnFilterService)!=null&&e.hasFloatingFilters())}getFilterInstance(e,t){var i;if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}return(i=this.columnFilterService)==null?void 0:i.getFilterInstance(e,t)}getColumnFilterInstance(e){var t;return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve(void 0)):((t=this.columnFilterService)==null?void 0:t.getColumnFilterInstance(e))??Promise.resolve(void 0)}warnAdvancedFilters(){W("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;(t=this.advancedFilterService)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){var t;return(t=this.columnFilterService)==null?void 0:t.getColumnFilterModel(e)}setColumnFilterModel(e,t){var i;return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve()):((i=this.columnFilterService)==null?void 0:i.setColumnFilterModel(e,t))??Promise.resolve()}setColDefPropertiesForDataType(e,t,i){var s;(s=this.columnFilterService)==null||s.setColDefPropertiesForDataType(e,t,i)}},nM=class extends Pe{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}wireBeans(e){this.filterManager=e.filterManager,this.columnModel=e.columnModel}postConstruct(){this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return!!this.filterWrapper}getFilter(){var e;return((e=this.filterWrapper)==null?void 0:e.filterPromise)??null}afterInit(){var e,t;return((t=(e=this.filterWrapper)==null?void 0:e.filterPromise)==null?void 0:t.then(()=>{}))??Zt.resolve()}afterGuiAttached(e){var t,i;(i=(t=this.filterWrapper)==null?void 0:t.filterPromise)==null||i.then(s=>{var n;(n=s==null?void 0:s.afterGuiAttached)==null||n.call(s,e)})}afterGuiDetached(){var e,t;(t=(e=this.filterWrapper)==null?void 0:e.filterPromise)==null||t.then(i=>{var s;(s=i==null?void 0:i.afterGuiDetached)==null||s.call(i)})}createFilter(e){var s,n;const{column:t,source:i}=this;this.filterWrapper=((s=this.filterManager)==null?void 0:s.getOrCreateFilterWrapper(t))??null,(n=this.filterWrapper)!=null&&n.filterPromise&&this.filterWrapper.filterPromise.then(o=>{const r=o.getGui();j(r)||W(`getGui method from filter returned ${r}; it should be a DOM element.`),this.appendChild(r),e&&this.eventService.dispatchEvent({type:"filterOpened",column:t,source:i,eGui:this.getGui()})})}onFilterDestroyed(e){(e.source==="api"||e.source==="paramsUpdated")&&e.column.getId()===this.column.getId()&&this.columnModel.getColDefCol(this.column)&&(yt(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}},pf="ag-resizer-wrapper",Is=(e,t)=>`<div data-ref="${e}Resizer" class="ag-resizer ag-resizer-${t}"></div>`,oM=`<div class="${pf}">
70
+ ${Is("eTopLeft","topLeft")}
71
+ ${Is("eTop","top")}
72
+ ${Is("eTopRight","topRight")}
73
+ ${Is("eRight","right")}
74
+ ${Is("eBottomRight","bottomRight")}
75
+ ${Is("eBottom","bottom")}
76
+ ${Is("eBottomLeft","bottomLeft")}
77
+ ${Is("eLeft","left")}
78
+ </div>`,gf=class extends B{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=Object.assign({},{popup:!1},t)}wireBeans(e){this.popupService=e.popupService,this.resizeObserverService=e.resizeObserverService,this.dragService=e.dragService}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:n,height:o,x:r,y:a}=this.config;this.offsetParent||this.setOffsetParent();let d=0,h=0;const g=jt(this.element);if(g){const f=this.findBoundaryElement(),C=window.getComputedStyle(f);if(C.minWidth!=null){const v=f.offsetWidth-this.element.offsetWidth;h=parseInt(C.minWidth,10)-v}if(C.minHeight!=null){const v=f.offsetHeight-this.element.offsetHeight;d=parseInt(C.minHeight,10)-v}}if(this.minHeight=n||d,this.minWidth=i||h,s&&this.setWidth(s),o&&this.setHeight(o),(!s||!o)&&this.refreshSize(),e)this.center();else if(r||a)this.offsetElement(r,a);else if(g&&t){let f=this.boundaryEl,C=!0;if(f||(f=this.findBoundaryElement(),C=!1),f){const v=parseFloat(f.style.top),S=parseFloat(f.style.left);C?this.offsetElement(isNaN(S)?0:S,isNaN(v)?0:v):this.setPosition(S,v)}}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 i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const s=!!e[t],n=this.getResizerElement(t),o={dragStartPixels:0,eElement:n,onDragStart:r=>this.onResizeStart(r,t),onDragging:this.onResize.bind(this),onDragStop:r=>this.onResizeEnd(r,t)};(s||!this.isAlive()&&!s)&&(s?(this.dragService.addDragSource(o),this.resizeListeners.push(o),n.style.pointerEvents="all"):n.style.pointerEvents="none",this.resizable[t]=s)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)or(i,e),e=Kg(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const n=this.getAvailableHeight();n&&e>n&&(e=n)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?or(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),o=e?this.position.y:s.top,r=e?0:n.top;let a=0;if(t){const h=this.element.parentElement;if(h){const{bottom:g}=h.getBoundingClientRect();a=g-s.bottom}}return i+r-o-a}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)Fi(t,e),e=Vl(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:n}=this.offsetParent,o=i?this.position.x:this.element.getBoundingClientRect().left;n&&e+o>n&&(e=n-o)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Fi(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const i=this.getAvailableHeight();this.element.style.setProperty("max-height",`${i}px`)};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.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:i,isTop:s,anywhereWithin:n,topBuffer:o}=e,r=t.clientX-this.dragStartPosition.x,a=t.clientY-this.dragStartPosition.y,d=this.shouldSkipX(t,!!i,!!n,r)?0:r,h=this.shouldSkipY(t,!!s,o,a)?0:a;return{movementX:d,movementY:h}}shouldSkipX(e,t,i,s){const n=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.x:n.left;let d=a<=0&&o.left>=e.clientX||o.right<=e.clientX&&o.right<=r.right;return d?!0:(t?d=s<0&&e.clientX>a+o.left||s>0&&e.clientX<a+o.left:i?d=s<0&&e.clientX>r.right||s>0&&e.clientX<a+o.left:d=s<0&&e.clientX>r.right||s>0&&e.clientX<r.right,d)}shouldSkipY(e,t,i=0,s){const n=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),a=this.config.popup?this.position.y:n.top;let d=a<=0&&o.top>=e.clientY||o.bottom<=e.clientY&&o.bottom<=r.bottom;return d?!0:(t?d=s<0&&e.clientY>a+o.top+i||s>0&&e.clientY<a+o.top:d=s<0&&e.clientY>r.bottom||s>0&&e.clientY<r.bottom,d)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[data-ref=eTopLeftResizer]")},top:{element:e.querySelector("[data-ref=eTopResizer]")},topRight:{element:e.querySelector("[data-ref=eTopRightResizer]")},right:{element:e.querySelector("[data-ref=eRightResizer]")},bottomRight:{element:e.querySelector("[data-ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[data-ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[data-ref=eBottomLeftResizer]")},left:{element:e.querySelector("[data-ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const i=new DOMParser().parseFromString(oM,"text/html").body;e.appendChild(i.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${pf}`);e&&this.element.removeChild(e),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:i,forcePopupParentAsOffsetParent:s}=this.config;!i&&!s&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(i=>!i.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const n=e[s],o=!!n.style.flex&&n.style.flex!=="0 0 auto";if(n===this.element)continue;let r=this.minHeight||0,a=this.minWidth||0;if(o){const d=window.getComputedStyle(n);d.minHeight&&(r=parseInt(d.minHeight,10)),d.minWidth&&(a=parseInt(d.minWidth,10))}else r=n.offsetHeight,a=n.offsetWidth;t+=r,i+=a}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const n=i[s];n!==t&&(e?n.style.height=`${n.offsetHeight}px`:n.style.width=`${n.offsetWidth}px`,n.style.flex="0 0 auto",n===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:n,isBottom:o,isLeft:r}=this.currentResizer,a=n||r,d=o||s,{movementX:h,movementY:g}=this.calculateMouseMovement({e,isLeft:r,isTop:s}),f=this.position.x,C=this.position.y;let v=0,S=0;if(a&&h){const R=r?-1:1,y=this.getWidth(),x=y+h*R;let P=!1;r&&(v=y-x,(f+v<=0||x<=this.minWidth)&&(P=!0,v=0)),P||this.setWidth(x)}if(d&&g){const R=s?-1:1,y=this.getHeight(),x=y+g*R;let P=!1;s?(S=y-x,(C+S<=0||x<=this.minHeight)&&(P=!0,S=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&y<x&&this.getMinSizeOfSiblings().height+x>this.element.parentElement.offsetHeight&&(P=!0),P||this.setHeight(x)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&v||S)&&this.offsetElement(f+v,C+S)}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:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:n,movementY:o}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+n,i+o),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},ff=class Lw extends B{constructor(t,i={}){super(),this.eFocusableElement=t,this.callbacks=i,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:s=>{if(s.defaultPrevented)return;const n=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,s.shiftKey);n&&(n.focus(),s.preventDefault())},...i}}wireBeans(t){this.focusService=t.focusService}postConstruct(){this.eFocusableElement.classList.add(Lw.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedElementListeners(this.eFocusableElement,{focusin:this.callbacks.onFocusIn}),this.callbacks.onFocusOut&&this.addManagedElementListeners(this.eFocusableElement,{focusout:this.callbacks.onFocusOut})}addKeyDownListeners(t){this.addManagedElementListeners(t,{keydown:i=>{if(!(i.defaultPrevented||Xi(i))){if(this.callbacks.shouldStopEventPropagation(i)){Un(i);return}i.key===N.TAB?this.callbacks.onTabKeyDown(i):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(i)}}})}};ff.FOCUS_MANAGED_CLASS="ag-focus-managed";var hn=ff,mf={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number 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"};function Ud(e,t){return $l(e)?(e.debounceMs!=null&&W("debounceMs is ignored when apply button is present"),0):e.debounceMs!=null?e.debounceMs:t}function $l(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}var rM=class extends Pe{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.eFilterBody=J,this.buttonListeners=[]}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.resetTemplate(),this.createManagedBean(new hn(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new gf(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`
79
+ <form class="ag-filter-wrapper">
80
+ <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" data-ref="eFilterBody">
81
+ ${this.createBodyTemplate()}
82
+ </div>
83
+ </form>`;this.setTemplate(i,this.getAgComponents(),e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(e){this.providedFilterParams=e,this.applyActive=$l(e),this.resetButtonsPanel(e)}updateParams(e){this.providedFilterParams=e,this.applyActive=$l(e),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(e,t){const{buttons:i,readOnly:s}=t??{},{buttons:n,readOnly:o}=e;if(s===o&&Zo(i,n))return;const r=n&&n.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(yt(this.eButtonsPanel),this.buttonListeners.forEach(h=>h()),this.buttonListeners=[]):r&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!r){this.eButtonsPanel&&Hi(this.eButtonsPanel);return}const a=document.createDocumentFragment(),d=h=>{let g,f;switch(h){case"apply":g=this.translate("applyFilter"),f=S=>this.onBtApply(!1,!1,S);break;case"clear":g=this.translate("clearFilter"),f=()=>this.onBtClear();break;case"reset":g=this.translate("resetFilter"),f=()=>this.onBtReset();break;case"cancel":g=this.translate("cancelFilter"),f=S=>{this.onBtCancel(S)};break;default:W("Unknown button type specified");return}const v=is(`<button
84
+ type="${h==="apply"?"submit":"button"}"
85
+ data-ref="${h}FilterButton"
86
+ class="ag-button ag-standard-button ag-filter-apply-panel-button"
87
+ >${g}
88
+ </button>`);this.buttonListeners.push(...this.addManagedElementListeners(v,{click:f})),a.append(v)};n.forEach(h=>d(h)),this.eButtonsPanel.append(a),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=Ud(this.providedFilterParams,this.getDefaultDebounceMs()),t=Pt(this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(e!=null?this.setModelIntoUi(e):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(e)})}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),t==null||t()};e!=null?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")&&this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:"columnFilter"});const{closeOnApply:s}=this.providedFilterParams;s&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let s;(i==="Enter"||i==="Space")&&(s={keyboardEvent:t}),this.hidePopup(s),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const i=this.isModelValid(this.getModelFromUi()),s=this.queryForHtmlElement('[data-ref="applyFilterButton"]');s&&nr(s,!i)}e&&!t||t==="immediately"?this.onBtApply(e):(!this.applyActive&&!t||t==="debounce")&&this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e==null?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||e==="toolPanel")return;const t=e==="floatingFilter"||e==="columnFilter",{positionableFeature:i,gos:s}=this;t?(i.restoreLastSize(),i.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}refresh(e){const t=this.providedFilterParams;return this.providedFilterParams=e,this.resetButtonsPanel(e,t),!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,mf[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}},lM=class extends Gd{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},aM=class extends Pe{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=t,this.activeClass="ag-active-item",this.options=[],this.itemEls=[]}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()}),!this.unFocusable&&this.addManagedElementListeners(e,{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){const t=e.key;switch(t){case N.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{const i=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(i)}break;case N.DOWN:case N.UP:e.preventDefault(),this.navigate(t);break;case N.PAGE_DOWN:case N.PAGE_UP:case N.PAGE_HOME:case N.PAGE_END:e.preventDefault(),this.navigateToPage(t);break}}navigate(e){const t=e===N.DOWN;let i;if(!this.highlightedEl)i=this.itemEls[t?0:this.itemEls.length-1];else{let n=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);n=Math.min(Math.max(n,0),this.itemEls.length-1),i=this.itemEls[n]}this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||this.itemEls.length===0)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,s=this.itemEls[0].clientHeight,n=Math.floor(this.getGui().clientHeight/s);let o=-1;e===N.PAGE_HOME?o=0:e===N.PAGE_END?o=i:e===N.PAGE_DOWN?o=Math.min(t+n,i):e===N.PAGE_UP&&(o=Math.max(t-n,0)),o!==-1&&this.highlightItem(this.itemEls[o])}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){const{value:t,text:i}=e,s=i||t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach(e=>{Hi(e)}),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{HT(t,i+1),GT(t,e.length)})}renderOption(e,t){const i=Xe(this.gos),s=i.createElement("div");Vt(s,"option"),s.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const n=i.createElement("span");s.appendChild(n),n.textContent=t,this.unFocusable||(s.tabIndex=-1),this.itemEls.push(s),this.addManagedListeners(s,{mouseover:()=>this.highlightItem(s),mousedown:o=>{o.preventDefault(),o.stopPropagation(),this.setValue(e)}}),this.createManagedBean(new Yn({getTooltipValue:()=>t,getGui:()=>s,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>n.scrollWidth>n.clientWidth})),this.getGui().appendChild(s)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(t),this;const i=this.options.findIndex(s=>s.value===e);if(i!==-1){const s=this.options[i];this.value=s.value,this.displayValue=s.text,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(e){if(!jt(e))return;this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(this.activeClass),Il(this.highlightedEl,!0);const t=this.getGui(),{scrollTop:i,clientHeight:s}=t,{offsetTop:n,offsetHeight:o}=e;(n+o>i+s||n<i)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){!this.highlightedEl||!jt(this.highlightedEl)||(this.highlightedEl.classList.remove(this.activeClass),Il(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},cM=class extends nf{constructor(e){if(super(e,(e==null?void 0:e.template)||`
89
+ <div class="ag-picker-field" role="presentation">
90
+ <div data-ref="eLabel"></div>
91
+ <div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">
92
+ <div data-ref="eDisplayField" class="ag-picker-field-display"></div>
93
+ <div data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
94
+ </div>
95
+ </div>`,(e==null?void 0:e.agComponents)||[],e==null?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=J,this.eWrapper=J,this.eDisplayField=J,this.eIcon=J,this.ariaRole=e==null?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:n,maxPickerWidth:o}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!s,i!=null&&this.setPickerMaxHeight(i),n!=null&&this.setPickerMinWidth(n),o!=null&&this.setPickerMaxWidth(o)}wireBeans(e){this.popupService=e.popupService}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:i,inputWidth:s}=this.config;if(i){const n=bt(i,this.gos);n&&this.eIcon.appendChild(n)}s!=null&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),sr(e,!1),this.ariaRole&&Vt(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(e==null?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case N.UP:case N.DOWN:case N.ENTER:case N.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case N.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const t=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:i,pickerAriaLabelValue:s,modalPicker:n=!0}=this.config,o={modal:n,eChild:e,closeOnEsc:!0,closedCallback:()=>{const C=fg(this.gos);this.beforeHidePicker(),C&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:t(i,s),anchorToElement:this.eWrapper};e.style.position="absolute";const r=this.popupService.addPopup(o),{maxPickerHeight:a,minPickerWidth:d,maxPickerWidth:h,variableWidth:g}=this;g?(d&&(e.style.minWidth=d),e.style.width=Vd(Vl(this.eWrapper)),h&&(e.style.maxWidth=h)):Hl(e,h??Vl(this.eWrapper));const f=a??`${Ol(this.popupService.getPopupParent())}px`;return e.style.setProperty("max-height",f),this.alignPickerToComponent(),r.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();sr(t,e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(t=this.pickerComponent)!=null&&t.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return Hl(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},$d=class extends cM{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox",...e})}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),i&&t==null&&(this.eDisplayField.textContent=i),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new aM("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),ZT(this.getAriaElement(),e),this.listComponent.addManagedListeners(this.listComponent,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})}}),this.listComponent.addManagedListeners(this.listComponent,{fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}onKeyDown(e){var i;const{key:t}=e;switch(t===N.TAB&&this.hidePicker(),t){case N.ENTER:case N.UP:case N.DOWN:case N.PAGE_UP:case N.PAGE_DOWN:case N.PAGE_HOME:case N.PAGE_END:e.preventDefault(),this.isPickerDisplayed?(i=this.listComponent)==null||i.handleKeyDown(e):super.onKeyDown(e);break;case N.ESCAPE:super.onKeyDown(e);break;case N.SPACE:this.isPickerDisplayed?e.preventDefault():super.onKeyDown(e);break}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){var e;return(e=this.listComponent)==null||e.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let n=this.listComponent.getDisplayValue();return n==null&&this.config.placeholder&&(n=this.config.placeholder),this.eDisplayField.textContent=n,this.setTooltip({newTooltipText:n??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),super.destroy()}},dM={selector:"AG-SELECT",component:$d},Cf=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{if(typeof e=="string")return;const t=[["displayKey"],["displayName"],["predicate","test"]],i=s=>s.some(n=>e[n]!=null)?!0:(W(`ignoring FilterOptionDef as it doesn't contain one of '${s}'`),!1);if(!t.every(i)){this.filterOptions=this.filterOptions.filter(s=>s===e)||[];return}this.customFilterOptions[e.displayKey]=e})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const t=this.filterOptions[0];typeof t=="string"?this.defaultOption=t:t.displayKey?this.defaultOption=t.displayKey:W("invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else W("no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},vf=class extends rM{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:s}=t;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{i===0?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return this.eJoinOperatorsOr.length===0?this.defaultJoinOperator:this.eJoinOperatorsOr[0].getValue()===!0?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let o;if(i){const r=e,a=t;o=this.areSimpleModelsEqual(r,a)}else{const r=e,a=t;o=r.operator===a.operator&&Ni(r.conditions,a.conditions,(d,h)=>this.areSimpleModelsEqual(d,h))}return o}shouldRefresh(e){var o;const t=this.getModel(),i=t?t.conditions??[t]:null,s=((o=e.filterOptions)==null?void 0:o.map(r=>typeof r=="string"?r:r.displayKey))??this.getDefaultFilterOptions();return!(!(!i||i.every(r=>s.find(a=>a===r.type)!==void 0))||typeof e.maxNumConditions=="number"&&i&&i.length>e.maxNumConditions)}refresh(e){return!this.shouldRefresh(e)||!super.refresh(e)?!1:(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){const i=e;let s=i.conditions;s==null&&(s=[],W("Filter model is missing 'conditions'"));const n=this.validateAndUpdateConditions(s),o=this.getNumConditions();if(n<o)this.removeConditionsAndOperators(n);else if(n>o)for(let a=o;a<n;a++)this.createJoinOperatorPanel(),this.createOption();const r=i.operator==="OR";this.eJoinOperatorsAnd.forEach(a=>a.setValue(!r,!0)),this.eJoinOperatorsOr.forEach(a=>a.setValue(r,!0)),s.forEach((a,d)=>{this.eTypes[d].setValue(a.type,!0),this.setConditionIntoUi(a,d)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),Zt.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),W('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){const t=this.getModel();if(t==null)return!0;const{operator:i}=t,s=[];if(i){const o=t;s.push(...o.conditions??[])}else s.push(t);return s[i&&i==="OR"?"some":"every"](o=>this.individualConditionPasses(e,o))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Cf,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){this.maxNumConditions=e.maxNumConditions??2,this.maxNumConditions<1&&(W('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=e.numAlwaysVisibleConditions??1,this.numAlwaysVisibleConditions<1&&(W('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(W('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new $d);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,s=>this.resetInput(s)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,n=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,n),this.resetJoinOperatorOr(i,s,n),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new lM);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return e==="AND"||e==="OR"?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(t=>typeof t=="string"?this.createBoilerplateListOption(t):this.createCustomListOption(t))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}createBodyTemplate(){return""}getAgComponents(){return[]}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let i=0;i<this.getNumConditions();i++)this.isConditionUiComplete(i)?e=i:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const i=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<i){this.removeConditionsAndOperators(i+1);const s=e+1,n=i-s;n>0&&this.removeConditionsAndOperators(s,n),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,n)=>{const o=this.isConditionDisabled(n,e);s.setDisabled(o||this.filterListOptions.length<=1),n===1&&(nr(this.eJoinOperatorPanels[0],o),this.eJoinOperatorsAnd[0].setDisabled(o),this.eJoinOperatorsOr[0].setDisabled(o))}),this.eConditionBodies.forEach((s,n)=>{je(s,this.isConditionBodyVisible(n))});const i=(t??this.getJoinOperator())==="OR";this.eJoinOperatorsAnd.forEach(s=>{s.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach(s=>{s.setValue(i,!0)}),this.forEachInput((s,n,o,r)=>{this.setElementDisplayed(s,n<r),this.setElementDisabled(s,this.isConditionDisabled(o,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(n=>Hi(n))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(n=>{Hi(n.getGui()),this.destroyBean(n)})}removeItems(e,t,i){return i==null?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const t=this.getInputs(0)[0];if(!t)return;t instanceof un&&t.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const n=this.getJoinOperator();for(let r=this.getNumConditions()-1;r>=0;r--)if(this.isConditionUiComplete(r))t===-1&&(t=r,i=r);else{const a=r>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(r-1),d=r<t;(a||d)&&(this.removeConditionsAndOperators(r,1),s=!0,d&&i--)}let o=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),o=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),o=!0),o&&this.updateConditionStatusesAndValues(i,n),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(Qc(this.filterPlaceholder)){const s=this.filterPlaceholder,n=this.eTypes[t].getValue(),o=this.translate(n);i=s({filterOptionKey:n,filterOption:o,placeholder:i})}else typeof this.filterPlaceholder=="string"&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,s,n)=>{if(!(t instanceof un))return;const o=i===0&&n>1?"inRangeStart":i===0?"filterOoo":"inRangeEnd",r=i===0&&n>1?e("ariaFilterFromValue","Filter from value"):i===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(o,s)),t.setInputAriaLabel(r)})}setElementValue(e,t,i){e instanceof un&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Pe&&je(e.getGui(),t)}setElementDisabled(e,t){e instanceof Pe&&nr(e.getGui(),t)}attachElementOnChange(e,t){e instanceof un&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),n=this.getInputs(e);for(let o=0;o<n.length;o++){const r=n[o];r!=null&&i(r,o,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(i=>i==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinOperatorsAnd.forEach((t,i)=>this.resetJoinOperatorAnd(t,i,this.joinOperatorId+i)),this.eJoinOperatorsOr.forEach((t,i)=>this.resetJoinOperatorOr(t,i,this.joinOperatorId+i)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),Zt.resolve()}resetType(e){const i=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(i).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,n){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${n}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput((s,n,o)=>{o===t&&this.setElementValue(s,i[n]!=null?i[n]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,s)=>{this.setElementValue(t,i===0&&s===0?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,i=>{this.attachElementOnChange(i,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),n=this.optionsFactory.getCustomOption(t.type),o=this.evaluateCustomFilter(n,s,i);return o??(i==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e))}evaluateCustomFilter(e,t,i){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(n=>n==null))return s(t,i)}isBlank(e){return e==null||typeof e=="string"&&e.trim().length===0}hasInvalidInputs(){return!1}},wf=class extends vf{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case"equals":if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case"notEqual":if(this.scalarFilterParams.includeBlanksInNotEqual)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case"lessThan":case"lessThanOrEqual":if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case"inRange":if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,i){const s=this.comparator(),n=e[0]!=null?s(e[0],t):0;switch(i.type){case"equals":return n===0;case"notEqual":return n!==0;case"greaterThan":return n>0;case"greaterThanOrEqual":return n>=0;case"lessThan":return n<0;case"lessThanOrEqual":return n<=0;case"inRange":{const o=s(e[1],t);return this.scalarFilterParams.inRangeInclusive?n>=0&&o<=0:n>0&&o<0}case"blank":return this.isBlank(t);case"notBlank":return!this.isBlank(t);default:return W('Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},uM=65,hM=67,pM=86,gM=68,fM=90,mM=89;function Sf(e){var i;return e.altKey||e.ctrlKey||e.metaKey?!1:((i=e.key)==null?void 0:i.length)===1}function Kd(e,t,i,s,n){const o=s?s.getColDef().suppressKeyboardEvent:void 0;if(!o)return!1;const r=e.addGridCommonParams({event:t,editing:n,column:s,node:i,data:i.data,colDef:s.getColDef()});return!!(o&&o(r))}function CM(e,t,i,s){const n=s.getDefinition(),o=n&&n.suppressHeaderKeyboardEvent;if(!j(o))return!1;const r=e.addGridCommonParams({colDef:n,column:s,headerRowIndex:i,event:t});return!!o(r)}function vM(e){const{keyCode:t}=e;let i;switch(t){case uM:i=N.A;break;case hM:i=N.C;break;case pM:i=N.V;break;case gM:i=N.D;break;case fM:i=N.Z;break;case mM:i=N.Y;break;default:i=e.code}return i}function wM(e,t=!1){return e===N.DELETE?!0:!t&&e===N.BACKSPACE?Wg():!1}var pn=class extends un{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=j(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=i=>{Sf(i)&&i.key&&!e.test(i.key)&&i.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:i=>{var n;const s=(n=i.clipboardData)==null?void 0:n.getData("text");s&&s.split("").some(o=>!e.test(o))&&i.preventDefault()}})}},Kl={selector:"AG-INPUT-TEXT-FIELD",component:pn},jd=class extends pn{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListeners(this.eInput,{blur:()=>{const n=parseFloat(this.eInput.value),o=isNaN(n)?"":this.normalizeValue(n.toString());this.value!==o&&this.setValue(o)},wheel:this.onWheel.bind(this)}),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;typeof e=="number"&&this.setPrecision(e),typeof t=="number"&&this.setMin(t),typeof i=="number"&&this.setMax(i),typeof s=="number"&&this.setStep(s)}onWheel(e){Ke(this.gos)===this.eInput&&e.preventDefault()}normalizeValue(e){if(e==="")return"";this.precision!=null&&(e=this.adjustPrecision(e));const t=parseFloat(e);return this.min!=null&&t<this.min?e=this.min.toString():this.max!=null&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(this.precision==null)return e;if(t){const s=parseFloat(e).toFixed(this.precision);return parseFloat(s).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,ri(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,ri(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,ri(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(i=>super.setValue(i,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,i){if(j(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(!s){i=this.adjustPrecision(i);const n=this.normalizeValue(i);s=i!=n}if(s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},SM={selector:"AG-INPUT-NUMBER-FIELD",component:jd},yf=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],Zd=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=e.operator!=null,i=this.localeService.getLocaleTextFunc();if(t){const s=e,o=(s.conditions??[]).map(a=>this.getModelAsString(a)),r=s.operator==="AND"?"andCondition":"orCondition";return o.join(` ${i(r,mf[r])} `)}else{if(e.type==="blank"||e.type==="notBlank")return i(e.type,e.type);{const s=e,n=this.optionsFactory.getCustomOption(s.type),{displayKey:o,displayName:r,numberOfInputs:a}=n||{};return o&&r&&a===0?(i(o,r),r):this.conditionToString(s,n)}}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){return this.valueFormatter?this.valueFormatter(e??null)??"":String(e)}},bf=class extends Zd{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:e.filter!=null?this.formatValue(e.filter):`${e.type}`}};function qd(e){const{allowedCharPattern:t}=e??{};return t??null}var yM=class extends wf{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern!==e.allowedCharPattern?!1:super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new bf(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return yf}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,s)}createValueElement(){const e=qd(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),Vt(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const n=this.createManagedBean(s?new pn({allowedCharPattern:s}):new jd);n.addCssClass(`ag-filter-${i}`),n.addCssClass("ag-filter-filter"),t.push(n),e.appendChild(n.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,n,o)=>{s<o&&t.push(this.processValue(this.stringToFloat(i.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return e==null||isNaN(e)?null:e}stringToFloat(e){if(typeof e=="number")return e;let t=yi(e);return t!=null&&t.trim()===""&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):t==null||t.trim()==="-"?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{if(!t.getInputElement().validity.valid){e=!0;return}}),e}},Rf=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Ff=class extends Zd{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${e.filter}-${e.filterTo}`:e.filter!=null?`${e.filter}`:`${e.type}`}};function xf(e){const t=e&&e.trim();return t===""?e:t}var bM=class extends vf{constructor(){super("textFilter"),this.defaultFormatter=e=>e,this.defaultLowercaseFormatter=e=>e==null?null:e.toString().toLowerCase(),this.defaultMatcher=({filterOption:e,value:t,filterText:i})=>{if(i==null)return!1;switch(e){case"contains":return t.indexOf(i)>=0;case"notContains":return t.indexOf(i)<0;case"equals":return t===i;case"notEqual":return t!=i;case"startsWith":return t.indexOf(i)===0;case"endsWith":{const s=t.lastIndexOf(i);return s>=0&&s===t.length-i.length}default:return!1}},this.eValuesFrom=[],this.eValuesTo=[]}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?this.defaultFormatter:this.defaultLowercaseFormatter),this.filterModelFormatter=new Ff(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(W("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:i,filterText:s})=>e(t,i,s)):this.textFilterParams.textMatcher||this.defaultMatcher}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const i=[];return this.forEachPositionInput(e,(s,n,o,r)=>{if(n<r){let a=yi(s.getValue());t&&this.textFilterParams.trimInput&&(a=xf(a)??null,s.setValue(a,!0)),i.push(a)}}),i}getDefaultFilterOptions(){return Rf}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),Vt(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new pn);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,i,s){const n=e.map(C=>this.formatter(C))||[],o=this.formatter(t),{api:r,colDef:a,column:d,context:h,textFormatter:g}=this.textFilterParams;if(i.type==="blank")return this.isBlank(t);if(i.type==="notBlank")return!this.isBlank(t);const f={api:r,colDef:a,column:d,context:h,node:s.node,data:s.data,filterOption:i.type,value:o,textFormatter:g};return n.some(C=>this.matcher({...f,filterText:C}))}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}};function Ef(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=parseInt(e);return isNaN(t)?void 0:t}}function Wi(e,t=Number.MAX_VALUE){return i=>{const s=Ef(i);if(!(s==null||s<e||s>t))return s}}function cr(e,t){return e.toString().padStart(t,"0")}function RM(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function FM(e,t,i){return typeof e!="number"?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function li(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(n=>cr(n,2)).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(n=>cr(n,2)).join(":")),s}var Yd=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function dr(e,t="YYYY-MM-DD"){const i=cr(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>cr(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Yd(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Yd(e.getDate())}`,DD:()=>cr(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>n[e.getDay()],ddd:()=>n[e.getDay()].slice(0,3),dd:()=>n[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Yd(e.getDay())}`,d:()=>`${e.getDay()}`},r=new RegExp(Object.keys(o).join("|"),"g");return t.replace(r,a=>a in o?o[a]():a)}function Nt(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map(f=>parseInt(f,10));if(s.filter(f=>!isNaN(f)).length!==3)return null;const[n,o,r]=s,a=new Date(n,o-1,r);if(a.getFullYear()!==n||a.getMonth()!==o-1||a.getDate()!==r)return null;if(!i||i==="00:00:00")return a;const[d,h,g]=i.split(":").map(f=>parseInt(f,10));return d>=0&&d<24&&a.setHours(d),h>=0&&h<60&&a.setMinutes(h),g>=0&&g<60&&a.setSeconds(g),a}var Pf=class{constructor(e,t,i,s,n){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then(a=>{if(!this.alive){e.destroyBean(a);return}this.dateComp=a,a&&(s.appendChild(a.getGui()),a.afterGuiAttached&&a.afterGuiAttached(),this.tempValue&&a.setDate(this.tempValue),this.disabled!=null&&this.setDateCompDisabled(this.disabled),n==null||n(this))})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){je(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(e)}updateParams(e){var i,s;let t=!1;(i=this.dateComp)!=null&&i.refresh&&typeof this.dateComp.refresh=="function"&&this.dateComp.refresh(e)!==null&&(t=!0),!t&&((s=this.dateComp)!=null&&s.onParamsUpdated)&&typeof this.dateComp.onParamsUpdated=="function"&&this.dateComp.onParamsUpdated(e)!==null&&W("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(e)}},Df=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],Tf=class extends Zd{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},n=i=="inRange"||s===2,o=Nt(e.dateFrom),r=Nt(e.dateTo),a=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(n){const d=o!==null?dr(o,a):"null",h=r!==null?dr(r,a):"null";return`${d}-${h}`}return o!=null?dr(o,a):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},Af=1e3,Mf=1/0,xM=class extends wf{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=Af,this.maxValidYear=Mf,this.minValidDate=null,this.maxValidDate=null}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&Nt(t)||null,i&&Nt(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){const i=t;return t==null||i<e?-1:i>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(i,s)=>{if(e[i]!=null)if(isNaN(e[i]))W(`DateFilter ${i} is not a number`);else return e[i]==null?s:Number(e[i]);return s};this.minValidYear=t("minValidYear",Af),this.maxValidYear=t("maxValidYear",Mf),this.minValidYear>this.maxValidYear&&W("DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:Nt(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:Nt(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&W("DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Tf(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new Pf(this.context,this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return Df}createValueElement(){const t=Xe(this.gos).createElement("div");return t.classList.add("ag-filter-body"),this.createFromToElement(t,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(t,this.eConditionPanelsTo,this.dateConditionToComps,"to"),t}createFromToElement(e,t,i,s){const o=Xe(this.gos).createElement("div");o.classList.add(`ag-filter-${s}`),o.classList.add(`ag-filter-date-${s}`),t.push(o),e.appendChild(o),i.push(this.createDateCompWrapper(o))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(n=>n.destroy())}isValidDateValue(e){if(e===null)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((i,s,n,o)=>{n!==e||!t||s>=o||(t=t&&this.isValidDateValue(i.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=li(s[0])),s.length>1&&(i.dateTo=li(s[1])),{dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t,...i}}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,n,o)=>{s<o&&t.push(i.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}},Qd=class extends B{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?ce(this.colsSpanning):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 e=this.beans.gos.get("suppressColumnMoveAnimation"),t=j(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),n=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=n,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===n&&this.setLeft(n)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!ht(this.beans.gos,"print")||e.getPinned()==="left")return t;const s=this.beans.visibleColsService.getColsLeftWidth();if(e.getPinned()==="right"){const n=this.beans.visibleColsService.getBodyContainerWidth();return s+n+t}return s+t}setLeft(e){if(j(e)&&(this.eCell.style.left=`${e}px`),ot(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&$T(this.ariaEl,t.length)}}},EM="ag-column-first",PM="ag-column-last";function kf(e,t,i,s){return ke(e)?[]:TM(e.headerClass,e,t,i,s)}function If(e,t,i){e.addOrRemoveCssClass(EM,i.isColAtEdge(t,"first")),e.addOrRemoveCssClass(PM,i.isColAtEdge(t,"last"))}function DM(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}function TM(e,t,i,s,n){if(ke(e))return[];let o;if(typeof e=="function"){const r=DM(t,i,s,n);o=e(r)}else o=e;return typeof o=="string"?[o]:Array.isArray(o)?[...o]:[]}var AM=0,Lf=class _w extends B{constructor(t,i,s){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=t,this.parentRowCtrl=s,this.beans=i,this.instanceId=t.getUniqueId()+"-"+AM++}wireBeans(t){this.pinnedWidthService=t.pinnedWidthService,this.focusService=t.focusService,this.userComponentFactory=t.userComponentFactory,this.ctrlsService=t.ctrlsService,this.dragAndDropService=t.dragAndDropService,this.menuService=t.menuService}postConstruct(){const t=this.refreshTabIndex.bind(this);this.addManagedPropertyListeners(["suppressHeaderFocus"],t),this.addManagedEventListeners({overlayExclusiveChanged:t})}shouldStopEventPropagation(t){const{headerRowIndex:i,column:s}=this.focusService.getFocusedHeader();return CM(this.gos,t,i,s)}getWrapperHasFocus(){return Ke(this.gos)===this.eGui}setGui(t,i){this.eGui=t,this.addDomData(i),i.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),i.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onGuiFocus(){this.eventService.dispatchEvent({type:"headerFocused",column:this.column})}setupAutoHeight(t){const{wrapperElement:i,checkMeasuringCallback:s,compBean:n}=t,{animationFrameService:o,resizeObserverService:r,columnModel:a,gos:d}=this.beans,h=R=>{if(!this.isAlive()||!n.isAlive())return;const{paddingTop:y,paddingBottom:x,borderBottomWidth:P,borderTopWidth:T}=dn(this.getGui()),I=y+x+P+T,_=i.offsetHeight+I;if(R<5){const O=Xe(d),M=!O||!O.contains(i),A=_==0;if(M||A){o.requestAnimationFrame(()=>h(R+1));return}}a.setColHeaderHeight(this.column,_)};let g=!1,f;const C=()=>{const R=this.column.isAutoHeaderHeight();R&&!g&&v(),!R&&g&&S()},v=()=>{g=!0,h(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),f=r.observeResize(i,()=>h(0))},S=()=>{g=!1,f&&f(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),f=void 0};C(),n.addDestroyFunc(()=>S()),n.addManagedListeners(this.column,{widthChanged:()=>g&&h(0)}),n.addManagedEventListeners({sortChanged:()=>{g&&window.setTimeout(()=>h(0))}}),s&&s(C)}onDisplayedColumnsChanged(){const{comp:t,column:i,beans:s,eGui:n}=this;!t||!i||!n||(If(t,i,s.visibleColsService),Gg(n,s.visibleColsService.getAriaColIndex(i)))}addResizeAndMoveKeyboardListeners(t){this.resizeFeature&&t.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){const t=this.focusService.isHeaderFocusSuppressed();this.eGui&&ri(this.eGui,"tabindex",t?null:"-1")}onGuiKeyDown(t){var r;const i=Ke(this.gos),s=t.key===N.LEFT||t.key===N.RIGHT;if(this.isResizing&&(t.preventDefault(),t.stopImmediatePropagation()),i!==this.eGui||!t.shiftKey&&!t.altKey||((this.isResizing||s)&&(t.preventDefault(),t.stopImmediatePropagation()),!s))return;const n=t.key===N.LEFT!==this.gos.get("enableRtl"),o=df[n?"Left":"Right"];if(t.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const a=this.getViewportAdjustedResizeDiff(t);this.resizeHeader(a,t.shiftKey),(r=this.resizeFeature)==null||r.toggleColumnResizing(!0)}else this.moveHeader(o)}getViewportAdjustedResizeDiff(t){let i=this.getResizeDiff(t);if(this.column.getPinned()){const n=this.pinnedWidthService.getPinnedLeftWidth(),o=this.pinnedWidthService.getPinnedRightWidth(),r=Zn(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(n+o+i>r)if(r>n+o)i=r-n-o;else return 0}return i}getResizeDiff(t){let i=t.key===N.LEFT!==this.gos.get("enableRtl");const s=this.column.getPinned(),n=this.gos.get("enableRtl");return s&&n!==(s==="right")&&(i=!i),(i?-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(()=>{var t;(t=this.resizeFeature)==null||t.toggleColumnResizing(!1)},150))}handleKeyDown(t){const i=this.getWrapperHasFocus();switch(t.key){case N.PAGE_DOWN:case N.PAGE_UP:case N.PAGE_HOME:case N.PAGE_END:i&&t.preventDefault()}}addDomData(t){const i=_w.DOM_DATA_KEY_HEADER_CTRL;rn(this.gos,this.eGui,i,this),t.addDestroyFunc(()=>rn(this.gos,this.eGui,i,null))}getGui(){return this.eGui}focus(t){return this.eGui?(this.lastFocusEvent=t||null,this.eGui.focus(),!0):!1}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(t,i,s){const n=t??i;this.gos.get("preventDefaultOnContextMenu")&&n.preventDefault(),this.menuService.isHeaderContextMenuEnabled(s)&&this.menuService.showHeaderContextMenu(s,t,i),this.dispatchColumnMouseEvent("columnHeaderContextMenu",s)}dispatchColumnMouseEvent(t,i){this.eventService.dispatchEvent({type:t,column:i})}clearComponent(){this.removeDragSource(),this.resizeFeature=null,this.comp=null,this.eGui=null}destroy(){super.destroy(),this.column=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null}};Lf.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";var jl=Lf,Xd=class extends B{wireBeans(e){this.columnHoverService=e.columnHoverService}constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListeners(this.element,{mouseout:this.onMouseOut.bind(this),mouseover:this.onMouseOver.bind(this)})}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}},MM=class extends jl{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s,n){this.comp=e,n=tr(this,this.beans.context,n),this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t,n),this.setupActive(),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),n.addManagedListeners(this.column,{colDefChanged:()=>this.onColDefChanged(n)}),n.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}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=bt("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new hn(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.localeService.getLocaleTextFunc();Kn(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(Ke(this.gos)===this.eGui)return;const s=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(s){this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const n=this.findNextColumnWithFloatingFilter(e.shiftKey);n&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:n},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleColsService;let i=this.column;do if(i=e?t.getColBefore(i):t.getColAfter(i),!i)break;while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case N.UP:case N.DOWN:t||e.preventDefault();case N.LEFT:case N.RIGHT:if(t)return;e.stopPropagation();case N.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case N.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const i=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&jn(e.relatedTarget,"ag-floating-filter");if(i&&s&&e.target===this.eGui){const o=this.lastFocusEvent,r=!!(o&&o.key===N.TAB);if(o&&r){const a=o.shiftKey;this.focusService.focusInto(this.eGui,a)}}const n=this.getRowIndex();this.beans.focusService.setFocusedHeader(n,this.column)}setupHover(e){e.createManagedBean(new Xd([this.column],this.eGui));const t=()=>{if(!this.gos.get("columnHoverHighlight"))return;const i=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:t}),t()}setupLeft(e){const t=new Qd(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.filterManager)==null?void 0:t.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.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{filterManager:t}=this.beans,i=s=>{if((s==null?void 0:s.source)==="filterDestroyed"&&!this.isAlive())return;const n=this.comp.getFloatingFilterComp();n&&n.then(o=>{if(o){const r=t==null?void 0:t.getCurrentFloatingFilterParentModel(this.column),a=s?{...s,columns:s.columns??[],source:s.source==="api"?"api":"columnFilter"}:null;o.onParentModelChanged(r,a)}})};[this.destroySyncListener]=e.addManagedListeners(this.column,{filterChanged:i}),t!=null&&t.isFilterActive(this.column)&&i(null)}setupWidth(e){const t=()=>{const i=`${this.column.getActualWidth()}px`;this.comp.setWidth(i)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){var o;const t=this.active;this.setupActive();const i=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.active?(o=this.beans.filterManager)==null?void 0:o.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,n=this.comp.getFloatingFilterComp();!n||!s?this.updateCompDetails(e,s,i):n.then(r=>{var a;!r||(a=this.beans.filterManager)!=null&&a.areFilterCompsDifferent(this.userCompDetails??null,s)?this.updateCompDetails(e,s,i):this.updateFloatingFilterParams(s)})}updateCompDetails(e,t,i){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),i&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e){var i;if(!e)return;const t=e.params;(i=this.comp.getFloatingFilterComp())==null||i.then(s=>{let n=!1;s!=null&&s.refresh&&typeof s.refresh=="function"&&s.refresh(t)!==null&&(n=!0),!n&&(s!=null&&s.onParamsUpdated)&&typeof s.onParamsUpdated=="function"&&s.onParamsUpdated(t)!==null&&W("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function a4(e){return e}var ge="32.2.0";function kM(e){var t,i;return!!((t=e.filterManager)!=null&&t.isColumnFilterPresent())||!!((i=e.filterManager)!=null&&i.isAggregateFilterPresent())}function IM(e,t,i){var s;return(s=e.filterManager)==null?void 0:s.getFilterInstance(t,i)}function LM(e,t){var i;return((i=e.filterManager)==null?void 0:i.getColumnFilterInstance(t))??Promise.resolve(void 0)}function _M(e,t){var s;const i=e.columnModel.getColDefCol(t);if(i)return(s=e.filterManager)==null?void 0:s.destroyFilter(i,"api")}function OM(e,t){e.frameworkOverrides.wrapIncoming(()=>{var i;return(i=e.filterManager)==null?void 0:i.setFilterModel(t)})}function VM(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function NM(e,t){var i;return((i=e.filterManager)==null?void 0:i.getColumnFilterModel(t))??null}function BM(e,t,i){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,i))??Promise.resolve()}function GM(e,t){const i=e.columnModel.getCol(t);if(!i){Ve(`column '${t}' not found`);return}e.menuService.showFilterMenu({column:i,containerType:"columnFilter",positionBy:"auto"})}function HM(e,t,i){if(t==null)return null;let s=null;const{compName:n,jsComp:o,fwComp:r}=cf.getCompKeys(e,t,Wd);return n?s={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[n]:o==null&&r==null&&t.filter===!0&&(s=i()),s}var _f={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Of=["january","february","march","april","may","june","july","august","september","october","november","december"],WM=class extends B{constructor(){super(...arguments),this.beanName="columnFilterService",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[]}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.userComponentFactory=e.userComponentFactory,this.rowRenderer=e.rowRenderer,this.dataTypeService=e.dataTypeService,this.filterManager=e.filterManager}postConstruct(){var e,t;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),rowDataUpdated:()=>this.onNewRowsLoaded("rowDataUpdated"),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.initialFilterModel={...((t=(e=this.gos.get("initialState"))==null?void 0:e.filter)==null?void 0:t.filterModel)??{}}}setFilterModel(e,t="api"){var n;if((n=this.dataTypeService)!=null&&n.isPendingInference()){this.filterModelUpdateQueue.push({model:e,source:t});return}const i=[],s=this.getFilterModel(!0);if(e){const o=new Set(Object.keys(e));this.allColumnFilters.forEach((r,a)=>{const d=e[a];i.push(this.setModelOnFilterWrapper(r.filterPromise,d)),o.delete(a)}),o.forEach(r=>{const a=this.columnModel.getColDefCol(r)||this.columnModel.getCol(r);if(!a){W("setFilterModel() - no column found for colId: "+r);return}if(!a.isFilterAllowed()){W("setFilterModel() - unable to fully apply model, filtering disabled for colId: "+r);return}const d=this.getOrCreateFilterWrapper(a);if(!d){W("setFilterModel() - unable to fully apply model, unable to create filter for colId: "+r);return}i.push(this.setModelOnFilterWrapper(d.filterPromise,e[r]))})}else this.allColumnFilters.forEach(o=>{i.push(this.setModelOnFilterWrapper(o.filterPromise,null))});Zt.all(i).then(()=>{var a;const o=this.getFilterModel(!0),r=[];this.allColumnFilters.forEach((d,h)=>{const g=s?s[h]:null,f=o?o[h]:null;Zo(g,f)||r.push(d.column)}),r.length>0&&((a=this.filterManager)==null||a.onFilterChanged({columns:r,source:t}))})}setModelOnFilterWrapper(e,t){return new Zt(i=>{e.then(s=>{typeof s.setModel!="function"&&(W("filter missing setModel method, which is needed for setFilterModel"),i()),(s.setModel(t)||Zt.resolve()).then(()=>i())})})}getFilterModel(e){const t={},{allColumnFilters:i,initialFilterModel:s}=this;return i.forEach((n,o)=>{const r=this.getModelFromFilterWrapper(n);j(r)&&(t[o]=r)}),e||Object.entries(s).forEach(([n,o])=>{var r;j(o)&&!i.has(n)&&((r=this.columnModel.getCol(n))!=null&&r.isFilterAllowed())&&(t[n]=o)}),t}getModelFromFilterWrapper(e){const{filter:t}=e;return t?typeof t.getModel!="function"?(W("filter API missing getModel method, which is needed for getFilterModel"),null):t.getModel():this.getModelFromInitialState(e.column)}getModelFromInitialState(e){return this.initialFilterModel[e.getColId()]??null}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}disableColumnFilters(){return this.allColumnFilters.size?(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),!0):!1}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){const e=o=>o?o.isFilterActive?o.isFilterActive():(W("Filter is missing isFilterActive() method"),!1):!1,t=!!nd(this.gos),i=o=>{if(!o.isPrimary())return!0;const a=!this.columnModel.isPivotActive();return!o.isValueActive()||!a?!1:this.columnModel.isPivotMode()?!0:t},s=[],n=[];return this.forEachColumnFilter((o,r)=>{e(o)&&(i(r.column)?s.push(o):n.push(o))}).then(()=>{this.activeAggregateFilters=s,this.activeColumnFilters=n})}updateFilterFlagInColumns(e,t){return this.forEachColumnFilter((i,s)=>s.column.setFilterActive(i.isFilterActive(),e,t))}forEachColumnFilter(e){return Zt.all(Array.from(this.allColumnFilters.values()).map(t=>t.filterPromise.then(i=>e(i,t))))}doColumnFiltersPass(e,t,i){const{data:s,aggData:n}=e,o=i?this.activeAggregateFilters:this.activeColumnFilters,r=i?n:s;for(let a=0;a<o.length;a++){const d=o[a];if(!(d==null||d===t)){if(typeof d.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!d.doesFilterPass({node:e,data:r}))return!1}}return!0}callOnFilterChangedOutsideRenderCycle(e){const t=()=>{var i;return(i=this.filterManager)==null?void 0:i.onFilterChanged(e)};this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}updateBeforeFilterChanged(e={}){const{filterInstance:t,additionalEventAttributes:i}=e;return this.updateDependentFilters(),this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",i).then(()=>{this.allColumnFilters.forEach(s=>{s.filterPromise&&s.filterPromise.then(n=>{n&&n!==t&&n.onAnyFilterChanged&&n.onAnyFilterChanged()})}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){this.forEachColumnFilter(t=>{t.onNewRowsLoaded&&t.onNewRowsLoaded()}).then(()=>this.updateFilterFlagInColumns(e,{afterDataChange:!0})).then(()=>this.updateActiveFilters())}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getCol(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}isFilterActive(e){const{filter:t}=this.cachedFilter(e)??{};return t?t.isFilterActive():this.getModelFromInitialState(e)!=null}getOrCreateFilterWrapper(e){if(!e.isFilterAllowed())return null;let t=this.cachedFilter(e);return t||(t=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,t)),t}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){var i;let t;if(ud(this.gos))t="agSetColumnFilter";else{const s=(i=this.dataTypeService)==null?void 0:i.getBaseDataType(e);s==="number"?t="agNumberColumnFilter":s==="date"||s==="dateString"?t="agDateColumnFilter":t="agTextColumnFilter"}return t}getDefaultFloatingFilter(e){var i;let t;if(ud(this.gos))t="agSetColumnFloatingFilter";else{const s=(i=this.dataTypeService)==null?void 0:i.getBaseDataType(e);s==="number"?t="agNumberColumnFloatingFilter":s==="date"||s==="dateString"?t="agDateColumnFloatingFilter":t="agTextColumnFloatingFilter"}return t}createFilterInstance(e,t){const i=this.getDefaultFilter(e),s=e.getColDef();let n;const o={...this.createFilterParams(e,s),filterModifiedCallback:()=>this.filterModifiedCallbackFactory(n,e)(),filterChangedCallback:a=>this.filterChangedCallbackFactory(n,e)(a),doesRowPassOtherFilter:a=>this.filterManager?this.filterManager.doesRowPassOtherFilters(n,a):!0},r=this.userComponentFactory.getFilterDetails(s,o,i);return r?{filterPromise:()=>{const a=r.newAgStackInstance();return a!=null&&a.then(d=>{n=d,t&&(t.filter=d)}),a},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:Pg(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e){const t={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:i,compDetails:s}=this.createFilterInstance(e,t);return t.filterPromise=(i==null?void 0:i())??null,t.compDetails=s,t}onColumnsChanged(){var i;const e=[];this.allColumnFilters.forEach((s,n)=>{let o;s.column.isPrimary()?o=this.columnModel.getColDefCol(n):o=this.columnModel.getCol(n),!(o&&o===s.column)&&(e.push(s.column),this.disposeFilterWrapper(s,"columnChanged"),this.disposeColumnListener(n))});const t=e.every(s=>s.getColDef().filter==="agGroupColumnFilter");e.length>0&&!t?(i=this.filterManager)==null||i.onFilterChanged({columns:e,source:"api"}):this.updateDependentFilters()}updateDependentFilters(){const e=this.columnModel.getAutoCols();e==null||e.forEach(t=>{t.getColDef().filter==="agGroupColumnFilter"&&this.getOrCreateFilterWrapper(t)})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const{filter:i}=this.allColumnFilters.get(e.getColId())??{};return i&&typeof(i==null?void 0:i.isFilterAllowed)=="function"?i.isFilterAllowed():!0}getFloatingFilterCompDetails(e,t){const i=d=>{var g;const h=(g=this.getOrCreateFilterWrapper(e))==null?void 0:g.filterPromise;h!=null&&h.then(f=>{d(lr(f))})},s=e.getColDef(),n={...this.createFilterParams(e,s),filterChangedCallback:()=>i(d=>this.filterChangedCallbackFactory(d,e)())},o=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,Wd,n);let r=HM(this.frameworkOverrides,s,()=>this.getDefaultFloatingFilter(e));r==null&&(r="agReadOnlyFloatingFilter");const a={column:e,filterParams:o,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,a,r)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilter(e,t="api"){var n;const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),(n=this.filterManager)==null||n.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId()),this.eventService.dispatchEvent({type:"filterDestroyed",source:t,column:e.column})})}filterModifiedCallbackFactory(e,t){return()=>{this.eventService.dispatchEvent({type:"filterModified",column:t,filterInstance:e})}}filterChangedCallbackFactory(e,t){return i=>{const s=(i==null?void 0:i.source)??"columnFilter",n={filter:e,additionalEventAttributes:i,columns:[t],source:s};this.callOnFilterChangedOutsideRenderCycle(n)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s)){this.destroyFilter(i,"paramsUpdated");return}const n=i.getColDef().filterParams;if(!t.filterPromise){this.destroyFilter(i,"paramsUpdated");return}t.filterPromise.then(o=>{(o!=null&&o.refresh?o.refresh({...this.createFilterParams(i,i.getColDef()),filterModifiedCallback:this.filterModifiedCallbackFactory(o,i),filterChangedCallback:this.filterChangedCallbackFactory(o,i),doesRowPassOtherFilter:a=>this.filterManager?this.filterManager.doesRowPassOtherFilters(o,a):!0,...n}):!0)===!1&&this.destroyFilter(i,"paramsUpdated")})}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListeners(e,{colDefChanged:()=>this.checkDestroyFilter(i)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||(i==null?void 0:i.render)&&(s==null?void 0:s.render)&&i.render===s.render)}hasFloatingFilters(){return this.columnModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e,t){t&&this.getFilterInstanceImpl(e).then(i=>{const s=lr(i);t(s)})}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstanceImpl(e).then(i=>{t(lr(i))})})}getFilterInstanceImpl(e){var s;const t=this.columnModel.getColDefCol(e);return t?((s=this.getOrCreateFilterWrapper(t))==null?void 0:s.filterPromise)??Zt.resolve(null):Zt.resolve(void 0)}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){var o;if((o=this.dataTypeService)!=null&&o.isPendingInference()){let r=()=>{};const a=new Promise(d=>{r=d});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:r}),a}const i=this.columnModel.getColDefCol(e),s=i?this.getOrCreateFilterWrapper(i):null;return s?(r=>new Promise(a=>{r.then(d=>a(d))}))(this.setModelOnFilterWrapper(s.filterPromise,t)):Promise.resolve()}getFilterWrapper(e){const t=this.columnModel.getColDefCol(e);return t?this.cachedFilter(t)??null:null}setColDefPropertiesForDataType(e,t,i){const s=ud(this.gos),n=this.localeService.getLocaleTextFunc(),o=r=>{const{filterParams:a}=e;e.filterParams=typeof a=="object"?{...a,...r}:r};switch(t.baseDataType){case"number":{s&&o({comparator:(r,a)=>{const d=r==null?0:parseInt(r),h=a==null?0:parseInt(a);return d===h?0:d>h?1:-1}});break}case"boolean":{o(s?{valueFormatter:r=>j(r.value)?n(String(r.value),r.value?"True":"False"):n("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(r,a)=>a,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(r,a)=>a===!1,numberOfInputs:0}]});break}case"date":{s&&o({valueFormatter:r=>{const a=i(r);return j(a)?a:n("blanks","(Blanks)")},treeList:!0,treeListFormatter:(r,a)=>{if(a===1&&r!=null){const d=Of[Number(r)-1];return n(d,_f[d])}return r??n("blanks","(Blanks)")}});break}case"dateString":{const r=t.dateParser;o(s?{valueFormatter:a=>{const d=i(a);return j(d)?d:n("blanks","(Blanks)")},treeList:!0,treeListPathGetter:a=>{const d=r(a??void 0);return d?[String(d.getFullYear()),String(d.getMonth()+1),String(d.getDate())]:null},treeListFormatter:(a,d)=>{if(d===1&&a!=null){const h=Of[Number(a)-1];return n(h,_f[h])}return a??n("blanks","(Blanks)")}}:{comparator:(a,d)=>{const h=r(d);return d==null||h<a?-1:h>a?1:0}});break}case"object":{s?o({valueFormatter:r=>{const a=i(r);return j(a)?a:n("blanks","(Blanks)")}}):e.filterValueGetter=r=>i({column:r.column,node:r.node,value:this.valueService.getValue(r.column,r.node)});break}}}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};function zM(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function UM(e,t="api"){var i;(i=e.filterManager)==null||i.onFilterChanged({source:t})}var $M=class extends Pe{constructor(){super(`
96
+ <div class="ag-floating-filter-input" role="presentation">
97
+ <ag-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field>
98
+ </div>`,[Kl]),this.eFloatingFilterText=J}wireBeans(e){this.columnNameService=e.columnNameService}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}},Vf=class extends Pe{wireBeans(e){this.columnNameService=e.columnNameService}getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return e==null?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.getDefaultOption();return}const t=e.operator;let i;t?i=e.conditions[0]:i=e,this.lastType=i.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const i=e;return this.isTypeEditable(i.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new Cf,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return i==null||i==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();return`${t} ${i("ariaFilterInput","Filter Input")}`}},KM=class extends Vf{constructor(){super(`
99
+ <div class="ag-floating-filter-input" role="presentation">
100
+ <ag-input-text-field data-ref="eReadOnlyText"></ag-input-text-field>
101
+ <div data-ref="eDateWrapper" style="display: flex;"></div>
102
+ </div>`,[Kl]),this.eReadOnlyText=J,this.eDateWrapper=J}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}getDefaultFilterOptions(){return Df}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Tf(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const i=e;this.dateComp.setDate(Nt(i.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){je(this.eDateWrapper,e),je(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=this.dateComp.getDate(),t=li(e);this.params.parentFilterInstance(i=>{if(i){const s=Nt(t);i.onFloatingFilterChanged(this.getLastType()||null,s)}})}getDateComponentParams(){const e=Ud(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Pt(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new Pf(this.context,this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))}),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}},jM=class extends Pe{constructor(){super(`
103
+ <div class="ag-filter-filter">
104
+ <ag-input-text-field class="ag-date-filter" data-ref="eDateInput"></ag-input-text-field>
105
+ </div>`,[Kl]),this.eDateInput=J}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()},input:i=>{i.target===Ke(this.gos)&&(this.eDateInput.isDisabled()||this.params.onDateChanged())}})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&Gi(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:n,minValidDate:o,maxValidDate:r}=e.filterParams||{};if(o&&s&&W("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),r&&n&&W("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),o&&r){const[a,d]=[o,r].map(h=>h instanceof Date?h:Nt(h));a&&d&&a.getTime()>d.getTime()&&W("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}o?o instanceof Date?t.min=dr(o):t.min=o:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=dr(r):t.max=r:n&&(t.max=`${n}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return Nt(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(li(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){(!e||!e.suppressFocus)&&this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&e.filterParams.browserDatePicker!=null?e.filterParams.browserDatePicker:kd()||Id()||Gi()&&Hg()>=14.1}},Nf=class extends B{constructor(e){super(),this.params=e,this.eFloatingFilterTextInput=J,this.valueChangedListener=()=>{}}setupGui(e){var s;this.eFloatingFilterTextInput=this.createManagedBean(new pn((s=this.params)==null?void 0:s.config));const t=this.eFloatingFilterTextInput.getGui();e.appendChild(t);const i=n=>this.valueChangedListener(n);this.addManagedListeners(t,{input:i,keydown:i})}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},Bf=class extends Vf{constructor(){super(...arguments),this.eFloatingFilterInputContainer=J}postConstruct(){this.setTemplate(`
106
+ <div class="ag-floating-filter-input" role="presentation" data-ref="eFloatingFilterInputContainer"></div>
107
+ `)}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){this.params=e;const t=e.browserAutoComplete??!1;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=$l(this.params.filterParams),!this.isReadOnly()){const i=Ud(this.params.filterParams,this.getDefaultDebounceMs()),s=Pt(this.syncUpWithParentFilter.bind(this),i);this.floatingFilterInputService.setValueChangedListener(s)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();yt(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===N.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=xf(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(s=>{s&&s.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}},ZM=class extends B{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new jd),this.eFloatingFilterTextInput=this.createManagedBean(new pn),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,s=>this.valueChangedListener(s)),this.setupListeners(i,s=>this.valueChangedListener(s))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},qM=class extends Bf{init(e){var t;super.init(e),this.filterModelFormatter=new bf(this.localeService,this.optionsFactory,(t=e.filterParams)==null?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){qd(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return yf}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=qd(e.filterParams),this.allowedCharPattern?this.createManagedBean(new Nf({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new ZM)}},YM=class extends Bf{init(e){super.init(e),this.filterModelFormatter=new Ff(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Rf}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new Nf)}};function QM(e){var t;return!!((t=e.filterManager)!=null&&t.isQuickFilterPresent())}function XM(e){return e.gos.get("quickFilterText")}function JM(e){var t;(t=e.filterManager)==null||t.resetQuickFilterCache()}var ek=class extends B{constructor(){super(...arguments),this.beanName="quickFilterService",this.quickFilter=null,this.quickFilterParts=null}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.pivotResultColsService=e.pivotResultColsService}postConstruct(){const e=this.resetQuickFilterCache.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}}),this.addManagedPropertyListener("quickFilterText",t=>this.setQuickFilter(t.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onQuickFilterColumnConfigChanged()),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}refreshQuickFilterCols(){var n;const e=this.columnModel.isPivotMode(),t=this.columnModel.getAutoCols(),i=this.columnModel.getColDefCols();let s=(e&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?(n=this.pivotResultColsService.getPivotResultCols())==null?void 0:n.list:i)??[];t&&(s=s.concat(t)),this.colsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?s:s.filter(o=>o.isVisible()||o.isRowGroupActive())}isQuickFilterPresent(){return this.quickFilter!==null}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseQuickFilter(e){return j(e)?Ye(this.gos)?e.toUpperCase():(W("Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(e!=null&&typeof e!="string"){W(`Grid option quickFilterText only supports string inputs, received: ${typeof e}`);return}const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onQuickFilterColumnConfigChanged(){this.refreshQuickFilterCols(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassQuickFilterNoCache(e,t){return this.colsForQuickFilter.some(i=>{const s=this.getQuickFilterTextForColumn(i,e);return j(s)&&s.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:n}=this;return n(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const n=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:s});i=s.getQuickFilterText(n)}return j(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.colsForQuickFilter.forEach(i=>{const s=this.getQuickFilterTextForColumn(i,e);j(s)&&t.push(s)}),t.join(`
108
+ `)}},Jd={version:ge,moduleName:"@ag-grid-community/filter-core",beans:[sM]},tk={version:ge,moduleName:"@ag-grid-community/filter-api",apiFunctions:{isAnyFilterPresent:zM,onFilterChanged:UM},dependantModules:[Jd]},eu={version:ge,moduleName:"@ag-grid-community/column-filter",beans:[WM],dependantModules:[Jd]},ik={version:ge,moduleName:"@ag-grid-community/column-filter-api",apiFunctions:{isColumnFilterPresent:kM,getFilterInstance:IM,getColumnFilterInstance:LM,destroyFilter:_M,setFilterModel:OM,getFilterModel:VM,getColumnFilterModel:NM,setColumnFilterModel:BM,showColumnFilter:GM},dependantModules:[eu,tk]},Gf={version:ge,moduleName:"@ag-grid-community/floating-filter-core",controllers:[{name:"headerFilterCell",classImp:MM}],dependantModules:[eu]},sk={version:ge,moduleName:"@ag-grid-community/read-only-floating-filter",userComponents:[{name:"agReadOnlyFloatingFilter",classImp:$M}],dependantModules:[Gf]},nk={version:ge,moduleName:"@ag-grid-community/simple-filter",dependantModules:[eu],userComponents:[{name:"agTextColumnFilter",classImp:bM},{name:"agNumberColumnFilter",classImp:yM},{name:"agDateColumnFilter",classImp:xM},{name:"agDateInput",classImp:jM}]},ok={version:ge,moduleName:"@ag-grid-community/simple-floating-filter",dependantModules:[nk,Gf],userComponents:[{name:"agTextColumnFloatingFilter",classImp:YM},{name:"agNumberColumnFloatingFilter",classImp:qM},{name:"agDateColumnFloatingFilter",classImp:KM}]},Hf={version:ge,moduleName:"@ag-grid-community/quick-filter-core",beans:[ek],dependantModules:[Jd]},rk={version:ge,moduleName:"@ag-grid-community/quick-filter-api",apiFunctions:{isQuickFilterPresent:QM,getQuickFilter:XM,resetQuickFilter:JM},dependantModules:[Hf]},lk={version:ge,moduleName:"@ag-grid-community/quick-filter",dependantModules:[Hf,rk]},ak={version:ge,moduleName:"@ag-grid-community/filter",dependantModules:[ok,sk,lk,ik]},tu=class extends Pe{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},ck=class extends tu{constructor(e){super(`<div class="ag-header-cell ag-floating-filter" role="gridcell">
109
+ <div data-ref="eFloatingFilterBody" role="presentation"></div>
110
+ <div class="ag-floating-filter-button ag-hidden" data-ref="eButtonWrapper" role="presentation">
111
+ <button type="button" class="ag-button ag-floating-filter-button-button" data-ref="eButtonShowMainFilter" tabindex="-1"></button>
112
+ </div>
113
+ </div>`,e),this.eFloatingFilterBody=J,this.eButtonWrapper=J,this.eButtonShowMainFilter=J}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(i,s)=>this.addOrRemoveCssClass(i,s),addOrRemoveBodyCssClass:(i,s)=>this.eFloatingFilterBody.classList.toggle(i,s),setButtonWrapperDisplayed:i=>je(this.eButtonWrapper,i),setCompDetails:i=>this.setCompDetails(i),getFloatingFilterComp:()=>this.compPromise,setWidth:i=>e.style.width=i,setMenuIcon:i=>this.eButtonShowMainFilter.appendChild(i)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody,void 0)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()}}},dk=class extends tu{constructor(e){super(`<div class="ag-header-cell" role="columnheader">
114
+ <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
115
+ <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>
116
+ </div>`,e),this.eResize=J,this.eHeaderCompWrapper=J,this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();((n,o)=>{o!=null&&o!=""?e.setAttribute(n,o):e.removeAttribute(n)})("col-id",this.column.getColId());const i={setWidth:n=>e.style.width=n,addOrRemoveCssClass:(n,o)=>this.addOrRemoveCssClass(n,o),setAriaSort:n=>n?KT(e,n):jT(e),setUserCompDetails:n=>this.setUserCompDetails(n),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(i,this.getGui(),this.eResize,this.eHeaderCompWrapper,void 0);const s=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",s)}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(i=>this.afterCompCreated(t,i))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},uk=class extends tu{constructor(e){super(`<div class="ag-header-group-cell" role="columnheader">
117
+ <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>
118
+ <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
119
+ </div>`,e),this.eResize=J,this.eHeaderCompWrapper=J}postConstruct(){const e=this.getGui(),t=(s,n)=>n!=null?e.setAttribute(s,n):e.removeAttribute(s);e.setAttribute("col-id",this.ctrl.getColId());const i={addOrRemoveCssClass:(s,n)=>this.addOrRemoveCssClass(s,n),setResizableDisplayed:s=>je(this.eResize,s),setWidth:s=>e.style.width=s,setAriaExpanded:s=>t("aria-expanded",s),setUserCompDetails:s=>this.setUserCompDetails(s),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(i,e,this.eResize,this.eHeaderCompWrapper,void 0)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const i=this.getGui(),s=e.getGui();this.eHeaderCompWrapper.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}},hk=class extends Pe{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}postConstruct(){Bg(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:(t,i)=>this.setHeaderCtrls(t,i),setWidth:t=>this.getGui().style.width=t};this.ctrl.setComp(e,void 0)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(s=>{const n=s.instanceId;let o=i[n];delete i[n],o==null&&(o=this.createHeaderComp(s),this.getGui().appendChild(o.getGui())),this.headerComps[n]=o}),ni(i,(s,n)=>{this.getGui().removeChild(n.getGui()),this.destroyBean(n)}),t){const s=Ts(this.headerComps);s.sort((o,r)=>{const a=o.getCtrl().getColumnGroupChild().getLeft(),d=r.getCtrl().getColumnGroupChild().getLeft();return a-d});const n=s.map(o=>o.getGui());Yg(this.getGui(),n)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new uk(e);break;case"filter":t=new ck(e);break;default:t=new dk(e);break}return this.createBean(t),t.setParentComponent(this),t}},pk=class extends B{constructor(){super(...arguments),this.beanName="headerNavigationService",this.currentHeaderRowWithoutSpan=-1}wireBeans(e){this.focusService=e.focusService,this.headerPositionUtils=e.headerPositionUtils,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.visibleColService=e.visibleColsService}postConstruct(){this.ctrlsService.whenReady(this,t=>{this.gridBodyCon=t.gridBodyCtrl});const e=Xe(this.gos);this.addManagedElementListeners(e,{mousedown:()=>this.setCurrentHeaderRowWithoutSpan(-1)})}getHeaderRowCount(){var e;return((e=this.ctrlsService.getHeaderRowContainerCtrl())==null?void 0:e.getRowCount())??0}getHeaderPositionForColumn(e,t){let i;if(typeof e=="string"?(i=this.columnModel.getCol(e),i||(i=this.visibleColService.getColumnGroup(e))):i=e,!i)return null;const s=this.ctrlsService.getHeaderRowContainerCtrl(),n=s==null?void 0:s.getAllCtrls(),o=ce(n||[]).getType()==="filter",r=this.getHeaderRowCount()-1;let a=-1,d=i;for(;d;)a++,d=d.getParent();let h=a;return t&&o&&h===r-1&&h++,h===-1?null:{headerRowIndex:h,column:i}}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s}=t,n=t.column,o=this.getHeaderRowCount(),r=e===0;let{headerRowIndex:a,column:d,headerRowIndexWithoutSpan:h}=r?this.headerPositionUtils.getColumnVisibleParent(n,s):this.headerPositionUtils.getColumnVisibleChild(n,s),g=!1;return a<0&&(a=0,d=n,g=!0),a>=o?(a=-1,this.setCurrentHeaderRowWithoutSpan(-1)):h!==void 0&&(this.currentHeaderRowWithoutSpan=h),!g&&!d?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a,column:d},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),n=e===2,o=this.gos.get("enableRtl");let r,a;if(this.currentHeaderRowWithoutSpan!==-1?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,n!==o?(a="Before",r=this.headerPositionUtils.findHeader(s,a)):(a="After",r=this.headerPositionUtils.findHeader(s,a)),r||!t)return this.focusService.focusHeaderPosition({headerPosition:r,direction:a,fromTab:t,allowUserOverride:!0,event:i});if(t){const d=this.gos.getCallback("tabToNextHeader");if(d)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:d,headerPosition:r,direction:a})}return this.focusNextHeaderRow(s,a,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let n=null,o;if(t==="Before"?s>0&&(o=s-1,this.currentHeaderRowWithoutSpan-=1,n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"end")):(o=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"start")),!n)return!1;const{column:r,headerRowIndex:a}=this.headerPositionUtils.getHeaderIndexToFocus(n.column,n==null?void 0:n.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:r,headerRowIndex:a},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(ot(e)){const s=e.getDisplayedLeafColumns();i=t==="Before"?ce(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}},gk=class extends B{wireBeans(e){this.animationFrameService=e.animationFrameService,this.headerNavigationService=e.headerNavigationService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.menuService=e.menuService}setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new hn(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:s}),this.mockContextMenuForIPad(s),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e),this.addManagedEventListeners({displayedColumnsChanged:e,columnHeaderHeightChanged:e,columnGroupHeaderHeightChanged:()=>this.animationFrameService.requestAnimationFrame(()=>e()),gridStylesChanged:e,advancedFilterEnabledChanged:e})}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){var o;const{columnModel:e}=this;let t=0;const i=this.columnModel.getGroupRowsHeight().reduce((r,a)=>r+a,0),s=this.columnModel.getColumnHeaderRowHeight();if((o=this.filterManager)!=null&&o.hasFloatingFilters()&&(t+=e.getFloatingFiltersHeight()),t+=i,t+=s,this.headerHeight===t)return;this.headerHeight=t;const n=`${t+1}px`;this.comp.setHeightAndMinHeight(n),this.eventService.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const t=this.visibleColsService.getAllCols().some(i=>i.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey,s=i!==t?2:3;(this.headerNavigationService.navigateHorizontally(s,!0,e)||!i&&this.focusService.focusOverlay(!1)||this.focusService.focusNextGridCoreContainer(i))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case N.LEFT:t=2;case N.RIGHT:{j(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e)&&e.preventDefault();break}case N.UP:t=0;case N.DOWN:{j(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(Ke(this.gos))||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){var n;if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=e??t;(s===this.eGui||s===((n=this.ctrlsService.getHeaderRowContainerCtrl())==null?void 0:n.getViewportElement()))&&this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!Ms())return;const t=new ks(this.eGui),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}},iu=class extends B{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}wireBeans(e){this.visibleColsService=e.visibleColsService,this.scrollVisibleService=e.scrollVisibleService}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=ht(this.gos,"print"),t=this.visibleColsService.getBodyContainerWidth(),i=this.visibleColsService.getColsLeftWidth(),s=this.visibleColsService.getDisplayedColumnsRightWidth();let n;e?n=t+i+s:(n=t,this.addSpacer&&(this.gos.get("enableRtl")?i:s)===0&&this.scrollVisibleService.isVerticalScrollShowing()&&(n+=this.scrollVisibleService.getScrollbarWidth())),this.callback(n)}},fk=class extends B{constructor(e){super(),this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}wireBeans(e){this.funcColsService=e.funcColsService}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(i=>{i.isPrimary()&&(i.isAnyFunctionActive()||(i.isAllowValue()?this.columnsToAggregate.push(i):i.isAllowRowGroup()?this.columnsToGroup.push(i):i.isAllowPivot()&&this.columnsToPivot.push(i)))})}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){this.columnsToAggregate.length>0&&this.funcColsService.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.funcColsService.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.funcColsService.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}onDragCancel(){this.clearColumnsList()}};function Wf(e){const{isFromHeader:t,fromLeft:i,xPosition:s,fromEnter:n,fakeEvent:o,pinned:r,gos:a,columnModel:d,columnMoveService:h,visibleColsService:g}=e;let{allMovingColumns:f}=e;if(t){const V=[];f.forEach(_=>{var A;let O=null,M=_.getParent();for(;M!=null&&M.getDisplayedLeafColumns().length===1;)O=M,M=M.getParent();O!=null?(!!((A=O.getColGroupDef())!=null&&A.marryChildren)?O.getProvidedColumnGroup().getLeafColumns():O.getLeafColumns()).forEach(Z=>{V.includes(Z)||V.push(Z)}):V.includes(_)||V.push(_)}),f=V}const C=f.slice();d.sortColsLikeCols(C);const v=wk({movingCols:C,draggingRight:i,xPosition:s,pinned:r,gos:a,columnModel:d,visibleColsService:g}),S=mk(C,d);if(v.length===0)return;const R=v[0];let y=S!==null&&!n;if(t&&(y=S!==null),y&&!o&&(!i&&R>=S||i&&R<=S))return;const x=g.getAllCols(),P=[];let T=null;for(let V=0;V<v.length;V++){const _=v[V],O=h.getProposedColumnOrder(C,_);if(!h.doesOrderPassRules(O))continue;const M=O.filter(z=>x.includes(z));if(T===null)T=M;else if(!Ni(M,T))break;const A=Ck(O);P.push({move:_,fragCount:A})}if(P.length===0)return;P.sort((V,_)=>V.fragCount-_.fragCount);const I=P[0].move;if(!(I>d.getCols().length-f.length))return{columns:f,toIndex:I}}function su(e){const{columns:t,toIndex:i}=Wf(e)||{},{finished:s,columnMoveService:n}=e;return!t||i==null?null:(n.moveColumns(t,i,"uiColumnMoved",s),s?null:{columns:t,toIndex:i})}function mk(e,t){const i=t.getCols(),s=tT(e.map(d=>i.indexOf(d))),n=s[0];return ce(s)-n!==s.length-1?null:n}function Ck(e){function t(s){const n=[];let o=s.getOriginalParent();for(;o!=null;)n.push(o),o=o.getOriginalParent();return n}let i=0;for(let s=0;s<e.length-1;s++){let n=t(e[s]),o=t(e[s+1]);[n,o]=n.length>o.length?[n,o]:[o,n],n.forEach(r=>{o.indexOf(r)===-1&&i++})}return i}function vk(e,t){switch(t){case"left":return e.getLeftCols();case"right":return e.getRightCols();default:return e.getCenterCols()}}function wk(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:n,gos:o,columnModel:r,visibleColsService:a}=e;if(o.get("suppressMovableColumns")||t.some(T=>T.getColDef().suppressMovable))return[];const h=vk(a,n),g=r.getCols(),f=h.filter(T=>Qi(t,T)),C=h.filter(T=>!Qi(t,T)),v=g.filter(T=>!Qi(t,T));let S=0,R=s;if(i){let T=0;f.forEach(I=>T+=I.getActualWidth()),R-=T}if(R>0){for(let T=0;T<C.length;T++){const I=C[T];if(R-=I.getActualWidth(),R<0)break;S++}i&&S++}let y;if(S>0){const T=C[S-1];y=v.indexOf(T)+1}else y=v.indexOf(C[0]),y===-1&&(y=0);const x=[y],P=(T,I)=>T-I;if(i){let T=y+1;const I=g.length-1;for(;T<=I;)x.push(T),T++;x.sort(P)}else{let T=y;const I=g.length-1;let V=g[T];for(;T<=I&&h.indexOf(V)<0;)T++,x.push(T),V=g[T];T=y-1;const _=0;for(;T>=_;)x.push(T),T--;x.sort(P).reverse()}return x}function Zl(e){var h;const{pinned:t,fromKeyboard:i,gos:s,ctrlsService:n,useHeaderRow:o,skipScrollPadding:r}=e;let a=(h=n.getHeaderRowContainerCtrl(t))==null?void 0:h.getViewportElement(),{x:d}=e;return a?(i&&(d-=a.getBoundingClientRect().left),s.get("enableRtl")&&(o&&(a=a.querySelector(".ag-header-row")),d=a.clientWidth-d),t==null&&!r&&(d+=n.get("center").getCenterViewportScrollLeft()),d):0}function Xn(e,t){for(const i of e)i.setMoving(t,"uiColumnMoved")}var zf=7,nu=100,ql=nu/2,Sk=5,yk=100,bk=class extends B{constructor(e){super(),this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!j(e)}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnMoveService=e.columnMoveService,this.dragAndDropService=e.dragAndDropService,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){var t;const e=((t=this.lastDraggingEvent)==null?void 0:t.dragItem.columns)??[];for(const i of e){const s=i.getPinned();if(i.getColDef().lockPinned){if(s==this.pinned)return"move";continue}if(s===this.pinned||!this.pinned)return"move";if(!s&&this.pinned)return"pinned"}return"notAllowed"}onDragEnter(e){const t=e.dragItem.columns;if(e.dragSource.type===0)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const s=e.dragItem.visibleState,n=(t||[]).filter(o=>s[o.getId()]);this.setColumnsVisible(n,!0,"uiColumnDragged")}this.gos.get("suppressMoveWhenColumnDragging")||this.attemptToPinColumns(t,this.pinned),this.onDragging(e,!0,!0)}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){const n=this.gos.get("suppressMoveWhenColumnDragging");if(s&&!n){this.finishColumnMoving();return}if(this.lastDraggingEvent=e,!e||!s&&ke(e.hDirection))return;const{pinned:o,gos:r,ctrlsService:a}=this,d=Zl({x:e.x,pinned:o,gos:r,ctrlsService:a});t||this.checkCenterForScrolling(d),n?this.handleColumnDragWhileSuppressingMovement(e,t,i,d,s):this.handleColumnDragWhileAllowingMovement(e,t,i,d,s)}onDragLeave(){this.ensureIntervalCleared(),this.clearHighlighted(),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,i){if(!e)return;const s=e.filter(n=>!n.getColDef().lockVisible);this.columnModel.setColsVisible(s,t,i)}finishColumnMoving(){if(this.clearHighlighted(),!this.lastMovedInfo)return;const{columns:e,toIndex:t}=this.lastMovedInfo;this.columnMoveService.moveColumns(e,t,"uiColumnMoved",!0)}handleColumnDragWhileSuppressingMovement(e,t,i,s,n){const o=this.getAllMovingColumns(e,!0);if(n){const r=this.isAttemptingToPin(o);r&&this.attemptToPinColumns(o,void 0,!0);const{fromLeft:a,xPosition:d}=this.getNormalisedXPositionInfo(o,r)||{};if(a==null||d==null){this.finishColumnMoving();return}this.moveColumnsAfterHighlight({allMovingColumns:o,xPosition:d,fromEnter:t,fakeEvent:i,fromLeft:a})}else{if(!this.dragAndDropService.isDropZoneWithinThisGrid(e))return;this.highlightHoveredColumn(o,s)}}handleColumnDragWhileAllowingMovement(e,t,i,s,n){const o=this.getAllMovingColumns(e),r=this.normaliseDirection(e.hDirection)===1,a=e.dragSource.type===1,d=this.getMoveColumnParams({allMovingColumns:o,isFromHeader:a,xPosition:s,fromLeft:r,fromEnter:t,fakeEvent:i}),h=su({...d,finished:n});h&&(this.lastMovedInfo=h)}getAllMovingColumns(e,t=!1){const i=e.dragSource.getDragItem();let s=null;t?(s=i.columnsInSplit,s||(s=i.columns)):s=i.columns;const n=o=>o.getColDef().lockPinned?o.getPinned()==this.pinned:!0;return s?s.filter(n):[]}getMoveColumnParams(e){const{allMovingColumns:t,isFromHeader:i,xPosition:s,fromLeft:n,fromEnter:o,fakeEvent:r}=e,{pinned:a,gos:d,columnModel:h,columnMoveService:g,visibleColsService:f}=this;return{allMovingColumns:t,isFromHeader:i,fromLeft:n,xPosition:s,pinned:a,fromEnter:o,fakeEvent:r,gos:d,columnModel:h,columnMoveService:g,visibleColsService:f}}findFirstAndLastMovingColumns(e){const t=e.length;let i,s;for(let n=0;n<=t;n++){if(!i){const o=e[n];o.getLeft()!=null&&(i=o)}if(!s){const o=e[t-1-n];o.getLeft()!=null&&(s=o)}if(i&&s)break}return{firstMovingCol:i,lastMovingCol:s}}highlightHoveredColumn(e,t){var g;const{gos:i,columnModel:s}=this,n=i.get("enableRtl"),o=s.getCols().filter(f=>f.isVisible()&&f.getPinned()===this.pinned);let r=null,a=null,d=null;for(const f of o){if(a=f.getActualWidth(),r=this.getNormalisedColumnLeft(f,0,n),r!=null){const C=r+a;if(r<=t&&C>=t){d=f;break}}r=null,a=null}if(d)e.indexOf(d)!==-1&&(d=null);else{for(let f=o.length-1;f>=0;f--){const C=o[f],v=o[f].getParent();if(!v){d=C;break}const S=v==null?void 0:v.getDisplayedLeafColumns();if(S.length){d=ce(S);break}}if(!d)return;r=this.getNormalisedColumnLeft(d,0,n),a=d.getActualWidth()}if(((g=this.lastHighlightedColumn)==null?void 0:g.column)!==d&&this.clearHighlighted(),d==null||r==null||a==null)return;let h;t-r<a/2!==n?h=0:h=1,d.setHighlighted(h),this.lastHighlightedColumn={column:d,position:h}}getNormalisedXPositionInfo(e,t){const{gos:i,visibleColsService:s}=this,n=i.get("enableRtl"),{firstMovingCol:o,column:r,position:a}=this.getColumnMoveAndTargetInfo(e,t,n);if(!o||!r||a==null)return;const d=s.getAllCols(),h=d.indexOf(o),g=d.indexOf(r),f=a===0!==n,C=h<g||h===g&&!f;let v=0;if(f?C&&(v-=1):C||(v+=1),g+v===h)return;const S=d[g+v];if(!S)return;const R=this.getNormalisedColumnLeft(S,20,n);return{fromLeft:C,xPosition:R}}getColumnMoveAndTargetInfo(e,t,i){const s=this.lastHighlightedColumn||{},{firstMovingCol:n,lastMovingCol:o}=this.findFirstAndLastMovingColumns(e);if(!n||!o||s.column||!t)return{firstMovingCol:n,...s};const a=this.getPinDirection()==="left";return{firstMovingCol:n,position:a?1:0,column:a!==i?n:o}}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case 0:return 1;case 1:return 0}return e}getNormalisedColumnLeft(e,t,i){const{gos:s,ctrlsService:n}=this,o=e.getLeft();if(o==null)return null;const r=e.getActualWidth();return Zl({x:i?o+r-t:o+t,pinned:e.getPinned(),useHeaderRow:i,skipScrollPadding:!0,gos:s,ctrlsService:n})}isAttemptingToPin(e){const t=this.needToMoveLeft||this.needToMoveRight,i=this.failedMoveAttempts>zf;return t&&i||e.some(s=>s.getPinned()!==this.pinned)}moveColumnsAfterHighlight(e){const{allMovingColumns:t,xPosition:i,fromEnter:s,fakeEvent:n,fromLeft:o}=e,r=this.getMoveColumnParams({allMovingColumns:t,isFromHeader:!0,xPosition:i,fromLeft:o,fromEnter:s,fakeEvent:n}),{columns:a,toIndex:d}=Wf(r)||{};a&&d!=null&&(this.lastMovedInfo={columns:a,toIndex:d}),this.finishColumnMoving()}clearHighlighted(){this.lastHighlightedColumn&&(this.lastHighlightedColumn.column.setHighlighted(null),this.lastHighlightedColumn=null)}checkCenterForScrolling(e){if(!this.isCenterContainer)return;const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+ql,this.needToMoveLeft=e>s-ql):(this.needToMoveLeft=e<i+ql,this.needToMoveRight=e>s-ql),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}ensureIntervalStarted(){var e;this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),yk),(e=this.dragAndDropService.getDragAndDropImageComponent())==null||e.setIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){var e;this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.failedMoveAttempts=0,(e=this.dragAndDropService.getDragAndDropImageComponent())==null||e.setIcon(this.getIconName()))}moveInterval(){var s,n;let e;this.intervalCount++,e=10+this.intervalCount*Sk,e>nu&&(e=nu);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{if(this.failedMoveAttempts++,this.failedMoveAttempts<=zf+1)return;if((s=this.dragAndDropService.getDragAndDropImageComponent())==null||s.setIcon("pinned"),!this.gos.get("suppressMoveWhenColumnDragging")){const o=(n=this.lastDraggingEvent)==null?void 0:n.dragItem.columns;this.attemptToPinColumns(o,void 0,!0)}}}getPinDirection(){if(this.needToMoveLeft||this.pinned==="left")return"left";if(this.needToMoveRight||this.pinned==="right")return"right"}attemptToPinColumns(e,t,i=!1){const s=(e||[]).filter(n=>!n.getColDef().lockPinned);return s.length?(i&&(t=this.getPinDirection()),this.columnModel.setColsPinned(s,t,"uiColumnDragged"),i&&this.dragAndDropService.nudge(),s.length):0}destroy(){super.destroy(),this.lastDraggingEvent=null,this.clearHighlighted(),this.lastMovedInfo=null}},Rk=class extends B{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(this,e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]];break}}),this.moveColumnFeature=this.createManagedBean(new bk(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new fk(this.pinned)),this.dragAndDropService.addDropTarget(this),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(this))}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}onDragCancel(){this.currentDropListener.onDragCancel()}},Fk=class extends B{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.pinnedWidthService=e.pinnedWidthService,this.ctrlsService=e.ctrlsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s,n){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=n}postConstruct(){const e=[];let t,i;const s=()=>{if(je(this.eResize,t),!t)return;const r=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(r),i){const a=this.gos.get("skipHeaderOnAutoSize"),d=()=>{this.columnAutosizeService.autoSizeColumn(this.column,"uiColumnResized",a)};this.eResize.addEventListener("dblclick",d);const h=new ks(this.eResize);h.addEventListener("doubleTap",d),e.push(()=>{this.eResize.removeEventListener("dblclick",d),h.removeEventListener("doubleTap",d),h.destroy()})}},n=()=>{e.forEach(r=>r()),e.length=0},o=()=>{const r=this.column.isResizable(),a=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(r!==t||a!==i)&&(t=r,i=a,n(),s())};o(),this.addDestroyFunc(n),this.ctrl.setRefreshFunction("resize",o)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:n}=this,o=this.normaliseResizeAmount(t),r=n+o,a=[{key:i,newWidth:r}];if(this.column.getPinned()){const d=this.pinnedWidthService.getPinnedLeftWidth(),h=this.pinnedWidthService.getPinnedRightWidth(),g=Zn(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(d+h+(o-s)>g)return}this.lastResizeAmount=o,this.columnSizeService.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.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i=this.pinned!=="left",s=this.pinned==="right";return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}},xk=class extends B{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.selectionOptions=this.gos.get("selection"),this.addManagedPropertyListener("selection",e=>this.selectionOptions=e.currentValue)}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(Ke(this.gos))&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new Gd),this.cbSelectAll.addCssClass("ag-header-select-all"),Vt(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedEventListeners({newColumnsLoaded:this.onNewColumnsLoaded.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:this.onSelectionChanged.bind(this),paginationChanged:this.onSelectionChanged.bind(this),modelUpdated:this.onModelChanged.bind(this)}),this.addManagedListeners(this.cbSelectAll,{fieldValueChanged:this.onCbSelectAll.bind(this)}),bd(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),i=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),s=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${s} (${i})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${s} (${i})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return cd(this.gos)?!0:(W(`${e} is only available if using 'multiRow' selection mode.`),!1)}checkRightRowModelType(e){return Ye(this.gos)||Yi(this.gos)?!0:(W(`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${this.rowModel.getType()}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const n={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(n):this.selectionService.deselectAllRowNodes(n)}isCheckboxSelection(){const e=this.selectionOptions,t=e&&Pl(e)&&$n(this.column),i=this.column.getColDef().headerCheckboxSelection;let s=!1;return t?s=!0:typeof i=="function"?s=i(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()})):s=!!i,s&&this.checkRightRowModelType(t?"headerCheckbox":"headerCheckboxSelection")&&this.checkSelectionType(t?"headerCheckbox":"headerCheckboxSelection")}isFilteredOnly(){const e=this.selectionOptions;return e!==void 0?e.mode==="multiRow"&&e.selectAll==="filtered":!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){const e=this.selectionOptions;return e!==void 0?e.mode==="multiRow"&&e.selectAll==="currentPage":!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}},Ek=class extends jl{constructor(e,t,i){super(e,t,i),this.refreshFunctions={},this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s,n){this.comp=e,n=tr(this,this.beans.context,n),this.setGui(t,n),this.updateState(),this.setupWidth(n),this.setupMovingCss(n),this.setupMenuClass(n),this.setupSortableClass(n),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight({wrapperElement:s,checkMeasuringCallback:r=>this.setRefreshFunction("measuring",r),compBean:n}),this.addColumnHoverListener(n),this.setupFilterClass(n),this.setupClassesFromColDef(),this.setupTooltip(n),this.addActiveHeaderMouseListeners(n),this.setupSelectAll(n),this.setupUserComp(n),this.refreshAria(),this.resizeFeature=n.createManagedBean(new Fk(this.getPinned(),this.column,i,e,this)),n.createManagedBean(new Xd([this.column],t)),n.createManagedBean(new Qd(this.column,t,this.beans)),n.createManagedBean(new hn(t,{shouldStopEventPropagation:r=>this.shouldStopEventPropagation(r),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(n),n.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],()=>this.refresh(n)),n.addManagedListeners(this.column,{colDefChanged:()=>this.refresh(n)}),n.addManagedListeners(this.column,{headerHighlightChanged:this.onHeaderHighlightChanged.bind(this)});const o=()=>this.checkDisplayName(n);n.addManagedEventListeners({columnValueChanged:o,columnRowGroupChanged:o,columnPivotChanged:o,headerHeightChanged:this.onHeaderHeightChanged.bind(this)}),n.addDestroyFunc(()=>{this.refreshFunctions={},this.selectAllFeature=null,this.dragSourceElement=void 0,this.userCompDetails=null,this.userHeaderClasses.clear(),this.ariaDescriptionProperties.clear(),this.clearComponent()})}resizeHeader(e,t){if(!this.column.isResizable())return;const i=this.column.getActualWidth(),s=this.column.getMinWidth(),n=this.column.getMaxWidth(),o=Math.min(Math.max(i+e,s),n);this.beans.columnSizeService.setColumnWidths([{key:this.column,newWidth:o}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,beans:i,column:s,ctrlsService:n}=this,{gos:o,columnModel:r,columnMoveService:a,visibleColsService:d}=i,h=this.getPinned(),g=t.getBoundingClientRect().left,f=s.getActualWidth(),C=o.get("enableRtl"),S=Zl({x:e===0!==C?g-20:g+f+20,pinned:h,fromKeyboard:!0,gos:o,ctrlsService:n}),R=this.focusService.getFocusedHeader();su({allMovingColumns:[s],isFromHeader:!0,fromLeft:e===1,xPosition:S,pinned:h,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:r,columnMoveService:a,visibleColsService:d,finished:!0}),n.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(s,"auto"),(!this.isAlive()||this.beans.gos.get("ensureDomOrder"))&&R&&this.restoreFocus(R)}restoreFocus(e){this.focusService.focusHeaderPosition({headerPosition:{...e,column:this.column}})}setupUserComp(e){const t=this.lookupUserCompDetails(e);this.setCompDetails(t)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(e){const t=this.createParams(e),i=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(i,t)}createParams(e){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:i=>{this.menuService.showColumnMenu({column:this.column,buttonElement:i,positionBy:"button"})},showColumnMenuAfterMouseClick:i=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:i,positionBy:"mouse"})},showFilter:i=>{this.menuService.showFilterMenu({column:this.column,buttonElement:i,containerType:"columnFilter",positionBy:"button"})},progressSort:i=>{this.beans.sortController.progressSort(this.column,!!i,"uiColumnSorted")},setSort:(i,s)=>{this.beans.sortController.setSortForColumn(this.column,i,!!s,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(i,s)=>{this.setupTooltip(e,i,s)}})}setupSelectAll(e){this.selectAllFeature=e.createManagedBean(new xk(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===N.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===N.ENTER&&this.onEnterKeyDown(e),e.key===N.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();!i||!(i instanceof Bd)||i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const t=this.getRowIndex();this.focusService.setFocusedHeader(t,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t,i){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const s=this.gos.get("tooltipShowMode")==="whenTruncated",n=this.eGui,o=this.column.getColDef();!i&&s&&!o.headerComponent&&(i=()=>{const d=n.querySelector(".ag-header-cell-text");return d?d.scrollWidth>d.clientWidth:!0});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>n,getLocation:()=>"header",getTooltipValue:()=>t??this.column.getColDef().headerTooltip,shouldDisplayTooltip:i},a=e.createManagedBean(new Yn(r));this.setRefreshFunction("tooltip",()=>a.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),i=kf(t,this.gos,this.column,null),s=this.userHeaderClasses;this.userHeaderClasses=new Set(i),i.forEach(n=>{s.has(n)?s.delete(n):this.comp.addOrRemoveCssClass(n,!0)}),s.forEach(n=>this.comp.addOrRemoveCssClass(n,!1))};this.setRefreshFunction("headerClasses",e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:n,gos:o}=this,{columnModel:r}=i;let a=!this.gos.get("suppressDragLeaveHidesColumns");const d=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?"hide":"notAllowed",getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),Xn([t],!0)},onDragStopped:()=>Xn([t],!1),onDragCancelled:()=>Xn([t],!1),onGridEnter:h=>{var g;if(a){const f=((g=h==null?void 0:h.columns)==null?void 0:g.filter(C=>!C.getColDef().lockVisible))||[];r.setColsVisible(f,!0,"uiColumnMoved")}},onGridExit:h=>{var g;if(a){const f=((g=h==null?void 0:h.columns)==null?void 0:g.filter(C=>!C.getColDef().lockVisible))||[];r.setColsVisible(f,!1,"uiColumnMoved")}}};n.addDragSource(d,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}setRefreshFunction(e,t){this.refreshFunctions[e]=t}refresh(e){this.updateState(),this.refreshHeaderComp(e),this.refreshAria(),Object.values(this.refreshFunctions).forEach(t=>t())}refreshHeaderComp(e){const t=this.lookupUserCompDetails(e);(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==t.componentClass?this.attemptHeaderCompRefresh(t.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(t)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.columnNameService.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(e){this.displayName!==this.calculateDisplayName()&&this.refresh(e)}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}setupWidth(e){const t=()=>{const i=this.column.getActualWidth();this.comp.setWidth(`${i}px`)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupMovingCss(e){const t=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};e.addManagedListeners(this.column,{movingChanged:t}),t()}setupMenuClass(e){const t=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};e.addManagedListeners(this.column,{menuVisibleChanged:t}),t()}setupSortableClass(e){const t=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};t(),this.setRefreshFunction("updateSortable",t),e.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(e){const t=()=>{const i=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",i),this.refreshAria()};e.addManagedListeners(this.column,{filterActiveChanged:t}),t()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",t)};e(),this.setRefreshFunction("wrapText",e)}onHeaderHighlightChanged(){const e=this.column.getHighlighted(),t=e===0,i=e===1;this.comp.addOrRemoveCssClass("ag-header-highlight-before",t),this.comp.addOrRemoveCssClass("ag-header-highlight-after",i)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),i.addOrRemoveCssClass("ag-header-span-total",!1);return}const{numberOfParents:n,isSpanningTotal:o}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",n>0);const{columnModel:r}=s,a=r.getColumnHeaderRowHeight();if(n===0){i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${a}px`);return}i.addOrRemoveCssClass("ag-header-span-total",o);const d=this.beans.columnModel.getGroupRowsHeight();let h=0;for(let g=0;g<n;g++)h+=d[d.length-1-g];e.style.setProperty("top",`${-h}px`),e.style.setProperty("height",`${a+h}px`)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(_T(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){t!=null?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(Ke(this.beans.gos)))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort((t,i)=>t==="filter"?-1:i.charCodeAt(0)-t.charCodeAt(0)).map(t=>this.ariaDescriptionProperties.get(t)).join(". ");this.beans.ariaAnnouncementService.announceValue(e,"columnHeader")}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(e){const t=()=>{if(!this.gos.get("columnHoverHighlight"))return;const i=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",i)};e.addManagedEventListeners({columnHoverChanged:t}),t()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(e){const t=n=>this.handleMouseOverChange(n.type==="mouseenter"),i=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column),s=n=>this.handleContextMenuMouseEvent(n,void 0,this.column);e.addManagedListeners(this.getGui(),{mouseenter:t,mouseleave:t,click:i,contextmenu:s})}handleMouseOverChange(e){this.setActiveHeader(e),this.eventService.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column})}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof Bd?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy()}},Pk=class extends B{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.autoWidthCalculator=e.autoWidthCalculator,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const t=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const i=[];this.columnGroup.getDisplayedLeafColumns().forEach(n=>{n.getColDef().suppressAutoSize||i.push(n.getColId())}),i.length>0&&this.columnAutosizeService.autoSizeCols({colKeys:i,skipHeader:t,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),n=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(n,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s=this.getSizeRatiosOfColumns(t,i),n={columnsToResize:t,resizeStartWidth:i,resizeRatios:s};let o=null;if(e&&(o=this.visibleColsService.getGroupAtDirection(this.columnGroup,"After")),o){const r=o.getDisplayedLeafColumns(),a=n.groupAfterColumns=r.filter(h=>h.isResizable()),d=n.groupAfterStartWidth=this.getInitialSizeOfColumns(a);n.groupAfterRatios=this.getSizeRatiosOfColumns(a,d)}else n.groupAfterColumns=void 0,n.groupAfterStartWidth=void 0,n.groupAfterRatios=void 0;return n}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:n,groupAfterStartWidth:o,groupAfterRatios:r}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=n,this.resizeTakeFromStartWidth=o,this.resizeTakeFromRatios=r}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){if(!this.resizeCols||!this.resizeRatios)return;const s={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols??void 0,groupAfterStartWidth:this.resizeTakeFromStartWidth??void 0,groupAfterRatios:this.resizeTakeFromRatios??void 0};this.resizeColumns(s,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:n,resizeStartWidth:o,resizeRatios:r,groupAfterColumns:a,groupAfterStartWidth:d,groupAfterRatios:h}=e,g=[];if(g.push({columns:n,ratios:r,width:t}),a){const f=t-o;g.push({columns:a,ratios:h,width:d-f})}this.columnSizeService.resizeColumnSets({resizeSets:g,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}getInitialSizeOfColumns(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(i=>i.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}},Dk=class extends B{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);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",e===0)}},Tk=class extends jl{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const s=this.getGui();this.setDragSource(s)}},this.column=e}setComp(e,t,i,s,n){this.comp=e,n=tr(this,this.beans.context,n),this.setGui(t,n),this.displayName=this.beans.columnNameService.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(n),this.setupExpandable(n),this.setupTooltip(n),this.setupAutoHeight({wrapperElement:s,compBean:n}),this.setupUserComp(n),this.addHeaderMouseListeners(n);const o=this.getParentRowCtrl().getPinned(),r=this.column.getProvidedColumnGroup().getLeafColumns();n.createManagedBean(new Xd(r,t)),n.createManagedBean(new Qd(this.column,t,this.beans)),n.createManagedBean(new Dk(e,this.column)),this.resizeFeature=n.createManagedBean(new Pk(e,i,o,this.column)),n.createManagedBean(new hn(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addHighlightListeners(n,r),n.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners(n),n.addDestroyFunc(()=>this.clearComponent())}addHighlightListeners(e,t){if(this.beans.gos.get("suppressMoveWhenColumnDragging"))for(const i of t)e.addManagedListeners(i,{headerHighlightChanged:this.onLeafColumnHighlightChanged.bind(this,i)})}onLeafColumnHighlightChanged(e){const t=this.column.getDisplayedLeafColumns(),i=t[0]===e,s=ce(t)===e;if(!i&&!s)return;const n=e.getHighlighted(),o=!!this.getParentRowCtrl().findHeaderCellCtrl(d=>d.getColumnGroupChild().isMoving());let r=!1,a=!1;if(o){const d=this.beans.gos.get("enableRtl"),h=n===1,g=n===0;i&&(d?a=h:r=g),s&&(d?r=g:a=h)}this.comp.addOrRemoveCssClass("ag-header-highlight-before",r),this.comp.addOrRemoveCssClass("ag-header-highlight-after",a)}getColumn(){return this.column}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,ctrlsService:n}=this,{gos:o,columnModel:r,columnMoveService:a,visibleColsService:d}=t,h=o.get("enableRtl"),g=e===0,f=this.getPinned(),C=i.getBoundingClientRect(),v=C.left,S=C.width,R=Zl({x:g!==h?v-20:v+S+20,pinned:f,fromKeyboard:!0,gos:o,ctrlsService:n}),y=s.getGroupId(),x=this.focusService.getFocusedHeader();su({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,fromLeft:e===1,xPosition:R,pinned:f,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:r,columnMoveService:a,visibleColsService:d,finished:!0});const P=s.getDisplayedLeafColumns(),T=g?P[0]:ce(P);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(T,"auto"),(!this.isAlive()||this.beans.gos.get("ensureDomOrder"))&&x&&this.restoreFocus(y,s,x)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const n=s[0].getParent();if(!n)return;const o=this.findGroupWidthId(n,e);o&&this.focusService.focusHeaderPosition({headerPosition:{...i,column:o}})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(e){const t=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:s=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),s,"gridInitializing")},setTooltip:(s,n)=>{this.setupTooltip(e,s,n)}}),i=this.userComponentFactory.getHeaderGroupCompDetails(t);this.comp.setUserCompDetails(i)}addHeaderMouseListeners(e){const t=n=>this.handleMouseOverChange(n.type==="mouseenter"),i=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column.getProvidedColumnGroup()),s=n=>this.handleContextMenuMouseEvent(n,void 0,this.column.getProvidedColumnGroup());e.addManagedListeners(this.getGui(),{mouseenter:t,mouseleave:t,click:i,contextmenu:s})}handleMouseOverChange(e){this.eventService.dispatchEvent({type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()})}setupTooltip(e,t,i){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const s=this.column.getColGroupDef(),n=this.gos.get("tooltipShowMode")==="whenTruncated",o=this.eGui;!i&&n&&!(s!=null&&s.headerGroupComponent)&&(i=()=>{const a=o.querySelector(".ag-header-group-text");return a?a.scrollWidth>a.clientWidth:!0});const r={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>t??(s&&s.headerTooltip),shouldDisplayTooltip:i};s&&(r.getColDef=()=>s),e.createManagedBean(new Yn(r))}setupExpandable(e){const t=this.column.getProvidedColumnGroup();this.refreshExpanded();const i=this.refreshExpanded.bind(this);e.addManagedListeners(t,{expandedChanged:i,expandableChanged:i})}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)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=kf(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(s=>s.isSpanHeaderHeight())&&t.push("ag-header-span-height")):(t.push("ag-header-group-cell-with-group"),e!=null&&e.wrapHeaderText&&t.push("ag-header-cell-wrap-text")),t.forEach(i=>this.comp.addOrRemoveCssClass(i,!0))}setupMovingCss(e){const i=this.column.getProvidedColumnGroup().getLeafColumns(),s=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());i.forEach(n=>{e.addManagedListeners(n,{movingChanged:s})}),s()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const t=this.getRowIndex();this.beans.focusService.setFocusedHeader(t,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(!(!this.expandable||!t)&&e.key===N.ENTER){const i=this.column,s=!i.isExpanded();this.beans.columnModel.setColumnGroupOpened(i.getProvidedColumnGroup(),s,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),!e))return;const{beans:t,column:i,displayName:s,gos:n,dragAndDropService:o}=this,{columnModel:r}=t,a=i.getProvidedColumnGroup().getLeafColumns();let d=!n.get("suppressDragLeaveHidesColumns");const h=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>d?"hide":"notAllowed",dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{d=!n.get("suppressDragLeaveHidesColumns"),Xn(a,!0)},onDragStopped:()=>Xn(a,!1),onDragCancelled:()=>Xn(a,!1),onGridEnter:g=>{if(d){const{columns:f=[],visibleState:C}=g??{},v=f.filter(S=>!S.getColDef().lockVisible&&(!C||C[S.getColId()]));r.setColsVisible(v,!0,"uiColumnMoved")}},onGridExit:g=>{var f;if(d){const C=((f=g==null?void 0:g.columns)==null?void 0:f.filter(v=>!v.getColDef().lockVisible))||[];r.setColsVisible(C,!1,"uiColumnMoved")}}};o.addDragSource(h,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(r=>i[r.getId()]=r.isVisible());const s=[];this.beans.visibleColsService.getAllCols().forEach(r=>{t.indexOf(r)>=0&&(s.push(r),wt(t,r))}),t.forEach(r=>s.push(r));const n=[],o=e.getLeafColumns();for(const r of s)o.indexOf(r)!==-1&&n.push(r);return{columns:s,columnsInSplit:n,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(i=>{(i.getColDef().suppressMovable||i.getColDef().lockPosition)&&(e=!0)}),e||this.gos.get("suppressMovableColumns")}destroy(){super.destroy()}},Ak=0,ou=class extends B{constructor(e,t,i){super(),this.instanceId=Ak++,this.rowIndex=e,this.pinned=t,this.type=i;const s=i=="group"?"ag-header-row-column-group":i=="filter"?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}wireBeans(e){this.beans=e}postConstruct(){this.isPrintLayout=ht(this.gos,"print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}areCellsRendered(){return this.comp?this.getHeaderCellCtrls().every(e=>e.getGui()!=null):!1}setComp(e,t,i=!0){this.comp=e,t=tr(this,this.beans.context,t),i&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners(t)}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(e){const t=this.onRowHeightChanged.bind(this);e.addManagedEventListeners({columnResized:this.onColumnResized.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:i=>this.onVirtualColumnsChanged(i.afterScroll),columnGroupHeaderHeightChanged:t,columnHeaderHeightChanged:t,gridStylesChanged:t,advancedFilterEnabledChanged:t}),e.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),e.addManagedPropertyListener("ensureDomOrder",i=>this.isEnsureDomOrder=i.currentValue),e.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],t)}getHeaderCellCtrl(e){if(this.headerCellCtrls)return Rl(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=ht(this.gos,"print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleColsService:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans,i=[],s=e.getGroupRowsHeight(),n=e.getColumnHeaderRowHeight();i.push(...s),i.push(n),t!=null&&t.hasFloatingFilters()&&i.push(e.getFloatingFiltersHeight());let o=0;for(let a=0;a<this.rowIndex;a++)o+=i[a];const r=i[this.rowIndex];return{topOffset:o,rowHeight:r}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const s of t)this.recycleAndCreateHeaderCtrls(s,e);const i=s=>{const{focusService:n,visibleColsService:o}=this.beans;return n.isHeaderWrapperFocused(s)?o.isVisible(s.getColumnGroupChild()):!1};if(e)for(const[s,n]of e)i(n)?this.headerCellCtrls.set(s,n):this.destroyBean(n);return this.getHeaderCellCtrls()}getHeaderCellCtrls(){var e;return Array.from(((e=this.headerCellCtrls)==null?void 0:e.values())??[])}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls||e.isEmptyGroup())return;const i=e.getUniqueId();let s;if(t&&(s=t.get(i),t.delete(i)),s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),s==null)switch(this.type){case"filter":{s=this.createBean(this.beans.ctrlsFactory.getInstance("headerFilterCell",e,this.beans,this));break}case"group":s=this.createBean(new Tk(e,this.beans,this));break;default:s=this.createBean(new Ek(e,this.beans,this));break}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let e=[];const t=this.getActualDepth(),{columnViewportService:i}=this.beans;return["left",null,"right"].forEach(s=>{const n=i.getHeadersToRender(s,t);e=e.concat(n)}),e}getActualDepth(){return this.type=="filter"?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnViewportService.getHeadersToRender(this.pinned,this.getActualDepth())}findHeaderCellCtrl(e){if(!this.headerCellCtrls)return;const t=this.getHeaderCellCtrls();let i;return typeof e=="function"?i=t.find(e):i=t.find(s=>s.getColumnGroupChild()==e),i}focusHeader(e,t){const i=this.findHeaderCellCtrl(e);return i?i.focus(t):!1}destroy(){var e;(e=this.headerCellCtrls)==null||e.forEach(t=>{this.destroyBean(t)}),this.headerCellCtrls=void 0,super.destroy()}},Mk=class extends B{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}wireBeans(e){this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.focusService=e.focusService,this.filterManager=e.filterManager}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport);const i=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsChanged:i,advancedFilterEnabledChanged:i});const s=`${typeof this.pinned=="string"?this.pinned:"center"}Header`;this.ctrlsService.register(s,this),this.columnModel.isReady()&&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 t=new qn,i=this.focusService.getFocusHeaderToUseAfterRefresh(),s=()=>{const a=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let d=0;d<a;d++){const h=this.createBean(new ou(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(h)}},n=()=>{const a=t.next(),d=!this.hidden&&(this.columnsRowCtrl==null||!e||this.columnsRowCtrl.getRowIndex()!==a);(d||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),d&&(this.columnsRowCtrl=this.createBean(new ou(a,this.pinned,"column")))},o=()=>{var h;this.includeFloatingFilter=!!((h=this.filterManager)!=null&&h.hasFloatingFilters())&&!this.hidden;const a=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){a();return}const d=t.next();if(this.filtersRowCtrl){const g=this.filtersRowCtrl.getRowIndex()!==d;(!e||g)&&a()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new ou(d,this.pinned,"filter")))};s(),n(),o();const r=this.getAllCtrls();this.comp.setCtrls(r),this.restoreFocusOnHeader(i)}getHeaderCtrlForColumn(e){var t;if(As(e))return(t=this.columnsRowCtrl)==null?void 0:t.getHeaderCellCtrl(e);if(this.groupsRowCtrls.length!==0)for(let i=0;i<this.groupsRowCtrls.length;i++){const s=this.groupsRowCtrls[i].getHeaderCellCtrl(e);if(s)return s}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const i=this.getAllCtrls()[e];return i?i.getType():void 0}focusHeader(e,t,i){const n=this.getAllCtrls()[e];return n?n.focusHeader(t,i):!1}getViewportElement(){return this.eViewport}getGroupRowCount(){return this.groupsRowCtrls.length}getGroupRowCtrlAtIndex(e){return this.groupsRowCtrls[e]}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}onScrollCallback(e){this.addManagedElementListeners(this.getViewportElement(),{scroll:e})}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}setupDragAndDrop(e){const t=new Rk(this.pinned,e);this.createManagedBean(t)}restoreFocusOnHeader(e){if(!e)return;const{column:t}=e;t.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){var t;const e=((t=this.filterManager)==null?void 0:t.hasFloatingFilters())&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new iu(e=>this.comp.setCenterWidth(`${e}px`),!0))}setupPinnedWidth(){if(this.pinned==null)return;const e=this.pinned==="left",t=this.pinned==="right";this.hidden=!0;const i=()=>{const s=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(s==null)return;const n=s==0,o=this.hidden!==n,r=this.gos.get("enableRtl"),a=this.scrollVisibleService.getScrollbarWidth(),h=this.scrollVisibleService.isVerticalScrollShowing()&&(r&&e||!r&&t)?s+a:s;this.comp.setPinnedContainerWidth(`${h}px`),this.comp.setDisplayed(!n),o&&(this.hidden=n,this.refresh())};this.addManagedEventListeners({leftPinnedWidthChanged:i,rightPinnedWidthChanged:i,scrollVisibilityChanged:i,scrollbarWidthChanged:i})}},kk='<div class="ag-pinned-left-header" role="rowgroup"></div>',Ik='<div class="ag-pinned-right-header" role="rowgroup"></div>',Lk=`<div class="ag-header-viewport" role="presentation">
120
+ <div class="ag-header-container" data-ref="eCenterContainer" role="rowgroup"></div>
121
+ </div>`,ru=class extends Pe{constructor(e){super(),this.eCenterContainer=J,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:i=>this.setDisplayed(i),setCtrls:i=>this.setCtrls(i),setCenterWidth:i=>this.eCenterContainer.style.width=i,setViewportScrollLeft:i=>this.getGui().scrollLeft=i,setPinnedContainerWidth:i=>{const s=this.getGui();s.style.width=i,s.style.maxWidth=i,s.style.minWidth=i}};this.createManagedBean(new Mk(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",i=e?kk:t?Ik:Lk;this.setTemplate(i),this.eRowContainer=this.eCenterContainer!==J?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let i;const s=n=>{const o=n.getGui();o.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(o),i&&qg(this.eRowContainer,o,i),i=o};e.forEach(n=>{const o=n.instanceId,r=t[o];delete t[o];const a=r||this.createBean(new hk(n));this.headerRowComps[o]=a,this.rowCompsList.push(a),s(a)}),Ts(t).forEach(n=>this.destroyRowComp(n))}},_k=class extends Pe{constructor(){super('<div class="ag-header" role="presentation"/>')}postConstruct(){const e={addOrRemoveCssClass:(s,n)=>this.addOrRemoveCssClass(s,n),setHeightAndMinHeight:s=>{this.getGui().style.height=s,this.getGui().style.minHeight=s}};this.createManagedBean(new gk).setComp(e,this.getGui(),this.getFocusableElement());const i=s=>{this.createManagedBean(s),this.appendChild(s)};i(new ru("left")),i(new ru(null)),i(new ru("right"))}},Ok={selector:"AG-HEADER-ROOT",component:_k},lu=class extends B{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){const e=this.gos.get("domLayout")??"normal";return["normal","print","autoHeight"].indexOf(e)===-1?(W(`${e} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):e}},Vk=class extends Pe{constructor(){super(`
122
+ <div class="ag-overlay" role="presentation">
123
+ <div class="ag-overlay-panel" role="presentation">
124
+ <div class="ag-overlay-wrapper" data-ref="eOverlayWrapper" role="presentation"></div>
125
+ </div>
126
+ </div>`),this.eOverlayWrapper=J,this.activePromise=null,this.activeOverlay=null,this.updateListenerDestroyFunc=null,this.activeOverlayWrapperCssClass=null,this.elToFocusAfter=null}wireBeans(e){this.overlayService=e.overlayService,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}handleKeyDown(e){if(e.key!==N.TAB||e.defaultPrevented||Xi(e)||this.focusService.findNextFocusableElement(this.eOverlayWrapper,!1,e.shiftKey))return;let i=!1;e.shiftKey?i=this.focusService.focusGridView(ce(this.visibleColsService.getAllCols()),!0,!1):i=this.focusService.focusNextGridCoreContainer(!1),i&&e.preventDefault()}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new lu(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.setOverlayWrapperComp(this),this.addManagedElementListeners(this.getFocusableElement(),{keydown:this.handleKeyDown.bind(this)})}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,i,s){if(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.elToFocusAfter=null,this.activePromise=e,!!e){if(this.setDisplayed(!0,{skipAriaHidden:!0}),i&&this.focusService.isGridFocused()){const n=Ke(this.gos);n&&!fg(this.gos)&&(this.elToFocusAfter=n)}e.then(n=>{if(this.activePromise!==e){this.activeOverlay!==n&&(this.destroyBean(n),n=null);return}if(this.activePromise=null,!n)return;if(this.activeOverlay!==n&&(this.eOverlayWrapper.appendChild(n.getGui()),this.activeOverlay=n,s)){const r=n;this.updateListenerDestroyFunc=this.addManagedPropertyListener(s,({currentValue:a})=>{var d;(d=r.refresh)==null||d.call(r,this.gos.addGridCommonParams({...a??{}}))})}const o=this.focusService;i&&o.isGridFocused()&&o.focusInto(this.eOverlayWrapper)})}}updateOverlayWrapperPaddingTop(e){this.eOverlayWrapper.style.setProperty("padding-top",`${e}px`)}destroyActiveOverlay(){var s;this.activePromise=null;const e=this.activeOverlay;if(!e)return;let t=this.elToFocusAfter;this.activeOverlay=null,this.elToFocusAfter=null,t&&!this.focusService.isGridFocused()&&(t=null);const i=this.updateListenerDestroyFunc;i&&(i(),this.updateListenerDestroyFunc=null),this.destroyBean(e),yt(this.eOverlayWrapper),(s=t==null?void 0:t.focus)==null||s.call(t,{preventScroll:!0})}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.elToFocusAfter=null,this.destroyActiveOverlay(),this.overlayService.setOverlayWrapperComp(void 0),super.destroy()}},Nk={selector:"AG-OVERLAY-WRAPPER",component:Vk},Uf=class extends Pe{constructor(e,t){super(),this.direction=t,this.eViewport=J,this.eContainer=J,this.hideTimeout=null,this.setTemplate(e)}wireBeans(e){this.animationFrameService=e.animationFrameService}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",Wg()||Ms())}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=Ug(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0),i=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:i,touchend:i})}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(this.hideTimeout!==null&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)}})}attemptSettingScrollPosition(e){const t=this.getViewportElement();UD(()=>jt(t),()=>this.setScrollPosition(e),100)}getViewportElement(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedElementListeners(this.getViewportElement(),{scroll:e})}},Bk=class extends Uf{constructor(){super(`<div class="ag-body-horizontal-scroll" aria-hidden="true">
127
+ <div class="ag-horizontal-left-spacer" data-ref="eLeftSpacer"></div>
128
+ <div class="ag-body-horizontal-scroll-viewport" data-ref="eViewport">
129
+ <div class="ag-body-horizontal-scroll-container" data-ref="eContainer"></div>
130
+ </div>
131
+ <div class="ag-horizontal-right-spacer" data-ref="eRightSpacer"></div>
132
+ </div>`,"horizontal"),this.eLeftSpacer=J,this.eRightSpacer=J}wireBeans(e){super.wireBeans(e),this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new iu(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.visibleColsService.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.scrollVisibleService.getScrollbarWidth();i&&(t+=s),Fi(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let n=this.visibleColsService.getColsLeftWidth();this.enableRtl&&e&&(n+=s),Fi(this.eLeftSpacer,n),this.eLeftSpacer.classList.toggle("ag-scroller-corner",n<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),s=e&&this.scrollVisibleService.getScrollbarWidth()||0,o=i?0:s===0&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),or(this.getGui(),o),or(this.eViewport,o),or(this.eContainer,o),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return Bl(this.getViewportElement(),this.enableRtl)}setScrollPosition(e){jt(this.getViewportElement())||this.attemptSettingScrollPosition(e),Gl(this.getViewportElement(),e,this.enableRtl)}},Gk={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:Bk},$f=class extends B{wireBeans(e){this.maxDivHeightScaler=e.rowContainerHeightService}constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this)})}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=e!=null?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}},Hk=class extends Uf{wireBeans(e){super.wireBeans(e),this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}constructor(){super(`<div class="ag-body-vertical-scroll" aria-hidden="true">
133
+ <div class="ag-body-vertical-scroll-viewport" data-ref="eViewport">
134
+ <div class="ag-body-vertical-scroll-container" data-ref="eContainer"></div>
135
+ </div>
136
+ </div>`,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new $f(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this)})}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.scrollVisibleService.getScrollbarWidth()||0,s=i===0&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Fi(this.getGui(),s),Fi(this.eViewport,s),Fi(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,i=e.getGridBodyCtrl().getBodyViewportElement(),s=this.getScrollPosition(),n=i.scrollTop;s!=n&&this.setScrollPosition(n,!0)}getScrollPosition(){return this.getViewportElement().scrollTop}setScrollPosition(e,t){!t&&!jt(this.getViewportElement())&&this.attemptSettingScrollPosition(e),this.getViewportElement().scrollTop=e}},Wk={selector:"AG-FAKE-VERTICAL-SCROLL",component:Hk},au=(e=>(e.FakeHScrollbar="fakeHScrollComp",e.Header="centerHeader",e.PinnedTop="topCenter",e.PinnedBottom="bottomCenter",e.StickyTop="stickyTopCenter",e.StickyBottom="stickyBottomCenter",e))(au||{}),zk=class extends B{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Pt(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=Pt(()=>this.lastScrollSource[0]=null,500)}wireBeans(e){this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.rowModel=e.rowModel,this.heightScaler=e.rowContainerHeightService,this.rowRenderer=e.rowRenderer,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)}),this.ctrlsService.whenReady(this,e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){this.addHorizontalScrollListeners(),this.addVerticalScrollListeners()}addHorizontalScrollListeners(){this.addManagedElementListeners(this.centerRowsCtrl.getViewportElement(),{scroll:this.onHScroll.bind(this,"Viewport")});for(const e of Object.values(au)){const t=this.ctrlsService.get(e);this.registerScrollPartner(t,this.onHScroll.bind(this,e))}}addVerticalScrollListeners(){const e=this.ctrlsService.get("fakeVScrollComp"),t=this.gos.get("debounceVerticalScrollbar"),i=t?Pt(this.onVScroll.bind(this,"Viewport"),100):this.onVScroll.bind(this,"Viewport"),s=t?Pt(this.onVScroll.bind(this,"fakeVScrollComp"),100):this.onVScroll.bind(this,"fakeVScrollComp");this.addManagedElementListeners(this.eBodyViewport,{scroll:i}),this.registerScrollPartner(e,s)}registerScrollPartner(e,t){e.onScrollCallback(t)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){this.centerRowsCtrl!=null&&(e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft()),this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e)))}setScrollLeftForAllContainersExceptCurrent(e){for(const t of[...Object.values(au),"Viewport"]){if(this.lastScrollSource[1]===t)continue;const i=this.getViewportForSource(t);Gl(i,e,this.enableRtl)}}getViewportForSource(e){return e==="Viewport"?this.centerRowsCtrl.getViewportElement():this.ctrlsService.get(e).getViewportElement()}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(t===0?this.lastScrollSource[0]=e:this.lastScrollSource[1]=e,!0):this.lastScrollSource[t]===e}onHScroll(e){if(!this.isControllingScroll(e,1))return;const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;const s=Bl(this.getViewportForSource(e),this.enableRtl);this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onVScroll(e){if(!this.isControllingScroll(e,0))return;let t;e==="Viewport"?t=this.eBodyViewport.scrollTop:t=this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),!this.shouldBlockScrollUpdate(0,t,!0)&&(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,e==="Viewport"?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{this.eventService.dispatchEvent({...t,type:"bodyScrollEnd"})},100)}shouldBlockScrollUpdate(e,t,i=!1){return i&&!Ms()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=Ol(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&Nl()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScroll("Viewport")}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const s=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl&&Nl()?e=e>0?0:s:e=Math.min(Math.max(e,0),s)),Gl(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}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.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let n=0;n<i;n++){const o=this.rowModel.getRow(n);if(typeof e=="function"){if(o&&e(o)){s=n;break}}else if(e===o||e===o.data){s=n;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(ht(this.gos,"print"))return;const i=this.rowModel.getRowCount();if(typeof e!="number"||e<0||e>=i){W("Invalid row index for ensureIndexVisible: "+e);return}const n=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{var g;n||(g=this.paginationService)==null||g.goToPageWithIndex(e);const o=this.ctrlsService.getGridBodyCtrl(),r=o.getStickyTopHeight(),a=o.getStickyBottomHeight(),d=this.rowModel.getRow(e);let h;do{const f=d.rowTop,C=d.rowHeight,v=this.pageBoundsService.getPixelOffset(),S=d.rowTop-v,R=S+d.rowHeight,y=this.getVScrollPosition(),x=this.heightScaler.getDivStretchOffset(),P=y.top+x,T=y.bottom+x,I=T-P,V=this.heightScaler.getScrollPositionForPixel(S),_=this.heightScaler.getScrollPositionForPixel(R-I),O=Math.min((V+_)/2,S),M=P+r>S,A=T-a<R;let z=null;t==="top"?z=V:t==="bottom"?z=_:t==="middle"?z=O:M?z=V-r:A&&(z=_+a),z!==null&&(this.setVerticalScrollPosition(z),this.rowRenderer.redraw({afterScroll:!0})),h=f!==d.rowTop||C!==d.rowHeight}while(h);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getCol(e);if(!i||i.isPinned()||!this.visibleColsService.isColDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{s!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),n=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),o=this.centerRowsCtrl.getCenterWidth(),r=this.enableRtl;let a=(r?i:s)||n,d=r?s:i;t!=="auto"&&(a=t==="start",d=t==="end");const h=t==="middle";if(a||d||h){const{colLeft:g,colMiddle:f,colRight:C}=this.getColumnBounds(e);return h?f-o/2:a?r?C:g:r?g-o:C-o}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:n}=this.getColumnBounds(e),o=this.enableRtl,r=o?t>n:i<n,a=o?i<s:t>s;return{columnBeforeStart:r,columnAfterEnd:a}}getColumnBounds(e){const t=this.enableRtl,i=this.visibleColsService.getBodyContainerWidth(),s=e.getActualWidth(),n=e.getLeft(),o=t?-1:1,r=t?i-n:n,a=r+s*o,d=r+s/2*o;return{colLeft:r,colMiddle:d,colRight:a}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),i=t,s=e+t;return{start:i,end:s,width:e}}},Uk=class extends B{wireBeans(e){this.ctrlsService=e.ctrlsService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.columnViewportService=e.columnViewportService}constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.scrollVisibleService.onCentreViewportResized(),this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnSizeService.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=Zn(e);if(t<=50)return;let i=this.getPinnedColumnsOverflowingViewport(t-50);const s=this.gos.getCallback("processUnpinnedColumns");i.length&&(s&&(i=s({columns:i,viewportWidth:t})),this.columnModel.setColsPinned(i,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth(),i=this.pinnedWidthService.getPinnedLeftWidth(),s=t+i;if(s<e)return[];const n=[...this.visibleColsService.getLeftCols()],o=[...this.visibleColsService.getRightCols()];let r=0,a=0;const d=0,h=[];let g=s-d-e;for(;(a<n.length||r<o.length)&&g>0;){if(r<o.length){const f=o[r++];g-=f.getActualWidth(),h.push(f)}if(a<n.length&&g>0){const f=n[a++];g-=f.getActualWidth(),h.push(f)}}return h}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=Ol(e);this.bodyHeight!==t&&(this.bodyHeight=t,this.eventService.dispatchEvent({type:"bodyHeightChanged"}))}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnViewportService.setScrollPosition(e,t)}},$k=class extends B{wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.rangeService)return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListeners(["enableRangeSelection","selection"],()=>{Ot(this.gos)?this.enableFeature():this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),Ot(this.gos)&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}},Kk=class extends Pe{constructor(){super(`
137
+ <div class="ag-selection-checkbox" role="presentation">
138
+ <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
139
+ </div>`,[Hd]),this.eCheckbox=J}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=Rd(e,t),[s,n]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],o=e(s,n);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${o} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getInputElement(),{dblclick:s=>Un(s),click:s=>{Un(s);const n=dd(this.gos)==="filteredDescendants",o=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(o,n)?this.onClicked(!0,n,s||{})===0&&this.onClicked(!1,n,s):o?this.onClicked(!1,n,s):this.onClicked(!0,n,s||{})}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),ad(this.gos)||typeof this.getIsVisible()=="function"){const s=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:s}),this.addManagedListeners(this.rowNode,{dataChanged:s,cellChanged:s}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(this.eCheckbox.getPreviousValue()===void 0||e===void 0)&&Ye(this.gos)}showOrHideSelect(){var n,o,r;let e=this.rowNode.selectable;const t=this.getIsVisible();if(e)if(typeof t=="function"){const a=(n=this.overrides)==null?void 0:n.callbackParams;if(!this.column)e=t({...a,node:this.rowNode,data:this.rowNode.data});else{const d=this.column.createColumnFunctionCallbackParams(this.rowNode);e=t({...a,...d})}}else e=t??!1;const i=this.gos.get("selection");if(i?!qD(i):(o=this.column)==null?void 0:o.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!e),this.setVisible(!0),this.setDisplayed(!0);return}if((r=this.overrides)!=null&&r.removeHidden){this.setDisplayed(e);return}this.setVisible(e)}getIsVisible(){var t,i;if(this.overrides)return this.overrides.isVisible;const e=this.gos.get("selection");return e?zn(e):(i=(t=this.column)==null?void 0:t.getColDef())==null?void 0:i.checkboxSelection}},jk=class extends Pe{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(bt("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const i=()=>{try{const s=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",s),e.dataTransfer.setData("text/plain",s)}catch{}};if(t){const s=this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e});t(s)}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},Zk=class extends B{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,s=>this.cellComp.addOrRemoveCssClass(s,!0),s=>this.cellComp.addOrRemoveCssClass(s,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if(typeof e.cellStyle=="function"){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex}),s=e.cellStyle;t=s(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!0))}destroy(){super.destroy()}},qk=class extends B{constructor(e,t,i,s,n){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=n}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case N.ENTER:this.onEnterKeyDown(e);break;case N.F2:this.onF2KeyDown(e);break;case N.ESCAPE:this.onEscapeKeyDown(e);break;case N.TAB:this.onTabKeyDown(e);break;case N.BACKSPACE:case N.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case N.DOWN:case N.UP:case N.RIGHT:case N.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:s,rowNode:n}=this,{gos:o,rangeService:r,eventService:a}=s;if(!i.isEditing()){if(a.dispatchEvent({type:"keyShortcutChangedCellStart"}),wM(e,o.get("enableCellEditingOnBackspace"))){if(r&&Ot(o))r.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(i.isCellEditable()){const d=i.getColumn(),h=this.beans.valueService.getDeleteValue(d,n);n.setDataValue(d,h,"cellClear")}}else i.startRowOrCellEdit(e,t);a.dispatchEvent({type:"keyShortcutChangedCellEnd"})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?N.UP:N.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(N.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(N.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const s=e.key;s===" "?this.onSpaceKeyDown(e):this.cellCtrl.startRowOrCellEdit(s,e)&&e.preventDefault()}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&id(t)){const i=this.rowNode.isSelected(),s=!i,n=dd(t)==="filteredDescendants",o=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:n,event:e,source:"spaceKey"});i===void 0&&o===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:n,event:e,source:"spaceKey"})}e.preventDefault()}destroy(){super.destroy()}},Yk=class extends B{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!Xi(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t);break}}onCellClicked(e){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(e),e.preventDefault();return}const{eventService:t,rangeService:i,gos:s}=this.beans,n=e.ctrlKey||e.metaKey;i&&n&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const o=this.cellCtrl.createEvent(e,"cellClicked");t.dispatchEvent(o);const r=this.column.getColDef();r.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{r.onCellClicked(o)})},0),(s.get("singleClickEdit")||r.singleClickEdit)&&!s.get("suppressClickEdit")&&!(e.shiftKey&&(i==null?void 0:i.getCellRanges().length)!=0)&&this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!Ms()||xg("dblclick"))return!1;const e=new Date().getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const{column:t,beans:i,cellCtrl:s}=this,{eventService:n,frameworkOverrides:o,gos:r}=i,a=t.getColDef(),d=s.createEvent(e,"cellDoubleClicked");n.dispatchEvent(d),typeof a.onCellDoubleClicked=="function"&&window.setTimeout(()=>{o.wrapOutgoing(()=>{a.onCellDoubleClicked(d)})},0),!r.get("singleClickEdit")&&!r.get("suppressClickEdit")&&s.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,n=e.target,{cellCtrl:o,beans:r}=this,{eventService:a,rangeService:d,focusService:h,gos:g}=r;if(this.isRightClickInExistingRange(e))return;const f=d&&d.getCellRanges().length!=0;if(!s||!f){const v=g.get("enableCellTextSelection")&&e.defaultPrevented,S=(Gi()||v)&&!o.isEditing()&&!Od(n);o.focusCell(S)}if(s&&f&&!h.isCellFocused(o.getCellPosition())){e.preventDefault();const C=h.getFocusedCell();if(C){const{column:v,rowIndex:S,rowPinned:R}=C,y=r.rowRenderer.getRowByPosition({rowIndex:S,rowPinned:R}),x=y==null?void 0:y.getCellCtrl(v);x!=null&&x.isEditing()&&x.stopEditing(),h.setFocusedCell({column:v,rowIndex:S,rowPinned:R,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(n)){if(d){const C=this.cellCtrl.getCellPosition();if(s)d.extendLatestRangeToCell(C);else{const v=t||i;d.setRangeToCell(C,v)}}a.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseDown"))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=e.button===2||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return jn(e,"ag-selection-checkbox",3)}onMouseOut(e){this.mouseStayingInsideCell(e)||(this.beans.eventService.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOut")),this.beans.columnHoverService.clearMouseOver())}onMouseOver(e){this.mouseStayingInsideCell(e)||(this.beans.eventService.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseOver")),this.beans.columnHoverService.setMouseOver([this.column]))}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){super.destroy()}},Qk=class extends B{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();Ni(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(e===1)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let n=0;i&&n<e&&(t.push(i),i=this.beans.visibleColsService.getColAfter(i),!(!i||ke(i)||s!==i.getPinned()));n++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return this.beans.gos.get("enableRtl")&&this.colsSpanning?e=ce(this.colsSpanning):e=this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||this.column.getPinned()==="left")return e;const t=this.beans.visibleColsService.getColsLeftWidth();if(this.column.getPinned()==="right"){const i=this.beans.visibleColsService.getBodyContainerWidth();return t+i+(e||0)}return t+(e||0)}applyRowSpan(e){if(this.rowSpan===1&&!e)return;const i=on(this.beans.gos)*this.rowSpan;this.eGui.style.height=`${i}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},ur=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(ur||{}),cu=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(cu||{}),hr="ag-cell-range-selected",Xk="ag-cell-range-chart",Jk="ag-cell-range-single-cell",eI="ag-cell-range-chart-category",tI="ag-cell-range-handle",iI="ag-cell-range-top",sI="ag-cell-range-right",nI="ag-cell-range-bottom",oI="ag-cell-range-left",rI=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onCellSelectionChanged()}onCellSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(hr,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${hr}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${hr}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${hr}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${hr}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass(Xk,this.hasChartRange),Il(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(Jk,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,n=!t&&e.bottom,o=!t&&e.left;this.cellComp.addOrRemoveCssClass(iI,i),this.cellComp.addOrRemoveCssClass(sI,s),this.cellComp.addOrRemoveCssClass(nI,n),this.cellComp.addOrRemoveCssClass(oI,o)}isSingleCell(){const{rangeService:e}=this.beans;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(i=>Qi([1,0],i.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,n=!1;const o=this.cellCtrl.getCellPosition().column,r=this.beans.visibleColsService;let a,d;e?(a=r.getColAfter(o),d=r.getColBefore(o)):(a=r.getColBefore(o),d=r.getColAfter(o));const h=this.rangeService.getCellRanges().filter(g=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),g));a||(n=!0),d||(i=!0);for(let g=0;g<h.length&&!(t&&i&&s&&n);g++){const f=h[g],C=this.rangeService.getRangeStartRow(f),v=this.rangeService.getRangeEndRow(f);!t&&this.beans.rowPositionUtils.sameRow(C,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(v,this.cellCtrl.getCellPosition())&&(s=!0),!n&&a&&f.columns.indexOf(a)<0&&(n=!0),!i&&d&&f.columns.indexOf(d)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:n}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass(tI,!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=ce(t),n=this.cellCtrl.getCellPosition(),o=wg(e)&&!this.cellCtrl.isSuppressFillHandle(),r=YD(e);let a=i===1&&!this.cellCtrl.isEditing()&&(o||r);if(this.hasChartRange){const h=t[0].type===1&&this.rangeService.isCellInSpecificRange(n,t[0]);this.cellComp.addOrRemoveCssClass(eI,h),a=s.type===0}return a&&s.endRow!=null&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,n)}addSelectionHandle(){const e=ce(this.rangeService.getCellRanges()).type,i=wg(this.beans.gos)&&ke(e)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},lI="ag-cell",aI="ag-cell-auto-height",cI="ag-cell-normal-height",dI="ag-cell-focus",uI="ag-cell-first-right-pinned",hI="ag-cell-last-left-pinned",pI="ag-cell-not-inline-editing",gI="ag-column-hover",fI="ag-cell-wrap-text",mI=0,Kf=class Xh extends B{constructor(t,i,s,n){super(),this.column=t,this.rowNode=i,this.beans=s,this.rowCtrl=n,this.cellRangeFeature=void 0,this.cellPositionFeature=void 0,this.cellCustomStyleFeature=void 0,this.tooltipFeature=void 0,this.cellMouseListenerFeature=void 0,this.cellKeyboardListenerFeature=void 0,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.onCellEditorAttachedFuncs=[],this.instanceId=t.getId()+"-"+mI++,this.colIdSanitised=Bi(this.column.getId()),this.createCellPosition(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}onFocusOut(){this.beans.focusService.clearRestoreFocus()}addFeatures(){this.cellPositionFeature=new Qk(this,this.beans),this.cellCustomStyleFeature=new Zk(this,this.beans),this.cellMouseListenerFeature=new Yk(this,this.beans,this.column),this.cellKeyboardListenerFeature=new qk(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.column.isTooltipEnabled()&&this.enableTooltipFeature(),this.beans.rangeService&&Ot(this.beans.gos)&&(this.cellRangeFeature=new rI(this.beans,this))}removeFeatures(){const t=this.beans.context;this.cellPositionFeature=t.destroyBean(this.cellPositionFeature),this.cellCustomStyleFeature=t.destroyBean(this.cellCustomStyleFeature),this.cellMouseListenerFeature=t.destroyBean(this.cellMouseListenerFeature),this.cellKeyboardListenerFeature=t.destroyBean(this.cellKeyboardListenerFeature),this.cellRangeFeature=t.destroyBean(this.cellRangeFeature),this.disableTooltipFeature()}enableTooltipFeature(t,i){const s=()=>{const r=this.column.getColDef(),a=this.rowNode.data;if(r.tooltipField&&j(a))return Jo(a,r.tooltipField,this.column.isTooltipFieldContainsDots());const d=r.tooltipValueGetter;return d?d(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},n=this.beans.gos.get("tooltipShowMode")==="whenTruncated";!i&&n&&!this.isCellRenderer()&&(i=()=>{const r=this.getGui(),a=r.children.length===0?r:r.querySelector(".ag-cell-value");return a?a.scrollWidth>a.clientWidth:!0});const o={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:t!=null?()=>t:s,getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:i};this.tooltipFeature=new Yn(o,this.beans)}disableTooltipFeature(){this.tooltipFeature=this.beans.context.destroyBean(this.tooltipFeature)}setComp(t,i,s,n,o,r){var a,d,h,g;this.cellComp=t,this.eGui=i,this.printLayout=n,r??(r=this),this.addDomData(r),this.addFeatures(),r.addDestroyFunc(()=>this.removeFeatures()),this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(s,r),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),(a=this.cellPositionFeature)==null||a.setComp(i),(d=this.cellCustomStyleFeature)==null||d.setComp(t),(h=this.tooltipFeature)==null||h.refreshToolTip(),(g=this.cellKeyboardListenerFeature)==null||g.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(t,i),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(f=>f()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(t,i){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!t)return;const s=t.parentElement,n=Ps(this.beans.gos,this.rowNode).height,o=d=>{if(this.editing||!this.isAlive()||!i.isAlive())return;const{paddingTop:h,paddingBottom:g,borderBottomWidth:f,borderTopWidth:C}=dn(s),v=h+g+f+C,R=t.offsetHeight+v;if(d<5){const x=Xe(this.beans.gos),P=!x||!x.contains(t),T=R==0;if(P||T){window.setTimeout(()=>o(d+1),0);return}}const y=Math.max(R,n);this.rowNode.setRowAutoHeight(y,this.column)},r=()=>o(0);r();const a=this.beans.resizeObserverService.observeResize(t,r);i.addDestroyFunc(()=>{a(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}isCellRenderer(){const t=this.column.getColDef();return t.cellRenderer!=null||t.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}showValue(t=!1){var o,r;const i=this.getValueToDisplay();let s;if(this.rowNode.stub&&((o=this.rowNode.groupData)==null?void 0:o[this.column.getId()])==null){const a=this.createCellRendererParams();s=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),a)}else if(this.isCellRenderer()){const a=this.createCellRendererParams();s=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),a)}this.cellComp.setRenderDetails(s,i,t),(r=this.cellRangeFeature)==null||r.refreshHandle()}setupControlComps(){const t=this.column.getColDef();this.includeSelection=this.isIncludeControl(this.isCheckboxSelection(t)),this.includeRowDrag=this.isIncludeControl(t.rowDrag),this.includeDndSource=this.isIncludeControl(t.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(t){return this.rowNode.rowPinned!=null?!1:typeof t=="function"||t===!0}isCheckboxSelection(t){const{selection:i}=this.beans.gridOptions;return t.checkboxSelection||$n(this.column)&&i&&zn(i)}refreshShouldDestroy(){const t=this.column.getColDef(),i=this.includeSelection!=this.isIncludeControl(this.isCheckboxSelection(t)),s=this.includeRowDrag!=this.isIncludeControl(t.rowDrag),n=this.includeDndSource!=this.isIncludeControl(t.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return i||s||n||o}startEditing(t=null,i=!1,s=null){const{editService:n}=this.beans;return!this.isCellEditable()||this.editing||!n?!0:this.cellComp?n.startEditing(this,t,i,s):(this.onCellCompAttachedFuncs.push(()=>{this.startEditing(t,i,s)}),!0)}setEditing(t,i){var s;this.editCompDetails=i,this.editing!==t&&(this.editing=t,(s=this.cellRangeFeature)==null||s.refreshHandle())}stopRowOrCellEdit(t=!1){this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.stopEditing(t):this.stopEditing(t)}onPopupEditorClosed(){this.editing&&this.stopEditingAndFocus()}stopEditing(t=!1){this.onCellEditorAttachedFuncs=[];const{editService:i}=this.beans;return!this.editing||!i?!1:i.stopEditing(this,t)}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.beans.valueService.getValueForDisplay(this.column,this.rowNode),setValue:i=>this.beans.valueService.setValue(this.rowNode,this.column,i),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(i,s,n,o)=>this.registerRowDragger(i,s,o),setTooltip:(i,s)=>{var n;this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(i,s),(n=this.tooltipFeature)==null||n.refreshToolTip()}})}setFocusOutOnEditor(){var t;this.editing&&((t=this.beans.editService)==null||t.setFocusOutOnEditor(this))}setFocusInOnEditor(){var t;this.editing&&((t=this.beans.editService)==null||t.setFocusInOnEditor(this))}onCellChanged(t){t.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(t){var i;this.refreshShouldDestroy()?(i=this.rowCtrl)==null||i.recreateCell(this):this.refreshCell(t)}refreshCell(t){var g,f,C,v,S;if(this.suppressRefreshCell||this.editing)return;const i=this.column.getColDef(),s=t!=null&&!!t.newData,n=t!=null&&!!t.suppressFlash||!!i.suppressCellFlash,o=i.field==null&&i.valueGetter==null&&i.showRowGroup==null,r=t&&t.forceRefresh||o||s,a=!!this.cellComp,d=this.updateAndFormatValue(a),h=r||d;if(a){if(h){this.showValue(s);const R=(g=this.beans.filterManager)==null?void 0:g.isSuppressFlashingCellsBecauseFiltering();!n&&!R&&(this.beans.gos.get("enableCellChangeFlash")||i.enableCellChangeFlash)&&this.flashCell(),(f=this.cellCustomStyleFeature)==null||f.applyUserStyles(),(C=this.cellCustomStyleFeature)==null||C.applyClassesFromColDef()}(v=this.tooltipFeature)==null||v.refreshToolTip(),(S=this.cellCustomStyleFeature)==null||S.applyCellClassRules()}}stopEditingAndFocus(t=!1,i=!1){var s;(s=this.beans.editService)==null||s.stopEditingAndFocus(this,t,i)}flashCell(t){const i=(t==null?void 0:t.flashDuration)??(t==null?void 0:t.flashDelay),s=(t==null?void 0:t.fadeDuration)??(t==null?void 0:t.fadeDelay);this.animateCell("data-changed",i,s)}animateCell(t,i,s){if(!this.cellComp)return;const{gos:n}=this.beans;if(i||(i=n.get("cellFlashDuration")),i===0)return;j(s)||(s=n.get("cellFadeDuration"));const o=`ag-cell-${t}`,r=`ag-cell-${t}-animation`;this.cellComp.addOrRemoveCssClass(o,!0),this.cellComp.addOrRemoveCssClass(r,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.cellComp.addOrRemoveCssClass(r,!0),this.eGui.style.transition=`background-color ${s}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.eGui.style.transition="")},s))},i)})}onFlashCells(t){if(!this.cellComp)return;const i=this.beans.cellPositionUtils.createId(this.getCellPosition());t.cells[i]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(t){return this.callValueFormatter(t)??t}callValueFormatter(t){return this.beans.valueService.formatValue(this.column,this.rowNode,t)}updateAndFormatValue(t){const i=this.value,s=this.valueFormatted;return this.value=this.beans.valueService.getValueForDisplay(this.column,this.rowNode),this.valueFormatted=this.callValueFormatter(this.value),t?!this.valuesAreEqual(i,this.value)||this.valueFormatted!=s:!0}valuesAreEqual(t,i){const s=this.column.getColDef();return s.equals?s.equals(t,i):t===i}getComp(){return this.cellComp}getValue(){return this.value}addDomData(t){const i=this.getGui();rn(this.beans.gos,i,Xh.DOM_DATA_KEY_CELL_CTRL,this),t.addDestroyFunc(()=>rn(this.beans.gos,i,Xh.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(t,i){return this.beans.gos.addGridCommonParams({type:i,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:t,rowIndex:this.rowNode.rowIndex})}processCharacter(t){var i;(i=this.cellKeyboardListenerFeature)==null||i.processCharacter(t)}onKeyDown(t){var i;(i=this.cellKeyboardListenerFeature)==null||i.onKeyDown(t)}onMouseEvent(t,i){var s;(s=this.cellMouseListenerFeature)==null||s.onMouseEvent(t,i)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var t;this.cellComp&&((t=this.cellPositionFeature)==null||t.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:t,column:i,beans:s}=this;If(t,i,s.visibleColsService)}refreshAriaColIndex(){const t=this.beans.visibleColsService.getAriaColIndex(this.column);Gg(this.getGui(),t)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var t;return(t=this.cellPositionFeature)==null?void 0:t.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(t,i=null){return this.cellComp?this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.startRowEditing(t,this):this.startEditing(t,!0,i):(this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(t,i)}),!0)}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onCellSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onCellSelectionChanged()}isRangeSelectionEnabled(){return this.cellRangeFeature!=null}focusCell(t=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:t})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onCellSelectionChanged()}onSuppressCellFocusChanged(t){this.eGui&&ri(this.eGui,"tabindex",t?void 0:-1)}onFirstRightPinnedChanged(){if(!this.cellComp)return;const t=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass(uI,t)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const t=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(hI,t)}onCellFocused(t){if(this.beans.focusService.isCellFocusSuppressed())return;const i=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp){i&&(t!=null&&t.forceBrowserFocus)&&(this.focusEventToRestore=t);return}if(this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass(dI,i),i&&t&&t.forceBrowserFocus){let n=this.cellComp.getFocusableElement();if(this.editing){const o=this.beans.focusService.findFocusableElements(n,null,!0);o.length&&(n=o[0])}n.focus({preventScroll:!!t.preventScrollOnBrowserFocus})}const s=this.beans.gos.get("editType")==="fullRow";!i&&!s&&this.editing&&this.stopRowOrCellEdit(),i&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:yi(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(lI,!0),this.cellComp.addOrRemoveCssClass(pI,!0);const t=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(aI,t),this.cellComp.addOrRemoveCssClass(cI,!t)}onColumnHover(){if(!this.cellComp||!this.beans.gos.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass(gI,t)}onColDefChanged(){var i;if(!this.cellComp)return;this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing?(i=this.beans.editService)==null||i.handleColDefChanged(this):this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const t=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(fI,t)}dispatchCellContextMenuEvent(t){const i=this.column.getColDef(),s=this.createEvent(t,"cellContextMenu");this.beans.eventService.dispatchEvent(s),i.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{i.onCellContextMenu(s)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],this.onCellEditorAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const t=new Kk;return this.beans.context.createBean(t),t.init({rowNode:this.rowNode,column:this.column}),t}createDndSource(){const t=new jk(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(t),t}registerRowDragger(t,i,s){if(this.customRowDragComp){this.customRowDragComp.setDragElement(t,i);return}const n=this.createRowDragComp(t,i,s);n&&(this.customRowDragComp=n,this.addDestroyFunc(()=>{this.beans.context.destroyBean(n),this.customRowDragComp=null}))}createRowDragComp(t,i,s){const n=this.beans.gos.get("pagination"),o=this.beans.gos.get("rowDragManaged"),r=Ye(this.beans.gos);if(o){if(!r){W("managed row dragging is only allowed in the Client Side Row Model");return}if(n){W("managed row dragging is not possible when doing pagination");return}}const a=new zd(()=>this.value,this.rowNode,this.column,t,i,s);return this.beans.context.createBean(a),a}setSuppressRefreshCell(t){this.suppressRefreshCell=t}getEditCompDetails(){return this.editCompDetails}onCellEditorAttached(t){this.onCellEditorAttachedFuncs.push(t)}cellEditorAttached(){this.onCellEditorAttachedFuncs.forEach(t=>t()),this.onCellEditorAttachedFuncs=[]}};Kf.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var Ls=Kf,CI=0,jf=class Jh extends B{constructor(t,i,s,n,o){var r;super(),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.businessKeySanitised=null,this.beans=i,this.gos=i.gos,this.rowNode=t,this.paginationPage=((r=i.paginationService)==null?void 0:r.getCurrentPage())??0,this.useAnimationFrameForCreate=n,this.printLayout=o,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=t.id+"-"+CI++,this.rowId=Bi(t.id),this.initRowBusinessKey(),this.rowFocused=i.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=i.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const t=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=Bi(t)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}isSticky(){return this.rowNode.sticky}updateGui(t,i){t==="left"?this.leftGui=i:t==="right"?this.rightGui=i:t==="fullWidth"?this.fullWidthGui=i:this.centerGui=i}setComp(t,i,s,n){n=tr(this,this.beans.context,n);const o={rowComp:t,element:i,containerType:s,compBean:n};this.allRowGuis.push(o),this.updateGui(s,o),this.initialiseRowComp(o),this.rowType!=="FullWidthLoading"&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(t){this.allRowGuis=this.allRowGuis.filter(i=>i.containerType!==t),this.updateGui(t,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(t){const i=t?"none":"";this.allRowGuis.forEach(s=>s.element.style.display=i)}initialiseRowComp(t){const i=this.gos;this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")),this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),id(i)&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(o=>s.addOrRemoveCssClass(o,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&sr(t.element,this.rowNode.expanded==!0),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),rn(i,t.element,Jh.DOM_DATA_KEY_ROW_CTRL,this),t.compBean.addDestroyFunc(()=>rn(i,t.element,Jh.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(t){this.businessKeySanitised!=null&&t.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(t){this.rowId=Bi(this.rowNode.id),this.rowId!=null&&t.setRowId(this.rowId)}executeSlideAndFadeAnimations(t){const{containerType:i}=t;this.slideInAnimation[i]&&(dg(()=>{this.onTopChanged()}),this.slideInAnimation[i]=!1),this.fadeInAnimation[i]&&(dg(()=>{t.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[i]=!1)}addRowDraggerToRow(t){if(Ot(this.gos)){W("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `selection.mode = 'cell'`");return}const i=this.beans.localeService.getLocaleTextFunc(),s=new zd(()=>`1 ${i("rowDragRow","row")}`,this.rowNode,void 0,t.element,void 0,!0),n=this.createBean(s,this.beans.context);this.rowDragComps.push(n),t.compBean.addDestroyFunc(()=>{this.rowDragComps=this.rowDragComps.filter(o=>o!==n),this.destroyBean(n,this.beans.context)})}setupFullWidth(t){const i=this.getPinnedForContainer(t.containerType);if(this.rowType=="FullWidthDetail"&&!this.gos.assertModuleRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)"))return;const s=this.createFullWidthCompDetails(t.element,i);t.rowComp.showFullWidth(s)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var t,i;return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(s=>{var n;return(n=s==null?void 0:s.rowComp)==null?void 0:n.getFullWidthCellRenderer()}):[(i=(t=this.fullWidthGui)==null?void 0:t.rowComp)==null?void 0:i.getFullWidthCellRenderer()]}getCellElement(t){const i=this.getCellCtrl(t);return i?i.getGui():null}executeProcessRowPostCreateFunc(){const t=this.gos.getCallback("processRowPostCreate");if(!t||!this.areAllContainersReady())return;const i={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)};t(i)}areAllContainersReady(){const t=!!this.leftGui||!this.beans.visibleColsService.isPinningLeft(),i=!!this.centerGui,s=!!this.rightGui||!this.beans.visibleColsService.isPinningRight();return t&&i&&s}isNodeFullWidthCell(){if(this.rowNode.detail)return!0;const t=this.beans.gos.getCallback("isFullWidthRow");return t?t({rowNode:this.rowNode}):!1}setRowType(){const t=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow")&&!this.gos.get("groupHideOpenParents"),i=this.isNodeFullWidthCell(),s=this.gos.get("masterDetail")&&this.rowNode.detail,n=this.beans.columnModel.isPivotMode(),r=!!this.rowNode.group&&!this.rowNode.footer&&El(this.gos,n);t?this.rowType="FullWidthLoading":s?this.rowType="FullWidthDetail":i?this.rowType="FullWidth":r?this.rowType="FullWidthGroup":this.rowType="Normal"}updateColumnLists(t=!1,i=!1){if(this.isFullWidth())return;if(t||this.gos.get("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(i);return}this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(t,i,s=null){const n={list:[],map:{}},o=(r,a)=>{n.list.push(a),n.map[r]=a};return i.forEach(r=>{const a=r.getInstanceId();let d=t.map[a];d||(d=new Ls(r,this.rowNode,this.beans,this)),o(a,d)}),t.list.forEach(r=>{const a=r.getColumn().getInstanceId();if(n.map[a]!=null)return;if(!this.isCellEligibleToBeRemoved(r,s)){o(a,r);return}r.destroy()}),n}updateColumnListsImpl(t){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(t)}setCellCtrls(t){this.allRowGuis.forEach(i=>{const s=this.getCellCtrlsForContainer(i.containerType);i.rowComp.setCellCtrls(s,t)})}getCellCtrlsForContainer(t){switch(t){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const t=this.beans.columnViewportService,i=this.beans.visibleColsService;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i.getAllCols()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const s=t.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s);const n=i.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,n,"left");const o=i.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}}isCellEligibleToBeRemoved(t,i){if(t.getColumn().getPinned()!=i)return!0;const r=t.isEditing(),a=this.beans.focusService.isCellFocused(t.getCellPosition());if(r||a){const h=t.getColumn();return!(this.beans.visibleColsService.getAllCols().indexOf(h)>=0)}return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||ht(this.gos,"print")}listenOnDomOrder(t){const i=()=>{t.rowComp.setDomOrder(this.getDomOrder())};t.compBean.addManagedPropertyListeners(["domLayout","ensureDomOrder"],i)}setAnimateFlags(t){if(this.isSticky()||!t)return;const i=j(this.rowNode.oldRowTop),s=this.beans.visibleColsService.isPinningLeft(),n=this.beans.visibleColsService.isPinningRight();if(i){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.slideInAnimation.fullWidth=!0;return}this.slideInAnimation.center=!0,this.slideInAnimation.left=s,this.slideInAnimation.right=n}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.fadeInAnimation.fullWidth=!0;return}this.fadeInAnimation.center=!0,this.fadeInAnimation.left=s,this.fadeInAnimation.right=n}}isEditing(){return this.editingRow}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){const t=(a,d)=>a?a.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(a.element,d).params):!0,i=t(this.fullWidthGui,null),s=t(this.centerGui,null),n=t(this.leftGui,"left"),o=t(this.rightGui,"right");return i&&s&&n&&o}addListeners(){this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),expandedChanged:this.updateExpandedCss.bind(this),hasChildrenChanged:this.updateExpandedCss.bind(this)}),this.rowNode.detail&&this.addManagedListeners(this.rowNode.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(this.rowNode,{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)}),this.addManagedListeners(this.beans.eventService,{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()}),this.addDestroyFunc(()=>{this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{if(this.gos.get("rowDragEntireRow")){this.allRowGuis.forEach(i=>{this.addRowDraggerToRow(i)});return}this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{this.getAllCellCtrls().forEach(t=>t.onRowIndexChanged())},cellChanged:t=>{this.getAllCellCtrls().forEach(i=>i.onCellChanged(t))}})}onRowNodeDataChanged(t){if(this.isFullWidth()!==!!this.isNodeFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);return}this.getAllCellCtrls().forEach(s=>s.refreshCell({suppressFlash:!t.update,newData:!t.update})),this.allRowGuis.forEach(s=>{this.setRowCompRowId(s.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(s.rowComp)}),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const t=this.rowNode.highlighted;this.allRowGuis.forEach(i=>{const s=t===0,n=t===1;i.rowComp.addOrRemoveCssClass("ag-row-highlight-above",s),i.rowComp.addOrRemoveCssClass("ag-row-highlight-below",n)})}postProcessRowDragging(){const t=this.rowNode.dragging;this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-dragging",t))}updateExpandedCss(){const t=this.rowNode.isExpandable(),i=this.rowNode.expanded==!0;this.allRowGuis.forEach(s=>{s.rowComp.addOrRemoveCssClass("ag-row-group",t),s.rowComp.addOrRemoveCssClass("ag-row-group-expanded",t&&i),s.rowComp.addOrRemoveCssClass("ag-row-group-contracted",t&&!i),sr(s.element,t&&i)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:yi(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}findFullWidthRowGui(t){return this.allRowGuis.find(i=>i.element.contains(t))}onKeyboardNavigate(t){const i=this.findFullWidthRowGui(t.target);if(!((i?i.element:null)===t.target))return;const o=this.rowNode,r=this.beans.focusService.getFocusedCell(),a={rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:(r==null?void 0:r.column)??this.getColumnForFullWidth(i)};this.beans.navigationService.navigateToNextCell(t,t.key,a,!0),t.preventDefault()}onTabKeyDown(t){if(t.defaultPrevented||Xi(t))return;const i=this.allRowGuis.find(d=>d.element.contains(t.target)),s=i?i.element:null,n=s===t.target,o=Ke(this.gos);let r=!1;s&&o&&(r=s.contains(o)&&o.classList.contains("ag-cell"));let a=null;!n&&!r&&(a=this.beans.focusService.findNextFocusableElement(s,!1,t.shiftKey)),(this.isFullWidth()&&n||!a)&&this.beans.navigationService.onTabKeyDown(this,t)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){var i;const t=(i=this.allRowGuis.find(s=>jt(s.element)))==null?void 0:i.element;return t?t.getBoundingClientRect().top:0}onSuppressCellFocusChanged(t){const i=this.isFullWidth()&&t?void 0:-1;this.allRowGuis.forEach(s=>{ri(s.element,"tabindex",i)})}onFullWidthRowFocused(t){var o;const i=this.rowNode,s=t?this.isFullWidth()&&t.rowIndex===i.rowIndex&&t.rowPinned==i.rowPinned:!1,n=this.fullWidthGui?this.fullWidthGui.element:(o=this.centerGui)==null?void 0:o.element;n&&(n.classList.toggle("ag-full-width-focus",s),s&&(t!=null&&t.forceBrowserFocus)&&n.focus({preventScroll:!0}))}recreateCell(t){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,t),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,t),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,t),t.destroy(),this.updateColumnLists()}removeCellCtrl(t,i){const s={list:[],map:{}};return t.list.forEach(n=>{n!==i&&(s.list.push(n),s.map[n.getColumn().getInstanceId()]=n)}),s}onMouseEvent(t,i){switch(t){case"dblclick":this.onRowDblClick(i);break;case"click":this.onRowClick(i);break;case"touchstart":case"mousedown":this.onRowMouseDown(i);break}}createRowEvent(t,i){return this.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:i})}createRowEventWithSource(t,i){const s=this.createRowEvent(t,i);return s.source=this,s}onRowDblClick(t){Xi(t)||this.beans.eventService.dispatchEvent(this.createRowEventWithSource("rowDoubleClicked",t))}getColumnForFullWidth(t){const{visibleColsService:i}=this.beans;switch(t==null?void 0:t.containerType){case"center":return i.getCenterCols()[0];case"left":return i.getLeftCols()[0];case"right":return i.getRightCols()[0];default:return i.getAllCols()[0]}}onRowMouseDown(t){if(this.lastMouseDownOnDragger=jn(t.target,"ag-row-drag",3),!this.isFullWidth())return;const i=this.rowNode;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges();const s=this.findFullWidthRowGui(t.target),n=s==null?void 0:s.element,o=t.target;let r=!0;n&&n.contains(o)&&Od(o)&&(r=!1),this.beans.focusService.setFocusedCell({rowIndex:i.rowIndex,column:this.getColumnForFullWidth(s),rowPinned:i.rowPinned,forceBrowserFocus:r})}onRowClick(t){if(Xi(t)||this.lastMouseDownOnDragger)return;const{gos:s}=this;this.beans.eventService.dispatchEvent(this.createRowEventWithSource("rowClicked",t));const n=t.ctrlKey||t.metaKey,o=t.shiftKey,r=this.rowNode.isSelected();if(ln(s)&&this.rowNode.group||this.isRowSelectionBlocked()||!QD(s)&&!r||!ld(s)&&r)return;const d=XD(s),h=ld(s),g="rowClicked";if(r)d?this.rowNode.setSelectedParams({newValue:!1,event:t,source:g}):n?h&&this.rowNode.setSelectedParams({newValue:!1,event:t,source:g}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!o,rangeSelect:o,event:t,source:g});else{const f=d?!1:!n;this.rowNode.setSelectedParams({newValue:!0,clearSelection:f,rangeSelect:o,event:t,source:g})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!id(this.gos)}setupDetailRowAutoHeight(t){if(this.rowType!=="FullWidthDetail"||!this.gos.get("detailRowAutoHeight"))return;const i=()=>{const n=t.clientHeight;if(n!=null&&n>0){const o=()=>{this.rowNode.setRowHeight(n),(Ye(this.gos)||Yi(this.gos))&&this.beans.rowModel.onRowHeightChanged()};window.setTimeout(o,0)}},s=this.beans.resizeObserverService.observeResize(t,i);this.addDestroyFunc(s),i()}createFullWidthCompDetails(t,i){const{gos:s,rowNode:n}=this,o=s.addGridCommonParams({fullWidth:!0,data:n.data,node:n,value:n.key,valueFormatted:n.key,eGridCell:t,eParentOfValue:t,pinned:i,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(a,d,h,g)=>this.addFullWidthRowDragging(a,d,h,g),setTooltip:(a,d)=>this.refreshRowTooltip(a,d)}),r=this.beans.userComponentFactory;switch(this.rowType){case"FullWidthDetail":return r.getFullWidthDetailCellRendererDetails(o);case"FullWidthGroup":return r.getFullWidthGroupCellRendererDetails(o);case"FullWidthLoading":return r.getFullWidthLoadingCellRendererDetails(o);default:return r.getFullWidthCellRendererDetails(o)}}refreshRowTooltip(t,i){if(!this.fullWidthGui)return;const s={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>t,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new Yn(s,this.beans))}addFullWidthRowDragging(t,i,s="",n){if(!this.isFullWidth())return;const o=new zd(()=>s,this.rowNode,void 0,t,i,n);this.createBean(o,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(o,this.beans.context)})}onUiLevelChanged(){const t=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=t){const i="ag-row-level-"+t,s="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(n=>{n.rowComp.addOrRemoveCssClass(i,!0),n.rowComp.addOrRemoveCssClass(s,!1)})}this.rowLevel=t}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getLastRow()}refreshFirstAndLastRowStyles(){const t=this.isFirstRowOnPage(),i=this.isLastRowOnPage();this.firstRowOnPage!==t&&(this.firstRowOnPage=t,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-first",t))),this.lastRowOnPage!==i&&(this.lastRowOnPage=i,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-last",i)))}stopEditing(t=!1){var i;this.stoppingRowEdit||(i=this.beans.rowEditService)==null||i.stopEditing(this,t)}setInlineEditingCss(){const t=this.editingRow||this.getAllCellCtrls().some(i=>i.isEditing());this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-inline-editing",t),i.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!t)})}setEditingRow(t){this.editingRow=t}startRowEditing(t=null,i=null,s=null){var n;return this.editingRow?!0:((n=this.beans.rowEditService)==null?void 0:n.startEditing(this,t,i,s))??!0}getAllCellCtrls(){return this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const t=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!t||!t.length||t.forEach(i=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(i,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!0))},t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!1))})}setStylesFromGridOptions(t,i){t&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(i,s=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(t){return t==="left"||t==="right"?t:null}getInitialRowClasses(t){const i=this.getPinnedForContainer(t),s={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[t],rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:i};return this.beans.rowCssClassCalculator.getInitialRowClasses(s)}processStylesFromGridOptions(){const t=this.gos.get("rowStyle");if(t&&typeof t=="function"){W("rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}const i=this.gos.getCallback("getRowStyle");let s;if(i){const n={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};s=i(n)}return s||t?Object.assign({},t,s):this.emptyStyle}onRowSelected(t){const i=!!this.rowNode.isSelected();this.forEachGui(t,s=>{s.rowComp.addOrRemoveCssClass("ag-row-selected",i),Il(s.element,i),s.element.contains(Ke(this.gos))&&(s===this.centerGui||s===this.fullWidthGui)&&this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const t=this.rowNode.isSelected();if(t&&!ld(this.gos))return;const s=this.beans.localeService.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(s,"rowSelection")}addHoverFunctionality(t){if(!this.active)return;const{element:i,compBean:s}=t,{rowNode:n,beans:o,gos:r}=this;s.addManagedListeners(i,{mouseenter:()=>n.onMouseEnter(),mouseleave:()=>n.onMouseLeave()}),s.addManagedListeners(n,{mouseEnter:()=>{!o.dragService.isDragging()&&!r.get("suppressRowHoverHighlight")&&(i.classList.add("ag-row-hover"),n.setHovered(!0))},mouseLeave:()=>{i.classList.remove("ag-row-hover"),n.setHovered(!1)}})}roundRowTopToBounds(t){const i=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(i.top,!0)-100,n=this.applyPaginationOffset(i.bottom,!0)+100;return Math.min(Math.max(s,t),n)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(t,i){t?i(t):this.allRowGuis.forEach(i)}onRowHeightChanged(t){if(this.rowNode.rowHeight==null)return;const i=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),o=pg(this.gos)?Ps(this.gos,this.rowNode).height:void 0,r=o?`${Math.min(s,o)-2}px`:void 0;this.forEachGui(t,a=>{a.element.style.height=`${i}px`,r&&a.element.style.setProperty("--ag-line-height",r)})}addEventListener(t,i){super.addEventListener(t,i)}removeEventListener(t,i){super.removeEventListener(t,i)}destroyFirstPass(t=!1){if(this.active=!1,!t&&Hn(this.gos)&&!this.isSticky())if(this.rowNode.rowTop!=null){const n=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(n)}else this.allRowGuis.forEach(n=>n.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const i=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(i),this.beans.eventService.dispatchEvent(i),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const t=i=>(i.list.forEach(s=>s.destroy()),{list:[],map:{}});this.centerCellCtrls=t(this.centerCellCtrls),this.leftCellCtrls=t(this.leftCellCtrls),this.rightCellCtrls=t(this.rightCellCtrls)}setFocusedClasses(t){this.forEachGui(t,i=>{i.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),i.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const t=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.rowFocused=t,this.setFocusedClasses()),!t&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){var i;const t=((i=this.beans.paginationService)==null?void 0:i.getCurrentPage())??0;this.paginationPage!==t&&(this.paginationPage=t,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(t,i=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return t;const s=this.beans.pageBoundsService.getPixelOffset();return t+s*(i?1:-1)}setRowTop(t){if(!this.printLayout&&j(t)){const i=this.applyPaginationOffset(t),o=`${this.rowNode.isRowPinned()||this.rowNode.sticky?i:this.beans.rowContainerHeightService.getRealPixelPosition(i)}px`;this.setRowTopStyle(o)}}getInitialRowTop(t){return this.suppressRowTransform?this.getInitialRowTopShared(t):void 0}getInitialTransform(t){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(t)})`}getInitialRowTopShared(t){if(this.printLayout)return"";const i=this.rowNode;let s;if(this.isSticky())s=i.stickyRowTop;else{const n=this.slideInAnimation[t]?this.roundRowTopToBounds(i.oldRowTop):i.rowTop,o=this.applyPaginationOffset(n);s=i.isRowPinned()?o:this.beans.rowContainerHeightService.getRealPixelPosition(o)}return s+"px"}setRowTopStyle(t){this.allRowGuis.forEach(i=>this.suppressRowTransform?i.rowComp.setTop(t):i.rowComp.setTransform(`translateY(${t})`))}getRowNode(){return this.rowNode}getCellCtrl(t){let i=null;return this.getAllCellCtrls().forEach(s=>{s.getColumn()==t&&(i=s)}),i!=null||this.getAllCellCtrls().forEach(s=>{s.getColSpanningList().indexOf(t)>=0&&(i=s)}),i}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(t){var r;const i=this.rowNode.getRowIndexString();if(i===null)return;const s=this.beans.headerNavigationService.getHeaderRowCount()+(((r=this.beans.filterManager)==null?void 0:r.getHeaderRowCount())??0),n=this.rowNode.rowIndex%2===0,o=s+this.rowNode.rowIndex+1;this.forEachGui(t,a=>{a.rowComp.setRowIndex(i),a.rowComp.addOrRemoveCssClass("ag-row-even",n),a.rowComp.addOrRemoveCssClass("ag-row-odd",!n),Bg(a.element,o)})}setStoppingRowEdit(t){this.stoppingRowEdit=t}};jf.DOM_DATA_KEY_ROW_CTRL="renderedRow";var gn=jf,vI=class extends B{wireBeans(e){this.mouseEventService=e.mouseEventService,this.valueService=e.valueService,this.menuService=e.menuService,this.ctrlsService=e.ctrlsService,this.navigationService=e.navigationService,this.focusService=e.focusService,this.undoRedoService=e.undoRedoService,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService,this.clipboardService=e.clipboardService}constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",xg("touchstart")?"touchstart":"mousedown"].forEach(i=>{const s=this.processMouseEvent.bind(this,i);this.addManagedElementListeners(this.element,{[i]:s})})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||Xi(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);e==="contextmenu"?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!Ms())return;const e=new ks(this.element),t=i=>{const s=this.getRowForEvent(i.touchEvent),n=this.mouseEventService.getRenderedCellForEvent(i.touchEvent);this.handleContextMenuMouseEvent(void 0,i.touchEvent,s,n)};this.addManagedListeners(e,{longTap:t}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const i=qo(this.gos,t,gn.DOM_DATA_KEY_ROW_CTRL);if(i)return i;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const n=i?i.getRowNode():null,o=s?s.getColumn():null;let r=null;if(o){const h=e||t;s.dispatchCellContextMenuEvent(h??null),r=this.valueService.getValue(o,n)}const a=this.ctrlsService.getGridBodyCtrl(),d=s?s.getGui():a.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:n,column:o,value:r,anchorToElement:d})}getControlsForEventTarget(e){return{cellCtrl:Tl(this.gos,e,Ls.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Tl(this.gos,e,gn.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),n=e.getColumn(),o=e.isEditing();!Kd(this.gos,i,s,n,o)&&t==="keydown"&&(!o&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Sf(i)&&e.processCharacter(i)),t==="keydown"&&this.eventService.dispatchEvent(e.createEvent(i,"cellKeyDown"))}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),n=this.focusService.getFocusedCell(),o=n&&n.column;if(!Kd(this.gos,i,s,o,!1)){const a=i.key;if(t==="keydown")switch(a){case N.PAGE_HOME:case N.PAGE_END:case N.PAGE_UP:case N.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case N.UP:case N.DOWN:e.onKeyboardNavigate(i);break;case N.TAB:e.onTabKeyDown(i);break}}t==="keydown"&&this.eventService.dispatchEvent(e.createRowEvent("cellKeyDown",i))}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!this.mouseEventService.isEventFromThisGrid(e))return;const i=vM(e);if(i===N.A)return this.onCtrlAndA(e);if(i===N.C)return this.onCtrlAndC(e);if(i===N.D)return this.onCtrlAndD(e);if(i===N.V)return this.onCtrlAndV(e);if(i===N.X)return this.onCtrlAndX(e);if(i===N.Y)return this.onCtrlAndY();if(i===N.Z)return this.onCtrlAndZ(e)}onCtrlAndA(e){const{pinnedRowModel:t,rowModel:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[n,o]=[t.isEmpty("top"),t.isEmpty("bottom")],r=n?null:"top";let a,d;o?(a=null,d=i.getRowCount()-1):(a="bottom",d=t.getPinnedBottomRowCount()-1);const h=this.visibleColsService.getAllCols();if(gt(h))return;s.setCellRange({rowStartIndex:0,rowStartPinned:r,rowEndIndex:d,rowEndPinned:a,columnStart:h[0],columnEnd:ce(h)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){!this.gos.get("undoRedoCellEditing")||!this.undoRedoService||(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){var e;(e=this.undoRedoService)==null||e.redo("ui")}},wI=class extends B{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({leftPinnedWidthChanged:this.onPinnedLeftWidthChanged.bind(this)})}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;je(this.element,t),Fi(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}},SI=class extends B{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({rightPinnedWidthChanged:this.onPinnedRightWidthChanged.bind(this)})}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;je(this.element,t),Fi(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}},Yl=e=>e.getTopRowCtrls(),Ql=e=>e.getStickyTopRowCtrls(),Xl=e=>e.getStickyBottomRowCtrls(),Jl=e=>e.getBottomRowCtrls(),ea=e=>e.getCentreRowCtrls(),yI={center:{type:"center",container:"ag-center-cols-container",viewport:"ag-center-cols-viewport",getRowCtrls:ea},left:{type:"left",container:"ag-pinned-left-cols-container",pinnedType:"left",getRowCtrls:ea},right:{type:"right",container:"ag-pinned-right-cols-container",pinnedType:"right",getRowCtrls:ea},fullWidth:{type:"fullWidth",container:"ag-full-width-container",fullWidth:!0,getRowCtrls:ea},topCenter:{type:"center",container:"ag-floating-top-container",viewport:"ag-floating-top-viewport",getRowCtrls:Yl},topLeft:{type:"left",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Yl},topRight:{type:"right",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Yl},topFullWidth:{type:"fullWidth",container:"ag-floating-top-full-width-container",fullWidth:!0,getRowCtrls:Yl},stickyTopCenter:{type:"center",container:"ag-sticky-top-container",viewport:"ag-sticky-top-viewport",getRowCtrls:Ql},stickyTopLeft:{type:"left",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Ql},stickyTopRight:{type:"right",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Ql},stickyTopFullWidth:{type:"fullWidth",container:"ag-sticky-top-full-width-container",fullWidth:!0,getRowCtrls:Ql},stickyBottomCenter:{type:"center",container:"ag-sticky-bottom-container",viewport:"ag-sticky-bottom-viewport",getRowCtrls:Xl},stickyBottomLeft:{type:"left",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Xl},stickyBottomRight:{type:"right",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Xl},stickyBottomFullWidth:{type:"fullWidth",container:"ag-sticky-bottom-full-width-container",fullWidth:!0,getRowCtrls:Xl},bottomCenter:{type:"center",container:"ag-floating-bottom-container",viewport:"ag-floating-bottom-viewport",getRowCtrls:Jl},bottomLeft:{type:"left",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Jl},bottomRight:{type:"right",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Jl},bottomFullWidth:{type:"fullWidth",container:"ag-floating-bottom-full-width-container",fullWidth:!0,getRowCtrls:Jl}};function Jn(e){return yI[e]}var bI=["topCenter","topLeft","topRight"],RI=["bottomCenter","bottomLeft","bottomRight"],FI=["center","left","right"],xI=["center","left","right","fullWidth"],EI=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],PI=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],DI=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Zf=["stickyTopCenter","stickyTopLeft","stickyTopRight"],qf=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],TI=[...Zf,"stickyTopFullWidth",...qf,"stickyBottomFullWidth"],AI=[...bI,...RI,...FI,...Zf,...qf],MI=class extends B{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.options=Jn(e)}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService,this.columnViewportService=e.columnViewportService,this.resizeObserverService=e.resizeObserverService,this.rowRenderer=e.rowRenderer}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new Uk(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.ctrlsService.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new vI(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder();const s=()=>this.onPinnedWidthChanged();this.forContainers(PI,()=>{this.pinnedWidthFeature=this.createManagedBean(new wI(this.eContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:s})}),this.forContainers(DI,()=>{this.pinnedWidthFeature=this.createManagedBean(new SI(this.eContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:s})}),this.forContainers(xI,()=>this.createManagedBean(new $f(this.eContainer,this.name==="center"?i:void 0))),this.forContainers(AI,()=>this.createManagedBean(new $k(this.eContainer))),this.forContainers(EI,()=>this.createManagedBean(new iu(n=>this.comp.setContainerWidth(`${n}px`)))),this.visible=this.isContainerVisible(),this.addListeners(),this.registerWithCtrlsService()}onScrollCallback(e){this.addManagedElementListeners(this.getViewportElement(),{scroll:e})}addListeners(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(TI.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const i=this.gos.get("ensureDomOrder"),s=ht(this.gos,"print");this.comp.setDomOrder(i||s)};this.addManagedPropertyListener("domLayout",t),t()}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=t=>{this.dragService.isDragging()&&t.cancelable&&t.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnViewportService.setScrollPosition(t,i,e)}hasHorizontalScrollGap(){return this.eContainer.clientWidth-this.eViewport.clientWidth<0}hasVerticalScrollGap(){return this.eContainer.clientHeight-this.eViewport.clientHeight<0}getCenterWidth(){return Zn(this.eViewport)}getCenterViewportScrollLeft(){return Bl(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return Zg(this.eViewport)}getViewportScrollLeft(){return Bl(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||iA(this.eViewport)}getViewportElement(){return this.eViewport}setHorizontalScroll(e){this.comp.setHorizontalScroll(e)}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){Gl(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const i=ht(this.gos,"print"),n=this.gos.get("embedFullWidthRows")||i,o=t.filter(r=>{const a=r.isFullWidth();return this.options.fullWidth?!n&&a:n||!a});this.comp.setRowCtrls({rowCtrls:o,useFlushSync:e})}},Yf="ag-force-vertical-scroll",kI="ag-selectable",II="ag-column-moving",LI=class extends B{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.menuService=e.menuService,this.headerNavigationService=e.headerNavigationService,this.dragAndDropService=e.dragAndDropService,this.pinnedRowModel=e.pinnedRowModel,this.rowRenderer=e.rowRenderer,this.popupService=e.popupService,this.mouseEventService=e.mouseEventService,this.rowModel=e.rowModel,this.filterManager=e.filterManager,this.environment=e.environment}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,n,o,r){var a;this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=n,this.eStickyTop=o,this.eStickyBottom=r,this.eCenterColsViewport=i.querySelector(`.${Jn("center").viewport}`),this.eFullWidthContainer=i.querySelector(`.${Jn("fullWidth").container}`),this.eStickyTopFullWidthContainer=o.querySelector(`.${Jn("stickyTopFullWidth").container}`),this.eStickyBottomFullWidthContainer=r.querySelector(`.${Jn("stickyBottomFullWidth").container}`),this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",d=>this.setCellTextSelection(d.currentValue)),this.createManagedBean(new lu(this.comp)),this.bodyScrollFeature=this.createManagedBean(new zk(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,n,o,r]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.updateScrollingClasses(),(a=this.filterManager)==null||a.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){const e=this.setFloatingHeights.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),scrollGapChanged:this.onScrollGapChanged.bind(this),pinnedRowDataChanged:e,pinnedHeightChanged:e,headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}addFocusListeners(e){e.forEach(t=>{this.addManagedElementListeners(t,{focusin:i=>{const{target:s}=i,n=jn(s,"ag-root",t);t.classList.toggle("ag-has-focus",!n)},focusout:i=>{const{target:s,relatedTarget:n}=i,o=t.contains(n),r=jn(n,"ag-root",t);jn(s,"ag-root",t)||(!o||r)&&t.classList.remove("ag-has-focus")}})})}setColumnMovingCss(e){this.comp.setColumnMovingCss(II,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(kI,e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=e&&this.scrollVisibleService.getScrollbarWidth()||0,i=Ug()?16:0,s=`calc(100% + ${t+i}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(s)),this.updateScrollingClasses()}onScrollGapChanged(){this.updateScrollingClasses()}updateScrollingClasses(){this.eGridBody.classList.toggle("ag-body-vertical-content-no-gap",!this.scrollVisibleService.hasVerticalScrollGap()),this.eGridBody.classList.toggle("ag-body-horizontal-content-no-gap",!this.scrollVisibleService.hasHorizontalScrollGap())}onGridColumnsChanged(){const e=this.columnModel.getCols();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=i=>{const s=i.relatedTarget;if(_d(s)===null){this.rowRenderer.stopEditing();return}let n=t.some(o=>o.contains(s))&&this.mouseEventService.isElementInThisGrid(s);if(!n){const o=this.popupService;n=o.getActivePopups().some(r=>r.contains(s))||o.isElementWithinCustomPopup(s)}n||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach(i=>this.addManagedElementListeners(i,{focusout:e}))}updateRowCount(){var s;const e=this.headerNavigationService.getHeaderRowCount()+(((s=this.filterManager)==null?void 0:s.getHeaderRowCount())??0),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=t===-1?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?Yf:null,i=ht(this.gos,"normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&sA(this.eBodyViewport)}setupRowAnimationCssClass(){let e=this.environment.hasMeasuredSizes();const t=()=>{const i=e&&Hn(this.gos)&&!this.rowContainerHeightService.isStretching(),s=i?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(s,i)};t(),this.addManagedEventListeners({heightScaleChanged:t}),this.addManagedPropertyListener("animateRows",t),this.addManagedEventListeners({gridStylesChanged:()=>{!e&&this.environment.hasMeasuredSizes()&&(e=!0,t())}})}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(this.eBodyViewport,{contextmenu:e}),this.mockContextMenuForIPad(e),this.addManagedElementListeners(this.eBodyViewport,{wheel:this.onBodyViewportWheel.bind(this)}),this.addManagedElementListeners(this.eStickyTop,{wheel:this.onStickyWheel.bind(this)}),this.addManagedElementListeners(this.eStickyBottom,{wheel:this.onStickyWheel.bind(this)}),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){this.addManagedElementListeners(this.eFullWidthContainer,{wheel:e=>this.onFullWidthContainerWheel(e)})}onFullWidthContainerWheel(e){const{deltaX:t,deltaY:i,shiftKey:s}=e;(s||Math.abs(t)>Math.abs(i))&&this.mouseEventService.isEventFromThisGrid(e)&&this.scrollGridBodyToMatchEvent(e)}onStickyWheel(e){const{deltaX:t,deltaY:i,shiftKey:s}=e,n=s||Math.abs(t)>Math.abs(i),o=e.target;n?(this.eStickyTopFullWidthContainer.contains(o)||this.eStickyBottomFullWidthContainer.contains(o))&&this.scrollGridBodyToMatchEvent(e):(e.preventDefault(),this.scrollVertically(i))}scrollGridBodyToMatchEvent(e){const{deltaX:t,deltaY:i}=e;e.preventDefault(),this.eCenterColsViewport.scrollBy({left:t||i})}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;(s===this.eBodyViewport||s===this.ctrlsService.get("center").getViewportElement())&&this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!Ms())return;const t=new ks(this.eBodyViewport),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new XA(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature),this.addDestroyFunc(()=>this.dragAndDropService.removeDropTarget(this.rowDragFeature))}getRowDragFeature(){return this.rowDragFeature}setFloatingHeights(){const{pinnedRowModel:e}=this,t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.scrollVisibleService.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){var n;const t=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+(((n=this.filterManager)==null?void 0:n.getHeaderHeight())??0),i=this.pinnedRowModel.getPinnedTopTotalHeight();let s=0;t>0&&(s+=t),i>0&&(s+=i),s>0&&(s+=1),this.comp.setStickyTopTop(`${s}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight(),i=this.scrollVisibleService.isHorizontalScrollShowing()&&this.scrollVisibleService.getScrollbarWidth()||0,s=e+i;this.comp.setStickyBottomBottom(`${s}px`)}sizeColumnsToFit(e,t){const s=this.isVerticalScrollShowing()?this.scrollVisibleService.getScrollbarWidth():0,o=Zn(this.eGridBody)-s;if(o>0){this.columnSizeService.sizeColumnsToFit(o,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):W("tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}},_I=class extends Pe{constructor(e,t,i,s,n){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const o=document.createElement("div");o.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(o);const r=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1),Vt(r,t.getCellAriaRole()),r.setAttribute("col-id",t.colIdSanitised);const a={addOrRemoveCssClass:(d,h)=>this.addOrRemoveCssClass(d,h),setUserStyles:d=>Qg(r,d),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:d=>this.includeSelection=d,setIncludeRowDrag:d=>this.includeRowDrag=d,setIncludeDndSource:d=>this.includeDndSource=d,setRenderDetails:(d,h,g)=>this.setRenderDetails(d,h,g),setEditDetails:(d,h,g)=>this.setEditDetails(d,h,g),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(a,this.getGui(),this.eCellWrapper,i,n,void 0)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const n=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(i||n)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&this.eCellWrapper==null;if(s){const h=document.createElement("div");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=h,this.getGui().appendChild(this.eCellWrapper)}const n=!i&&this.eCellWrapper!=null;n&&(Hi(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const o=!e&&i,r=o&&this.eCellValue==null;if(r){const h=document.createElement("span");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-value"),this.eCellValue=h,this.eCellWrapper.appendChild(this.eCellValue)}const a=!o&&this.eCellValue!=null;a&&(Hi(this.eCellValue),this.eCellValue=void 0);const d=s||n||r||a;return d&&this.removeControls(),e||t&&this.addControls(),d}addControls(){this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,n=e.newAgStackInstance();if(n==null)return;const{params:o}=e;n.then(a=>this.afterCellEditorCreated(s,a,o,t,i)),ke(this.cellEditor)&&o.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();yt(t);const i=e!=null?Bi(e,!0):null;i!=null&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Hi(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Hi(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const i=!this.beans.gos.get("suppressAnimationFrame"),s=this.rendererVersion,{componentClass:n}=e,o=()=>{if(this.rendererVersion!==s||!this.isAlive())return;const a=e.newAgStackInstance(),d=this.afterCellRendererCreated.bind(this,s,n);a&&a.then(d)};i&&this.firstRender?this.beans.animationFrameService.createTask(o,this.rowNode.rowIndex,"createTasksP2"):o()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(i);return}if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){const n=this.getParentOfValue();yt(n),n.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,i,s,n){if(e!==this.editorVersion){this.beans.context.destroyBean(t);return}if(t.isCancelBeforeStart&&t.isCancelBeforeStart()){this.beans.context.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){W(`cellEditor for column ${this.column.getId()} is missing getGui() method`),this.beans.context.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const a=s||t.isPopup!==void 0&&t.isPopup();a?this.addPopupCellEditor(i,n):this.addInCellEditor(),this.refreshEditStyles(!0,a),t.afterGuiAttached&&t.afterGuiAttached(),this.cellCtrl.cellEditorAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),(i=this.rowCtrl)==null||i.setInlineEditingCss()}addInCellEditor(){const e=this.getGui();e.contains(Ke(this.beans.gos))&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){var C;this.beans.gos.get("editType")==="fullRow"&&W("popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(this.beans.editService.createPopupEditorWrapper(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const n=this.beans.popupService,o=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),r=t??((C=i.getPopupPosition)==null?void 0:C.call(i))??"over",a=this.beans.gos.get("enableRtl"),d={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:r,alignSide:a?"right":"left",keepWithinBounds:!0},h=n.positionPopupByComponent.bind(n,d),g=this.beans.localeService.getLocaleTextFunc(),f=n.addPopup({modal:o,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:h,ariaLabel:g("ariaLabelCellEditor","Cell Editor")});f&&(this.hideEditorPopup=f.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(Ke(this.beans.gos))&&Ld()&&e.focus({preventScroll:!0}),yt(this.getParentOfValue())}},OI=class extends Pe{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const n=this.getGui(),o=n.style;this.domOrder=this.rowCtrl.getDomOrder(),Vt(n,"row");const r={setDomOrder:a=>this.domOrder=a,setCellCtrls:a=>this.setCellCtrls(a),showFullWidth:a=>this.showFullWidth(a),getFullWidthCellRenderer:()=>this.fullWidthCellRenderer,addOrRemoveCssClass:(a,d)=>this.addOrRemoveCssClass(a,d),setUserStyles:a=>Qg(n,a),setTop:a=>o.top=a,setTransform:a=>o.transform=a,setRowIndex:a=>n.setAttribute("row-index",a),setRowId:a=>n.setAttribute("row-id",a),setRowBusinessKey:a=>n.setAttribute("row-business-key",a),refreshFullWidth:a=>{var d,h;return((h=(d=this.fullWidthCellRenderer)==null?void 0:d.refresh)==null?void 0:h.call(d,a()))??!1}};e.setComp(r,this.getGui(),i,void 0),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=s=>{if(this.isAlive()){const n=s.getGui();this.getGui().appendChild(n),this.rowCtrl.setupDetailRowAutoHeight(n),this.setFullWidthRowComp(s)}else this.beans.context.destroyBean(s)},i=e.newAgStackInstance();i!=null&&i.then(t)}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(s=>{const n=s.instanceId;this.cellComps[n]==null?this.newCellComp(s):t[n]=null});const i=Ts(t).filter(s=>s!=null);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(i=>{const s=this.cellComps[i.instanceId];s&&t.push(s.getGui())}),Yg(this.getGui(),t)}newCellComp(e){const t=new _I(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.instanceId]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=Ts(this.cellComps).filter(t=>t!=null);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&Ve("should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}destroyCells(e){e.forEach(t=>{if(!t)return;const i=t.getCtrl().instanceId;this.cellComps[i]===t&&(t.detach(),t.destroy(),this.cellComps[i]=null)})}};function VI(e){let t;return e.type==="center"?t=`<div class="${e.viewport}" data-ref="eViewport" role="presentation">
140
+ <div class="${e.container}" data-ref="eContainer"></div>
141
+ </div>`:t=`<div class="${e.container}" data-ref="eContainer"></div>`,t}var NI=class extends Pe{constructor(){super(),this.eViewport=J,this.eContainer=J,this.rowComps={},this.name=Pe.elementGettingCreated.getAttribute("name"),this.options=Jn(this.name),this.setTemplate(VI(this.options))}wireBeans(e){this.beans=e}postConstruct(){const e={setHorizontalScroll:i=>this.eViewport.scrollLeft=i,setViewportHeight:i=>this.eViewport.style.height=i,setRowCtrls:({rowCtrls:i})=>this.setRowCtrls(i),setDomOrder:i=>{this.domOrder=i},setContainerWidth:i=>this.eContainer.style.width=i,setOffsetTop:i=>this.eContainer.style.transform=`translateY(${i})`};this.createManagedBean(new MI(this.name)).setComp(e,this.eContainer,this.eViewport)}destroy(){this.setRowCtrls([]),super.destroy()}setRowCtrls(e){const t={...this.rowComps};this.rowComps={},this.lastPlacedElement=null;const i=s=>{const n=s.instanceId,o=t[n];if(o)this.rowComps[n]=o,delete t[n],this.ensureDomOrder(o.getGui());else{if(!s.getRowNode().displayed)return;const r=new OI(s,this.beans,this.options.type);this.rowComps[n]=r,this.appendRow(r.getGui())}};e.forEach(i),Ts(t).forEach(s=>{this.eContainer.removeChild(s.getGui()),s.destroy()}),Vt(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?tA(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(qg(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}},BI={selector:"AG-ROW-CONTAINER",component:NI};function pr(e){return e.map(t=>`<ag-row-container name="${t}"></ag-row-container>`).join("")}var GI=`<div class="ag-root ag-unselectable" role="treegrid">
142
+ <ag-header-root></ag-header-root>
143
+ <div class="ag-floating-top" data-ref="eTop" role="presentation">
144
+ ${pr(["topLeft","topCenter","topRight","topFullWidth"])}
145
+ </div>
146
+ <div class="ag-body" data-ref="eBody" role="presentation">
147
+ <div class="ag-body-viewport" data-ref="eBodyViewport" role="presentation">
148
+ ${pr(["left","center","right","fullWidth"])}
149
+ </div>
150
+ <ag-fake-vertical-scroll></ag-fake-vertical-scroll>
151
+ </div>
152
+ <div class="ag-sticky-top" data-ref="eStickyTop" role="presentation">
153
+ ${pr(["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])}
154
+ </div>
155
+ <div class="ag-sticky-bottom" data-ref="eStickyBottom" role="presentation">
156
+ ${pr(["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])}
157
+ </div>
158
+ <div class="ag-floating-bottom" data-ref="eBottom" role="presentation">
159
+ ${pr(["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])}
160
+ </div>
161
+ <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>
162
+ <ag-overlay-wrapper></ag-overlay-wrapper>
163
+ </div>`,HI=class extends Pe{constructor(){super(GI,[Nk,Gk,Wk,Ok,BI]),this.eBodyViewport=J,this.eStickyTop=J,this.eStickyBottom=J,this.eTop=J,this.eBottom=J,this.eBody=J}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.rangeService=e.rangeService}postConstruct(){const e=(i,s)=>{const n=`${i}px`;s.style.minHeight=n,s.style.height=n},t={setRowAnimationCssOnBodyViewport:(i,s)=>this.setRowAnimationCssOnBodyViewport(i,s),setColumnCount:i=>UT(this.getGui(),i),setRowCount:i=>zT(this.getGui(),i),setTopHeight:i=>e(i,this.eTop),setBottomHeight:i=>e(i,this.eBottom),setTopDisplay:i=>this.eTop.style.display=i,setBottomDisplay:i=>this.eBottom.style.display=i,setStickyTopHeight:i=>this.eStickyTop.style.height=i,setStickyTopTop:i=>this.eStickyTop.style.top=i,setStickyTopWidth:i=>this.eStickyTop.style.width=i,setStickyBottomHeight:i=>{this.eStickyBottom.style.height=i,this.eStickyBottom.classList.toggle("ag-hidden",i==="0px")},setStickyBottomBottom:i=>this.eStickyBottom.style.bottom=i,setStickyBottomWidth:i=>this.eStickyBottom.style.width=i,setColumnMovingCss:(i,s)=>this.addOrRemoveCssClass(i,s),updateLayoutClasses:(i,s)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(o=>{o.toggle("ag-layout-auto-height",s.autoHeight),o.toggle("ag-layout-normal",s.normal),o.toggle("ag-layout-print",s.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",s.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",s.normal),this.addOrRemoveCssClass("ag-layout-print",s.print)},setAlwaysVerticalScrollClass:(i,s)=>this.eBodyViewport.classList.toggle(Yf,s),registerBodyViewportResizeListener:i=>{const s=this.resizeObserverService.observeResize(this.eBodyViewport,i);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:i=>this.eTop.style.overflowY=this.eBottom.style.overflowY=i,setCellSelectableCss:(i,s)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(n=>n.classList.toggle(i,s))},setBodyViewportWidth:i=>this.eBodyViewport.style.width=i};this.ctrl=this.createManagedBean(new LI),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&Ot(this.gos)||cd(this.gos))&&WT(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}},WI={selector:"AG-GRID-BODY",component:HI},zI=class extends B{constructor(){super(...arguments),this.beanName="scrollVisibleService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnAnimationService=e.columnAnimationService}postConstruct(){this.getScrollbarWidth(),this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)})}onDisplayedColumnsChanged(){this.updateScrollVisible()}onDisplayedColumnsWidthChanged(){this.updateScrollVisible()}onCentreViewportResized(){this.updateScrollGap()}updateScrollVisible(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateScrollVisibleImpl())}):this.updateScrollVisibleImpl()}updateScrollVisibleImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t),this.updateScrollGap()}updateScrollGap(){const e=this.ctrlsService.get("center"),t=e.hasHorizontalScrollGap(),i=e.hasVerticalScrollGap();(this.horizontalScrollGap!==t||this.verticalScrollGap!==i)&&(this.horizontalScrollGap=t,this.verticalScrollGap=i,this.eventService.dispatchEvent({type:"scrollGapChanged"}))}setScrollsVisible(e){(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing)&&(this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing,this.eventService.dispatchEvent({type:"scrollVisibilityChanged"}))}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}hasHorizontalScrollGap(){return this.horizontalScrollGap}hasVerticalScrollGap(){return this.verticalScrollGap}getScrollbarWidth(){if(this.scrollbarWidth==null){const e=this.gos.get("scrollbarWidth"),i=typeof e=="number"&&e>=0?e:XT();i!=null&&(this.scrollbarWidth=i,this.eventService.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}},Qf="__ag_grid_instance",Xf=class Ow extends B{constructor(){super(...arguments),this.beanName="mouseEventService",this.gridInstanceId=Ow.gridInstanceSequence.next()}wireBeans(t){this.ctrlsService=t.ctrlsService}stampTopLevelGridCompWithGridInstance(t){t[Qf]=this.gridInstanceId}getRenderedCellForEvent(t){return Tl(this.gos,t.target,Ls.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(t){return this.isElementInThisGrid(t.target)}isElementInThisGrid(t){let i=t;for(;i;){const s=i[Qf];if(j(s))return s===this.gridInstanceId;i=i.parentElement}return!1}getCellPositionForEvent(t){const i=this.getRenderedCellForEvent(t);return i?i.getCellPosition():null}getNormalisedPosition(t){const i=ht(this.gos,"normal"),s=t;let n,o;if(s.clientX!=null||s.clientY!=null?(n=s.clientX,o=s.clientY):(n=s.x,o=s.y),i){const r=this.ctrlsService.getGridBodyCtrl(),a=r.getScrollFeature().getVScrollPosition(),d=r.getScrollFeature().getHScrollPosition();n+=d.left,o+=a.top}return{x:n,y:o}}};Xf.gridInstanceSequence=new qn;var UI=Xf,$I=class extends B{constructor(){super(),this.beanName="navigationService",this.onPageDown=ug(this.onPageDown,100),this.onPageUp=ug(this.onPageUp,100)}wireBeans(e){this.mouseEventService=e.mouseEventService,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.rowRenderer=e.rowRenderer,this.headerNavigationService=e.headerNavigationService,this.rowPositionUtils=e.rowPositionUtils,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.scrollVisibleService=e.scrollVisibleService,this.rangeService=e.rangeService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,n=e.ctrlKey||e.metaKey,o=!!this.rangeService&&e.shiftKey,r=this.mouseEventService.getCellPositionForEvent(e);let a=!1;switch(i){case N.PAGE_HOME:case N.PAGE_END:!n&&!s&&(this.onHomeOrEndKey(i),a=!0);break;case N.LEFT:case N.RIGHT:case N.UP:case N.DOWN:if(!r)return!1;n&&!s&&!o&&(this.onCtrlUpDownLeftRight(i,r),a=!0);break;case N.PAGE_DOWN:case N.PAGE_UP:!n&&!s&&(a=this.handlePageUpDown(i,r,t));break}return a&&e.preventDefault(),a}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),t?(e===N.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0):!1}navigateTo(e){var r;const{scrollIndex:t,scrollType:i,scrollColumn:s,focusIndex:n,focusColumn:o}=e;j(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),j(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(n),this.focusService.setFocusedCell({rowIndex:n,column:o,rowPinned:null,forceBrowserFocus:!0}),(r=this.rangeService)==null||r.setRangeToCell({rowIndex:n,rowPinned:null,column:o})}onPageDown(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.getViewportHeight(),n=this.pageBoundsService.getPixelOffset(),o=i.top+s,r=this.rowModel.getRowIndexAtPixel(o+n);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r):this.navigateToNextPage(e,r)}onPageUp(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.pageBoundsService.getPixelOffset(),n=i.top,o=this.rowModel.getRowIndexAtPixel(n+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,o,!0):this.navigateToNextPage(e,o,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),n=this.pageBoundsService.getFirstRow(),o=this.pageBoundsService.getLastRow(),r=this.pageBoundsService.getPixelOffset(),a=this.rowModel.getRow(e.rowIndex),d=i?(a==null?void 0:a.rowHeight)-s-r:s-r,h=(a==null?void 0:a.rowTop)+d;let g=this.rowModel.getRowIndexAtPixel(h+r);if(g===e.rowIndex){const C=i?-1:1;t=g=e.rowIndex+C}let f;i?(f="bottom",g<n&&(g=n),t<n&&(t=n)):(f="top",g>o&&(g=o),t>o&&(t=o)),this.isRowTallerThanView(g)&&(t=g,f="top"),this.navigateTo({scrollIndex:t,scrollType:f,scrollColumn:null,focusIndex:g,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){const i=t?-1:1,s=this.getViewportHeight(),n=this.pageBoundsService.getLastRow();let o=0,r=e.rowIndex;for(;r>=0&&r<=n;){const a=this.rowModel.getRow(r);if(a){const d=a.rowHeight??0;if(o+d>s)break;o+=d}r+=i}return Math.max(0,Math.min(r,n))}getViewportHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),t=this.scrollVisibleService.getScrollbarWidth();let i=e.bottom-e.top;return this.ctrlsService.get("center").isHorizontalScrollShowing()&&(i-=t),i}isRowTallerThanView(e){const t=this.rowModel.getRow(e);if(!t)return!1;const i=t.rowHeight;return typeof i!="number"?!1:i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s}=i,n=i.column;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:n,focusIndex:s,focusColumn:n})}onHomeOrEndKey(e){const t=e===N.PAGE_HOME,i=this.visibleColsService.getAllCols(),s=t?i[0]:ce(i),n=t?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow();this.navigateTo({scrollIndex:n,scrollType:null,scrollColumn:s,focusIndex:n,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(s!==!1){s?t.preventDefault():s===null&&this.focusService.allowFocusForNextGridCoreContainer(i);return}if(i){const{rowIndex:n,rowPinned:o}=e.getRowPosition();(o?n===0:n===this.pageBoundsService.getFirstRow())&&(this.gos.get("headerHeight")===0||this.focusService.isHeaderFocusSuppressed()?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof Ls&&e.focusCell(!0),(!i&&this.focusService.focusOverlay(!1)||this.focusService.focusNextGridCoreContainer(i))&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!s&&(s=this.rowRenderer.getRowByPosition(i),!s||!s.isFullWidth())?!1:!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s=e.isEditing();if(!s&&e instanceof Ls){const r=e.getRowCtrl();r&&(s=r.isEditing())}let n;return s?this.gos.get("editType")==="fullRow"?n=this.moveToNextEditingRow(e,t,i):n=this.moveToNextEditingCell(e,t,i):n=this.moveToNextCellNotEditing(e,t),n===null?n:n||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const n=this.findNextCellToFocusOn(s,t,!0);return n===!1?null:n==null?!1:(n.startEditing(null,!0,i),n.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),n=this.findNextCellToFocusOn(s,t,!0);if(n===!1)return null;if(n==null)return!1;const o=n.getCellPosition(),r=this.isCellEditable(s),a=this.isCellEditable(o),d=o&&s.rowIndex===o.rowIndex&&s.rowPinned===o.rowPinned;return r&&e.setFocusOutOnEditor(),d||(e.getRowCtrl().stopEditing(),n.getRowCtrl().startRowEditing(void 0,void 0,i)),a?(n.setFocusInOnEditor(),n.focusCell()):n.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.visibleColsService.getAllCols();let s;e instanceof gn?s={...e.getRowPosition(),column:t?i[0]:ce(i)}:s=e.getCellPosition();const n=this.findNextCellToFocusOn(s,t,!1);if(n===!1)return null;if(n instanceof Ls)n.focusCell(!0);else if(n)return this.tryToFocusFullWidthRow(n.getRowPosition(),t);return j(n)}findNextCellToFocusOn(e,t,i){var n;let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const o=this.gos.getCallback("tabToNextCell");if(j(o)){const h=o({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});if(h===!0||h===null)h===null&&W("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),s=e;else{if(h===!1)return!1;s={rowIndex:h.rowIndex,column:h.column,rowPinned:h.rowPinned}}}if(!s)return null;if(s.rowIndex<0){const d=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:d+s.rowIndex,column:s.column},fromCell:!0}),null}const r=this.gos.get("editType")==="fullRow";if(i&&!r&&!this.isCellEditable(s))continue;this.ensureCellVisible(s);const a=this.getCellByPosition(s);if(!a){const d=this.rowRenderer.getRowByPosition(s);if(!d||!d.isFullWidth()||i)continue;return d}if(!a.isSuppressNavigable())return(n=this.rangeService)==null||n.setRangeToCell(s),a}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return t?e.column.isCellEditable(t):!1}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return e.rowPinned==="top"?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):e.rowPinned==="bottom"?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.rowModel.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let n=i,o=!1;for(;n&&(n===i||!this.isValidNavigateCell(n));)this.gos.get("enableRtl")?t===N.LEFT&&(n=this.getLastCellOfColSpan(n)):t===N.RIGHT&&(n=this.getLastCellOfColSpan(n)),n=this.cellNavigationService.getNextCellToFocus(t,n),o=ke(n);if(o&&e&&e.key===N.UP&&(n={rowIndex:-1,rowPinned:null,column:i.column}),s){const a=this.gos.getCallback("navigateToNextCell");if(j(a)){const h=a({key:t,previousCellPosition:i,nextCellPosition:n||null,event:e});j(h)?n={rowPinned:h.rowPinned,rowIndex:h.rowIndex,column:h.column}:n=null}}if(!n)return;if(n.rowIndex<0){const a=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:a+n.rowIndex,column:i.column},event:e||void 0,fromCell:!0});return}const r=this.getNormalisedPosition(n);r?this.focusPosition(r):this.tryToFocusFullWidthRow(n)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t){const i=this.visibleColsService.getAllCols(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const n=this.focusService.getFocusedCell(),o={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?ce(i):i[0])};this.focusPosition(o);const r=t??(n!=null&&this.rowPositionUtils.before(o,n));return this.eventService.dispatchEvent({type:"fullWidthRowFocused",rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:o.column,isFullWidthCell:!0,fromBelow:r}),!0}focusPosition(e){var t;this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),(t=this.rangeService)==null||t.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return i.length===1?e:{rowIndex:e.rowIndex,column:ce(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=xl(this.gos),i=this.rowModel.getRow(e.rowIndex);!(t&&(i==null?void 0:i.sticky))&&ke(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}},KI=class extends B{constructor(){super(...arguments),this.beanName="horizontalResizeService"}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService}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};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},jI=class extends B{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.menuService=e.menuService}hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,n="left";const o=this.menuService.isLegacyMenuEnabled();!o&&this.gos.get("enableRtl")&&(s=1,n="right");const r=o?void 0:4*s,a=o?void 0:4;this.showPopup(e,d=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:d,nudgeX:r,nudgeY:a,alignSide:n,keepWithinBounds:!0,position:"under",column:e})},i,t,o)}showPopup(e,t,i,s,n){const o=e?this.createBean(new nM(e,"COLUMN_MENU")):void 0;if(this.activeMenu=o,!(o!=null&&o.hasFilter())||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const r=document.createElement("div");Vt(r,"presentation"),r.classList.add("ag-menu"),n||r.classList.add("ag-filter-menu"),[this.tabListener]=this.addManagedElementListeners(r,{keydown:S=>this.trapFocusWithin(S,r)}),r.appendChild(o==null?void 0:o.getGui());let a;const d=()=>o==null?void 0:o.afterGuiDetached(),h=this.menuService.isColumnMenuAnchoringEnabled()?s??this.ctrlsService.getGridBodyCtrl().getGui():void 0,g=S=>{e.setMenuVisible(!1,"contextMenu");const R=S instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),R&&s&&jt(s)){const y=this.focusService.findTabbableParent(s);y&&y.focus()}d(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},f=this.localeService.getLocaleTextFunc(),C=n&&i!=="columnFilter"?f("ariaLabelColumnMenu","Column Menu"):f("ariaLabelColumnFilter","Column Filter"),v=this.popupService.addPopup({modal:!0,eChild:r,closeOnEsc:!0,closedCallback:g,positionCallback:()=>t(r),anchorToElement:h,ariaLabel:C});v&&(this.hidePopup=a=v.hideFunc),o.afterInit().then(()=>{t(r),o.afterGuiAttached({container:i,hidePopup:a})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==N.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){this.eventService.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:i??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},ZI=class extends B{constructor(){super(...arguments),this.beanName="resizeObserverService"}observeResize(e,t){const s=gg(this.gos).ResizeObserver,n=s?new s(t):null;return n==null||n.observe(e),()=>n==null?void 0:n.disconnect()}},qI=class extends B{constructor(){super(...arguments),this.beanName="animationFrameService",this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}setScrollTop(e){var i;const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&e===0){const s=((i=this.paginationService)==null?void 0:i.getCurrentPage())??0;s!==this.lastPage&&(this.lastPage=s,this.scrollGoingDown=!0)}this.lastScrollTop=e}postConstruct(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){this.useAnimationFrame===!1&&W(`AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}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((i,s)=>i.index!==s.index?t*(s.index-i.index):s.createOrder-i.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,n=s.list,o=this.destroyTasks,r=new Date().getTime();let a=new Date().getTime()-r;const d=e<=0,h=this.ctrlsService.getGridBodyCtrl();for(;d||a<e;){if(!h.getScrollFeature().scrollGridIfNeeded()){let f;if(i.length)this.sortTaskList(t),f=i.pop().task;else if(n.length)this.sortTaskList(s),f=n.pop().task;else if(o.length)f=o.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(f)||f()}a=new Date().getTime()-r}i.length||n.length||o.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=gg(this.gos);t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{if(!this.isOn()){window.setTimeout(e,0);return}t||(t=!0,this.addDestroyTask(()=>{t=!1,e()}))}}},Le=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing",e))(Le||{}),YI=class extends B{constructor(){super(...arguments),this.beanName="expansionService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.isClientSideRowModel=Ye(this.gos)}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(i=>{i.id&&t.has(i.id)&&(i.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&e.parent.level!==-1&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}},QI=class extends B{constructor(){super(...arguments),this.beanName="menuService"}wireBeans(e){this.valueService=e.valueService,this.filterMenuFactory=e.filterMenuFactory,this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.filterManager=e.filterManager,this.rowRenderer=e.rowRenderer,this.columnChooserFactory=e.columnChooserFactory,this.contextMenuFactory=e.contextMenuFactory,this.enterpriseMenuFactory=e.enterpriseMenuFactory}postConstruct(){this.activeMenuFactory=this.enterpriseMenuFactory??this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const n=s.getBoundingClientRect();return{x:n.x+n.width/2,y:n.y+n.height/2}}showContextMenu(e){var o;const{rowNode:t}=e,i=e.column;let{anchorToElement:s,value:n}=e;t&&i&&n==null&&(n=this.valueService.getValueForDisplay(i,t)),s==null&&(s=this.getContextMenuAnchorElement(t,i)),(o=this.contextMenuFactory)==null||o.onContextMenu(e.mouseEvent??null,e.touchEvent??null,t??null,i??null,n,s)}showColumnChooser(e){var t;(t=this.columnChooserFactory)==null||t.showColumnChooser(e)}hidePopupMenu(){var e;(e=this.contextMenuFactory)==null||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;(e=this.columnChooserFactory)==null||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(i??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){var t;return!e.getColDef().suppressHeaderFilterButton&&!!((t=this.filterManager)!=null&&t.isFilterAllowed(e))}isHeaderContextMenuEnabled(e){const t=e&&As(e)?e.getColDef():e==null?void 0:e.getColGroupDef();return!(t!=null&&t.suppressHeaderContextMenu)&&this.getColumnMenuType()==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Ms()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){var t;return!!((t=this.filterManager)!=null&&t.isFilterAllowed(e))&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return this.getColumnMenuType()==="new"}isLegacyMenuEnabled(){return this.getColumnMenuType()==="legacy"}isFloatingFilterButtonEnabled(e){var s;const t=e.getColDef(),i=(s=t.floatingFilterComponentParams)==null?void 0:s.suppressFilterButton;return i!=null&&W("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),t.suppressFloatingFilterButton==null?!i:!t.suppressFloatingFilterButton}getColumnMenuType(){return this.gos.get("columnMenu")}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?this.gos.exists("suppressMenuHide")?e:!1:e}showColumnMenuCommon(e,t,i,s){const{positionBy:n}=t,o=t.column;if(n==="button"){const{buttonElement:r}=t;e.showMenuAfterButtonClick(o,r,i,s)}else if(n==="mouse"){const{mouseEvent:r}=t;e.showMenuAfterMouseEvent(o,r,i,s)}else o&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(o,"auto"),this.animationFrameService.requestAnimationFrame(()=>{var a;const r=(a=this.ctrlsService.getHeaderRowContainerCtrl(o.getPinned()))==null?void 0:a.getHeaderCtrlForColumn(o);r&&e.showMenuAfterButtonClick(o,r.getAnchorElementForMenu(s),i,!0)}))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(t!=null)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return(i==null?void 0:i.getGui())||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;const n=this.getCellGui(s,t);return n||(s.isFullWidth()?s.getFullWidthElement():i)}},XI=class extends un{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},JI={selector:"AG-INPUT-TEXT-AREA",component:XI},eL=class extends Qn{constructor(){super(`<div class="ag-large-text">
164
+ <ag-input-text-area data-ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>
165
+ </div>`,[JI]),this.eTextArea=J}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),j(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===N.LEFT||t===N.UP||t===N.RIGHT||t===N.DOWN||e.shiftKey&&t===N.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return!j(e)&&!j(this.params.value)?this.params.value:this.params.parseValue(e)}},tL=class extends Qn{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){rn(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,i=s=>{Kd(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:i})}},iL=class extends Qn{constructor(){super(`<div class="ag-cell-edit-wrapper">
166
+ <ag-select class="ag-cell-editor" data-ref="eSelect"></ag-select>
167
+ </div>`,[dM]),this.eSelect=J,this.startedByEnter=!1}wireBeans(e){this.valueService=e.valueService}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:s}=this,{values:n,value:o,eventKey:r}=e;if(ke(n)){W("no values found for select cellEditor");return}this.startedByEnter=r!=null?r===N.ENTER:!1;let a=!1;n.forEach(f=>{const C={value:f},v=i.formatValue(e.column,null,f),S=v!=null;C.text=S?v:f,t.addOption(C),a=a||o===f}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:d,valueListMaxWidth:h,valueListMaxHeight:g}=e;d!=null&&t.setPickerGap(d),g!=null&&t.setPickerMaxHeight(g),h!=null&&t.setPickerMaxWidth(h),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eSelect,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}},ta=class extends Qn{constructor(e){super(`
168
+ <div class="ag-cell-edit-wrapper">
169
+ ${e.getTemplate()}
170
+ </div>`,e.getAgComponents()),this.cellEditorInput=e,this.eInput=J}init(e){this.params=e;const{cellStartedEdit:t,eventKey:i,suppressPreventDefault:s}=e,n=this.eInput;this.cellEditorInput.init(n,e);let o,r=!0;t?(this.focusAfterAttached=!0,i===N.BACKSPACE||i===N.DELETE?o="":i&&i.length===1?s?r=!1:o=i:(o=this.cellEditorInput.getStartValue(),i!==N.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,o=this.cellEditorInput.getStartValue()),r&&o!=null&&n.setStartValue(o),this.addManagedElementListeners(n.getGui(),{keydown:a=>{const{key:d}=a;(d===N.PAGE_UP||d===N.PAGE_DOWN)&&a.preventDefault()}})}afterGuiAttached(){var s,n;const e=this.localeService.getLocaleTextFunc(),t=this.eInput;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;Gi()||t.getFocusableElement().focus();const i=t.getInputElement();this.highlightAllOnFocus?i.select():(n=(s=this.cellEditorInput).setCaret)==null||n.call(s)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}},sL=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" data-ref="eInput"></ag-input-text-field>'}getAgComponents(){return[Kl]}init(e,t){this.eInput=e,this.params=t,t.maxLength!=null&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return!j(e)&&!j(this.params.value)?this.params.value:this.params.parseValue(e)}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=j(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},Jf=class extends ta{constructor(){super(new sL)}},nL=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" data-ref="eInput"></ag-input-number-field>'}getAgComponents(){return[SM]}init(e,t){this.eInput=e,this.params=t,t.max!=null&&e.setMax(t.max),t.min!=null&&e.setMin(t.min),t.precision!=null&&e.setPrecision(t.precision),t.step!=null&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){(e.key===N.UP||e.key===N.DOWN)&&e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!j(e)&&!j(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(t==null)return t;if(typeof t=="string"){if(t==="")return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}setCaret(){Gi()&&this.eInput.getInputElement().focus({preventScroll:!0})}},oL=class extends ta{constructor(){super(new nL)}},rL=class extends pn{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=Gi();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){Ke(this.gos)===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?li(e??null,!1)??void 0:e;return this.min===t?this:(this.min=t,ri(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?li(e??null,!1)??void 0:e;return this.max===t?this:(this.max=t,ri(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,ri(this.eInput,"step",e),this)}getDate(){if(this.eInput.validity.valid)return Nt(this.getValue())??void 0}setDate(e,t){this.setValue(li(e??null,!1),t)}},em={selector:"AG-INPUT-DATE-FIELD",component:rL},lL=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[em]}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return!j(e)&&!j(this.params.value)?this.params.value:e??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return li(e,!1)}},aL=class extends ta{constructor(){super(new lL)}},cL=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[em]}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return!j(e)&&!j(this.params.value)?this.params.value:this.params.parseValue(e??"")}getStartValue(){return li(this.parseDate(this.params.value??void 0)??null,!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):Nt(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):li(e??null,!1)??void 0}},dL=class extends ta{wireBeans(e){this.dataTypeService=e.dataTypeService}constructor(){super(new cL(()=>this.dataTypeService))}},uL=class extends Qn{constructor(){super(`
171
+ <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">
172
+ <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
173
+ </div>`,[Hd]),this.eCheckbox=J}init(e){this.params=e;const t=e.value??void 0;this.eCheckbox.setValue(t),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(this.eCheckbox,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=Rd(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}},gr=class{constructor(e){this.cellValueChanges=e}},du=class extends gr{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},hL=10,tm=class{constructor(e){this.actionStack=[],this.maxStackSize=e||hL,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},pL=class extends B{constructor(){super(...arguments),this.beanName="undoRedoService",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=this.activeCellEdit!==null&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=this.activeRowEdit!==null&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:o,rowIndex:r,column:a,oldValue:d,value:h}=e,g={rowPinned:o,rowIndex:r,columnId:a.getColId(),newValue:h,oldValue:d};this.cellValueChanges.push(g)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}wireBeans(e){this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.columnModel=e.columnModel,this.rangeService=e.rangeService}postConstruct(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");if(e<=0)return;this.undoStack=new tm(e),this.redoStack=new tm(e),this.addListeners();const t=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:i=>{i.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:t,newColumnsLoaded:t,columnGroupOpened:t,columnRowGroupChanged:t,columnMoved:t,columnPinned:t,columnVisible:t,rowDragEnd:t}),this.ctrlsService.whenReady(this,i=>{this.gridBodyCtrl=i.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){this.eventService.dispatchEvent({type:"undoStarted",source:e});const t=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo");this.eventService.dispatchEvent({type:"undoEnded",source:e,operationPerformed:t})}redo(e){this.eventService.dispatchEvent({type:"redoStarted",source:e});const t=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo");this.eventService.dispatchEvent({type:"redoEnded",source:e,operationPerformed:t})}undoRedo(e,t,i,s,n){if(!e)return!1;const o=e.pop();return!o||!o.cellValueChanges?!1:(this.processAction(o,r=>r[s],n),o instanceof du?this.processRange(this.rangeService,o.ranges||[o[i]]):this.processCell(o.cellValueChanges),t.push(o),!0)}processAction(e,t,i){e.cellValueChanges.forEach(s=>{const{rowIndex:n,rowPinned:o,columnId:r}=s,a={rowIndex:n,rowPinned:o},d=this.rowPositionUtils.getRowNode(a);d.displayed&&d.setDataValue(r,t(s),i)})}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach((s,n)=>{if(!s)return;const o=s.startRow,r=s.endRow;n===t.length-1&&(i={rowPinned:o.rowPinned,rowIndex:o.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const a={rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,n={rowIndex:i,rowPinned:s},o=this.rowPositionUtils.getRowNode(n),r={rowPinned:t.rowPinned,rowIndex:o.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:n}=e,o=this.gridBodyCtrl.getScrollFeature(),r=this.columnModel.getCol(s);if(!r)return;o.ensureIndexVisible(i),o.ensureColumnVisible(r);const a={rowIndex:i,column:r,rowPinned:n};this.focusService.setFocusedCell({...a,forceBrowserFocus:!0}),t==null||t.setRangeToCell(a)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new gr(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const i=new gr(this.cellValueChanges);this.pushActionsToUndoStack(i)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new gr(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new du(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;this.rangeService&&Ot(this.gos)?e=new du(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):e=new gr(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1}})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};function gL(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition()}function fL(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getHScrollPosition()}function im(e,t,i="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t,i),"ensureVisible")}function sm(e,t,i){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureIndexVisible(t,i),"ensureVisible")}function mL(e,t,i=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureNodeVisible(t,i),"ensureVisible")}function CL(e){var t;(t=e.undoRedoService)==null||t.undo("api")}function vL(e){var t;(t=e.undoRedoService)==null||t.redo("api")}function wL(e,t={}){return e.rowRenderer.getCellEditorInstances(t).map(lr)}function SL(e){return e.rowRenderer.getEditingCells()}function yL(e,t=!1){e.rowRenderer.stopEditing(t)}function bL(e,t){const i=e.columnModel.getCol(t.colKey);if(!i){W(`no column found for ${t.colKey}`);return}const s={rowIndex:t.rowIndex,rowPinned:t.rowPinned||null,column:i};t.rowPinned==null&&sm(e,t.rowIndex),im(e,t.colKey);const o=e.navigationService.getCellByPosition(s);if(!o)return;const{focusService:r,gos:a}=e,d=()=>{const g=Ke(a),f=o.getGui();return g!==f&&f.contains(g)},h=a.get("stopEditingWhenCellsLoseFocus")&&d();(h||!r.isCellFocused(s))&&r.setFocusedCell({...s,forceBrowserFocus:h,preventScrollOnBrowserFocus:!0}),o.startRowOrCellEdit(t.key)}function RL(e){var t;return((t=e.undoRedoService)==null?void 0:t.getCurrentUndoStackSize())??0}function FL(e){var t;return((t=e.undoRedoService)==null?void 0:t.getCurrentRedoStackSize())??0}var xL=class extends B{constructor(){super(...arguments),this.beanName="editService"}wireBeans(e){this.navigationService=e.navigationService,this.userComponentFactory=e.userComponentFactory,this.valueService=e.valueService}startEditing(e,t=null,i=!1,s=null){var h;const n=this.createCellEditorParams(e,t,i),o=e.getColumn().getColDef(),r=this.userComponentFactory.getCellEditorDetails(o,n),a=(r==null?void 0:r.popupFromSelector)!=null?r.popupFromSelector:!!o.cellEditorPopup,d=(r==null?void 0:r.popupPositionFromSelector)!=null?r.popupPositionFromSelector:o.cellEditorPopupPosition;return e.setEditing(!0,r),e.getComp().setEditDetails(r,a,d,this.gos.get("reactiveCustomComponents")),this.eventService.dispatchEvent(e.createEvent(s,"cellEditingStarted")),!((h=r==null?void 0:r.params)!=null&&h.suppressPreventDefault)}stopEditing(e,t){const i=e.getComp(),{newValue:s,newValueExists:n}=this.takeValueFromCellEditor(t,i),o=e.getRowNode(),r=e.getColumn(),a=this.valueService.getValueForDisplay(r,o);let d=!1;return n&&(d=this.saveNewValue(e,a,s,o,r)),e.setEditing(!1,void 0),i.setEditDetails(),e.updateAndFormatValue(!1),e.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.eventService.dispatchEvent({...e.createEvent(null,"cellEditingStopped"),oldValue:a,newValue:s,valueChanged:d}),d}handleColDefChanged(e){const t=e.getCellEditor();if(t!=null&&t.refresh){const{eventKey:i,cellStartedEdit:s}=e.getEditCompDetails().params,n=this.createCellEditorParams(e,i,s),o=e.getColumn().getColDef(),r=this.userComponentFactory.getCellEditorDetails(o,n);t.refresh(r.params)}}setFocusOutOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusOut&&t.focusOut()}setFocusInOnEditor(e){const t=e.getComp(),i=t.getCellEditor();i!=null&&i.focusIn?i.focusIn():(e.focusCell(!0),e.onCellEditorAttached(()=>{var s,n;return(n=(s=t.getCellEditor())==null?void 0:s.focusIn)==null?void 0:n.call(s)}))}stopEditingAndFocus(e,t=!1,i=!1){e.stopRowOrCellEdit(),e.focusCell(!0),t||this.navigateAfterEdit(i,e.getCellPosition())}createPopupEditorWrapper(e){return new tL(e)}takeValueFromCellEditor(e,t){const i={newValueExists:!1};if(e)return i;const s=t.getCellEditor();return!s||s.isCancelAfterEnd&&s.isCancelAfterEnd()?i:{newValue:s.getValue(),newValueExists:!0}}saveNewValue(e,t,i,s,n){if(i===t)return!1;e.setSuppressRefreshCell(!0);const o=s.setDataValue(n,i,"edit");return e.setSuppressRefreshCell(!1),o}createCellEditorParams(e,t,i){const s=e.getColumn(),n=e.getRowNode();return this.gos.addGridCommonParams({value:this.valueService.getValueForDisplay(s,n),eventKey:t,column:s,colDef:s.getColDef(),rowIndex:e.getCellPosition().rowIndex,node:n,data:n.data,cellStartedEdit:i,onKeyDown:e.onKeyDown.bind(e),stopEditing:e.stopEditingAndFocus.bind(e),eGridCell:e.getGui(),parseValue:o=>this.valueService.parseValue(s,n,o,e.getValue()),formatValue:e.formatValue.bind(e)})}navigateAfterEdit(e,t){if(this.gos.get("enterNavigatesVerticallyAfterEdit")){const s=e?N.UP:N.DOWN;this.navigationService.navigateToNextCell(null,s,t,!1)}}},EL=class extends B{constructor(){super(...arguments),this.beanName="rowEditService"}startEditing(e,t=null,i=null,s=null){let n=!0;return e.getAllCellCtrls().reduce((r,a)=>{const d=a===i;return d?n=a.startEditing(t,d,s):a.startEditing(null,d,s),r?!0:a.isEditing()},!1)&&this.setEditing(e,!0),n}stopEditing(e,t=!1){const i=e.getAllCellCtrls(),s=e.isEditing();e.setStoppingRowEdit(!0);let n=!1;for(const o of i){const r=o.stopEditing(t);s&&!t&&!n&&r&&(n=!0)}n&&this.eventService.dispatchEvent(e.createRowEvent("rowValueChanged")),s&&this.setEditing(e,!1),e.setStoppingRowEdit(!1)}setEditing(e,t){e.setEditingRow(t),e.forEachGui(void 0,s=>s.rowComp.addOrRemoveCssClass("ag-row-editing",t));const i=t?e.createRowEvent("rowEditingStarted"):e.createRowEvent("rowEditingStopped");this.eventService.dispatchEvent(i)}},fn={version:ge,moduleName:"@ag-grid-community/edit-core",beans:[xL]},PL={version:ge,moduleName:"@ag-grid-community/edit-api",apiFunctions:{undoCellEditing:CL,redoCellEditing:vL,getCellEditorInstances:wL,getEditingCells:SL,stopEditing:yL,startEditingCell:bL,getCurrentUndoSize:RL,getCurrentRedoSize:FL},dependantModules:[fn]},DL={version:ge,moduleName:"@ag-grid-community/undo-redo-edit",beans:[pL],dependantModules:[fn]},TL={version:ge,moduleName:"@ag-grid-community/full-row-edit",beans:[EL],dependantModules:[fn]},nm={version:ge,moduleName:"@ag-grid-community/default-editor",userComponents:[{name:"agCellEditor",classImp:Jf}],dependantModules:[fn]},AL={version:ge,moduleName:"@ag-grid-community/data-type-editors",userComponents:[{name:"agTextCellEditor",classImp:Jf},{name:"agNumberCellEditor",classImp:oL,params:{suppressPreventDefault:!0}},{name:"agDateCellEditor",classImp:aL},{name:"agDateStringCellEditor",classImp:dL},{name:"agCheckboxCellEditor",classImp:uL}],dependantModules:[nm]},ML={version:ge,moduleName:"@ag-grid-community/select-editor",userComponents:[{name:"agSelectCellEditor",classImp:iL}],dependantModules:[fn]},kL={version:ge,moduleName:"@ag-grid-community/large-text-editor",userComponents:[{name:"agLargeTextCellEditor",classImp:eL}],dependantModules:[fn]},IL={version:ge,moduleName:"@ag-grid-community/all-editors",dependantModules:[nm,AL,ML,kL]},LL={version:ge,moduleName:"@ag-grid-community/editing",dependantModules:[fn,DL,TL,IL,PL]},_L=class extends B{constructor(){super(...arguments),this.beanName="autoWidthCalculator"}wireBeans(e){this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(o=>this.cloneItemIntoDummy(o,t)),i.appendChild(t);const s=t.offsetWidth;i.removeChild(t);const n=this.getAutoSizePadding();return s+n}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const s=i.getHtmlElementForColumnHeader(e);s!=null&&(t=s)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),n=s.classList;["ag-header-cell","ag-header-group-cell"].some(a=>i.classList.contains(a))?(n.add("ag-header","ag-header-row"),s.style.position="static"):n.add("ag-row");let r=e.parentElement;for(;r;){if(["ag-header-row","ag-row"].some(d=>r.classList.contains(d))){for(let d=0;d<r.classList.length;d++){const h=r.classList[d];h!="ag-row-position-absolute"&&n.add(h)}break}r=r.parentElement}s.appendChild(i),t.appendChild(s)}},OL=class extends B{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.extraTopHeight=0,this.extraBottomHeight=0}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.isClientSide=Ye(this.gos),this.ctrlsService.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl}),this.resetStickyContainers()}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}setOffsetTop(e){this.extraTopHeight!==e&&(this.extraTopHeight=e,this.eventService.dispatchEvent({type:"stickyTopOffsetChanged",offset:e}))}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getExtraTopHeight(){return this.extraTopHeight}getExtraBottomHeight(){return this.extraBottomHeight}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){var t,i;if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let n=(t=e.childStore)==null?void 0:t.getStoreBounds();return e.footer&&(n=(i=e.sibling.childStore)==null?void 0:i.getStoreBounds()),((n==null?void 0:n.heightPx)??0)+((n==null?void 0:n.topPx)??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let s=e.footer?e.sibling:e;for(;s.isExpandable()&&s.expanded;)if(s.master)s=s.detailNode;else if(s.childrenAfterSort){if(s.childrenAfterSort.length===0)break;s=ce(s.childrenAfterSort)}return s.rowTop+s.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t=e==="top";let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel()-this.extraTopHeight:this.rowRenderer.getLastVisibleVerticalPixel()-this.extraTopHeight,n=new Set,o=h=>{if(n.add(h),t){const g=this.getLastPixelOfGroup(h),f=s+i+h.rowHeight;g<f?h.stickyRowTop=i+(g-f):h.stickyRowTop=i}else{const g=this.getFirstPixelOfGroup(h),f=s-(i+h.rowHeight);g>f?h.stickyRowTop=i-(g-f):h.stickyRowTop=i}i=0,n.forEach(g=>{const f=g.stickyRowTop+g.rowHeight;i<f&&(i=f)})},r=this.areFooterRowsStickySuppressed(),a=this.gos.get("suppressGroupRowsSticky"),d=h=>{if(!h.displayed)return!1;if(h.footer){if(r===!0||r==="grand"&&h.level===-1||r==="group"&&h.level>-1)return!1;const g=h.sibling.rowIndex?h.sibling.rowIndex+1===h.rowIndex:!1;return e==="bottom"&&g?!1:!n.has(h)}return h.isExpandable()?a===!0||e==="bottom"?!1:!n.has(h)&&h.expanded:!1};for(let h=0;h<100;h++){let g=s+i;t||(g=s-i);const f=this.rowModel.getRowIndexAtPixel(g),C=this.rowModel.getRow(f);if(C==null)break;const S=this.getStickyAncestors(C).find(y=>(t?y.rowIndex<f:y.rowIndex>f)&&d(y));if(S){o(S);continue}if((t?C.rowTop<g:C.rowTop+C.rowHeight>g)&&d(C)){o(C);continue}break}return t||n.forEach(h=>{h.stickyRowTop=i-(h.stickyRowTop+h.rowHeight)}),this.refreshNodesAndContainerHeight(e,n,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(e===!0)return!0;const t=!!this.gos.get("groupIncludeFooter")||e==="group",i=!!this.gos.get("groupIncludeTotalFooter")||e==="grand";return t&&i?!0:i?"grand":t?"group":!1}canRowsBeSticky(){const e=xl(this.gos),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.resetStickyContainers()}resetStickyContainers(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(i=>i.getRowNode()===e)){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows();return}for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t,i){const s=e==="top",n=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,o={},r=[];for(let C=0;C<n.length;C++){const v=n[C].getRowNode();if(!t.has(v)){o[v.id]=n[C],v.sticky=!1;continue}r.push(n[C])}const a=new Set;for(let C=0;C<r.length;C++)a.add(r[C].getRowNode());const d=[];t.forEach(C=>{a.has(C)||(C.sticky=!0,d.push(this.createRowCon(C,!1,!1)))});let h=!!d.length||r.length!==n.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),h=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),h=!0),this.destroyRowCtrls(o,!1);const g=[...r,...d];g.sort((C,v)=>v.getRowNode().rowIndex-C.getRowNode().rowIndex),s||g.reverse(),g.forEach(C=>C.setRowTop(C.getRowNode().stickyRowTop));let f=0;return s?(t.forEach(C=>{C.rowIndex<this.pageBoundsService.getFirstRow()&&(f+=C.rowHeight)}),f>this.topContainerHeight&&(f=this.topContainerHeight),this.setOffsetTop(f)):(t.forEach(C=>{C.rowIndex>this.pageBoundsService.getLastRow()&&(f+=C.rowHeight)}),f>this.bottomContainerHeight&&(f=this.bottomContainerHeight),this.setOffsetBottom(f)),h?(s?this.stickyTopRowCtrls=g:this.stickyBottomRowCtrls=g,!0):!1}ensureRowHeightsValid(){let e=!1;const t=i=>{const s=i.getRowNode();if(s.rowHeightEstimated){const n=Ps(this.gos,s);s.setRowHeight(n.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}},VL=class extends B{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(o=>o.onCellSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(o=>o.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener("cellSelectionChanged",e),this.eventService.addEventListener("columnMoved",t),this.eventService.addEventListener("columnPinned",t),this.eventService.addEventListener("columnVisible",t)},s=()=>{this.eventService.removeEventListener("cellSelectionChanged",e),this.eventService.removeEventListener("columnMoved",t),this.eventService.removeEventListener("columnPinned",t),this.eventService.removeEventListener("columnVisible",t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListeners(["enableRangeSelection","selection"],()=>{Ot(this.gos)?i():s()}),Ot(this.gos)&&i()}}wireBeans(e){this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusService=e.focusService,this.beans=e,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.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(["getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection","selection"],()=>this.redrawRows()),xl(this.gos)&&(Ye(this.gos)||Yi(this.gos))&&(this.stickyRowFeature=this.createManagedBean(new OL(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this)))),this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=ht(this.gos,"print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=e??3;this.cachedRowCtrls=new NL(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=Ts(this.rowCtrlsByRowIndex),t=Ts(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}onSuppressCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onSuppressCellFocusChanged(e)),this.getFullWidthRowCtrls().forEach(t=>t.onSuppressCellFocusChanged(e))}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>{this.onCellFocusChanged(e)},cellFocusCleared:()=>this.onCellFocusChanged(),flashCells:e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))},columnHoverChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())},displayedColumnsChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())},displayedColumnsWidthChanged:()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getCols().forEach(t=>{const i=d=>{this.getAllCellCtrls().forEach(h=>{h.getColumn()===t&&d(h)})},s=()=>{i(d=>d.onLeftChanged())},n=()=>{i(d=>d.onWidthChanged())},o=()=>{i(d=>d.onFirstRightPinnedChanged())},r=()=>{i(d=>d.onLastLeftPinnedChanged())},a=()=>{i(d=>d.onColDefChanged())};t.addEventListener("leftChanged",s),t.addEventListener("widthChanged",n),t.addEventListener("firstRightPinnedChanged",o),t.addEventListener("lastLeftPinnedChanged",r),t.addEventListener("colDefChanged",a),this.destroyFuncsForColumnListeners.push(()=>{t.removeEventListener("leftChanged",s),t.removeEventListener("widthChanged",n),t.removeEventListener("firstRightPinnedChanged",o),t.removeEventListener("lastLeftPinnedChanged",r),t.removeEventListener("colDefChanged",a)})})}onDomLayoutChanged(){const e=ht(this.gos,"print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&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)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,"top"),this.refreshFloatingRows(this.bottomRowCtrls,"bottom")}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){const{pinnedRowModel:i,beans:s,printLayout:n}=this,o=Object.fromEntries(e.map(a=>[a.getRowNode().id,a]));i.forEachPinnedRow(t,(a,d)=>{const h=e[d];h&&i.getPinnedRowById(h.getRowNode().id,t)===void 0&&(h.destroyFirstPass(),h.destroySecondPass()),a.id in o?(e[d]=o[a.id],delete o[a.id]):e[d]=new gn(a,s,!1,!1,n)});const r=t==="top"?i.getPinnedTopRowCount():i.getPinnedBottomRowCount();e.length=r}onPinnedRowDataChanged(){const e={recycleRows:!0};this.redrawAfterModelUpdate(e)}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else if((i=this.cachedRowCtrls)!=null&&i.has(e)){this.cachedRowCtrls.removeRow(e);return}else{const s=n=>{const o=n[e.rowIndex];o&&o.getRowNode()===e&&(o.destroyFirstPass(),o.destroySecondPass(),n[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":s(this.topRowCtrls);break;case"bottom":s(this.bottomRowCtrls);break;default:s(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(e!=null){e==null||e.forEach(i=>this.redrawRow(i,!0)),this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e!=null&&e.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(t==null)return null;const i=Ke(this.gos),s=qo(this.gos,i,Ls.DOM_DATA_KEY_CELL_CTRL),n=qo(this.gos,i,gn.DOM_DATA_KEY_ROW_CTRL);return s||n?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&Hn(this.gos),n=i?this.getRowsToRecycle():null;if(i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature){this.stickyRowFeature.checkStickyRows();const o=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();o&&this.updateContainerHeights(o)}this.recycleRows(n,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),t!=null&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){var s;const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&(this.gridBodyCtrl.getScrollFeature().scrollToTop(),(s=this.stickyRowFeature)==null||s.resetOffsets())}updateContainerHeights(e=0){if(this.printLayout){this.rowContainerHeightService.setModelHeight(null);return}let t=this.pageBoundsService.getCurrentPageHeight();t===0&&(t=1),this.rowContainerHeightService.setModelHeight(t+e)}getLockOnRefresh(){var e,t;if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0,(t=(e=this.frameworkOverrides).getLockOnRefresh)==null||t.call(e)}releaseLockOnRefresh(){var e,t;this.refreshInProgress=!1,(t=(e=this.frameworkOverrides).releaseLockOnRefresh)==null||t.call(e)}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&this.focusService.restoreFocusedCell(e,()=>{this.onCellFocusChanged(this.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))})}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const n=t[s].getAllCellCtrls(),o=n.length;for(let r=0;r<o;r++)e.push(n[r])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const s in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[s]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};for(const i of this.getCellCtrls(e.rowNodes,e.columns))i.refreshOrDestroyCell(t);this.refreshFullWidth(e.rowNodes)}refreshFullWidth(e){if(!e)return;let t=null;this.stickyRowFeature&&Ld()&&(t=this.getCellToRestoreFocusToAfterRefresh()||null);for(const i of this.getRowCtrls(e)){if(!i.isFullWidth())continue;i.refreshFullWidth()||this.redrawRow(i.getRowNode(),!0)}this.dispatchDisplayedRowsChanged(!1),t&&this.restoreFocusedCell(t)}getCellRendererInstances(e){var n;const t=this.getCellCtrls(e.rowNodes,e.columns).map(o=>o.getCellRenderer()).filter(o=>o!=null);if((n=e.columns)!=null&&n.length)return t;const i=[],s=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(o=>{if(s&&!this.isRowInMap(o.getRowNode(),s)||!o.isFullWidth())return;const r=o.getFullWidthCellRenderers();for(let a=0;a<r.length;a++){const d=r[a];d!=null&&i.push(d)}}),[...i,...t]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>{const s=i.getCellEditor();s&&t.push(s)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(i=>{const s=i.id;switch(i.rowPinned){case"top":t.top[s]=i;break;case"bottom":t.bottom[s]=i;break;default:t.normal[s]=i;break}}),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return t.top[i]!=null;case"bottom":return t.bottom[i]!=null;default:return t.normal[i]!=null}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return!e||!t?i:i.filter(s=>{const n=s.getRowNode();return this.isRowInMap(n,t)})}getCellCtrls(e,t){let i;j(t)&&(i={},t.forEach(n=>{const o=this.columnModel.getCol(n);j(o)&&(i[o.getId()]=!0)}));const s=[];return this.getRowCtrls(e).forEach(n=>{n.getAllCellCtrls().forEach(o=>{const r=o.getColumn().getId();i&&!i[r]||s.push(o)})}),s}destroy(){this.removeAllRowComps(!0),super.destroy()}removeAllRowComps(e=!1){const t=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(t,e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];ni(this.rowCtrlsByRowIndex,(i,s)=>{s.getRowNode().id==null&&e.push(i)}),this.removeRowCtrls(e);const t={};return ni(this.rowCtrlsByRowIndex,(i,s)=>{const n=s.getRowNode();t[n.id]=s}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(i=>{const s=this.rowCtrlsByRowIndex[i];s&&(s.destroyFirstPass(t),s.destroySecondPass()),delete this.rowCtrlsByRowIndex[i]})}onBodyScroll(e){e.direction==="vertical"&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&Ld()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,n=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let o=!1;if(this.stickyRowFeature){o=this.stickyRowFeature.checkStickyRows();const a=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();a&&this.updateContainerHeights(a)}const r=this.firstRenderedRow!==s||this.lastRenderedRow!==n;if(!(t&&!o&&!r)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!o),i!=null)){const a=this.getCellToRestoreFocusToAfterRefresh();i!=null&&a==null&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(o=>i[o]=!0);const n=Object.keys(this.rowCtrlsByRowIndex).filter(o=>!i[o]);this.removeRowCtrls(n,t)}calculateIndexesToDraw(e){const t=RM(this.firstRenderedRow,this.lastRenderedRow),i=(n,o)=>{const r=o.getRowNode().rowIndex;r!=null&&(r<this.firstRenderedRow||r>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(o)&&t.push(r)};ni(this.rowCtrlsByRowIndex,i),ni(e,i),t.sort((n,o)=>n-o);const s=[];for(let n=0;n<t.length;n++){const o=t[n],r=this.rowModel.getRow(o);r&&!r.sticky&&s.push(o)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t),s.forEach(n=>{this.createOrUpdateRowCtrl(n,e,t,i)}),e&&(i&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){this.eventService.dispatchEvent({type:"displayedRowsChanged",afterScroll:e})}onDisplayedColumnsChanged(){const e=this.visibleColsService.isPinningLeft(),t=this.visibleColsService.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(i=>{if(!i.isFullWidth())return!1;const s=i.getRowNode();return!(t!=null&&!this.isRowInMap(s,t))})}createOrUpdateRowCtrl(e,t,i,s){let n,o=this.rowCtrlsByRowIndex[e];if(o||(n=this.rowModel.getRow(e),j(n)&&j(t)&&t[n.id]&&n.alreadyRendered&&(o=t[n.id],t[n.id]=null)),!o)if(n||(n=this.rowModel.getRow(e)),j(n))o=this.createRowCon(n,i,s);else return;return n&&(n.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=o,o}destroyRowCtrls(e,t){const i=[];ni(e,(s,n)=>{if(n){if(this.cachedRowCtrls&&n.isCacheable()){this.cachedRowCtrls.addRow(n);return}if(n.destroyFirstPass(!t),t){const o=n.instanceId;this.zombieRowCtrls[o]=n,i.push(()=>{n.destroySecondPass(),delete this.zombieRowCtrls[o]})}else n.destroySecondPass()}}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),WD(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){const e=this.getRowBuffer(),t=on(this.gos);return e*t}workOutFirstAndLastRowsToRender(){this.rowContainerHeightService.updateOffset();let e,t;if(!this.rowModel.isRowsToRender())e=0,t=-1;else if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.pageBoundsService.getFirstRow(),t=this.pageBoundsService.getLastRow();else{const a=this.getRowBufferInPixels(),d=this.ctrlsService.getGridBodyCtrl(),h=this.gos.get("suppressRowVirtualisation");let g=!1,f,C;do{const x=this.pageBoundsService.getPixelOffset(),{pageFirstPixel:P,pageLastPixel:T}=this.pageBoundsService.getCurrentPagePixelRange(),I=this.rowContainerHeightService.getDivStretchOffset(),V=d.getScrollFeature().getVScrollPosition(),_=V.top,O=V.bottom;h?(f=P+I,C=T+I):(f=Math.max(_+x-a,P)+I,C=Math.min(O+x+a,T)+I),this.firstVisibleVPixel=Math.max(_+x,P)+I,this.lastVisibleVPixel=Math.min(O+x,T)+I,g=this.ensureAllRowsInRangeHaveHeightsCalculated(f,C)}while(g);let v=this.rowModel.getRowIndexAtPixel(f),S=this.rowModel.getRowIndexAtPixel(C);const R=this.pageBoundsService.getFirstRow(),y=this.pageBoundsService.getLastRow();v<R&&(v=R),S>y&&(S=y),e=v,t=S}const i=ht(this.gos,"normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),n=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>n&&(t=e+n);const o=e!==this.firstRenderedRow,r=t!==this.lastRenderedRow;(o||r)&&(this.firstRenderedRow=e,this.lastRenderedRow=t,this.eventService.dispatchEvent({type:"viewportChanged",firstRow:e,lastRow:t}))}dispatchFirstDataRenderedEvent(){this.dataFirstRenderedFired||(this.dataFirstRenderedFired=!0,window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent({type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow})}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){var o,r;const i=(o=this.pinnedRowModel)==null?void 0:o.ensureRowHeightsValid(),s=(r=this.stickyRowFeature)==null?void 0:r.ensureRowHeightsValid(),n=this.rowModel.ensureRowHeightsValid(e,t,this.pageBoundsService.getFirstRow(),this.pageBoundsService.getLastRow());return(n||s)&&this.eventService.dispatchEvent({type:"recalculateRowBounds"}),s||n||i?(this.updateContainerHeights(),!0):!1}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const s=e.getRowNode(),n=this.focusService.isRowNodeFocused(s),o=e.isEditing(),r=s.detail;return n||o||r?!!this.isRowPresent(s):!1}isRowPresent(e){return this.rowModel.isRowPresent(e)?this.paginationService?this.paginationService.isRowPresent(e):!0:!1}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const n=this.gos.get("suppressAnimationFrame"),o=i&&!n&&!this.printLayout;return new gn(e,this.beans,t,o,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map(t=>t.getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null,t||(t=this.getStickyBottomRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null));break}return t}isRangeInRenderedViewport(e,t){if(e==null||t==null)return!1;const s=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!s}},NL=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const t=this.entriesList[0];t.destroyFirstPass(),t.destroySecondPass(),this.removeFromCache(t)}}getRow(e){if(e==null||e.id==null)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return this.entriesMap[e.id]!=null}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],wt(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],wt(this.entriesList,e)}getEntries(){return this.entriesList}},BL=class extends B{constructor(){super(...arguments),this.beanName="pinnedRowModel",this.nextId=0,this.pinnedTopRows=new om,this.pinnedBottomRows=new om}wireBeans(e){this.beans=e}postConstruct(){this.setPinnedRowData(this.gos.get("pinnedTopRowData"),"top"),this.setPinnedRowData(this.gos.get("pinnedBottomRowData"),"bottom"),this.addManagedPropertyListener("pinnedTopRowData",e=>this.setPinnedRowData(e.currentValue,"top")),this.addManagedPropertyListener("pinnedBottomRowData",e=>this.setPinnedRowData(e.currentValue,"bottom")),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanges.bind(this)})}isEmpty(e){return(e==="top"?this.pinnedTopRows:this.pinnedBottomRows).isEmpty()}isRowsToRender(e){return!this.isEmpty(e)}onGridStylesChanges(e){if(e.rowHeightChanged){const t=i=>{i.setRowHeight(i.rowHeight,!0)};this.pinnedBottomRows.forEach(t),this.pinnedTopRows.forEach(t)}}ensureRowHeightsValid(){var s,n;let e=!1,t=0;const i=o=>{if(o.rowHeightEstimated){const r=Ps(this.gos,o);o.setRowTop(t),o.setRowHeight(r.height),t+=r.height,e=!0}};return(s=this.pinnedBottomRows)==null||s.forEach(i),t=0,(n=this.pinnedTopRows)==null||n.forEach(i),this.eventService.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedRowData(e,t){this.updateNodesFromRowData(e,t),this.eventService.dispatchEvent({type:"pinnedRowDataChanged"})}updateNodesFromRowData(e,t){const i=t==="top"?this.pinnedTopRows:this.pinnedBottomRows;if(e===void 0){i.clear();return}const s=Wn(this.gos),n=t==="top"?ns.ID_PREFIX_TOP_PINNED:ns.ID_PREFIX_BOTTOM_PINNED,o=i.getIds(),r=[],a=new Set;let d=0,h=-1;for(const g of e){const f=(s==null?void 0:s({data:g,level:0,rowPinned:t}))??n+this.nextId++;if(a.has(f)){W("Duplicate ID",f,"found for pinned row with data",g,"When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter.");continue}h++,a.add(f),r.push(f);const C=i.getById(f);if(C!==void 0)C.data!==g&&C.setData(g),d+=this.setRowTopAndRowIndex(C,d,h),o.delete(f);else{const v=new ns(this.beans);v.id=f,v.data=g,v.rowPinned=t,d+=this.setRowTopAndRowIndex(v,d,h),i.push(v)}}o.forEach(g=>{var f;(f=i.getById(g))==null||f.clearRowTopAndRowIndex()}),i.removeAllById(o),i.setOrder(r)}setRowTopAndRowIndex(e,t,i){return e.setRowTop(t),e.setRowHeight(Ps(this.gos,e).height),e.setRowIndex(i),e.rowHeight}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getPinnedTopRowCount(){return this.pinnedTopRows.getSize()}getPinnedBottomRowCount(){return this.pinnedBottomRows.getSize()}getPinnedTopRow(e){return this.pinnedTopRows.getByIndex(e)}getPinnedBottomRow(e){return this.pinnedBottomRows.getByIndex(e)}getPinnedRowById(e,t){return t==="top"?this.pinnedTopRows.getById(e):this.pinnedBottomRows.getById(e)}forEachPinnedRow(e,t){return e==="top"?this.pinnedTopRows.forEach(t):this.pinnedBottomRows.forEach(t)}getTotalHeight(e){const t=e.getSize();if(t===0)return 0;const i=e.getByIndex(t-1);return i===void 0?0:i.rowTop+i.rowHeight}},om=class{constructor(){this.cache={},this.ordering=[]}getById(e){return this.cache[e]}getByIndex(e){const t=this.ordering[e];return this.cache[t]}push(e){this.cache[e.id]=e,this.ordering.push(e.id)}removeAllById(e){for(const t of e)delete this.cache[t];this.ordering=this.ordering.filter(t=>!e.has(t))}setOrder(e){this.ordering=e}forEach(e){this.ordering.forEach((t,i)=>{const s=this.cache[t];s&&e(s,i)})}clear(){this.ordering.length=0,this.cache={}}isEmpty(){return this.ordering.length===0}getSize(){return this.ordering.length}getIds(){return new Set(this.ordering)}},GL=class extends B{constructor(e){super(),this.state="needsLoading",this.version=0,this.id=e}getId(){return this.id}load(){this.state="loading",this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed",this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(e,t){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:"loadComplete",success:e,block:this};this.dispatchLocalEvent(t)}},HL=class extends B{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Pt(this.performCheckBlocksToLoad.bind(this),e))}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");if(e==null)return 2;if(!(e<=0))return e}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){wt(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchLocalEvent({type:"blockLoaded"}),this.activeBlockLoadsCount==0&&this.dispatchLocalEvent({type:"blockLoaderFinished"})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.gos.get("debug")&&si("RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.getAvailableLoadingCount(),t=this.blocks.filter(i=>i.getState()==="needsLoading").slice(0,e);this.registerLoads(t.length),t.forEach(i=>i.load()),this.printCacheStatus()}getBlockState(){if(Yi(this.gos))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.gos.get("debug")&&si(`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return this.maxConcurrentRequests!==void 0?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}},WL={version:ge,moduleName:"@ag-grid-community/row-node-block",beans:[HL]},zL=class{constructor(){this.root=null,this.end=null,this.cachedRange=[]}init(e){this.rowModel=e}reset(){this.root=null,this.end=null,this.cachedRange.length=0}setRoot(e){this.root=e,this.end=null,this.cachedRange.length=0}setEndRange(e){this.end=e,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){const e=this.getRoot(),t=this.getEnd();if(e==null||t==null)return this.cachedRange;this.cachedRange=this.rowModel.getNodesInRangeForSelection(e,t)}return this.cachedRange}isInRange(e){return this.root===null?!1:this.getRange().some(t=>t.id===e.id)}getRoot(){var e;return this.root&&((e=this.root)==null?void 0:e.key)===null&&(this.root=this.rowModel.getRowNode(this.root.id)??null),this.root}getEnd(){var e;return this.end&&((e=this.end)==null?void 0:e.key)===null&&(this.end=this.rowModel.getRowNode(this.end.id)??null),this.end}truncate(e){const t=this.getRange();if(t.length===0)return{keep:[],discard:[]};const i=t[0].id===this.root.id,s=t.findIndex(n=>n.id===e.id);if(s>-1){const n=t.slice(0,s),o=t.slice(s+1);return this.setEndRange(e),i?{keep:n,discard:o}:{keep:o,discard:n}}else return{keep:t,discard:[]}}extend(e,t=!1){const i=this.getRoot();if(i==null){const n=this.getRange().slice();return t&&e.depthFirstSearch(o=>!o.group&&n.push(o)),n.push(e),this.setRoot(e),{keep:n,discard:[]}}if(this.rowModel.getNodesInRangeForSelection(i,e).find(n=>{var o;return n.id===((o=this.end)==null?void 0:o.id)}))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const n=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:n}}}},UL=class extends B{constructor(){super(...arguments),this.beanName="stylingService"}wireBeans(e){this.expressionService=e.expressionService}processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,n){if(t==null&&e==null)return;const o={},r={},a=(d,h)=>{d.split(" ").forEach(g=>{g.trim()!=""&&h(g)})};if(t){const d=Object.keys(t);for(let h=0;h<d.length;h++){const g=d[h],f=t[g];let C;typeof f=="string"?C=this.expressionService.evaluate(f,i):typeof f=="function"&&(C=f(i)),a(g,v=>{C?o[v]=!0:r[v]=!0})}}e&&n&&Object.keys(e).forEach(d=>a(d,h=>{o[h]||(r[h]=!0)})),n&&Object.keys(r).forEach(n),Object.keys(o).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;return typeof i=="function"?s=i(t):s=i,typeof s=="string"&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(n=>{i(n)})}},$L=class extends B{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:n,forceFocusOutWhenTabGuardsAreEmpty:o,isFocusableContainer:r,focusInnerElement:a,onFocusIn:d,onFocusOut:h,shouldStopEventPropagation:g,onTabKeyDown:f,handleKeyDown:C,eFocusableElement:v}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=a,this.eFocusableElement=v,this.focusTrapActive=!!n,this.forceFocusOutWhenTabGuardsAreEmpty=!!o,this.isFocusableContainer=!!r,this.providedFocusIn=d,this.providedFocusOut=h,this.providedShouldStopEventPropagation=g,this.providedOnTabKeyDown=f,this.providedHandleKeyDown=C}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.createManagedBean(new hn(this.eFocusableElement,{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(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)}))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){var d;const t=Xe(this.gos),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(s===-1)return;let n,o;e?(n=0,o=s):(n=s+1,o=i.length);const r=i.slice(n,o),a=this.gos.get("tabIndex");r.sort((h,g)=>{const f=parseInt(h.getAttribute("tabindex")||"0"),C=parseInt(g.getAttribute("tabindex")||"0");return C===a?1:f===a?-1:f===0?1:C===0?-1:f-C}),(d=r[e?r.length-1:0])==null||d.focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(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}},KL=class extends B{constructor(e){super(),this.comp=e}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:i,eFocusableElement:s}=this,n=[t,i],o={setTabIndex:R=>{n.forEach(y=>R!=null?y.setAttribute("tabindex",R):y.removeAttribute("tabindex"))}};this.addTabGuards(t,i);const{focusTrapActive:r=!1,onFocusIn:a,onFocusOut:d,focusInnerElement:h,handleKeyDown:g,onTabKeyDown:f,shouldStopEventPropagation:C,forceFocusOutWhenTabGuardsAreEmpty:v,isFocusableContainer:S}=e;this.tabGuardCtrl=this.createManagedBean(new $L({comp:o,focusTrapActive:r,eTopGuard:t,eBottomGuard:i,eFocusableElement:s,onFocusIn:a,onFocusOut:d,focusInnerElement:h,handleKeyDown:g,onTabKeyDown:f,shouldStopEventPropagation:C,forceFocusOutWhenTabGuardsAreEmpty:v,isFocusableContainer:S}))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=Xe(this.gos).createElement("div"),i=e==="top"?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),Vt(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];yt(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,i){Wl(t)||(t=t.getGui());const{eBottomGuard:s}=this;s?s.insertAdjacentElement("beforebegin",t):e(t,i)}},rm=class extends Pe{initialiseTabGuard(e){this.tabGuardFeature=this.createManagedBean(new KL(this)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},jL=0,ZL=200,qL=class extends B{constructor(){super(...arguments),this.beanName="popupService",this.popupList=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.resizeObserverService=e.resizeObserverService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);if(s!==-1){const v=this.popupList[s];v.alignedToElement=t}const n=t.getBoundingClientRect(),o=this.getParentRect(),r=this.keepXYWithinBounds(i,n.top-o.top,0),a=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${a}px`;const h=o.right-o.left-a;let g;this.gos.get("enableRtl")?(g=C(),g<0&&(g=f(),this.setAlignedStyles(i,"left")),g>h&&(g=0,this.setAlignedStyles(i,"right"))):(g=f(),g>h&&(g=C(),this.setAlignedStyles(i,"right")),g<0&&(g=0,this.setAlignedStyles(i,"left"))),i.style.left=`${g}px`,i.style.top=`${r}px`;function f(){return n.right-o.left-2}function C(){return n.left-o.left-a}}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:n}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:n,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:n,eventSource:o,alignSide:r="left",position:a="over",column:d,rowNode:h,type:g}=e,f=o.getBoundingClientRect(),C=this.getParentRect(),v=this.getPopupIndex(t);if(v!==-1){const R=this.popupList[v];R.alignedToElement=o}const S=()=>{let R=f.left-C.left;r==="right"&&(R-=t.offsetWidth-f.width);let y;return a==="over"?(y=f.top-C.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),this.shouldRenderUnderOrAbove(t,f,C,e.nudgeY||0)==="under"?y=f.top-C.top+f.height:y=f.top-t.offsetHeight-(s||0)*2-C.top),{x:R,y}};this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:n,updatePosition:S,postProcessCallback:()=>this.callPostProcessPopup(g,t,o,null,d,h)})}shouldRenderUnderOrAbove(e,t,i,s){const n=i.bottom-t.bottom,o=t.top-i.top,r=e.offsetHeight+s;return n>r?"under":o>r||o>n?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i],{alignedToElement:n}=s;!n||(["right","left","over","above","under"].forEach(r=>{n.classList.remove(`ag-has-popup-positioned-${r}`),e.classList.remove(`ag-popup-positioned-${r}`)}),!t)||(n.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,i,s,n,o){const r=this.gos.getCallback("postProcessPopup");r&&r({column:n,rowNode:o,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:n,skipObserver:o,updatePosition:r}=e,a={width:0,height:0},d=(h=!1)=>{let{x:g,y:f}=r();h&&t.clientWidth===a.width&&t.clientHeight===a.height||(a.width=t.clientWidth,a.height=t.clientHeight,s&&(g+=s),n&&(f+=n),i&&(g=this.keepXYWithinBounds(t,g,1),f=this.keepXYWithinBounds(t,f,0)),t.style.left=`${g}px`,t.style.top=`${f}px`,e.postProcessCallback&&e.postProcessCallback())};if(d(),!o){const h=this.resizeObserverService.observeResize(t,()=>d(!0));setTimeout(()=>h(),ZL)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=Xe(this.gos);let t=this.getPopupParent();return t===e.body?t=e.documentElement:getComputedStyle(t).position==="static"&&(t=t.offsetParent),jg(t)}keepXYWithinBounds(e,t,i){const s=i===0,n=s?"clientHeight":"clientWidth",o=s?"top":"left",r=s?"height":"width",a=s?"scrollTop":"scrollLeft",d=Xe(this.gos),h=d.documentElement,g=this.getPopupParent(),f=e.getBoundingClientRect(),C=g.getBoundingClientRect(),v=d.documentElement.getBoundingClientRect(),S=g===d.body,R=Math.ceil(f[r]);let x=S?(s?Kg:Vl)(h)+h[a]:g[n];S&&(x-=Math.abs(v[o]-C[o]));const P=x-R;return Math.min(Math.max(t,0),Math.abs(P))}addPopup(e){const t=Xe(this.gos),{eChild:i,ariaLabel:s,alwaysOnTop:n,positionCallback:o,anchorToElement:r}=e;if(!t)return W("could not find the document, document is empty"),{hideFunc:()=>{}};const a=this.getPopupIndex(i);if(a!==-1)return{hideFunc:this.popupList[a].hideFunc};this.initialisePopupPosition(i);const d=this.createPopupWrapper(i,s,!!n),h=this.addEventListenersToPopup({...e,wrapperEl:d});return o&&o(),this.addPopupToPopupList(i,d,h,r),{hideFunc:h}}initialisePopupPosition(e){const i=this.getPopupParent().getBoundingClientRect();j(e.style.top)||(e.style.top=`${i.top*-1}px`),j(e.style.left)||(e.style.left=`${i.left*-1}px`)}createPopupWrapper(e,t,i){const s=this.getPopupParent(),n=document.createElement("div");return this.environment.applyThemeClasses(n),n.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||Vt(e,"dialog"),Kn(e,t),n.appendChild(e),s.appendChild(n),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),n}handleThemeChange(e){if(e.themeChanged)for(const t of this.popupList)this.environment.applyThemeClasses(t.wrapper)}addEventListenersToPopup(e){const t=Xe(this.gos),i=this.getPopupParent(),{wrapperEl:s,eChild:n,closedCallback:o,afterGuiAttached:r,closeOnEsc:a,modal:d}=e;let h=!1;const g=S=>{if(!s.contains(Ke(this.gos)))return;S.key===N.ESCAPE&&!Xi(S)&&v({keyboardEvent:S})},f=S=>v({mouseEvent:S}),C=S=>v({touchEvent:S}),v=(S={})=>{const{mouseEvent:R,touchEvent:y,keyboardEvent:x,forceHide:P}=S;!P&&(this.isEventFromCurrentPopup({mouseEvent:R,touchEvent:y},n)||h)||(h=!0,i.removeChild(s),t.removeEventListener("keydown",g),t.removeEventListener("mousedown",f),t.removeEventListener("touchstart",C),t.removeEventListener("contextmenu",f),this.eventService.removeEventListener("dragStarted",f),o&&o(R||y||x),this.removePopupFromPopupList(n))};return r&&r({hidePopup:v}),window.setTimeout(()=>{a&&t.addEventListener("keydown",g),d&&(t.addEventListener("mousedown",f),this.eventService.addEventListener("dragStarted",f),t.addEventListener("touchstart",C),t.addEventListener("contextmenu",f))},0),v}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:jL++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(o=>o&&o()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const n=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=n,s.isAnchored=!0,n}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:n}=e,o=s.getBoundingClientRect(),r=f=>parseInt(f.substring(0,f.length-1),10),a=(f,C)=>{const v=i[f]-o[f],S=r(n.style[f]);return{initialDiff:v,lastDiff:v,initial:S,last:S,direction:C}},d=a("top",0),h=a("left",1),g=this.getFrameworkOverrides();return new Zt(f=>{g.wrapIncoming(()=>{g.setInterval(()=>{const C=t.getBoundingClientRect(),v=s.getBoundingClientRect();if(v.top==0&&v.left==0&&v.height==0&&v.width==0){e.hidePopup();return}const R=(y,x)=>{const P=r(n.style[x]);y.last!==P&&(y.initial=P,y.last=P);const T=C[x]-v[x];if(T!=y.lastDiff){const I=this.keepXYWithinBounds(n,y.initial+y.initialDiff-T,y.direction);n.style[x]=`${I}px`,y.last=I}y.lastDiff=T};R(d,"top"),R(h,"left")},200).then(C=>{f(()=>{C!=null&&window.clearInterval(C)})})},"popupPositioning")})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,n=i||s;if(!n)return!1;const o=this.getPopupIndex(t);if(o===-1)return!1;for(let r=o;r<this.popupList.length;r++){const a=this.popupList[r];if(rT(a.element,n))return!0}return this.isElementWithinCustomPopup(n.target)}isElementWithinCustomPopup(e){const t=Xe(this.gos);for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||e.parentElement===null)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,n=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),o=n.length,r=this.getWrapper(e);if(!r||s<=1||!t.contains(e))return!1;const a=i.indexOf(r),d=r.querySelectorAll("div"),h=[];d.forEach(f=>{f.scrollTop!==0&&h.push([f,f.scrollTop])});let g=!1;for(o?r.classList.contains("ag-always-on-top")?a!==s-1&&(ce(n).insertAdjacentElement("afterend",r),g=!0):a!==s-o-1&&(n[0].insertAdjacentElement("beforebegin",r),g=!0):a!==s-1&&(ce(i).insertAdjacentElement("afterend",r),g=!0);h.length;){const f=h.pop();f[0].scrollTop=f[1]}return g}},YL=["touchstart","touchend","touchmove","touchcancel"],lm=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=t=>t(),this.wrapOutgoing=t=>t()}setInterval(e,t){return new Zt(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const n=Qi(YL,t);e.addEventListener(t,i,{capture:!!s,passive:n})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${this.frameworkName==="solid"?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},QL=class extends B{constructor(){super(...arguments),this.beanName="cellNavigationService"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.pinnedRowModel=e.pinnedRowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===N.UP,s=e===N.DOWN,n=e===N.LEFT;let o,r;if(i||s)r=i?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow(),o=t.column;else{const a=this.visibleColsService.getAllCols(),d=this.gos.get("enableRtl");r=t.rowIndex,o=n!==d?a[0]:ce(a)}return{rowIndex:r,rowPinned:null,column:o}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case N.UP:i=this.getCellAbove(i);break;case N.DOWN:i=this.getCellBelow(i);break;case N.RIGHT:this.gos.get("enableRtl")?i=this.getCellToLeft(i):i=this.getCellToRight(i);break;case N.LEFT:this.gos.get("enableRtl")?i=this.getCellToRight(i):i=this.getCellToLeft(i);break;default:i=null,W("unknown key for navigation ",e);break}i?s=this.isCellGoodToFocusOn(i):s=!0}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex);break}return i?!t.isSuppressNavigable(i):!1}getCellToLeft(e){if(!e)return null;const t=this.visibleColsService.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.visibleColsService.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;let s=!1;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.pageBoundsService.getFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}else i&&(s=!0);const n=this.rowModel.getRow(e.rowIndex),o=s?void 0:this.getNextStickyPosition(n);return o||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!xl(this.gos)||!e||!e.sticky)return;const i=this.rowRenderer.getStickyTopRowCtrls().some(a=>a.getRowNode().rowIndex===e.rowIndex);let s=[];i?s=[...this.rowRenderer.getStickyTopRowCtrls()].sort((a,d)=>a.getRowNode().rowIndex-d.getRowNode().rowIndex):s=[...this.rowRenderer.getStickyBottomRowCtrls()].sort((a,d)=>d.getRowNode().rowIndex-a.getRowNode().rowIndex);const n=t?-1:1,o=s.findIndex(a=>a.getRowNode().rowIndex===e.rowIndex),r=s[o+n];if(r)return{rowIndex:r.getRowNode().rowIndex,rowPinned:null}}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return t==="top"?this.pinnedRowModel.getPinnedTopRowCount()-1<=i:t==="bottom"?this.pinnedRowModel.getPinnedBottomRowCount()-1<=i:this.pageBoundsService.getLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned,s=i?t===0:t===this.pageBoundsService.getFirstRow();let n=!1;if(s)return i==="top"?null:i?this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null:this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;i&&(n=!0);const o=this.rowModel.getRow(e.rowIndex),r=n?void 0:this.getNextStickyPosition(o,!0);return r||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.pageBoundsService.getLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowCount()-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){var o;const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,n=this.visibleColsService.getColAfter(e.column);if(!n){n=t[0];const r=this.getRowBelow(e);if(ke(r)||!r.rowPinned&&!(((o=this.paginationService)==null?void 0:o.isRowInPage(r))??!0))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:n,rowPinned:s}}getNextTabbedCellBackwards(e){var o;const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,n=this.visibleColsService.getColBefore(e.column);if(!n){n=ce(t);const r=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(ke(r)||!r.rowPinned&&!(((o=this.paginationService)==null?void 0:o.isRowInPage(r))??!0))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:n,rowPinned:s}}},At=(e,t)=>{for(const i in t)t[i]=e;return t},am={...At("@ag-grid-community/core",{dispatchEvent:0,destroy:0,getGridId:0,getGridOption:0,isDestroyed:0,setGridOption:0,updateGridOptions:0,getState:0,setNodesSelected:0,selectAll:0,deselectAll:0,selectAllFiltered:0,deselectAllFiltered:0,selectAllOnCurrentPage:0,deselectAllOnCurrentPage:0,getSelectedNodes:0,getSelectedRows:0,redrawRows:0,setRowNodeExpanded:0,getRowNode:0,addRenderedRowListener:0,getRenderedNodes:0,forEachNode:0,getFirstDisplayedRow:0,getFirstDisplayedRowIndex:0,getLastDisplayedRow:0,getLastDisplayedRowIndex:0,getDisplayedRowAtIndex:0,getDisplayedRowCount:0,getModel:0,getVerticalPixelRange:0,getHorizontalPixelRange:0,ensureColumnVisible:0,ensureIndexVisible:0,ensureNodeVisible:0,getFocusedCell:0,clearFocusedCell:0,setFocusedCell:0,tabToNextCell:0,tabToPreviousCell:0,setFocusedHeader:0,addEventListener:0,addGlobalListener:0,removeEventListener:0,removeGlobalListener:0,expireValueCache:0,getValue:0,getCellValue:0,showColumnMenuAfterButtonClick:0,showColumnMenuAfterMouseClick:0,showColumnMenu:0,hidePopupMenu:0,onSortChanged:0,getPinnedTopRowCount:0,getPinnedBottomRowCount:0,getPinnedTopRow:0,getPinnedBottomRow:0,showLoadingOverlay:0,showNoRowsOverlay:0,hideOverlay:0,setGridAriaProperty:0,refreshCells:0,flashCells:0,refreshHeader:0,isAnimationFrameQueueEmpty:0,flushAllAnimationFrames:0,getSizesForCurrentTheme:0,getCellRendererInstances:0,addRowDropZone:0,removeRowDropZone:0,getRowDropZoneParams:0,getColumnDef:0,getColumnDefs:0,sizeColumnsToFit:0,setColumnGroupOpened:0,getColumnGroup:0,getProvidedColumnGroup:0,getDisplayNameForColumn:0,getDisplayNameForColumnGroup:0,getColumn:0,getColumns:0,applyColumnState:0,getColumnState:0,resetColumnState:0,getColumnGroupState:0,setColumnGroupState:0,resetColumnGroupState:0,isPinning:0,isPinningLeft:0,isPinningRight:0,getDisplayedColAfter:0,getDisplayedColBefore:0,setColumnVisible:0,setColumnsVisible:0,setColumnPinned:0,setColumnsPinned:0,getAllGridColumns:0,getDisplayedLeftColumns:0,getDisplayedCenterColumns:0,getDisplayedRightColumns:0,getAllDisplayedColumns:0,getAllDisplayedVirtualColumns:0,moveColumn:0,moveColumnByIndex:0,moveColumns:0,setColumnWidth:0,setColumnWidths:0,getLeftDisplayedColumnGroups:0,getCenterDisplayedColumnGroups:0,getRightDisplayedColumnGroups:0,getAllDisplayedColumnGroups:0,autoSizeColumn:0,autoSizeColumns:0,autoSizeAllColumns:0,undoCellEditing:0,redoCellEditing:0,getCellEditorInstances:0,getEditingCells:0,stopEditing:0,startEditingCell:0,getCurrentUndoSize:0,getCurrentRedoSize:0,isAnyFilterPresent:0,onFilterChanged:0,isColumnFilterPresent:0,getFilterInstance:0,getColumnFilterInstance:0,destroyFilter:0,setFilterModel:0,getFilterModel:0,getColumnFilterModel:0,setColumnFilterModel:0,showColumnFilter:0,isQuickFilterPresent:0,getQuickFilter:0,resetQuickFilter:0,paginationIsLastPageFound:0,paginationGetPageSize:0,paginationGetCurrentPage:0,paginationGetTotalPages:0,paginationGetRowCount:0,paginationGoToNextPage:0,paginationGoToPreviousPage:0,paginationGoToFirstPage:0,paginationGoToLastPage:0,paginationGoToPage:0,expandAll:0,collapseAll:0,onRowHeightChanged:0,setRowCount:0,getCacheBlockState:0,isLastRowIndexKnown:0}),...At("@ag-grid-community/client-side-row-model",{onGroupExpandedOrCollapsed:0,refreshClientSideRowModel:0,isRowDataEmpty:0,forEachLeafNode:0,forEachNodeAfterFilter:0,forEachNodeAfterFilterAndSort:0,resetRowHeights:0,applyTransaction:0,applyTransactionAsync:0,flushAsyncTransactions:0,getBestCostNodeSelection:0}),...At("@ag-grid-community/csv-export",{getDataAsCsv:0,exportDataAsCsv:0}),...At("@ag-grid-community/infinite-row-model",{refreshInfiniteCache:0,purgeInfiniteCache:0,getInfiniteRowCount:0}),...At("@ag-grid-enterprise/advanced-filter",{getAdvancedFilterModel:0,setAdvancedFilterModel:0,showAdvancedFilterBuilder:0,hideAdvancedFilterBuilder:0}),...At("@ag-grid-enterprise/charts",{getChartModels:0,getChartRef:0,getChartImageDataURL:0,downloadChart:0,openChartToolPanel:0,closeChartToolPanel:0,createRangeChart:0,createPivotChart:0,createCrossFilterChart:0,updateChart:0,restoreChart:0}),...At("@ag-grid-enterprise/clipboard",{copyToClipboard:0,cutToClipboard:0,copySelectedRowsToClipboard:0,copySelectedRangeToClipboard:0,copySelectedRangeDown:0,pasteFromClipboard:0}),...At("@ag-grid-enterprise/excel-export",{getDataAsExcel:0,exportDataAsExcel:0,getSheetDataForExcel:0,getMultipleSheetsAsExcel:0,exportMultipleSheetsAsExcel:0}),...At("@ag-grid-enterprise/master-detail",{addDetailGridInfo:0,removeDetailGridInfo:0,getDetailGridInfo:0,forEachDetailGridInfo:0}),...At("@ag-grid-enterprise/menu",{showContextMenu:0,showColumnChooser:0,hideColumnChooser:0}),...At("@ag-grid-enterprise/range-selection",{getCellRanges:0,addCellRange:0,clearRangeSelection:0,clearCellSelection:0}),...At("@ag-grid-enterprise/row-grouping",{addAggFunc:0,addAggFuncs:0,clearAggFuncs:0,setColumnAggFunc:0,isPivotMode:0,getPivotResultColumn:0,setValueColumns:0,getValueColumns:0,removeValueColumn:0,removeValueColumns:0,addValueColumn:0,addValueColumns:0,setRowGroupColumns:0,removeRowGroupColumn:0,removeRowGroupColumns:0,addRowGroupColumn:0,addRowGroupColumns:0,getRowGroupColumns:0,moveRowGroupColumn:0,setPivotColumns:0,removePivotColumn:0,removePivotColumns:0,addPivotColumn:0,addPivotColumns:0,getPivotColumns:0,setPivotResultColumns:0,getPivotResultColumns:0}),...At("@ag-grid-enterprise/server-side-row-model",{getServerSideSelectionState:0,setServerSideSelectionState:0,applyServerSideTransaction:0,applyServerSideTransactionAsync:0,applyServerSideRowData:0,retryServerSideLoads:0,flushServerSideAsyncTransactions:0,refreshServerSide:0,getServerSideGroupLevelState:0}),...At("@ag-grid-enterprise/side-bar",{isSideBarVisible:0,setSideBarVisible:0,setSideBarPosition:0,openToolPanel:0,closeToolPanel:0,getOpenedToolPanel:0,refreshToolPanel:0,isToolPanelShowing:0,getToolPanelInstance:0,getSideBar:0}),...At("@ag-grid-enterprise/status-bar",{getStatusPanel:0})},uu={isDestroyed:()=>!0,destroy(){},preConstruct(){},postConstruct(){},preWireBeans(){},wireBeans(){}},XL=(e,t)=>e.eventService.dispatchEvent(t),cm=class{};Reflect.defineProperty(cm,"name",{value:"GridApi"});var JL=class extends B{constructor(){super(),this.beanName="apiFunctionService",this.api=new cm,this.fns={...uu,dispatchEvent:XL},this.beans=null,this.preDestroyLink="";const{api:e}=this;for(const t in am)e[t]=this.makeApi(t)[t]}wireBeans(e){this.beans=e}postConstruct(){this.preDestroyLink=this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}addFunction(e,t){var n;const{fns:i,beans:s}=this;i!==uu&&(i[e]=((n=s==null?void 0:s.validationService)==null?void 0:n.validateApiFunction(e,t))??t)}makeApi(e){return{[e]:(...t)=>{const{beans:i,fns:{[e]:s}}=this;return s?s(i,...t):this.apiNotFound(e)}}}apiNotFound(e){const{beans:t,gos:i,preDestroyLink:s}=this;if(!t)W(`Grid API function ${e}() cannot be called as the grid has been destroyed.
174
+ Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.
175
+ To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${s}`);else{const n=am[e];i.assertModuleRegistered(n,`api.${e}`)&&W(`API function '${e}' not registered to module '${n}'`)}}destroy(){super.destroy(),this.fns=uu,this.beans=null}};function e_(e){return{beanName:"gridApi",bean:e.getBean("apiFunctionService").api}}var t_=class extends B{constructor(){super(...arguments),this.beanName="columnDefFactory"}buildColumnDefs(e,t,i){const s=[],n={};return e.forEach(o=>{const r=this.createDefFromColumn(o,t,i);let a=!0,d=r,h=o.getOriginalParent(),g=null;for(;h;){let f=null;if(h.isPadding()){h=h.getOriginalParent();continue}const C=n[h.getGroupId()];if(C){C.children.push(d),a=!1;break}if(f=this.createDefFromGroup(h),f&&(f.children=[d],n[f.groupId]=f,d=f,h=h.getOriginalParent()),h!=null&&g===h){a=!1;break}g=h}a&&s.push(d)}),s}createDefFromGroup(e){const t=Cd(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=Cd(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=e.isVisible()?void 0:!0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,s}},i_=class extends B{constructor(){super(...arguments),this.beanName="columnEventDispatcher"}visibleCols(e){this.eventService.dispatchEvent({type:"displayedColumnsChanged",source:e})}gridColumns(){this.eventService.dispatchEvent({type:"gridColumnsChanged"})}headerHeight(e){this.eventService.dispatchEvent({type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"})}groupHeaderHeight(e){this.eventService.dispatchEvent({type:"columnGroupHeaderHeightChanged",columnGroup:e,source:"autosizeColumnGroupHeaderHeight"})}groupOpened(e){this.eventService.dispatchEvent({type:"columnGroupOpened",columnGroup:e.length===1?e[0]:void 0,columnGroups:e})}rowGroupChanged(e,t){this.eventService.dispatchEvent({type:"columnRowGroupChanged",columns:e,column:e.length===1?e[0]:null,source:t})}genericColumnEvent(e,t,i){this.eventService.dispatchEvent({type:e,columns:t,column:t.length===1?t[0]:null,source:i})}pivotModeChanged(){this.eventService.dispatchEvent({type:"columnPivotModeChanged"})}virtualColumnsChanged(e){this.eventService.dispatchEvent({type:"virtualColumnsChanged",afterScroll:e})}newColumnsLoaded(e){this.eventService.dispatchEvent({type:"newColumnsLoaded",source:e})}everythingChanged(e){this.eventService.dispatchEvent({type:"columnEverythingChanged",source:e})}columnMoved(e){const{movedColumns:t,source:i,toIndex:s,finished:n}=e;this.eventService.dispatchEvent({type:"columnMoved",columns:t,column:t&&t.length===1?t[0]:null,toIndex:s,finished:n,source:i})}columnPinned(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,n=>n.getPinned());this.eventService.dispatchEvent({type:"columnPinned",pinned:s??null,columns:e,column:i,source:t})}columnVisible(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,n=>n.isVisible());this.eventService.dispatchEvent({type:"columnVisible",visible:s,columns:e,column:i,source:t})}getCommonValue(e,t){if(!e||e.length==0)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}columnChanged(e,t,i){this.eventService.dispatchEvent({type:e,columns:t,column:t&&t.length==1?t[0]:null,source:i})}columnResized(e,t,i,s=null){e&&e.length&&this.eventService.dispatchEvent({type:"columnResized",columns:e,column:e.length===1?e[0]:null,flexColumns:s,finished:t,source:i})}},s_=class extends B{constructor(){super(...arguments),this.beanName="columnGetStateService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService}getColumnState(){const e=this.columnModel.getColDefCols();if(ke(e)||!this.columnModel.isAlive())return[];const i=this.columnModel.getAllCols().map(s=>this.createStateItemFromColumn(s));return this.orderColumnStateList(i),i}createStateItemFromColumn(e){const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns(),s=e.isRowGroupActive()?t.indexOf(e):null,n=e.isPivotActive()?i.indexOf(e):null,o=e.isValueActive()?e.getAggFunc():null,r=e.getSort()!=null?e.getSort():null,a=e.getSortIndex()!=null?e.getSortIndex():null,d=e.getFlex()!=null&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:r,sortIndex:a,aggFunc:o,rowGroup:e.isRowGroupActive(),rowGroupIndex:s,pivot:e.isPivotActive(),pivotIndex:n,flex:d}}orderColumnStateList(e){const t=this.columnModel.getCols(),i=new Map(t.map((s,n)=>[s.getColId(),n]));e.sort((s,n)=>{const o=i.has(s.colId)?i.get(s.colId):-1,r=i.has(n.colId)?i.get(n.colId):-1;return o-r})}},n_=class extends B{constructor(){super(...arguments),this.beanName="columnGroupStateService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService}getColumnGroupState(){const e=[],t=this.columnModel.getColTree();return es(null,t,i=>{Dt(i)&&e.push({groupId:i.getGroupId(),open:i.isExpanded()})}),e}resetColumnGroupState(e){const t=this.columnModel.getColDefColTree();if(!t)return;const i=[];es(null,t,s=>{if(Dt(s)){const n=s.getColGroupDef(),o={groupId:s.getGroupId(),open:n?n.openByDefault:void 0};i.push(o)}}),this.setColumnGroupState(i,e)}setColumnGroupState(e,t){if(!this.columnModel.getColTree())return;this.columnAnimationService.start();const s=[];e.forEach(n=>{const o=n.groupId,r=n.open,a=this.columnModel.getProvidedColGroup(o);a&&a.isExpanded()!==r&&(a.setExpanded(r),s.push(a))}),this.visibleColsService.refresh(t,!0),s.length&&this.eventDispatcher.groupOpened(s),this.columnAnimationService.finish()}},o_=class extends B{constructor(){super(...arguments),this.beanName="columnViewportService",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={}}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}setScrollPosition(e,t,i=!1){const s=this.visibleColsService.isBodyWidthDirty();if(!(e===this.scrollWidth&&t===this.scrollPosition&&!s)){if(this.scrollWidth=e,this.scrollPosition=t,this.visibleColsService.setBodyWidthDirty(),this.gos.get("enableRtl")){const o=this.visibleColsService.getBodyContainerWidth();this.viewportLeft=o-this.scrollPosition-this.scrollWidth,this.viewportRight=o-this.scrollPosition}else this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition;this.columnModel.isReady()&&this.checkViewportColumns(i)}}getHeadersToRender(e,t){let i;switch(e){case"left":i=this.rowsOfHeadersToRenderLeft[t];break;case"right":i=this.rowsOfHeadersToRenderRight[t];break;default:i=this.rowsOfHeadersToRenderCenter[t];break}return i||[]}extractViewportColumns(){const e=this.visibleColsService.getCenterCols();this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()||this.isAnyParentAutoHeaderHeight(e)?!0:this.isColumnInRowViewport(e)}isAnyParentAutoHeaderHeight(e){for(;e;){if(e.isAutoHeaderHeight())return!0;e=e.getParent()}return!1}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,n=this.viewportRight+200,o=t<s&&i<s,r=t>n&&i>n;return!o&&!r}getViewportColumns(){const e=this.visibleColsService.getLeftCols(),t=this.visibleColsService.getRightCols();return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.columnModel.isColSpanActive())return this.colsWithinViewport;const t=n=>{const o=n.getLeft();return j(o)&&o>this.viewportLeft},i=this.isColumnVirtualisationSuppressed()?void 0:this.isColumnInRowViewport.bind(this),s=this.visibleColsService.getColsCenter();return this.visibleColsService.getColsForRow(e,s,i,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventDispatcher.virtualColumnsChanged(e)}calculateHeaderRows(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={};const e={},t=this.visibleColsService.getLeftCols(),i=this.visibleColsService.getRightCols();this.headerColsWithinViewport.concat(t).concat(i).forEach(o=>e[o.getId()]=!0);const n=(o,r,a)=>{let d=!1;for(let h=0;h<o.length;h++){const g=o[h];let f=!1;if(As(g))f=e[g.getId()]===!0;else{const v=g.getDisplayedChildren();v&&(f=n(v,r,a+1))}f&&(d=!0,r[a]||(r[a]=[]),r[a].push(g))}return d};n(this.visibleColsService.getTreeLeft(),this.rowsOfHeadersToRenderLeft,0),n(this.visibleColsService.getTreeRight(),this.rowsOfHeadersToRenderRight,0),n(this.visibleColsService.getTreeCenter(),this.rowsOfHeadersToRenderCenter,0)}extractViewport(){const e=s=>`${s.getId()}-${s.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),i=this.colsWithinViewportHash!==t;return i&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),i}},r_=class extends B{constructor(){super(...arguments),this.beanName="agComponentUtils"}wireBeans(e){this.componentMetadataProvider=e.componentMetadataProvider}adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){class t{refresh(){return!1}getGui(){return this.eGui}init(s){const n=e(s),o=typeof n;if(o==="string"||o==="number"||o==="boolean"){this.eGui=is("<span>"+n+"</span>");return}if(n==null){this.eGui=is("<span></span>");return}this.eGui=n}}return t}doesImplementIComponent(e){return e?e.prototype&&"getGui"in e.prototype:!1}},l_=class extends B{constructor(){super(...arguments),this.beanName="componentMetadataProvider"}wireBeans(e){this.agComponentUtils=e.agComponentUtils}postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},dragAndDropImageComponent:{mandatoryMethodList:["setIcon","setLabel"],optionalMethodList:[]},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}},a_=["rowPositionUtils","cellPositionUtils","headerPositionUtils","paginationAutoPageSizeService","apiFunctionService","gridApi","userComponentRegistry","agComponentUtils","componentMetadataProvider","resizeObserverService","userComponentFactory","rowContainerHeightService","horizontalResizeService","localeService","validationService","pinnedRowModel","dragService","visibleColsService","eventService","gos","popupService","selectionService","columnFilterService","quickFilterService","filterManager","columnModel","headerNavigationService","pageBoundsService","paginationService","pageBoundsListener","rowRenderer","expressionService","columnFactory","alignedGridsService","navigationService","valueCache","valueService","loggerFactory","autoWidthCalculator","filterMenuFactory","dragAndDropService","focusService","mouseEventService","environment","cellNavigationService","stylingService","scrollVisibleService","sortController","columnHoverService","columnAnimationService","selectableService","autoColService","controlsColService","changeDetectionService","animationFrameService","undoRedoService","columnDefFactory","rowCssClassCalculator","rowNodeBlockLoader","rowNodeSorter","ctrlsService","pinnedWidthService","rowNodeEventThrottle","ctrlsFactory","dataTypeService","syncService","overlayService","stateService","expansionService","apiEventService","ariaAnnouncementService","menuService","columnApplyStateService","columnEventDispatcher","columnMoveService","columnAutosizeService","columnGetStateService","columnGroupStateService","columnSizeService","funcColsService","columnNameService","columnViewportService","pivotResultColsService","showRowGroupColsService"],dm=Object.fromEntries(a_.map((e,t)=>[e,t]));function c_(e,t){const i=(e.beanName?dm[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,s=(t.beanName?dm[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return i-s}function d_(e,t){return(e==null?void 0:e.beanName)==="gridDestroyService"?-1:0}var u_=class extends B{constructor(){super(...arguments),this.beanName="ctrlsFactory",this.registry={}}register(e){this.registry[e.name]=e.classImp}getInstance(e,...t){const i=this.registry[e];if(i!=null)return new i(...t)}},h_=class extends B{constructor(){super(...arguments),this.beanName="ctrlsService",this.params={gridCtrl:void 0,gridBodyCtrl:void 0,center:void 0,left:void 0,right:void 0,bottomCenter:void 0,bottomLeft:void 0,bottomRight:void 0,topCenter:void 0,topLeft:void 0,topRight:void 0,stickyTopCenter:void 0,stickyTopLeft:void 0,stickyTopRight:void 0,stickyBottomCenter:void 0,stickyBottomLeft:void 0,stickyBottomRight:void 0,fakeHScrollComp:void 0,fakeVScrollComp:void 0,gridHeaderCtrl:void 0,centerHeader:void 0,leftHeader:void 0,rightHeader:void 0},this.ready=!1,this.readyCallbacks=[],this.runReadyCallbacksAsync=!1}wireBeans(e){var t,i;this.runReadyCallbacksAsync=((i=(t=e.frameworkOverrides).runWhenReadyAsync)==null?void 0:i.call(t))??!1}postConstruct(){this.addEventListener("ready",()=>{this.updateReady(),this.ready&&(this.readyCallbacks.forEach(e=>e(this.params)),this.readyCallbacks.length=0)},this.runReadyCallbacksAsync)}updateReady(){this.ready=Object.values(this.params).every(e=>(e==null?void 0:e.isAlive())??!1)}whenReady(e,t){this.ready?t(this.params):this.readyCallbacks.push(t),e.addDestroyFunc(()=>{const i=this.readyCallbacks.indexOf(t);i>=0&&this.readyCallbacks.splice(i,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:i}=this.params;return[e,i,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}},p_=class extends B{constructor(){super(...arguments),this.beanName="cellPositionUtils"}createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${i??"null"}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,n=e.rowIndex===t.rowIndex;return i&&s&&n}},g_=class extends B{constructor(){super(...arguments),this.beanName="rowNodeEventThrottle",this.events=[]}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowModel=e.rowModel}postConstruct(){Ye(this.gos)&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(this.clientSideRowModel==null){this.eventService.dispatchEvent(e);return}this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(s=>this.eventService.dispatchEvent(s)),this.events=[]};t?i():(this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}},f_=class extends B{constructor(){super(...arguments),this.beanName="rowPositionUtils"}wireBeans(e){this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.pageBoundsService=e.pageBoundsService}getFirstRow(){let e=0,t;return this.pinnedRowModel.getPinnedTopRowCount()?t="top":this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(t="bottom"),t===void 0?null:{rowIndex:e,rowPinned:t}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getLastRow()):s&&(t="top",e=s-1),e===void 0?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRow(e.rowIndex);case"bottom":return this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t?!0:e&&!t||!e&&t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(j(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}},um={cssName:"--ag-row-height",changeKey:"rowHeightChanged",defaultValue:42},hm={cssName:"--ag-header-height",changeKey:"headerHeightChanged",defaultValue:48},pm={cssName:"--ag-list-item-height",changeKey:"listItemHeightChanged",defaultValue:24},m_=class extends B{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.ancestorThemeClasses=[],this.sizesMeasured=!1,this.gridTheme=null}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.eGridDiv=e.eGridDiv}postConstruct(){this.addManagedPropertyListener("theme",()=>this.handleThemeGridOptionChange()),this.handleThemeGridOptionChange(),this.addDestroyFunc(()=>this.stopUsingTheme()),this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.ancestorThemeClasses=this.readAncestorThemeClasses(),this.setUpThemeClassObservers(),this.getSizeEl(um),this.getSizeEl(hm),this.getSizeEl(pm)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(um)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(hm)}getDefaultColumnMinWidth(){return Math.min(36,this.getDefaultRowHeight())}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(pm)}hasMeasuredSizes(){return this.sizesMeasured}getGridThemeClass(){var e;return((e=this.gridTheme)==null?void 0:e.getCssClass())||null}getThemeClasses(){return this.gridTheme?[this.gridTheme.getCssClass()]:this.ancestorThemeClasses}applyThemeClasses(e){const t=this.getThemeClasses();for(const i of Array.from(e.classList))i.startsWith("ag-theme-")&&!t.includes(i)&&e.classList.remove(i);e.classList.add(...t)}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(t==null||isNaN(t)||!isFinite(t))return e!==null&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):e!=""?parseFloat(e):-1}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(t!=null)return t;const i=this.measureSizeEl(e);return i==="detached"||i==="no-styles"?e.defaultValue:(this.lastKnownValues.set(e,i),i)}measureSizeEl(e){const t=this.getSizeEl(e);if(t.offsetParent==null)return"detached";const i=t.offsetWidth;return i===gm?"no-styles":(this.sizesMeasured=!0,i)}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;let i=this.eMeasurementContainer;i||(i=this.eMeasurementContainer=document.createElement("div"),i.className="ag-measurement-container",this.gos.get("theme")&&this.applyThemeClasses(i),this.eGridDiv.appendChild(i)),t=document.createElement("div"),t.style.width=`var(${e.cssName}, ${gm}px)`,i.appendChild(t),this.sizeEls.set(e,t);let s=this.measureSizeEl(e);s==="no-styles"&&W(`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.`);const n=this.resizeObserverService.observeResize(t,()=>{const o=this.measureSizeEl(e);o==="detached"||o==="no-styles"||(this.lastKnownValues.set(e,o),o!==s&&(s=o,this.fireGridStylesChangedEvent(e.changeKey)))});return this.addDestroyFunc(()=>n()),t}fireGridStylesChangedEvent(e){this.eventService.dispatchEvent({type:"gridStylesChanged",[e]:!0})}setUpThemeClassObservers(){const e=new MutationObserver(()=>{const i=this.readAncestorThemeClasses();C_(i,this.ancestorThemeClasses)||(this.ancestorThemeClasses=i,this.fireGridStylesChangedEvent("themeChanged"))});let t=this.eGridDiv;for(;t;)e.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement;this.addDestroyFunc(()=>e.disconnect())}readAncestorThemeClasses(){let e=this.eGridDiv;const t=[];for(;e;){const i=Array.from(e.classList).filter(s=>s.startsWith("ag-theme-"));for(const s of i)t.includes(s)||t.unshift(s);e=e.parentElement}return Object.freeze(t)}handleThemeGridOptionChange(){const{gos:e,eMeasurementContainer:t,gridTheme:i}=this,s=e.get("theme")||null;s!==i&&(i==null||i.stopUse(),this.gridTheme=s,s==null||s.startUse({loadThemeGoogleFonts:e.get("loadThemeGoogleFonts"),container:this.eGridDiv}),t&&this.applyThemeClasses(t),this.fireGridStylesChangedEvent("themeChanged"))}stopUsingTheme(){var e;(e=this.gridTheme)==null||e.stopUse(),this.gridTheme=null}},C_=(e,t)=>e.length===t.length&&e.findIndex((i,s)=>e[s]!==t[s])===-1,gm=15538,v_=class extends B{constructor(){super(...arguments),this.beanName="eventService",this.globalEventService=new Gn}wireBeans(e){this.globalEventListener=e.globalEventListener,this.globalSyncEventListener=e.globalSyncEventListener}postConstruct(){if(this.globalEventListener){const e=Fl(this.gos);this.addGlobalListener(this.globalEventListener,e)}this.globalSyncEventListener&&this.addGlobalListener(this.globalSyncEventListener,!1)}addEventListener(e,t,i){this.globalEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.globalEventService.removeEventListener(e,t,i)}addGlobalListener(e,t=!1){this.globalEventService.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalEventService.removeGlobalListener(e,t)}dispatchLocalEvent(){}dispatchEvent(e){this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e))}dispatchEventOnce(e){this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e))}},hu=class mi extends B{constructor(){super(...arguments),this.beanName="focusService"}wireBeans(t){this.eGridDiv=t.eGridDiv,this.columnModel=t.columnModel,this.visibleColsService=t.visibleColsService,this.headerNavigationService=t.headerNavigationService,this.headerPositionUtils=t.headerPositionUtils,this.rowRenderer=t.rowRenderer,this.rowPositionUtils=t.rowPositionUtils,this.cellPositionUtils=t.cellPositionUtils,this.navigationService=t.navigationService,this.ctrlsService=t.ctrlsService,this.filterManager=t.filterManager,this.rangeService=t.rangeService,this.advancedFilterService=t.advancedFilterService,this.overlayService=t.overlayService}static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",mi.toggleKeyboardMode),t.addEventListener("mousedown",mi.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.removeEventListener("keydown",mi.toggleKeyboardMode),t.removeEventListener("mousedown",mi.toggleKeyboardMode))}static toggleKeyboardMode(t){const i=mi.keyboardModeActive,s=t.type==="keydown";s&&(t.ctrlKey||t.metaKey||t.altKey)||i!==s&&(mi.keyboardModeActive=s)}postConstruct(){const t=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:t,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:t,columnRowGroupChanged:t}),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(this,i=>{this.gridCtrl=i.gridCtrl})}registerKeyboardFocusEvents(){const t=Xe(this.gos);mi.addKeyboardModeEvents(t),mi.instanceCount++,this.addDestroyFunc(()=>{mi.instanceCount--,mi.removeKeyboardModeEvents(t)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const t=this.focusedCellPosition.column,i=this.columnModel.getCol(t.getId());t!==i&&this.clearFocusedCell()}isKeyboardMode(){return mi.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(Ke(this.gos),gn.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(Ke(this.gos),jl.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(t,i){let s=t;for(;s;){if(qo(this.gos,s,i))return!1;s=s.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(t){return this.isCellRestoreFocused(t)?(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0):!1}clearRestoreFocus(){this.restoredFocusedCellPosition=null,this.awaitRestoreFocusedCell=!1}restoreFocusedCell(t,i){this.awaitRestoreFocusedCell=!0,setTimeout(()=>{this.awaitRestoreFocusedCell&&(this.setRestoreFocusedCell(t),i())})}isCellRestoreFocused(t){return this.restoredFocusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.restoredFocusedCellPosition)}setRestoreFocusedCell(t){this.getFrameworkOverrides().renderingEngine==="react"&&(this.restoredFocusedCellPosition=t)}getFocusEventParams(t){const{rowIndex:i,rowPinned:s,column:n}=t,o={rowIndex:i,rowPinned:s,column:n,isFullWidthCell:!1},r=this.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:s});return r&&(o.isFullWidthCell=r.isFullWidth()),o}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,this.focusedCellPosition==null)return;const t=this.getFocusEventParams(this.focusedCellPosition);this.focusedCellPosition=null,this.eventService.dispatchEvent({type:"cellFocusCleared",...t})}setFocusedCell(t){const{column:i,rowIndex:s,rowPinned:n,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:r=!1}=t,a=this.columnModel.getCol(i);if(!a){this.focusedCellPosition=null;return}this.focusedCellPosition={rowIndex:s,rowPinned:yi(n),column:a},this.eventService.dispatchEvent({type:"cellFocused",...this.getFocusEventParams(this.focusedCellPosition),forceBrowserFocus:o,preventScrollOnBrowserFocus:r})}isCellFocused(t){return this.focusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.focusedCellPosition)}isRowNodeFocused(t){return this.isRowFocused(t.rowIndex,t.rowPinned)}isHeaderWrapperFocused(t){if(this.focusedHeaderPosition==null)return!1;const i=t.getColumnGroupChild(),s=t.getRowIndex(),n=t.getPinned(),{column:o,headerRowIndex:r}=this.focusedHeaderPosition;return i===o&&s===r&&n==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(t,i){this.focusedHeaderPosition={headerRowIndex:t,column:i}}isHeaderFocusSuppressed(){return this.gos.get("suppressHeaderFocus")||this.overlayService.isExclusive()}isCellFocusSuppressed(){return this.gos.get("suppressCellFocus")||this.overlayService.isExclusive()}focusHeaderPosition(t){var h;if(this.isHeaderFocusSuppressed())return!1;const{direction:i,fromTab:s,allowUserOverride:n,event:o,fromCell:r,rowWithoutSpanValue:a}=t;let{headerPosition:d}=t;if(r&&((h=this.filterManager)!=null&&h.isAdvancedFilterHeaderActive()))return this.focusAdvancedFilter(d);if(n){const g=this.getFocusedHeader(),f=this.headerNavigationService.getHeaderRowCount();if(s){const C=this.gos.getCallback("tabToNextHeader");C&&(d=this.getHeaderPositionFromUserFunc({userFunc:C,direction:i,currentPosition:g,headerPosition:d,headerRowCount:f}))}else{const C=this.gos.getCallback("navigateToNextHeader");if(C&&o){const v={key:o.key,previousHeaderPosition:g,nextHeaderPosition:d,headerRowCount:f,event:o};d=C(v)}}}return d?this.focusProvidedHeaderPosition({headerPosition:d,direction:i,event:o,fromCell:r,rowWithoutSpanValue:a}):!1}focusHeaderPositionFromUserFunc(t){if(this.isHeaderFocusSuppressed())return!1;const{userFunc:i,headerPosition:s,direction:n,event:o}=t,r=this.getFocusedHeader(),a=this.headerNavigationService.getHeaderRowCount(),d=this.getHeaderPositionFromUserFunc({userFunc:i,direction:n,currentPosition:r,headerPosition:s,headerRowCount:a});return!!d&&this.focusProvidedHeaderPosition({headerPosition:d,direction:n,event:o})}getHeaderPositionFromUserFunc(t){const{userFunc:i,direction:s,currentPosition:n,headerPosition:o,headerRowCount:r}=t,d=i({backwards:s==="Before",previousHeaderPosition:n,nextHeaderPosition:o,headerRowCount:r});return d===!0||d===null?(d===null&&W("Since v31.3 Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),n):d===!1?null:d}focusProvidedHeaderPosition(t){var f;const{headerPosition:i,direction:s,fromCell:n,rowWithoutSpanValue:o,event:r}=t,{column:a,headerRowIndex:d}=i;if(d===-1)return(f=this.filterManager)!=null&&f.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(i):this.focusGridView(a);this.headerNavigationService.scrollToColumn(a,s);const h=this.ctrlsService.getHeaderRowContainerCtrl(a.getPinned()),g=(h==null?void 0:h.focusHeader(i.headerRowIndex,a,r))||!1;return g&&(o!=null||n)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(o??-1),g}focusFirstHeader(){if(this.overlayService.isExclusive()&&this.focusOverlay())return!0;let t=this.visibleColsService.getAllCols()[0];if(!t)return!1;t.getParent()&&(t=this.visibleColsService.getColGroupAtLevel(t,0));const i=this.headerPositionUtils.getHeaderIndexToFocus(t,0);return this.focusHeaderPosition({headerPosition:i,rowWithoutSpanValue:0})}focusLastHeader(t){if(this.overlayService.isExclusive()&&this.focusOverlay(!0))return!0;const i=this.headerNavigationService.getHeaderRowCount()-1,s=ce(this.visibleColsService.getAllCols());return this.focusHeaderPosition({headerPosition:{headerRowIndex:i,column:s},rowWithoutSpanValue:-1,event:t})}focusPreviousFromFirstCell(t){var i;return(i=this.filterManager)!=null&&i.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(t)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(t,i){return this.focusedCellPosition==null?!1:this.focusedCellPosition.rowIndex===t&&this.focusedCellPosition.rowPinned===yi(i)}findFocusableElements(t,i,s=!1){const n=JT;let o=$g;i&&(o+=", "+i),s&&(o+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(t.querySelectorAll(n)).filter(h=>jt(h)),a=Array.prototype.slice.apply(t.querySelectorAll(o));return a.length?((h,g)=>h.filter(f=>g.indexOf(f)===-1))(r,a):r}focusInto(t,i=!1,s=!1){const n=this.findFocusableElements(t,null,s),o=i?ce(n):n[0];return o?(o.focus({preventScroll:!0}),!0):!1}findFocusableElementBeforeTabGuard(t,i){if(!i)return null;const s=this.findFocusableElements(t),n=s.indexOf(i);if(n===-1)return null;let o=-1;for(let r=n-1;r>=0;r--)if(s[r].classList.contains("ag-tab-guard-top")){o=r;break}return o<=0?null:s[o-1]}findNextFocusableElement(t=this.eGridDiv,i,s){const n=this.findFocusableElements(t,i?':not([tabindex="-1"])':null),o=Ke(this.gos);let r;i?r=n.findIndex(d=>d.contains(o)):r=n.indexOf(o);const a=r+(s?-1:1);return a<0||a>=n.length?null:n[a]}isTargetUnderManagedComponent(t,i){if(!i)return!1;const s=t.querySelectorAll(`.${hn.FOCUS_MANAGED_CLASS}`);if(!s.length)return!1;for(let n=0;n<s.length;n++)if(s[n].contains(i))return!0;return!1}findTabbableParent(t,i=5){let s=0;for(;t&&_d(t)===null&&++s<=i;)t=t.parentElement;return _d(t)===null?null:t}focusOverlay(t){var s;const i=this.overlayService.isVisible()&&((s=this.overlayService.getOverlayWrapper())==null?void 0:s.getGui());return!!i&&this.focusInto(i,t)}focusGridViewFailed(t,i){return i&&this.focusOverlay(t)||t&&this.focusLastHeader()}focusGridView(t,i=!1,s=!0){var o,r;if(this.overlayService.isExclusive())return s&&this.focusOverlay(i);if(this.isCellFocusSuppressed())return i&&!this.isHeaderFocusSuppressed()?this.focusLastHeader():s&&this.focusOverlay(i)?!0:this.focusNextGridCoreContainer(!1);const n=i?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(n){const{rowIndex:a,rowPinned:d}=n;if(t??(t=(o=this.getFocusedHeader())==null?void 0:o.column),t&&a!==void 0&&a!==null){if(this.navigationService.ensureCellVisible({rowIndex:a,column:t,rowPinned:d}),i){const h=this.rowRenderer.getRowByPosition(n);if(h!=null&&h.isFullWidth()&&this.navigationService.tryToFocusFullWidthRow(n,i))return!0}return this.setFocusedCell({rowIndex:a,column:t,rowPinned:yi(d),forceBrowserFocus:!0}),(r=this.rangeService)==null||r.setRangeToCell({rowIndex:a,rowPinned:d,column:t}),!0}}return!!(s&&this.focusOverlay(i)||i&&this.focusLastHeader())}isGridFocused(){const t=Ke(this.gos);return!!t&&this.eGridDiv.contains(t)}focusNextGridCoreContainer(t,i=!1){return!i&&this.gridCtrl.focusNextInnerContainer(t)?!0:((i||!t&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(t),!1)}focusAdvancedFilter(t){var i;return this.advancedFilterFocusColumn=t==null?void 0:t.column,((i=this.advancedFilterService)==null?void 0:i.getCtrl().focusHeaderComp())??!1}focusNextFromAdvancedFilter(t,i){var n;const s=(i?void 0:this.advancedFilterFocusColumn)??((n=this.visibleColsService.getAllCols())==null?void 0:n[0]);return t?this.focusHeaderPosition({headerPosition:{column:s,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(s)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}addFocusableContainer(t){this.gridCtrl.addFocusableContainer(t)}removeFocusableContainer(t){this.gridCtrl.removeFocusableContainer(t)}focusGridInnerElement(t){return this.gridCtrl.focusInnerElement(t)}allowFocusForNextGridCoreContainer(t){this.gridCtrl.allowFocusForNextCoreContainer(t)}};hu.keyboardModeActive=!1,hu.instanceCount=0;var w_=hu,S_=class extends B{constructor(){super(...arguments),this.beanName="pinnedWidthService"}wireBeans(e){this.visibleColsService=e.visibleColsService}postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=ht(this.gos,"print"),t=e?0:this.visibleColsService.getColsLeftWidth(),i=e?0:this.visibleColsService.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:"leftPinnedWidthChanged"})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:"rightPinnedWidthChanged"}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}},y_=class extends B{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}wireBeans(e){this.beans=e,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.beans.context.getGridId());const{dragAndDropService:s,mouseEventService:n,ctrlsService:o,resizeObserverService:r}=this.beans,a={getContainer:()=>this.eGui,isInterestedIn:h=>h===1||h===0,getIconName:()=>"notAllowed"};s.addDropTarget(a),this.addDestroyFunc(()=>s.removeDropTarget(a)),n.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new lu(this.view)),this.view.setRtlClass(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr"),this.updateGridThemeClass(),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)});const d=r.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>d()),o.register("gridCtrl",this)}isDetailGrid(){var t;const e=this.focusService.findTabbableParent(this.getGui());return((t=e==null?void 0:e.getAttribute("row-id"))==null?void 0:t.startsWith("detail"))||!1}getOptionalSelectors(){var t,i,s,n,o;const e=this.beans;return{paginationSelector:(t=e.paginationService)==null?void 0:t.getPaginationSelector(),gridHeaderDropZonesSelector:(i=e.columnDropZonesService)==null?void 0:i.getDropZoneSelector(),sideBarSelector:(s=e.sideBarService)==null?void 0:s.getSideBarSelector(),statusBarSelector:(n=e.statusBarService)==null?void 0:n.getStatusPanelSelector(),watermarkSelector:(o=e.licenseManager)==null?void 0:o.getWatermarkSelector()}}onGridSizeChanged(){this.eventService.dispatchEvent({type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight})}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),{indexWithFocus:i,nextIndex:s}=this.getNextFocusableIndex(t,e);if(s<0||s>=t.length)return!1;if(s===0){if(i>0){const n=this.visibleColsService.getAllCols(),o=ce(n);if(this.focusService.focusGridView(o,!0))return!0}return!1}return this.focusContainer(t[s],e)}focusInnerElement(e){const t=this.gos.getCallback("focusGridInnerElement");if(t&&t({fromBottom:!!e}))return!0;const i=this.getFocusableContainers(),s=this.visibleColsService.getAllCols();if(e){if(i.length>1)return this.focusContainer(ce(i),!0);const n=ce(s);if(this.focusService.focusGridView(n,!0))return!0}if(this.gos.get("headerHeight")===0||this.focusService.isHeaderFocusSuppressed()){if(this.focusService.focusGridView(s[0]))return!0;for(let n=1;n<i.length;n++)if(this.focusService.focusInto(i[n].getGui()))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}allowFocusForNextCoreContainer(e){var o;const t=this.view.getFocusableContainers(),{nextIndex:i,indexWithFocus:s}=this.getNextFocusableIndex(t,e);if(s===-1||i<0||i>=t.length)return;const n=t[i];(o=n.setAllowFocus)==null||o.call(n,!0),setTimeout(()=>{var r;(r=n.setAllowFocus)==null||r.call(n,!1)})}getNextFocusableIndex(e,t){const i=Ke(this.gos),s=e.findIndex(o=>o.getGui().contains(i)),n=s+(t?-1:1);return{indexWithFocus:s,nextIndex:n}}focusContainer(e,t){var s,n;(s=e.setAllowFocus)==null||s.call(e,!0);const i=this.focusService.focusInto(e.getGui(),t);return(n=e.setAllowFocus)==null||n.call(e,!1),i}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers]}updateGridThemeClass(){const e=this.beans.environment.getGridThemeClass();e&&this.view.setGridThemeClass(e)}handleThemeChange(e){e.themeChanged&&this.updateGridThemeClass()}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},b_=class extends rm{constructor(e){super(),this.gridBody=J,this.sideBar=J,this.pagination=J,this.rootWrapperBody=J,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:o=>this.addCssClass(o),setGridThemeClass:o=>this.addCssClass(o),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:o=>{this.getGui().style.userSelect=o??"",this.getGui().style.webkitUserSelect=o??""},setCursor:o=>{this.getGui().style.cursor=o??""}},t=this.createManagedBean(new y_),i=t.getOptionalSelectors(),s=this.createTemplate(i),n=[WI,...Object.values(i).filter(o=>!!o)];this.setTemplate(s,n),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:o=>t.focusInnerElement(o),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.gos.get("debug")&&si("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.rootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",i=e.sideBarSelector?'<ag-side-bar data-ref="sideBar"></ag-side-bar>':"",s=e.statusBarSelector?"<ag-status-bar></ag-status-bar>":"",n=e.watermarkSelector?"<ag-watermark></ag-watermark>":"",o=e.paginationSelector?'<ag-pagination data-ref="pagination"></ag-pagination>':"";return`<div class="ag-root-wrapper" role="presentation">
176
+ ${t}
177
+ <div class="ag-root-wrapper-body" data-ref="rootWrapperBody" role="presentation">
178
+ <ag-grid-body data-ref="gridBody"></ag-grid-body>
179
+ ${i}
180
+ </div>
181
+ ${s}
182
+ ${o}
183
+ ${n}
184
+ </div>`}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){var t;if(!e&&((t=this.pagination)!=null&&t.isDisplayed())){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[this.gridBody];return[this.sideBar,this.pagination].forEach(t=>{t&&e.push(t)}),e.filter(t=>jt(t.getGui()))}},R_=class extends B{constructor(){super(...arguments),this.beanName="alignedGridsService",this.consuming=!1}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.ctrlsService=e.ctrlsService,this.columnApplyStateService=e.columnApplyStateService}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";typeof e=="function"&&(e=e());const i=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return e.map(n=>{var r;if(!n){Ve("alignedGrids contains an undefined option."),t||Ve(`You may want to configure via a callback to avoid setup race conditions:
185
+ "alignedGrids: () => [linkedGrid]"`),Ve(i());return}if(this.isGridApi(n))return n;const o=n;return"current"in o?(r=o.current)==null?void 0:r.api:(o.api||Ve(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${i()}`),o.api)}).filter(n=>!!n&&!n.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{t.isDestroyed()||t.dispatchEvent(e)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const i=[];return e.columns?e.columns.forEach(s=>{i.push(t(s))}):e.column&&i.push(t(e.column)),i}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":W("pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.");break}})}processGroupOpenedEvent(e){const{columnModel:t}=this;e.columnGroups.forEach(i=>{let s=null;i&&(s=t.getProvidedColGroup(i.getGroupId())),!(i&&!s)&&t.setColumnGroupOpened(s,i.isExpanded(),"alignedGridChanged")})}processColumnEvent(e){var h;const t=e.column;let i=null;if(t&&(i=this.columnModel.getColDefCol(t.getColId())),t&&!i)return;const s=this.getMasterColumns(e),{columnApplyStateService:n,columnSizeService:o,ctrlsService:r}=this;switch(e.type){case"columnMoved":{const f=e.api.getColumnState().map(C=>({colId:C.colId}));n.applyColumnState({state:f,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const f=e.api.getColumnState().map(C=>({colId:C.colId,hide:C.hide}));n.applyColumnState({state:f},"alignedGridChanged")}break;case"columnPinned":{const f=e.api.getColumnState().map(C=>({colId:C.colId,pinned:C.pinned}));n.applyColumnState({state:f},"alignedGridChanged")}break;case"columnResized":{const g=e,f={};s.forEach(C=>{f[C.getId()]={key:C.getColId(),newWidth:C.getActualWidth()}}),(h=g.flexColumns)==null||h.forEach(C=>{f[C.getId()]&&delete f[C.getId()]}),o.setColumnWidths(Object.values(f),!1,g.finished,"alignedGridChanged");break}}const d=r.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(g=>{g.setGridOption("alwaysShowVerticalScroll",d)})}},F_={version:ge,moduleName:"@ag-grid-community/aligned-grid",beans:[R_]};function x_(e,t){const i=e.columnModel.getColDefCol(t);return i?i.getColDef():null}function E_(e){return e.columnModel.getColumnDefs()}function P_(e,t){typeof t=="number"?e.columnSizeService.sizeColumnsToFit(t,"api"):e.ctrlsService.getGridBodyCtrl().sizeColumnsToFit(t)}function D_(e,t,i){e.columnModel.setColumnGroupOpened(t,i,"api")}function T_(e,t,i){return e.visibleColsService.getColumnGroup(t,i)}function A_(e,t){return e.columnModel.getProvidedColGroup(t)}function M_(e,t,i){return e.columnNameService.getDisplayNameForColumn(t,i)||""}function k_(e,t,i){return e.columnNameService.getDisplayNameForColumnGroup(t,i)||""}function I_(e,t){return e.columnModel.getColDefCol(t)}function L_(e){return e.columnModel.getColDefCols()}function __(e,t){return e.columnApplyStateService.applyColumnState(t,"api")}function O_(e){return e.columnGetStateService.getColumnState()}function V_(e){e.columnApplyStateService.resetColumnState("api")}function N_(e){return e.columnGroupStateService.getColumnGroupState()}function B_(e,t){e.columnGroupStateService.setColumnGroupState(t,"api")}function G_(e){e.columnGroupStateService.resetColumnGroupState("api")}function H_(e){return e.visibleColsService.isPinningLeft()||e.visibleColsService.isPinningRight()}function W_(e){return e.visibleColsService.isPinningLeft()}function z_(e){return e.visibleColsService.isPinningRight()}function U_(e,t){return e.visibleColsService.getColAfter(t)}function $_(e,t){return e.visibleColsService.getColBefore(t)}function K_(e,t,i){e.columnModel.setColsVisible([t],i,"api")}function j_(e,t,i){e.columnModel.setColsVisible(t,i,"api")}function Z_(e,t,i){e.columnModel.setColsPinned([t],i,"api")}function q_(e,t,i){e.columnModel.setColsPinned(t,i,"api")}function Y_(e){return e.columnModel.getCols()}function Q_(e){return e.visibleColsService.getLeftCols()}function X_(e){return e.visibleColsService.getCenterCols()}function J_(e){return e.visibleColsService.getRightCols()}function eO(e){return e.visibleColsService.getAllCols()}function tO(e){return e.columnViewportService.getViewportColumns()}function iO(e,t,i){e.columnMoveService.moveColumns([t],i,"api")}function sO(e,t,i){e.columnMoveService.moveColumnByIndex(t,i,"api")}function nO(e,t,i){e.columnMoveService.moveColumns(t,i,"api")}function oO(e,t,i,s=!0,n="api"){e.columnSizeService.setColumnWidths([{key:t,newWidth:i}],!1,s,n)}function rO(e,t,i=!0,s="api"){e.columnSizeService.setColumnWidths(t,!1,i,s)}function lO(e){return e.visibleColsService.getTreeLeft()}function aO(e){return e.visibleColsService.getTreeCenter()}function cO(e){return e.visibleColsService.getTreeRight()}function dO(e){return e.visibleColsService.getAllTrees()}function uO(e,t,i){return e.columnAutosizeService.autoSizeCols({colKeys:[t],skipHeader:i,source:"api"})}function hO(e,t,i){e.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"api"})}function pO(e,t){e.columnAutosizeService.autoSizeAllColumns("api",t)}var gO=class extends B{constructor(){super(...arguments),this.beanName="dataTypeService",this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}wireBeans(e){this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.columnApplyStateService=e.columnApplyStateService,this.filterManager=e.filterManager}postConstruct(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(an(e.source))})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},this.formatValueFuncs={};const t=s=>n=>{const{column:o,node:r,value:a}=n;let d=o.getColDef().valueFormatter;return d===s.groupSafeValueFormatter&&(d=s.valueFormatter),this.valueService.formatValue(o,r,a,d)};Object.entries(e).forEach(([s,n])=>{const o={...n,groupSafeValueFormatter:this.createGroupSafeValueFormatter(n)};this.dataTypeDefinitions[s]=o,this.formatValueFuncs[s]=t(o)});const i=this.gos.get("dataTypeDefinitions")??{};this.dataTypeMatchers={},Object.entries(i).forEach(([s,n])=>{const o=this.processDataTypeDefinition(n,i,[s],e);o&&(this.dataTypeDefinitions[s]=o,n.dataTypeMatcher&&(this.dataTypeMatchers[s]=n.dataTypeMatcher),this.formatValueFuncs[s]=t(o))}),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach(s=>{const n=this.dataTypeMatchers[s];n&&delete this.dataTypeMatchers[s],this.dataTypeMatchers[s]=n??e[s].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...kl(e.columnTypes),...kl(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let n;const o=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let r=s[o];const a=t[o];if(r&&a&&(r=a),!this.validateDataTypeDefinition(e,r,o))return;n=this.mergeDataTypeDefinitions(r,e)}else{if(i.includes(o)){W('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');return}const r=t[o];if(!this.validateDataTypeDefinition(e,r,o))return;const a=this.processDataTypeDefinition(r,t,[...i,o],s);if(!a)return;n=this.mergeDataTypeDefinitions(a,e)}return{...n,groupSafeValueFormatter:this.createGroupSafeValueFormatter(n)}}validateDataTypeDefinition(e,t,i){return t?t.baseDataType!==e.baseDataType?(W('The "baseDataType" property of a data type definition must match that of its parent.'),!1):!0:(W(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,s;if((i=t.node)!=null&&i.group){const n=(t.colDef.pivotValueColumn??t.column).getAggFunc();if(n){if(n==="first"||n==="last")return e.valueFormatter(t);if(e.baseDataType==="number"&&n!=="count"){if(typeof t.value=="number")return e.valueFormatter(t);if(typeof t.value=="object"){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter({...t,value:t.value.toNumber()});if("value"in t.value)return e.valueFormatter({...t,value:t.value.value})}}return}if((this.gos.get("suppressGroupMaintainValueType")||this.gos.get("groupDisplayType")==="groupRows")&&!this.gos.get("treeData"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()&&typeof t.value=="string"&&!((s=e.dataTypeMatcher)!=null&&s.call(e,t.value)))return;return e.valueFormatter(t)}}updateColDefAndGetColumnType(e,t,i){let{cellDataType:s}=t;const{field:n}=t;if(s===void 0&&(s=e.cellDataType),(s==null||s===!0)&&(s=this.canInferCellDataType(e,t)?this.inferCellDataType(n,i):!1),!s){e.cellDataType=!1;return}const o=this.dataTypeDefinitions[s];if(!o){W(`Missing data type definition - "${s}"`);return}return e.cellDataType=s,o.groupSafeValueFormatter&&(e.valueFormatter=o.groupSafeValueFormatter),o.valueParser&&(e.valueParser=o.valueParser),o.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,s,o,i),o.columnTypes}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=s=>{t.add(s.key)};e.addEventListener("columnStateUpdated",i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener("columnStateUpdated",i))}canInferCellDataType(e,t){if(!Ye(this.gos))return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,i))return!1;const s=t.type===null?e.type:t.type;if(s){const n=this.gos.get("columnTypes")??{};if(kl(s).some(r=>{const a=n[r.trim()];return a&&this.doColDefPropsPreventInference(a,i)}))return!1}return!this.doColDefPropsPreventInference(e,i)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const n=e[i];return n===null?(t[i]=!1,!1):s===void 0?!!n:n===s}inferCellDataType(e,t){if(!e)return;let i;const s=this.getInitialData();if(s){const o=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");i=Jo(s,e,o)}else this.initWaitForRowData(t);if(i==null)return;const[n]=Object.entries(this.dataTypeMatchers).find(([o,r])=>r(i))??["object"];return n}getInitialData(){const e=this.gos.get("rowData");if(e!=null&&e.length)return e[0];if(this.initialData)return this.initialData;{const t=this.rowModel.getRootNode().allLeafChildren;if(t!=null&&t.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const[i]=this.addManagedEventListeners({rowDataUpdateStarted:s=>{const{firstRowData:n}=s;n&&(i==null||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(n,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations(),this.eventService.dispatchEvent({type:"dataTypesInferred"}))}})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.destroyColumnStateUpdateListeners();const s={},n={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([o,r])=>{const a=this.columnModel.getCol(o);if(!a)return;const d=a.getColDef();if(!this.columnModel.resetColDefIntoCol(a,"cellDataTypeInferred"))return;const h=a.getColDef();if(t&&h.type&&h.type!==d.type){const g=this.getUpdatedColumnState(a,r);g.rowGroup&&g.rowGroupIndex==null&&(s[o]=g),g.pivot&&g.pivotIndex==null&&(n[o]=g),i.push(g)}}),t&&i.push(...this.funcColsService.generateColumnStateForRowGroupAndPivotIndexes(s,n)),i.length&&this.columnApplyStateService.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnApplyStateService.getColumnStateFromColDef(e);return t.forEach(s=>{delete i[s],s==="rowGroup"?delete i.rowGroupIndex:s==="pivot"&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}getDateStringTypeDefinition(e){return e?this.getDataTypeDefinition(e)??this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return(t=this.getDataTypeDefinition(e))==null?void 0:t.baseDataType}checkType(e,t){var s;if(t==null)return!0;const i=(s=this.getDataTypeDefinition(e))==null?void 0:s.dataTypeMatcher;return i?i(t):!0}validateColDef(e){const t=i=>W(`Cell data type is "object" but no Value ${i} has been provided. Please either provide an object data type definition with a Value ${i}, or set "colDef.value${i}"`);e.cellDataType==="object"&&(e.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&t("Formatter"),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&t("Parser"))}getFormatValue(e){return this.formatValueFuncs[e]}setColDefPropertiesForBaseDataType(e,t,i,s){var o;const n=this.formatValueFuncs[t];switch(i.baseDataType){case"number":{e.cellEditor="agNumberCellEditor";break}case"boolean":{e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=r=>!!r.colDef.editable&&r.event.key===N.SPACE;break}case"date":{e.cellEditor="agDateCellEditor",e.keyCreator=n;break}case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=n;break}case"object":{e.cellEditorParams={useFormatter:!0},e.comparator=(r,a)=>{const d=this.columnModel.getColDefCol(s),h=d==null?void 0:d.getColDef();if(!d||!h)return 0;const g=r==null?"":n({column:d,node:null,value:r}),f=a==null?"":n({column:d,node:null,value:a});return g===f?0:g>f?1:-1},e.keyCreator=n;break}}(o=this.filterManager)==null||o.setColDefPropertiesForDataType(e,i,n)}getDefaultDataTypes(){const e=i=>!!i.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:i=>{var s,n;return((n=(s=i.newValue)==null?void 0:s.trim)==null?void 0:n.call(s))===""?null:Number(i.newValue)},valueFormatter:i=>i.value==null?"":typeof i.value!="number"||isNaN(i.value)?t("invalidNumber","Invalid Number"):String(i.value),dataTypeMatcher:i=>typeof i=="number"},text:{baseDataType:"text",valueParser:i=>i.newValue===""?null:bl(i.newValue),dataTypeMatcher:i=>typeof i=="string"},boolean:{baseDataType:"boolean",valueParser:i=>{var s,n;return i.newValue==null?i.newValue:((n=(s=i.newValue)==null?void 0:s.trim)==null?void 0:n.call(s))===""?null:String(i.newValue).toLowerCase()==="true"},valueFormatter:i=>i.value==null?"":String(i.value),dataTypeMatcher:i=>typeof i=="boolean"},date:{baseDataType:"date",valueParser:i=>Nt(i.newValue==null?null:String(i.newValue)),valueFormatter:i=>i.value==null?"":!(i.value instanceof Date)||isNaN(i.value.getTime())?t("invalidDate","Invalid Date"):li(i.value,!1)??"",dataTypeMatcher:i=>i instanceof Date},dateString:{baseDataType:"dateString",dateParser:i=>Nt(i)??void 0,dateFormatter:i=>li(i??null,!1)??void 0,valueParser:i=>e(String(i.newValue))?i.newValue:null,valueFormatter:i=>e(String(i.value))?i.value:"",dataTypeMatcher:i=>typeof i=="string"&&e(i)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:i=>bl(i.value)??""}}}destroyColumnStateUpdateListeners(){this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}},fO={version:ge,moduleName:"@ag-grid-community/data-type",beans:[gO]},mO={version:ge,moduleName:"@ag-grid-community/column-api",apiFunctions:{getColumnDef:x_,getColumnDefs:E_,sizeColumnsToFit:P_,setColumnGroupOpened:D_,getColumnGroup:T_,getProvidedColumnGroup:A_,getDisplayNameForColumn:M_,getDisplayNameForColumnGroup:k_,getColumn:I_,getColumns:L_,applyColumnState:__,getColumnState:O_,resetColumnState:V_,getColumnGroupState:N_,setColumnGroupState:B_,resetColumnGroupState:G_,isPinning:H_,isPinningLeft:W_,isPinningRight:z_,getDisplayedColAfter:U_,getDisplayedColBefore:$_,setColumnVisible:K_,setColumnsVisible:j_,setColumnPinned:Z_,setColumnsPinned:q_,getAllGridColumns:Y_,getDisplayedLeftColumns:Q_,getDisplayedCenterColumns:X_,getDisplayedRightColumns:J_,getAllDisplayedColumns:eO,getAllDisplayedVirtualColumns:tO,moveColumn:iO,moveColumnByIndex:sO,moveColumns:nO,setColumnWidth:oO,setColumnWidths:rO,getLeftDisplayedColumnGroups:lO,getCenterDisplayedColumnGroups:aO,getRightDisplayedColumnGroups:cO,getAllDisplayedColumnGroups:dO,autoSizeColumn:uO,autoSizeColumns:hO,autoSizeAllColumns:pO}};function CO(e,t){e.ctrlsService.getGridBodyCtrl().getRowDragFeature().addRowDropZone(t)}function vO(e,t){const i=e.dragAndDropService.findExternalZone(t);i&&e.dragAndDropService.removeDropTarget(i)}function wO(e,t){return e.ctrlsService.getGridBodyCtrl().getRowDragFeature().getRowDropZone(t)}var SO={version:ge,moduleName:"@ag-grid-community/drag-api",apiFunctions:{addRowDropZone:CO,removeRowDropZone:vO,getRowDropZoneParams:wO}};function yO(e){return e.pinnedRowModel.getPinnedTopRowCount()}function bO(e){return e.pinnedRowModel.getPinnedBottomRowCount()}function RO(e,t){return e.pinnedRowModel.getPinnedTopRow(t)}function FO(e,t){return e.pinnedRowModel.getPinnedBottomRow(t)}var xO={version:ge,moduleName:"@ag-grid-community/pinned-row-api",apiFunctions:{getPinnedTopRowCount:yO,getPinnedBottomRowCount:bO,getPinnedTopRow:RO,getPinnedBottomRow:FO}};function EO(e){e.overlayService.showLoadingOverlay()}function PO(e){e.overlayService.showNoRowsOverlay()}function DO(e){e.overlayService.hideOverlay()}var TO={version:ge,moduleName:"@ag-grid-community/overlay-api",apiFunctions:{showLoadingOverlay:EO,showNoRowsOverlay:PO,hideOverlay:DO}};function AO(e,t,i){if(!t)return;const s=e.ctrlsService.getGridBodyCtrl().getGui(),n=`aria-${t}`;i===null?s.removeAttribute(n):s.setAttribute(n,i)}function MO(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function kO(e,t={}){const i=s=>W(`Since v31.1 api.flashCells parameter '${s}Delay' is deprecated. Please use '${s}Duration' instead.`);j(t.fadeDelay)&&i("fade"),j(t.flashDelay)&&i("flash"),e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.flashCells(t))}function IO(e){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getHeaderRowContainerCtrls().forEach(t=>t.refresh()))}function LO(e){return e.animationFrameService.isQueueEmpty()}function _O(e){e.animationFrameService.flushAllFrames()}function OO(e){return{rowHeight:on(e.gos),headerHeight:e.columnModel.getHeaderHeight()}}function VO(e,t={}){return e.rowRenderer.getCellRendererInstances(t).map(lr)}var NO={version:ge,moduleName:"@ag-grid-community/render-api",apiFunctions:{setGridAriaProperty:AO,refreshCells:MO,flashCells:kO,refreshHeader:IO,isAnimationFrameQueueEmpty:LO,flushAllAnimationFrames:_O,getSizesForCurrentTheme:OO,getCellRendererInstances:VO}};function BO(e){e.valueCache.expire()}function GO(e,t,i){return fm(e,{colKey:t,rowNode:i})}function fm(e,t){const{colKey:i,rowNode:s,useFormatter:n}=t,o=e.columnModel.getColDefCol(i)??e.columnModel.getCol(i);if(ke(o))return null;const r=e.valueService.getValueForDisplay(o,s);return n?e.valueService.formatValue(o,s,r)??Bi(r,!0):r}function HO(e){return e.context.getGridId()}function WO(e){e.gridDestroyService.destroy()}function zO(e){return e.gridDestroyService.isDestroyCalled()}function UO(e,t){return e.gos.get(t)}function $O(e,t,i){mm(e,{[t]:i})}function mm(e,t){e.gos.updateGridOptions({options:t})}function KO(e,t,i){e.apiEventService.addEventListener(t,i)}function jO(e,t,i){e.apiEventService.removeEventListener(t,i)}function ZO(e,t){e.apiEventService.addGlobalListener(t)}function qO(e,t){e.apiEventService.removeGlobalListener(t)}function YO(e){return e.focusService.getFocusedCell()}function QO(e){return e.focusService.clearFocusedCell()}function XO(e,t,i,s){e.focusService.setFocusedCell({rowIndex:t,column:i,rowPinned:s,forceBrowserFocus:!0})}function JO(e,t){return e.navigationService.tabToNextCell(!1,t)}function eV(e,t){return e.navigationService.tabToNextCell(!0,t)}function tV(e,t,i=!1){const s=e.headerNavigationService.getHeaderPositionForColumn(t,i);s&&e.focusService.focusHeaderPosition({headerPosition:s})}function iV(e,t,i){const s=e.columnModel.getCol(t);e.menuService.showColumnMenu({column:s,buttonElement:i,positionBy:"button"})}function sV(e,t,i){let s=e.columnModel.getCol(t);if(s||(s=e.columnModel.getColDefCol(t)),!s){Ve(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:s,mouseEvent:i,positionBy:"mouse"})}function nV(e,t){const i=e.columnModel.getCol(t);if(!i){Ve(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:i,positionBy:"auto"})}function oV(e){e.menuService.hidePopupMenu()}function rV(e,t={}){const i=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(i))}function lV(e,t,i,s,n){e.expansionService.setRowNodeExpanded(t,i,s,n)}function aV(e,t){return e.rowModel.getRowNode(t)}function cV(e,t,i,s){e.rowRenderer.addRenderedRowListener(t,i,s)}function dV(e){return e.rowRenderer.getRenderedNodes()}function uV(e,t,i){e.rowModel.forEachNode(t,i)}function hV(e){return Cm(e)}function Cm(e){return e.rowRenderer.getFirstVirtualRenderedRow()}function pV(e){return vm(e)}function vm(e){return e.rowRenderer.getLastVirtualRenderedRow()}function gV(e,t){return e.rowModel.getRow(t)}function fV(e){return e.rowModel.getRowCount()}function mV(e){return e.rowModel}function CV(e,t){if(!t.nodes.every(a=>a.rowPinned?(W("cannot select pinned rows"),!1):a.id===void 0?(W("cannot select node until id for node is known"),!1):!0))return;const{nodes:s,source:n,newValue:o}=t,r=s;e.selectionService.setNodesSelected({nodes:r,source:n??"api",newValue:o})}function vV(e,t="apiSelectAll"){e.selectionService.selectAllRowNodes({source:t})}function wV(e,t="apiSelectAll"){e.selectionService.deselectAllRowNodes({source:t})}function SV(e,t="apiSelectAllFiltered"){e.selectionService.selectAllRowNodes({source:t,justFiltered:!0})}function yV(e,t="apiSelectAllFiltered"){e.selectionService.deselectAllRowNodes({source:t,justFiltered:!0})}function bV(e,t="apiSelectAllCurrentPage"){e.selectionService.selectAllRowNodes({source:t,justCurrentPage:!0})}function RV(e,t="apiSelectAllCurrentPage"){e.selectionService.deselectAllRowNodes({source:t,justCurrentPage:!0})}function FV(e){return e.selectionService.getSelectedNodes()}function xV(e){return e.selectionService.getSelectedRows()}function EV(e){e.sortController.onSortChanged("api")}var PV={version:ge,moduleName:"@ag-grid-community/core-api",apiFunctions:{getGridId:HO,destroy:WO,isDestroyed:zO,getGridOption:UO,setGridOption:$O,updateGridOptions:mm}},DV={version:ge,moduleName:"@ag-grid-community/row-selection-api",apiFunctions:{setNodesSelected:CV,selectAll:vV,deselectAll:wV,selectAllFiltered:SV,deselectAllFiltered:yV,selectAllOnCurrentPage:bV,deselectAllOnCurrentPage:RV,getSelectedNodes:FV,getSelectedRows:xV}},TV={version:ge,moduleName:"@ag-grid-community/row-api",apiFunctions:{redrawRows:rV,setRowNodeExpanded:lV,getRowNode:aV,addRenderedRowListener:cV,getRenderedNodes:dV,forEachNode:uV,getFirstDisplayedRow:hV,getFirstDisplayedRowIndex:Cm,getLastDisplayedRow:pV,getLastDisplayedRowIndex:vm,getDisplayedRowAtIndex:gV,getDisplayedRowCount:fV,getModel:mV}},AV={version:ge,moduleName:"@ag-grid-community/scroll-api",apiFunctions:{getVerticalPixelRange:gL,getHorizontalPixelRange:fL,ensureColumnVisible:im,ensureIndexVisible:sm,ensureNodeVisible:mL}},MV={version:ge,moduleName:"@ag-grid-community/keyboard-navigation-api",apiFunctions:{getFocusedCell:YO,clearFocusedCell:QO,setFocusedCell:XO,setFocusedHeader:tV,tabToNextCell:JO,tabToPreviousCell:eV}},kV={version:ge,moduleName:"@ag-grid-community/event-api",apiFunctions:{addEventListener:KO,addGlobalListener:ZO,removeEventListener:jO,removeGlobalListener:qO}},IV={version:ge,moduleName:"@ag-grid-community/cell-api",apiFunctions:{expireValueCache:BO,getValue:GO,getCellValue:fm}},LV={version:ge,moduleName:"@ag-grid-community/menu-api",apiFunctions:{showColumnMenuAfterButtonClick:iV,showColumnMenuAfterMouseClick:sV,showColumnMenu:nV,hidePopupMenu:oV}},_V={version:ge,moduleName:"@ag-grid-community/sort-api",apiFunctions:{onSortChanged:EV}},OV={version:ge,moduleName:"@ag-grid-community/api",dependantModules:[PV,xO,DV,mO,TV,SO,AV,TO,MV,kV,NO,IV,LV,_V]};function VV(e){var t;return((t=e.stateService)==null?void 0:t.getState())??{}}function NV(e){switch(e.version||(e.version="32.1.0"),e.version){case"32.1.0":e=BV(e)}return e}function BV(e){return e.cellSelection=GV(e,"rangeSelection"),e}function GV(e,t){if(e&&typeof e=="object")return e[t]}var HV=class extends B{constructor(){super(...arguments),this.beanName="stateService",this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Pt(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Pt(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=Pt(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}wireBeans(e){this.filterManager=e.filterManager,this.ctrlsService=e.ctrlsService,this.pivotResultColsService=e.pivotResultColsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnGroupStateService=e.columnGroupStateService,this.columnGetStateService=e.columnGetStateService,this.paginationService=e.paginationService,this.selectionService=e.selectionService,this.expansionService=e.expansionService,this.columnAnimationService=e.columnAnimationService,this.columnApplyStateService=e.columnApplyStateService,this.sideBarService=e.sideBarService,this.rangeService=e.rangeService}postConstruct(){this.isClientSideRowModel=Ye(this.gos),this.cachedState=this.getInitialState(),this.ctrlsService.whenReady(this,()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const[e,t,i]=this.addManagedEventListeners({newColumnsLoaded:({source:s})=>{s==="gridInitializing"&&(e(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))},rowCountReady:()=>{t==null||t(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())},firstDataRendered:()=>{i==null||i(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())}})}getInitialState(){return NV(this.gos.get("initialState")??{})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState());const e=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:e,sideBarUpdated:e})}setupStateOnColumnsInitialised(){const e=this.getInitialState();this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState());const t=i=>()=>this.updateColumnState([i]);this.addManagedEventListeners({columnValueChanged:t("aggregation"),columnMoved:t("columnOrder"),columnPinned:t("columnPinning"),columnResized:t("columnSizing"),columnVisible:t("columnVisibility"),columnPivotChanged:t("pivot"),columnPivotModeChanged:t("pivot"),columnRowGroupChanged:t("rowGroup"),sortChanged:t("sort"),newColumnsLoaded:()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setupStateOnRowCountReady(){const{filter:e,rowGroupExpansion:t,rowSelection:i,pagination:s}=this.getInitialState(),n=this.gos.get("advancedFilterModel");(e||n)&&this.setFilterState(e,n),t&&this.setRowGroupExpansionState(t),i&&this.setRowSelectionState(i),s&&this.setPaginationState(s),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState());const o=()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState());this.addManagedEventListeners({filterChanged:()=>this.updateCachedState("filter",this.getFilterState()),rowGroupOpened:()=>this.onRowGroupOpenedDebounced(),expandOrCollapseAll:o,columnRowGroupChanged:o,rowDataUpdated:()=>{this.gos.get("groupDefaultExpanded")!==0&&setTimeout(()=>{o()})},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())}})}setupStateOnFirstDataRendered(){const{scroll:e,cellSelection:t,focusedCell:i,columnOrder:s}=this.getInitialState();i&&this.setFocusedCellState(i),t&&this.setCellSelectionState(t),e&&this.setScrollState(e),this.setColumnPivotState(!!(s!=null&&s.orderedColIds)),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState());const n=this.getRangeSelectionState();this.updateCachedState("rangeSelection",n),this.updateCachedState("cellSelection",n),this.updateCachedState("scroll",this.getScrollState()),this.addManagedEventListeners({cellFocused:()=>this.updateCachedState("focusedCell",this.getFocusedCellState()),cellSelectionChanged:o=>{if(o.finished){const r=this.getRangeSelectionState();this.updateCachedState("rangeSelection",r),this.updateCachedState("cellSelection",r)}},bodyScrollEnd:()=>this.updateCachedState("scroll",this.getScrollState())})}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],n=[],o=[],r=[],a=[],d=[],h=[];let g=0;const f=this.columnGetStateService.getColumnState();for(let C=0;C<f.length;C++){const{colId:v,sort:S,sortIndex:R,rowGroup:y,rowGroupIndex:x,aggFunc:P,pivot:T,pivotIndex:I,pinned:V,hide:_,width:O,flex:M}=f[C];h.push(v),S&&(t[R??g++]={colId:v,sort:S}),y&&(i[x??0]=v),typeof P=="string"&&s.push({colId:v,aggFunc:P}),T&&(n[I??0]=v),V&&(V==="right"?r:o).push(v),_&&a.push(v),(M||O)&&d.push({colId:v,flex:M??void 0,width:O})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:n.length||e?{pivotMode:e,pivotColIds:n}:void 0,columnPinning:o.length||r.length?{leftColIds:o,rightColIds:r}:void 0,columnVisibility:a.length?{hiddenColIds:a}:void 0,columnSizing:d.length?{columnSizingModel:d}:void 0,columnOrder:h.length?{orderedColIds:h}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:n,columnPinning:o,columnVisibility:r,columnSizing:a,columnOrder:d,partialColumnState:h}=e,g={},f=y=>{let x=g[y];return x||(x={colId:y},g[y]=x,x)},C=h?{}:{sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};t&&(t.sortModel.forEach(({colId:y,sort:x},P)=>{const T=f(y);T.sort=x,T.sortIndex=P}),C.sort=null,C.sortIndex=null),i&&(i.groupColIds.forEach((y,x)=>{const P=f(y);P.rowGroup=!0,P.rowGroupIndex=x}),C.rowGroup=null,C.rowGroupIndex=null),s&&(s.aggregationModel.forEach(({colId:y,aggFunc:x})=>{f(y).aggFunc=x}),C.aggFunc=null),n&&(n.pivotColIds.forEach((y,x)=>{const P=f(y);P.pivot=!0,P.pivotIndex=x}),this.gos.updateGridOptions({options:{pivotMode:n.pivotMode},source:"gridInitializing"}),C.pivot=null,C.pivotIndex=null),o&&(o.leftColIds.forEach(y=>{f(y).pinned="left"}),o.rightColIds.forEach(y=>{f(y).pinned="right"}),C.pinned=null),r&&(r.hiddenColIds.forEach(y=>{f(y).hide=!0}),C.hide=null),a&&(a.columnSizingModel.forEach(({colId:y,flex:x,width:P})=>{const T=f(y);T.flex=x??null,T.width=P}),C.flex=null);const v=d==null?void 0:d.orderedColIds,S=!!(v!=null&&v.length),R=S?v.map(y=>f(y)):Object.values(g);R.length&&(this.columnStates=R,this.columnApplyStateService.applyColumnState({state:R,applyOrder:S,defaultState:C},"gridInitializing"))}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,!!this.pivotResultColsService.isPivotResultColsPresent()){if(t){const s=[];for(const n of t)this.pivotResultColsService.getPivotResultCol(n.colId)&&s.push(n);this.columnApplyStateService.applyColumnState({state:s,applyOrder:e},"gridInitializing")}i&&this.columnGroupStateService.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnGroupStateService.getColumnGroupState(),t=[];return e.forEach(({groupId:i,open:s})=>{s&&t.push(i)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var n;if(!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const t=new Set((n=e.columnGroup)==null?void 0:n.openColumnGroupIds),s=this.columnGroupStateService.getColumnGroupState().map(({groupId:o})=>{const r=t.has(o);return r&&t.delete(o),{groupId:o,open:r}});t.forEach(o=>{s.push({groupId:o,open:!0})}),s.length&&(this.columnGroupStates=s),this.columnGroupStateService.setColumnGroupState(s,"gridInitializing")}getFilterState(){var i,s;let e=(i=this.filterManager)==null?void 0:i.getFilterModel();e&&Object.keys(e).length===0&&(e=void 0);const t=((s=this.filterManager)==null?void 0:s.getAdvancedFilterModel())??void 0;return e||t?{filterModel:e,advancedFilterModel:t}:void 0}setFilterState(e,t){var n,o;const{filterModel:i,advancedFilterModel:s}=e??{advancedFilterModel:t};i&&((n=this.filterManager)==null||n.setFilterModel(i,"columnFilter")),s&&((o=this.filterManager)==null||o.setAdvancedFilterModel(s))}getRangeSelectionState(){var t;const e=(t=this.rangeService)==null?void 0:t.getCellRanges().map(i=>{const{id:s,type:n,startRow:o,endRow:r,columns:a,startColumn:d}=i;return{id:s,type:n,startRow:o,endRow:r,colIds:a.map(h=>h.getColId()),startColId:d.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeService:i,columnModel:s,visibleColsService:n}=this;if(!Ot(t)||!i)return;const o=[];if(e.cellRanges.forEach(r=>{const a=[];if(r.colIds.forEach(h=>{const g=s.getCol(h);g&&a.push(g)}),!a.length)return;let d=s.getCol(r.startColId);if(!d){const h=n.getAllCols(),g=new Set(a);d=h.find(f=>g.has(f))}o.push({...r,columns:a,startColumn:d})}),od(t)&&Qo(t)&&o.length>1)return W("cannot add multiple ranges when `selection.suppressMultiRanges = true`");i.setCellRanges(o)}getScrollState(){var s;if(!this.isClientSideRowModel)return;const e=(s=this.ctrlsService.getGridBodyCtrl())==null?void 0:s.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:i}=(e==null?void 0:e.getVScrollPosition())??{top:0};return i||t?{top:i,left:t}:void 0}setScrollState(e){var s;if(!this.isClientSideRowModel)return;const{top:t,left:i}=e;(s=this.ctrlsService.getGridBodyCtrl())==null||s.getScrollFeature().setScrollPosition(t,i)}getSideBarState(){var e,t;return(t=(e=this.sideBarService)==null?void 0:e.getSideBarComp())==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getCol(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){if(!this.paginationService)return;const e=this.paginationService.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationService.getPageSize();if(!(!e&&!t))return{page:e,pageSize:t}}setPaginationState(e){this.paginationService&&(e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationService.setPageSize(e.pageSize,"initialState"),typeof e.page=="number"&&this.paginationService.setPage(e.page))}getRowSelectionState(){var i;const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(e.selectAll===!1||e.selectAllChildren===!1)&&!((i=e==null?void 0:e.toggledNodes)!=null&&i.length)?void 0:e}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([s,n])=>{Zo(n,this.cachedState[s])||(i=!0)}),this.cachedState={...this.cachedState,...t},i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),Zo(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){this.staleStateKeys.forEach(e=>{switch(e){case"rowSelection":this.setCachedStateValue(e,this.getRowSelectionState());break}}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(t=>this.queuedUpdateSources.add(t)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear(),this.eventService.dispatchEvent({type:"stateUpdated",sources:e,state:this.cachedState})}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}},wm={version:ge,moduleName:"@ag-grid-community/state-core",beans:[HV]},WV={version:ge,moduleName:"@ag-grid-community/state-api",apiFunctions:{getState:VV},dependantModules:[wm]},zV={version:ge,moduleName:"@ag-grid-community/state",dependantModules:[wm,WV]};function UV(e){return e.rowModel.isLastRowIndexKnown()}function $V(e){var t;return((t=e.paginationService)==null?void 0:t.getPageSize())??100}function KV(e){var t;return((t=e.paginationService)==null?void 0:t.getCurrentPage())??0}function jV(e){var t;return((t=e.paginationService)==null?void 0:t.getTotalPages())??1}function ZV(e){return e.paginationService?e.paginationService.getMasterRowCount():e.rowModel.getRowCount()}function qV(e){var t;(t=e.paginationService)==null||t.goToNextPage()}function YV(e){var t;(t=e.paginationService)==null||t.goToPreviousPage()}function QV(e){var t;(t=e.paginationService)==null||t.goToFirstPage()}function XV(e){var t;(t=e.paginationService)==null||t.goToLastPage()}function JV(e,t){var i;(i=e.paginationService)==null||i.goToPage(t)}var eN=class extends B{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}postConstruct(){this.ctrlsService.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.paginationService.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const i=Math.max(on(this.gos),1),s=Math.floor(e/i);this.paginationService.setPageSize(s,"autoCalculated")};this.isBodyRendered?Pt(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};function tN(e,t,i){e.addManagedElementListeners(t,{keydown:s=>{if(!s.defaultPrevented&&s.key===N.TAB){const n=s.shiftKey;i.findNextFocusableElement(t,!1,n)||i.focusNextGridCoreContainer(n)&&s.preventDefault()}}})}var fr="paginationPageSizeSelector",iN=class extends Pe{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationService.getPageSize()||(this.paginationService.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.paginationService=e.paginationService}postConstruct(){this.addManagedPropertyListener(fr,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.paginationService.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){yt(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(fr)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationService.getPageSize(),i=!t||!e.includes(t);if(i){const n=this.gos.exists("paginationPageSize"),o=this.gos.get(fr)!==!0;W(`'paginationPageSize=${t}'${n?"":" (default value)"}, but ${t} is not included in${o?"":" the default"} paginationPageSizeSelector=[${e.join(", ")}].`),o||W(`Either set '${fr}' to an array that includes ${t} or to 'false' to disable the page size selector.`),e.unshift("")}const s=String(i?"":t);this.selectPageSizeComp?(Ni(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=i}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const i=this.localeService.getLocaleTextFunc(),s=i("pageSizeSelectorLabel","Page Size:"),n=i("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new $d).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(n).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(fr);return!Array.isArray(t)||gt(t)?e:[...t].sort((i,s)=>i-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},sN={selector:"AG-PAGE-SIZE-SELECTOR",component:iN},nN=class extends rm{constructor(){super(),this.btFirst=J,this.btPrevious=J,this.btNext=J,this.btLast=J,this.lbRecordCount=J,this.lbFirstRowOnPage=J,this.lbLastRowOnPage=J,this.lbCurrent=J,this.lbTotal=J,this.pageSizeComp=J,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.focusService=e.focusService,this.ariaAnnouncementService=e.ariaAnnouncementService}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[sN]);const{btFirst:t,btPrevious:i,btNext:s,btLast:n}=this;this.activateTabIndex([t,i,s,n]),t.insertAdjacentElement("afterbegin",bt(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",bt(e?"next":"previous",this.gos)),s.insertAdjacentElement("afterbegin",bt(e?"previous":"next",this.gos)),n.insertAdjacentElement("afterbegin",bt(e?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:o=>{this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(o):this.focusService.focusGridInnerElement(o)},forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)}),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListeners(t,{click:i,keydown:s=>{(s.key===N.ENTER||s.key===N.SPACE)&&(s.preventDefault(),i())}})}),tN(this,this.getGui(),this.focusService),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationService.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc(),s=i("thousandSeparator",","),n=i("decimalSeparator",".");return FM(e,s,n)}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),n=e("firstPage","First Page"),o=e("previousPage","Previous Page"),r=e("nextPage","Next Page"),a=e("lastPage","Last Page"),d=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${d}">
186
+ <ag-page-size-selector data-ref="pageSizeComp"></ag-page-size-selector>
187
+ <span class="ag-paging-row-summary-panel">
188
+ <span id="ag-${d}-first-row" data-ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>
189
+ <span id="ag-${d}-to">${i}</span>
190
+ <span id="ag-${d}-last-row" data-ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>
191
+ <span id="ag-${d}-of">${s}</span>
192
+ <span id="ag-${d}-row-count" data-ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>
193
+ </span>
194
+ <span class="ag-paging-page-summary-panel" role="presentation">
195
+ <div data-ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>
196
+ <div data-ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>
197
+ <span class="ag-paging-description">
198
+ <span id="ag-${d}-start-page">${t}</span>
199
+ <span id="ag-${d}-start-page-number" data-ref="lbCurrent" class="ag-paging-number"></span>
200
+ <span id="ag-${d}-of-page">${s}</span>
201
+ <span id="ag-${d}-of-page-number" data-ref="lbTotal" class="ag-paging-number"></span>
202
+ </span>
203
+ <div data-ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>
204
+ <div data-ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>
205
+ </span>
206
+ </div>`}onBtNext(){this.nextButtonDisabled||this.paginationService.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationService.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationService.goToLastPage()}enableOrDisableButtons(){const e=this.paginationService.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),i=this.paginationService.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),n=e===i-1;this.nextButtonDisabled=n||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){BT(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages(),i=this.paginationService.getMasterRowCount(),s=e?i:null;if(s===1){const P=this.rowModel.getRow(0);if(P&&P.group&&!(P.groupData||P.aggData)){this.setTotalLabelsToZero();return}}const n=this.paginationService.getCurrentPage(),o=this.paginationService.getPageSize();let r,a;this.isZeroPagesToDisplay()?r=a=0:(r=o*n+1,a=r+o-1,e&&a>s&&(a=s));const d=r+o-1,h=!e&&i<d,g=this.formatNumber(r);this.lbFirstRowOnPage.textContent=g;let f;const C=this.localeService.getLocaleTextFunc();h?f=C("pageLastRowUnknown","?"):f=this.formatNumber(a),this.lbLastRowOnPage.textContent=f;const S=t>0?n+1:0,R=this.formatNumber(S);this.lbCurrent.textContent=R;let y,x;if(e)y=this.formatNumber(t),x=this.formatNumber(s);else{const P=C("more","more");y=P,x=P}this.lbTotal.textContent=y,this.lbRecordCount.textContent=x,this.announceAriaStatus(g,f,x,R,y)}announceAriaStatus(e,t,i,s,n){const o=this.localeService.getLocaleTextFunc(),r=o("page","Page"),a=o("to","to"),d=o("of","of"),h=`${e} ${a} ${t} ${d} ${i}`,g=`${r} ${s} ${d} ${n}`;h!==this.ariaRowStatus&&(this.ariaRowStatus=h,this.ariaAnnouncementService.announceValue(h,"paginationRow")),g!==this.ariaPageStatus&&(this.ariaPageStatus=g,this.ariaAnnouncementService.announceValue(g,"paginationPage"))}setTotalLabelsToZero(){const e=this.formatNumber(0);this.lbFirstRowOnPage.textContent=e,this.lbCurrent.textContent=e,this.lbLastRowOnPage.textContent=e,this.lbTotal.textContent=e,this.lbRecordCount.textContent=e,this.announceAriaStatus(e,e,e,e,e)}},oN={selector:"AG-PAGINATION",component:nN},rN=class extends B{constructor(){super(...arguments),this.beanName="paginationService",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return oN}isPaginateChildRows(){return this.gos.get("groupRemoveSingleChildren")||this.gos.get("groupRemoveLowestSingleChildren")?!0:this.gos.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){!this.active||this.currentPage===e||typeof this.currentPage!="number"||(this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0}))}isRowPresent(e){return e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return this.active?this.getPageForIndex(e.rowIndex)===this.currentPage:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return j(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:j(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:j(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:j(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.pageBoundsService.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}i!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const s=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=s-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),this.masterRowCount===0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:i=!1,newPageSize:s=!1}=e;this.eventService.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:i,newPageSize:s,keepRenderedRows:t})}},Sm={version:ge,moduleName:"@ag-grid-community/pagination-core",beans:[rN,eN]},lN={version:ge,moduleName:"@ag-grid-community/pagination-api",dependantModules:[Sm],apiFunctions:{paginationIsLastPageFound:UV,paginationGetPageSize:$V,paginationGetCurrentPage:KV,paginationGetTotalPages:jV,paginationGetRowCount:ZV,paginationGoToNextPage:qV,paginationGoToPreviousPage:YV,paginationGoToFirstPage:QV,paginationGoToLastPage:XV,paginationGoToPage:JV}},aN={version:ge,moduleName:"@ag-grid-community/pagination",dependantModules:[Sm,lN]},Bt="clientSide",Mt="serverSide",eo="infinite",cN={onGroupExpandedOrCollapsed:[Bt],refreshClientSideRowModel:[Bt],isRowDataEmpty:[Bt],forEachLeafNode:[Bt],forEachNodeAfterFilter:[Bt],forEachNodeAfterFilterAndSort:[Bt],resetRowHeights:[Bt],applyTransaction:[Bt],applyTransactionAsync:[Bt],flushAsyncTransactions:[Bt],getBestCostNodeSelection:[Bt],getServerSideSelectionState:[Mt],setServerSideSelectionState:[Mt],applyServerSideTransaction:[Mt],applyServerSideTransactionAsync:[Mt],applyServerSideRowData:[Mt],retryServerSideLoads:[Mt],flushServerSideAsyncTransactions:[Mt],refreshServerSide:[Mt],getServerSideGroupLevelState:[Mt],refreshInfiniteCache:[eo],purgeInfiniteCache:[eo],getInfiniteRowCount:[eo],isLastRowIndexKnown:[eo,Mt],expandAll:[Bt,Mt],collapseAll:[Bt,Mt],onRowHeightChanged:[Bt,Mt],setRowCount:[eo,Mt],getCacheBlockState:[eo,Mt]},dN={getValue:{version:"v31.3",new:"getCellValue"},getFirstDisplayedRow:{version:"v31.1",new:"getFirstDisplayedRowIndex"},getLastDisplayedRow:{version:"v31.1",new:"getLastDisplayedRowIndex"},getModel:{version:"v31.1",message:"Please use the appropriate grid API methods instead."},setColumnVisible:{version:"v31.1",old:"setColumnVisible(key,visible)",new:"setColumnsVisible([key],visible)"},setColumnPinned:{version:"v31.1",old:"setColumnPinned(key,pinned)",new:"setColumnsPinned([key],pinned)"},moveColumn:{version:"v31.1",old:"moveColumn(key, toIndex)",new:"moveColumns([key], toIndex)"},setColumnWidth:{version:"v31.1",old:"setColumnWidth(col, width)",new:"setColumnWidths([{key: col, newWidth: width}])"},autoSizeColumn:{version:"v31.1",old:"autoSizeColumn(key, skipHeader)",new:"autoSizeColumns([key], skipHeader)"},addAggFunc:{version:"v31.1",old:"addAggFunc(key, func)",new:"addAggFuncs({ key: func })"},removeValueColumn:{version:"v31.1",old:"removeValueColumn(colKey)",new:"removeValueColumns([colKey])"},addValueColumn:{version:"v31.1",old:"addValueColumn(colKey)",new:"addValueColumns([colKey])"},removeRowGroupColumn:{version:"v31.1",old:"removeRowGroupColumn(colKey)",new:"removeRowGroupColumns([colKey])"},addRowGroupColumn:{version:"v31.1",old:"addRowGroupColumn(colKey)",new:"addRowGroupColumns([colKey])"},removePivotColumn:{version:"v31.1",old:"removePivotColumn(colKey)",new:"removePivotColumns([colKey])"},addPivotColumn:{version:"v31.1",old:"addPivotColumn(colKey)",new:"addPivotColumns([colKey])"},showColumnMenuAfterButtonClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere."},showColumnMenuAfterMouseClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere."},getFilterInstance:{version:"v31.1",message:"'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."},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()"}};function uN(e,t,i){const s=dN[e];if(s){const{version:o,new:r,old:a,message:d}=s,h=a??e;return(...g)=>{const f=r?`Please use ${r} instead. `:"";return W(`Since ${o} api.${h} is deprecated. ${f}${d??""}`),t.apply(t,g)}}const n=cN[e];return n?(...o)=>{const r=i.rowModel.getType();if(!n.includes(r)){Ve(`api.${e} can only be called when gridOptions.rowModelType is ${n.join(" or ")}`);return}return t.apply(t,o)}:t}var hN={columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"},checkboxSelection:{version:"32.2",message:"Use `selection.checkboxes` in `GridOptions` instead."},headerCheckboxSelection:{version:"32.2",message:"Use `selection.headerCheckbox = true` in `GridOptions` instead."},headerCheckboxSelectionFilteredOnly:{version:"32.2",message:'Use `selection.selectAll = "filtered"` in `GridOptions` instead.'},headerCheckboxSelectionCurrentPageOnly:{version:"32.2",message:'Use `selection.selectAll = "currentPage"` in `GridOptions` instead.'},showDisabledCheckboxes:{version:"32.2",message:"Use `selection.hideDisabledCheckboxes = true` in `GridOptions` instead."}},_s=(e,t)=>(t.rowModelType??"clientSide")==="clientSide"?{module:"@ag-grid-enterprise/row-grouping"}:null,pN={enableRowGroup:_s,rowGroup:_s,rowGroupIndex:_s,enablePivot:_s,enableValue:_s,pivot:_s,pivotIndex:_s,aggFunc:_s,cellEditor:e=>e.cellEditor==="agRichSelect"||e.cellEditor==="agRichSelectCellEditor"?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{var i;const t=["columnsMenuTab","generalMenuTab"];return(i=e.menuTabs)!=null&&i.some(s=>t.includes(s))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],validate:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],validate:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>to},gN={headerName:void 0,columnGroupShow: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,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc: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,columnsMenuParams: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,suppressCellFlash: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,suppressMenu: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,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter: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},fN=Object.keys(gN),to={objectName:"colDef",allProperties:fN,docsUrl:"column-properties/",deprecations:hN,validations:pN},mN={},CN={},vN={mode:void 0,enableClickSelection:void 0,suppressMultiRanges:void 0,hideDisabledCheckboxes:void 0,checkboxes:void 0,headerCheckbox:void 0,isRowSelectable:void 0,groupSelects:void 0,selectAll:void 0,enableMultiSelectWithClick:void 0,handle:void 0,copySelectedRows:void 0},wN=Object.keys(vN),SN={objectName:"selection",allProperties:wN,docsUrl:"grid-options/#reference-selection-selection/",deprecations:mN,validations:CN},yN=()=>({advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."},suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."},enableFillHandle:{version:"32.2",message:"Use `selection.handle` instead."},enableRangeHandle:{version:"32.2",message:"Use `selection.handle` instead."},enableRangeSelection:{version:"32.2",message:'Use `selection.mode = "cell"` instead.'},rowSelection:{version:"32.2",message:'Use `selection.mode = "singleRow"` or `selection.mode = "multiRow" instead.'},suppressMultiRangeSelection:{version:"32.2",message:"Use `selection.suppressMultiRanges` instead."},suppressClearOnFillReduction:{version:"32.2",message:"Use `selection.handle.suppressClearOnFillReduction` instead."},fillHandleDirection:{version:"32.2",message:"Use `selection.handle.direction` instead."},fillOperation:{version:"32.2",message:"Use `selection.handle.setFillValue` instead."},suppressRowClickSelection:{version:"32.2",message:"Use `selection.enableClickSelection` instead."},suppressRowDeselection:{version:"32.2",message:"Use `selection.suppressDeselection` instead."},rowMultiSelectWithClick:{version:"32.2",message:"Use `selection.enableMultiSelectWithClick` instead."},groupSelectsChildren:{version:"32.2",message:'Use `selection.groupSelects = "descendants"` instead.'},groupSelectsFiltered:{version:"32.2",message:'Use `selection.groupSelects = "filteredDescendants"` instead.'},isRowSelectable:{version:"32.2",message:"Use `selectionOptions.isRowSelectable` instead."},suppressCopySingleCellRanges:{version:"32.2",message:"Use `selection.copySelectedRows` instead."},suppressCopyRowsToClipboard:{version:"32.2",message:"Use `selection.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."}}),bN={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,enableStrictPivotColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressMoveWhenColumnDragging:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!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,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!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,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!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,suppressGroupMaintainValueType:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0,suppressSetFilterByDefault:!1},RN=()=>({sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",validate:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const i=`treeData requires 'getDataPath' in the ${t} row model.`;return e.getDataPath?null:i}case"serverSide":{const i=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:i}}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],validate:e=>{switch(e.rowModelType??"clientSide"){case"clientSide":return null;case"serverSide":return e.suppressServerSideInfiniteScroll?"groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll":null}return null}},groupHideOpenParents:{supportedRowModels:["clientSide","serverSide"],dependencies:{groupTotalRow:[void 0,"bottom"]}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},paginationPageSizeSelector:{validate:e=>{const t=e.paginationPageSizeSelector;return typeof t=="boolean"||t==null||t.length?null:`'paginationPageSizeSelector' cannot be an empty array.
207
+ If you want to hide the page size selector, set paginationPageSizeSelector to false.`}},columnDefs:()=>to,defaultColDef:()=>to,defaultColGroupDef:()=>to,autoGroupColumnDef:()=>to,selectionColumnDef:()=>to,selection:()=>SN}),FN=()=>({objectName:"gridOptions",allProperties:[...er.ALL_PROPERTIES,...bi.EVENT_CALLBACKS],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:yN(),validations:RN()}),xN=class extends B{constructor(){super(...arguments),this.beanName="validationService"}wireBeans(e){this.beans=e,this.gridOptions=e.gridOptions}postConstruct(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,FN())}validateApiFunction(e,t){return uN(e,t,this.beans)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:n,propertyExceptions:o,objectName:r,docsUrl:a}=t;n&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(e,[...o??[],...Object.keys(s)],n,r,a);const d=new Set;Object.keys(e).forEach(g=>{const f=s[g];if(f)if("renamed"in f){const{renamed:T,version:I}=f;d.add(`As of v${I}, ${String(g)} is deprecated. Please use ${String(T)} instead.`),e[T]=e[g]}else{const{message:T,version:I}=f;d.add(`As of v${I}, ${String(g)} is deprecated. ${T??""}`)}const C=e[g];if(C==null||C===!1)return;const v=i[g];let S;if(v)if(typeof v=="function"){const T=v(e,this.gridOptions);if(!T)return;if("objectName"in T){const I=e[g];if(Array.isArray(I)){I.forEach(V=>{this.processOptions(V,T)});return}this.processOptions(e[g],T);return}S=T}else S=v;else return;const{module:R,dependencies:y,validate:x,supportedRowModels:P}=S;if(P){const T=this.gridOptions.rowModelType??"clientSide";if(!P.includes(T)){d.add(`${String(g)} is not supported with the '${T}' row model.`);return}}if(R){const T=Array.isArray(R)?R:[R];let I=!0;if(T.forEach(V=>{this.gos.assertModuleRegistered(V,String(g))||(I=!1,d.add(`${String(g)} is only available when ${V} is loaded.`))}),!I)return}if(y){const T=this.checkForRequiredDependencies(g,y,e);if(T){d.add(T);return}}if(x){const T=x(e,this.gridOptions);if(T){d.add(T);return}}}),d.size>0&&d.forEach(g=>{W(g)})}checkForRequiredDependencies(e,t,i){const n=Object.entries(t).find(([a,d])=>{const h=i[a];return!d.includes(h)});if(!n)return null;const[o,r]=n;return r.length>1?`'${String(e)}' requires '${o}' to be one of [${r.join(", ")}].`:`'${String(e)}' requires '${o}' to be ${r[0]}.`}checkProperties(e,t,i,s,n){const o=["__ob__","__v_skip","__metadata__"],r=DA(Object.getOwnPropertyNames(e),[...o,...t,...i],i);if(ni(r,(a,d)=>{let h=`invalid ${s} property '${a}' did you mean any of these: ${d.slice(0,8).join(", ")}.`;i.includes("context")&&(h+=`
208
+ If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),W(h)}),Object.keys(r).length>0&&n){const a=this.getFrameworkOverrides().getDocLink(n);W(`to see all the valid ${s} properties please check: ${a}`)}}},EN={version:ge,moduleName:"@ag-grid-community/core"},PN={version:ge,moduleName:"@ag-grid-community/core-validations",beans:[xN]},DN={version:ge,moduleName:"@ag-grid-community/core-community-features",dependantModules:[EN,PN,LL,ak,zV,fO,F_,aN,OV]},TN=class extends B{constructor(){super(...arguments),this.beanName="gridDestroyService",this.destroyCalled=!1}wireBeans(e){this.beans=e}destroy(){var e,t;this.destroyCalled||(this.eventService.dispatchEvent({type:"gridPreDestroyed",state:((e=this.beans.stateService)==null?void 0:e.getState())??{}}),this.destroyCalled=!0,(t=this.beans.ctrlsService.get("gridCtrl"))==null||t.destroyGridUi(),this.beans.context.destroy(),super.destroy())}isDestroyCalled(){return this.destroyCalled}},mr=new Set(["gridPreDestroyed","fillStart","pasteStart"]),AN=e=>e==="checkboxSelected"||e==="rowClicked"||e==="spaceKey"||e==="uiSelectAll"||e==="uiSelectAllCurrentPage"||e==="uiSelectAllFiltered",MN=new Map([...er.BOOLEAN_PROPERTIES.map(e=>[e,td]),...er.NUMBER_PROPERTIES.map(e=>[e,Ef]),["groupAggFiltering",e=>typeof e=="function"?e:td(e)],["pageSize",Wi(1)],["autoSizePadding",Wi(0)],["keepDetailRowsCount",Wi(1)],["rowBuffer",Wi(0)],["infiniteInitialRowCount",Wi(1)],["cacheOverflowSize",Wi(1)],["cacheBlockSize",Wi(1)],["serverSideInitialRowCount",Wi(1)],["viewportRowModelPageSize",Wi(1)],["viewportRowModelBufferSize",Wi(0)]]);function ym(e,t){const i=MN.get(e);return i?i(t):t}function kN(e){const t={};return Object.entries(e).forEach(([i,s])=>{const n=ym(i,s);t[i]=n}),t}var bm=class Vw extends B{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new Gn,this.globalEventHandlerFactory=t=>(i,s)=>{if(!this.isAlive())return;const n=mr.has(i);if(n&&!t||!n&&t)return;const o=bi.getCallbackForEvent(i),r=this.gridOptions[o];typeof r=="function"&&this.frameworkOverrides.wrapOutgoing(()=>{r(s)})}}wireBeans(t){this.gridOptions=t.gridOptions,this.eGridDiv=t.eGridDiv,this.validationService=t.validationService,this.environment=t.environment,this.api=t.gridApi,this.gridId=t.context.getGridId()}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){const t=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),t),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.addManagedEventListeners({gridOptionsChanged:({options:i})=>{this.updateGridOptions({options:i,force:!0,source:"gridOptionsUpdated"})}})}get(t){return this.gridOptions[t]??bN[t]}getCallback(t){return this.mergeGridCommonParams(this.gridOptions[t])}exists(t){return j(this.gridOptions[t])}mergeGridCommonParams(t){return t&&(s=>{const n=s;return n.api=this.api,n.context=this.gridOptionsContext,t(n)})}updateGridOptions({options:t,force:i,source:s="api"}){var r;const n={id:Vw.changeSetId++,properties:[]},o=[];Object.entries(t).forEach(([a,d])=>{s==="api"&&kT[a]&&W(`${a} is an initial property and cannot be updated.`);const h=ym(a,d),g=i||typeof h=="object"&&s==="api",f=this.gridOptions[a];if(g||f!==h){this.gridOptions[a]=h;const C={type:a,currentValue:h,previousValue:f,changeSet:n,source:s};o.push(C)}}),(r=this.validationService)==null||r.processGridOptions(this.gridOptions),n.properties=o.map(a=>a.type),o.forEach(a=>{this.gridOptions.debug&&si(`Updated property ${a.type} from`,a.previousValue," to ",a.currentValue),this.propertyEventService.dispatchEvent(a)})}addPropertyEventListener(t,i){this.propertyEventService.addEventListener(t,i)}removePropertyEventListener(t,i){this.propertyEventService.removeEventListener(t,i)}getDomDataKey(){return this.domDataKey}getGridCommonParams(){return{api:this.api,context:this.gridOptionsContext}}addGridCommonParams(t){const i=t;return i.api=this.api,i.context=this.gridOptionsContext,i}assertModuleRegistered(t,i){return ss.__assertRegistered(t,i,this.gridId)}isModuleRegistered(t){return ss.__isRegistered(t,this.gridId)}};bm.changeSetId=0;var IN=bm,LN=class extends B{constructor(){super(...arguments),this.beanName="headerPositionUtils"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}findHeader(e,t){let i,s;if(ot(e.column)?i=this.visibleColsService.getGroupAtDirection(e.column,t):(s=`getCol${t}`,i=this.visibleColsService[s](e.column)),!i)return;const{headerRowIndex:n}=e;if(this.getHeaderRowType(n)!=="filter"){const a=[i];for(;i.getParent();)i=i.getParent(),a.push(i);i=a[a.length-1-n]}const{column:o,headerRowIndex:r}=this.getHeaderIndexToFocus(i,n);return{column:o,headerRowIndex:r}}getHeaderIndexToFocus(e,t){let i;if(ot(e)&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let n=i;for(;n!==s;)t++,n=n.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return e?e.getLeafColumns().some(t=>t.isSpanHeaderHeight()):!1}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s=i==="filter",n=i==="column";let o=s?e:e.getParent(),r=t-1,a=r;if(n&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;o&&o.isPadding();)o=o.getParent(),r--;a=r,r<0&&(o=e,r=t,a=void 0)}return{column:o,headerRowIndex:r,headerRowIndexWithoutSpan:a}}getColumnVisibleChild(e,t,i="After"){const s=this.getHeaderRowType(t);let n=e,o=t+1;const r=o;if(s==="group"){const a=e.getDisplayedLeafColumns(),d=i==="After"?a[0]:ce(a),h=[];let g=d;for(;g.getParent()!==e;)g=g.getParent(),h.push(g);if(n=d,d.isSpanHeaderHeight())for(let f=h.length-1;f>=0;f--){const C=h[f];if(!C.isPadding()){n=C;break}o++}else n=ce(h),n||(n=d)}return{column:n,headerRowIndex:o,headerRowIndexWithoutSpan:r}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.visibleColsService.getAllCols(),s=i[t==="start"?0:i.length-1];if(!s)return;const n=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()),o=n==null?void 0:n.getRowType(e);if(o=="group"){const r=this.visibleColsService.getColGroupAtLevel(s,e);return{headerRowIndex:e,column:r}}return{headerRowIndex:o==null?-1:e,column:s}}},_N=class extends B{constructor(){super(...arguments),this.beanName="localeService"}getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(i,s,n)=>e({key:i,defaultValue:s,variableValues:n});const t=this.gos.get("localeText");return(i,s,n)=>{let o=t&&t[i];if(o&&n&&n.length){let r=0;for(;!(r>=n.length||o.indexOf("${variable}")===-1);)o=o.replace("${variable}",n[r++])}return o??s}}},ON=class extends B{constructor(){super(...arguments),this.beanName="apiEventService",this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new fd(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=Fl(this.gos)&&!mr.has(e),n=s?this.asyncEventListeners:this.syncEventListeners;n.has(e)||n.set(e,new Set),n.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){var o;const i=this.frameworkEventWrappingService.unwrap(t),s=this.asyncEventListeners.get(e),n=!!(s!=null&&s.delete(i));n||(o=this.syncEventListeners.get(e))==null||o.delete(i),this.eventService.removeEventListener(e,i,n)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(Fl(this.gos)){const s=(o,r)=>{mr.has(o)&&t(o,r)},n=(o,r)=>{mr.has(o)||t(o,r)};this.globalEventListenerPairs.set(e,{syncListener:s,asyncListener:n}),this.eventService.addGlobalListener(s,!1),this.eventService.addGlobalListener(n,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:s,asyncListener:n}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(s,!1),this.eventService.removeGlobalListener(n,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((i,s)=>{i.forEach(n=>this.eventService.removeEventListener(s,n,t)),i.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(i=>this.eventService.removeGlobalListener(i,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}},VN=class extends B{constructor(){super(...arguments),this.beanName="pageBoundsListener"}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages(),this.eventService.dispatchEvent({type:"paginationChanged",animate:(e==null?void 0:e.animate)??!1,newData:(e==null?void 0:e.newData)??!1,newPage:(e==null?void 0:e.newPage)??!1,newPageSize:(e==null?void 0:e.newPageSize)??!1,keepRenderedRows:(e==null?void 0:e.keepRenderedRows)??!1})}calculatePages(){this.paginationService?this.paginationService.calculatePages():this.pageBoundsService.calculateBounds(0,this.rowModel.getRowCount()-1)}},NN=class extends B{constructor(){super(...arguments),this.beanName="pageBoundsService",this.pixelOffset=0}wireBeans(e){this.rowModel=e.rowModel}getFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getCurrentPageHeight(){return ke(this.topRowBounds)||ke(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){const e=this.topRowBounds?this.topRowBounds.rowTop:0,t=this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0;return{pageFirstPixel:e,pageLastPixel:t}}calculateBounds(e,t){this.topRowBounds=this.rowModel.getRowBounds(e),this.topRowBounds&&(this.topRowBounds.rowIndex=e),this.bottomRowBounds=this.rowModel.getRowBounds(t),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=t),this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=j(this.topRowBounds)?this.topRowBounds.rowTop:0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},BN=class extends B{constructor(){super(),this.beanName="ariaAnnouncementService",this.descriptionContainer=null,this.pendingAnnouncements=new Map,this.updateAnnouncement=Pt(this.updateAnnouncement.bind(this),200)}wireBeans(e){this.eGridDiv=e.eGridDiv}postConstruct(){const e=Xe(this.gos),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),Ng(t,"polite"),NT(t,"additions text"),VT(t,!0),this.eGridDiv.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.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50)}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(yt(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null,this.pendingAnnouncements.clear()}},GN=class extends B{constructor(){super(...arguments),this.beanName="columnAnimationService",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.activeNext=!1,this.suppressAnimation=!1,this.animationThreadCount=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(this,e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.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;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e,t){if(this.executeNextFuncs.length===0&&this.executeLaterFuncs.length===0){e(),t();return}const i=s=>{for(;s.length;){const n=s.pop();n&&n()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e(),i(this.executeNextFuncs)},0),window.setTimeout(()=>{t(),i(this.executeLaterFuncs)},200)})}},HN=class extends B{constructor(){super(...arguments),this.beanName="columnHoverService"}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}updateState(e){this.selectedColumns=e,this.eventService.dispatchEvent({type:"columnHoverChanged"})}},WN=class extends B{constructor(){super(...arguments),this.beanName="overlayService",this.state=0,this.showInitialOverlay=!0,this.wrapperPadding=0}wireBeans(e){this.userComponentFactory=e.userComponentFactory,this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}postConstruct(){this.isClientSide=Ye(this.gos);const e=()=>this.updateOverlayVisibility();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e,gridSizeChanged:this.onGridSizeChanged.bind(this),rowCountReady:()=>{this.showInitialOverlay=!1,this.updateOverlayVisibility()}}),this.addManagedPropertyListener("loading",e)}setOverlayWrapperComp(e){this.overlayWrapperComp=e,this.updateOverlayVisibility()}isVisible(){return this.state!==0&&!!this.overlayWrapperComp}isExclusive(){return this.state===1&&!!this.overlayWrapperComp}getOverlayWrapper(){return this.overlayWrapperComp}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos.get("loading");!e&&(e!==void 0||this.gos.get("suppressLoadingOverlay"))||this.doShowLoadingOverlay()}showNoRowsOverlay(){this.showInitialOverlay=!1,!(this.gos.get("loading")||this.gos.get("suppressNoRowsOverlay"))&&this.doShowNoRowsOverlay()}hideOverlay(){if(this.showInitialOverlay=!1,this.gos.get("loading")){W("Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.");return}this.doHideOverlay()}updateOverlayVisibility(){if(!this.overlayWrapperComp){this.state=0;return}let e=this.gos.get("loading");this.showInitialOverlay&&e===void 0&&!this.gos.get("suppressLoadingOverlay")&&(e=!this.gos.get("columnDefs")||!this.columnModel.isReady()||!this.gos.get("rowData")&&this.isClientSide),e?this.state!==1&&this.doShowLoadingOverlay():(this.showInitialOverlay=!1,this.rowModel.isEmpty()&&!this.gos.get("suppressNoRowsOverlay")&&this.isClientSide?this.state!==2&&this.doShowNoRowsOverlay():this.state!==0&&this.doHideOverlay())}doShowLoadingOverlay(){this.overlayWrapperComp&&(this.state=1,this.showOverlay(this.userComponentFactory.getLoadingOverlayCompDetails({}),"ag-overlay-loading-wrapper","loadingOverlayComponentParams"),this.updateExclusive())}doShowNoRowsOverlay(){this.overlayWrapperComp&&(this.state=2,this.showOverlay(this.userComponentFactory.getNoRowsOverlayCompDetails({}),"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams"),this.updateExclusive())}doHideOverlay(){this.overlayWrapperComp&&(this.state=0,this.overlayWrapperComp.hideOverlay(),this.updateExclusive())}showOverlay(e,t,i){var n;const s=e.newAgStackInstance();(n=this.overlayWrapperComp)==null||n.showOverlay(s,t,this.isExclusive(),i),this.refreshWrapperPadding()}updateExclusive(){const e=this.exclusive;this.exclusive=this.isExclusive(),this.exclusive!==e&&this.eventService.dispatchEvent({type:"overlayExclusiveChanged"})}onGridSizeChanged(){this.refreshWrapperPadding()}refreshWrapperPadding(){if(!this.overlayWrapperComp)return;let e=0;if(this.state===2){const t=this.ctrlsService.get("gridHeaderCtrl");e=(t==null?void 0:t.getHeaderHeight())||0}else this.wrapperPadding!==0&&(e=0);this.wrapperPadding!==e&&(this.wrapperPadding=e,this.overlayWrapperComp.updateOverlayWrapperPaddingTop(e))}},zN=class extends B{constructor(){super(...arguments),this.beanName="rowCssClassCalculator"}wireBeans(e){this.stylingService=e.stylingService}getInitialRowClasses(e){const t=[];return j(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),Rg(t,this.processClassesFromGridOptions(e.rowNode)),Rg(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&(e.pinned==="left"&&t.push("ag-cell-last-left-pinned"),e.pinned==="right"&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=o=>{typeof o=="string"?t.push(o):Array.isArray(o)&&o.forEach(r=>t.push(r))},s=this.gos.get("rowClass");if(s){if(typeof s=="function")return W("rowClass should not be a function, please use getRowClass instead"),[];i(s)}const n=this.gos.getCallback("getRowClass");if(n){const o={data:e.data,node:e,rowIndex:e.rowIndex},r=n(o);i(r)}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,i=>{t.push(i)},()=>{}),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}},UN=class extends B{constructor(){super(...arguments),this.beanName="rowContainerHeightService",this.scrollY=0,this.uiBodyHeight=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=qT(),this.gos.get("debug")&&si("RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,i=this.getUiBodyHeight();(t!==this.scrollY||i!==this.uiBodyHeight)&&(this.scrollY=t,this.uiBodyHeight=i,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;this.gos.get("debug")&&si(`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t=typeof e=="number"?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=e!=null&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return t.bottom-t.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=this.modelHeight-this.getUiBodyHeight(),i=e/t;return this.maxScrollY*i}},$N=class extends B{constructor(){super(...arguments),this.beanName="rowNodeSorter"}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.showRowGroupColsService=e.showRowGroupColsService}postConstruct(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=Vi(this.gos),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=Vi(this.gos))}doFullSort(e,t){const i=(n,o)=>({currentPos:o,rowNode:n}),s=e.map(i);return s.sort(this.compareRowNodes.bind(this,t)),s.map(n=>n.rowNode)}compareRowNodes(e,t,i){const s=t.rowNode,n=i.rowNode;for(let o=0,r=e.length;o<r;o++){const a=e[o],d=a.sort==="desc",h=this.getValue(s,a.column),g=this.getValue(n,a.column);let f;const C=this.getComparator(a,s);if(C?f=C(h,g,s,n,d):f=KD(h,g,this.isAccentedSort),!isNaN(f)&&f!==0)return a.sort==="asc"?f:f*-1}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(s!=null)return s;if(!i.getColDef().showRowGroup)return;const n=!t.group&&i.getColDef().field;if(!n)return;const o=this.columnModel.getColDefCol(n);if(o)return o.getColDef().comparator}getValue(e,t){var s,n,o;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(El(this.gos,this.columnModel.isPivotActive())){const d=(s=e.allLeafChildren)==null?void 0:s[0];return d?this.valueService.getValue(t,d,!1,!1):void 0}const a=(n=this.showRowGroupColsService)==null?void 0:n.getShowRowGroupCol(t.getId());return a?(o=e.groupData)==null?void 0:o[a.getId()]:void 0}if(!(e.group&&t.getColDef().showRowGroup))return this.valueService.getValue(t,e,!1,!1)}},Cr=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}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const n=e.childrenAfterGroup[s];n.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(n)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const s={rowNode:t,children:null};this.mapToItems[t.id]=s,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(s=>this.nodeIdsToColumns[i.id][s.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let s=0;s<t;s++){const n=this.mapToItems[i.id],o=this.mapToItems[i.parent.id];o.children||(o.children=[]),o.children.push(n),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(n=>i[n.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(n=>!i[n.getId()])}},Rm=class extends B{constructor(){super(...arguments),this.beanName="selectionService",this.selectedNodes=new Map,this.selectionCtx=new zL,this.rowSelectionMode=void 0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){const{gos:e,rowModel:t,onRowSelected:i}=this;this.selectionCtx.init(t),this.rowSelectionMode=Xo(e),this.groupSelectsChildren=ln(e),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection","selection"],()=>{const s=ln(e),n=Xo(e);(s!==this.groupSelectsChildren||n!==this.rowSelectionMode)&&(this.groupSelectsChildren=s,this.rowSelectionMode=n,this.deselectAllRowNodes({source:"api"}))}),this.addManagedEventListeners({rowSelected:i.bind(this)})}destroy(){super.destroy(),this.resetNodes(),this.selectionCtx.reset()}isMultiSelect(){return this.rowSelectionMode==="multiRow"}overrideSelectionValue(e,t){if(!AN(t))return e;const i=this.selectionCtx.getRoot();return i?i.isSelected()??!1:!0}setNodesSelected(e){var f;const{newValue:t,clearSelection:i,suppressFinishActions:s,rangeSelect:n,nodes:o,event:r,source:a}=e;if(o.length===0)return 0;if(o.length>1&&!this.isMultiSelect())return W("cannot multi select unless selection mode is 'multiRow'"),0;const d=this.groupSelectsChildren&&e.groupSelectsFiltered===!0,h=o.map(C=>C.footer?C.sibling:C);if(n){if(h.length>1)return W("cannot range select while selecting multiple rows"),0;const C=h[0],v=this.overrideSelectionValue(t,a);if(this.isMultiSelect()){if(this.selectionCtx.isInRange(C)){const S=this.selectionCtx.truncate(C);return v&&this.selectRange(S.discard,!1,a),this.selectRange(S.keep,v,a)}else if(this.selectionCtx.getRoot()!==C){const y=this.selectionCtx.extend(C,this.groupSelectsChildren);return v&&this.selectRange(y.discard,!1,a),this.selectRange(y.keep,v,a)}}}s||this.selectionCtx.setRoot(h[0]);let g=0;for(let C=0;C<h.length;C++){const v=h[C];d&&v.group||v.selectThisNode(t,r,a)&&g++,this.groupSelectsChildren&&((f=v.childrenAfterGroup)!=null&&f.length)&&(g+=this.selectChildren(v,t,d,a))}return s||(t&&(i||!this.isMultiSelect())&&(g+=this.clearOtherNodes(h[0],a)),g>0&&(this.updateGroupsFromChildrenSelections(a),this.dispatchSelectionChanged(a))),g}selectRange(e,t,i){let s=0;return e.forEach(n=>{if(n.group&&this.groupSelectsChildren)return;n.selectThisNode(t,void 0,i)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i)),s}selectChildren(e,t,i,s){const n=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return ke(n)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:n})}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,s)=>{i&&e(i)&&t.set(s,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren||!Ye(this.gos))return!1;const s=this.rowModel.getRootNode();t||(t=new Cr(!0,s),t.setInactive());let n=!1;return t.forEachChangedNodeDepthFirst(o=>{if(o!==s){const r=o.calculateSelectedFromChildren();n=o.selectThisNode(r===null?!1:r,void 0,e)||n}}),n}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach(n=>{if(n&&n.id!==e.id){const o=this.selectedNodes.get(n.id);s+=o.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&n.parent&&i.set(n.parent.id,n.parent)}}),i.forEach(n=>{const o=n.calculateSelectedFromChildren();n.selectThisNode(o===null?!1:o,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&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)}syncInOldRowNode(e,t){if(j(t)&&e.id!==t.id&&t){const s=t.id;this.selectedNodes.get(s)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){var e;(e=this.selectedNodes)==null||e.clear()}getBestCostNodeSelection(){if(!Ye(this.gos))return;const t=this.rowModel.getTopLevelNodes();if(t===null)return;const i=[];function s(n){for(let o=0,r=n.length;o<r;o++){const a=n[o];if(a.isSelected())i.push(a);else{const d=a;d.group&&d.children&&s(d.children)}}}return s(t),i}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),e===0}deselectAllRowNodes(e){const t=r=>r.selectThisNode(!1,void 0,s),i=Ye(this.gos),{source:s,justFiltered:n,justCurrentPage:o}=e;if(o||n){if(!i){Ve("selecting just filtered only works when gridOptions.rowModelType='clientSide'");return}this.getNodesToSelect(n,o).forEach(t)}else this.selectedNodes.forEach(r=>{r&&t(r)}),this.reset(s);this.selectionCtx.reset(),i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)}getSelectedCounts(e,t){let i=0,s=0;const n=o=>{this.groupSelectsChildren&&o.group||(o.isSelected()?i++:o.selectable&&s++)};return this.getNodesToSelect(e,t).forEach(n),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return i===0&&s===0?!1:i>0&&s>0?null:i>0}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(i=>i.selectable).length>0}getNodesToSelect(e=!1,t=!1){this.validateSelectAllType();const i=[];if(t)return this.forEachNodeOnPage(n=>{if(!n.group){i.push(n);return}if(!n.expanded){const o=r=>{var a;i.push(r),(a=r.childrenAfterFilter)!=null&&a.length&&r.childrenAfterFilter.forEach(o)};o(n);return}this.groupSelectsChildren||i.push(n)}),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter(n=>{i.push(n)}),i):(s.forEachNode(n=>{i.push(n)}),i)}forEachNodeOnPage(e){const t=this.pageBoundsService.getFirstRow(),i=this.pageBoundsService.getLastRow();for(let s=t;s<=i;s++){const n=this.rowModel.getRow(s);n&&e(n)}}selectAllRowNodes(e){if(od(this.gos)&&!cd(this.gos))return W("cannot multi select unless selection mode is 'multiRow'");this.validateSelectAllType();const{source:t,justFiltered:i,justCurrentPage:s}=e,n=this.getNodesToSelect(i,s);n.forEach(o=>o.selectThisNode(!0,void 0,t)),this.selectionCtx.setRoot(n[0]??null),this.selectionCtx.setEndRange(ce(n)??null),Ye(this.gos)&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t),this.dispatchSelectionChanged(t)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{t!=null&&t.id&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return Ve("Invalid selection state. When using client-side row model, the state must conform to `string[]`.");const i=new Set(e),s=[];this.rowModel.forEachNode(n=>{i.has(n.id)&&s.push(n)}),this.setNodesSelected({newValue:!0,nodes:s,source:t})}dispatchSelectionChanged(e){this.eventService.dispatchEvent({type:"selectionChanged",source:e})}validateSelectAllType(){if(!Ye(this.gos))throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`)}},KN=class extends B{constructor(){super(...arguments),this.beanName="selectableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const{gos:t}=this,i=Xo(t)!==void 0,s=ad(t);if(!i||!s)return;const n=ln(t),o=Ye(t)&&n,r=[],a=d=>{if(e&&!d.group)return;if(o&&d.group){const g=d.childrenAfterGroup.some(f=>f.selectable===!0);d.setRowSelectable(g,!0);return}const h=(s==null?void 0:s(d))??!0;d.setRowSelectable(h,!0),!h&&d.isSelected()&&r.push(d)};if(o){const d=this.rowModel;new Cr(!1,d.getRootNode()).forEachChangedNodeDepthFirst(a,!0,!0)}else this.rowModel.forEachNode(a);r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof Rm&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}},Fm=["asc","desc",null],jN=class extends B{constructor(){super(...arguments),this.beanName="sortController"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.showRowGroupColsService=e.showRowGroupColsService}progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){t!=="asc"&&t!=="desc"&&(t=null);const n=Vi(this.gos);let o=[e];if(n&&e.getColDef().showRowGroup){const d=this.funcColsService.getSourceColumnsForGroupColumn(e),h=d==null?void 0:d.filter(g=>g.isSortable());h&&(o=[e,...h])}o.forEach(d=>d.setSort(t,s));const r=(i||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"),a=[];if(!r){const d=this.clearSortBarTheseColumns(o,s);a.push(...d)}this.updateSortIndex(e),a.push(...o),this.dispatchSortChangedEvents(s,a)}updateSortIndex(e){var a;const t=Vi(this.gos),i=(a=this.showRowGroupColsService)==null?void 0:a.getShowRowGroupCol(e.getId()),s=t&&i||e,n=this.getColumnsWithSortingOrdered();this.columnModel.getAllCols().forEach(d=>d.setSortIndex(null));const o=n.filter(d=>t&&d.getColDef().showRowGroup?!1:d!==s);(s.getSort()?[...o,s]:o).forEach((d,h)=>{d.setSortIndex(h)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const t=this.columnModel.getAllCols().filter(i=>!!i.getSort());return t&&t.length>0}dispatchSortChangedEvents(e,t){const i={type:"sortChanged",source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getAllCols().forEach(s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(e.getColDef().sortingOrder?t=e.getColDef().sortingOrder:this.gos.get("sortingOrder")?t=this.gos.get("sortingOrder"):t=Fm,!Array.isArray(t)||t.length<=0)return W(`sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,n=i==t.length-1;let o;return s||n?o=t[0]:o=t[i+1],Fm.indexOf(o)<0?(W("invalid sort type ",o),null):o}getIndexedSortMap(){let e=this.columnModel.getAllCols().filter(o=>!!o.getSort());if(this.columnModel.isPivotMode()){const o=Vi(this.gos);e=e.filter(r=>{var g;const a=!!r.getAggFunc(),d=!r.isPrimary(),h=o?(g=this.showRowGroupColsService)==null?void 0:g.getShowRowGroupCol(r.getId()):r.getColDef().showRowGroup;return a||d||h})}const t=this.funcColsService.getRowGroupColumns().filter(o=>!!o.getSort()),i={};e.forEach((o,r)=>i[o.getId()]=r),e.sort((o,r)=>{const a=o.getSortIndex(),d=r.getSortIndex();if(a!=null&&d!=null)return a-d;if(a==null&&d==null){const h=i[o.getId()],g=i[r.getId()];return h>g?1:-1}else return d==null?-1:1});const s=Vi(this.gos)&&!!t.length;s&&(e=[...new Set(e.map(o=>{var r;return((r=this.showRowGroupColsService)==null?void 0:r.getShowRowGroupCol(o.getId()))??o}))]);const n=new Map;return e.forEach((o,r)=>n.set(o,r)),s&&t.forEach(o=>{const r=this.showRowGroupColsService.getShowRowGroupCol(o.getId());n.set(o,n.get(r))}),n}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=Vi(this.gos),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.funcColsService.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(t!=null&&t.length))return e.getSort();const s=e.getColDef().field!=null||!!e.getColDef().valueGetter?[e,...t]:t,n=s[0].getSort();return s.every(r=>r.getSort()==n)?n:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}},ZN=class extends B{constructor(){super(...arguments),this.beanName="syncService",this.waitingForColumns=!1}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.rowModel=e.rowModel}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(this,()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.eventService.dispatchEvent({type:"gridReady"});const e=this.gos.isModuleRegistered("@ag-grid-enterprise/core");this.gos.get("debug")&&si(`initialised successfully, enterprise = ${e}`)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t){if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(t);return}this.columnModel.setColumnDefs(t,an(e.source))}}},qN="paste",YN=class extends B{constructor(){super(...arguments),this.beanName="changeDetectionService"}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer}postConstruct(){Ye(this.gos)&&(this.clientSideRowModel=this.rowModel),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}onCellValueChanged(e){e.source!==qN&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),n=new Cr(s,this.clientSideRowModel.getRootNode());n.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(n),n.forEachChangedNodeDepthFirst(o=>{i.push(o)})}this.rowRenderer.refreshCells({rowNodes:i})}},QN=class extends B{constructor(){super(...arguments),this.beanName="expressionService",this.expressionToFunctionCache={}}evaluate(e,t){if(typeof e=="string")return this.evaluateExpression(e,t);Ve("value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(i){return si("Processing of the expression failed"),si("Expression = ",e),si("Params = ",t),si("Exception = ",i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}},XN=class extends B{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0}postConstruct(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(!(!this.active||e.__cacheVersion!==this.cacheVersion))return e.__cacheData[t]}},JN=class extends B{constructor(){super(...arguments),this.beanName="valueService",this.initialised=!1,this.isSsrm=!1}wireBeans(e){this.expressionService=e.expressionService,this.columnModel=e.columnModel,this.valueCache=e.valueCache,this.dataTypeService=e.dataTypeService}postConstruct(){this.initialised||this.init()}init(){this.isSsrm=Yi(this.gos),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=i=>this.callColumnCellValueChangedHandler(i),t=Fl(this.gos);this.eventService.addEventListener("cellValueChanged",e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener("cellValueChanged",e,t)),this.addManagedPropertyListener("treeData",i=>this.isTreeData=i.currentValue)}getValueForDisplay(e,t){const i=t.leafGroup&&this.columnModel.isPivotMode(),s=t.group&&t.expanded&&!t.footer&&!i,n=this.gos.get("groupSuppressBlankHeader");if(!s||n)return this.getValue(e,t);let o=!1;const r=this.gos.get("groupTotalRow")??this.gos.get("groupIncludeFooter");typeof r!="function"?o=!!r:o=!!(this.gos.getCallback("groupTotalRow")??this.gos.getCallback("groupIncludeFooter"))({node:this});const a=s&&o;return this.getValue(e,t,!1,a)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const n=e.getColDef(),o=n.field,r=e.getColId(),a=t.data;let d;const h=t.groupData&&t.groupData[r]!==void 0,g=!s&&t.aggData&&t.aggData[r]!==void 0,f=this.isSsrm&&s&&!!e.getColDef().aggFunc,C=this.isSsrm&&t.footer&&t.field&&(e.getColDef().showRowGroup===!0||e.getColDef().showRowGroup===t.field);if(i&&n.filterValueGetter?d=this.executeFilterValueGetter(n.filterValueGetter,a,e,t):this.isTreeData&&g?d=t.aggData[r]:this.isTreeData&&n.valueGetter?d=this.executeValueGetter(n.valueGetter,a,e,t):this.isTreeData&&o&&a?d=Jo(a,o,e.isFieldContainsDots()):h?d=t.groupData[r]:g?d=t.aggData[r]:n.valueGetter?d=this.executeValueGetter(n.valueGetter,a,e,t):C?d=Jo(a,t.field,e.isFieldContainsDots()):o&&a&&!f&&(d=Jo(a,o,e.isFieldContainsDots())),this.cellExpressions&&typeof d=="string"&&d.indexOf("=")===0){const v=d.substring(1);d=this.executeValueGetter(v,a,e,t)}if(d==null){const v=this.getOpenedGroup(t,e);if(v!=null)return v}return d}parseValue(e,t,i,s){const n=e.getColDef(),o=n.valueParser;if(j(o)){const r=this.gos.addGridCommonParams({node:t,data:t==null?void 0:t.data,oldValue:s,newValue:i,colDef:n,column:e});return typeof o=="function"?o(r):this.expressionService.evaluate(o,r)}return i}getDeleteValue(e,t){return j(e.getColDef().valueParser)?this.parseValue(e,t,"",this.getValueForDisplay(e,t))??null:null}formatValue(e,t,i,s,n=!0){let o=null,r;const a=e.getColDef();if(s?r=s:n&&(r=a.valueFormatter),r){const d=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:a,column:e});typeof r=="function"?o=r(d):o=this.expressionService.evaluate(r,d)}else if(a.refData)return a.refData[i]||"";return o==null&&Array.isArray(i)&&(o=i.join(", ")),o}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup")||!t.getColDef().showRowGroup)return;const s=t.getColDef().showRowGroup;let n=e.parent;for(;n!=null;){if(n.rowGroupColumn&&(s===!0||s===n.rowGroupColumn.getColId()))return n.key;n=n.parent}}setValue(e,t,i,s){const n=this.columnModel.getColDefCol(t);if(!e||!n)return!1;ke(e.data)&&(e.data={});const{field:o,valueSetter:r}=n.getColDef();if(ke(o)&&ke(r))return W("you need either field or valueSetter set on colDef for editing to work"),!1;if(this.dataTypeService&&!this.dataTypeService.checkType(n,i))return W("Data type of the new value does not match the cell data type of the column"),!1;const a=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(n,e),newValue:i,colDef:n.getColDef(),column:n});a.newValue=i;let d;if(j(r)?typeof r=="function"?d=r(a):d=this.expressionService.evaluate(r,a):d=this.setValueUsingField(e.data,o,i,n.isFieldContainsDots()),d===void 0&&(d=!0),!d)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged();const h=this.getValue(n,e);return this.eventService.dispatchEvent({type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:a.column,colDef:a.colDef,data:e.data,node:e,oldValue:a.oldValue,newValue:h,value:h,source:s}),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;typeof t=="function"&&this.getFrameworkOverrides().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,i,s){if(!t)return!1;let n=!1;if(!s)n=e[t]===i,n||(e[t]=i);else{const o=t.split(".");let r=e;for(;o.length>0&&r;){const a=o.shift();o.length===0?(n=r[a]===i,n||(r[a]=i)):r=r[a]}}return!n}executeFilterValueGetter(e,t,i,s){const n=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return typeof e=="function"?e(n):this.expressionService.evaluate(e,n)}executeValueGetter(e,t,i,s){const n=i.getColId(),o=this.valueCache.getValue(s,n);if(o!==void 0)return o;const r=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let a;return typeof e=="function"?a=e(r):a=this.expressionService.evaluate(e,r),this.valueCache.setValue(s,n,a),a}getValueCallback(e,t){const i=this.columnModel.getColDefCol(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let n=i;if(s){const o=this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data});n=s(o)}return typeof n=="string"||n==null||(n=String(n),n==="[object Object]"&&W("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 (se AG Grid docs) or b) to toString() on the object to return a key")),n}},pu=class An{static applyGlobalGridOptions(t){if(!An.gridOptions)return t;let i={};return Tt(i,An.gridOptions,!0,!0),An.mergeStrategy==="deep"?Tt(i,t,!0,!0):i={...i,...t},An.gridOptions.context&&(i.context=An.gridOptions.context),t.context&&(An.mergeStrategy==="deep"&&i.context&&Tt(t.context,i.context,!0,!0),i.context=t.context),i}};pu.gridOptions=void 0,pu.mergeStrategy="shallow";var eB=pu;function tB(e,t,i){if(!t)return Ve("No gridOptions provided to createGrid"),{};const s=new sB().create(e,t,n=>{const o=new b_(e);n.createBean(o)},void 0,i);if(!Object.isFrozen(t)&&!(i!=null&&i.frameworkOverrides)){const n="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{Ve(`gridOptions.api is no longer supported. See ${n}.`)},configurable:!0})}return s}var iB=1,sB=class{create(e,t,i,s,n){const o=eB.applyGlobalGridOptions(t),r=kN(o),a=r.gridId??String(iB++),d=this.getRegisteredModules(n,a),h=this.createBeansList(r.rowModelType,d,a),g=this.createProvidedBeans(e,r,n);if(!h){Ve("Failed to create grid.");return}const f={providedBeanInstances:g,beanClasses:h,gridId:a,beanInitComparator:c_,beanDestroyComparator:d_,derivedBeans:[e_]},C=new YA(f);return this.registerModuleUserComponents(C,d),this.registerControllers(C,d),this.registerModuleApiFunctions(C,d),i(C),C.getBean("syncService").start(),s&&s(C),C.getBean("gridApi")}registerControllers(e,t){const i=e.getBean("ctrlsFactory");t.forEach(s=>{s.controllers&&s.controllers.forEach(n=>i.register(n))})}getRegisteredModules(e,t){const i=e?e.modules:null,s=ss.__getRegisteredModules(t),n=[],o={},r=(a,d,h)=>{(f=>{o[f.moduleName]||(o[f.moduleName]=!0,n.push(f),ss.__register(f,a,h))})(d),d.dependantModules&&d.dependantModules.forEach(f=>r(a,f,h))};return r(!!(i!=null&&i.length)||!ss.__isPackageBased(),DN,void 0),i&&i.forEach(a=>r(!0,a,t)),s&&s.forEach(a=>r(!ss.__isPackageBased(),a,void 0)),n}registerModuleUserComponents(e,t){const i=this.extractModuleEntity(t,n=>n.userComponents?n.userComponents:[]),s=e.getBean("userComponentRegistry");i.forEach(({name:n,classImp:o,params:r})=>{s.registerDefaultComponent(n,o,r)})}registerModuleApiFunctions(e,t){const i=e.getBean("apiFunctionService");t.forEach(s=>{const n=s.apiFunctions;n&&Object.keys(n).forEach(r=>{i==null||i.addFunction(r,n[r])})})}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;ke(s)&&(s=new lm);const n={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(n,i.providedBeanInstances),n}createBeansList(e="clientSide",t,i){const s=t.filter(d=>!d.rowModel||d.rowModel===e),n={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!n[e]){Ve("Could not find row model for rowModelType = ",e);return}if(!ss.__assertRegistered(n[e],`rowModelType = '${e}'`,i))return;const o=[f_,p_,LN,TN,JL,AA,r_,l_,ZI,cf,UN,KI,_N,BL,JA,TT,v_,IN,qL,Rm,mT,pk,NN,VN,VL,QN,fT,$I,XN,JN,_L,jI,QA,w_,UI,m_,QL,UL,zI,jN,HN,GN,KN,YN,qI,t_,zN,$N,h_,S_,g_,u_,ZN,WN,YI,ON,BN,QI,ST,i_,yT,vT,s_,n_,DT,wT,ET,o_,PT,dT],r=this.extractModuleEntity(s,d=>d.beans?d.beans:[]);o.push(...r);const a=[];return o.forEach(d=>{a.indexOf(d)<0&&a.push(d)}),a}extractModuleEntity(e,t){return[].concat(...e.map(t))}},xm=class extends B{constructor(){super(...arguments),this.beanName="rowModelHelperService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){const e=this.rowModel;switch(e.getType()){case"clientSide":this.clientSideRowModel=e;break;case"infinite":this.infiniteRowModel=e;break;case"serverSide":this.serverSideRowModel=e;break}}getClientSideRowModel(){return this.clientSideRowModel}getInfiniteRowModel(){return this.infiniteRowModel}getServerSideRowModel(){return this.serverSideRowModel}};function nB(e){e.expansionService.expandAll(!0)}function oB(e){e.expansionService.expandAll(!1)}function rB(e){var s,n;const t=(s=e.rowModelHelperService)==null?void 0:s.getClientSideRowModel(),i=(n=e.rowModelHelperService)==null?void 0:n.getServerSideRowModel();t?t.onRowHeightChanged():i&&i.onRowHeightChanged()}function lB(e,t,i){var o,r;const s=(o=e.rowModelHelperService)==null?void 0:o.getServerSideRowModel();if(s){if(e.funcColsService.isRowGroupEmpty()){s.setRowCount(t,i);return}Ve("setRowCount cannot be used while using row grouping.");return}const n=(r=e.rowModelHelperService)==null?void 0:r.getInfiniteRowModel();if(n){n.setRowCount(t,i);return}}function aB(e){var t;return((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function cB(e){return e.rowModel.isLastRowIndexKnown()}var dB={version:ge,moduleName:"@ag-grid-community/csrm-ssrm-shared-api",apiFunctions:{expandAll:nB,collapseAll:oB,onRowHeightChanged:rB}},uB={version:ge,moduleName:"@ag-grid-community/ssrm-infinite-shared-api",apiFunctions:{setRowCount:lB,getCacheBlockState:aB,isLastRowIndexKnown:cB}},hB=class{wrap(e,t,i=[],s){const n=this.createWrapper(e,s);return t.forEach(o=>{this.createMethod(n,o,!0)}),i.forEach(o=>{this.createMethod(n,o,!1)}),n}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&W("Framework component is missing the method "+t+"()"),null)}}},io=typeof global>"u"?{}:global;io.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement,io.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement,io.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement,io.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement,io.Node=typeof Node>"u"?{}:Node,io.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var pB="ROOT_NODE_ID",gu=0,gB=class{constructor(e,t,i,s,n,o){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=t,this.eventService=i,this.funcColsService=s,this.beans=o,this.selectionService=n,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=pB,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return Pg(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){W("rowData must be an array.");return}this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,i=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map((s,n)=>this.createNode(s,this.rootNode,gu,n)):(t.allLeafChildren=[],t.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=t.childrenAfterFilter,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenAfterAggFilter=t.childrenAfterAggFilter,i.childrenAfterSort=t.childrenAfterSort,i.childrenMapped=t.childrenMapped,i.allLeafChildren=t.allLeafChildren)}updateRowData(e){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const t={rowNodeTransaction:{remove:[],update:[],add:[]},rowsInserted:!1},i=[];return this.executeRemove(e,t,i),this.executeUpdate(e,t,i),this.executeAdd(e,t),this.updateSelection(i,"rowDataChanged"),t}updateRowOrderFromRowData(e){const t=this.rootNode.allLeafChildren,i=(t==null?void 0:t.length)??0,s=new Map;let n=-1,o=-1;for(let r=0;r<i;++r){const a=t[r],d=a.data;d!==e[r]&&(o<0&&(n=r),o=r,s.set(d,a))}if(n<0)return!1;for(let r=n;r<=o;++r){const a=s.get(e[r]);a!==void 0&&(t[r]=a,a.sourceRowIndex=r)}return!0}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){this.eventService.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}updateSelection(e,t){const i=e.length>0;i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i&&this.eventService.dispatchEvent({type:"selectionChanged",source:t})}executeAdd(e,t){const i=e.add;if(gt(i))return;const s=this.rootNode.allLeafChildren;let n=s.length;if(typeof e.addIndex=="number"&&(n=this.sanitizeAddIndex(e.addIndex),n>0&&this.gos.get("treeData")))for(let d=0;d<s.length;d++){const h=s[d];if((h==null?void 0:h.rowIndex)==n-1){n=d+1;break}}const o=i.map((a,d)=>this.createNode(a,this.rootNode,gu,n+d));if(n<s.length){const a=s.slice(0,n),d=s.slice(n,s.length),h=a.length+o.length;for(let g=0,f=d.length;g<f;++g)d[g].sourceRowIndex=h+g;this.rootNode.allLeafChildren=[...a,...o,...d],t.rowsInserted=!0}else this.rootNode.allLeafChildren=s.concat(o);const r=this.rootNode.sibling;r&&(r.allLeafChildren=s),t.rowNodeTransaction.add=o}sanitizeAddIndex(e){var i;const t=((i=this.rootNode.allLeafChildren)==null?void 0:i.length)??0;return e<0||e>=t||Number.isNaN(e)?t:Math.ceil(e)}executeRemove(e,{rowNodeTransaction:t},i){var r,a;const{remove:s}=e;if(gt(s))return;const n={};s.forEach(d=>{const h=this.lookupRowNode(d);h&&(h.isSelected()&&i.push(h),h.clearRowTopAndRowIndex(),n[h.id]=!0,delete this.allNodesMap[h.id],t.remove.push(h))}),this.rootNode.allLeafChildren=((r=this.rootNode.allLeafChildren)==null?void 0:r.filter(d=>!n[d.id]))??null,(a=this.rootNode.allLeafChildren)==null||a.forEach((d,h)=>{d.sourceRowIndex=h});const o=this.rootNode.sibling;o&&(o.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,{rowNodeTransaction:t},i){const{update:s}=e;gt(s)||s.forEach(n=>{const o=this.lookupRowNode(n);o&&(o.updateData(n),!o.selectable&&o.isSelected()&&i.push(o),this.setMasterForRow(o,n,gu,!1),t.update.push(o))})}lookupRowNode(e){var s;const t=Wn(this.gos);let i;if(t){const n=t({data:e,level:0});if(i=this.allNodesMap[n],!i)return Ve(`could not find row id=${n}, data item was not found for this id`),null}else if(i=(s=this.rootNode.allLeafChildren)==null?void 0:s.find(n=>n.data===e),!i)return Ve("could not find data item as object was not found",e),Ve("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i,s){const n=new ns(this.beans);return n.sourceRowIndex=s,n.group=!1,this.setMasterForRow(n,e,i,!0),t&&(n.parent=t),n.level=i,n.setDataAndId(e,this.nextId.toString()),this.allNodesMap[n.id]&&W(`duplicate node id '${n.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[n.id]=n,this.nextId++,n}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const r=this.gos.get("isRowMaster");r?e.setMaster(r(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const r=this.funcColsService.getRowGroupColumns(),a=r?r.length:0,d=i+a;e.expanded=e.master?this.isExpanded(d):!1}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return t===-1?!0:e<t}},fB=class extends B{constructor(){super(...arguments),this.beanName="rowModel",this.onRowHeightChanged_debounced=Pt(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}wireBeans(e){this.beans=e,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.selectionService=e.selectionService,this.valueCache=e.valueCache,this.environment=e.environment,this.filterStage=e.filterStage,this.sortStage=e.sortStage,this.flattenStage=e.flattenStage,this.groupStage=e.groupStage,this.aggregationStage=e.aggregationStage,this.pivotStage=e.pivotStage,this.filterAggregatesStage=e.filterAggregatesStage}postConstruct(){const e=this.refreshModel.bind(this,{step:Le.EVERYTHING}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:Le.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedEventListeners({newColumnsLoaded:i,columnRowGroupChanged:e,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:Le.PIVOT}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:e,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this)}),this.addPropertyListeners(),this.rootNode=new ns(this.beans),this.nodeManager=new gB(this.rootNode,this.gos,this.eventService,this.funcColsService,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),n=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),o=new Set(["postSortRows","groupDisplayType","accentedSort"]),r=new Set([]),a=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),d=[...e,...t,...i,...s,...s,...n,...o,...r,...a];this.addManagedPropertyListeners(d,h=>{var C;const g=(C=h.changeSet)==null?void 0:C.properties;if(!g)return;const f=v=>g.some(S=>v.has(S));if(f(e)){this.setRowData(this.rootNode.allLeafChildren.map(v=>v.data));return}if(f(t)){this.refreshModel({step:Le.EVERYTHING});return}if(f(i)){this.refreshModel({step:Le.FILTER});return}if(f(s)){this.refreshModel({step:Le.PIVOT});return}if(f(n)){this.refreshModel({step:Le.AGGREGATE});return}if(f(o)){this.refreshModel({step:Le.SORT});return}if(f(r)){this.refreshModel({step:Le.FILTER_AGGREGATES});return}f(a)&&this.refreshModel({step:Le.MAP})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let n,o=!1;do{n=!1;const r=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),d=Math.max(r,i),h=Math.min(a,s);for(let g=d;g<=h;g++){const f=this.getRow(g);if(f.rowHeightEstimated){const C=Ps(this.gos,f);f.setRowHeight(C.height),n=!0,o=!0}}n&&this.setRowTopAndRowIndex()}while(n);return o}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=ht(this.gos,"normal");for(let n=0;n<this.rowsToDisplay.length;n++){const o=this.rowsToDisplay[n];if(o.id!=null&&i.add(o.id),o.rowHeight==null){const r=Ps(this.gos,o,s,e);o.setRowHeight(r.height,r.estimated)}o.setRowTop(t),o.setRowIndex(n),t+=o.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=o=>{o&&o.id!=null&&!t.has(o.id)&&o.clearRowTopAndRowIndex()},n=o=>{if(s(o),s(o.detailNode),s(o.sibling),o.hasChildren()&&o.childrenAfterGroup){const r=o.level==-1;i&&!r&&!o.expanded||o.childrenAfterGroup.forEach(n)}};n(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),n=this.getRow(s),o=!this.gos.get("suppressAnimationFrame");if(n===e[0])return!1;const r=this.rootNode.allLeafChildren;return e.forEach(a=>{wt(r,a)}),e.forEach((a,d)=>{Dl(r,a,Math.max(s+i,0)+d)}),e.forEach((a,d)=>{a.sourceRowIndex=d}),this.refreshModel({step:Le.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:o,rowNodesOrderChanged:!0}),!0}highlightRowAtPixel(e,t){const i=t!=null?this.getRowIndexAtPixel(t):null,s=i!=null?this.getRow(i):null;if(!s||!e||s===e||t==null){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null);return}const n=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(n),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const n=this.getRowIndexAtPixel(e);if(t=this.getRow(n||0),!t)return Ul.Below}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?Ul.Above:Ul.Below}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay.length===0)return 0;if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const t=this.rootNode.childrenAfterAggFilter,i=this.rootNode.sibling?1:0;return(t?t.length:0)+i}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let i=e;if(this.rowsToDisplay[0].footer){if(e===0)return 0;i-=1}const s=this.rowsToDisplay[this.rowsToDisplay.length-1],n=i>=this.rootNode.childrenAfterSort.length;if(s.footer&&n)return s.rowIndex;let o=this.rootNode.childrenAfterSort[i];if(this.gos.get("groupHideOpenParents"))for(;o.expanded&&o.childrenAfterSort&&o.childrenAfterSort.length>0;)o=o.childrenAfterSort[0];return o.rowIndex}getRowBounds(e){if(ke(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=Hn(this.gos);this.refreshModel({step:Le.MAP,keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=Hn(this.gos),s=e.columns.length===0||e.columns.some(n=>n.isPrimary())?Le.FILTER:Le.FILTER_AGGREGATES;this.refreshModel({step:s,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=Hn(this.gos);this.refreshModel({step:Le.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:Le.PIVOT}):this.refreshModel({step:Le.AGGREGATE})}createChangePath(e){const t=gt(e),i=new Cr(!1,this.rootNode);return t&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction")||e.rowNodeTransactions==null)return!1;const t=e.rowNodeTransactions.filter(s=>s.add!=null&&s.add.length>0||s.remove!=null&&s.remove.length>0);return t==null||t.length==0}buildRefreshModelParams(e){let t=Le.EVERYTHING;const i={everything:Le.EVERYTHING,group:Le.EVERYTHING,filter:Le.FILTER,map:Le.MAP,aggregate:Le.AGGREGATE,sort:Le.SORT,pivot:Le.PIVOT};if(j(e)&&(t=i[e]),ke(t)){Ve(`invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`);return}const s=!this.gos.get("suppressAnimationFrame");return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s}}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.isChangeEventsDispatching())return;const t=typeof e=="object"&&"step"in e?e:this.buildRefreshModelParams(e);if(!t||this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case Le.EVERYTHING:this.doRowGrouping(t.rowNodeTransactions,i,!!t.rowNodesOrderChanged,!!t.afterColumnsChanged);case Le.FILTER:this.doFilter(i);case Le.PIVOT:this.doPivot(i);case Le.AGGREGATE:this.doAggregate(i);case Le.FILTER_AGGREGATES:this.doFilterAggregates(i);case Le.SORT:this.doSort(t.rowNodeTransactions,i);case Le.MAP:this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1,this.eventService.dispatchEvent({type:"modelUpdated",animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack})}isEmpty(){const e=ke(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return ke(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return j(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!1,s=!1;const n=[],o=ln(this.gos);return this.forEachNodeAfterFilterAndSort(r=>{if(s)return;if(i&&(r===t||r===e)&&(s=!0,r.group&&o)){n.push(...r.allLeafChildren);return}if(!i){if(r!==t&&r!==e)return;i=!0}if(!r.group||!o){n.push(r);return}}),n}setDatasource(e){Ve("should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(ce(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let n=-1,o=-1;for(;;){const r=Math.floor((t+i)/2),a=this.rowsToDisplay[r];if(this.isRowInPixel(a,e)||(a.rowTop<e?t=r+1:a.rowTop>e&&(i=r-1),n===t&&o===i))return r;n=t,o=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:n}=e;let{index:o}=e;const r=a=>{var v;const d=(v=t[0])==null?void 0:v.parent;if(!d)return;const h=n&&mg(this.gos),g=Cg(this.gos),f=n&&g({node:d});if(d===this.rootNode){h===a&&(d.createFooter(),i(d.sibling,o++));return}f===a&&(d.createFooter(),i(d.sibling,o++))};r("top");for(let a=0;a<t.length;a++){const d=t[a];if(i(d,o++),d.hasChildren()&&!d.footer){let h=null;switch(s){case 0:h=d.childrenAfterGroup;break;case 1:h=d.childrenAfterAggFilter;break;case 2:h=d.childrenAfterSort;break;case 3:h=d.leafGroup?null:d.childrenAfterSort;break}h&&(o=this.recursivelyWalkNodesAndCallback({nodes:[...h],callback:i,recursionType:s,index:o,includeFooterNodes:n}))}}return r("bottom"),o}doAggregate(e){var t;(t=this.aggregationStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=n=>{n&&n.forEach(o=>{const r=()=>{o.expanded=e,s(o.childrenAfterGroup)};if(t){j(o.childrenAfterGroup)&&r();return}if(i){!o.leafGroup&&r();return}o.group&&r()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:Le.MAP}),this.eventService.dispatchEvent({type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"})}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage)e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodesOrderChanged:i,changedPath:t}):this.groupStage.execute({rowNode:this.rootNode,changedPath:t,afterColumnsChanged:s}),ln(this.gos)&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",t)&&this.eventService.dispatchEvent({type:"selectionChanged",source:"rowGroupChanged"});else{const n=this.rootNode,o=n.sibling;n.childrenAfterGroup=n.allLeafChildren,o&&(o.childrenAfterGroup=n.childrenAfterGroup),this.rootNode.updateHasChildren()}this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){var t;(t=this.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getNodeManager(){return this.nodeManager}getRowNode(e){if(typeof e=="string"&&e.indexOf(ns.ID_PREFIX_ROW_GROUP)==0){let i;return this.forEachNode(s=>{s.id===e&&(i=s)}),i}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:Le.EVERYTHING,newData:!0})}batchUpdateRowData(e,t){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const i=this.gos.get("asyncTransactionWaitMillis");this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.isAlive()&&this.executeBatchUpdateRowData()},i)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var s;this.valueCache.onDataChanged();const e=[],t=[];let i=!1;(s=this.rowDataTransactionBatch)==null||s.forEach(n=>{const{rowNodeTransaction:o,rowsInserted:r}=this.nodeManager.updateRowData(n.rowDataTransaction);r&&(i=!0),t.push(o),n.callback&&e.push(n.callback.bind(null,o))}),this.commonUpdateRowData(t,i),e.length>0&&window.setTimeout(()=>{e.forEach(n=>n())},0),t.length>0&&this.eventService.dispatchEvent({type:"asyncTransactionsFlushed",results:t}),this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e){this.valueCache.onDataChanged();const{rowNodeTransaction:t,rowsInserted:i}=this.nodeManager.updateRowData(e);return this.commonUpdateRowData([t],i),t}afterImmutableDataChange(e,t){this.commonUpdateRowData([e],t)}commonUpdateRowData(e,t){if(!this.hasStarted)return;const i=!this.gos.get("suppressAnimationFrame");this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:Le.EVERYTHING,rowNodeTransactions:e,rowNodesOrderChanged:t,keepRenderedRows:!0,keepEditingRows:!0,animate:i})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:Le.MAP,keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){if(e.rowHeightChanged){if(this.columnModel.isAutoRowHeightActive())return;this.resetRowHeights()}}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};function mB(e){e.expansionService.onGroupExpandedOrCollapsed()}function CB(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.refreshModel(t)}function vB(e){var t,i;return((i=(t=e.rowModelHelperService)==null?void 0:t.getClientSideRowModel())==null?void 0:i.isEmpty())??!0}function wB(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.forEachLeafNode(t)}function SB(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.forEachNodeAfterFilter(t)}function yB(e,t){var i,s;(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null||s.forEachNodeAfterFilterAndSort(t)}function bB(e){var t,i;if(e.columnModel.isAutoRowHeightActive()){W("calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}(i=(t=e.rowModelHelperService)==null?void 0:t.getClientSideRowModel())==null||i.resetRowHeights()}function RB(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var i,s;return(s=(i=e.rowModelHelperService)==null?void 0:i.getClientSideRowModel())==null?void 0:s.updateRowData(t)})}function FB(e,t,i){e.frameworkOverrides.wrapIncoming(()=>{var s,n;return(n=(s=e.rowModelHelperService)==null?void 0:s.getClientSideRowModel())==null?void 0:n.batchUpdateRowData(t,i)})}function xB(e){e.frameworkOverrides.wrapIncoming(()=>{var t,i;return(i=(t=e.rowModelHelperService)==null?void 0:t.getClientSideRowModel())==null?void 0:i.flushAsyncTransactions()})}function EB(e){return e.selectionService.getBestCostNodeSelection()}var PB=class extends B{constructor(){super(...arguments),this.beanName="filterStage"}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var i;const t=!!((i=this.filterManager)!=null&&i.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const i=(s,n)=>{s.hasChildren()&&e&&!n?s.childrenAfterFilter=s.childrenAfterGroup.filter(o=>{const r=o.childrenAfterFilter&&o.childrenAfterFilter.length>0,a=o.data&&this.filterManager.doesRowPassFilter({rowNode:o});return r||a}):s.childrenAfterFilter=s.childrenAfterGroup,s.sibling&&(s.sibling.childrenAfterFilter=s.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const s=(o,r)=>{if(o.childrenAfterGroup)for(let a=0;a<o.childrenAfterGroup.length;a++){const d=o.childrenAfterGroup[a],h=r||this.filterManager.doesRowPassFilter({rowNode:d});d.childrenAfterGroup?s(o.childrenAfterGroup[a],h):i(d,h)}i(o,r)},n=o=>s(o,!1);t.executeFromRootNode(n)}else{const s=n=>i(n,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},DB=class extends B{constructor(){super(...arguments),this.beanName="flattenStage"}wireBeans(e){this.beans=e,this.columnModel=e.columnModel}execute(e){const t=e.rowNode,i=[],s=this.columnModel.isPivotMode(),n=s&&t.leafGroup,o=n?[t]:t.childrenAfterSort,r=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(r,o,i,s,0);const a=i.length>0;if(!n&&a&&r.grandTotalRow){t.createFooter();const h=r.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(r,t.sibling,i,0,h)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:vg(this.gos),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:mg(this.gos),groupTotalRow:Cg(this.gos)}}recursivelyAddToRowsToDisplay(e,t,i,s,n){if(!gt(t))for(let o=0;o<t.length;o++){const r=t[o],a=r.hasChildren(),d=s&&!a,h=e.groupRemoveSingleChildren&&a&&r.childrenAfterGroup.length===1,g=e.groupRemoveLowestSingleChildren&&a&&r.leafGroup&&r.childrenAfterGroup.length===1,f=s&&r.leafGroup,C=e.hideOpenParents&&r.expanded&&!r.master&&!f;if(!d&&!C&&!h&&!g&&this.addRowNodeToRowsToDisplay(e,r,i,n),!(s&&r.leafGroup)){if(a){const S=h||g;if(r.expanded||S){const R=e.groupTotalRow({node:r});R||r.destroyFooter();const y=S?n:n+1;R==="top"&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,y)),this.recursivelyAddToRowsToDisplay(e,r.childrenAfterSort,i,s,y),R==="bottom"&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,y))}}else if(r.master&&r.expanded){const S=this.createDetailNode(r);this.addRowNodeToRowsToDisplay(e,S,i,n)}}}}addRowNodeToRowsToDisplay(e,t,i,s,n){n?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(j(e.detailNode))return e.detailNode;const t=new ns(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,j(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}},TB=class extends B{constructor(){super(...arguments),this.beanName="immutableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){Ye(this.gos)&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gos.exists("getRowId");return this.gos.get("resetRowDataOnUpdate")?!1:e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const i=this.clientSideRowModel.getNodeManager(),{rowNodeTransaction:s,rowsInserted:n}=i.updateRowData(t);let o=!1;this.gos.get("suppressMaintainUnsortedOrder")||(o=i.updateRowOrderFromRowData(e)),this.clientSideRowModel.afterImmutableDataChange(s,o||n)}createTransactionForRowData(e){if(!Ye(this.gos))return Ve("ImmutableService only works with ClientSideRowModel"),null;const t=Wn(this.gos);if(t==null)return Ve("ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!"),null;const i=this.clientSideRowModel.getNodeManager().getCopyOfNodesMap(),s=[],n=[],o=[];return j(e)&&e.forEach(r=>{const a=t({data:r,level:0}),d=i[a];d?(d.data!==r&&n.push(r),i[a]=void 0):o.push(r)}),ni(i,(r,a)=>{a&&s.push(a.data)}),{remove:s,update:n,add:o}}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}},AB=class extends B{constructor(){super(...arguments),this.beanName="sortService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.rowNodeSorter=e.rowNodeSorter,this.showRowGroupColsService=e.showRowGroupColsService}sort(e,t,i,s,n,o){const r=this.gos.get("groupMaintainOrder"),a=this.columnModel.getCols().some(C=>C.isRowGroupActive());let d={};i&&s&&(d=this.calculateDirtyNodes(s));const h=this.columnModel.isPivotMode(),g=this.gos.getCallback("postSortRows"),f=C=>{var R;this.pullDownGroupDataForHideOpenParents(C.childrenAfterAggFilter,!0);const v=h&&C.leafGroup;if(r&&a&&!C.leafGroup&&!o){const y=(R=this.funcColsService.getRowGroupColumns())==null?void 0:R[C.level+1],x=(y==null?void 0:y.getSort())===null,P=C.childrenAfterAggFilter.slice(0);if(C.childrenAfterSort&&!x){const T={};C.childrenAfterSort.forEach((I,V)=>{T[I.id]=V}),P.sort((I,V)=>(T[I.id]??0)-(T[V.id]??0))}C.childrenAfterSort=P}else!t||v?C.childrenAfterSort=C.childrenAfterAggFilter.slice(0):i?C.childrenAfterSort=this.doDeltaSort(C,d,n,e):C.childrenAfterSort=this.rowNodeSorter.doFullSort(C.childrenAfterAggFilter,e);if(C.sibling&&(C.sibling.childrenAfterSort=C.childrenAfterSort),this.updateChildIndexes(C),g){const y={nodes:C.childrenAfterSort};g(y)}};n&&n.forEachChangedNodeDepthFirst(f),this.updateGroupDataForHideOpenParents(n)}calculateDirtyNodes(e){const t={},i=s=>{s&&s.forEach(n=>t[n.id]=!0)};return e&&e.forEach(s=>{i(s.add),i(s.update),i(s.remove)}),t}doDeltaSort(e,t,i,s){const n=e.childrenAfterAggFilter,o=e.childrenAfterSort;if(!o)return this.rowNodeSorter.doFullSort(n,s);const r={},a=[];n.forEach(f=>{t[f.id]||!i.canSkip(f)?a.push(f):r[f.id]=!0});const d=o.filter(f=>r[f.id]),h=(f,C)=>({currentPos:C,rowNode:f}),g=a.map(h).sort((f,C)=>this.rowNodeSorter.compareRowNodes(s,f,C));return this.mergeSortedArrays(s,g,d.map(h)).map(({rowNode:f})=>f)}mergeSortedArrays(e,t,i){const s=[];let n=0,o=0;for(;n<t.length&&o<i.length;)this.rowNodeSorter.compareRowNodes(e,t[n],i[o])<0?s.push(t[n++]):s.push(i[o++]);for(;n<t.length;)s.push(t[n++]);for(;o<i.length;)s.push(i[o++]);return s}updateChildIndexes(e){if(ke(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],n=i===0,o=i===e.childrenAfterSort.length-1;s.setFirstChild(n),s.setLastChild(o),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return W("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=i=>{this.pullDownGroupDataForHideOpenParents(i.childrenAfterSort,!1),i.childrenAfterSort.forEach(s=>{s.hasChildren()&&t(s)})};e&&e.executeFromRootNode(i=>t(i))}pullDownGroupDataForHideOpenParents(e,t){!this.gos.get("groupHideOpenParents")||ke(e)||e.forEach(i=>{var n;(((n=this.showRowGroupColsService)==null?void 0:n.getShowRowGroupCols())??[]).forEach(o=>{const r=o.getColDef().showRowGroup;if(typeof r!="string"){Ve("groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const a=r,d=this.columnModel.getColDefCol(a);if(d!==i.rowGroupColumn)if(t)i.setGroupValue(o.getId(),void 0);else{const g=this.getFirstChildOfFirstChild(i,d);g&&i.setGroupValue(o.getId(),g.key)}})})}getFirstChildOfFirstChild(e,t){let i=e;for(;i;){const s=i.parent;if(s&&i.firstChild){if(s.rowGroupColumn===t)return s}else return null;i=s}return null}},MB=class extends B{constructor(){super(...arguments),this.beanName="sortStage"}wireBeans(e){this.sortService=e.sortService,this.sortController=e.sortController}execute(e){const t=this.sortController.getSortOptions(),i=j(t)&&t.length>0,s=i&&j(e.rowNodeTransactions)&&this.gos.get("deltaSort"),n=t.some(o=>Vi(this.gos)?o.column.isPrimary()&&o.column.isRowGroupActive():!!o.column.getColDef().showRowGroup);this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,n)}},fu="32.2.0",Em={version:fu,moduleName:`${ut.ClientSideRowModelModule}-core`,rowModel:"clientSide",beans:[fB,PB,MB,DB,AB,TB]},kB={version:fu,moduleName:`${ut.ClientSideRowModelModule}-api`,beans:[xm],apiFunctions:{onGroupExpandedOrCollapsed:mB,refreshClientSideRowModel:CB,isRowDataEmpty:vB,forEachLeafNode:wB,forEachNodeAfterFilter:SB,forEachNodeAfterFilterAndSort:yB,resetRowHeights:bB,applyTransaction:RB,applyTransactionAsync:FB,flushAsyncTransactions:xB,getBestCostNodeSelection:EB},dependantModules:[Em,dB]},IB={version:fu,moduleName:ut.ClientSideRowModelModule,dependantModules:[Em,kB]},vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function LB(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _B=function e(t){if(typeof t=="number"&&isNaN(t))throw new Error("NaN is not allowed");if(typeof t=="number"&&!isFinite(t))throw new Error("Infinity is not allowed");return t===null||typeof t!="object"?JSON.stringify(t):t.toJSON instanceof Function?e(t.toJSON()):Array.isArray(t)?`[${t.reduce((n,o,r)=>`${n}${r===0?"":","}${e(o===void 0||typeof o=="symbol"?null:o)}`,"")}]`:`{${Object.keys(t).sort().reduce((s,n)=>{if(t[n]===void 0||typeof t[n]=="symbol")return s;const o=s.length===0?"":",";return`${s}${o}${e(n)}:${e(t[n])}`},"")}}`};const Pm=LB(_B);var OB=class extends GL{wireBeans(e){this.beans=e}constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){j(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(ke(this.params.datasource.getRows)){W("datasource is missing getRows method");return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((s,n)=>{this.startRow+n<i&&e(s,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new ns(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((i,s)=>{const n=e.rowData?e.rowData[s]:void 0;!i.id&&i.alreadyRendered&&n&&(this.rowNodes[s]=new ns(this.beans),this.rowNodes[s].setRowIndex(i.rowIndex),this.rowNodes[s].setRowTop(i.rowTop),this.rowNodes[s].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[s],n,this.startRow+s)});const t=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroy(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()}),super.destroy()}},VB=2,NB=class extends B{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}wireBeans(e){this.rowRenderer=e.rowRenderer,this.focusService=e.focusService}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new OB(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){if(this.blockCount==0){this.purgeCache();return}this.getBlocksInOrder().forEach(t=>t.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e)),super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.gos.get("debug")&&si(`InfiniteCache - onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(r=>r!=e),i=(r,a)=>a.getLastAccessed()-r.getLastAccessed();t.sort(i);const s=this.params.maxBlocksInCache>0,n=s?this.params.maxBlocksInCache-1:null,o=VB-1;t.forEach((r,a)=>{const d=r.getState()==="needsLoading"&&a>=o,h=s?a>=n:!1;if(d||h){if(this.isBlockCurrentlyDisplayed(r)||this.isBlockFocused(r))return;this.removeBlockFromCache(r)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const s=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<s&&(this.rowCount=s)}}setRowCount(e,t){this.rowCount=e,j(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new qn;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){const e=(i,s)=>i.getId()-s.getId();return Ts(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventService.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(t=>this.destroyBlock(t))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,n=!1;const o=new qn;let r=!1;return this.getBlocksInOrder().forEach(d=>{if(!r){if(n&&s+1!==d.getId()){r=!0;return}s=d.getId(),d.forEachNode(h=>{const g=h===e||h===t;(n||g)&&i.push(h),g&&(n=!n)},o,this.rowCount)}}),r||n?[]:i}},BB=class extends B{constructor(){super(...arguments),this.beanName="rowModel"}wireBeans(e){this.filterManager=e.filterManager,this.sortController=e.sortController,this.selectionService=e.selectionService,this.rowRenderer=e.rowRenderer,this.rowNodeBlockLoader=e.rowNodeBlockLoader}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){this.gos.get("rowModelType")==="infinite"&&(this.rowHeight=on(this.gos),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&W("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy()}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onCacheUpdated.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=on(this.gos),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;this.cacheParams?e=this.isSortModelDifferent():e=!0,e&&this.reset()}isSortModelDifferent(){return!Zo(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;Wn(this.gos)!=null||this.selectionService.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventService.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){var e;this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:((e=this.filterManager)==null?void 0:e.getFilterModel())??{},sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:on(this.gos),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new qn},this.infiniteCache=this.createBean(new NB(this.cacheParams)),this.eventService.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){this.dispatchModelUpdatedEvent()}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?this.infiniteCache.isLastRowIndexKnown():!1}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};function GB(e){var t,i;(i=(t=e.rowModelHelperService)==null?void 0:t.getInfiniteRowModel())==null||i.refreshCache()}function HB(e){var t,i;(i=(t=e.rowModelHelperService)==null?void 0:t.getInfiniteRowModel())==null||i.purgeCache()}function WB(e){var t,i;return(i=(t=e.rowModelHelperService)==null?void 0:t.getInfiniteRowModel())==null?void 0:i.getRowCount()}var mu="32.2.0",Dm={version:mu,moduleName:`${ut.InfiniteRowModelModule}-core`,rowModel:"infinite",beans:[BB],dependantModules:[WL]},zB={version:mu,moduleName:`${ut.InfiniteRowModelModule}-api`,beans:[xm],apiFunctions:{refreshInfiniteCache:GB,purgeInfiniteCache:HB,getInfiniteRowCount:WB},dependantModules:[Dm,uB]},UB={version:mu,moduleName:ut.InfiniteRowModelModule,dependantModules:[Dm,zB]},$B=e=>typeof e=="symbol",KB=(e,t,i,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:i})};new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter($B));function Cu(e){const t=e&&e.__v_raw;return t?Cu(t):e}function vu(e){return Object.isExtensible(e)&&KB(e,"__v_skip",!0),e}var jB=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),ZB=e=>`on${e.charAt(0).toUpperCase()}${e.substring(1,e.length)}`,Tm=e=>e&&(Object.isFrozen(e)?e:c.markRaw(c.toRaw(e))),qB=()=>{const e={};bi.PUBLIC_EVENTS.map(n=>ZB(jB(n))).forEach(n=>e[n]=void 0);const i={},s={modelValue:{handler(n,o){!this.gridCreated||!this.api||n!==o&&(n&&o&&n.length===o.length&&n.every((r,a)=>r===o[a])||yd({rowData:n},this.api))},deep:!0}};return bi.ALL_PROPERTIES.filter(n=>n!="gridOptions").forEach(n=>{e[n]={default:bi.VUE_OMITTED_PROPERTY},s[n]={handler(o,r){let a=o;n==="rowData"&&o!=bi.VUE_OMITTED_PROPERTY&&(a=Tm(o)),this.batchChanges[n]=a===bi.VUE_OMITTED_PROPERTY?void 0:a,this.batchTimeout==null&&(this.batchTimeout=setTimeout(()=>{this.batchTimeout=null,yd(this.batchChanges,this.api),this.batchChanges=c.markRaw({})},0))},deep:!0}}),[e,i,s]};function Am(e){Ve(`Could not find component with name of ${e}. Is it in Vue.components?`)}var wu=class Nw{static getComponentDefinition(t,i){let s;return typeof t=="string"?s=this.searchForComponentInstance(i,t):s={extends:c.defineComponent({...t})},s||Am(t),s.extends?(s.extends.setup&&(s.setup=s.extends.setup),s.extends.props=this.addParamsToProps(s.extends.props)):s.props=this.addParamsToProps(s.props),s}static addParamsToProps(t){return!t||Array.isArray(t)&&t.indexOf("params")===-1?t=["params",...t||[]]:typeof t=="object"&&!t.params&&(t.params={type:Object}),t}static createAndMountComponent(t,i,s,n){const o=Nw.getComponentDefinition(t,s);if(!o)return;const{vNode:r,destroy:a,el:d}=this.mount(o,{params:Object.freeze(i)},s,n||{});return{componentInstance:r.component.proxy,element:d,destroy:a}}static mount(t,i,s,n){let o=c.createVNode(t,i);o.appContext=s.$.appContext,o.appContext.provides={...n,...o.appContext.provides?o.appContext.provides:{},...s.$parent.$options.provide?s.$parent.$options.provide:{}};let r=document.createElement("div");return c.render(o,r),{vNode:o,destroy:()=>{r&&c.render(null,r),r=null,o=null},el:r}}static searchForComponentInstance(t,i,s=10,n=!1){let o=null,r=t.$parent,a=0;for(;!o&&r&&r.$options&&++a<s;){const d=r;d.$options&&d.$options.components&&d.$options.components[i]?o=d.$options.components[i]:d[i]&&(o=d[i]),r=r.$parent}if(!o){const d=t.$.appContext.components;d&&d[i]&&(o=d[i])}return!o&&!n?(Am(i),null):o}},YB=class lc extends hB{constructor(t,i){super(),this.parent=t,lc.provides||(lc.provides=i)}createWrapper(t){const i=this;class s extends QB{init(r){super.init(r)}hasMethod(r){const a=n.getFrameworkComponentInstance();return a[r]?!0:a.$.setupState[r]!=null}callMethod(r,a){var g;const d=this.getFrameworkComponentInstance(),h=n.getFrameworkComponentInstance();return h[r]?h[r].apply(d,a):(g=h.$.setupState[r])==null?void 0:g.apply(d,a)}addMethod(r,a){n[r]=a}processMethod(r,a){return r==="refresh"&&(this.getFrameworkComponentInstance().params=a[0]),this.hasMethod(r)?this.callMethod(r,a):r==="refresh"}createComponent(r){return i.createComponent(t,r)}}const n=new s;return n}createComponent(t,i){return wu.createAndMountComponent(t,i,this.parent,lc.provides)}createMethodProxy(t,i,s){return function(){return t.hasMethod(i)?t.callMethod(i,arguments):(s&&W("Framework component is missing the method "+i+"()"),null)}}destroy(){this.parent=null}},QB=class{getGui(){return this.element}destroy(){this.getFrameworkComponentInstance()&&typeof this.getFrameworkComponentInstance().destroy=="function"&&this.getFrameworkComponentInstance().destroy(),this.unmount()}getFrameworkComponentInstance(){return this.componentInstance}init(e){const{componentInstance:t,element:i,destroy:s}=this.createComponent(e);this.componentInstance=t,this.unmount=s,this.element=i.firstElementChild??i}},XB=class extends lm{constructor(e){super("vue"),this.parent=e}frameworkComponent(e,t){let i=wu.searchForComponentInstance(this.parent,e,10,!0)?e:null;if(!i&&t&&t[e]){const s=t[e];i=wu.searchForComponentInstance(this.parent,s,10,!0)?s:null}return i}isFrameworkComponent(e){return typeof e=="object"}},JB=new Set(["rowDataUpdated","cellValueChanged","rowValueChanged"]),Mm="onUpdate:modelValue",e1="update:modelValue",[t1,i1,s1]=qB(),n1=c.defineComponent({render(){return c.h("div")},props:{gridOptions:{type:Object,default:()=>({})},componentDependencies:{type:Array,default:()=>[]},plugins:[],modules:{type:Array,default:()=>[]},modelValue:{type:Array,default:void 0,required:!1},...t1},data(){return{api:void 0,gridCreated:!1,isDestroyed:!1,gridReadyFired:!1,emitRowModel:void 0,batchTimeout:null,batchChanges:vu({})}},computed:i1,watch:s1,methods:{globalEventListenerFactory(e){return t=>{if(this.isDestroyed)return;t==="gridReady"&&(this.gridReadyFired=!0);const i=mr.has(t);i&&!e||!i&&e||this.updateModelIfUsed(t)}},processChanges(e,t,i){if(this.gridCreated){if(this.skipChange(e,t,i))return;const s={[e]:e==="rowData"?Object.isFrozen(t)?t:vu(Cu(t)):t};yd(s,this.api)}},checkForBindingConflicts(){const e=this;(e.rowData&&e.rowData!=="AG-VUE-OMITTED-PROPERTY"||this.gridOptions.rowData)&&e.modelValue&&W("Using both rowData and v-model. rowData will be ignored.")},getRowData(){var t;const e=[];return(t=this.api)==null||t.forEachNode(i=>{e.push(i.data)}),e},updateModelIfUsed(e){this.gridReadyFired&&this.$attrs[Mm]&&JB.has(e)&&this.emitRowModel&&this.emitRowModel()},getRowDataBasedOnBindings(){const e=this,t=e.modelValue;return t||(e.rowData?e.rowData:e.gridOptions.rowData)},getProvides(){let e=c.getCurrentInstance(),t={};for(;e;)e&&e.provides&&(t={...t,...e.provides}),e=e.parent;return t},skipChange(e,t,i){if(this.gridReadyFired&&e==="rowData"&&this.$attrs[Mm]){if(t===i)return!0;if(t&&i){const s=t,n=i;if(s.length===n.length){for(let o=0;o<s.length;o++)if(s[o]!==n[o])return!1;return!0}}}return!1},debounce(e,t){let i;return()=>{const s=function(){e()};window.clearTimeout(i),i=window.setTimeout(s,t)}}},mounted(){this.emitRowModel=this.debounce(()=>{this.$emit(e1,Object.freeze(this.getRowData()))},20);const e=this.getProvides(),t=new YB(this,e),i=vu(IT(Cu(this.gridOptions),this));this.checkForBindingConflicts();const s=this.getRowDataBasedOnBindings();s!==bi.VUE_OMITTED_PROPERTY&&(i.rowData=Tm(s));const n={globalEventListener:this.globalEventListenerFactory().bind(this),globalSyncEventListener:this.globalEventListenerFactory(!0).bind(this),frameworkOverrides:new XB(this),providedBeanInstances:{frameworkComponentWrapper:t},modules:this.modules};this.api=tB(this.$el,i,n),this.gridCreated=!0},unmounted(){var e;this.gridCreated&&((e=this.api)==null||e.destroy(),this.isDestroyed=!0)}}),o1=class extends B{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return(e==null||!e.length)&&(e=this.getDefaultFileName()),e.indexOf(".")===-1?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},r1=class{constructor(e){this.groupColumns=[];const{columnModel:t,funcColsService:i,columnNameService:s,valueService:n,gos:o,processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:d,processRowGroupCallback:h}=e;this.columnModel=t,this.funcColsService=i,this.columnNameService=s,this.valueService=n,this.gos=o,this.processCellCallback=r,this.processHeaderCallback=a,this.processGroupHeaderCallback=d,this.processRowGroupCallback=h}prepare(e){this.groupColumns=e.filter(t=>!!t.getColDef().showRowGroup)}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e,t,i,s,n){const r=(!this.gos.get("groupHideOpenParents")||n.footer)&&this.shouldRenderGroupSummaryCell(n,e,t)?this.createValueForGroupNode(e,n):this.valueService.getValue(e,n);return this.processCell({accumulatedRowIndex:i,rowNode:n,column:e,value:r,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){var r;if(!(e&&e.group))return!1;if(this.groupColumns.indexOf(t)!==-1){if(((r=e.groupData)==null?void 0:r[t.getId()])!=null||Yi(this.gos)&&e.group)return!0;if(e.footer&&e.level===-1){const a=t.getColDef();return a==null||a.showRowGroup===!0||a.showRowGroup===this.funcColsService.getRowGroupColumns()[0].getId()}}const o=El(this.gos,this.columnModel.isPivotMode());return i===0&&o}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnNameService.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),n=d=>{var g;if(i||s)return d.key;const h=(g=d.groupData)==null?void 0:g[e.getId()];return!h||!d.rowGroupColumn||d.rowGroupColumn.getColDef().useValueFormatterForExport===!1?h:this.valueService.formatValue(d.rowGroupColumn,d,h)??h},o=t.footer,r=[n(t)];if(!vg(this.gos))for(;t.parent;)t=t.parent,r.push(n(t));const a=r.reverse().join(" -> ");return o?`Total ${a}`:a}processCell(e){const{accumulatedRowIndex:t,rowNode:i,column:s,value:n,processCellCallback:o,type:r}=e;return o?{value:o(this.gos.addGridCommonParams({accumulatedRowIndex:t,column:s,node:i,value:n,type:r,parseValue:a=>this.valueService.parseValue(s,i,a,this.valueService.getValue(s,i)),formatValue:a=>this.valueService.formatValue(s,i,a)??a}))??""}:s.getColDef().useValueFormatterForExport!==!1?{value:n??"",valueFormatted:this.valueService.formatValue(s,i,n)}:{value:n??""}}},l1=class{static download(e,t){const i=document.defaultView||window;if(!i){W("There is no `window` associated with the current `document`");return}const s=document.createElement("a"),n=i.URL.createObjectURL(t);s.setAttribute("href",n),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout(()=>{i.URL.revokeObjectURL(n)},0)}},km=`\r
209
+ `,a1=class extends r1{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,km),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((i,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(i.data.value||""),i.mergeAcross&&this.appendEmptyCells(i.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){i!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(W("unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=km),this.isFirstLine=!1}},c1=class extends o1{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.gridSerializer=e.gridSerializer}postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){W("Export cancelled. Export is not allowed as per your configuration.");return}const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\uFEFF",i],{type:"text/plain"}),n=typeof t.fileName=="function"?t.fileName(this.gos.getGridCommonParams()):t.fileName;l1.download(this.getFileName(n),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,columnNameService:i,funcColsService:s,valueService:n,gos:o}=this,{processCellCallback:r,processHeaderCallback:a,processGroupHeaderCallback:d,processRowGroupCallback:h,suppressQuotes:g,columnSeparator:f}=e;return new a1({columnModel:t,columnNameService:i,funcColsService:s,valueService:n,gos:o,processCellCallback:r||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:d||void 0,processRowGroupCallback:h||void 0,suppressQuotes:g||!1,columnSeparator:f||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function d1(e,t){var i;return(i=e.csvCreator)==null?void 0:i.getDataAsCsv(t)}function u1(e,t){var i;(i=e.csvCreator)==null||i.exportDataAsCsv(t)}var h1=class extends B{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.selectionService=e.selectionService,this.rowNodeSorter=e.rowNodeSorter,this.sortController=e.sortController}serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:n}=t,o=this.getColumnsToExport(i,n,s);return $D(this.prepareSession(o),this.prependContent(t),this.exportColumnGroups(t,o),this.exportHeaders(t,o),this.processPinnedTopRows(t,o),this.processRows(t,o),this.processPinnedBottomRows(t,o),this.appendContent(t))(e).parse()}processRow(e,t,i,s){var x;const n=t.shouldRowBeSkipped||(()=>!1),o=this.gos.get("groupRemoveSingleChildren"),r=this.gos.get("groupRemoveLowestSingleChildren"),d=t.rowPositions!=null||!!t.onlySelected,h=this.gos.get("groupHideOpenParents")&&!d,g=this.columnModel.isPivotMode()?s.leafGroup:!s.group,f=!!s.footer,C=r&&s.leafGroup,v=s.allChildrenCount===1&&((x=s.childrenAfterGroup)==null?void 0:x.length)===1&&(o||C);if(!g&&!f&&(t.skipRowGroups||v||h)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.level===-1&&!g&&!f||n(this.gos.addGridCommonParams({node:s})))return;const y=e.onNewBodyRow(s);if(i.forEach((P,T)=>{y.onColumn(P,T,s)}),t.getCustomContentBelowRow){const P=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));P&&e.addCustomContent(P)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new Lg,n=this.visibleColsService.createGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0});this.recursivelyAddHeaderGroups(n,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const s=i.onNewHeaderRow();t.forEach((n,o)=>{s.onColumn(n,o,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(n=>n.rowPinned==="top").sort((n,o)=>n.rowIndex-o.rowIndex).map(n=>this.pinnedRowModel.getPinnedTopRow(n.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedRow("top",s),i}}processRows(e,t){return i=>{const s=this.rowModel,n=Ye(this.gos),o=Yi(this.gos),r=!n&&e.onlySelected,a=this.processRow.bind(this,i,e,t),{exportedRows:d="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(h=>h.rowPinned==null).sort((h,g)=>h.rowIndex-g.rowIndex).map(h=>s.getRow(h.rowIndex)).forEach(a);else if(this.columnModel.isPivotMode())n?s.forEachPivotNode(a,!0):o?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||r){const h=this.selectionService.getSelectedNodes();this.replicateSortedOrder(h),h.forEach(a)}else d==="all"?s.forEachNode(a):n||o?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(s,n)=>{var o,r;return s.rowIndex!=null&&n.rowIndex!=null?s.rowIndex-n.rowIndex:s.level===n.level?((o=s.parent)==null?void 0:o.id)===((r=n.parent)==null?void 0:r.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:s,currentPos:s.rowIndex??-1},{rowNode:n,currentPos:n.rowIndex??-1}):i(s.parent,n.parent):s.level>n.level?i(s.parent,n):i(s,n.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(n=>n.rowPinned==="bottom").sort((n,o)=>n.rowIndex-o.rowIndex).map(n=>this.pinnedRowModel.getPinnedBottomRow(n.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedRow("bottom",s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getColsForKeys(i);const n=this.gos.get("treeData");let o=[];return e&&!s?o=this.columnModel.getCols():o=this.visibleColsService.getAllCols(),t&&!n&&(o=o.filter(r=>gd(r)||$n(r))),o}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach(n=>{const o=n;o.getChildren&&o.getChildren().forEach(r=>s.push(r))}),e.length>0&&ot(e[0])&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let n=0;t.forEach(o=>{const r=o;let a;i?a=i(this.gos.addGridCommonParams({columnGroup:r})):a=this.columnNameService.getDisplayNameForColumnGroup(r,"header");const d=r.getLeafColumns().reduce((h,g,f,C)=>{let v=ce(h);return g.getColumnGroupShow()==="open"?(!v||v[1]!=null)&&(v=[f],h.push(v)):v&&v[1]==null&&(v[1]=f-1),f===C.length-1&&v&&v[1]==null&&(v[1]=f),h},[]);s.onColumn(r,a||"",n++,r.getLeafColumns().length-1,d)})}},Su="32.2.0",Im={version:Su,moduleName:`${ut.CsvExportModule}-core`,beans:[c1,h1]},p1={version:Su,moduleName:`${ut.CsvExportModule}-api`,apiFunctions:{getDataAsCsv:d1,exportDataAsCsv:u1},dependantModules:[Im]},g1={version:Su,moduleName:ut.CsvExportModule,dependantModules:[Im,p1]},f1=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let i=e[0],s=e[1],n=e[2],o=e[3];i=this.ff(i,s,n,o,t[0],7,-680876936),o=this.ff(o,i,s,n,t[1],12,-389564586),n=this.ff(n,o,i,s,t[2],17,606105819),s=this.ff(s,n,o,i,t[3],22,-1044525330),i=this.ff(i,s,n,o,t[4],7,-176418897),o=this.ff(o,i,s,n,t[5],12,1200080426),n=this.ff(n,o,i,s,t[6],17,-1473231341),s=this.ff(s,n,o,i,t[7],22,-45705983),i=this.ff(i,s,n,o,t[8],7,1770035416),o=this.ff(o,i,s,n,t[9],12,-1958414417),n=this.ff(n,o,i,s,t[10],17,-42063),s=this.ff(s,n,o,i,t[11],22,-1990404162),i=this.ff(i,s,n,o,t[12],7,1804603682),o=this.ff(o,i,s,n,t[13],12,-40341101),n=this.ff(n,o,i,s,t[14],17,-1502002290),s=this.ff(s,n,o,i,t[15],22,1236535329),i=this.gg(i,s,n,o,t[1],5,-165796510),o=this.gg(o,i,s,n,t[6],9,-1069501632),n=this.gg(n,o,i,s,t[11],14,643717713),s=this.gg(s,n,o,i,t[0],20,-373897302),i=this.gg(i,s,n,o,t[5],5,-701558691),o=this.gg(o,i,s,n,t[10],9,38016083),n=this.gg(n,o,i,s,t[15],14,-660478335),s=this.gg(s,n,o,i,t[4],20,-405537848),i=this.gg(i,s,n,o,t[9],5,568446438),o=this.gg(o,i,s,n,t[14],9,-1019803690),n=this.gg(n,o,i,s,t[3],14,-187363961),s=this.gg(s,n,o,i,t[8],20,1163531501),i=this.gg(i,s,n,o,t[13],5,-1444681467),o=this.gg(o,i,s,n,t[2],9,-51403784),n=this.gg(n,o,i,s,t[7],14,1735328473),s=this.gg(s,n,o,i,t[12],20,-1926607734),i=this.hh(i,s,n,o,t[5],4,-378558),o=this.hh(o,i,s,n,t[8],11,-2022574463),n=this.hh(n,o,i,s,t[11],16,1839030562),s=this.hh(s,n,o,i,t[14],23,-35309556),i=this.hh(i,s,n,o,t[1],4,-1530992060),o=this.hh(o,i,s,n,t[4],11,1272893353),n=this.hh(n,o,i,s,t[7],16,-155497632),s=this.hh(s,n,o,i,t[10],23,-1094730640),i=this.hh(i,s,n,o,t[13],4,681279174),o=this.hh(o,i,s,n,t[0],11,-358537222),n=this.hh(n,o,i,s,t[3],16,-722521979),s=this.hh(s,n,o,i,t[6],23,76029189),i=this.hh(i,s,n,o,t[9],4,-640364487),o=this.hh(o,i,s,n,t[12],11,-421815835),n=this.hh(n,o,i,s,t[15],16,530742520),s=this.hh(s,n,o,i,t[2],23,-995338651),i=this.ii(i,s,n,o,t[0],6,-198630844),o=this.ii(o,i,s,n,t[7],10,1126891415),n=this.ii(n,o,i,s,t[14],15,-1416354905),s=this.ii(s,n,o,i,t[5],21,-57434055),i=this.ii(i,s,n,o,t[12],6,1700485571),o=this.ii(o,i,s,n,t[3],10,-1894986606),n=this.ii(n,o,i,s,t[10],15,-1051523),s=this.ii(s,n,o,i,t[1],21,-2054922799),i=this.ii(i,s,n,o,t[8],6,1873313359),o=this.ii(o,i,s,n,t[15],10,-30611744),n=this.ii(n,o,i,s,t[6],15,-1560198380),s=this.ii(s,n,o,i,t[13],21,1309151649),i=this.ii(i,s,n,o,t[4],6,-145523070),o=this.ii(o,i,s,n,t[11],10,-1120210379),n=this.ii(n,o,i,s,t[2],15,718787259),s=this.ii(s,n,o,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(s,e[1]),e[2]=this.add32(n,e[2]),e[3]=this.add32(o,e[3])}cmn(e,t,i,s,n,o){return t=this.add32(this.add32(t,e),this.add32(s,o)),this.add32(t<<n|t>>>32-n,i)}ff(e,t,i,s,n,o,r){return this.cmn(t&i|~t&s,e,t,n,o,r)}gg(e,t,i,s,n,o,r){return this.cmn(t&s|i&~s,e,t,n,o,r)}hh(e,t,i,s,n,o,r){return this.cmn(t^i^s,e,t,n,o,r)}ii(e,t,i,s,n,o,r){return this.cmn(i^(t|~s),e,t,n,o,r)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(i,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s<e.length;s++)n[s>>2]|=e.charCodeAt(s)<<(s%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,n),s=0;s<16;s++)n[s]=0;return n[14]=t*8,this.md5cycle(i,n),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=t[e>>s*8+4&15]+t[e>>s*8&15];return i}hex(e){for(let t=0;t<e.length;t++)e[t]=this.rhex(e[t]);return e.join("")}md5(e){return this.hex(this.md51(e))}add32(e,t){return this.ieCompatibility?this.add32Compat(e,t):this.add32Std(e,t)}add32Std(e,t){return e+t&4294967295}add32Compat(e,t){const i=(e&65535)+(t&65535);return(e>>16)+(t>>16)+(i>>16)<<16|i&65535}},ia={"01":"GRID","02":"CHARTS","0102":"BOTH"},Lm="https://ag-grid.com/licensing/",_m=class $t{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new f1,this.md5.init()}validateLicense(){const t=this.getLicenseDetails($t.licenseKey),i=`AG Grid ${t.currentLicenseType==="BOTH"?"and AG Charts ":""}Enterprise`,s=t.suppliedLicenseType===void 0?"":`AG ${t.suppliedLicenseType==="BOTH"?"Grid and AG Charts":t.suppliedLicenseType==="GRID"?"Grid":"Charts"} Enterprise`;if(t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(t.expired){const n=$t.getGridReleaseDate(),o=$t.formatDate(n);this.outputExpiredKey(t.expiry,o,i,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(parseInt($t.decode(i),10))}static extractLicenseComponents(t){let i=t.replace(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replace(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,n=i.substring(s),o=i.substring(0,s),[r,a,d]=$t.extractBracketedInformation(i);return{md5:n,license:o,version:r,isTrial:a,type:d}}getLicenseDetails(t){const i=$t.chartsLicenseManager?"BOTH":"GRID";if(gt(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:i};const s=$t.getGridReleaseDate(),{md5:n,license:o,version:r,isTrial:a,type:d}=$t.extractLicenseComponents(t);let h=n===this.md5.md5(o)&&t.indexOf("For_Trialing_ag-Grid_Only")===-1,g,f,C=null,v=!1,S;function R(){g=C<new Date,f=void 0}if(h&&(C=$t.extractExpiry(o),h=!isNaN(C.getTime()),h))switch(f=s>C,r){case"legacy":case"2":{a&&R();break}case"3":gt(d)?h=!1:(S=d,d!==ia["01"]&&d!==ia["0102"]||i==="BOTH"&&S!=="BOTH"?(h=!1,v=!0):a&&R())}return h?{licenseKey:t,valid:h,expiry:$t.formatDate(C),expired:f,version:r,isTrial:a,trialExpired:g,incorrectLicenseType:v,currentLicenseType:i,suppliedLicenseType:S}:{licenseKey:t,valid:h,incorrectLicenseType:v,currentLicenseType:i,suppliedLicenseType:S}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isWebsiteUrl()&&!gt(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage||""}getHostname(){const i=(this.document.defaultView||window).location,{hostname:s=""}=i;return s}isForceWatermark(){const i=(this.document.defaultView||window).location,{pathname:s}=i;return s?s.indexOf("forceWatermark")!==-1:!1}isWebsiteUrl(){return this.getHostname().match(/^((?:[\w-]+\.)?ag-grid\.com)$/)!==null}isLocalhost(){return this.getHostname().match(/^(?:127\.0\.0\.1|localhost)$/)!==null}static formatDate(t){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=t.getDate(),n=t.getMonth(),o=t.getFullYear();return s+" "+i[n]+" "+o}static getGridReleaseDate(){return new Date(parseInt($t.decode($t.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",n,o,r,a,d,h,g,f=0;const C=t.replace(/[^A-Za-z0-9+/=]/g,"");for(;f<C.length;)a=i.indexOf(C.charAt(f++)),d=i.indexOf(C.charAt(f++)),h=i.indexOf(C.charAt(f++)),g=i.indexOf(C.charAt(f++)),n=a<<2|d>>4,o=(d&15)<<4|h>>2,r=(h&3)<<6|g,s=s+String.fromCharCode(n),h!=64&&(s=s+String.fromCharCode(o)),g!=64&&(s=s+String.fromCharCode(r));return s=$t.utf8_decode(s),s}static utf8_decode(t){t=t.replace(/rn/g,"n");let i="";for(let s=0;s<t.length;s++){const n=t.charCodeAt(s);n<128?i+=String.fromCharCode(n):n>127&&n<2048?(i+=String.fromCharCode(n>>6|192),i+=String.fromCharCode(n&63|128)):(i+=String.fromCharCode(n>>12|224),i+=String.fromCharCode(n>>6&63|128),i+=String.fromCharCode(n&63|128))}return i}static setChartsLicenseManager(t){this.chartsLicenseManager=t}static setLicenseKey(t){this.licenseKey=t,this.chartsLicenseManager&&this.chartsLicenseManager.setLicenseKey(t,!0)}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const i=t.match(/\[(.*?)\]/g).map(a=>a.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const s=i.filter(a=>a==="TRIAL").length===1,n=i.filter(a=>a.indexOf("v")===0)[0],o=n?n.replace("v",""):"legacy",r=ia[i.filter(a=>ia[a])[0]];return[o,s,r]}centerPadAndOutput(t){const i=this.totalMessageLength-t.length;console.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",s=""){console.error(t.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(t,i,s){t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${Lm}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${Lm}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,s){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} 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(t,i,s,n){this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${n} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""),this.watermarkMessage="License Expired"}};_m.RELEASE_INFORMATION="MTcyNjQ3MTQ2NjA5Nw==";var sa=_m,m1=class extends Pe{constructor(){super(`<div class="ag-watermark">
210
+ <div data-ref="eLicenseTextRef" class="ag-watermark-text"></div>
211
+ </div>`),this.eLicenseTextRef=J}wireBeans(e){this.licenseManager=e.licenseManager}postConstruct(){const e=this.shouldDisplayWatermark();this.setDisplayed(e),e&&(this.eLicenseTextRef.innerText=this.licenseManager.getWatermarkMessage(),window.setTimeout(()=>this.addCssClass("ag-opacity-zero"),0),window.setTimeout(()=>this.setDisplayed(!1),5e3))}shouldDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}},C1={selector:"AG-WATERMARK",component:m1},v1=class extends B{constructor(){super(...arguments),this.beanName="licenseManager"}postConstruct(){this.validateLicense()}validateLicense(){this.licenseManager=new sa(Xe(this.gos)),this.licenseManager.validateLicense()}static getLicenseDetails(e){return new sa(null).getLicenseDetails(e)}getWatermarkSelector(){return C1}isDisplayWatermark(){return this.licenseManager.isDisplayWatermark()}getWatermarkMessage(){return this.licenseManager.getWatermarkMessage()}static setLicenseKey(e){sa.setLicenseKey(e)}static setChartsLicenseManager(e){sa.setChartsLicenseManager(e)}},w1="32.2.0",S1=class extends Pe{constructor(){super(),this.setTemplate("<div></div>")}init(e){this.params=e,this.cssClassPrefix=this.params.cssClassPrefix??"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=is(`<span data-ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`),{checked:t,icon:i}=this.params;t?e.appendChild(bt("check",this.gos)):i&&(Wl(i)?e.appendChild(i):typeof i=="string"?e.innerHTML=i:W("menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=is(`<span data-ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=is(`<span data-ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=is(`<span data-ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gos.get("enableRtl")?"smallLeft":"smallRight";sr(t,!1),e.appendChild(bt(i,this.gos))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}},Om={version:w1,moduleName:ut.EnterpriseCoreModule,beans:[v1],userComponents:[{name:"agMenuItem",classImp:S1}]};function y1(e){const t=e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">
212
+ <div data-ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">
213
+ <span data-ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>
214
+ <div data-ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>
215
+ </div>
216
+ <div data-ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>
217
+ </div>`}var b1=class Bw extends Pe{constructor(t){super(y1(t)),this.config=t,this.closable=!0,this.eContentWrapper=J,this.eTitleBar=J,this.eTitleBarButtons=J,this.eTitle=J}postConstruct(){const{component:t,closable:i,hideTitleBar:s,title:n,minWidth:o=250,width:r,minHeight:a=250,height:d,centered:h,popup:g,x:f,y:C}=this.config;this.positionableFeature=new gf(this.getGui(),{minWidth:o,width:r,minHeight:a,height:d,centered:h,x:f,y:C,popup:g,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const v=this.getGui();t&&this.setBodyComponent(t),s?je(this.eTitleBar,!1):(n&&this.setTitle(n),this.setClosable(i??this.closable)),this.addManagedElementListeners(this.eTitleBar,{mousedown:S=>{if(v.contains(S.relatedTarget)||v.contains(Ke(this.gos))||this.eTitleBarButtons.contains(S.target)){S.preventDefault();return}const R=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");R&&R.focus()}}),!(g&&this.positionableFeature.isPositioned())&&(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const t=this.getGui();t.focus(),this.close=()=>{t.parentElement.removeChild(t),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(t){this.positionableFeature.setHeight(t)}getWidth(){return this.positionableFeature.getWidth()}setWidth(t){this.positionableFeature.setWidth(t)}setClosable(t){if(t!==this.closable&&(this.closable=t),t){const i=this.closeButtonComp=new Pe(Bw.CLOSE_BTN_TEMPLATE);this.createBean(i);const s=i.getGui(),n=bt("close",this.gos);n.classList.add("ag-panel-title-bar-button-icon"),s.appendChild(n),this.addTitleBarButton(i),i.addManagedElementListeners(s,{click:this.onBtClose.bind(this)})}else if(this.closeButtonComp){const i=this.closeButtonComp.getGui();i.parentElement.removeChild(i),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(t){t.setParentComponent(this),this.eContentWrapper.appendChild(t.getGui())}addTitleBarButton(t,i){const s=this.eTitleBarButtons,n=s.children,o=n.length;i==null&&(i=o),i=Math.max(0,Math.min(i,o)),t.addCssClass("ag-panel-title-bar-button");const r=t.getGui();i===0?s.insertAdjacentElement("afterbegin",r):i===o?s.insertAdjacentElement("beforeend",r):n[i-1].insertAdjacentElement("afterend",r),t.setParentComponent(this)}getBodyHeight(){return Ol(this.eContentWrapper)}getBodyWidth(){return Zn(this.eContentWrapper)}setTitle(t){this.eTitle.innerText=t}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const t=this.getGui();t&&jt(t)&&this.close(),super.destroy()}};b1.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>';function R1(e,t){var i;(i=e.clipboardService)==null||i.copyToClipboard(t)}function F1(e,t){var i;(i=e.clipboardService)==null||i.cutToClipboard(t)}function x1(e,t){var i;(i=e.clipboardService)==null||i.copySelectedRowsToClipboard(t)}function E1(e,t){var i;(i=e.clipboardService)==null||i.copySelectedRangeToClipboard(t)}function P1(e){var t;(t=e.clipboardService)==null||t.copyRangeDown()}function D1(e){var t;(t=e.clipboardService)==null||t.pasteFromClipboard()}var yu="paste",bu="dragCopy",Vm="clipboard",Nm=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.`,T1=class Gw extends B{constructor(){super(...arguments),this.beanName="clipboardService",this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}wireBeans(t){this.csvCreator=t.csvCreator,this.selectionService=t.selectionService,this.rowModel=t.rowModel,this.ctrlsService=t.ctrlsService,this.valueService=t.valueService,this.focusService=t.focusService,this.rowRenderer=t.rowRenderer,this.visibleColsService=t.visibleColsService,this.funcColsService=t.funcColsService,this.cellNavigationService=t.cellNavigationService,this.cellPositionUtils=t.cellPositionUtils,this.rowPositionUtils=t.rowPositionUtils,this.rangeService=t.rangeService}postConstruct(){Ye(this.gos)&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(this,t=>{this.gridCtrl=t.gridCtrl})}pasteFromClipboard(){!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(i=>{W(`${i}
218
+ ${Nm("readText")}`),this.navigatorApiFailed=!0,this.pasteFromClipboardLegacy()}):this.pasteFromClipboardLegacy()}pasteFromClipboardLegacy(){let t=!1;const i=s=>{const n=new Date().getTime();n-this.lastPasteOperationTime<50&&(t=!0,s.preventDefault()),this.lastPasteOperationTime=n};this.executeOnTempElement(s=>{s.addEventListener("paste",i),s.focus({preventScroll:!0})},s=>{const n=s.value;t?this.refocusLastFocusedCell():this.processClipboardData(n),s.removeEventListener("paste",i)})}refocusLastFocusedCell(){const t=this.focusService.getFocusedCell();t&&this.focusService.setFocusedCell({rowIndex:t.rowIndex,column:t.column,rowPinned:t.rowPinned,forceBrowserFocus:!0})}getClipboardDelimiter(){const t=this.gos.get("clipboardDelimiter");return j(t)?t:" "}processClipboardData(t){if(t==null)return;let i=Gw.stringToArray(t,this.getClipboardDelimiter());const s=this.gos.getCallback("processDataFromClipboard");if(s&&(i=s({data:i})),i==null)return;this.gos.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(i);const n=(o,r,a,d)=>{var f;((f=this.rangeService)==null?void 0:f.isMoreThanOneCell())&&!this.hasOnlyOneValueToPaste(i)?this.pasteIntoActiveRange(this.rangeService,i,o,r,d):this.pasteStartingFromFocusedCell(i,o,r,a,d)};this.doPasteOperation(n)}static stringToArray(t,i=","){const s=[],n=r=>r==="\r"||r===`
219
+ `;let o=!1;if(t==="")return[[""]];for(let r=0,a=0,d=0;d<t.length;d++){const h=t[d-1],g=t[d],f=t[d+1],C=()=>{s[r]||(s[r]=[]),s[r][a]||(s[r][a]="")};if(C(),g==='"'&&(o?f==='"'?(s[r][a]+='"',d++):o=!1:(h===void 0||h===i||n(h))&&(o=!0)),!o&&g!=='"'){if(g===i){a++,C();continue}else if(n(g)){a=0,r++,C(),g==="\r"&&f===`
220
+ `&&d++;continue}}s[r][a]+=g}return s}doPasteOperation(t){const i="clipboard";this.eventService.dispatchEvent({type:"pasteStart",source:i});let s;if(this.clientSideRowModel){const d=this.gos.get("aggregateOnlyChangedColumns");s=new Cr(d,this.clientSideRowModel.getRootNode())}const n={},o=[],r=this.focusService.getFocusedCell();t(n,o,r,s);const a=[...o];s&&(this.clientSideRowModel.doAggregate(s),s.forEachChangedNodeDepthFirst(d=>{a.push(d)})),this.rowRenderer.refreshCells({rowNodes:a}),this.dispatchFlashCells(n),this.fireRowChanged(o),this.refocusLastFocusedCell(),this.eventService.dispatchEvent({type:"pasteEnd",source:i})}pasteIntoActiveRange(t,i,s,n,o){const r=this.getRangeSize(t)%i.length!=0;let a=0,d=0;const h=(g,f,C,v)=>{if(v-a>=i.length){if(r)return;a+=d,d=0}const R=i[v-a];n.push(f);const y=this.gos.getCallback("processCellFromClipboard");C.forEach((x,P)=>{if(!x.isCellEditable(f)||x.isSuppressPaste(f))return;P>=R.length&&(P=P%R.length);const T=this.processCell(f,x,R[P],bu,y,!0);f.setDataValue(x,T,yu),o&&o.addParentNode(f.parent,[x]);const{rowIndex:I,rowPinned:V}=g,_=this.cellPositionUtils.createIdFromValues({rowIndex:I,column:x,rowPinned:V});s[_]=!0}),d++};this.iterateActiveRanges(!1,h)}getDisplayedColumnsStartingAt(t){let i=t;const s=[];for(;i!=null;)s.push(i),i=this.visibleColsService.getColAfter(i);return s}pasteStartingFromFocusedCell(t,i,s,n,o){if(!n)return;const r={rowIndex:n.rowIndex,rowPinned:n.rowPinned},a=this.getDisplayedColumnsStartingAt(n.column);this.isPasteSingleValueIntoRange(t)?this.pasteSingleValueIntoRange(t,s,i,o):this.pasteMultipleValues(t,r,s,a,i,Vm,o)}isPasteSingleValueIntoRange(t){return this.hasOnlyOneValueToPaste(t)&&this.rangeService!=null&&!this.rangeService.isEmpty()}pasteSingleValueIntoRange(t,i,s,n){const o=t[0][0],r=(a,d,h)=>{i.push(d),h.forEach(g=>this.updateCellValue(d,g,o,s,Vm,n))};this.iterateActiveRanges(!1,r)}hasOnlyOneValueToPaste(t){return t.length===1&&t[0].length===1}copyRangeDown(){if(!this.rangeService||this.rangeService.isEmpty())return;const t=[],i=(s,n,o,r)=>{const a=this.gos.getCallback("processCellForClipboard"),d=this.gos.getCallback("processCellFromClipboard"),h=(g,f,C)=>{t.length?(n.push(f),C.forEach((v,S)=>{if(!v.isCellEditable(f)||v.isSuppressPaste(f))return;const R=this.processCell(f,v,t[S],bu,d,!0);f.setDataValue(v,R,yu),r&&r.addParentNode(f.parent,[v]);const{rowIndex:y,rowPinned:x}=g,P=this.cellPositionUtils.createIdFromValues({rowIndex:y,column:v,rowPinned:x});s[P]=!0})):C.forEach(v=>{const S=this.processCell(f,v,this.valueService.getValue(v,f),bu,a,!1,!0);t.push(S)})};this.iterateActiveRanges(!0,h)};this.doPasteOperation(i)}removeLastLineIfBlank(t){const i=ce(t);if(i&&i.length===1&&i[0]===""){if(t.length===1)return;wt(t,i)}}fireRowChanged(t){this.gos.get("editType")==="fullRow"&&t.forEach(i=>{this.eventService.dispatchEvent({type:"rowValueChanged",node:i,data:i.data,rowIndex:i.rowIndex,rowPinned:i.rowPinned})})}pasteMultipleValues(t,i,s,n,o,r,a){let d=i;const h=this.clientSideRowModel!=null&&!this.gos.get("enableGroupEdit")&&!this.gos.get("treeData"),g=()=>{for(;;){if(!d)return null;const f=this.rowPositionUtils.getRowNode(d);if(d=this.cellNavigationService.getRowBelow({rowPinned:d.rowPinned,rowIndex:d.rowIndex}),f==null)return null;if(!(f.detail||f.footer||h&&f.group))return f}};t.forEach(f=>{const C=g();C&&(f.forEach((v,S)=>this.updateCellValue(C,n[S],v,o,r,a)),s.push(C))})}updateCellValue(t,i,s,n,o,r){if(!t||!i||!i.isCellEditable(t)||i.isSuppressPaste(t))return;const a=this.processCell(t,i,s,o,this.gos.getCallback("processCellFromClipboard"),!0);t.setDataValue(i,a,yu);const{rowIndex:d,rowPinned:h}=t,g=this.cellPositionUtils.createIdFromValues({rowIndex:d,column:i,rowPinned:h});n[g]=!0,r&&r.addParentNode(t.parent,[i])}copyToClipboard(t={}){this.copyOrCutToClipboard(t)}cutToClipboard(t={},i="api"){this.gos.get("suppressCutToClipboard")||(this.eventService.dispatchEvent({type:"cutStart",source:i}),this.copyOrCutToClipboard(t,!0),this.eventService.dispatchEvent({type:"cutEnd",source:i}))}copyOrCutToClipboard(t,i){let{includeHeaders:s,includeGroupHeaders:n}=t;s==null&&(s=this.gos.get("copyHeadersToClipboard")),n==null&&(n=this.gos.get("copyGroupHeadersToClipboard"));const o={includeHeaders:s,includeGroupHeaders:n},r=this.gos.get("selection");let a=null;this.shouldCopyCells(r)?(this.copySelectedRangeToClipboard(o),a=0):this.shouldCopyRows(r)?(this.copySelectedRowsToClipboard(o),a=1):this.focusService.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(o),a=2),i&&a!==null&&this.clearCellsAfterCopy(a)}shouldCopyCells(t){if(!this.rangeService||this.rangeService.isEmpty())return!1;if(t)return t.mode==="cell";{const i=this.gos.get("suppressCopySingleCellRanges");return!(!this.rangeService.isMoreThanOneCell()&&i)}}shouldCopyRows(t){return this.selectionService.isEmpty()?!1:t?t.mode!=="cell"&&(t.copySelectedRows??!1):!this.gos.get("suppressCopyRowsToClipboard")}clearCellsAfterCopy(t){if(this.eventService.dispatchEvent({type:"keyShortcutChangedCellStart"}),t===0)this.rangeService.clearCellRangeCellValues({cellEventSource:"clipboardService"});else if(t===1)this.clearSelectedRows();else{const i=this.focusService.getFocusedCell();if(i==null)return;const s=this.rowPositionUtils.getRowNode(i);s&&this.clearCellValue(s,i.column)}this.eventService.dispatchEvent({type:"keyShortcutChangedCellEnd"})}clearSelectedRows(){const t=this.selectionService.getSelectedNodes(),i=this.visibleColsService.getAllCols();for(const s of t)for(const n of i)this.clearCellValue(s,n)}clearCellValue(t,i){if(!i.isCellEditable(t))return;const s=this.valueService.getDeleteValue(i,t);t.setDataValue(i,s,"clipboardService")}iterateActiveRanges(t,i,s){if(!this.rangeService||this.rangeService.isEmpty())return;const n=this.rangeService.getCellRanges();t?this.iterateActiveRange(n[0],i,s,!0):n.forEach((o,r)=>this.iterateActiveRange(o,i,s,r===n.length-1))}iterateActiveRange(t,i,s,n){if(!this.rangeService)return;let o=this.rangeService.getRangeStartRow(t);const r=this.rangeService.getRangeEndRow(t);s&&t.columns&&s(t.columns);let a=0,d=!1;for(;!d&&o!=null;){const h=this.rowPositionUtils.getRowNode(o);d=this.rowPositionUtils.sameRow(o,r),i(o,h,t.columns,a++,d&&n),o=this.cellNavigationService.getRowBelow(o)}}copySelectedRangeToClipboard(t={}){if(!this.rangeService||this.rangeService.isEmpty())return;const i=this.rangeService.areAllRangesAbleToMerge(),{data:s,cellsToFlash:n}=i?this.buildDataFromMergedRanges(this.rangeService,t):this.buildDataFromRanges(this.rangeService,t);this.copyDataToClipboard(s),this.dispatchFlashCells(n)}buildDataFromMergedRanges(t,i){const s=new Set,n=t.getCellRanges(),o=new Map,r=[],a={};n.forEach(f=>{f.columns.forEach(S=>s.add(S));const{rowPositions:C,cellsToFlash:v}=this.getRangeRowPositionsAndCellsToFlash(t,f);C.forEach(S=>{const R=`${S.rowIndex}-${S.rowPinned||"null"}`;o.get(R)||(o.set(R,!0),r.push(S))}),Object.assign(a,v)});const d=this.visibleColsService.getAllCols(),h=Array.from(s);return h.sort((f,C)=>{const v=d.indexOf(f),S=d.indexOf(C);return v-S}),{data:this.buildExportParams({columns:h,rowPositions:r,includeHeaders:i.includeHeaders,includeGroupHeaders:i.includeGroupHeaders}),cellsToFlash:a}}buildDataFromRanges(t,i){const s=t.getCellRanges(),n=[],o={};return s.forEach(r=>{const{rowPositions:a,cellsToFlash:d}=this.getRangeRowPositionsAndCellsToFlash(t,r);Object.assign(o,d),n.push(this.buildExportParams({columns:r.columns,rowPositions:a,includeHeaders:i.includeHeaders,includeGroupHeaders:i.includeGroupHeaders}))}),{data:n.join(`
221
+ `),cellsToFlash:o}}getRangeRowPositionsAndCellsToFlash(t,i){const s=[],n={},o=t.getRangeStartRow(i),r=t.getRangeEndRow(i);let a=o;for(;a&&(s.push(a),i.columns.forEach(d=>{const{rowIndex:h,rowPinned:g}=a,f=this.cellPositionUtils.createIdFromValues({rowIndex:h,column:d,rowPinned:g});n[f]=!0}),!this.rowPositionUtils.sameRow(a,r));)a=this.cellNavigationService.getRowBelow(a);return{rowPositions:s,cellsToFlash:n}}getCellsToFlashFromRowNodes(t){const i=this.visibleColsService.getAllCols(),s={};for(let n=0;n<t.length;n++){const{rowIndex:o,rowPinned:r}=t[n];if(o!=null)for(let a=0;a<i.length;a++){const d=i[a],h=this.cellPositionUtils.createIdFromValues({rowIndex:o,column:d,rowPinned:r});s[h]=!0}}return s}copyFocusedCellToClipboard(t={}){const i=this.focusService.getFocusedCell();if(i==null)return;const s=this.cellPositionUtils.createId(i),n={rowPinned:i.rowPinned,rowIndex:i.rowIndex},o=i.column,r=this.buildExportParams({columns:[o],rowPositions:[n],includeHeaders:t.includeHeaders,includeGroupHeaders:t.includeGroupHeaders});this.copyDataToClipboard(r),this.dispatchFlashCells({[s]:!0})}copySelectedRowsToClipboard(t={}){const{columnKeys:i,includeHeaders:s,includeGroupHeaders:n}=t,o=this.buildExportParams({columns:i,includeHeaders:s,includeGroupHeaders:n});this.copyDataToClipboard(o);const r=this.selectionService.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(r))}buildExportParams(t){const{columns:i,rowPositions:s,includeHeaders:n=!1,includeGroupHeaders:o=!1}=t,r={columnKeys:i,rowPositions:s,skipColumnHeaders:!n,skipColumnGroupHeaders:!o,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!s,processCellCallback:this.gos.getCallback("processCellForClipboard"),processRowGroupCallback:a=>this.processRowGroupCallback(a),processHeaderCallback:this.gos.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:this.gos.getCallback("processGroupHeaderForClipboard")};return this.csvCreator.getDataAsCsv(r,!0)}processRowGroupCallback(t){const{node:i,column:s}=t,n=this.gos.get("treeData"),o=this.gos.get("suppressGroupMaintainValueType");let a=(()=>{var g;if(n||o||!s)return i.key;const h=(g=i.groupData)==null?void 0:g[s.getId()];return!h||!i.rowGroupColumn||i.rowGroupColumn.getColDef().useValueFormatterForExport===!1?h:this.valueService.formatValue(i.rowGroupColumn,i,h)??h})();if(t.node.footer){let h="";a&&a.length&&(h=` ${a}`),a=`Total${h}`}const d=this.gos.getCallback("processCellForClipboard");if(d){let h=i.rowGroupColumn;return!h&&i.footer&&i.level===-1&&(h=this.funcColsService.getRowGroupColumns()[0]),d({value:a,node:i,column:h,type:"clipboard",formatValue:g=>this.valueService.formatValue(h,i,g)??g,parseValue:g=>this.valueService.parseValue(h,i,g,this.valueService.getValue(h,i))})}return a}dispatchFlashCells(t){window.setTimeout(()=>{this.eventService.dispatchEvent({type:"flashCells",cells:t})},0)}processCell(t,i,s,n,o,r,a){return o?o({column:i,node:t,value:s,type:n,formatValue:h=>this.valueService.formatValue(i,t??null,h)??h,parseValue:h=>this.valueService.parseValue(i,t??null,h,this.valueService.getValue(i,t))}):r&&i.getColDef().useValueParserForImport!==!1?this.valueService.parseValue(i,t??null,s,this.valueService.getValue(i,t)):a&&i.getColDef().useValueFormatterForExport!==!1?this.valueService.formatValue(i,t??null,s)??s:s}copyDataToClipboard(t){const i=this.gos.getCallback("sendToClipboard");if(i){i({data:t});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(t).catch(n=>{W(`${n}
222
+ ${Nm("writeText")}`),this.copyDataToClipboardLegacy(t)});return}this.copyDataToClipboardLegacy(t)}copyDataToClipboardLegacy(t){this.executeOnTempElement(i=>{const s=Xe(this.gos),n=Ke(this.gos);i.value=t||" ",i.select(),i.focus({preventScroll:!0}),s.execCommand("copy")||W("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."),n!=null&&n.focus!=null&&n.focus({preventScroll:!0})})}executeOnTempElement(t,i){const s=Xe(this.gos),n=s.createElement("textarea");n.style.width="1px",n.style.height="1px",n.style.top=s.documentElement.scrollTop+"px",n.style.left=s.documentElement.scrollLeft+"px",n.style.position="absolute",n.style.opacity="0";const o=this.gridCtrl.getGui();o.appendChild(n);try{t(n)}catch{W("Browser does not support document.execCommand('copy') for clipboard operations")}i?window.setTimeout(()=>{i(n),o.removeChild(n)},100):o.removeChild(n)}getRangeSize(t){const i=t.getCellRanges();let s=0,n=0;return i.length>0&&(s=t.getRangeStartRow(i[0]).rowIndex,n=t.getRangeEndRow(i[0]).rowIndex),s-n+1}},Ru="32.2.0",Bm={version:Ru,moduleName:`${ut.ClipboardModule}-core`,beans:[T1],dependantModules:[Om,g1]},A1={version:Ru,moduleName:`${ut.ClipboardModule}-api`,apiFunctions:{copyToClipboard:R1,cutToClipboard:F1,copySelectedRowsToClipboard:x1,copySelectedRangeToClipboard:E1,copySelectedRangeDown:P1,pasteFromClipboard:D1},dependantModules:[Bm]},M1={version:Ru,moduleName:ut.ClipboardModule,dependantModules:[Bm,A1]};function k1(e){var t;return((t=e.rangeService)==null?void 0:t.getCellRanges())??null}function I1(e,t){var i;(i=e.rangeService)==null||i.addCellRange(t)}function Gm(e){var t;(t=e.rangeService)==null||t.removeAllCellRanges()}var L1=class extends B{constructor(){super(...arguments),this.beanName="rangeService",this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}wireBeans(e){this.rowModel=e.rowModel,this.dragService=e.dragService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService,this.valueService=e.valueService}postConstruct(){const e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),i=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:i,columnMoved:i,columnPinned:i}),this.ctrlsService.whenReady(this,s=>{const n=s.gridBodyCtrl;this.autoScrollService=new uf({scrollContainer:n.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:()=>n.getScrollFeature().getVScrollPosition().top,setVerticalPosition:o=>n.getScrollFeature().setVerticalScrollPosition(o),getHorizontalPosition:()=>n.getScrollFeature().getHScrollPosition().left,setHorizontalPosition:o=>n.getScrollFeature().setHorizontalScrollPosition(o),shouldSkipVerticalScroll:()=>!ht(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!n.getScrollFeature().isHorizontalScrollShowing()})})}onColumnsChanged(){this.refreshLastRangeStart();const e=this.visibleColsService.getAllCols();this.cellRanges.forEach(i=>{const s=i.columns;i.columns=i.columns.filter(o=>o.isVisible()&&e.indexOf(o)!==-1),!Ni(s,i.columns)&&this.dispatchChangedEvent(!1,!0,i.id)});const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(i=>i.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=ce(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const i=this.visibleColsService.getAllCols(),s=t.map(n=>i.indexOf(n)).sort((n,o)=>n-o);return ce(s)-s[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?this.rowPositionUtils.before(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.pinnedRowModel.getPinnedBottomRowCount();return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(e,t=!1){if(!Ot(this.gos))return;const i=this.calculateColumnsBetween(e.column,e.column);if(!i)return;(Qo(this.gos)||!t||ke(this.cellRanges))&&this.removeAllCellRanges(!0);const n={rowIndex:e.rowIndex,rowPinned:e.rowPinned},o={startRow:n,endRow:n,columns:i,startColumn:e.column};this.cellRanges.push(o),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=ce(this.cellRanges);this.updateRangeEnd(t,e)}updateRangeEnd(e,t,i=!1){const s=t.column,n=this.calculateColumnsBetween(e.startColumn,s);!n||this.isLastCellOfRange(e,t)||(e.columns=n,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},i||this.dispatchChangedEvent(!0,!0,e.id))}refreshRangeStart(e){const{startColumn:t,columns:i}=e,s=(d,h)=>{const g=e.columns.filter(f=>f!==d);d?(e.startColumn=d,e.columns=h?[d,...g]:[...g,d]):e.columns=g},{left:n,right:o}=this.getRangeEdgeColumns(e);if(t===i[0]&&t!==n){s(n,!0);return}if(t===ce(i)&&t===o){s(o,!1);return}}getRangeEdgeColumns(e){const t=this.visibleColsService.getAllCols(),i=e.columns.map(s=>t.indexOf(s)).filter(s=>s>-1).sort((s,n)=>s-n);return{left:t[i[0]],right:t[ce(i)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,i=e.ctrlKey||e.metaKey,s=ce(this.cellRanges),n=this.newestRangeStartCell,o=s.columns[0],r=ce(s.columns),a=s.endRow.rowIndex,d=s.endRow.rowPinned,g={column:n.column===o?r:o,rowIndex:a,rowPinned:d},f=this.cellNavigationService.getNextCellToFocus(t,g,i);if(f)return this.setCellRange({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:f.rowIndex,rowEndPinned:f.rowPinned,columnStart:n.column,columnEnd:f.column}),f}setCellRange(e){Ot(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){eT(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach(t=>{t.columns&&t.startRow&&this.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.columns[0]}),this.cellRanges.push(t)}),this.dispatchChangedEvent(!1,!0))}setNewestRangeStartCell(e){this.newestRangeStartCell=e}clearCellRangeCellValues(e){let{cellRanges:t}=e;const{cellEventSource:i="rangeService",dispatchWrapperEvents:s,wrapperEventSource:n="deleteKey"}=e;s&&(this.eventService.dispatchEvent({type:"cellSelectionDeleteStart",source:n}),this.eventService.dispatchEvent({type:"rangeDeleteStart",source:n})),t||(t=this.cellRanges),t.forEach(o=>{this.forEachRowInRange(o,r=>{const a=this.rowPositionUtils.getRowNode(r);if(a)for(let d=0;d<o.columns.length;d++){const h=this.columnModel.getCol(o.columns[d]);if(!h||!h.isCellEditable(a))continue;const g=this.valueService.getDeleteValue(h,a);a.setDataValue(h,g,i)}})}),s&&(this.eventService.dispatchEvent({type:"cellSelectionDeleteEnd",source:n}),this.eventService.dispatchEvent({type:"rangeDeleteEnd",source:n}))}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let i,s=!1;if(e.columns)i=e.columns.map(r=>this.columnModel.getCol(r)).filter(r=>r);else{const r=this.columnModel.getCol(e.columnStart),a=this.columnModel.getCol(e.columnEnd);if(!r||!a)return;i=this.calculateColumnsBetween(r,a),i&&i.length&&(s=i[0]!==r)}if(!i||!t&&i.length===0)return;const n=e.rowStartIndex!=null?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,o=e.rowEndIndex!=null?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0;return{startRow:n,endRow:o,columns:i,startColumn:s?ce(i):i[0]}}addCellRange(e){const t=this.gos;if(!Ot(t))return;if(od(t)&&Qo(t)&&this.cellRanges.length>0)return W("cannot add multiple ranges when `selection.suppressMultiRanges = true`");const i=this.createCellRangeFromCellRangeParams(e);i&&(i.startRow&&this.setNewestRangeStartCell({rowIndex:i.startRow.rowIndex,rowPinned:i.startRow.rowPinned,column:i.startColumn}),this.cellRanges.push(i),this.dispatchChangedEvent(!1,!0,i.id))}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){const e=this.cellRanges.length;if(e===0)return!1;if(e>1)return!0;const t=this.cellRanges[0],i=this.getRangeStartRow(t),s=this.getRangeEndRow(t);return i.rowPinned!==s.rowPinned||i.rowIndex!==s.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach(s=>{this.forEachRowInRange(s,n=>{const o=`${n.rowPinned||"normal"}_${n.rowIndex}`,r=e.get(o),a=s.columns.map(d=>d.getId());if(r){const d=a.filter(h=>r.indexOf(h)===-1);r.push(...d)}else e.set(o,a)})});let i;for(const s of e.values()){const n=s.sort().join();if(i===void 0){i=n;continue}if(i!==n)return!1}return!0}forEachRowInRange(e,t){const i=this.getRangeStartRow(e),s=this.getRangeEndRow(e);let n=i;for(;n&&(t(n),!this.rowPositionUtils.sameRow(n,s));)n=this.cellNavigationService.getRowBelow(n)}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const i=t.columns!==null&&Qi(t.columns,e.column),s=this.isRowInRange(e.rowIndex,e.rowPinned,t);return i&&s}isLastCellOfRange(e,t){const{startRow:i,endRow:s}=e,n=this.rowPositionUtils.before(i,s)?s:i,o=t.rowIndex===n.rowIndex&&t.rowPinned===n.rowPinned,r=e.columns[0],a=ce(e.columns),d=e.startColumn===r?a:r;return t.column===d&&o}isBottomRightCell(e,t){const i=this.visibleColsService.getAllCols(),s=e.columns.map(h=>i.indexOf(h)).sort((h,g)=>h-g),{startRow:n,endRow:o}=e,r=this.rowPositionUtils.before(n,o)?o:n,a=i.indexOf(t.column)===ce(s),d=t.rowIndex===r.rowIndex&&yi(t.rowPinned)===yi(r.rowPinned);return a&&d}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,i){const s=this.getRangeStartRow(i),n=this.getRangeEndRow(i),o={rowIndex:e,rowPinned:t||null},r=o.rowIndex===s.rowIndex&&o.rowPinned==s.rowPinned,a=o.rowIndex===n.rowIndex&&o.rowPinned==n.rowPinned;if(r||a)return!0;const d=!this.rowPositionUtils.before(o,s),h=this.rowPositionUtils.before(o,n);return d&&h}getDraggingRange(){return this.draggingRange}onDragStart(e){if(!Ot(this.gos))return;const{ctrlKey:t,metaKey:i,shiftKey:s}=e,n=t||i,r=!Qo(this.gos)?n:!1,a=s&&JD(this.cellRanges);!r&&(!a||j(ce(this.cellRanges).type))&&this.removeAllCellRanges(!0);const d=this.dragService.getStartTarget();if(d&&this.updateValuesOnMove(d),!!this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=r&&this.getCellRangeCount(this.lastCellHovered)>1,a||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=ce(this.cellRanges);else{const h={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:h,endRow:h,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}intersectLastRange(e){if(e&&this.dragging||Qo(this.gos)||this.isEmpty())return;const t=this.rowPositionUtils,i=ce(this.cellRanges),s=this.getRangeStartRow(i),n=this.getRangeEndRow(i),o=[];this.cellRanges.slice(0,-1).forEach(r=>{const a=this.getRangeStartRow(r),d=this.getRangeEndRow(r),h=r.columns,g=h.filter(C=>i.columns.indexOf(C)===-1);if(g.length===h.length){o.push(r);return}if(t.before(n,a)||t.before(d,s)){o.push(r);return}const f=o.length;if(t.before(a,s)){const C={columns:[...h],startColumn:i.startColumn,startRow:{...a},endRow:this.cellNavigationService.getRowAbove(s)};o.push(C)}if(g.length>0){const C={columns:g,startColumn:Qi(g,i.startColumn)?i.startColumn:g[0],startRow:this.rowMax([{...s},{...a}]),endRow:this.rowMin([{...n},{...d}])};o.push(C)}t.before(n,d)&&o.push({columns:[...h],startColumn:i.startColumn,startRow:this.cellNavigationService.getRowBelow(n),endRow:{...d}}),o.length-f===1&&(o[o.length-1].id=r.id)}),this.cellRanges=o,e&&this.dispatchChangedEvent(!1,!0)}rowMax(e){let t;return e.forEach(i=>{(t===void 0||this.rowPositionUtils.before(t,i))&&(t=i)}),t}rowMin(e){let t;return e.forEach(i=>{(t===void 0||this.rowPositionUtils.before(i,t))&&(t=i)}),t}updateValuesOnMove(e){const t=Tl(this.gos,e,Ls.DOM_DATA_KEY_CELL_CTRL),i=t==null?void 0:t.getCellPosition();if(this.cellHasChanged=!1,!(!i||this.lastCellHovered&&this.cellPositionUtils.equals(i,this.lastCellHovered))){if(t!=null&&t.isEditing()){this.dragService.cancelDrag(e);return}this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=i}}onDragging(e){if(!this.dragging||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const t=this.lastCellHovered,i=o=>t&&t.rowPinned===o&&this.newestRangeStartCell.rowPinned===o,s=i("top")||i("bottom");if(this.autoScrollService.check(e,s),!this.cellHasChanged)return;const n=this.calculateColumnsBetween(this.newestRangeStartCell.column,t.column);n&&(this.draggingRange.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},this.draggingRange.columns=n,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(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)}dispatchChangedEvent(e,t,i){this.eventService.dispatchEvent({type:"cellSelectionChanged",started:e,finished:t,id:i}),this.eventService.dispatchEvent({type:"rangeSelectionChanged",started:e,finished:t,id:i})}calculateColumnsBetween(e,t){const i=this.visibleColsService.getAllCols(),s=e===t,n=i.indexOf(e),o=g=>W(`column ${g.getId()} is not visible`);if(n<0){o(e);return}const r=s?n:i.indexOf(t);if(r<0){o(t);return}if(s)return[e];const a=Math.min(n,r),d=a===n?r:n,h=[];for(let g=a;g<=d;g++)h.push(i[g]);return h}},Hm=class extends Pe{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService,this.mouseEventService=e.mouseEventService,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService}postConstruct(){this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:e=>{this.dragging=!0,this.rangeService.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearDragProperties(),this.shouldDestroyOnEndDragging&&this.destroy()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedElementListeners(this.getGui(),{mousedown:this.preventRangeExtension.bind(this)})}isDragging(){return this.dragging}getCellCtrl(){return this.cellCtrl}setCellCtrl(e){this.cellCtrl=e}getCellRange(){return this.cellRange}setCellRange(e){this.cellRange=e}getRangeStartRow(){return this.rangeStartRow}setRangeStartRow(e){this.rangeStartRow=e}getRangeEndRow(){return this.rangeEndRow}setRangeEndRow(e){this.rangeEndRow=e}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){[this.cellHoverListener]=this.addManagedElementListeners(this.ctrlsService.get("gridCtrl").getGui(),{mousemove:this.updateValuesOnMove.bind(this)}),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===ur.FILL?"fill":"range"}-handle`}updateValuesOnMove(e){const t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass())}getType(){return this.type}refresh(e){const t=this.getCellCtrl(),i=this.getGui(),s=ce(this.rangeService.getCellRanges()),n=s.startRow,o=s.endRow;if(n&&o&&(this.rowPositionUtils.before(o,n)?(this.setRangeStartRow(o),this.setRangeEndRow(n)):(this.setRangeStartRow(n),this.setRangeEndRow(o))),t!==e||!jt(i)){this.setCellCtrl(e);const r=e.getComp().getParentOfValue();r&&r.appendChild(i)}this.setCellRange(s)}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.isDragging()){je(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const e=this.getGui();e.parentElement&&e.parentElement.removeChild(e)}};function _1(e){const t=e.length;let i=0;if(t<=1)return e;for(let f=0;f<e.length;f++){const C=e[f],v=C.toString().split("e-");if(v.length>1){i=Math.max(i,parseInt(v[1],10));continue}Math.floor(C)!==C&&(i=Math.max(i,C.toString().split(".")[1].length))}let s=0,n=0,o=0,r=0,a=0;for(let f=0;f<t;f++)a=e[f],s+=f,n+=a,r+=f*f,o+=f*a;const d=(t*o-s*n)/(t*r-s*s),h=n/t-d*s/t,g=[];for(let f=0;f<=t;f++)g.push(parseFloat((f*d+h).toFixed(i)));return g}var O1=class extends Hm{constructor(){super('<div class="ag-fill-handle"></div>'),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=ur.FILL}wireBeans(e){super.wireBeans(e),this.valueService=e.valueService,this.navigationService=e.navigationService,this.cellNavigationService=e.cellNavigationService,this.visibleColsService=e.visibleColsService}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(e));const{x:t,y:i}=this.initialXY,{x:s,y:n}=this.mouseEventService.getNormalisedPosition(e),o=Math.abs(t-s),r=Math.abs(i-n),a=this.getFillHandleDirection();let d;a==="xy"?d=o>r?"x":"y":d=a,d!==this.dragAxis&&(this.dragAxis=d,this.changedCalculatedValues=!0)}onDrag(e){if(!this.initialPosition){const i=this.getCellCtrl();if(!i)return;this.initialPosition=i.getCellPosition()}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t=this.dragAxis==="x",i=this.getCellRange(),s=i.columns.length,n=this.getRangeStartRow(),o=this.getRangeEndRow();let r;if(!this.isUp&&!this.isLeft)r=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,columnStart:i.columns[0],rowEndIndex:t?o.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?o.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:i.columns[s-1]});else{const a=t?n:this.lastCellMarked;r=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:a.rowIndex,rowStartPinned:a.rowPinned,columnStart:t?this.lastCellMarked.column:i.columns[0],rowEndIndex:o.rowIndex,rowEndPinned:o.rowPinned,columnEnd:i.columns[s-1]})}r&&(this.eventService.dispatchEvent({type:"fillStart"}),this.handleValueChanged(i,r,e),this.rangeService.setCellRanges([r]),this.eventService.dispatchEvent({type:"fillEnd",initialRange:i,finalRange:r}))}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}getFillHandleDirection(){var t;const e=(t=rd(this.gos))==null?void 0:t.direction;return e?e!=="x"&&e!=="y"&&e!=="xy"?(W("valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."),"xy"):e:"xy"}handleValueChanged(e,t,i){var x;const s=this.rangeService.getRangeEndRow(e),n=this.rangeService.getRangeStartRow(e),o=this.rangeService.getRangeEndRow(t),r=this.rangeService.getRangeStartRow(t),a=this.dragAxis==="y";if(this.isReduce&&!((x=rd(this.gos))!=null&&x.suppressClearOnFillReduction)){const P=a?e.columns:e.columns.filter(I=>t.columns.indexOf(I)<0),T=a?this.cellNavigationService.getRowBelow(o):r;T&&this.clearCellsInRange(T,s,P);return}const d=[],h=[],g=[],f=[];let C=!0,v=0;const S=()=>{d.length=0,h.length=0,g.length=0,f.length=0,v=0},R=(P,T)=>{let I=this.isUp?s:n,V=!1;for(a&&(C=!0,S());!V&&I;){const _=this.rowPositionUtils.getRowNode(I);if(!_)break;a&&P?y(d,P,_,()=>!this.rowPositionUtils.sameRow(I,this.isUp?n:s)):T&&(C=!0,S(),T.forEach(O=>y(d,O,_,()=>O!==(this.isLeft?e.columns[0]:ce(e.columns))))),V=this.rowPositionUtils.sameRow(I,this.isUp?r:o),I=this.isUp?this.cellNavigationService.getRowAbove(I):this.cellNavigationService.getRowBelow(I)}},y=(P,T,I,V)=>{var M;let _,O=!1;if(C)_=this.valueService.getValue(T,I),h.push(_),g.push(this.valueService.getValue(T,I,void 0,!0)),f.push(this.valueService.formatValue(T,I,_)),C=V();else{const{value:A,fromUserFunction:z,sourceCol:H,sourceRowNode:Z}=this.processValues({event:i,values:P,initialValues:h,initialNonAggregatedValues:g,initialFormattedValues:f,col:T,rowNode:I,idx:v++});if(_=A,T.isCellEditable(I)){const ie=this.valueService.getValue(T,I);z||(H&&((M=H.getColDef())==null?void 0:M.useValueFormatterForExport)!==!1&&(_=this.valueService.formatValue(H,Z,_)??_),T.getColDef().useValueParserForImport!==!1&&(_=this.valueService.parseValue(T,I,H?_:bl(_),ie))),!z||ie!==_?I.setDataValue(T,_,"rangeService"):O=!0}}O||P.push({value:_,column:T,rowNode:I})};if(a)e.columns.forEach(P=>{R(P)});else{const P=this.isLeft?[...t.columns].reverse():t.columns;R(void 0,P)}}clearCellsInRange(e,t,i){const s={startRow:e,endRow:t,columns:i,startColumn:i[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[s]})}processValues(e){var v;const{event:t,values:i,initialValues:s,initialNonAggregatedValues:n,initialFormattedValues:o,col:r,rowNode:a,idx:d}=e,h=(v=rd(this.gos))==null?void 0:v.setFillValue,g=this.dragAxis==="y";let f;if(g?f=this.isUp?"up":"down":f=this.isLeft?"left":"right",h){const S=this.gos.addGridCommonParams({event:t,values:i.map(({value:y})=>y),initialValues:s,initialNonAggregatedValues:n,initialFormattedValues:o,currentIndex:d,currentCellValue:this.valueService.getValue(r,a),direction:f,column:r,rowNode:a}),R=h(S);if(R!==!1)return{value:R,fromUserFunction:!0}}const C=!i.some(({value:S})=>{const R=parseFloat(S);return isNaN(R)||R.toString()!==S.toString()});if(t.altKey||!C){if(C&&s.length===1){const x=this.isUp||this.isLeft?-1:1;return{value:parseFloat(ce(i).value)+1*x,fromUserFunction:!1}}const{value:S,column:R,rowNode:y}=i[d%i.length];return{value:S,fromUserFunction:!1,sourceCol:R,sourceRowNode:y}}return{value:ce(_1(i.map(({value:S})=>Number(S)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const t=e.getComp();t.addOrRemoveCssClass("ag-selection-fill-top",!1),t.addOrRemoveCssClass("ag-selection-fill-right",!1),t.addOrRemoveCssClass("ag-selection-fill-bottom",!1),t.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(this.rowPositionUtils.sameRow(t,e))return;const i=this.rowPositionUtils.before(t,e),s=this.getRangeStartRow(),n=this.getRangeEndRow();i&&(t.rowPinned==s.rowPinned&&t.rowIndex>=s.rowIndex||s.rowPinned!=n.rowPinned&&t.rowPinned==n.rowPinned&&t.rowIndex<=n.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,i),this.isReduce=!1)}else{const i=e.column,s=t.column;if(i===s)return;const n=this.visibleColsService.getAllCols(),o=n.indexOf(i),r=n.indexOf(s);r<=o&&r>=n.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,r<o),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,i){const{navigationService:s,rangeService:n}=this;let o=e;do{const r=this.getCellRange(),a=r.columns.length;for(let d=0;d<a;d++){const h=r.columns[d],f={...{rowIndex:o.rowIndex,rowPinned:o.rowPinned},column:h},C=n.isCellInSpecificRange(f,r),v=this.rowPositionUtils.sameRow(o,e);if(i&&(this.isUp=!0),!v){const S=s.getCellByPosition(f);if(S){this.markedCells.push(S);const R=S.getComp();C||(R.addOrRemoveCssClass("ag-selection-fill-left",d===0),R.addOrRemoveCssClass("ag-selection-fill-right",d===a-1)),R.addOrRemoveCssClass(i?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(o,t))}}}if(this.rowPositionUtils.sameRow(o,t))break}while(o=i?this.cellNavigationService.getRowAbove(o):this.cellNavigationService.getRowBelow(o))}reduceVertical(e,t){let i=e;do{const s=this.getCellRange(),n=s.columns.length,o=this.rowPositionUtils.sameRow(i,t);for(let r=0;r<n;r++){const d={...{rowIndex:i.rowIndex,rowPinned:i.rowPinned},column:s.columns[r]},h=this.navigationService.getCellByPosition(d);h&&(this.markedCells.push(h),h.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(i,t)))}if(o)break}while(i=this.cellNavigationService.getRowAbove(i))}extendHorizontal(e,t,i){const s=this.visibleColsService.getAllCols(),n=s.indexOf(i?t.column:e.column),o=s.indexOf(i?this.getCellRange().columns[0]:t.column),r=i?0:1,a=s.slice(n+r,o+r),d=this.getRangeStartRow(),h=this.getRangeEndRow();a.forEach(g=>{let f=d,C=!1;do{C=this.rowPositionUtils.sameRow(f,h);const v=this.navigationService.getCellByPosition({rowIndex:f.rowIndex,rowPinned:f.rowPinned,column:g});if(v){this.markedCells.push(v);const S=v.getComp();S.addOrRemoveCssClass("ag-selection-fill-top",this.rowPositionUtils.sameRow(f,d)),S.addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(f,h)),i?(this.isLeft=!0,S.addOrRemoveCssClass("ag-selection-fill-left",g===a[0])):S.addOrRemoveCssClass("ag-selection-fill-right",g===ce(a))}f=this.cellNavigationService.getRowBelow(f)}while(!C)})}reduceHorizontal(e,t){const i=this.visibleColsService.getAllCols(),s=i.indexOf(t.column),n=i.indexOf(e.column),o=i.slice(s,n),r=this.getRangeStartRow(),a=this.getRangeEndRow();o.forEach(d=>{let h=r,g=!1;do{g=this.rowPositionUtils.sameRow(h,a);const f=this.navigationService.getCellByPosition({rowIndex:h.rowIndex,rowPinned:h.rowPinned,column:d});f&&(this.markedCells.push(f),f.getComp().addOrRemoveCssClass("ag-selection-fill-right",d===o[0])),h=this.cellNavigationService.getRowBelow(h)}while(!g)})}refresh(e){const t=this.rangeService.getCellRanges()[0];if(!t.startRow||!t.endRow){this.destroy();return}super.refresh(e)}},V1=class extends Hm{constructor(){super('<div class="ag-range-handle"></div>'),this.type=ur.RANGE,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const i=this.rangeService.getCellRanges(),s=ce(i);this.rangeFixed||(this.fixRangeStartEnd(s),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},i.length===2&&i[0].type===cu.DIMENSION&&s.type===cu.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(s))&&this.rangeService.updateRangeEnd(i[0],{...this.endPosition,column:i[0].columns[0]},!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}onDragEnd(e){const t=ce(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}onDragCancel(){this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.rangeService.getRangeStartRow(e),i=this.rangeService.getRangeEndRow(e),s=e.columns[0];e.startRow=t,e.endRow=i,e.startColumn=s}},N1=class extends B{constructor(){super(...arguments),this.beanName="selectionHandleFactory"}createSelectionHandle(e){return this.createBean(e===ur.RANGE?new V1:new O1)}},Fu="32.2.0",Wm={version:Fu,moduleName:`${ut.RangeSelectionModule}-core`,beans:[L1,N1],dependantModules:[Om]},B1={version:Fu,moduleName:`${ut.RangeSelectionModule}-api`,apiFunctions:{getCellRanges:k1,addCellRange:I1,clearRangeSelection:Gm,clearCellSelection:Gm},dependantModules:[Wm]},G1={version:Fu,moduleName:ut.RangeSelectionModule,dependantModules:[Wm,B1]};const H1={class:"grid-overlay-container"},W1=c.defineComponent({__name:"OverlayLoading",props:{params:{}},setup(e){return(t,i)=>(c.openBlock(),c.createElementBlock("div",H1,[t.params.notReady?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[i[0]||(i[0]=c.createElementVNode("div",{class:"grid-icon-cat-in-bag"},null,-1)),i[1]||(i[1]=c.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1))],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[i[2]||(i[2]=c.createElementVNode("div",{class:"mask-24 mask-loading grid-mask-loading"},null,-1)),i[3]||(i[3]=c.createElementVNode("span",{class:"text-subtitle-m"},"Loading",-1))],64))]))}}),z1={},U1={class:"grid-overlay-container"};function $1(e,t){return c.openBlock(),c.createElementBlock("div",U1,t[0]||(t[0]=[c.createElementVNode("div",{class:"grid-icon-sad-cat"},null,-1),c.createElementVNode("span",{class:"text-subtitle-m"},"Not calculated",-1)]))}const K1=qc(z1,[["render",$1]]);async function j1(e,t,i){throw Error("not implemented")}var He;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function i(n){throw new Error}e.assertNever=i,e.arrayToEnum=n=>{const o={};for(const r of n)o[r]=r;return o},e.getValidEnumValues=n=>{const o=e.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),r={};for(const a of o)r[a]=n[a];return e.objectValues(r)},e.objectValues=n=>e.objectKeys(n).map(function(o){return n[o]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const o=[];for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&o.push(r);return o},e.find=(n,o)=>{for(const r of n)if(o(r))return r},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,o=" | "){return n.map(r=>typeof r=="string"?`'${r}'`:r).join(o)}e.joinValues=s,e.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(He||(He={}));var xu;(function(e){e.mergeShapes=(t,i)=>({...t,...i})})(xu||(xu={}));const re=He.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Os=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},X=He.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Z1=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class qt extends Error{constructor(t){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const i=t||function(o){return o.message},s={_errors:[]},n=o=>{for(const r of o.issues)if(r.code==="invalid_union")r.unionErrors.map(n);else if(r.code==="invalid_return_type")n(r.returnTypeError);else if(r.code==="invalid_arguments")n(r.argumentsError);else if(r.path.length===0)s._errors.push(i(r));else{let a=s,d=0;for(;d<r.path.length;){const h=r.path[d];d===r.path.length-1?(a[h]=a[h]||{_errors:[]},a[h]._errors.push(i(r))):a[h]=a[h]||{_errors:[]},a=a[h],d++}}};return n(this),s}static assert(t){if(!(t instanceof qt))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,He.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=i=>i.message){const i={},s=[];for(const n of this.issues)n.path.length>0?(i[n.path[0]]=i[n.path[0]]||[],i[n.path[0]].push(t(n))):s.push(t(n));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}}qt.create=e=>new qt(e);const so=(e,t)=>{let i;switch(e.code){case X.invalid_type:e.received===re.undefined?i="Required":i=`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(e.expected,He.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:i=`Unrecognized key(s) in object: ${He.joinValues(e.keys,", ")}`;break;case X.invalid_union:i="Invalid input";break;case X.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${He.joinValues(e.options)}`;break;case X.invalid_enum_value:i=`Invalid enum value. Expected ${He.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:i="Invalid function arguments";break;case X.invalid_return_type:i="Invalid function return type";break;case X.invalid_date:i="Invalid date";break;case X.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:He.assertNever(e.validation):e.validation!=="regex"?i=`Invalid ${e.validation}`:i="Invalid";break;case X.too_small:e.type==="array"?i=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?i=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?i=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?i=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:i="Invalid input";break;case X.too_big:e.type==="array"?i=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?i=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?i=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?i=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?i=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:i="Invalid input";break;case X.custom:i="Invalid input";break;case X.invalid_intersection_types:i="Intersection results could not be merged";break;case X.not_multiple_of:i=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:i="Number must be finite";break;default:i=t.defaultError,He.assertNever(e)}return{message:i}};let zm=so;function q1(e){zm=e}function na(){return zm}const oa=e=>{const{data:t,path:i,errorMaps:s,issueData:n}=e,o=[...i,...n.path||[]],r={...n,path:o};if(n.message!==void 0)return{...n,path:o,message:n.message};let a="";const d=s.filter(h=>!!h).slice().reverse();for(const h of d)a=h(r,{data:t,defaultError:a}).message;return{...n,path:o,message:a}},Y1=[];function ne(e,t){const i=na(),s=oa({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===so?void 0:so].filter(n=>!!n)});e.common.issues.push(s)}class Rt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,i){const s=[];for(const n of i){if(n.status==="aborted")return Se;n.status==="dirty"&&t.dirty(),s.push(n.value)}return{status:t.value,value:s}}static async mergeObjectAsync(t,i){const s=[];for(const n of i){const o=await n.key,r=await n.value;s.push({key:o,value:r})}return Rt.mergeObjectSync(t,s)}static mergeObjectSync(t,i){const s={};for(const n of i){const{key:o,value:r}=n;if(o.status==="aborted"||r.status==="aborted")return Se;o.status==="dirty"&&t.dirty(),r.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof r.value<"u"||n.alwaysSet)&&(s[o.value]=r.value)}return{status:t.value,value:s}}}const Se=Object.freeze({status:"aborted"}),no=e=>({status:"dirty",value:e}),kt=e=>({status:"valid",value:e}),Eu=e=>e.status==="aborted",Pu=e=>e.status==="dirty",wr=e=>e.status==="valid",Sr=e=>typeof Promise<"u"&&e instanceof Promise;function ra(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Um(e,t,i,s,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}typeof SuppressedError=="function"&&SuppressedError;var he;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(he||(he={}));var yr,br;class zi{constructor(t,i,s,n){this._cachedPath=[],this.parent=t,this.data=i,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $m=(e,t)=>{if(wr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new qt(e.common.issues);return this._error=i,this._error}}};function xe(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:s,description:n}=e;if(t&&(i||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(r,a)=>{var d,h;const{message:g}=e;return r.code==="invalid_enum_value"?{message:g??a.defaultError}:typeof a.data>"u"?{message:(d=g??s)!==null&&d!==void 0?d:a.defaultError}:r.code!=="invalid_type"?{message:a.defaultError}:{message:(h=g??i)!==null&&h!==void 0?h:a.defaultError}},description:n}}class Ae{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Os(t.data)}_getOrReturnCtx(t,i){return i||{common:t.parent.common,data:t.data,parsedType:Os(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rt,ctx:{common:t.parent.common,data:t.data,parsedType:Os(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const i=this._parse(t);if(Sr(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(t){const i=this._parse(t);return Promise.resolve(i)}parse(t,i){const s=this.safeParse(t,i);if(s.success)return s.data;throw s.error}safeParse(t,i){var s;const n={common:{issues:[],async:(s=i==null?void 0:i.async)!==null&&s!==void 0?s:!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Os(t)},o=this._parseSync({data:t,path:n.path,parent:n});return $m(n,o)}async parseAsync(t,i){const s=await this.safeParseAsync(t,i);if(s.success)return s.data;throw s.error}async safeParseAsync(t,i){const s={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Os(t)},n=this._parse({data:t,path:s.path,parent:s}),o=await(Sr(n)?n:Promise.resolve(n));return $m(s,o)}refine(t,i){const s=n=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(n):i;return this._refinement((n,o)=>{const r=t(n),a=()=>o.addIssue({code:X.custom,...s(n)});return typeof Promise<"u"&&r instanceof Promise?r.then(d=>d?!0:(a(),!1)):r?!0:(a(),!1)})}refinement(t,i){return this._refinement((s,n)=>t(s)?!0:(n.addIssue(typeof i=="function"?i(s,n):i),!1))}_refinement(t){return new Pi({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return $i.create(this,this._def)}nullable(){return Gs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ei.create(this,this._def)}promise(){return ao.create(this,this._def)}or(t){return Er.create([this,t],this._def)}and(t){return Pr.create(this,t,this._def)}transform(t){return new Pi({...xe(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const i=typeof t=="function"?t:()=>t;return new kr({...xe(this._def),innerType:this,defaultValue:i,typeName:we.ZodDefault})}brand(){return new Au({typeName:we.ZodBranded,type:this,...xe(this._def)})}catch(t){const i=typeof t=="function"?t:()=>t;return new Ir({...xe(this._def),innerType:this,catchValue:i,typeName:we.ZodCatch})}describe(t){const i=this.constructor;return new i({...this._def,description:t})}pipe(t){return Lr.create(this,t)}readonly(){return _r.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Q1=/^c[^\s-]{8,}$/i,X1=/^[0-9a-z]+$/,J1=/^[0-9A-HJKMNP-TV-Z]{26}$/,eG=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,tG=/^[a-z0-9_-]{21}$/i,iG=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Du;const oG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rG=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,lG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Km="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",aG=new RegExp(`^${Km}$`);function jm(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function cG(e){return new RegExp(`^${jm(e)}$`)}function Zm(e){let t=`${Km}T${jm(e)}`;const i=[];return i.push(e.local?"Z?":"Z"),e.offset&&i.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${i.join("|")})`,new RegExp(`^${t}$`)}function dG(e,t){return!!((t==="v4"||!t)&&oG.test(e)||(t==="v6"||!t)&&rG.test(e))}class xi extends Ae{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_type,expected:re.string,received:o.parsedType}),Se}const s=new Rt;let n;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(n=this._getOrReturnCtx(t,n),ne(n,{code:X.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),s.dirty());else if(o.kind==="max")t.data.length>o.value&&(n=this._getOrReturnCtx(t,n),ne(n,{code:X.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),s.dirty());else if(o.kind==="length"){const r=t.data.length>o.value,a=t.data.length<o.value;(r||a)&&(n=this._getOrReturnCtx(t,n),r?ne(n,{code:X.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&ne(n,{code:X.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),s.dirty())}else if(o.kind==="email")sG.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"email",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="emoji")Du||(Du=new RegExp(nG,"u")),Du.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"emoji",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="uuid")eG.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"uuid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="nanoid")tG.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"nanoid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="cuid")Q1.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"cuid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="cuid2")X1.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"cuid2",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="ulid")J1.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"ulid",code:X.invalid_string,message:o.message}),s.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),ne(n,{validation:"url",code:X.invalid_string,message:o.message}),s.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"regex",code:X.invalid_string,message:o.message}),s.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),s.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:{startsWith:o.value},message:o.message}),s.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:{endsWith:o.value},message:o.message}),s.dirty()):o.kind==="datetime"?Zm(o).test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:"datetime",message:o.message}),s.dirty()):o.kind==="date"?aG.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:"date",message:o.message}),s.dirty()):o.kind==="time"?cG(o).test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{code:X.invalid_string,validation:"time",message:o.message}),s.dirty()):o.kind==="duration"?iG.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"duration",code:X.invalid_string,message:o.message}),s.dirty()):o.kind==="ip"?dG(t.data,o.version)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"ip",code:X.invalid_string,message:o.message}),s.dirty()):o.kind==="base64"?lG.test(t.data)||(n=this._getOrReturnCtx(t,n),ne(n,{validation:"base64",code:X.invalid_string,message:o.message}),s.dirty()):He.assertNever(o);return{status:s.value,value:t.data}}_regex(t,i,s){return this.refinement(n=>t.test(n),{validation:i,code:X.invalid_string,...he.errToObj(s)})}_addCheck(t){return new xi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...he.errToObj(t)})}url(t){return this._addCheck({kind:"url",...he.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...he.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...he.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...he.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...he.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...he.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...he.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...he.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...he.errToObj(t)})}datetime(t){var i,s;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(i=t==null?void 0:t.offset)!==null&&i!==void 0?i:!1,local:(s=t==null?void 0:t.local)!==null&&s!==void 0?s:!1,...he.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...he.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...he.errToObj(t)})}regex(t,i){return this._addCheck({kind:"regex",regex:t,...he.errToObj(i)})}includes(t,i){return this._addCheck({kind:"includes",value:t,position:i==null?void 0:i.position,...he.errToObj(i==null?void 0:i.message)})}startsWith(t,i){return this._addCheck({kind:"startsWith",value:t,...he.errToObj(i)})}endsWith(t,i){return this._addCheck({kind:"endsWith",value:t,...he.errToObj(i)})}min(t,i){return this._addCheck({kind:"min",value:t,...he.errToObj(i)})}max(t,i){return this._addCheck({kind:"max",value:t,...he.errToObj(i)})}length(t,i){return this._addCheck({kind:"length",value:t,...he.errToObj(i)})}nonempty(t){return this.min(1,he.errToObj(t))}trim(){return new xi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxLength(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}}xi.create=e=>{var t;return new xi({checks:[],typeName:we.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xe(e)})};function uG(e,t){const i=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=i>s?i:s,o=parseInt(e.toFixed(n).replace(".","")),r=parseInt(t.toFixed(n).replace(".",""));return o%r/Math.pow(10,n)}class Vs extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==re.number){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_type,expected:re.number,received:o.parsedType}),Se}let s;const n=new Rt;for(const o of this._def.checks)o.kind==="int"?He.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),ne(s,{code:X.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?uG(t.data,o.value)!==0&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),ne(s,{code:X.not_finite,message:o.message}),n.dirty()):He.assertNever(o);return{status:n.value,value:t.data}}gte(t,i){return this.setLimit("min",t,!0,he.toString(i))}gt(t,i){return this.setLimit("min",t,!1,he.toString(i))}lte(t,i){return this.setLimit("max",t,!0,he.toString(i))}lt(t,i){return this.setLimit("max",t,!1,he.toString(i))}setLimit(t,i,s,n){return new Vs({...this._def,checks:[...this._def.checks,{kind:t,value:i,inclusive:s,message:he.toString(n)}]})}_addCheck(t){return new Vs({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:he.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(t)})}multipleOf(t,i){return this._addCheck({kind:"multipleOf",value:t,message:he.toString(i)})}finite(t){return this._addCheck({kind:"finite",message:he.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.toString(t)})}get minValue(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxValue(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&He.isInteger(t.value))}get isFinite(){let t=null,i=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(i===null||s.value>i)&&(i=s.value):s.kind==="max"&&(t===null||s.value<t)&&(t=s.value)}return Number.isFinite(i)&&Number.isFinite(t)}}Vs.create=e=>new Vs({checks:[],typeName:we.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...xe(e)});class Ns extends Ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==re.bigint){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_type,expected:re.bigint,received:o.parsedType}),Se}let s;const n=new Rt;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),ne(s,{code:X.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):He.assertNever(o);return{status:n.value,value:t.data}}gte(t,i){return this.setLimit("min",t,!0,he.toString(i))}gt(t,i){return this.setLimit("min",t,!1,he.toString(i))}lte(t,i){return this.setLimit("max",t,!0,he.toString(i))}lt(t,i){return this.setLimit("max",t,!1,he.toString(i))}setLimit(t,i,s,n){return new Ns({...this._def,checks:[...this._def.checks,{kind:t,value:i,inclusive:s,message:he.toString(n)}]})}_addCheck(t){return new Ns({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(t)})}multipleOf(t,i){return this._addCheck({kind:"multipleOf",value:t,message:he.toString(i)})}get minValue(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t}get maxValue(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t}}Ns.create=e=>{var t;return new Ns({checks:[],typeName:we.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xe(e)})};class Rr extends Ae{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.boolean,received:s.parsedType}),Se}return kt(t.data)}}Rr.create=e=>new Rr({typeName:we.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...xe(e)});class mn extends Ae{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_type,expected:re.date,received:o.parsedType}),Se}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ne(o,{code:X.invalid_date}),Se}const s=new Rt;let n;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(n=this._getOrReturnCtx(t,n),ne(n,{code:X.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),s.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(n=this._getOrReturnCtx(t,n),ne(n,{code:X.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),s.dirty()):He.assertNever(o);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(t){return new mn({...this._def,checks:[...this._def.checks,t]})}min(t,i){return this._addCheck({kind:"min",value:t.getTime(),message:he.toString(i)})}max(t,i){return this._addCheck({kind:"max",value:t.getTime(),message:he.toString(i)})}get minDate(){let t=null;for(const i of this._def.checks)i.kind==="min"&&(t===null||i.value>t)&&(t=i.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const i of this._def.checks)i.kind==="max"&&(t===null||i.value<t)&&(t=i.value);return t!=null?new Date(t):null}}mn.create=e=>new mn({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:we.ZodDate,...xe(e)});class la extends Ae{_parse(t){if(this._getType(t)!==re.symbol){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.symbol,received:s.parsedType}),Se}return kt(t.data)}}la.create=e=>new la({typeName:we.ZodSymbol,...xe(e)});class Fr extends Ae{_parse(t){if(this._getType(t)!==re.undefined){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.undefined,received:s.parsedType}),Se}return kt(t.data)}}Fr.create=e=>new Fr({typeName:we.ZodUndefined,...xe(e)});class xr extends Ae{_parse(t){if(this._getType(t)!==re.null){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.null,received:s.parsedType}),Se}return kt(t.data)}}xr.create=e=>new xr({typeName:we.ZodNull,...xe(e)});class oo extends Ae{constructor(){super(...arguments),this._any=!0}_parse(t){return kt(t.data)}}oo.create=e=>new oo({typeName:we.ZodAny,...xe(e)});class Cn extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kt(t.data)}}Cn.create=e=>new Cn({typeName:we.ZodUnknown,...xe(e)});class os extends Ae{_parse(t){const i=this._getOrReturnCtx(t);return ne(i,{code:X.invalid_type,expected:re.never,received:i.parsedType}),Se}}os.create=e=>new os({typeName:we.ZodNever,...xe(e)});class aa extends Ae{_parse(t){if(this._getType(t)!==re.undefined){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.void,received:s.parsedType}),Se}return kt(t.data)}}aa.create=e=>new aa({typeName:we.ZodVoid,...xe(e)});class Ei extends Ae{_parse(t){const{ctx:i,status:s}=this._processInputParams(t),n=this._def;if(i.parsedType!==re.array)return ne(i,{code:X.invalid_type,expected:re.array,received:i.parsedType}),Se;if(n.exactLength!==null){const r=i.data.length>n.exactLength.value,a=i.data.length<n.exactLength.value;(r||a)&&(ne(i,{code:r?X.too_big:X.too_small,minimum:a?n.exactLength.value:void 0,maximum:r?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&i.data.length<n.minLength.value&&(ne(i,{code:X.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&i.data.length>n.maxLength.value&&(ne(i,{code:X.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((r,a)=>n.type._parseAsync(new zi(i,r,i.path,a)))).then(r=>Rt.mergeArray(s,r));const o=[...i.data].map((r,a)=>n.type._parseSync(new zi(i,r,i.path,a)));return Rt.mergeArray(s,o)}get element(){return this._def.type}min(t,i){return new Ei({...this._def,minLength:{value:t,message:he.toString(i)}})}max(t,i){return new Ei({...this._def,maxLength:{value:t,message:he.toString(i)}})}length(t,i){return new Ei({...this._def,exactLength:{value:t,message:he.toString(i)}})}nonempty(t){return this.min(1,t)}}Ei.create=(e,t)=>new Ei({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...xe(t)});function ro(e){if(e instanceof tt){const t={};for(const i in e.shape){const s=e.shape[i];t[i]=$i.create(ro(s))}return new tt({...e._def,shape:()=>t})}else return e instanceof Ei?new Ei({...e._def,type:ro(e.element)}):e instanceof $i?$i.create(ro(e.unwrap())):e instanceof Gs?Gs.create(ro(e.unwrap())):e instanceof Ui?Ui.create(e.items.map(t=>ro(t))):e}class tt extends Ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),i=He.objectKeys(t);return this._cached={shape:t,keys:i}}_parse(t){if(this._getType(t)!==re.object){const h=this._getOrReturnCtx(t);return ne(h,{code:X.invalid_type,expected:re.object,received:h.parsedType}),Se}const{status:s,ctx:n}=this._processInputParams(t),{shape:o,keys:r}=this._getCached(),a=[];if(!(this._def.catchall instanceof os&&this._def.unknownKeys==="strip"))for(const h in n.data)r.includes(h)||a.push(h);const d=[];for(const h of r){const g=o[h],f=n.data[h];d.push({key:{status:"valid",value:h},value:g._parse(new zi(n,f,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof os){const h=this._def.unknownKeys;if(h==="passthrough")for(const g of a)d.push({key:{status:"valid",value:g},value:{status:"valid",value:n.data[g]}});else if(h==="strict")a.length>0&&(ne(n,{code:X.unrecognized_keys,keys:a}),s.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const g of a){const f=n.data[g];d.push({key:{status:"valid",value:g},value:h._parse(new zi(n,f,n.path,g)),alwaysSet:g in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const h=[];for(const g of d){const f=await g.key,C=await g.value;h.push({key:f,value:C,alwaysSet:g.alwaysSet})}return h}).then(h=>Rt.mergeObjectSync(s,h)):Rt.mergeObjectSync(s,d)}get shape(){return this._def.shape()}strict(t){return he.errToObj,new tt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(i,s)=>{var n,o,r,a;const d=(r=(o=(n=this._def).errorMap)===null||o===void 0?void 0:o.call(n,i,s).message)!==null&&r!==void 0?r:s.defaultError;return i.code==="unrecognized_keys"?{message:(a=he.errToObj(t).message)!==null&&a!==void 0?a:d}:{message:d}}}:{}})}strip(){return new tt({...this._def,unknownKeys:"strip"})}passthrough(){return new tt({...this._def,unknownKeys:"passthrough"})}extend(t){return new tt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new tt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,i){return this.augment({[t]:i})}catchall(t){return new tt({...this._def,catchall:t})}pick(t){const i={};return He.objectKeys(t).forEach(s=>{t[s]&&this.shape[s]&&(i[s]=this.shape[s])}),new tt({...this._def,shape:()=>i})}omit(t){const i={};return He.objectKeys(this.shape).forEach(s=>{t[s]||(i[s]=this.shape[s])}),new tt({...this._def,shape:()=>i})}deepPartial(){return ro(this)}partial(t){const i={};return He.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];t&&!t[s]?i[s]=n:i[s]=n.optional()}),new tt({...this._def,shape:()=>i})}required(t){const i={};return He.objectKeys(this.shape).forEach(s=>{if(t&&!t[s])i[s]=this.shape[s];else{let o=this.shape[s];for(;o instanceof $i;)o=o._def.innerType;i[s]=o}}),new tt({...this._def,shape:()=>i})}keyof(){return qm(He.objectKeys(this.shape))}}tt.create=(e,t)=>new tt({shape:()=>e,unknownKeys:"strip",catchall:os.create(),typeName:we.ZodObject,...xe(t)}),tt.strictCreate=(e,t)=>new tt({shape:()=>e,unknownKeys:"strict",catchall:os.create(),typeName:we.ZodObject,...xe(t)}),tt.lazycreate=(e,t)=>new tt({shape:e,unknownKeys:"strip",catchall:os.create(),typeName:we.ZodObject,...xe(t)});class Er extends Ae{_parse(t){const{ctx:i}=this._processInputParams(t),s=this._def.options;function n(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return i.common.issues.push(...a.ctx.common.issues),a.result;const r=o.map(a=>new qt(a.ctx.common.issues));return ne(i,{code:X.invalid_union,unionErrors:r}),Se}if(i.common.async)return Promise.all(s.map(async o=>{const r={...i,common:{...i.common,issues:[]},parent:null};return{result:await o._parseAsync({data:i.data,path:i.path,parent:r}),ctx:r}})).then(n);{let o;const r=[];for(const d of s){const h={...i,common:{...i.common,issues:[]},parent:null},g=d._parseSync({data:i.data,path:i.path,parent:h});if(g.status==="valid")return g;g.status==="dirty"&&!o&&(o={result:g,ctx:h}),h.common.issues.length&&r.push(h.common.issues)}if(o)return i.common.issues.push(...o.ctx.common.issues),o.result;const a=r.map(d=>new qt(d));return ne(i,{code:X.invalid_union,unionErrors:a}),Se}}get options(){return this._def.options}}Er.create=(e,t)=>new Er({options:e,typeName:we.ZodUnion,...xe(t)});const rs=e=>e instanceof Tr?rs(e.schema):e instanceof Pi?rs(e.innerType()):e instanceof Ar?[e.value]:e instanceof Bs?e.options:e instanceof Mr?He.objectValues(e.enum):e instanceof kr?rs(e._def.innerType):e instanceof Fr?[void 0]:e instanceof xr?[null]:e instanceof $i?[void 0,...rs(e.unwrap())]:e instanceof Gs?[null,...rs(e.unwrap())]:e instanceof Au||e instanceof _r?rs(e.unwrap()):e instanceof Ir?rs(e._def.innerType):[];class ca extends Ae{_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==re.object)return ne(i,{code:X.invalid_type,expected:re.object,received:i.parsedType}),Se;const s=this.discriminator,n=i.data[s],o=this.optionsMap.get(n);return o?i.common.async?o._parseAsync({data:i.data,path:i.path,parent:i}):o._parseSync({data:i.data,path:i.path,parent:i}):(ne(i,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Se)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,i,s){const n=new Map;for(const o of i){const r=rs(o.shape[t]);if(!r.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of r){if(n.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,o)}}return new ca({typeName:we.ZodDiscriminatedUnion,discriminator:t,options:i,optionsMap:n,...xe(s)})}}function Tu(e,t){const i=Os(e),s=Os(t);if(e===t)return{valid:!0,data:e};if(i===re.object&&s===re.object){const n=He.objectKeys(t),o=He.objectKeys(e).filter(a=>n.indexOf(a)!==-1),r={...e,...t};for(const a of o){const d=Tu(e[a],t[a]);if(!d.valid)return{valid:!1};r[a]=d.data}return{valid:!0,data:r}}else if(i===re.array&&s===re.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let o=0;o<e.length;o++){const r=e[o],a=t[o],d=Tu(r,a);if(!d.valid)return{valid:!1};n.push(d.data)}return{valid:!0,data:n}}else return i===re.date&&s===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Pr extends Ae{_parse(t){const{status:i,ctx:s}=this._processInputParams(t),n=(o,r)=>{if(Eu(o)||Eu(r))return Se;const a=Tu(o.value,r.value);return a.valid?((Pu(o)||Pu(r))&&i.dirty(),{status:i.value,value:a.data}):(ne(s,{code:X.invalid_intersection_types}),Se)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([o,r])=>n(o,r)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Pr.create=(e,t,i)=>new Pr({left:e,right:t,typeName:we.ZodIntersection,...xe(i)});class Ui extends Ae{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==re.array)return ne(s,{code:X.invalid_type,expected:re.array,received:s.parsedType}),Se;if(s.data.length<this._def.items.length)return ne(s,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Se;!this._def.rest&&s.data.length>this._def.items.length&&(ne(s,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const o=[...s.data].map((r,a)=>{const d=this._def.items[a]||this._def.rest;return d?d._parse(new zi(s,r,s.path,a)):null}).filter(r=>!!r);return s.common.async?Promise.all(o).then(r=>Rt.mergeArray(i,r)):Rt.mergeArray(i,o)}get items(){return this._def.items}rest(t){return new Ui({...this._def,rest:t})}}Ui.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ui({items:e,typeName:we.ZodTuple,rest:null,...xe(t)})};class Dr extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==re.object)return ne(s,{code:X.invalid_type,expected:re.object,received:s.parsedType}),Se;const n=[],o=this._def.keyType,r=this._def.valueType;for(const a in s.data)n.push({key:o._parse(new zi(s,a,s.path,a)),value:r._parse(new zi(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?Rt.mergeObjectAsync(i,n):Rt.mergeObjectSync(i,n)}get element(){return this._def.valueType}static create(t,i,s){return i instanceof Ae?new Dr({keyType:t,valueType:i,typeName:we.ZodRecord,...xe(s)}):new Dr({keyType:xi.create(),valueType:t,typeName:we.ZodRecord,...xe(i)})}}class da extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==re.map)return ne(s,{code:X.invalid_type,expected:re.map,received:s.parsedType}),Se;const n=this._def.keyType,o=this._def.valueType,r=[...s.data.entries()].map(([a,d],h)=>({key:n._parse(new zi(s,a,s.path,[h,"key"])),value:o._parse(new zi(s,d,s.path,[h,"value"]))}));if(s.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const d of r){const h=await d.key,g=await d.value;if(h.status==="aborted"||g.status==="aborted")return Se;(h.status==="dirty"||g.status==="dirty")&&i.dirty(),a.set(h.value,g.value)}return{status:i.value,value:a}})}else{const a=new Map;for(const d of r){const h=d.key,g=d.value;if(h.status==="aborted"||g.status==="aborted")return Se;(h.status==="dirty"||g.status==="dirty")&&i.dirty(),a.set(h.value,g.value)}return{status:i.value,value:a}}}}da.create=(e,t,i)=>new da({valueType:t,keyType:e,typeName:we.ZodMap,...xe(i)});class vn extends Ae{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.parsedType!==re.set)return ne(s,{code:X.invalid_type,expected:re.set,received:s.parsedType}),Se;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(ne(s,{code:X.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),i.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(ne(s,{code:X.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),i.dirty());const o=this._def.valueType;function r(d){const h=new Set;for(const g of d){if(g.status==="aborted")return Se;g.status==="dirty"&&i.dirty(),h.add(g.value)}return{status:i.value,value:h}}const a=[...s.data.values()].map((d,h)=>o._parse(new zi(s,d,s.path,h)));return s.common.async?Promise.all(a).then(d=>r(d)):r(a)}min(t,i){return new vn({...this._def,minSize:{value:t,message:he.toString(i)}})}max(t,i){return new vn({...this._def,maxSize:{value:t,message:he.toString(i)}})}size(t,i){return this.min(t,i).max(t,i)}nonempty(t){return this.min(1,t)}}vn.create=(e,t)=>new vn({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,...xe(t)});class lo extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==re.function)return ne(i,{code:X.invalid_type,expected:re.function,received:i.parsedType}),Se;function s(a,d){return oa({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,na(),so].filter(h=>!!h),issueData:{code:X.invalid_arguments,argumentsError:d}})}function n(a,d){return oa({data:a,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,na(),so].filter(h=>!!h),issueData:{code:X.invalid_return_type,returnTypeError:d}})}const o={errorMap:i.common.contextualErrorMap},r=i.data;if(this._def.returns instanceof ao){const a=this;return kt(async function(...d){const h=new qt([]),g=await a._def.args.parseAsync(d,o).catch(v=>{throw h.addIssue(s(d,v)),h}),f=await Reflect.apply(r,this,g);return await a._def.returns._def.type.parseAsync(f,o).catch(v=>{throw h.addIssue(n(f,v)),h})})}else{const a=this;return kt(function(...d){const h=a._def.args.safeParse(d,o);if(!h.success)throw new qt([s(d,h.error)]);const g=Reflect.apply(r,this,h.data),f=a._def.returns.safeParse(g,o);if(!f.success)throw new qt([n(g,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new lo({...this._def,args:Ui.create(t).rest(Cn.create())})}returns(t){return new lo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,i,s){return new lo({args:t||Ui.create([]).rest(Cn.create()),returns:i||Cn.create(),typeName:we.ZodFunction,...xe(s)})}}class Tr extends Ae{get schema(){return this._def.getter()}_parse(t){const{ctx:i}=this._processInputParams(t);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Tr.create=(e,t)=>new Tr({getter:e,typeName:we.ZodLazy,...xe(t)});class Ar extends Ae{_parse(t){if(t.data!==this._def.value){const i=this._getOrReturnCtx(t);return ne(i,{received:i.data,code:X.invalid_literal,expected:this._def.value}),Se}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ar.create=(e,t)=>new Ar({value:e,typeName:we.ZodLiteral,...xe(t)});function qm(e,t){return new Bs({values:e,typeName:we.ZodEnum,...xe(t)})}class Bs extends Ae{constructor(){super(...arguments),yr.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const i=this._getOrReturnCtx(t),s=this._def.values;return ne(i,{expected:He.joinValues(s),received:i.parsedType,code:X.invalid_type}),Se}if(ra(this,yr)||Um(this,yr,new Set(this._def.values)),!ra(this,yr).has(t.data)){const i=this._getOrReturnCtx(t),s=this._def.values;return ne(i,{received:i.data,code:X.invalid_enum_value,options:s}),Se}return kt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const i of this._def.values)t[i]=i;return t}get Values(){const t={};for(const i of this._def.values)t[i]=i;return t}get Enum(){const t={};for(const i of this._def.values)t[i]=i;return t}extract(t,i=this._def){return Bs.create(t,{...this._def,...i})}exclude(t,i=this._def){return Bs.create(this.options.filter(s=>!t.includes(s)),{...this._def,...i})}}yr=new WeakMap,Bs.create=qm;class Mr extends Ae{constructor(){super(...arguments),br.set(this,void 0)}_parse(t){const i=He.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==re.string&&s.parsedType!==re.number){const n=He.objectValues(i);return ne(s,{expected:He.joinValues(n),received:s.parsedType,code:X.invalid_type}),Se}if(ra(this,br)||Um(this,br,new Set(He.getValidEnumValues(this._def.values))),!ra(this,br).has(t.data)){const n=He.objectValues(i);return ne(s,{received:s.data,code:X.invalid_enum_value,options:n}),Se}return kt(t.data)}get enum(){return this._def.values}}br=new WeakMap,Mr.create=(e,t)=>new Mr({values:e,typeName:we.ZodNativeEnum,...xe(t)});class ao extends Ae{unwrap(){return this._def.type}_parse(t){const{ctx:i}=this._processInputParams(t);if(i.parsedType!==re.promise&&i.common.async===!1)return ne(i,{code:X.invalid_type,expected:re.promise,received:i.parsedType}),Se;const s=i.parsedType===re.promise?i.data:Promise.resolve(i.data);return kt(s.then(n=>this._def.type.parseAsync(n,{path:i.path,errorMap:i.common.contextualErrorMap})))}}ao.create=(e,t)=>new ao({type:e,typeName:we.ZodPromise,...xe(t)});class Pi extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:i,ctx:s}=this._processInputParams(t),n=this._def.effect||null,o={addIssue:r=>{ne(s,r),r.fatal?i.abort():i.dirty()},get path(){return s.path}};if(o.addIssue=o.addIssue.bind(o),n.type==="preprocess"){const r=n.transform(s.data,o);if(s.common.async)return Promise.resolve(r).then(async a=>{if(i.value==="aborted")return Se;const d=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return d.status==="aborted"?Se:d.status==="dirty"||i.value==="dirty"?no(d.value):d});{if(i.value==="aborted")return Se;const a=this._def.schema._parseSync({data:r,path:s.path,parent:s});return a.status==="aborted"?Se:a.status==="dirty"||i.value==="dirty"?no(a.value):a}}if(n.type==="refinement"){const r=a=>{const d=n.refinement(a,o);if(s.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Se:(a.status==="dirty"&&i.dirty(),r(a.value),{status:i.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?Se:(a.status==="dirty"&&i.dirty(),r(a.value).then(()=>({status:i.value,value:a.value}))))}if(n.type==="transform")if(s.common.async===!1){const r=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!wr(r))return r;const a=n.transform(r.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(r=>wr(r)?Promise.resolve(n.transform(r.value,o)).then(a=>({status:i.value,value:a})):r);He.assertNever(n)}}Pi.create=(e,t,i)=>new Pi({schema:e,typeName:we.ZodEffects,effect:t,...xe(i)}),Pi.createWithPreprocess=(e,t,i)=>new Pi({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,...xe(i)});class $i extends Ae{_parse(t){return this._getType(t)===re.undefined?kt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$i.create=(e,t)=>new $i({innerType:e,typeName:we.ZodOptional,...xe(t)});class Gs extends Ae{_parse(t){return this._getType(t)===re.null?kt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gs.create=(e,t)=>new Gs({innerType:e,typeName:we.ZodNullable,...xe(t)});class kr extends Ae{_parse(t){const{ctx:i}=this._processInputParams(t);let s=i.data;return i.parsedType===re.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}kr.create=(e,t)=>new kr({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...xe(t)});class Ir extends Ae{_parse(t){const{ctx:i}=this._processInputParams(t),s={...i,common:{...i.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Sr(n)?n.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new qt(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new qt(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Ir.create=(e,t)=>new Ir({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...xe(t)});class ua extends Ae{_parse(t){if(this._getType(t)!==re.nan){const s=this._getOrReturnCtx(t);return ne(s,{code:X.invalid_type,expected:re.nan,received:s.parsedType}),Se}return{status:"valid",value:t.data}}}ua.create=e=>new ua({typeName:we.ZodNaN,...xe(e)});const hG=Symbol("zod_brand");class Au extends Ae{_parse(t){const{ctx:i}=this._processInputParams(t),s=i.data;return this._def.type._parse({data:s,path:i.path,parent:i})}unwrap(){return this._def.type}}class Lr extends Ae{_parse(t){const{status:i,ctx:s}=this._processInputParams(t);if(s.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?Se:o.status==="dirty"?(i.dirty(),no(o.value)):this._def.out._parseAsync({data:o.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Se:n.status==="dirty"?(i.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(t,i){return new Lr({in:t,out:i,typeName:we.ZodPipeline})}}class _r extends Ae{_parse(t){const i=this._def.innerType._parse(t),s=n=>(wr(n)&&(n.value=Object.freeze(n.value)),n);return Sr(i)?i.then(n=>s(n)):s(i)}unwrap(){return this._def.innerType}}_r.create=(e,t)=>new _r({innerType:e,typeName:we.ZodReadonly,...xe(t)});function Ym(e,t={},i){return e?oo.create().superRefine((s,n)=>{var o,r;if(!e(s)){const a=typeof t=="function"?t(s):typeof t=="string"?{message:t}:t,d=(r=(o=a.fatal)!==null&&o!==void 0?o:i)!==null&&r!==void 0?r:!0,h=typeof a=="string"?{message:a}:a;n.addIssue({code:"custom",...h,fatal:d})}}):oo.create()}const pG={object:tt.lazycreate};var we;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(we||(we={}));const gG=(e,t={message:`Input not instance of ${e.name}`})=>Ym(i=>i instanceof e,t),Qm=xi.create,Xm=Vs.create,fG=ua.create,mG=Ns.create,Jm=Rr.create,CG=mn.create,vG=la.create,wG=Fr.create,SG=xr.create,yG=oo.create,bG=Cn.create,RG=os.create,FG=aa.create,xG=Ei.create,EG=tt.create,PG=tt.strictCreate,DG=Er.create,TG=ca.create,AG=Pr.create,MG=Ui.create,kG=Dr.create,IG=da.create,LG=vn.create,_G=lo.create,OG=Tr.create,VG=Ar.create,NG=Bs.create,BG=Mr.create,GG=ao.create,eC=Pi.create,HG=$i.create,WG=Gs.create,zG=Pi.createWithPreprocess,UG=Lr.create;var ha=Object.freeze({__proto__:null,defaultErrorMap:so,setErrorMap:q1,getErrorMap:na,makeIssue:oa,EMPTY_PATH:Y1,addIssueToContext:ne,ParseStatus:Rt,INVALID:Se,DIRTY:no,OK:kt,isAborted:Eu,isDirty:Pu,isValid:wr,isAsync:Sr,get util(){return He},get objectUtil(){return xu},ZodParsedType:re,getParsedType:Os,ZodType:Ae,datetimeRegex:Zm,ZodString:xi,ZodNumber:Vs,ZodBigInt:Ns,ZodBoolean:Rr,ZodDate:mn,ZodSymbol:la,ZodUndefined:Fr,ZodNull:xr,ZodAny:oo,ZodUnknown:Cn,ZodNever:os,ZodVoid:aa,ZodArray:Ei,ZodObject:tt,ZodUnion:Er,ZodDiscriminatedUnion:ca,ZodIntersection:Pr,ZodTuple:Ui,ZodRecord:Dr,ZodMap:da,ZodSet:vn,ZodFunction:lo,ZodLazy:Tr,ZodLiteral:Ar,ZodEnum:Bs,ZodNativeEnum:Mr,ZodPromise:ao,ZodEffects:Pi,ZodTransformer:Pi,ZodOptional:$i,ZodNullable:Gs,ZodDefault:kr,ZodCatch:Ir,ZodNaN:ua,BRAND:hG,ZodBranded:Au,ZodPipeline:Lr,ZodReadonly:_r,custom:Ym,Schema:Ae,ZodSchema:Ae,late:pG,get ZodFirstPartyTypeKind(){return we},coerce:{string:e=>xi.create({...e,coerce:!0}),number:e=>Vs.create({...e,coerce:!0}),boolean:e=>Rr.create({...e,coerce:!0}),bigint:e=>Ns.create({...e,coerce:!0}),date:e=>mn.create({...e,coerce:!0})},any:yG,array:xG,bigint:mG,boolean:Jm,date:CG,discriminatedUnion:TG,effect:eC,enum:NG,function:_G,instanceof:gG,intersection:AG,lazy:OG,literal:VG,map:IG,nan:fG,nativeEnum:BG,never:RG,null:SG,nullable:WG,number:Xm,object:EG,oboolean:()=>Jm().optional(),onumber:()=>Xm().optional(),optional:HG,ostring:()=>Qm().optional(),pipeline:UG,preprocess:zG,promise:GG,record:kG,set:LG,strictObject:PG,string:Qm,symbol:vG,transformer:eC,tuple:MG,undefined:wG,union:DG,unknown:bG,void:FG,NEVER:Se,ZodIssueCode:X,quotelessJson:Z1,ZodError:qt});const $G=-2147483648,KG=-9007199254740991n,jG=NaN,ZG=NaN,qG=null,YG=null;ha.object({__isRef:ha.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:ha.string().describe("Upstream block id"),name:ha.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();var pa={exports:{}};/**
223
+ * @license
224
+ * Lodash <https://lodash.com/>
225
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
226
+ * Released under MIT license <https://lodash.com/license>
227
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
228
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
229
+ */pa.exports,function(e,t){(function(){var i,s="4.17.21",n=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",r="Expected a function",a="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",h=500,g="__lodash_placeholder__",f=1,C=2,v=4,S=1,R=2,y=1,x=2,P=4,T=8,I=16,V=32,_=64,O=128,M=256,A=512,z=30,H="...",Z=800,ie=16,pe=1,ae=2,ee=3,Ee=1/0,_e=9007199254740991,wn=17976931348623157e292,Ws=NaN,Gt=4294967295,fH=Gt-1,mH=Gt>>>1,CH=[["ary",O],["bind",y],["bindKey",x],["curry",T],["curryRight",I],["flip",A],["partial",V],["partialRight",_],["rearg",M]],co="[object Arguments]",fa="[object Array]",vH="[object AsyncFunction]",Or="[object Boolean]",Vr="[object Date]",wH="[object DOMException]",ma="[object Error]",Ca="[object Function]",tC="[object GeneratorFunction]",Di="[object Map]",Nr="[object Number]",SH="[object Null]",ls="[object Object]",iC="[object Promise]",yH="[object Proxy]",Br="[object RegExp]",Ti="[object Set]",Gr="[object String]",va="[object Symbol]",bH="[object Undefined]",Hr="[object WeakMap]",RH="[object WeakSet]",Wr="[object ArrayBuffer]",uo="[object DataView]",Mu="[object Float32Array]",ku="[object Float64Array]",Iu="[object Int8Array]",Lu="[object Int16Array]",_u="[object Int32Array]",Ou="[object Uint8Array]",Vu="[object Uint8ClampedArray]",Nu="[object Uint16Array]",Bu="[object Uint32Array]",FH=/\b__p \+= '';/g,xH=/\b(__p \+=) '' \+/g,EH=/(__e\(.*?\)|\b__t\)) \+\n'';/g,sC=/&(?:amp|lt|gt|quot|#39);/g,nC=/[&<>"']/g,PH=RegExp(sC.source),DH=RegExp(nC.source),TH=/<%-([\s\S]+?)%>/g,AH=/<%([\s\S]+?)%>/g,oC=/<%=([\s\S]+?)%>/g,MH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kH=/^\w*$/,IH=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gu=/[\\^$.*+?()[\]{}|]/g,LH=RegExp(Gu.source),Hu=/^\s+/,_H=/\s/,OH=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,VH=/\{\n\/\* \[wrapped with (.+)\] \*/,NH=/,? & /,BH=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,GH=/[()=,{}\[\]\/\s]/,HH=/\\(\\)?/g,WH=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rC=/\w*$/,zH=/^[-+]0x[0-9a-f]+$/i,UH=/^0b[01]+$/i,$H=/^\[object .+?Constructor\]$/,KH=/^0o[0-7]+$/i,jH=/^(?:0|[1-9]\d*)$/,ZH=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wa=/($^)/,qH=/['\n\r\u2028\u2029\\]/g,Sa="\\ud800-\\udfff",YH="\\u0300-\\u036f",QH="\\ufe20-\\ufe2f",XH="\\u20d0-\\u20ff",lC=YH+QH+XH,aC="\\u2700-\\u27bf",cC="a-z\\xdf-\\xf6\\xf8-\\xff",JH="\\xac\\xb1\\xd7\\xf7",eW="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tW="\\u2000-\\u206f",iW=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dC="A-Z\\xc0-\\xd6\\xd8-\\xde",uC="\\ufe0e\\ufe0f",hC=JH+eW+tW+iW,Wu="['’]",sW="["+Sa+"]",pC="["+hC+"]",ya="["+lC+"]",gC="\\d+",nW="["+aC+"]",fC="["+cC+"]",mC="[^"+Sa+hC+gC+aC+cC+dC+"]",zu="\\ud83c[\\udffb-\\udfff]",oW="(?:"+ya+"|"+zu+")",CC="[^"+Sa+"]",Uu="(?:\\ud83c[\\udde6-\\uddff]){2}",$u="[\\ud800-\\udbff][\\udc00-\\udfff]",ho="["+dC+"]",vC="\\u200d",wC="(?:"+fC+"|"+mC+")",rW="(?:"+ho+"|"+mC+")",SC="(?:"+Wu+"(?:d|ll|m|re|s|t|ve))?",yC="(?:"+Wu+"(?:D|LL|M|RE|S|T|VE))?",bC=oW+"?",RC="["+uC+"]?",lW="(?:"+vC+"(?:"+[CC,Uu,$u].join("|")+")"+RC+bC+")*",aW="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cW="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",FC=RC+bC+lW,dW="(?:"+[nW,Uu,$u].join("|")+")"+FC,uW="(?:"+[CC+ya+"?",ya,Uu,$u,sW].join("|")+")",hW=RegExp(Wu,"g"),pW=RegExp(ya,"g"),Ku=RegExp(zu+"(?="+zu+")|"+uW+FC,"g"),gW=RegExp([ho+"?"+fC+"+"+SC+"(?="+[pC,ho,"$"].join("|")+")",rW+"+"+yC+"(?="+[pC,ho+wC,"$"].join("|")+")",ho+"?"+wC+"+"+SC,ho+"+"+yC,cW,aW,gC,dW].join("|"),"g"),fW=RegExp("["+vC+Sa+lC+uC+"]"),mW=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,CW=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],vW=-1,Qe={};Qe[Mu]=Qe[ku]=Qe[Iu]=Qe[Lu]=Qe[_u]=Qe[Ou]=Qe[Vu]=Qe[Nu]=Qe[Bu]=!0,Qe[co]=Qe[fa]=Qe[Wr]=Qe[Or]=Qe[uo]=Qe[Vr]=Qe[ma]=Qe[Ca]=Qe[Di]=Qe[Nr]=Qe[ls]=Qe[Br]=Qe[Ti]=Qe[Gr]=Qe[Hr]=!1;var qe={};qe[co]=qe[fa]=qe[Wr]=qe[uo]=qe[Or]=qe[Vr]=qe[Mu]=qe[ku]=qe[Iu]=qe[Lu]=qe[_u]=qe[Di]=qe[Nr]=qe[ls]=qe[Br]=qe[Ti]=qe[Gr]=qe[va]=qe[Ou]=qe[Vu]=qe[Nu]=qe[Bu]=!0,qe[ma]=qe[Ca]=qe[Hr]=!1;var wW={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},SW={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},yW={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},bW={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},RW=parseFloat,FW=parseInt,xC=typeof vr=="object"&&vr&&vr.Object===Object&&vr,xW=typeof self=="object"&&self&&self.Object===Object&&self,ft=xC||xW||Function("return this")(),ju=t&&!t.nodeType&&t,Sn=ju&&!0&&e&&!e.nodeType&&e,EC=Sn&&Sn.exports===ju,Zu=EC&&xC.process,ai=function(){try{var k=Sn&&Sn.require&&Sn.require("util").types;return k||Zu&&Zu.binding&&Zu.binding("util")}catch{}}(),PC=ai&&ai.isArrayBuffer,DC=ai&&ai.isDate,TC=ai&&ai.isMap,AC=ai&&ai.isRegExp,MC=ai&&ai.isSet,kC=ai&&ai.isTypedArray;function Yt(k,U,G){switch(G.length){case 0:return k.call(U);case 1:return k.call(U,G[0]);case 2:return k.call(U,G[0],G[1]);case 3:return k.call(U,G[0],G[1],G[2])}return k.apply(U,G)}function EW(k,U,G,le){for(var be=-1,ze=k==null?0:k.length;++be<ze;){var at=k[be];U(le,at,G(at),k)}return le}function ci(k,U){for(var G=-1,le=k==null?0:k.length;++G<le&&U(k[G],G,k)!==!1;);return k}function PW(k,U){for(var G=k==null?0:k.length;G--&&U(k[G],G,k)!==!1;);return k}function IC(k,U){for(var G=-1,le=k==null?0:k.length;++G<le;)if(!U(k[G],G,k))return!1;return!0}function zs(k,U){for(var G=-1,le=k==null?0:k.length,be=0,ze=[];++G<le;){var at=k[G];U(at,G,k)&&(ze[be++]=at)}return ze}function ba(k,U){var G=k==null?0:k.length;return!!G&&po(k,U,0)>-1}function qu(k,U,G){for(var le=-1,be=k==null?0:k.length;++le<be;)if(G(U,k[le]))return!0;return!1}function Je(k,U){for(var G=-1,le=k==null?0:k.length,be=Array(le);++G<le;)be[G]=U(k[G],G,k);return be}function Us(k,U){for(var G=-1,le=U.length,be=k.length;++G<le;)k[be+G]=U[G];return k}function Yu(k,U,G,le){var be=-1,ze=k==null?0:k.length;for(le&&ze&&(G=k[++be]);++be<ze;)G=U(G,k[be],be,k);return G}function DW(k,U,G,le){var be=k==null?0:k.length;for(le&&be&&(G=k[--be]);be--;)G=U(G,k[be],be,k);return G}function Qu(k,U){for(var G=-1,le=k==null?0:k.length;++G<le;)if(U(k[G],G,k))return!0;return!1}var TW=Xu("length");function AW(k){return k.split("")}function MW(k){return k.match(BH)||[]}function LC(k,U,G){var le;return G(k,function(be,ze,at){if(U(be,ze,at))return le=ze,!1}),le}function Ra(k,U,G,le){for(var be=k.length,ze=G+(le?1:-1);le?ze--:++ze<be;)if(U(k[ze],ze,k))return ze;return-1}function po(k,U,G){return U===U?zW(k,U,G):Ra(k,_C,G)}function kW(k,U,G,le){for(var be=G-1,ze=k.length;++be<ze;)if(le(k[be],U))return be;return-1}function _C(k){return k!==k}function OC(k,U){var G=k==null?0:k.length;return G?eh(k,U)/G:Ws}function Xu(k){return function(U){return U==null?i:U[k]}}function Ju(k){return function(U){return k==null?i:k[U]}}function VC(k,U,G,le,be){return be(k,function(ze,at,Ze){G=le?(le=!1,ze):U(G,ze,at,Ze)}),G}function IW(k,U){var G=k.length;for(k.sort(U);G--;)k[G]=k[G].value;return k}function eh(k,U){for(var G,le=-1,be=k.length;++le<be;){var ze=U(k[le]);ze!==i&&(G=G===i?ze:G+ze)}return G}function th(k,U){for(var G=-1,le=Array(k);++G<k;)le[G]=U(G);return le}function LW(k,U){return Je(U,function(G){return[G,k[G]]})}function NC(k){return k&&k.slice(0,WC(k)+1).replace(Hu,"")}function Qt(k){return function(U){return k(U)}}function ih(k,U){return Je(U,function(G){return k[G]})}function zr(k,U){return k.has(U)}function BC(k,U){for(var G=-1,le=k.length;++G<le&&po(U,k[G],0)>-1;);return G}function GC(k,U){for(var G=k.length;G--&&po(U,k[G],0)>-1;);return G}function _W(k,U){for(var G=k.length,le=0;G--;)k[G]===U&&++le;return le}var OW=Ju(wW),VW=Ju(SW);function NW(k){return"\\"+bW[k]}function BW(k,U){return k==null?i:k[U]}function go(k){return fW.test(k)}function GW(k){return mW.test(k)}function HW(k){for(var U,G=[];!(U=k.next()).done;)G.push(U.value);return G}function sh(k){var U=-1,G=Array(k.size);return k.forEach(function(le,be){G[++U]=[be,le]}),G}function HC(k,U){return function(G){return k(U(G))}}function $s(k,U){for(var G=-1,le=k.length,be=0,ze=[];++G<le;){var at=k[G];(at===U||at===g)&&(k[G]=g,ze[be++]=G)}return ze}function Fa(k){var U=-1,G=Array(k.size);return k.forEach(function(le){G[++U]=le}),G}function WW(k){var U=-1,G=Array(k.size);return k.forEach(function(le){G[++U]=[le,le]}),G}function zW(k,U,G){for(var le=G-1,be=k.length;++le<be;)if(k[le]===U)return le;return-1}function UW(k,U,G){for(var le=G+1;le--;)if(k[le]===U)return le;return le}function fo(k){return go(k)?KW(k):TW(k)}function Ai(k){return go(k)?jW(k):AW(k)}function WC(k){for(var U=k.length;U--&&_H.test(k.charAt(U)););return U}var $W=Ju(yW);function KW(k){for(var U=Ku.lastIndex=0;Ku.test(k);)++U;return U}function jW(k){return k.match(Ku)||[]}function ZW(k){return k.match(gW)||[]}var qW=function k(U){U=U==null?ft:mo.defaults(ft.Object(),U,mo.pick(ft,CW));var G=U.Array,le=U.Date,be=U.Error,ze=U.Function,at=U.Math,Ze=U.Object,nh=U.RegExp,YW=U.String,di=U.TypeError,xa=G.prototype,QW=ze.prototype,Co=Ze.prototype,Ea=U["__core-js_shared__"],Pa=QW.toString,$e=Co.hasOwnProperty,XW=0,zC=function(){var l=/[^.]+$/.exec(Ea&&Ea.keys&&Ea.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Da=Co.toString,JW=Pa.call(Ze),ez=ft._,tz=nh("^"+Pa.call($e).replace(Gu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ta=EC?U.Buffer:i,Ks=U.Symbol,Aa=U.Uint8Array,UC=Ta?Ta.allocUnsafe:i,Ma=HC(Ze.getPrototypeOf,Ze),$C=Ze.create,KC=Co.propertyIsEnumerable,ka=xa.splice,jC=Ks?Ks.isConcatSpreadable:i,Ur=Ks?Ks.iterator:i,yn=Ks?Ks.toStringTag:i,Ia=function(){try{var l=En(Ze,"defineProperty");return l({},"",{}),l}catch{}}(),iz=U.clearTimeout!==ft.clearTimeout&&U.clearTimeout,sz=le&&le.now!==ft.Date.now&&le.now,nz=U.setTimeout!==ft.setTimeout&&U.setTimeout,La=at.ceil,_a=at.floor,oh=Ze.getOwnPropertySymbols,oz=Ta?Ta.isBuffer:i,ZC=U.isFinite,rz=xa.join,lz=HC(Ze.keys,Ze),ct=at.max,Ft=at.min,az=le.now,cz=U.parseInt,qC=at.random,dz=xa.reverse,rh=En(U,"DataView"),$r=En(U,"Map"),lh=En(U,"Promise"),vo=En(U,"Set"),Kr=En(U,"WeakMap"),jr=En(Ze,"create"),Oa=Kr&&new Kr,wo={},uz=Pn(rh),hz=Pn($r),pz=Pn(lh),gz=Pn(vo),fz=Pn(Kr),Va=Ks?Ks.prototype:i,Zr=Va?Va.valueOf:i,YC=Va?Va.toString:i;function b(l){if(nt(l)&&!Re(l)&&!(l instanceof Ne)){if(l instanceof ui)return l;if($e.call(l,"__wrapped__"))return Qv(l)}return new ui(l)}var So=function(){function l(){}return function(u){if(!it(u))return{};if($C)return $C(u);l.prototype=u;var p=new l;return l.prototype=i,p}}();function Na(){}function ui(l,u){this.__wrapped__=l,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=i}b.templateSettings={escape:TH,evaluate:AH,interpolate:oC,variable:"",imports:{_:b}},b.prototype=Na.prototype,b.prototype.constructor=b,ui.prototype=So(Na.prototype),ui.prototype.constructor=ui;function Ne(l){this.__wrapped__=l,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Gt,this.__views__=[]}function mz(){var l=new Ne(this.__wrapped__);return l.__actions__=Ht(this.__actions__),l.__dir__=this.__dir__,l.__filtered__=this.__filtered__,l.__iteratees__=Ht(this.__iteratees__),l.__takeCount__=this.__takeCount__,l.__views__=Ht(this.__views__),l}function Cz(){if(this.__filtered__){var l=new Ne(this);l.__dir__=-1,l.__filtered__=!0}else l=this.clone(),l.__dir__*=-1;return l}function vz(){var l=this.__wrapped__.value(),u=this.__dir__,p=Re(l),m=u<0,w=p?l.length:0,F=A2(0,w,this.__views__),E=F.start,D=F.end,L=D-E,$=m?D:E-1,K=this.__iteratees__,q=K.length,te=0,de=Ft(L,this.__takeCount__);if(!p||!m&&w==L&&de==L)return Sv(l,this.__actions__);var me=[];e:for(;L--&&te<de;){$+=u;for(var Me=-1,Ce=l[$];++Me<q;){var Oe=K[Me],Be=Oe.iteratee,ei=Oe.type,_t=Be(Ce);if(ei==ae)Ce=_t;else if(!_t){if(ei==pe)continue e;break e}}me[te++]=Ce}return me}Ne.prototype=So(Na.prototype),Ne.prototype.constructor=Ne;function bn(l){var u=-1,p=l==null?0:l.length;for(this.clear();++u<p;){var m=l[u];this.set(m[0],m[1])}}function wz(){this.__data__=jr?jr(null):{},this.size=0}function Sz(l){var u=this.has(l)&&delete this.__data__[l];return this.size-=u?1:0,u}function yz(l){var u=this.__data__;if(jr){var p=u[l];return p===d?i:p}return $e.call(u,l)?u[l]:i}function bz(l){var u=this.__data__;return jr?u[l]!==i:$e.call(u,l)}function Rz(l,u){var p=this.__data__;return this.size+=this.has(l)?0:1,p[l]=jr&&u===i?d:u,this}bn.prototype.clear=wz,bn.prototype.delete=Sz,bn.prototype.get=yz,bn.prototype.has=bz,bn.prototype.set=Rz;function as(l){var u=-1,p=l==null?0:l.length;for(this.clear();++u<p;){var m=l[u];this.set(m[0],m[1])}}function Fz(){this.__data__=[],this.size=0}function xz(l){var u=this.__data__,p=Ba(u,l);if(p<0)return!1;var m=u.length-1;return p==m?u.pop():ka.call(u,p,1),--this.size,!0}function Ez(l){var u=this.__data__,p=Ba(u,l);return p<0?i:u[p][1]}function Pz(l){return Ba(this.__data__,l)>-1}function Dz(l,u){var p=this.__data__,m=Ba(p,l);return m<0?(++this.size,p.push([l,u])):p[m][1]=u,this}as.prototype.clear=Fz,as.prototype.delete=xz,as.prototype.get=Ez,as.prototype.has=Pz,as.prototype.set=Dz;function cs(l){var u=-1,p=l==null?0:l.length;for(this.clear();++u<p;){var m=l[u];this.set(m[0],m[1])}}function Tz(){this.size=0,this.__data__={hash:new bn,map:new($r||as),string:new bn}}function Az(l){var u=Qa(this,l).delete(l);return this.size-=u?1:0,u}function Mz(l){return Qa(this,l).get(l)}function kz(l){return Qa(this,l).has(l)}function Iz(l,u){var p=Qa(this,l),m=p.size;return p.set(l,u),this.size+=p.size==m?0:1,this}cs.prototype.clear=Tz,cs.prototype.delete=Az,cs.prototype.get=Mz,cs.prototype.has=kz,cs.prototype.set=Iz;function Rn(l){var u=-1,p=l==null?0:l.length;for(this.__data__=new cs;++u<p;)this.add(l[u])}function Lz(l){return this.__data__.set(l,d),this}function _z(l){return this.__data__.has(l)}Rn.prototype.add=Rn.prototype.push=Lz,Rn.prototype.has=_z;function Mi(l){var u=this.__data__=new as(l);this.size=u.size}function Oz(){this.__data__=new as,this.size=0}function Vz(l){var u=this.__data__,p=u.delete(l);return this.size=u.size,p}function Nz(l){return this.__data__.get(l)}function Bz(l){return this.__data__.has(l)}function Gz(l,u){var p=this.__data__;if(p instanceof as){var m=p.__data__;if(!$r||m.length<n-1)return m.push([l,u]),this.size=++p.size,this;p=this.__data__=new cs(m)}return p.set(l,u),this.size=p.size,this}Mi.prototype.clear=Oz,Mi.prototype.delete=Vz,Mi.prototype.get=Nz,Mi.prototype.has=Bz,Mi.prototype.set=Gz;function QC(l,u){var p=Re(l),m=!p&&Dn(l),w=!p&&!m&&Qs(l),F=!p&&!m&&!w&&Fo(l),E=p||m||w||F,D=E?th(l.length,YW):[],L=D.length;for(var $ in l)(u||$e.call(l,$))&&!(E&&($=="length"||w&&($=="offset"||$=="parent")||F&&($=="buffer"||$=="byteLength"||$=="byteOffset")||ps($,L)))&&D.push($);return D}function XC(l){var u=l.length;return u?l[vh(0,u-1)]:i}function Hz(l,u){return Xa(Ht(l),Fn(u,0,l.length))}function Wz(l){return Xa(Ht(l))}function ah(l,u,p){(p!==i&&!ki(l[u],p)||p===i&&!(u in l))&&ds(l,u,p)}function qr(l,u,p){var m=l[u];(!($e.call(l,u)&&ki(m,p))||p===i&&!(u in l))&&ds(l,u,p)}function Ba(l,u){for(var p=l.length;p--;)if(ki(l[p][0],u))return p;return-1}function zz(l,u,p,m){return js(l,function(w,F,E){u(m,w,p(w),E)}),m}function JC(l,u){return l&&ji(u,pt(u),l)}function Uz(l,u){return l&&ji(u,zt(u),l)}function ds(l,u,p){u=="__proto__"&&Ia?Ia(l,u,{configurable:!0,enumerable:!0,value:p,writable:!0}):l[u]=p}function ch(l,u){for(var p=-1,m=u.length,w=G(m),F=l==null;++p<m;)w[p]=F?i:zh(l,u[p]);return w}function Fn(l,u,p){return l===l&&(p!==i&&(l=l<=p?l:p),u!==i&&(l=l>=u?l:u)),l}function hi(l,u,p,m,w,F){var E,D=u&f,L=u&C,$=u&v;if(p&&(E=w?p(l,m,w,F):p(l)),E!==i)return E;if(!it(l))return l;var K=Re(l);if(K){if(E=k2(l),!D)return Ht(l,E)}else{var q=xt(l),te=q==Ca||q==tC;if(Qs(l))return Rv(l,D);if(q==ls||q==co||te&&!w){if(E=L||te?{}:Wv(l),!D)return L?y2(l,Uz(E,l)):S2(l,JC(E,l))}else{if(!qe[q])return w?l:{};E=I2(l,q,D)}}F||(F=new Mi);var de=F.get(l);if(de)return de;F.set(l,E),Cw(l)?l.forEach(function(Ce){E.add(hi(Ce,u,p,Ce,l,F))}):fw(l)&&l.forEach(function(Ce,Oe){E.set(Oe,hi(Ce,u,p,Oe,l,F))});var me=$?L?Th:Dh:L?zt:pt,Me=K?i:me(l);return ci(Me||l,function(Ce,Oe){Me&&(Oe=Ce,Ce=l[Oe]),qr(E,Oe,hi(Ce,u,p,Oe,l,F))}),E}function $z(l){var u=pt(l);return function(p){return ev(p,l,u)}}function ev(l,u,p){var m=p.length;if(l==null)return!m;for(l=Ze(l);m--;){var w=p[m],F=u[w],E=l[w];if(E===i&&!(w in l)||!F(E))return!1}return!0}function tv(l,u,p){if(typeof l!="function")throw new di(r);return il(function(){l.apply(i,p)},u)}function Yr(l,u,p,m){var w=-1,F=ba,E=!0,D=l.length,L=[],$=u.length;if(!D)return L;p&&(u=Je(u,Qt(p))),m?(F=qu,E=!1):u.length>=n&&(F=zr,E=!1,u=new Rn(u));e:for(;++w<D;){var K=l[w],q=p==null?K:p(K);if(K=m||K!==0?K:0,E&&q===q){for(var te=$;te--;)if(u[te]===q)continue e;L.push(K)}else F(u,q,m)||L.push(K)}return L}var js=Dv(Ki),iv=Dv(uh,!0);function Kz(l,u){var p=!0;return js(l,function(m,w,F){return p=!!u(m,w,F),p}),p}function Ga(l,u,p){for(var m=-1,w=l.length;++m<w;){var F=l[m],E=u(F);if(E!=null&&(D===i?E===E&&!Jt(E):p(E,D)))var D=E,L=F}return L}function jz(l,u,p,m){var w=l.length;for(p=De(p),p<0&&(p=-p>w?0:w+p),m=m===i||m>w?w:De(m),m<0&&(m+=w),m=p>m?0:ww(m);p<m;)l[p++]=u;return l}function sv(l,u){var p=[];return js(l,function(m,w,F){u(m,w,F)&&p.push(m)}),p}function mt(l,u,p,m,w){var F=-1,E=l.length;for(p||(p=_2),w||(w=[]);++F<E;){var D=l[F];u>0&&p(D)?u>1?mt(D,u-1,p,m,w):Us(w,D):m||(w[w.length]=D)}return w}var dh=Tv(),nv=Tv(!0);function Ki(l,u){return l&&dh(l,u,pt)}function uh(l,u){return l&&nv(l,u,pt)}function Ha(l,u){return zs(u,function(p){return gs(l[p])})}function xn(l,u){u=qs(u,l);for(var p=0,m=u.length;l!=null&&p<m;)l=l[Zi(u[p++])];return p&&p==m?l:i}function ov(l,u,p){var m=u(l);return Re(l)?m:Us(m,p(l))}function It(l){return l==null?l===i?bH:SH:yn&&yn in Ze(l)?T2(l):W2(l)}function hh(l,u){return l>u}function Zz(l,u){return l!=null&&$e.call(l,u)}function qz(l,u){return l!=null&&u in Ze(l)}function Yz(l,u,p){return l>=Ft(u,p)&&l<ct(u,p)}function ph(l,u,p){for(var m=p?qu:ba,w=l[0].length,F=l.length,E=F,D=G(F),L=1/0,$=[];E--;){var K=l[E];E&&u&&(K=Je(K,Qt(u))),L=Ft(K.length,L),D[E]=!p&&(u||w>=120&&K.length>=120)?new Rn(E&&K):i}K=l[0];var q=-1,te=D[0];e:for(;++q<w&&$.length<L;){var de=K[q],me=u?u(de):de;if(de=p||de!==0?de:0,!(te?zr(te,me):m($,me,p))){for(E=F;--E;){var Me=D[E];if(!(Me?zr(Me,me):m(l[E],me,p)))continue e}te&&te.push(me),$.push(de)}}return $}function Qz(l,u,p,m){return Ki(l,function(w,F,E){u(m,p(w),F,E)}),m}function Qr(l,u,p){u=qs(u,l),l=Kv(l,u);var m=l==null?l:l[Zi(gi(u))];return m==null?i:Yt(m,l,p)}function rv(l){return nt(l)&&It(l)==co}function Xz(l){return nt(l)&&It(l)==Wr}function Jz(l){return nt(l)&&It(l)==Vr}function Xr(l,u,p,m,w){return l===u?!0:l==null||u==null||!nt(l)&&!nt(u)?l!==l&&u!==u:e2(l,u,p,m,Xr,w)}function e2(l,u,p,m,w,F){var E=Re(l),D=Re(u),L=E?fa:xt(l),$=D?fa:xt(u);L=L==co?ls:L,$=$==co?ls:$;var K=L==ls,q=$==ls,te=L==$;if(te&&Qs(l)){if(!Qs(u))return!1;E=!0,K=!1}if(te&&!K)return F||(F=new Mi),E||Fo(l)?Bv(l,u,p,m,w,F):P2(l,u,L,p,m,w,F);if(!(p&S)){var de=K&&$e.call(l,"__wrapped__"),me=q&&$e.call(u,"__wrapped__");if(de||me){var Me=de?l.value():l,Ce=me?u.value():u;return F||(F=new Mi),w(Me,Ce,p,m,F)}}return te?(F||(F=new Mi),D2(l,u,p,m,w,F)):!1}function t2(l){return nt(l)&&xt(l)==Di}function gh(l,u,p,m){var w=p.length,F=w,E=!m;if(l==null)return!F;for(l=Ze(l);w--;){var D=p[w];if(E&&D[2]?D[1]!==l[D[0]]:!(D[0]in l))return!1}for(;++w<F;){D=p[w];var L=D[0],$=l[L],K=D[1];if(E&&D[2]){if($===i&&!(L in l))return!1}else{var q=new Mi;if(m)var te=m($,K,L,l,u,q);if(!(te===i?Xr(K,$,S|R,m,q):te))return!1}}return!0}function lv(l){if(!it(l)||V2(l))return!1;var u=gs(l)?tz:$H;return u.test(Pn(l))}function i2(l){return nt(l)&&It(l)==Br}function s2(l){return nt(l)&&xt(l)==Ti}function n2(l){return nt(l)&&nc(l.length)&&!!Qe[It(l)]}function av(l){return typeof l=="function"?l:l==null?Ut:typeof l=="object"?Re(l)?uv(l[0],l[1]):dv(l):Aw(l)}function fh(l){if(!tl(l))return lz(l);var u=[];for(var p in Ze(l))$e.call(l,p)&&p!="constructor"&&u.push(p);return u}function o2(l){if(!it(l))return H2(l);var u=tl(l),p=[];for(var m in l)m=="constructor"&&(u||!$e.call(l,m))||p.push(m);return p}function mh(l,u){return l<u}function cv(l,u){var p=-1,m=Wt(l)?G(l.length):[];return js(l,function(w,F,E){m[++p]=u(w,F,E)}),m}function dv(l){var u=Mh(l);return u.length==1&&u[0][2]?Uv(u[0][0],u[0][1]):function(p){return p===l||gh(p,l,u)}}function uv(l,u){return Ih(l)&&zv(u)?Uv(Zi(l),u):function(p){var m=zh(p,l);return m===i&&m===u?Uh(p,l):Xr(u,m,S|R)}}function Wa(l,u,p,m,w){l!==u&&dh(u,function(F,E){if(w||(w=new Mi),it(F))r2(l,u,E,p,Wa,m,w);else{var D=m?m(_h(l,E),F,E+"",l,u,w):i;D===i&&(D=F),ah(l,E,D)}},zt)}function r2(l,u,p,m,w,F,E){var D=_h(l,p),L=_h(u,p),$=E.get(L);if($){ah(l,p,$);return}var K=F?F(D,L,p+"",l,u,E):i,q=K===i;if(q){var te=Re(L),de=!te&&Qs(L),me=!te&&!de&&Fo(L);K=L,te||de||me?Re(D)?K=D:rt(D)?K=Ht(D):de?(q=!1,K=Rv(L,!0)):me?(q=!1,K=Fv(L,!0)):K=[]:sl(L)||Dn(L)?(K=D,Dn(D)?K=Sw(D):(!it(D)||gs(D))&&(K=Wv(L))):q=!1}q&&(E.set(L,K),w(K,L,m,F,E),E.delete(L)),ah(l,p,K)}function hv(l,u){var p=l.length;if(p)return u+=u<0?p:0,ps(u,p)?l[u]:i}function pv(l,u,p){u.length?u=Je(u,function(F){return Re(F)?function(E){return xn(E,F.length===1?F[0]:F)}:F}):u=[Ut];var m=-1;u=Je(u,Qt(fe()));var w=cv(l,function(F,E,D){var L=Je(u,function($){return $(F)});return{criteria:L,index:++m,value:F}});return IW(w,function(F,E){return w2(F,E,p)})}function l2(l,u){return gv(l,u,function(p,m){return Uh(l,m)})}function gv(l,u,p){for(var m=-1,w=u.length,F={};++m<w;){var E=u[m],D=xn(l,E);p(D,E)&&Jr(F,qs(E,l),D)}return F}function a2(l){return function(u){return xn(u,l)}}function Ch(l,u,p,m){var w=m?kW:po,F=-1,E=u.length,D=l;for(l===u&&(u=Ht(u)),p&&(D=Je(l,Qt(p)));++F<E;)for(var L=0,$=u[F],K=p?p($):$;(L=w(D,K,L,m))>-1;)D!==l&&ka.call(D,L,1),ka.call(l,L,1);return l}function fv(l,u){for(var p=l?u.length:0,m=p-1;p--;){var w=u[p];if(p==m||w!==F){var F=w;ps(w)?ka.call(l,w,1):yh(l,w)}}return l}function vh(l,u){return l+_a(qC()*(u-l+1))}function c2(l,u,p,m){for(var w=-1,F=ct(La((u-l)/(p||1)),0),E=G(F);F--;)E[m?F:++w]=l,l+=p;return E}function wh(l,u){var p="";if(!l||u<1||u>_e)return p;do u%2&&(p+=l),u=_a(u/2),u&&(l+=l);while(u);return p}function Ie(l,u){return Oh($v(l,u,Ut),l+"")}function d2(l){return XC(xo(l))}function u2(l,u){var p=xo(l);return Xa(p,Fn(u,0,p.length))}function Jr(l,u,p,m){if(!it(l))return l;u=qs(u,l);for(var w=-1,F=u.length,E=F-1,D=l;D!=null&&++w<F;){var L=Zi(u[w]),$=p;if(L==="__proto__"||L==="constructor"||L==="prototype")return l;if(w!=E){var K=D[L];$=m?m(K,L,D):i,$===i&&($=it(K)?K:ps(u[w+1])?[]:{})}qr(D,L,$),D=D[L]}return l}var mv=Oa?function(l,u){return Oa.set(l,u),l}:Ut,h2=Ia?function(l,u){return Ia(l,"toString",{configurable:!0,enumerable:!1,value:Kh(u),writable:!0})}:Ut;function p2(l){return Xa(xo(l))}function pi(l,u,p){var m=-1,w=l.length;u<0&&(u=-u>w?0:w+u),p=p>w?w:p,p<0&&(p+=w),w=u>p?0:p-u>>>0,u>>>=0;for(var F=G(w);++m<w;)F[m]=l[m+u];return F}function g2(l,u){var p;return js(l,function(m,w,F){return p=u(m,w,F),!p}),!!p}function za(l,u,p){var m=0,w=l==null?m:l.length;if(typeof u=="number"&&u===u&&w<=mH){for(;m<w;){var F=m+w>>>1,E=l[F];E!==null&&!Jt(E)&&(p?E<=u:E<u)?m=F+1:w=F}return w}return Sh(l,u,Ut,p)}function Sh(l,u,p,m){var w=0,F=l==null?0:l.length;if(F===0)return 0;u=p(u);for(var E=u!==u,D=u===null,L=Jt(u),$=u===i;w<F;){var K=_a((w+F)/2),q=p(l[K]),te=q!==i,de=q===null,me=q===q,Me=Jt(q);if(E)var Ce=m||me;else $?Ce=me&&(m||te):D?Ce=me&&te&&(m||!de):L?Ce=me&&te&&!de&&(m||!Me):de||Me?Ce=!1:Ce=m?q<=u:q<u;Ce?w=K+1:F=K}return Ft(F,fH)}function Cv(l,u){for(var p=-1,m=l.length,w=0,F=[];++p<m;){var E=l[p],D=u?u(E):E;if(!p||!ki(D,L)){var L=D;F[w++]=E===0?0:E}}return F}function vv(l){return typeof l=="number"?l:Jt(l)?Ws:+l}function Xt(l){if(typeof l=="string")return l;if(Re(l))return Je(l,Xt)+"";if(Jt(l))return YC?YC.call(l):"";var u=l+"";return u=="0"&&1/l==-Ee?"-0":u}function Zs(l,u,p){var m=-1,w=ba,F=l.length,E=!0,D=[],L=D;if(p)E=!1,w=qu;else if(F>=n){var $=u?null:x2(l);if($)return Fa($);E=!1,w=zr,L=new Rn}else L=u?[]:D;e:for(;++m<F;){var K=l[m],q=u?u(K):K;if(K=p||K!==0?K:0,E&&q===q){for(var te=L.length;te--;)if(L[te]===q)continue e;u&&L.push(q),D.push(K)}else w(L,q,p)||(L!==D&&L.push(q),D.push(K))}return D}function yh(l,u){return u=qs(u,l),l=Kv(l,u),l==null||delete l[Zi(gi(u))]}function wv(l,u,p,m){return Jr(l,u,p(xn(l,u)),m)}function Ua(l,u,p,m){for(var w=l.length,F=m?w:-1;(m?F--:++F<w)&&u(l[F],F,l););return p?pi(l,m?0:F,m?F+1:w):pi(l,m?F+1:0,m?w:F)}function Sv(l,u){var p=l;return p instanceof Ne&&(p=p.value()),Yu(u,function(m,w){return w.func.apply(w.thisArg,Us([m],w.args))},p)}function bh(l,u,p){var m=l.length;if(m<2)return m?Zs(l[0]):[];for(var w=-1,F=G(m);++w<m;)for(var E=l[w],D=-1;++D<m;)D!=w&&(F[w]=Yr(F[w]||E,l[D],u,p));return Zs(mt(F,1),u,p)}function yv(l,u,p){for(var m=-1,w=l.length,F=u.length,E={};++m<w;){var D=m<F?u[m]:i;p(E,l[m],D)}return E}function Rh(l){return rt(l)?l:[]}function Fh(l){return typeof l=="function"?l:Ut}function qs(l,u){return Re(l)?l:Ih(l,u)?[l]:Yv(Ue(l))}var f2=Ie;function Ys(l,u,p){var m=l.length;return p=p===i?m:p,!u&&p>=m?l:pi(l,u,p)}var bv=iz||function(l){return ft.clearTimeout(l)};function Rv(l,u){if(u)return l.slice();var p=l.length,m=UC?UC(p):new l.constructor(p);return l.copy(m),m}function xh(l){var u=new l.constructor(l.byteLength);return new Aa(u).set(new Aa(l)),u}function m2(l,u){var p=u?xh(l.buffer):l.buffer;return new l.constructor(p,l.byteOffset,l.byteLength)}function C2(l){var u=new l.constructor(l.source,rC.exec(l));return u.lastIndex=l.lastIndex,u}function v2(l){return Zr?Ze(Zr.call(l)):{}}function Fv(l,u){var p=u?xh(l.buffer):l.buffer;return new l.constructor(p,l.byteOffset,l.length)}function xv(l,u){if(l!==u){var p=l!==i,m=l===null,w=l===l,F=Jt(l),E=u!==i,D=u===null,L=u===u,$=Jt(u);if(!D&&!$&&!F&&l>u||F&&E&&L&&!D&&!$||m&&E&&L||!p&&L||!w)return 1;if(!m&&!F&&!$&&l<u||$&&p&&w&&!m&&!F||D&&p&&w||!E&&w||!L)return-1}return 0}function w2(l,u,p){for(var m=-1,w=l.criteria,F=u.criteria,E=w.length,D=p.length;++m<E;){var L=xv(w[m],F[m]);if(L){if(m>=D)return L;var $=p[m];return L*($=="desc"?-1:1)}}return l.index-u.index}function Ev(l,u,p,m){for(var w=-1,F=l.length,E=p.length,D=-1,L=u.length,$=ct(F-E,0),K=G(L+$),q=!m;++D<L;)K[D]=u[D];for(;++w<E;)(q||w<F)&&(K[p[w]]=l[w]);for(;$--;)K[D++]=l[w++];return K}function Pv(l,u,p,m){for(var w=-1,F=l.length,E=-1,D=p.length,L=-1,$=u.length,K=ct(F-D,0),q=G(K+$),te=!m;++w<K;)q[w]=l[w];for(var de=w;++L<$;)q[de+L]=u[L];for(;++E<D;)(te||w<F)&&(q[de+p[E]]=l[w++]);return q}function Ht(l,u){var p=-1,m=l.length;for(u||(u=G(m));++p<m;)u[p]=l[p];return u}function ji(l,u,p,m){var w=!p;p||(p={});for(var F=-1,E=u.length;++F<E;){var D=u[F],L=m?m(p[D],l[D],D,p,l):i;L===i&&(L=l[D]),w?ds(p,D,L):qr(p,D,L)}return p}function S2(l,u){return ji(l,kh(l),u)}function y2(l,u){return ji(l,Gv(l),u)}function $a(l,u){return function(p,m){var w=Re(p)?EW:zz,F=u?u():{};return w(p,l,fe(m,2),F)}}function yo(l){return Ie(function(u,p){var m=-1,w=p.length,F=w>1?p[w-1]:i,E=w>2?p[2]:i;for(F=l.length>3&&typeof F=="function"?(w--,F):i,E&&Lt(p[0],p[1],E)&&(F=w<3?i:F,w=1),u=Ze(u);++m<w;){var D=p[m];D&&l(u,D,m,F)}return u})}function Dv(l,u){return function(p,m){if(p==null)return p;if(!Wt(p))return l(p,m);for(var w=p.length,F=u?w:-1,E=Ze(p);(u?F--:++F<w)&&m(E[F],F,E)!==!1;);return p}}function Tv(l){return function(u,p,m){for(var w=-1,F=Ze(u),E=m(u),D=E.length;D--;){var L=E[l?D:++w];if(p(F[L],L,F)===!1)break}return u}}function b2(l,u,p){var m=u&y,w=el(l);function F(){var E=this&&this!==ft&&this instanceof F?w:l;return E.apply(m?p:this,arguments)}return F}function Av(l){return function(u){u=Ue(u);var p=go(u)?Ai(u):i,m=p?p[0]:u.charAt(0),w=p?Ys(p,1).join(""):u.slice(1);return m[l]()+w}}function bo(l){return function(u){return Yu(Dw(Pw(u).replace(hW,"")),l,"")}}function el(l){return function(){var u=arguments;switch(u.length){case 0:return new l;case 1:return new l(u[0]);case 2:return new l(u[0],u[1]);case 3:return new l(u[0],u[1],u[2]);case 4:return new l(u[0],u[1],u[2],u[3]);case 5:return new l(u[0],u[1],u[2],u[3],u[4]);case 6:return new l(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new l(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var p=So(l.prototype),m=l.apply(p,u);return it(m)?m:p}}function R2(l,u,p){var m=el(l);function w(){for(var F=arguments.length,E=G(F),D=F,L=Ro(w);D--;)E[D]=arguments[D];var $=F<3&&E[0]!==L&&E[F-1]!==L?[]:$s(E,L);if(F-=$.length,F<p)return _v(l,u,Ka,w.placeholder,i,E,$,i,i,p-F);var K=this&&this!==ft&&this instanceof w?m:l;return Yt(K,this,E)}return w}function Mv(l){return function(u,p,m){var w=Ze(u);if(!Wt(u)){var F=fe(p,3);u=pt(u),p=function(D){return F(w[D],D,w)}}var E=l(u,p,m);return E>-1?w[F?u[E]:E]:i}}function kv(l){return hs(function(u){var p=u.length,m=p,w=ui.prototype.thru;for(l&&u.reverse();m--;){var F=u[m];if(typeof F!="function")throw new di(r);if(w&&!E&&Ya(F)=="wrapper")var E=new ui([],!0)}for(m=E?m:p;++m<p;){F=u[m];var D=Ya(F),L=D=="wrapper"?Ah(F):i;L&&Lh(L[0])&&L[1]==(O|T|V|M)&&!L[4].length&&L[9]==1?E=E[Ya(L[0])].apply(E,L[3]):E=F.length==1&&Lh(F)?E[D]():E.thru(F)}return function(){var $=arguments,K=$[0];if(E&&$.length==1&&Re(K))return E.plant(K).value();for(var q=0,te=p?u[q].apply(this,$):K;++q<p;)te=u[q].call(this,te);return te}})}function Ka(l,u,p,m,w,F,E,D,L,$){var K=u&O,q=u&y,te=u&x,de=u&(T|I),me=u&A,Me=te?i:el(l);function Ce(){for(var Oe=arguments.length,Be=G(Oe),ei=Oe;ei--;)Be[ei]=arguments[ei];if(de)var _t=Ro(Ce),ti=_W(Be,_t);if(m&&(Be=Ev(Be,m,w,de)),F&&(Be=Pv(Be,F,E,de)),Oe-=ti,de&&Oe<$){var lt=$s(Be,_t);return _v(l,u,Ka,Ce.placeholder,p,Be,lt,D,L,$-Oe)}var Ii=q?p:this,ms=te?Ii[l]:l;return Oe=Be.length,D?Be=z2(Be,D):me&&Oe>1&&Be.reverse(),K&&L<Oe&&(Be.length=L),this&&this!==ft&&this instanceof Ce&&(ms=Me||el(ms)),ms.apply(Ii,Be)}return Ce}function Iv(l,u){return function(p,m){return Qz(p,l,u(m),{})}}function ja(l,u){return function(p,m){var w;if(p===i&&m===i)return u;if(p!==i&&(w=p),m!==i){if(w===i)return m;typeof p=="string"||typeof m=="string"?(p=Xt(p),m=Xt(m)):(p=vv(p),m=vv(m)),w=l(p,m)}return w}}function Eh(l){return hs(function(u){return u=Je(u,Qt(fe())),Ie(function(p){var m=this;return l(u,function(w){return Yt(w,m,p)})})})}function Za(l,u){u=u===i?" ":Xt(u);var p=u.length;if(p<2)return p?wh(u,l):u;var m=wh(u,La(l/fo(u)));return go(u)?Ys(Ai(m),0,l).join(""):m.slice(0,l)}function F2(l,u,p,m){var w=u&y,F=el(l);function E(){for(var D=-1,L=arguments.length,$=-1,K=m.length,q=G(K+L),te=this&&this!==ft&&this instanceof E?F:l;++$<K;)q[$]=m[$];for(;L--;)q[$++]=arguments[++D];return Yt(te,w?p:this,q)}return E}function Lv(l){return function(u,p,m){return m&&typeof m!="number"&&Lt(u,p,m)&&(p=m=i),u=fs(u),p===i?(p=u,u=0):p=fs(p),m=m===i?u<p?1:-1:fs(m),c2(u,p,m,l)}}function qa(l){return function(u,p){return typeof u=="string"&&typeof p=="string"||(u=fi(u),p=fi(p)),l(u,p)}}function _v(l,u,p,m,w,F,E,D,L,$){var K=u&T,q=K?E:i,te=K?i:E,de=K?F:i,me=K?i:F;u|=K?V:_,u&=~(K?_:V),u&P||(u&=~(y|x));var Me=[l,u,w,de,q,me,te,D,L,$],Ce=p.apply(i,Me);return Lh(l)&&jv(Ce,Me),Ce.placeholder=m,Zv(Ce,l,u)}function Ph(l){var u=at[l];return function(p,m){if(p=fi(p),m=m==null?0:Ft(De(m),292),m&&ZC(p)){var w=(Ue(p)+"e").split("e"),F=u(w[0]+"e"+(+w[1]+m));return w=(Ue(F)+"e").split("e"),+(w[0]+"e"+(+w[1]-m))}return u(p)}}var x2=vo&&1/Fa(new vo([,-0]))[1]==Ee?function(l){return new vo(l)}:qh;function Ov(l){return function(u){var p=xt(u);return p==Di?sh(u):p==Ti?WW(u):LW(u,l(u))}}function us(l,u,p,m,w,F,E,D){var L=u&x;if(!L&&typeof l!="function")throw new di(r);var $=m?m.length:0;if($||(u&=~(V|_),m=w=i),E=E===i?E:ct(De(E),0),D=D===i?D:De(D),$-=w?w.length:0,u&_){var K=m,q=w;m=w=i}var te=L?i:Ah(l),de=[l,u,p,m,w,K,q,F,E,D];if(te&&G2(de,te),l=de[0],u=de[1],p=de[2],m=de[3],w=de[4],D=de[9]=de[9]===i?L?0:l.length:ct(de[9]-$,0),!D&&u&(T|I)&&(u&=~(T|I)),!u||u==y)var me=b2(l,u,p);else u==T||u==I?me=R2(l,u,D):(u==V||u==(y|V))&&!w.length?me=F2(l,u,p,m):me=Ka.apply(i,de);var Me=te?mv:jv;return Zv(Me(me,de),l,u)}function Vv(l,u,p,m){return l===i||ki(l,Co[p])&&!$e.call(m,p)?u:l}function Nv(l,u,p,m,w,F){return it(l)&&it(u)&&(F.set(u,l),Wa(l,u,i,Nv,F),F.delete(u)),l}function E2(l){return sl(l)?i:l}function Bv(l,u,p,m,w,F){var E=p&S,D=l.length,L=u.length;if(D!=L&&!(E&&L>D))return!1;var $=F.get(l),K=F.get(u);if($&&K)return $==u&&K==l;var q=-1,te=!0,de=p&R?new Rn:i;for(F.set(l,u),F.set(u,l);++q<D;){var me=l[q],Me=u[q];if(m)var Ce=E?m(Me,me,q,u,l,F):m(me,Me,q,l,u,F);if(Ce!==i){if(Ce)continue;te=!1;break}if(de){if(!Qu(u,function(Oe,Be){if(!zr(de,Be)&&(me===Oe||w(me,Oe,p,m,F)))return de.push(Be)})){te=!1;break}}else if(!(me===Me||w(me,Me,p,m,F))){te=!1;break}}return F.delete(l),F.delete(u),te}function P2(l,u,p,m,w,F,E){switch(p){case uo:if(l.byteLength!=u.byteLength||l.byteOffset!=u.byteOffset)return!1;l=l.buffer,u=u.buffer;case Wr:return!(l.byteLength!=u.byteLength||!F(new Aa(l),new Aa(u)));case Or:case Vr:case Nr:return ki(+l,+u);case ma:return l.name==u.name&&l.message==u.message;case Br:case Gr:return l==u+"";case Di:var D=sh;case Ti:var L=m&S;if(D||(D=Fa),l.size!=u.size&&!L)return!1;var $=E.get(l);if($)return $==u;m|=R,E.set(l,u);var K=Bv(D(l),D(u),m,w,F,E);return E.delete(l),K;case va:if(Zr)return Zr.call(l)==Zr.call(u)}return!1}function D2(l,u,p,m,w,F){var E=p&S,D=Dh(l),L=D.length,$=Dh(u),K=$.length;if(L!=K&&!E)return!1;for(var q=L;q--;){var te=D[q];if(!(E?te in u:$e.call(u,te)))return!1}var de=F.get(l),me=F.get(u);if(de&&me)return de==u&&me==l;var Me=!0;F.set(l,u),F.set(u,l);for(var Ce=E;++q<L;){te=D[q];var Oe=l[te],Be=u[te];if(m)var ei=E?m(Be,Oe,te,u,l,F):m(Oe,Be,te,l,u,F);if(!(ei===i?Oe===Be||w(Oe,Be,p,m,F):ei)){Me=!1;break}Ce||(Ce=te=="constructor")}if(Me&&!Ce){var _t=l.constructor,ti=u.constructor;_t!=ti&&"constructor"in l&&"constructor"in u&&!(typeof _t=="function"&&_t instanceof _t&&typeof ti=="function"&&ti instanceof ti)&&(Me=!1)}return F.delete(l),F.delete(u),Me}function hs(l){return Oh($v(l,i,ew),l+"")}function Dh(l){return ov(l,pt,kh)}function Th(l){return ov(l,zt,Gv)}var Ah=Oa?function(l){return Oa.get(l)}:qh;function Ya(l){for(var u=l.name+"",p=wo[u],m=$e.call(wo,u)?p.length:0;m--;){var w=p[m],F=w.func;if(F==null||F==l)return w.name}return u}function Ro(l){var u=$e.call(b,"placeholder")?b:l;return u.placeholder}function fe(){var l=b.iteratee||jh;return l=l===jh?av:l,arguments.length?l(arguments[0],arguments[1]):l}function Qa(l,u){var p=l.__data__;return O2(u)?p[typeof u=="string"?"string":"hash"]:p.map}function Mh(l){for(var u=pt(l),p=u.length;p--;){var m=u[p],w=l[m];u[p]=[m,w,zv(w)]}return u}function En(l,u){var p=BW(l,u);return lv(p)?p:i}function T2(l){var u=$e.call(l,yn),p=l[yn];try{l[yn]=i;var m=!0}catch{}var w=Da.call(l);return m&&(u?l[yn]=p:delete l[yn]),w}var kh=oh?function(l){return l==null?[]:(l=Ze(l),zs(oh(l),function(u){return KC.call(l,u)}))}:Yh,Gv=oh?function(l){for(var u=[];l;)Us(u,kh(l)),l=Ma(l);return u}:Yh,xt=It;(rh&&xt(new rh(new ArrayBuffer(1)))!=uo||$r&&xt(new $r)!=Di||lh&&xt(lh.resolve())!=iC||vo&&xt(new vo)!=Ti||Kr&&xt(new Kr)!=Hr)&&(xt=function(l){var u=It(l),p=u==ls?l.constructor:i,m=p?Pn(p):"";if(m)switch(m){case uz:return uo;case hz:return Di;case pz:return iC;case gz:return Ti;case fz:return Hr}return u});function A2(l,u,p){for(var m=-1,w=p.length;++m<w;){var F=p[m],E=F.size;switch(F.type){case"drop":l+=E;break;case"dropRight":u-=E;break;case"take":u=Ft(u,l+E);break;case"takeRight":l=ct(l,u-E);break}}return{start:l,end:u}}function M2(l){var u=l.match(VH);return u?u[1].split(NH):[]}function Hv(l,u,p){u=qs(u,l);for(var m=-1,w=u.length,F=!1;++m<w;){var E=Zi(u[m]);if(!(F=l!=null&&p(l,E)))break;l=l[E]}return F||++m!=w?F:(w=l==null?0:l.length,!!w&&nc(w)&&ps(E,w)&&(Re(l)||Dn(l)))}function k2(l){var u=l.length,p=new l.constructor(u);return u&&typeof l[0]=="string"&&$e.call(l,"index")&&(p.index=l.index,p.input=l.input),p}function Wv(l){return typeof l.constructor=="function"&&!tl(l)?So(Ma(l)):{}}function I2(l,u,p){var m=l.constructor;switch(u){case Wr:return xh(l);case Or:case Vr:return new m(+l);case uo:return m2(l,p);case Mu:case ku:case Iu:case Lu:case _u:case Ou:case Vu:case Nu:case Bu:return Fv(l,p);case Di:return new m;case Nr:case Gr:return new m(l);case Br:return C2(l);case Ti:return new m;case va:return v2(l)}}function L2(l,u){var p=u.length;if(!p)return l;var m=p-1;return u[m]=(p>1?"& ":"")+u[m],u=u.join(p>2?", ":" "),l.replace(OH,`{
230
+ /* [wrapped with `+u+`] */
231
+ `)}function _2(l){return Re(l)||Dn(l)||!!(jC&&l&&l[jC])}function ps(l,u){var p=typeof l;return u=u??_e,!!u&&(p=="number"||p!="symbol"&&jH.test(l))&&l>-1&&l%1==0&&l<u}function Lt(l,u,p){if(!it(p))return!1;var m=typeof u;return(m=="number"?Wt(p)&&ps(u,p.length):m=="string"&&u in p)?ki(p[u],l):!1}function Ih(l,u){if(Re(l))return!1;var p=typeof l;return p=="number"||p=="symbol"||p=="boolean"||l==null||Jt(l)?!0:kH.test(l)||!MH.test(l)||u!=null&&l in Ze(u)}function O2(l){var u=typeof l;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?l!=="__proto__":l===null}function Lh(l){var u=Ya(l),p=b[u];if(typeof p!="function"||!(u in Ne.prototype))return!1;if(l===p)return!0;var m=Ah(p);return!!m&&l===m[0]}function V2(l){return!!zC&&zC in l}var N2=Ea?gs:Qh;function tl(l){var u=l&&l.constructor,p=typeof u=="function"&&u.prototype||Co;return l===p}function zv(l){return l===l&&!it(l)}function Uv(l,u){return function(p){return p==null?!1:p[l]===u&&(u!==i||l in Ze(p))}}function B2(l){var u=ic(l,function(m){return p.size===h&&p.clear(),m}),p=u.cache;return u}function G2(l,u){var p=l[1],m=u[1],w=p|m,F=w<(y|x|O),E=m==O&&p==T||m==O&&p==M&&l[7].length<=u[8]||m==(O|M)&&u[7].length<=u[8]&&p==T;if(!(F||E))return l;m&y&&(l[2]=u[2],w|=p&y?0:P);var D=u[3];if(D){var L=l[3];l[3]=L?Ev(L,D,u[4]):D,l[4]=L?$s(l[3],g):u[4]}return D=u[5],D&&(L=l[5],l[5]=L?Pv(L,D,u[6]):D,l[6]=L?$s(l[5],g):u[6]),D=u[7],D&&(l[7]=D),m&O&&(l[8]=l[8]==null?u[8]:Ft(l[8],u[8])),l[9]==null&&(l[9]=u[9]),l[0]=u[0],l[1]=w,l}function H2(l){var u=[];if(l!=null)for(var p in Ze(l))u.push(p);return u}function W2(l){return Da.call(l)}function $v(l,u,p){return u=ct(u===i?l.length-1:u,0),function(){for(var m=arguments,w=-1,F=ct(m.length-u,0),E=G(F);++w<F;)E[w]=m[u+w];w=-1;for(var D=G(u+1);++w<u;)D[w]=m[w];return D[u]=p(E),Yt(l,this,D)}}function Kv(l,u){return u.length<2?l:xn(l,pi(u,0,-1))}function z2(l,u){for(var p=l.length,m=Ft(u.length,p),w=Ht(l);m--;){var F=u[m];l[m]=ps(F,p)?w[F]:i}return l}function _h(l,u){if(!(u==="constructor"&&typeof l[u]=="function")&&u!="__proto__")return l[u]}var jv=qv(mv),il=nz||function(l,u){return ft.setTimeout(l,u)},Oh=qv(h2);function Zv(l,u,p){var m=u+"";return Oh(l,L2(m,U2(M2(m),p)))}function qv(l){var u=0,p=0;return function(){var m=az(),w=ie-(m-p);if(p=m,w>0){if(++u>=Z)return arguments[0]}else u=0;return l.apply(i,arguments)}}function Xa(l,u){var p=-1,m=l.length,w=m-1;for(u=u===i?m:u;++p<u;){var F=vh(p,w),E=l[F];l[F]=l[p],l[p]=E}return l.length=u,l}var Yv=B2(function(l){var u=[];return l.charCodeAt(0)===46&&u.push(""),l.replace(IH,function(p,m,w,F){u.push(w?F.replace(HH,"$1"):m||p)}),u});function Zi(l){if(typeof l=="string"||Jt(l))return l;var u=l+"";return u=="0"&&1/l==-Ee?"-0":u}function Pn(l){if(l!=null){try{return Pa.call(l)}catch{}try{return l+""}catch{}}return""}function U2(l,u){return ci(CH,function(p){var m="_."+p[0];u&p[1]&&!ba(l,m)&&l.push(m)}),l.sort()}function Qv(l){if(l instanceof Ne)return l.clone();var u=new ui(l.__wrapped__,l.__chain__);return u.__actions__=Ht(l.__actions__),u.__index__=l.__index__,u.__values__=l.__values__,u}function $2(l,u,p){(p?Lt(l,u,p):u===i)?u=1:u=ct(De(u),0);var m=l==null?0:l.length;if(!m||u<1)return[];for(var w=0,F=0,E=G(La(m/u));w<m;)E[F++]=pi(l,w,w+=u);return E}function K2(l){for(var u=-1,p=l==null?0:l.length,m=0,w=[];++u<p;){var F=l[u];F&&(w[m++]=F)}return w}function j2(){var l=arguments.length;if(!l)return[];for(var u=G(l-1),p=arguments[0],m=l;m--;)u[m-1]=arguments[m];return Us(Re(p)?Ht(p):[p],mt(u,1))}var Z2=Ie(function(l,u){return rt(l)?Yr(l,mt(u,1,rt,!0)):[]}),q2=Ie(function(l,u){var p=gi(u);return rt(p)&&(p=i),rt(l)?Yr(l,mt(u,1,rt,!0),fe(p,2)):[]}),Y2=Ie(function(l,u){var p=gi(u);return rt(p)&&(p=i),rt(l)?Yr(l,mt(u,1,rt,!0),i,p):[]});function Q2(l,u,p){var m=l==null?0:l.length;return m?(u=p||u===i?1:De(u),pi(l,u<0?0:u,m)):[]}function X2(l,u,p){var m=l==null?0:l.length;return m?(u=p||u===i?1:De(u),u=m-u,pi(l,0,u<0?0:u)):[]}function J2(l,u){return l&&l.length?Ua(l,fe(u,3),!0,!0):[]}function eU(l,u){return l&&l.length?Ua(l,fe(u,3),!0):[]}function tU(l,u,p,m){var w=l==null?0:l.length;return w?(p&&typeof p!="number"&&Lt(l,u,p)&&(p=0,m=w),jz(l,u,p,m)):[]}function Xv(l,u,p){var m=l==null?0:l.length;if(!m)return-1;var w=p==null?0:De(p);return w<0&&(w=ct(m+w,0)),Ra(l,fe(u,3),w)}function Jv(l,u,p){var m=l==null?0:l.length;if(!m)return-1;var w=m-1;return p!==i&&(w=De(p),w=p<0?ct(m+w,0):Ft(w,m-1)),Ra(l,fe(u,3),w,!0)}function ew(l){var u=l==null?0:l.length;return u?mt(l,1):[]}function iU(l){var u=l==null?0:l.length;return u?mt(l,Ee):[]}function sU(l,u){var p=l==null?0:l.length;return p?(u=u===i?1:De(u),mt(l,u)):[]}function nU(l){for(var u=-1,p=l==null?0:l.length,m={};++u<p;){var w=l[u];m[w[0]]=w[1]}return m}function tw(l){return l&&l.length?l[0]:i}function oU(l,u,p){var m=l==null?0:l.length;if(!m)return-1;var w=p==null?0:De(p);return w<0&&(w=ct(m+w,0)),po(l,u,w)}function rU(l){var u=l==null?0:l.length;return u?pi(l,0,-1):[]}var lU=Ie(function(l){var u=Je(l,Rh);return u.length&&u[0]===l[0]?ph(u):[]}),aU=Ie(function(l){var u=gi(l),p=Je(l,Rh);return u===gi(p)?u=i:p.pop(),p.length&&p[0]===l[0]?ph(p,fe(u,2)):[]}),cU=Ie(function(l){var u=gi(l),p=Je(l,Rh);return u=typeof u=="function"?u:i,u&&p.pop(),p.length&&p[0]===l[0]?ph(p,i,u):[]});function dU(l,u){return l==null?"":rz.call(l,u)}function gi(l){var u=l==null?0:l.length;return u?l[u-1]:i}function uU(l,u,p){var m=l==null?0:l.length;if(!m)return-1;var w=m;return p!==i&&(w=De(p),w=w<0?ct(m+w,0):Ft(w,m-1)),u===u?UW(l,u,w):Ra(l,_C,w,!0)}function hU(l,u){return l&&l.length?hv(l,De(u)):i}var pU=Ie(iw);function iw(l,u){return l&&l.length&&u&&u.length?Ch(l,u):l}function gU(l,u,p){return l&&l.length&&u&&u.length?Ch(l,u,fe(p,2)):l}function fU(l,u,p){return l&&l.length&&u&&u.length?Ch(l,u,i,p):l}var mU=hs(function(l,u){var p=l==null?0:l.length,m=ch(l,u);return fv(l,Je(u,function(w){return ps(w,p)?+w:w}).sort(xv)),m});function CU(l,u){var p=[];if(!(l&&l.length))return p;var m=-1,w=[],F=l.length;for(u=fe(u,3);++m<F;){var E=l[m];u(E,m,l)&&(p.push(E),w.push(m))}return fv(l,w),p}function Vh(l){return l==null?l:dz.call(l)}function vU(l,u,p){var m=l==null?0:l.length;return m?(p&&typeof p!="number"&&Lt(l,u,p)?(u=0,p=m):(u=u==null?0:De(u),p=p===i?m:De(p)),pi(l,u,p)):[]}function wU(l,u){return za(l,u)}function SU(l,u,p){return Sh(l,u,fe(p,2))}function yU(l,u){var p=l==null?0:l.length;if(p){var m=za(l,u);if(m<p&&ki(l[m],u))return m}return-1}function bU(l,u){return za(l,u,!0)}function RU(l,u,p){return Sh(l,u,fe(p,2),!0)}function FU(l,u){var p=l==null?0:l.length;if(p){var m=za(l,u,!0)-1;if(ki(l[m],u))return m}return-1}function xU(l){return l&&l.length?Cv(l):[]}function EU(l,u){return l&&l.length?Cv(l,fe(u,2)):[]}function PU(l){var u=l==null?0:l.length;return u?pi(l,1,u):[]}function DU(l,u,p){return l&&l.length?(u=p||u===i?1:De(u),pi(l,0,u<0?0:u)):[]}function TU(l,u,p){var m=l==null?0:l.length;return m?(u=p||u===i?1:De(u),u=m-u,pi(l,u<0?0:u,m)):[]}function AU(l,u){return l&&l.length?Ua(l,fe(u,3),!1,!0):[]}function MU(l,u){return l&&l.length?Ua(l,fe(u,3)):[]}var kU=Ie(function(l){return Zs(mt(l,1,rt,!0))}),IU=Ie(function(l){var u=gi(l);return rt(u)&&(u=i),Zs(mt(l,1,rt,!0),fe(u,2))}),LU=Ie(function(l){var u=gi(l);return u=typeof u=="function"?u:i,Zs(mt(l,1,rt,!0),i,u)});function _U(l){return l&&l.length?Zs(l):[]}function OU(l,u){return l&&l.length?Zs(l,fe(u,2)):[]}function VU(l,u){return u=typeof u=="function"?u:i,l&&l.length?Zs(l,i,u):[]}function Nh(l){if(!(l&&l.length))return[];var u=0;return l=zs(l,function(p){if(rt(p))return u=ct(p.length,u),!0}),th(u,function(p){return Je(l,Xu(p))})}function sw(l,u){if(!(l&&l.length))return[];var p=Nh(l);return u==null?p:Je(p,function(m){return Yt(u,i,m)})}var NU=Ie(function(l,u){return rt(l)?Yr(l,u):[]}),BU=Ie(function(l){return bh(zs(l,rt))}),GU=Ie(function(l){var u=gi(l);return rt(u)&&(u=i),bh(zs(l,rt),fe(u,2))}),HU=Ie(function(l){var u=gi(l);return u=typeof u=="function"?u:i,bh(zs(l,rt),i,u)}),WU=Ie(Nh);function zU(l,u){return yv(l||[],u||[],qr)}function UU(l,u){return yv(l||[],u||[],Jr)}var $U=Ie(function(l){var u=l.length,p=u>1?l[u-1]:i;return p=typeof p=="function"?(l.pop(),p):i,sw(l,p)});function nw(l){var u=b(l);return u.__chain__=!0,u}function KU(l,u){return u(l),l}function Ja(l,u){return u(l)}var jU=hs(function(l){var u=l.length,p=u?l[0]:0,m=this.__wrapped__,w=function(F){return ch(F,l)};return u>1||this.__actions__.length||!(m instanceof Ne)||!ps(p)?this.thru(w):(m=m.slice(p,+p+(u?1:0)),m.__actions__.push({func:Ja,args:[w],thisArg:i}),new ui(m,this.__chain__).thru(function(F){return u&&!F.length&&F.push(i),F}))});function ZU(){return nw(this)}function qU(){return new ui(this.value(),this.__chain__)}function YU(){this.__values__===i&&(this.__values__=vw(this.value()));var l=this.__index__>=this.__values__.length,u=l?i:this.__values__[this.__index__++];return{done:l,value:u}}function QU(){return this}function XU(l){for(var u,p=this;p instanceof Na;){var m=Qv(p);m.__index__=0,m.__values__=i,u?w.__wrapped__=m:u=m;var w=m;p=p.__wrapped__}return w.__wrapped__=l,u}function JU(){var l=this.__wrapped__;if(l instanceof Ne){var u=l;return this.__actions__.length&&(u=new Ne(this)),u=u.reverse(),u.__actions__.push({func:Ja,args:[Vh],thisArg:i}),new ui(u,this.__chain__)}return this.thru(Vh)}function e$(){return Sv(this.__wrapped__,this.__actions__)}var t$=$a(function(l,u,p){$e.call(l,p)?++l[p]:ds(l,p,1)});function i$(l,u,p){var m=Re(l)?IC:Kz;return p&&Lt(l,u,p)&&(u=i),m(l,fe(u,3))}function s$(l,u){var p=Re(l)?zs:sv;return p(l,fe(u,3))}var n$=Mv(Xv),o$=Mv(Jv);function r$(l,u){return mt(ec(l,u),1)}function l$(l,u){return mt(ec(l,u),Ee)}function a$(l,u,p){return p=p===i?1:De(p),mt(ec(l,u),p)}function ow(l,u){var p=Re(l)?ci:js;return p(l,fe(u,3))}function rw(l,u){var p=Re(l)?PW:iv;return p(l,fe(u,3))}var c$=$a(function(l,u,p){$e.call(l,p)?l[p].push(u):ds(l,p,[u])});function d$(l,u,p,m){l=Wt(l)?l:xo(l),p=p&&!m?De(p):0;var w=l.length;return p<0&&(p=ct(w+p,0)),oc(l)?p<=w&&l.indexOf(u,p)>-1:!!w&&po(l,u,p)>-1}var u$=Ie(function(l,u,p){var m=-1,w=typeof u=="function",F=Wt(l)?G(l.length):[];return js(l,function(E){F[++m]=w?Yt(u,E,p):Qr(E,u,p)}),F}),h$=$a(function(l,u,p){ds(l,p,u)});function ec(l,u){var p=Re(l)?Je:cv;return p(l,fe(u,3))}function p$(l,u,p,m){return l==null?[]:(Re(u)||(u=u==null?[]:[u]),p=m?i:p,Re(p)||(p=p==null?[]:[p]),pv(l,u,p))}var g$=$a(function(l,u,p){l[p?0:1].push(u)},function(){return[[],[]]});function f$(l,u,p){var m=Re(l)?Yu:VC,w=arguments.length<3;return m(l,fe(u,4),p,w,js)}function m$(l,u,p){var m=Re(l)?DW:VC,w=arguments.length<3;return m(l,fe(u,4),p,w,iv)}function C$(l,u){var p=Re(l)?zs:sv;return p(l,sc(fe(u,3)))}function v$(l){var u=Re(l)?XC:d2;return u(l)}function w$(l,u,p){(p?Lt(l,u,p):u===i)?u=1:u=De(u);var m=Re(l)?Hz:u2;return m(l,u)}function S$(l){var u=Re(l)?Wz:p2;return u(l)}function y$(l){if(l==null)return 0;if(Wt(l))return oc(l)?fo(l):l.length;var u=xt(l);return u==Di||u==Ti?l.size:fh(l).length}function b$(l,u,p){var m=Re(l)?Qu:g2;return p&&Lt(l,u,p)&&(u=i),m(l,fe(u,3))}var R$=Ie(function(l,u){if(l==null)return[];var p=u.length;return p>1&&Lt(l,u[0],u[1])?u=[]:p>2&&Lt(u[0],u[1],u[2])&&(u=[u[0]]),pv(l,mt(u,1),[])}),tc=sz||function(){return ft.Date.now()};function F$(l,u){if(typeof u!="function")throw new di(r);return l=De(l),function(){if(--l<1)return u.apply(this,arguments)}}function lw(l,u,p){return u=p?i:u,u=l&&u==null?l.length:u,us(l,O,i,i,i,i,u)}function aw(l,u){var p;if(typeof u!="function")throw new di(r);return l=De(l),function(){return--l>0&&(p=u.apply(this,arguments)),l<=1&&(u=i),p}}var Bh=Ie(function(l,u,p){var m=y;if(p.length){var w=$s(p,Ro(Bh));m|=V}return us(l,m,u,p,w)}),cw=Ie(function(l,u,p){var m=y|x;if(p.length){var w=$s(p,Ro(cw));m|=V}return us(u,m,l,p,w)});function dw(l,u,p){u=p?i:u;var m=us(l,T,i,i,i,i,i,u);return m.placeholder=dw.placeholder,m}function uw(l,u,p){u=p?i:u;var m=us(l,I,i,i,i,i,i,u);return m.placeholder=uw.placeholder,m}function hw(l,u,p){var m,w,F,E,D,L,$=0,K=!1,q=!1,te=!0;if(typeof l!="function")throw new di(r);u=fi(u)||0,it(p)&&(K=!!p.leading,q="maxWait"in p,F=q?ct(fi(p.maxWait)||0,u):F,te="trailing"in p?!!p.trailing:te);function de(lt){var Ii=m,ms=w;return m=w=i,$=lt,E=l.apply(ms,Ii),E}function me(lt){return $=lt,D=il(Oe,u),K?de(lt):E}function Me(lt){var Ii=lt-L,ms=lt-$,Mw=u-Ii;return q?Ft(Mw,F-ms):Mw}function Ce(lt){var Ii=lt-L,ms=lt-$;return L===i||Ii>=u||Ii<0||q&&ms>=F}function Oe(){var lt=tc();if(Ce(lt))return Be(lt);D=il(Oe,Me(lt))}function Be(lt){return D=i,te&&m?de(lt):(m=w=i,E)}function ei(){D!==i&&bv(D),$=0,m=L=w=D=i}function _t(){return D===i?E:Be(tc())}function ti(){var lt=tc(),Ii=Ce(lt);if(m=arguments,w=this,L=lt,Ii){if(D===i)return me(L);if(q)return bv(D),D=il(Oe,u),de(L)}return D===i&&(D=il(Oe,u)),E}return ti.cancel=ei,ti.flush=_t,ti}var x$=Ie(function(l,u){return tv(l,1,u)}),E$=Ie(function(l,u,p){return tv(l,fi(u)||0,p)});function P$(l){return us(l,A)}function ic(l,u){if(typeof l!="function"||u!=null&&typeof u!="function")throw new di(r);var p=function(){var m=arguments,w=u?u.apply(this,m):m[0],F=p.cache;if(F.has(w))return F.get(w);var E=l.apply(this,m);return p.cache=F.set(w,E)||F,E};return p.cache=new(ic.Cache||cs),p}ic.Cache=cs;function sc(l){if(typeof l!="function")throw new di(r);return function(){var u=arguments;switch(u.length){case 0:return!l.call(this);case 1:return!l.call(this,u[0]);case 2:return!l.call(this,u[0],u[1]);case 3:return!l.call(this,u[0],u[1],u[2])}return!l.apply(this,u)}}function D$(l){return aw(2,l)}var T$=f2(function(l,u){u=u.length==1&&Re(u[0])?Je(u[0],Qt(fe())):Je(mt(u,1),Qt(fe()));var p=u.length;return Ie(function(m){for(var w=-1,F=Ft(m.length,p);++w<F;)m[w]=u[w].call(this,m[w]);return Yt(l,this,m)})}),Gh=Ie(function(l,u){var p=$s(u,Ro(Gh));return us(l,V,i,u,p)}),pw=Ie(function(l,u){var p=$s(u,Ro(pw));return us(l,_,i,u,p)}),A$=hs(function(l,u){return us(l,M,i,i,i,u)});function M$(l,u){if(typeof l!="function")throw new di(r);return u=u===i?u:De(u),Ie(l,u)}function k$(l,u){if(typeof l!="function")throw new di(r);return u=u==null?0:ct(De(u),0),Ie(function(p){var m=p[u],w=Ys(p,0,u);return m&&Us(w,m),Yt(l,this,w)})}function I$(l,u,p){var m=!0,w=!0;if(typeof l!="function")throw new di(r);return it(p)&&(m="leading"in p?!!p.leading:m,w="trailing"in p?!!p.trailing:w),hw(l,u,{leading:m,maxWait:u,trailing:w})}function L$(l){return lw(l,1)}function _$(l,u){return Gh(Fh(u),l)}function O$(){if(!arguments.length)return[];var l=arguments[0];return Re(l)?l:[l]}function V$(l){return hi(l,v)}function N$(l,u){return u=typeof u=="function"?u:i,hi(l,v,u)}function B$(l){return hi(l,f|v)}function G$(l,u){return u=typeof u=="function"?u:i,hi(l,f|v,u)}function H$(l,u){return u==null||ev(l,u,pt(u))}function ki(l,u){return l===u||l!==l&&u!==u}var W$=qa(hh),z$=qa(function(l,u){return l>=u}),Dn=rv(function(){return arguments}())?rv:function(l){return nt(l)&&$e.call(l,"callee")&&!KC.call(l,"callee")},Re=G.isArray,U$=PC?Qt(PC):Xz;function Wt(l){return l!=null&&nc(l.length)&&!gs(l)}function rt(l){return nt(l)&&Wt(l)}function $$(l){return l===!0||l===!1||nt(l)&&It(l)==Or}var Qs=oz||Qh,K$=DC?Qt(DC):Jz;function j$(l){return nt(l)&&l.nodeType===1&&!sl(l)}function Z$(l){if(l==null)return!0;if(Wt(l)&&(Re(l)||typeof l=="string"||typeof l.splice=="function"||Qs(l)||Fo(l)||Dn(l)))return!l.length;var u=xt(l);if(u==Di||u==Ti)return!l.size;if(tl(l))return!fh(l).length;for(var p in l)if($e.call(l,p))return!1;return!0}function q$(l,u){return Xr(l,u)}function Y$(l,u,p){p=typeof p=="function"?p:i;var m=p?p(l,u):i;return m===i?Xr(l,u,i,p):!!m}function Hh(l){if(!nt(l))return!1;var u=It(l);return u==ma||u==wH||typeof l.message=="string"&&typeof l.name=="string"&&!sl(l)}function Q$(l){return typeof l=="number"&&ZC(l)}function gs(l){if(!it(l))return!1;var u=It(l);return u==Ca||u==tC||u==vH||u==yH}function gw(l){return typeof l=="number"&&l==De(l)}function nc(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=_e}function it(l){var u=typeof l;return l!=null&&(u=="object"||u=="function")}function nt(l){return l!=null&&typeof l=="object"}var fw=TC?Qt(TC):t2;function X$(l,u){return l===u||gh(l,u,Mh(u))}function J$(l,u,p){return p=typeof p=="function"?p:i,gh(l,u,Mh(u),p)}function e3(l){return mw(l)&&l!=+l}function t3(l){if(N2(l))throw new be(o);return lv(l)}function i3(l){return l===null}function s3(l){return l==null}function mw(l){return typeof l=="number"||nt(l)&&It(l)==Nr}function sl(l){if(!nt(l)||It(l)!=ls)return!1;var u=Ma(l);if(u===null)return!0;var p=$e.call(u,"constructor")&&u.constructor;return typeof p=="function"&&p instanceof p&&Pa.call(p)==JW}var Wh=AC?Qt(AC):i2;function n3(l){return gw(l)&&l>=-_e&&l<=_e}var Cw=MC?Qt(MC):s2;function oc(l){return typeof l=="string"||!Re(l)&&nt(l)&&It(l)==Gr}function Jt(l){return typeof l=="symbol"||nt(l)&&It(l)==va}var Fo=kC?Qt(kC):n2;function o3(l){return l===i}function r3(l){return nt(l)&&xt(l)==Hr}function l3(l){return nt(l)&&It(l)==RH}var a3=qa(mh),c3=qa(function(l,u){return l<=u});function vw(l){if(!l)return[];if(Wt(l))return oc(l)?Ai(l):Ht(l);if(Ur&&l[Ur])return HW(l[Ur]());var u=xt(l),p=u==Di?sh:u==Ti?Fa:xo;return p(l)}function fs(l){if(!l)return l===0?l:0;if(l=fi(l),l===Ee||l===-Ee){var u=l<0?-1:1;return u*wn}return l===l?l:0}function De(l){var u=fs(l),p=u%1;return u===u?p?u-p:u:0}function ww(l){return l?Fn(De(l),0,Gt):0}function fi(l){if(typeof l=="number")return l;if(Jt(l))return Ws;if(it(l)){var u=typeof l.valueOf=="function"?l.valueOf():l;l=it(u)?u+"":u}if(typeof l!="string")return l===0?l:+l;l=NC(l);var p=UH.test(l);return p||KH.test(l)?FW(l.slice(2),p?2:8):zH.test(l)?Ws:+l}function Sw(l){return ji(l,zt(l))}function d3(l){return l?Fn(De(l),-_e,_e):l===0?l:0}function Ue(l){return l==null?"":Xt(l)}var u3=yo(function(l,u){if(tl(u)||Wt(u)){ji(u,pt(u),l);return}for(var p in u)$e.call(u,p)&&qr(l,p,u[p])}),yw=yo(function(l,u){ji(u,zt(u),l)}),rc=yo(function(l,u,p,m){ji(u,zt(u),l,m)}),h3=yo(function(l,u,p,m){ji(u,pt(u),l,m)}),p3=hs(ch);function g3(l,u){var p=So(l);return u==null?p:JC(p,u)}var f3=Ie(function(l,u){l=Ze(l);var p=-1,m=u.length,w=m>2?u[2]:i;for(w&&Lt(u[0],u[1],w)&&(m=1);++p<m;)for(var F=u[p],E=zt(F),D=-1,L=E.length;++D<L;){var $=E[D],K=l[$];(K===i||ki(K,Co[$])&&!$e.call(l,$))&&(l[$]=F[$])}return l}),m3=Ie(function(l){return l.push(i,Nv),Yt(bw,i,l)});function C3(l,u){return LC(l,fe(u,3),Ki)}function v3(l,u){return LC(l,fe(u,3),uh)}function w3(l,u){return l==null?l:dh(l,fe(u,3),zt)}function S3(l,u){return l==null?l:nv(l,fe(u,3),zt)}function y3(l,u){return l&&Ki(l,fe(u,3))}function b3(l,u){return l&&uh(l,fe(u,3))}function R3(l){return l==null?[]:Ha(l,pt(l))}function F3(l){return l==null?[]:Ha(l,zt(l))}function zh(l,u,p){var m=l==null?i:xn(l,u);return m===i?p:m}function x3(l,u){return l!=null&&Hv(l,u,Zz)}function Uh(l,u){return l!=null&&Hv(l,u,qz)}var E3=Iv(function(l,u,p){u!=null&&typeof u.toString!="function"&&(u=Da.call(u)),l[u]=p},Kh(Ut)),P3=Iv(function(l,u,p){u!=null&&typeof u.toString!="function"&&(u=Da.call(u)),$e.call(l,u)?l[u].push(p):l[u]=[p]},fe),D3=Ie(Qr);function pt(l){return Wt(l)?QC(l):fh(l)}function zt(l){return Wt(l)?QC(l,!0):o2(l)}function T3(l,u){var p={};return u=fe(u,3),Ki(l,function(m,w,F){ds(p,u(m,w,F),m)}),p}function A3(l,u){var p={};return u=fe(u,3),Ki(l,function(m,w,F){ds(p,w,u(m,w,F))}),p}var M3=yo(function(l,u,p){Wa(l,u,p)}),bw=yo(function(l,u,p,m){Wa(l,u,p,m)}),k3=hs(function(l,u){var p={};if(l==null)return p;var m=!1;u=Je(u,function(F){return F=qs(F,l),m||(m=F.length>1),F}),ji(l,Th(l),p),m&&(p=hi(p,f|C|v,E2));for(var w=u.length;w--;)yh(p,u[w]);return p});function I3(l,u){return Rw(l,sc(fe(u)))}var L3=hs(function(l,u){return l==null?{}:l2(l,u)});function Rw(l,u){if(l==null)return{};var p=Je(Th(l),function(m){return[m]});return u=fe(u),gv(l,p,function(m,w){return u(m,w[0])})}function _3(l,u,p){u=qs(u,l);var m=-1,w=u.length;for(w||(w=1,l=i);++m<w;){var F=l==null?i:l[Zi(u[m])];F===i&&(m=w,F=p),l=gs(F)?F.call(l):F}return l}function O3(l,u,p){return l==null?l:Jr(l,u,p)}function V3(l,u,p,m){return m=typeof m=="function"?m:i,l==null?l:Jr(l,u,p,m)}var Fw=Ov(pt),xw=Ov(zt);function N3(l,u,p){var m=Re(l),w=m||Qs(l)||Fo(l);if(u=fe(u,4),p==null){var F=l&&l.constructor;w?p=m?new F:[]:it(l)?p=gs(F)?So(Ma(l)):{}:p={}}return(w?ci:Ki)(l,function(E,D,L){return u(p,E,D,L)}),p}function B3(l,u){return l==null?!0:yh(l,u)}function G3(l,u,p){return l==null?l:wv(l,u,Fh(p))}function H3(l,u,p,m){return m=typeof m=="function"?m:i,l==null?l:wv(l,u,Fh(p),m)}function xo(l){return l==null?[]:ih(l,pt(l))}function W3(l){return l==null?[]:ih(l,zt(l))}function z3(l,u,p){return p===i&&(p=u,u=i),p!==i&&(p=fi(p),p=p===p?p:0),u!==i&&(u=fi(u),u=u===u?u:0),Fn(fi(l),u,p)}function U3(l,u,p){return u=fs(u),p===i?(p=u,u=0):p=fs(p),l=fi(l),Yz(l,u,p)}function $3(l,u,p){if(p&&typeof p!="boolean"&&Lt(l,u,p)&&(u=p=i),p===i&&(typeof u=="boolean"?(p=u,u=i):typeof l=="boolean"&&(p=l,l=i)),l===i&&u===i?(l=0,u=1):(l=fs(l),u===i?(u=l,l=0):u=fs(u)),l>u){var m=l;l=u,u=m}if(p||l%1||u%1){var w=qC();return Ft(l+w*(u-l+RW("1e-"+((w+"").length-1))),u)}return vh(l,u)}var K3=bo(function(l,u,p){return u=u.toLowerCase(),l+(p?Ew(u):u)});function Ew(l){return $h(Ue(l).toLowerCase())}function Pw(l){return l=Ue(l),l&&l.replace(ZH,OW).replace(pW,"")}function j3(l,u,p){l=Ue(l),u=Xt(u);var m=l.length;p=p===i?m:Fn(De(p),0,m);var w=p;return p-=u.length,p>=0&&l.slice(p,w)==u}function Z3(l){return l=Ue(l),l&&DH.test(l)?l.replace(nC,VW):l}function q3(l){return l=Ue(l),l&&LH.test(l)?l.replace(Gu,"\\$&"):l}var Y3=bo(function(l,u,p){return l+(p?"-":"")+u.toLowerCase()}),Q3=bo(function(l,u,p){return l+(p?" ":"")+u.toLowerCase()}),X3=Av("toLowerCase");function J3(l,u,p){l=Ue(l),u=De(u);var m=u?fo(l):0;if(!u||m>=u)return l;var w=(u-m)/2;return Za(_a(w),p)+l+Za(La(w),p)}function eK(l,u,p){l=Ue(l),u=De(u);var m=u?fo(l):0;return u&&m<u?l+Za(u-m,p):l}function tK(l,u,p){l=Ue(l),u=De(u);var m=u?fo(l):0;return u&&m<u?Za(u-m,p)+l:l}function iK(l,u,p){return p||u==null?u=0:u&&(u=+u),cz(Ue(l).replace(Hu,""),u||0)}function sK(l,u,p){return(p?Lt(l,u,p):u===i)?u=1:u=De(u),wh(Ue(l),u)}function nK(){var l=arguments,u=Ue(l[0]);return l.length<3?u:u.replace(l[1],l[2])}var oK=bo(function(l,u,p){return l+(p?"_":"")+u.toLowerCase()});function rK(l,u,p){return p&&typeof p!="number"&&Lt(l,u,p)&&(u=p=i),p=p===i?Gt:p>>>0,p?(l=Ue(l),l&&(typeof u=="string"||u!=null&&!Wh(u))&&(u=Xt(u),!u&&go(l))?Ys(Ai(l),0,p):l.split(u,p)):[]}var lK=bo(function(l,u,p){return l+(p?" ":"")+$h(u)});function aK(l,u,p){return l=Ue(l),p=p==null?0:Fn(De(p),0,l.length),u=Xt(u),l.slice(p,p+u.length)==u}function cK(l,u,p){var m=b.templateSettings;p&&Lt(l,u,p)&&(u=i),l=Ue(l),u=rc({},u,m,Vv);var w=rc({},u.imports,m.imports,Vv),F=pt(w),E=ih(w,F),D,L,$=0,K=u.interpolate||wa,q="__p += '",te=nh((u.escape||wa).source+"|"+K.source+"|"+(K===oC?WH:wa).source+"|"+(u.evaluate||wa).source+"|$","g"),de="//# sourceURL="+($e.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++vW+"]")+`
232
+ `;l.replace(te,function(Ce,Oe,Be,ei,_t,ti){return Be||(Be=ei),q+=l.slice($,ti).replace(qH,NW),Oe&&(D=!0,q+=`' +
233
+ __e(`+Oe+`) +
234
+ '`),_t&&(L=!0,q+=`';
235
+ `+_t+`;
236
+ __p += '`),Be&&(q+=`' +
237
+ ((__t = (`+Be+`)) == null ? '' : __t) +
238
+ '`),$=ti+Ce.length,Ce}),q+=`';
239
+ `;var me=$e.call(u,"variable")&&u.variable;if(!me)q=`with (obj) {
240
+ `+q+`
241
+ }
242
+ `;else if(GH.test(me))throw new be(a);q=(L?q.replace(FH,""):q).replace(xH,"$1").replace(EH,"$1;"),q="function("+(me||"obj")+`) {
243
+ `+(me?"":`obj || (obj = {});
244
+ `)+"var __t, __p = ''"+(D?", __e = _.escape":"")+(L?`, __j = Array.prototype.join;
245
+ function print() { __p += __j.call(arguments, '') }
246
+ `:`;
247
+ `)+q+`return __p
248
+ }`;var Me=Tw(function(){return ze(F,de+"return "+q).apply(i,E)});if(Me.source=q,Hh(Me))throw Me;return Me}function dK(l){return Ue(l).toLowerCase()}function uK(l){return Ue(l).toUpperCase()}function hK(l,u,p){if(l=Ue(l),l&&(p||u===i))return NC(l);if(!l||!(u=Xt(u)))return l;var m=Ai(l),w=Ai(u),F=BC(m,w),E=GC(m,w)+1;return Ys(m,F,E).join("")}function pK(l,u,p){if(l=Ue(l),l&&(p||u===i))return l.slice(0,WC(l)+1);if(!l||!(u=Xt(u)))return l;var m=Ai(l),w=GC(m,Ai(u))+1;return Ys(m,0,w).join("")}function gK(l,u,p){if(l=Ue(l),l&&(p||u===i))return l.replace(Hu,"");if(!l||!(u=Xt(u)))return l;var m=Ai(l),w=BC(m,Ai(u));return Ys(m,w).join("")}function fK(l,u){var p=z,m=H;if(it(u)){var w="separator"in u?u.separator:w;p="length"in u?De(u.length):p,m="omission"in u?Xt(u.omission):m}l=Ue(l);var F=l.length;if(go(l)){var E=Ai(l);F=E.length}if(p>=F)return l;var D=p-fo(m);if(D<1)return m;var L=E?Ys(E,0,D).join(""):l.slice(0,D);if(w===i)return L+m;if(E&&(D+=L.length-D),Wh(w)){if(l.slice(D).search(w)){var $,K=L;for(w.global||(w=nh(w.source,Ue(rC.exec(w))+"g")),w.lastIndex=0;$=w.exec(K);)var q=$.index;L=L.slice(0,q===i?D:q)}}else if(l.indexOf(Xt(w),D)!=D){var te=L.lastIndexOf(w);te>-1&&(L=L.slice(0,te))}return L+m}function mK(l){return l=Ue(l),l&&PH.test(l)?l.replace(sC,$W):l}var CK=bo(function(l,u,p){return l+(p?" ":"")+u.toUpperCase()}),$h=Av("toUpperCase");function Dw(l,u,p){return l=Ue(l),u=p?i:u,u===i?GW(l)?ZW(l):MW(l):l.match(u)||[]}var Tw=Ie(function(l,u){try{return Yt(l,i,u)}catch(p){return Hh(p)?p:new be(p)}}),vK=hs(function(l,u){return ci(u,function(p){p=Zi(p),ds(l,p,Bh(l[p],l))}),l});function wK(l){var u=l==null?0:l.length,p=fe();return l=u?Je(l,function(m){if(typeof m[1]!="function")throw new di(r);return[p(m[0]),m[1]]}):[],Ie(function(m){for(var w=-1;++w<u;){var F=l[w];if(Yt(F[0],this,m))return Yt(F[1],this,m)}})}function SK(l){return $z(hi(l,f))}function Kh(l){return function(){return l}}function yK(l,u){return l==null||l!==l?u:l}var bK=kv(),RK=kv(!0);function Ut(l){return l}function jh(l){return av(typeof l=="function"?l:hi(l,f))}function FK(l){return dv(hi(l,f))}function xK(l,u){return uv(l,hi(u,f))}var EK=Ie(function(l,u){return function(p){return Qr(p,l,u)}}),PK=Ie(function(l,u){return function(p){return Qr(l,p,u)}});function Zh(l,u,p){var m=pt(u),w=Ha(u,m);p==null&&!(it(u)&&(w.length||!m.length))&&(p=u,u=l,l=this,w=Ha(u,pt(u)));var F=!(it(p)&&"chain"in p)||!!p.chain,E=gs(l);return ci(w,function(D){var L=u[D];l[D]=L,E&&(l.prototype[D]=function(){var $=this.__chain__;if(F||$){var K=l(this.__wrapped__),q=K.__actions__=Ht(this.__actions__);return q.push({func:L,args:arguments,thisArg:l}),K.__chain__=$,K}return L.apply(l,Us([this.value()],arguments))})}),l}function DK(){return ft._===this&&(ft._=ez),this}function qh(){}function TK(l){return l=De(l),Ie(function(u){return hv(u,l)})}var AK=Eh(Je),MK=Eh(IC),kK=Eh(Qu);function Aw(l){return Ih(l)?Xu(Zi(l)):a2(l)}function IK(l){return function(u){return l==null?i:xn(l,u)}}var LK=Lv(),_K=Lv(!0);function Yh(){return[]}function Qh(){return!1}function OK(){return{}}function VK(){return""}function NK(){return!0}function BK(l,u){if(l=De(l),l<1||l>_e)return[];var p=Gt,m=Ft(l,Gt);u=fe(u),l-=Gt;for(var w=th(m,u);++p<l;)u(p);return w}function GK(l){return Re(l)?Je(l,Zi):Jt(l)?[l]:Ht(Yv(Ue(l)))}function HK(l){var u=++XW;return Ue(l)+u}var WK=ja(function(l,u){return l+u},0),zK=Ph("ceil"),UK=ja(function(l,u){return l/u},1),$K=Ph("floor");function KK(l){return l&&l.length?Ga(l,Ut,hh):i}function jK(l,u){return l&&l.length?Ga(l,fe(u,2),hh):i}function ZK(l){return OC(l,Ut)}function qK(l,u){return OC(l,fe(u,2))}function YK(l){return l&&l.length?Ga(l,Ut,mh):i}function QK(l,u){return l&&l.length?Ga(l,fe(u,2),mh):i}var XK=ja(function(l,u){return l*u},1),JK=Ph("round"),e4=ja(function(l,u){return l-u},0);function t4(l){return l&&l.length?eh(l,Ut):0}function i4(l,u){return l&&l.length?eh(l,fe(u,2)):0}return b.after=F$,b.ary=lw,b.assign=u3,b.assignIn=yw,b.assignInWith=rc,b.assignWith=h3,b.at=p3,b.before=aw,b.bind=Bh,b.bindAll=vK,b.bindKey=cw,b.castArray=O$,b.chain=nw,b.chunk=$2,b.compact=K2,b.concat=j2,b.cond=wK,b.conforms=SK,b.constant=Kh,b.countBy=t$,b.create=g3,b.curry=dw,b.curryRight=uw,b.debounce=hw,b.defaults=f3,b.defaultsDeep=m3,b.defer=x$,b.delay=E$,b.difference=Z2,b.differenceBy=q2,b.differenceWith=Y2,b.drop=Q2,b.dropRight=X2,b.dropRightWhile=J2,b.dropWhile=eU,b.fill=tU,b.filter=s$,b.flatMap=r$,b.flatMapDeep=l$,b.flatMapDepth=a$,b.flatten=ew,b.flattenDeep=iU,b.flattenDepth=sU,b.flip=P$,b.flow=bK,b.flowRight=RK,b.fromPairs=nU,b.functions=R3,b.functionsIn=F3,b.groupBy=c$,b.initial=rU,b.intersection=lU,b.intersectionBy=aU,b.intersectionWith=cU,b.invert=E3,b.invertBy=P3,b.invokeMap=u$,b.iteratee=jh,b.keyBy=h$,b.keys=pt,b.keysIn=zt,b.map=ec,b.mapKeys=T3,b.mapValues=A3,b.matches=FK,b.matchesProperty=xK,b.memoize=ic,b.merge=M3,b.mergeWith=bw,b.method=EK,b.methodOf=PK,b.mixin=Zh,b.negate=sc,b.nthArg=TK,b.omit=k3,b.omitBy=I3,b.once=D$,b.orderBy=p$,b.over=AK,b.overArgs=T$,b.overEvery=MK,b.overSome=kK,b.partial=Gh,b.partialRight=pw,b.partition=g$,b.pick=L3,b.pickBy=Rw,b.property=Aw,b.propertyOf=IK,b.pull=pU,b.pullAll=iw,b.pullAllBy=gU,b.pullAllWith=fU,b.pullAt=mU,b.range=LK,b.rangeRight=_K,b.rearg=A$,b.reject=C$,b.remove=CU,b.rest=M$,b.reverse=Vh,b.sampleSize=w$,b.set=O3,b.setWith=V3,b.shuffle=S$,b.slice=vU,b.sortBy=R$,b.sortedUniq=xU,b.sortedUniqBy=EU,b.split=rK,b.spread=k$,b.tail=PU,b.take=DU,b.takeRight=TU,b.takeRightWhile=AU,b.takeWhile=MU,b.tap=KU,b.throttle=I$,b.thru=Ja,b.toArray=vw,b.toPairs=Fw,b.toPairsIn=xw,b.toPath=GK,b.toPlainObject=Sw,b.transform=N3,b.unary=L$,b.union=kU,b.unionBy=IU,b.unionWith=LU,b.uniq=_U,b.uniqBy=OU,b.uniqWith=VU,b.unset=B3,b.unzip=Nh,b.unzipWith=sw,b.update=G3,b.updateWith=H3,b.values=xo,b.valuesIn=W3,b.without=NU,b.words=Dw,b.wrap=_$,b.xor=BU,b.xorBy=GU,b.xorWith=HU,b.zip=WU,b.zipObject=zU,b.zipObjectDeep=UU,b.zipWith=$U,b.entries=Fw,b.entriesIn=xw,b.extend=yw,b.extendWith=rc,Zh(b,b),b.add=WK,b.attempt=Tw,b.camelCase=K3,b.capitalize=Ew,b.ceil=zK,b.clamp=z3,b.clone=V$,b.cloneDeep=B$,b.cloneDeepWith=G$,b.cloneWith=N$,b.conformsTo=H$,b.deburr=Pw,b.defaultTo=yK,b.divide=UK,b.endsWith=j3,b.eq=ki,b.escape=Z3,b.escapeRegExp=q3,b.every=i$,b.find=n$,b.findIndex=Xv,b.findKey=C3,b.findLast=o$,b.findLastIndex=Jv,b.findLastKey=v3,b.floor=$K,b.forEach=ow,b.forEachRight=rw,b.forIn=w3,b.forInRight=S3,b.forOwn=y3,b.forOwnRight=b3,b.get=zh,b.gt=W$,b.gte=z$,b.has=x3,b.hasIn=Uh,b.head=tw,b.identity=Ut,b.includes=d$,b.indexOf=oU,b.inRange=U3,b.invoke=D3,b.isArguments=Dn,b.isArray=Re,b.isArrayBuffer=U$,b.isArrayLike=Wt,b.isArrayLikeObject=rt,b.isBoolean=$$,b.isBuffer=Qs,b.isDate=K$,b.isElement=j$,b.isEmpty=Z$,b.isEqual=q$,b.isEqualWith=Y$,b.isError=Hh,b.isFinite=Q$,b.isFunction=gs,b.isInteger=gw,b.isLength=nc,b.isMap=fw,b.isMatch=X$,b.isMatchWith=J$,b.isNaN=e3,b.isNative=t3,b.isNil=s3,b.isNull=i3,b.isNumber=mw,b.isObject=it,b.isObjectLike=nt,b.isPlainObject=sl,b.isRegExp=Wh,b.isSafeInteger=n3,b.isSet=Cw,b.isString=oc,b.isSymbol=Jt,b.isTypedArray=Fo,b.isUndefined=o3,b.isWeakMap=r3,b.isWeakSet=l3,b.join=dU,b.kebabCase=Y3,b.last=gi,b.lastIndexOf=uU,b.lowerCase=Q3,b.lowerFirst=X3,b.lt=a3,b.lte=c3,b.max=KK,b.maxBy=jK,b.mean=ZK,b.meanBy=qK,b.min=YK,b.minBy=QK,b.stubArray=Yh,b.stubFalse=Qh,b.stubObject=OK,b.stubString=VK,b.stubTrue=NK,b.multiply=XK,b.nth=hU,b.noConflict=DK,b.noop=qh,b.now=tc,b.pad=J3,b.padEnd=eK,b.padStart=tK,b.parseInt=iK,b.random=$3,b.reduce=f$,b.reduceRight=m$,b.repeat=sK,b.replace=nK,b.result=_3,b.round=JK,b.runInContext=k,b.sample=v$,b.size=y$,b.snakeCase=oK,b.some=b$,b.sortedIndex=wU,b.sortedIndexBy=SU,b.sortedIndexOf=yU,b.sortedLastIndex=bU,b.sortedLastIndexBy=RU,b.sortedLastIndexOf=FU,b.startCase=lK,b.startsWith=aK,b.subtract=e4,b.sum=t4,b.sumBy=i4,b.template=cK,b.times=BK,b.toFinite=fs,b.toInteger=De,b.toLength=ww,b.toLower=dK,b.toNumber=fi,b.toSafeInteger=d3,b.toString=Ue,b.toUpper=uK,b.trim=hK,b.trimEnd=pK,b.trimStart=gK,b.truncate=fK,b.unescape=mK,b.uniqueId=HK,b.upperCase=CK,b.upperFirst=$h,b.each=ow,b.eachRight=rw,b.first=tw,Zh(b,function(){var l={};return Ki(b,function(u,p){$e.call(b.prototype,p)||(l[p]=u)}),l}(),{chain:!1}),b.VERSION=s,ci(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){b[l].placeholder=b}),ci(["drop","take"],function(l,u){Ne.prototype[l]=function(p){p=p===i?1:ct(De(p),0);var m=this.__filtered__&&!u?new Ne(this):this.clone();return m.__filtered__?m.__takeCount__=Ft(p,m.__takeCount__):m.__views__.push({size:Ft(p,Gt),type:l+(m.__dir__<0?"Right":"")}),m},Ne.prototype[l+"Right"]=function(p){return this.reverse()[l](p).reverse()}}),ci(["filter","map","takeWhile"],function(l,u){var p=u+1,m=p==pe||p==ee;Ne.prototype[l]=function(w){var F=this.clone();return F.__iteratees__.push({iteratee:fe(w,3),type:p}),F.__filtered__=F.__filtered__||m,F}}),ci(["head","last"],function(l,u){var p="take"+(u?"Right":"");Ne.prototype[l]=function(){return this[p](1).value()[0]}}),ci(["initial","tail"],function(l,u){var p="drop"+(u?"":"Right");Ne.prototype[l]=function(){return this.__filtered__?new Ne(this):this[p](1)}}),Ne.prototype.compact=function(){return this.filter(Ut)},Ne.prototype.find=function(l){return this.filter(l).head()},Ne.prototype.findLast=function(l){return this.reverse().find(l)},Ne.prototype.invokeMap=Ie(function(l,u){return typeof l=="function"?new Ne(this):this.map(function(p){return Qr(p,l,u)})}),Ne.prototype.reject=function(l){return this.filter(sc(fe(l)))},Ne.prototype.slice=function(l,u){l=De(l);var p=this;return p.__filtered__&&(l>0||u<0)?new Ne(p):(l<0?p=p.takeRight(-l):l&&(p=p.drop(l)),u!==i&&(u=De(u),p=u<0?p.dropRight(-u):p.take(u-l)),p)},Ne.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ne.prototype.toArray=function(){return this.take(Gt)},Ki(Ne.prototype,function(l,u){var p=/^(?:filter|find|map|reject)|While$/.test(u),m=/^(?:head|last)$/.test(u),w=b[m?"take"+(u=="last"?"Right":""):u],F=m||/^find/.test(u);w&&(b.prototype[u]=function(){var E=this.__wrapped__,D=m?[1]:arguments,L=E instanceof Ne,$=D[0],K=L||Re(E),q=function(Oe){var Be=w.apply(b,Us([Oe],D));return m&&te?Be[0]:Be};K&&p&&typeof $=="function"&&$.length!=1&&(L=K=!1);var te=this.__chain__,de=!!this.__actions__.length,me=F&&!te,Me=L&&!de;if(!F&&K){E=Me?E:new Ne(this);var Ce=l.apply(E,D);return Ce.__actions__.push({func:Ja,args:[q],thisArg:i}),new ui(Ce,te)}return me&&Me?l.apply(this,D):(Ce=this.thru(q),me?m?Ce.value()[0]:Ce.value():Ce)})}),ci(["pop","push","shift","sort","splice","unshift"],function(l){var u=xa[l],p=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",m=/^(?:pop|shift)$/.test(l);b.prototype[l]=function(){var w=arguments;if(m&&!this.__chain__){var F=this.value();return u.apply(Re(F)?F:[],w)}return this[p](function(E){return u.apply(Re(E)?E:[],w)})}}),Ki(Ne.prototype,function(l,u){var p=b[u];if(p){var m=p.name+"";$e.call(wo,m)||(wo[m]=[]),wo[m].push({name:u,func:p})}}),wo[Ka(i,x).name]=[{name:"wrapper",func:i}],Ne.prototype.clone=mz,Ne.prototype.reverse=Cz,Ne.prototype.value=vz,b.prototype.at=jU,b.prototype.chain=ZU,b.prototype.commit=qU,b.prototype.next=YU,b.prototype.plant=XU,b.prototype.reverse=JU,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=e$,b.prototype.first=b.prototype.head,Ur&&(b.prototype[Ur]=QU),b},mo=qW();Sn?((Sn.exports=mo)._=mo,ju._=mo):ft._=mo}).call(vr)}(pa,pa.exports);var Hs=pa.exports;function QG(e){return Pm({type:e.type,id:e.id})}function XG(e){return JSON.parse(e)}function JG(e,t){var i,s;return{colId:QG(t),field:e.toString(),headerName:((s=(i=t.spec.annotations)==null?void 0:i["pl7.app/label"])==null?void 0:s.trim())??"Unlabeled "+t.type+" "+e.toString(),lockPosition:t.type==="axis",valueFormatter:n=>n?n.value===void 0?"NULL":n.value===null?"NA":n.value.toString():"ERROR",cellDataType:(n=>{switch(n){case"Int":case"Long":case"Float":case"Double":return"number";case"String":case"Bytes":return"text";default:throw Error(`unsupported data type: ${n}`)}})(t.type==="axis"?t.spec.type:t.spec.valueType)}}function eH(e,t){switch(t){case"Int":return e===$G;case"Long":return e===KG;case"Float":return e===jG;case"Double":return e===ZG;case"String":return e===qG;case"Bytes":return e===YG;default:throw Error(`unsupported data type: ${t}`)}}function tH(e,t){const i=Math.floor(t/8),s=1<<7-t%8;return(e[i]&s)>0}function iH(e,t){switch(t){case"Int":return e;case"Long":return Number(e);case"Float":return e;case"Double":return e;case"String":return e;case"Bytes":return Buffer.from(e).toString("hex");default:throw Error(`unsupported data type: ${t}`)}}function sH(e,t){const i=t.length,s=[];for(let n=0;n<t[0].data.length;++n){const o={},r=[];for(let a=0;a<i;++a){const d=e[a].toString(),h=t[a].data[n],g=t[a].type;tH(t[a].absent,n)?o[d]=void 0:eH(h,g)||h===null?o[d]=null:o[d]=iH(h,g),r.push(g==="Long"?Number(h):h)}o.id=JSON.stringify(r),s.push(o)}return s}async function nH(e,t,i,s){const n=await t.getSpec(i),o=n.map((f,C)=>Hs.find(s,v=>Hs.isEqual(v.axis,f.id))?null:C).filter(f=>f!==null),r=o.map(f=>JG(f,n[f])),a=await t.getShape(i),d=a.rows;let h;return{columnDefs:r,datasource:{rowCount:d,getRows:async f=>{e.setGridOption("loading",!0);try{if(d==0){f.successCallback([],d),e.setGridOption("loading",!1),e.showNoRowsOverlay();return}if(h&&!Hs.isEqual(h.sortModel,f.sortModel)){h=void 0,f.failCallback();return}h=f;const C=f.endRow-f.startRow;let v=[];if(C>0){const S=await t.getData(i,o,{offset:f.startRow,length:C});v=sH(o,S)}f.successCallback(v,a.rows),e.setGridOption("loading",!1),e.autoSizeAllColumns()}catch{f.failCallback()}}}}}const oH={class:"ap-ag-data-table-container"},rH={key:0,class:"ap-ag-data-table-sheets"},lH=qc(c.defineComponent({__name:"PlAgDataTable",props:c.mergeModels({settings:{}},{modelValue:{default:{gridState:{}}},modelModifiers:{}}),emits:["update:modelValue"],setup(e){ss.registerModules([IB,M1,UB,G1]);const t=c.useModel(e,"modelValue"),i=e,{settings:s}=c.toRefs(i);function n(v){if(s.value.sourceType==="ptable")return(v==null?void 0:v.sortModel.map(S=>({column:XG(S.colId),ascending:S.sort==="asc",naAndAbsentAreLeastValues:!0})))??[]}const o=c.computed({get:()=>{const v=t.value;return{columnOrder:v.gridState.columnOrder,sort:v.gridState.sort}},set:v=>{const S=n(v.sort),R=t.value;R.gridState.columnOrder=v.columnOrder,R.gridState.sort=v.sort,s.value.sourceType==="ptable"&&(R.pTableParams||(R.pTableParams={sorting:[],filters:[]}),R.pTableParams.sorting=S),t.value=R}}),r=v=>Pm(v);function a(v){var S;if(s.value.sourceType==="ptable")return((S=s.value.sheets)==null?void 0:S.map(R=>({type:"bySingleColumn",column:{type:"axis",id:R.axis},predicate:{operator:"Equal",reference:v[r(R.axis)]}})))??[]}const d=c.computed({get:()=>t.value.gridState.sheets??{},set:v=>{const S=a(v),R=t.value;R.gridState.sheets=v,s.value.sourceType==="ptable"&&(R.pTableParams||(R.pTableParams={sorting:[],filters:[]}),R.pTableParams.filters=S),t.value=R}});c.watch(()=>s.value,(v,S)=>{if(v.sourceType==="ptable"&&(S==null?void 0:S.sourceType)==="ptable"&&Hs.isEqual(v.sheets,S.sheets))return;if(v.sourceType!=="ptable"){d.value={};return}const R=d.value,y=v.sheets??[];for(const x of y){const P=r(x.axis);R[P]||(R[P]=x.defaultValue??x.options[0].value)}d.value=R},{immediate:!0});const h=c.shallowRef(),g={animateRows:!1,suppressColumnMoveAnimation:!0,enableRangeSelection:!0,initialState:t.value.gridState,onGridReady:v=>{h.value=v.api},onStateUpdated:v=>{o.value={columnOrder:v.state.columnOrder,sort:v.state.sort}},autoSizeStrategy:{type:"fitCellContents"},onRowDataUpdated:v=>{v.api.autoSizeAllColumns()},rowModelType:"infinite",maxBlocksInCache:1e4,cacheBlockSize:100,getRowId:v=>v.data.id,loading:!0,loadingOverlayComponentParams:{notReady:!0},loadingOverlayComponent:W1,noRowsOverlayComponent:K1},f=c.ref(0);c.watch(()=>[h.value,o.value],(v,S)=>{if(Hs.isEqual(v,S))return;const[R,y]=v;if(!R)return;const x=R.getState();Hs.isEqual(y.columnOrder,x.columnOrder)&&Hs.isEqual(y.sort,x.sort)||(g.initialState=y,++f.value)});const C=(v,S)=>{const R=d.value;R[v]!==S&&(R[v]=S,d.value=R)};return c.watch(()=>[h.value,s.value],async(v,S)=>{if(Hs.isEqual(v,S))return;const[R,y]=v;if(!R)return;const x=window.platforma;if(!x)throw Error("platforma not set");const P=y.sourceType;switch(P){case"ptable":{const T=x.pFrameDriver;if(!T)throw Error("platforma.pFrameDriver not set");const I=y.pTable;if(!(I!=null&&I.ok)||!I.value)return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const V=await nH(R,T,I.value,y.sheets??[]);return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...V})}case"xsv":{const T=x.blobDriver;if(!T)throw Error("platforma.blobDriver not set");const I=y.xsvFile;if(!(I!=null&&I.ok)||!I.value)return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!0},columnDefs:[],rowData:[]});const V=await j1(R,T,I.value);return R.updateGridOptions({loading:!0,loadingOverlayComponentParams:{notReady:!1},...V})}default:throw Error(`unsupported source type: ${P}`)}}),(v,S)=>{var R;return c.openBlock(),c.createElementBlock("div",oH,[c.unref(s).sourceType==="ptable"&&(((R=c.unref(s).sheets)==null?void 0:R.length)??0)>0?(c.openBlock(),c.createElementBlock("div",rH,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(s).sheets,(y,x)=>(c.openBlock(),c.createBlock(c.unref(Up),{key:x,"model-value":d.value[r(y.axis)],options:y.options,"onUpdate:modelValue":P=>C(r(y.axis),P)},null,8,["model-value","options","onUpdate:modelValue"]))),128))])):c.createCommentVNode("",!0),c.createVNode(c.unref(n1),{class:"ap-ag-data-table-grid","grid-options":g})])}}}),[["__scopeId","data-v-f43438f3"]]),aH={key:1,class:"alert-error"},cH={key:2},dH=c.defineComponent({__name:"ValueOrErrorsComponent",props:{valueOrError:{}},setup(e){const t=e,i=c.computed(()=>t.valueOrError&&t.valueOrError.ok?t.valueOrError.value:void 0),s=c.computed(()=>t.valueOrError&&!t.valueOrError.ok?t.valueOrError.errors:void 0),n=c.computed(()=>i.value===void 0&&s.value===void 0);return(o,r)=>(c.openBlock(),c.createElementBlock("div",null,[i.value!==void 0?c.renderSlot(o.$slots,"default",c.normalizeProps(c.mergeProps({key:0},{value:i.value}))):c.createCommentVNode("",!0),s.value?(c.openBlock(),c.createElementBlock("div",aH,c.toDisplayString(s.value),1)):c.createCommentVNode("",!0),n.value?(c.openBlock(),c.createElementBlock("div",cH,"Unresolved")):c.createCommentVNode("",!0)]))}}),ga=new Map;function uH(e,t){const i=c.getCurrentScope()??c.effectScope(),s=i.run(()=>(c.onScopeDispose(()=>{ga.delete(e)}),c.reactive(t())));return s[Symbol.dispose]=()=>{i.stop()},s}function hH(e){const t=Symbol();return()=>(ga.has(t)||ga.set(t,uH(t,e)),ga.get(t))}function pH(e){return c.computed(()=>{try{return tp(e())}catch(t){return{errors:[String(t)],value:void 0}}})}function gH(e,t){const i=c.reactive({value:void 0,errors:void 0}),s={version:0},n=async(o,r)=>({value:await t(o),version:r});return c.watch(e,async o=>{i.errors=void 0,i.value=void 0;try{const{value:r,version:a}=await n(o,++s.version);a===s.version&&(i.value=r)}catch(r){i.errors=[String(r)]}},{immediate:!0,deep:!0}),i}Y.BlockLayout=HD,Y.ContextProvider=YE,Y.DataTable=Ab,Y.DemoData=kD,Y.DropdownListItem=ul,Y.GridTable=Iy,Y.LongText=Wp,Y.MaskIcon16=To,Y.MaskIcon24=Ln,Y.MultiError=hc,Y.PlAgDataTable=lH,Y.PlAlert=nR,Y.PlBlockPage=zb,Y.PlBtnAccent=cR,Y.PlBtnGhost=Mp,Y.PlBtnGroup=MR,Y.PlBtnLink=pR,Y.PlBtnPrimary=Ap,Y.PlBtnSecondary=Lc,Y.PlCheckbox=rx,Y.PlCheckboxGroup=dx,Y.PlChip=Gc,Y.PlContainer=$b,Y.PlDialogModal=$p,Y.PlDropdown=zp,Y.PlDropdownLine=Up,Y.PlDropdownMulti=nx,Y.PlFileDialog=Kp,Y.PlFileInput=qE,Y.PlGrid=Xb,Y.PlNumberField=zF,Y.PlProgressBar=OF,Y.PlRow=jb,Y.PlSlideModal=mx,Y.PlSpacer=Yb,Y.PlTextArea=eF,Y.PlTextField=Np,Y.PlToggleSwitch=wx,Y.PlTooltip=ii,Y.Scrollable=HP,Y.Slider=lP,Y.SliderRange=VP,Y.SliderRangeTriple=xP,Y.ThemeSwitcher=Ob,Y.UnresolvedError=uc,Y.ValueOrErrorsComponent=dH,Y.animate=yp,Y.animateInfinite=My,Y.call=mp,Y.computedResult=pH,Y.createModel=dc,Y.debounce=bp,Y.defineApp=Xw,Y.defineStore=hH,Y.delay=Cp,Y.detectOutside=tF,Y.eventListener=Nc,Y.getElementScrollPosition=Gp,Y.getFilePathBreadcrumbs=Yw,Y.isDefined=qw,Y.isElementVisible=Bp,Y.listToOptions=ky,Y.makeEaseInOut=Ay,Y.makeEaseOut=Sp,Y.maskIcons16=AD,Y.maskIcons24=MD,Y.notEmpty=Rc,Y.randomInt=wp,Y.randomString=Ty,Y.requestTick=Fc,Y.scrollIntoView=dl,Y.showContextMenu=Pc,Y.throttle=xc,Y.timeout=vp,Y.unwrapOptionalResult=Zw,Y.unwrapValueOrErrors=ep,Y.useClickOutside=cl,Y.useDraggable=gP,Y.useEventListener=st,Y.useFormState=hP,Y.useHover=bc,Y.useInterval=uP,Y.useLocalStorage=Ep,Y.useMouse=yc,Y.useMouseCapture=ws,Y.usePosition=kp,Y.useQuery=pP,Y.useResizeObserver=lg,Y.useScroll=aP,Y.useSdkPlugin=pc,Y.useSortable=dP,Y.useTheme=Dp,Y.useWatchResult=gH,Y.wrapOptionalResult=tp,Y.wrapValueOrErrors=jw,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})});