@infinite-table/infinite-react 7.2.2 → 7.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.dev.js +16 -7
- package/index.dev.mjs +16 -7
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Zg=Object.create;var _s=Object.defineProperty;var Qg=Object.getOwnPropertyDescriptor;var Jg=Object.getOwnPropertyNames;var eh=Object.getPrototypeOf,th=Object.prototype.hasOwnProperty;var nh=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var oh=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Jg(e))!th.call(o,r)&&r!==t&&_s(o,r,{get:()=>e[r],enumerable:!(n=Qg(e,r))||n.enumerable});return o};var Wn=(o,e,t)=>(t=o!=null?Zg(eh(o)):{},oh(e||!o||!o.__esModule?_s(t,"default",{value:o,enumerable:!0}):t,o));var Tn=nh((pv,lc)=>{"use strict";lc.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});function zt(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}import*as be from"react";var Z=(...o)=>o.filter(e=>!!`${e}`).join(" ");import*as yn from"react";import{useRef as Hs}from"react";function ge(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function Qe(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Fs=(o,e)=>o-e;var hr=(o,e)=>Fs(o.revision,e.revision),J=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let h=g?[]:[...e,p],b=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let T=t(f.value,h,l,b,f);if(n&&T===!0)return!0;l++}else b?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(n&&f===!0)return f}};this.fill(e)}static clone(e){let t=new o;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push(i)},t),n}getEntriesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push([r,i])},t),n}getLeafNodesStartingWith(e,t,n){let{respectOrder:r=!1}=n||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},n),r?i.sort(hr).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},c=this.map,u,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(u=c.get(m),!u||!u.map)if(d=!0,p===f-1){d=!0;break}else return[];c=u.map}else if(!n&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(n||(s({...u,keys:e}),d=!0)),d?i?a.sort(hr).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,c,r,n),i?a.sort(hr).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,p,f)=>{t(u,c,{...f,keys:u}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let n=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((n,r)=>{let{map:i}=n;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],c=Qe(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e({...n,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(hr);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=J;function we(){return globalThis}var yr=["#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],Os=Symbol("color"),br=new WeakMap,sa=ge();function ca(o=yr){br.set(o,o.map(e=>0))}ca();var rh=(o=yr)=>{let e=[];br.has(o)?e=br.get(o):(e=o.map(n=>0),br.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??yr[0]},xo=":",ua="*",Ns="-",ih=",",ah="debug",lh="diffdebug",ks=!1,Ro=new J,Do=new Map;function da(o,e){let t=o.split(xo),n=new J;n.set(t,!0);let r=e.split(xo),i=new Set(r).has(ua),a=r.indexOf(ua),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(xo)):!0}}function sh(o,e){let t=`channel=${o}_permissions=${e}`;if(Do.has(t))return Do.get(t);let n=e.split(ih);function r(l){return Do.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(ua)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Ns);if(c&&(s=s.substring(Ns.length)),da(o,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),da(o,s))return r(!c)}return r(!1)}var pa=()=>Be.enable??(we()&&we().localStorage?.getItem(ah))??"",ch=()=>Be.diffenable??(we()&&we().localStorage?.getItem(lh))??`${ks}`,fa="",zs=ks;function ma(o){zs=`${ch()}`=="true",fa!==o&&(fa=o,Do.clear())}function Vs(o){ma(pa()),typeof we()<"u"&&we().addEventListener&&we().addEventListener("storage",function(){ma(pa())});function e(t,n){let r=n?`${n}${xo}${t}`:t,i=r.split(xo),a=Ro.get(i);if(a)return a;let l=Ro.get(i.slice(0,-1)),s=(l?l.logFn:Be.logFn)??Gs,c=s,u,d=0,p=()=>u??sh(r,fa),f=rh(Be.colors),m=Object.defineProperties((...g)=>{let h=sa.getListenersCount(),b;if(h>0&&(b=b??Date.now(),sa({color:f,channel:r,args:g,timestamp:b})),p()){if(b=b??Date.now(),d&&zs){let C=b-d;c(`%c[${r}]`,`color: ${f}`,`+${C}ms:`)}d=b;let T=[],S;if(g.forEach(C=>{if(C[Os])S===void 0&&(S=!0),T.push(...C);else{if(typeof C!="string"&&typeof C!="number"){S=!1;return}T.push(`${C}%s`)}}),S){let C=[`%c[${r}]%c %s`,`color: ${f}`,"",...T,""];c(...C)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let b=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return b.toString=()=>h.join(" "),b[Os]=!0,b}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{Ro.delete(i)}}});return Ro.set(i,m),m}return e(o)}var Gs=console.log.bind(console),Ls;Object.defineProperty(Vs,"enable",{get:()=>Ls,set:o=>{Ls=o,ma(pa())}});var Be=Vs;Be.colors=yr;Be.logFn=Gs;var uh=(o,e)=>sa.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;da(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Be.onLogIntent=uh;Be.destroyAll=()=>{ca(),ca(Be.colors),Ro.clear(),Do.clear()};var ut=o=>{let e=Be(o?`${o}:TYPE=debug`:"TYPE=debug");return e.logFn=console.log.bind(console),e},Qt=o=>{let e=Be(o?`${o}:TYPE=error`:"TYPE=error");return e.logFn=console.error.bind(console),e},Po=()=>Po;Po.extend=()=>Po;var rt=class{constructor(e){this.debug=Po,this.error=Po}};import*as dh from"react";import{useMemo as cI,useRef as ph,useEffect as fh,useLayoutEffect as mh,useCallback as uI}from"react";var Eo=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?zt(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}},Tr=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=ph({width:0,height:0}),r=i=>{let a;return o.current&&(a=Eo(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};fh(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),mh(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};var gh=Qt("CSSVariableWatch"),hh=ut("CSSVariableWatch"),bh={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},yh=o=>{let e=Hs(0),t=yn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);Tr(o.ref,t,{earlyAttach:!0}),yn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n)return e.current=n,hh(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);gh(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Mo=o=>{let e=Hs(null);yh({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return yn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:bh},yn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};import*as Cr from"react";import*as Ks from"react";var ga;function Ao(){return ga||(ga=Ks.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}import*as Bs from"react";var ha;function Sr(){return ha||(ha=Bs.createContext(void 0))}function Jt(){let o=Ao();return Cr.useContext(o).componentState}function De(){let o=Ao();return Cr.useContext(o)}function ke(){let o=Sr();return Cr.useContext(o)}import*as wn from"react";import{useCallback as Mc,useEffect as _a,useRef as ab,useState as lb}from"react";import*as wr from"react";function Th(o){let{height:e,width:t,count:n}=o;return wr.createElement("div",{"data-count":n,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var Ws=wr.memo(Th);var js="mlx2t3";import*as Ir from"react";import{useRef as Ch}from"react";import{useEffect as Sh}from"react";var $s=(o,e)=>{Sh(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var Us={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Ys={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},qs={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},ba="_1ueijco1",Xs="_1ueijco0 _16lm1iw0";var Zs=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=Us[`${o}`]:e=Z(Ys[`${o.horizontal}`],qs[`${o.vertical}`]),e};var wh="InfiniteVirtualScrollContainer";var Qs=Ir.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??Ch(null);return $s(u,i),Ir.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:Z(a,wh,Xs,Zs(r))},n)});import*as Fr from"react";import{useLayoutEffect as Aa,useMemo as Lh}from"react";import*as Js from"react";import{useLayoutEffect as Ih,useRef as vh,useState as Rh}from"react";function xh(o){let[e,t]=Rh(o.updater.get),n=vh(null);return Ih(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var en=Js.memo(xh);function tn(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function ec(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}function q(o){return o.slice(4,-1)}var Je="Infinite",Me={rootClassName:Je};var $={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var tc="true",ae={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},nc="column-header-height";var oc=`.${Me.rootClassName}`;function ya(o){return tn(o,oc)}var rc=q($.scrollLeft),Dh=q($.scrollTop),Ph=q($.columnWidthAtIndex),Ta=q($.columnOffsetAtIndex),ic=q($.columnReorderEffectDurationAtIndex),Eh=q($.columnOffsetAtIndexWhileReordering),Mh=q($.columnVisibilityAtIndex),Ah=q($.columnZIndexAtIndex);function At(o,e,t){let n=t?ya(t):document.querySelector(oc);_h(o,e,n)}function _h(o,e,t){if(t){let n=o,r=$[n]?q($[n]):o;t.style.setProperty(r,`${e}`)}}function jn(o,e){if(e)for(var t in o){let n=$[t]?q($[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function Sa(o,e,t){At(`${Ta}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${rc}))`:`${o.computedAbsoluteOffset+e}px`,t)}function Ca(o,e,t){At(`${Ah}-${o}`,`${e}`,t)}function $n(o,e,t){At(`${Eh}-${o}`,typeof e=="number"?`calc( var(${Ta}-${o}) + ${e}px )`:e,t)}function _o(o,e,t){At(`${Mh}-${o}`,e,t)}function vr(o,e,t){At(`${ic}-${o}`,t??"",e)}function wa(o,e){let t=`${ic}-${o}`;At(t,ae.components.Cell.reorderEffectDuration,e)}var Te={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Ph}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,At(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Ta}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,At(this.varName.get(o),e,t)}}};function ac(o,e){jn({[rc]:`${o.scrollLeft}px`,[Dh]:`${o.scrollTop}px`},e)}var Ae=we().requestAnimationFrame||(o=>setTimeout(o,16)),It=we().cancelAnimationFrame||(o=>clearTimeout(o));var sc=Wn(Tn());var Ia=(o,e)=>o-e,Vt={horizontal:!0,vertical:!0};function Rr(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var va="DebugID=";function nn(o,e){return e&&e.startsWith(va)?e:e?`${va}${o}:${e}`:`${va}${o}`}var xr={start:0,end:0},Ra=o=>{o()},xa=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},cc=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},Fo=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function Fh(o){return o.horizontalChange||o.verticalChange}var Sn=class extends rt{constructor(t){let n=nn(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=xr;this.verticalExtendRangeBy=xr;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{Fo(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Ra:Fo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Ra:Fo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=Vt)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Vt)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=Vt)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,sc.default)(a,t,Ia);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let b=f;for(;h>1;)b+=1,d[b]=f,p[b]=0,h-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=xa;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Vt){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",h=m&&r!==this.rows,b=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let T=a!=null,S=l!=null,C=T&&a!==this.rowHeight,y=S&&l!==this.colWidth;T&&(this.rowHeight=a),S&&(this.colWidth=l);let v=t.rowspan!=null,w=t.colspan!=null,I=v&&t.rowspan!=this.rowspan,R=w&&t.colspan!=this.colspan;I&&(this.rowspan=t.rowspan),R&&(this.colspan=t.colspan);let x=b||y||p||R,D=h||C||f||I;(n||Fh)({horizontalChange:x,verticalChange:D,colsChanged:b,colWidthChanged:y,widthChanged:p,colspanChanged:R,rowsChanged:h,rowHeightChanged:C,heightChanged:f,rowspanChanged:I})&&this.updateRenderCount({horizontal:x,vertical:D})}extendRenderRange(t){let{direction:n}=t,r=n==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(t=Vt){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Vt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(n?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Ra:Fo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=Rr(l,u)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{Fo(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let n=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=xr,this.verticalExtendRangeBy=xr,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Pa=Wn(Tn());function uc(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function dc(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function Oo(o,e){for(let t of o)if(e(t))return t}import*as fc from"react";var pc=new Map,Oh=()=>{},Da=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=ge();let n=pc.get(e)??0,r=`${e}:GridCellReact:${n}`;pc.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=ge(),this.node=fc.createElement(en,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Oh,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Un=class Un extends rt{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=ge();this.cellAttachmentChangeSubscription=ge();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=new Da(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,n=t.values().next().value;return n||(this.poolSize+=Un.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/Un.POOL_SIZE_INCREMENT)*Un.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};Un.POOL_SIZE_INCREMENT=1;var Dr=Un;var Pr=(o,e)=>o-e,Er=class extends rt{constructor(t){super(`${t}:GridCellManager`);this.matrix=new J;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,b=f>=s;(m||g||h||b)&&c.add(u)}),c};this.debugId=t,this.pool=new Dr(t),this.offRemoveCell=this.pool.onRemoveCell(n=>this.onRemoveCell(n))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=Oo(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=Oo(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Pr)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Pr)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((n,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,Pa.default)(n,t,Pr);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,Pa.default)(n,t,Pr);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return Oo(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return Oo(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var hc=Wn(Tn());import*as gc from"react";var mc=new Map,Nh=()=>{},Ea=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=ge();let t=mc.get(e)??0,n=`${e}:ListRowReact:${t}`;mc.set(e,t+1),this.debugId=n,this.updater=ge(),this.node=gc.createElement(en,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Nh,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Yn=class Yn extends rt{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=ge();this.rowAttachmentChangeSubscription=ge();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=new Ea(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,n=t.values().next().value;return n||(this.poolSize+=Yn.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/Yn.POOL_SIZE_INCREMENT)*Yn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};Yn.POOL_SIZE_INCREMENT=1;var Mr=Yn;var Ar=class extends rt{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new Mr(t),this.offRemoveRow=this.pool.onRemoveRow(n=>this.onRemoveRow(n))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,hc.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var bc=!0,Cn=q($.y),yc=q($.scrollTop),Qv=q($.columnOffsetAtIndex),Ma=q($.columnOffsetAtIndexWhileReordering),qn=class extends rt{constructor(t,n){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(Cn,i?`calc( ${r}px + var(${yc}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Cn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=Te.columnOffsets.get(r),d=`${Ma}-${r}`,p=s?`calc( ${a}px + var(${yc}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(Cn,p));let f=`translate3d(var(${d}, ${u}), var(${Cn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),c!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),this.brain.isHorizontalLayoutBrain){let b=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),T=this.getScrollPositionForScrollColumnIntoView(b,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});T&&(a=T.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,p]=c,[f,m]=u,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let h={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:u?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ae(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:c,y:u}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,bc){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let f=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==f&&(r.__zIndex=f,r.style.zIndex=f)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,bc&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(E=>{let _=i.getRowIndex(E);if(_!=null){let P=this.brain.getItemOffsetFor(_,"vertical");if(P==null)return;let F=E.getElement();if(!F)return;this.setDetailTransform(F,_,{y:P,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&ac(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:h}=this.brain.getRenderRange(),[b,T]=g,[S,C]=h;function y(E,_,P){let F=r.getCellAt([E,_]);if(F==null)return;let N=n.getCellOffset(E,_),G=F.getElement();G&&N&&P(E,_,G,N)}let v=(E,_,P,{x:F,y:N})=>{this.setTransform(P,E,_,{x:F,y:N,scrollLeft:!0},s-_)},w=(E,_,P,F)=>{this.setTransform(P,E,_,{x:F.x,y:F.y,scrollTop:!0},u-E)},I=(E,_,P,{y:F})=>{let N=f[_];this.setTransform(P,E,_,{x:N,y:F,scrollLeft:!0},a-_)},R=(E,_,P,F)=>{this.setTransform(P,E,_,{x:F.x,y:m[E],scrollTop:!0},l-E)},x=(E,_,P,{x:F,y:N})=>{this.setTransform(P,E,_,{x:F,scrollLeft:!0,y:N,scrollTop:!0},1e5)},D=(E,_,P,{x:F})=>{this.setTransform(P,E,_,{x:F,scrollLeft:!0,y:m[E],scrollTop:!0},2e5)},M=(E,_,P,F)=>{this.setTransform(P,E,_,{x:f[_],y:F.y,scrollLeft:!0,scrollTop:!0},3e5)},A=(E,_,P)=>{this.setTransform(P,E,_,{x:f[_],y:m[E],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let E=b;E<S;E++){for(let _=0;_<s;_++)y(E,_,v);if(c){let _=a-c;for(let P=_;P<a;P++)y(E,P,I)}}if(u||d)for(let E=T;E<C;E++){for(let _=0;_<u;_++)y(_,E,w);if(d){let _=l-d;for(let P=_;P<l;P++)y(P,E,R)}}if(s&&u)for(let E=0;E<u;E++)for(let _=0;_<s;_++)y(E,_,x);if(s&&d){let E=l-d;for(let _=E;_<l;_++)for(let P=0;P<s;P++)y(_,P,D)}if(c&&u){let E=a-c;for(let _=0;_<u;_++)for(let P=E;P<a;P++)y(_,P,M)}if(c&&d){let E=l-d,_=a-c;for(let P=E;P<l;P++)for(let F=_;F<a;F++)y(P,F,A)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new Er(n),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new Ar(n),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ae(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=ya(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],D=t.end[1];m.forEach(M=>{x<=M&&M<D||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([x,D])=>{g.set(`${x}:${D}`,!0)});let b=f.reduce((x,D)=>x+xa(D),0),T=r?f.reduce((x,D)=>x+cc(D),0):0,S=this.brain.getRowCount(),C=this.brain.getColCount();d.detachCellsStartingAt([S,C]);let y=Math.min(S*C,b);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>T&&(u.poolSize=T));let v=uc(...f.map(x=>d.getCellsOutsideRenderRange(x)));v=dc(v,x=>{let D=d.getCellPosition(x);return!(D&&g.has(`${D[0]}:${D[1]}`))}),d.detachCells(v),d.poolSize=y;let w=new Map,I=new Map;f.forEach(x=>{let{start:D,end:M}=x,[A,E]=D,[_,P]=M;for(let F=A;F<_;F++){for(let G=E;G<P;G++){let H=`${F}:${G}`;if(w.has(H))continue;w.set(H,!0);let{rendered:B,mapped:pe}=this.isCellRenderedAndMappedCorrectly(F,G);if(F===A||G===E){let k=this.isCellCovered(F,G);if(k&&g.has(`${k[0]}:${k[1]}`)){let W=d.getCellAt([F,G]);W!=null&&d.detachCell(W);continue}}if(B&&!i&&pe)continue;let de;B?de=d.getCellAt([F,G]):de=d.getCellFor([F,G],c?"row":"column"),de==null&&(de=d.getDetachedCell()),this.renderCellAt(F,G,de,n)}!r||I.has(F)||(I.set(F,!0),u.isRowAttachedAt(F)&&!i)||this.renderDetailRowAtElement(F,this.rowManager.getRowFor(F),r)}}),h.forEach(([x,D])=>{let{rendered:M,mapped:A}=this.isCellRenderedAndMappedCorrectly(x,D);if(M){if(i||!A){let _=[x,D],P=d.getCellAt(_);this.renderCellAt(x,D,P,n)}return}let E=d.getCellFor([x,D],c?"row":"column");E!=null&&this.renderCellAt(x,D,E,n)});let R=d.getAllCells().map(x=>x.getNode());return r&&u.getAllRows().forEach(x=>{R.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(R),R}renderDetailRowAtElement(t,n,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),p=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:b}=this.getCellRealCoordinates(t,n),T=i({rowIndex:h,colIndex:b,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:r.ref});r.isMounted()||r.onMount(C=>{let y=C.getElement();y&&(y.style.position="absolute",y.style.left="0px",y.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:b}:void 0;if(!T){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(T,r,[t,n],S),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var _r=class extends qn{constructor(t,n){super(t,n);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=ae.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=Te.columnOffsets.get(l.colIndex),f=`${Ma}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Cn,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${Cn})`,b=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==b&&(t.__transformValue=b,t.style.transform=b)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function No(o){let e=o.isHorizontalLayoutBrain?new _r(o,`${o.name}:HorizontalLayoutTableRenderer`):new qn(o,`${o.name}:ReactHeadlessTableRenderer`),t=ge();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function kh(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=Lh(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:No(e),[e,o.onRenderUpdater,o.renderer]);return Aa(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),Aa(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),Aa(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),Fr.createElement(en,{updater:a})}var Or=Fr.memo(kh);import*as Lo from"react";import{useEffect as Wh,useLayoutEffect as jh,useRef as $h}from"react";import{useCallback as zh,useState as Vh}from"react";var _t=()=>{let[o,e]=Vh(0);return[o,zh(()=>{e(t=>t+1)},[e])]};function Gh(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function Hh(o){var e=Gh(o,"string");return typeof e=="symbol"?e:String(e)}function Kh(o,e,t){return e=Hh(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Tc(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function Sc(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tc(Object(t),!0).forEach(function(n){Kh(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Tc(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Cc(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var Bh=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},ue=o=>{var e=t=>{var n=o.defaultClassName,r=Sc(Sc({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=o.variantClassNames[i][s];c&&(n+=" "+c)}}for(var[u,d]of o.compoundVariants)Bh(u,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Cc(o.variantClassNames,t=>Cc(t,n=>n.split(" ")[0]))}},e};var wc=ue({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Nr="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Ic=ue({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Uh}=Me,Yh=`${Uh}-ActiveRowIndicator`,qh=`calc(${$.activeCellRowOffsetX} + var(${q($.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,Xh={[q($.activeCellOffsetY)]:$.activeCellRowOffset,transform:`translate3d(${qh}, calc( ${$.activeCellOffsetY} + var(${q($.scrollTopForActiveRow)}, 0px)), 0px)`,height:$.activeCellRowHeight,maxWidth:ae.runtime.totalVisibleColumnsWidthVar},Zh=o=>{let{brain:e}=o,t=$h(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=_t();return jh(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${ae.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};jn(d,u)},[o.activeRowIndex,e]),Wh(()=>{let a=c=>{jn({scrollTopForActiveRow:`${-c.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-c.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),Lo.createElement("div",{className:Nr,"data-name":"active-row"},Lo.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${Yh} ${Ic({active:n})}`,style:n?Xh:void 0}))},vc=Lo.memo(Zh);import*as ko from"react";import{useEffect as Qh,useLayoutEffect as Jh,useRef as eb}from"react";var{rootClassName:tb}=Me,nb=`${tb}-ActiveCellIndicator`,ob=q($.columnZIndexAtIndex),rb=(o,e,t,n)=>{if(e==null)return;let[r]=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(r=r%o.rowsPerPage);let i=typeof t=="function"?t(r):t??o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;jn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},ib=o=>{let{brain:e}=o,[t,n]=_t(),r=eb(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return Jh(()=>{rb(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),Qh(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),ko.createElement("div",{className:Nr,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${ob}-${o.activeCellIndex[1]})`}:void 0},ko.createElement("div",{"data-name":"active-cell-indicator",className:`${nb} ${wc({visible:i})}`}))},Rc=ko.memo(ib);var xc="_1eexc2a7 _1eexc2a6",Dc=ue({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),Pc=ue({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Ec="_1eexc2a5",Lr=ue({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),kr="_1eexc2a8";var zr=[Ec,`${Je}DetachedCell`];function Vr(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var sb=Z(js,ba);function Ac(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,b=ab(null),[T,S]=lb({width:0,height:0});_a(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),_a(()=>{let v=b.current?.parentNode;return v?(h&&document.activeElement!==v&&v.focus(),Eo(v,()=>{let R={height:v.clientHeight,width:v.clientWidth};e.update(R)},{debounce:50})):void 0},[p,e]);let C=Mc(v=>{requestAnimationFrame(()=>{b.current&&b.current.style.setProperty("transform",`translate3d(${-v.scrollLeft}px, ${-v.scrollTop}px, 0px)`)})},[]),y=Mc(v=>{e.setScrollPosition(v,C)},[e,C]);return _a(()=>{let v=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),C(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),v},[e]),wn.createElement(Qs,{onContainerScroll:y,...g,ref:t},wn.createElement("div",{ref:b,className:sb,"data-name":"scroll-transform-target"},wn.createElement(Or,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:zr}),u!=null?wn.createElement(Rc,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?wn.createElement(vc,{brain:e,activeRowIndex:c}):null,wn.createElement(Ws,{width:T.width,height:T.height}))}import*as Xn from"react";import{useReducer as gb,createContext as hb,useMemo as La,useEffect as bb,useState as Fc,useRef as Oc,useLayoutEffect as yb}from"react";function Fa(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var Oa=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function zo(o){return o!==void 0}function on(o,e){let t=e[o];return zo(t)}import{useCallback as cb,useEffect as ub,useRef as Na}from"react";var _c=o=>{let e=cb(o,[]),t=Na(!1),n=Na(!1),r=Na(void 0),[i,a]=_t();t.current&&(n.current=!0),ub(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};import{useCallback as db,useRef as pb}from"react";function ve(o){let e=pb(o);return e.current=o,db(()=>e.current,[])}import{useRef as fb,useLayoutEffect as mb}from"react";var In=(o,e)=>{let t=fb(e===void 0?o:e);return mb(()=>{t.current=o}),t.current};var Tb=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)},ka;function Nc(){return ka||(ka=hb(null))}function Sb(o,e,t,n,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:p=>{let f=t(),m=e(),g=m[u],h=!0;if(i&&typeof i[u]=="function"&&i[u](p,{actions:s,state:m})===!1&&(h=!1),h){let S=[p],C=`on${Oa(c)}Change`;if(a&&a[u]){let y=a[u](p,m);C=y.callbackName||C,S=y.callbackParams}Tb(f,C,S)}let b=n[u];typeof b=="function"&&(p=b(p));let T=!!r?.[u];on(c,f)&&!T||o({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function Cb(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=on(r,e)?e[r]:e[`default${Oa(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function vt(o){let e=o.getParentState||(()=>null);function t(r){let[i]=Fc(()=>o.initSetupState?o.initSetupState(r):{}),a=Oc(new Set),l=La(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=ve(s);function u(){let I={};l&&(I=Cb(l,r,i));let R={...i,...I};if(o.mapPropsToState){let{fn:x,propertyReads:D}=Fa(o.mapPropsToState,{getProxyTargetFromArgs:A=>A.props,putProxyToArgs:(A,E)=>[{...E,props:A}]}),M=x({props:r,state:R,oldState:null,parentState:s});return a.current=new Set([...a.current,...D]),{...R,...M}}return R}let[d]=Fc(u),p=ve(r),f=(I,R)=>{if(R.type==="REPLACE_STATE")return R.payload;let x=c?.()??null,D=R.payload.mappedState,M=R.payload.updatedPropsToState,A={...I};if(D&&Object.assign(A,D),o.mapPropsToState){let{fn:_,propertyReads:P}=Fa(o.mapPropsToState,{getProxyTargetFromArgs:N=>N.props,putProxyToArgs:(N,G)=>[{...G,props:N}]}),F=_({props:p(),state:A,oldState:I,parentState:x});a.current=new Set([...a.current,...P]),Object.assign(A,F)}return R.type==="ASSIGN_STATE"&&Object.assign(A,R.payload),o.concludeReducer?o.concludeReducer({previousState:I,state:A,updatedProps:M,parentState:x}):A},[m,g]=gb(f,d),h=ve(m),{allowedControlledPropOverrides:b}=o,T=La(()=>Sb(g,h,p,l,b,o.interceptActions,o.mappedCallbacks),[g,l,b]),S=o.Context??Nc(),C=La(()=>({componentState:m,componentActions:T,getComponentState:h,replaceState:I=>{g({type:"REPLACE_STATE",payload:I})},assignState:I=>{g({type:"ASSIGN_STATE",payload:I})}}),[m,T,h]),y=In(r),v=Oc(!1);v.current=!1;let w=o.layoutEffect?yb:bb;return w(()=>{let I=r,R={},x=0,D={},M=0,A={},E=0;if(new Set([...Object.keys(I),...Object.keys(y)]).forEach(F=>{let N=F,G=y[N],H=I[N];if(N!=="children"&&G!==H&&(A[N]={newValue:H,oldValue:G},E++,on(N,r)||on(N,y)))if(l.hasOwnProperty(F)){let B=H,pe=l[F];typeof pe=="function"&&(B=pe(H)),m[N]!==B&&(R[N]=B,x++)}else a.current.has(F)&&(D[N]=I[N],M++)}),M>0||x>0){(o.debugName?ut(typeof o.debugName=="function"?`${o.debugName(I)}:rerender`:`${o.debugName}:rerender`):ut("rerender"))("Triggered by new values for the following props",...Object.keys(R??{}),...Object.keys(D??{}));let N={payload:{mappedState:x?R:null,updatedPropsToState:M?D:null}};if(v.current=!0,g(N),o.onPropChange){for(var P in A)if(A.hasOwnProperty(P)){let{newValue:G,oldValue:H}=A[P];o.onPropChange({name:P,newValue:G,oldValue:H},r,T,m)}}o.onPropsChange&&E&&o.onPropsChange(A,r,T,m)}}),w(()=>{s!=null&&!v.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),_c(()=>()=>{o.cleanup?.(h())}),{contextValue:C,ContextComponent:S}}return{ManagedComponentContextProvider:Xn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Xn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function je(o){return o=o??Nc(),Xn.useContext(o)}import*as Yc from"react";var Gr=()=>Me;var Lc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",kc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Ft="_16lm1iw3b _16lm1iw3c _16lm1iw35",zc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Zn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Hr={1:"_16lm1iw1c",none:"_16lm1iw1d"},Vo={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Vc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Gc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Hc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Kc={none:"_16lm1iwd"},Bc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Kr={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Wc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var jc={none:"_16lm1iw1x"};var $c={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Uc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function qc(o){let{rootClassName:e}=Gr();return Yc.createElement("div",{...o,className:Z(`${e}Footer`,Kr.relative,Zn.flex,Vo.row,o.className)})}import*as Ie from"react";import{useCallback as bp,useContext as nT,useEffect as oT,useRef as rT}from"react";import{createPortal as iT}from"react-dom";function Br(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}import*as Xc from"react";var _e=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return Xc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};import*as Go from"react";var Zc=o=>Go.createElement(_e,{...o},Go.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Go.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Go.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));import*as za from"react";var Qc=o=>za.createElement(_e,{...o},za.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));import*as Va from"react";var Ga=o=>Va.createElement(_e,{...o},Va.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as Ha from"react";var Jc=o=>Ha.createElement(_e,{...o},Ha.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));import*as Ka from"react";var eu=o=>Ka.createElement(_e,{...o},Ka.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as Ba from"react";var tu=o=>Ba.createElement(_e,{...o},Ba.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));import*as Wa from"react";var nu=o=>Wa.createElement(_e,{...o},Wa.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as ja from"react";var ou=o=>ja.createElement(_e,{...o},ja.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as $a from"react";var ru=o=>$a.createElement(_e,{...o},$a.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));import*as nl from"react";import*as qe from"react";import{useEffect as Nb,useState as Ou}from"react";import{useContext as Ib}from"react";import{createContext as wb}from"react";var Ua;function Qn(){return Ua||(Ua=wb(null))}var Q=()=>{let o=Qn();return Ib(o)};import{useContext as vb}from"react";var iu=()=>{let o=Qn(),{state:e}=vb(o);return e};import*as Jn from"react";import{useEffect as Rb,useLayoutEffect as xb,useState as vu}from"react";var au="_1eexc2a6";var lu=ue({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),su="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",cu=ue({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),uu=ue({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),du=ue({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),pu="_12zfob12u _16lm1iw22 _16lm1iw1z";var fu="_12zfob17",mu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",gu=ue({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Ya=ue({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),hu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",bu=ue({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),yu="_12zfob1b _16lm1iw2",Tu="_16lm1iw1",Su="_12zfob16",Cu=ue({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),wu="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var dt="InfiniteIcon";var Iu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Db={transition:"width 0.25s, opacity 0.25s"};function eo(o){let[e,t]=vu(!0),[n,r]=vu(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...Db,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if(Rb(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),xb(()=>{t(!0)},[]),!e)return null;let m={};return Jn.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:Z(l,dt,Iu,`${dt}-filter`)},c?Jn.createElement("div",{"data-name":"index",style:m,className:fu},s):null,Jn.createElement("div",{style:{width:p[0],...f}}),Jn.createElement("div",{style:{width:p[1],...f}}),Jn.createElement("div",{style:{width:p[2],...f}}))}var qa=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((w,I)=>{let R=w.maxSize??r??void 0,x=w.minSize??n??void 0;s.push(x),c.push(R),w.size!=null&&(R!=null&&w.size>R&&(w.size=R),x!=null&&w.size<x&&(w.size=x));let D=w.flex==0?null:w.flex;if(w.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${I} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,i+=w.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((w,I)=>{if(w.flex!=null){let R=d*w.flex,x=w.maxSize??r??void 0,D=w.minSize??n??void 0,M=!1,A=0;x!=null&&R>x&&(p[I]=!0,M=!0,A=x),D!=null&&R<D&&(f[I]=!0,M=!0,A=D),M&&(m+=1,l-=1,a-=w.flex,u-=A)}}),m&&(d=u/a);let g=[],h=0,b=u,T=a,S=0,C=0,y=[];return{items:t.map((w,I)=>{let R={...w},x=w.maxSize??r??void 0,D=w.minSize??n??void 0,M=0,A=p[I],E=f[I],_=A||E,P=w.size??0;if(w.flex!=null){if(_)E&&(M=D),A&&(M=x);else{h+=1;let F=N=>(x!=null&&N>x&&(N=x),D!=null&&N<D&&(N=D),N);h===l?M=F(b):(M=F(Math.round(w.flex*d)),C+=M,b=u-C,T-=w.flex,d=b/T)}P=M,R.flexSize=M}return g.push(M),y.push(P),R.computedSize=P,S+=P,R}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:y,remainingSize:Math.round(e-S)}};function Wr(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}var Xa=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((x,D)=>(x[D]={...o.columnSizing[D]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],c=l.id,u=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,h=s?.computedMinWidth,b=s?.computedMaxWidth,T=s?.computedFlex?"flex":"width",S=!1,C=!1,y=r>0?1:-1,{value:v,clamped:w,diff:I}=Wr(d+r,p,f,y);if(o.shareSpaceOnResize){if(s==null)return n[c]={...n[c],[m]:v},C=w==="min",S=w==="max",{adjustedDiff:v-d,reservedWidth:t,columnSizing:n,minReached:C,maxReached:S,constrained:C||S};let{value:x,clamped:D,diff:M}=Wr(g-r,h,b,y);if(w&&D&&(Math.abs(I)>Math.abs(M)?D=!1:w=!1),!(!w&&!D)){if(w){let A=Wr(g-r-I,h,b,y);x=A.value,D=A.clamped,M=A.diff}else if(D){let A=Wr(d+r+M,p,f,y);v=A.value,w=A.clamped,I=A.diff}}n[c]={...n[c],[m]:v},n[u]={...n[u],[T]:x},C=w==="min"||D==="min",S=w==="max"||D==="max"}else n[c]={...n[c],[m]:v},C=w==="min",S=w==="max";let R=v-d;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?t:t-R,columnSizing:n,minReached:C,maxReached:S,constrained:C||S}};function Ru(o,e){return o+e}function Pb(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var xu=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((b,T)=>(b[T]={...o.columnSizing[T]},b),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((b,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),s=a.map(b=>b.computedFlex?"flex":"width"),c=0,{computedSizes:u}=qa({items:a.map(b=>(b.resizable===!1&&(c+=b.computedWidth),{maxSize:b.computedMaxWidth,minSize:b.computedMinWidth,flex:b.resizable?b.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Ru,0)+r-c,0)}),d=a.map((b,T)=>u[T]-b.computedWidth),p=!0,f=!0,m=!0,g=[];d.forEach((b,T)=>{let S=a[T];if(!S.resizable){g.push(0);return}let C=s[T],y=l[T],v=Pb(n),{maxReached:w,minReached:I,constrained:R,adjustedDiff:x}=Xa({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:v});n[S.id]={...v[S.id],[C]:y+x},g.push(x),w||(f=!1),I||(p=!1),R||(m=!1)});let h=g.reduce(Ru,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:g,adjustedDiff:h,columnSizing:n,reservedWidth:t-h}};var jr;function rn(){if(jr!=null)return jr;let o=we().document??null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),jr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),jr}var Du=["start",void 0,"end"],Pu=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Du.indexOf(r)-Du.indexOf(i)}),o);function Eu(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function Za(o,...e){return Eu(t=>t!=null,o,...e)}function Mu(o,e,...t){return Eu((n,r)=>!(r in o),e,...t)}var $r=Object.freeze({}),Eb={string:$r,number:{}};function Qa(o,e){let t=e.default||$r;return o.type===void 0?t:o.type===null?$r:typeof o.type=="string"?e[o.type]||Eb[o.type]||$r:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var Ur=!0,Mb=!0,Ab=!0,_b="string",to="unknown",Fb=Qt("getComputedVisibleColumns"),Ob=(o,e,t)=>o[t]!==!1,Ja=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},Au=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:g=vn,viewportReservedWidth:h,resizableColumns:b,draggableColumns:T,columnDefaultDraggable:S,columnOrder:C,columnPinning:y,editable:v,columnDefaultEditable:w,columnDefaultFilterable:I,columnDefaultGroupable:R,columnDefaultSortable:x,columnSizing:D,columnTypes:M,columnVisibility:A,columnVisibilityAssumeVisible:E,groupBy:_})=>{let P=0,F={};_.forEach((z,X)=>{z.field&&(F[z.field]=X)});let N=(d||[]).reduce((z,X)=>{let{id:ye,field:Ce}=X;return Ce&&(z[Ce]=X),ye&&(z[ye]=X),z},{}),G=Pu(C===!0?Object.keys(o):C,y),H=G.filter(z=>o[z]?Ob(A,E,z):(Fb(`Column with id "${z}" specified in columnOrder array cannot be found in the columns map.`),!1)),B=new Map,pe=H.map((z,X)=>{let ye=o[z];return B.set(z,X),ye}),de=(f??[]).reduce((z,X,ye)=>(X.id?z[X.id]={sortInfo:X,index:ye}:X.field&&(z[X.field]={sortInfo:X,index:ye}),z),{});function k(z){let X=o[z],ye=Qa(X,M),Ce={minWidth:ye?.minWidth,maxWidth:ye?.maxWidth,width:ye?.defaultWidth,flex:ye?.defaultFlex},$e=Za({width:X?.defaultWidth,flex:X?.defaultFlex,minWidth:X?.minWidth,maxWidth:X?.maxWidth},D[z]);$e.width!=null&&delete Ce.flex,$e.flex!=null&&delete Ce.width,$e=Za(Ce,$e);let L=$e.flex??void 0,He=$e.minWidth??X?.minWidth??t,Et=$e.maxWidth??X?.maxWidth??n,ct=L!=null?void 0:$e.width??(i?void 0:r);return!ct&&L==null&&(i?L=i:ct=He),{size:ct,flex:L,minSize:He,maxSize:Et}}let W=qa({availableSize:Math.max(e.width-(h??0)-(a??rn()),0),maxSize:n,minSize:t,items:H.map(k)}),{computedSizes:se,flexSizes:ce,minSizes:ie,maxSizes:oe}=W,te=[],fe=[],ne=[],V=[];V.length=H.length;let U=new Map,O=new Map,re=0,j=0,K=0,ee=null,Y=[],le=0,me=0,Ve=0;pe.forEach((z,X)=>{let ye=H[X],Ce=se[X],$e=Y[X]=Ja(ye,y);$e==="start"?le+=Ce:$e==="end"?Ve+=Ce:me+=Ce});let Ee=e.width-Ve,Ge=[],Ue=new Map;H.forEach((z,X)=>{let ye=pe[X];Ue.set(z,ye)});let Le=[];Object.keys(o).forEach(z=>{let X=o[z];Le.push(z),Ue.has(z)||Ue.set(z,X)});let Ye=new Map;Ue.forEach((z,X)=>{let ye=B.get(X);ye==null&&(ye=-1);let Ce=ye!=-1,$e=H[ye+1],L=Qa(z,M),He=ye,Et=de[X]?de[X]:z.field?de[z.field]??null:null,ct=Et?.sortInfo??null,Tt=!!ct,Mt=Tt&&ct.dir===1,oa=Tt&&!Mt,ra=Et?.index??-1,vo=Ce?{}:k(X),fr=Ce?se[ye]:vo.size||0,Pe=Ce&&ce[ye]||null,Ze=Ce?ie[ye]||0:vo.minSize||0,kt=Ce?oe[ye]||1e4:vo.maxSize||1e4,Fe=Ce?Ja(X,y):!1,Kn=Ce?ye===H.length-1:!1,mr=He,Gg=Ce?Fe==="start"?j:Fe==="end"?K:P-j:0;Fe=="start"?mr=Ce?He:-1:Fe==="end"?mr=Ce?He-(te.length+ne.length):-1:mr=Ce?He-te.length:-1;let Hg=Ce?Fe==="start"||Fe===!1?P:Ee+K:-1,Kg=Ce?Fe!==ee:!1,Bg=Ce?Kn||Fe!==Ja($e,y):!1,xs=z.cssEllipsis??L.cssEllipsis??l,Wg=z.headerCssEllipsis??L.cssEllipsis??z.cssEllipsis??L.headerCssEllipsis??s??xs,gr=Ce&&(N[X]||z.field||z.groupByForColumn)&&(N[X]||N[z.field||z.groupByForColumn])||null,jg=z.defaultFilterable??L.defaultFilterable??I??!0,$g=v??z.defaultEditable??L.defaultEditable??w??!1,ia=z.dataType||L.dataType||(Array.isArray(z.type)?z.type[0]:z.type)||_b,Ug=z.sortType||L.sortType||ia,Ds=z.filterType||L.filterType||ia,Ps=!1;if(gr!=null&&!gr.disabled){let la=g[Ds];la&&(!la.emptyValues||!la.emptyValues.includes(gr.filter.value))&&(Ps=!0)}let Bn=z.field??L.field,Es=z.valueGetter??L.valueGetter,Ms=z.defaultGroupable??L.defaultGroupable??R??!!Bn;z.groupByForColumn&&(Ms=!1);let aa=z.defaultSortable??L.defaultSortable;aa==null&&!z.groupByForColumn&&Bn==null&&Es==null&&(aa=!1);let As=Bn?F[Bn]!==void 0:!1,Yg=As?F[Bn]:void 0,qg=p??aa??x??Ur,Xg=z.resizable??L.resizable??b??Mb,Ke={colType:L,align:L.align,headerAlign:L.headerAlign,computedVisible:Ce,verticalAlign:L.verticalAlign,defaultHiddenWhenGroupedBy:L.defaultHiddenWhenGroupedBy,valueGetter:Es,valueFormatter:L.valueFormatter,renderValue:L.renderValue,render:L.render,style:L.style,contentFocusable:L.contentFocusable,renderMenuIcon:L.renderMenuIcon,renderSortIcon:L.renderSortIcon,renderRowDetailIcon:L.renderRowDetailIcon,renderSelectionCheckBox:L.renderSelectionCheckBox,renderHeaderSelectionCheckBox:L.renderHeaderSelectionCheckBox,headerStyle:L.headerStyle,headerClassName:L.headerClassName,columnGroup:L.columnGroup,getValueToEdit:L.getValueToEdit,getValueToPersist:L.getValueToPersist,shouldAcceptEdit:L.shouldAcceptEdit,field:Bn,...z,components:{...L.components,...z.components},computedResizable:Xg,computedMinWidth:Ze,computedMaxWidth:kt,computedFlex:Pe,computedDataType:ia,computedEditable:$g,computedSortType:Ug,computedFilterType:Ds,cssEllipsis:xs,headerCssEllipsis:Wg,computedFilterValue:gr,computedFiltered:Ps,computedFilterable:jg,computedGroupable:Ms,computedGroupedBy:As,computedGroupedByIndex:Yg,computedWidth:fr,computedAbsoluteOffset:Hg,computedPinningOffset:Gg,computedVisibleIndexInCategory:mr,computedOffset:P,computedSortable:qg,computedSortInfo:ct,computedSortIndex:ra,computedMultiSort:m,computedSorted:Tt,computedSortedAsc:Mt,computedSortedDesc:oa,computedVisibleIndex:He,computedPinned:Fe,computedDraggable:T??z.defaultDraggable??S??Ab,computedFirstInCategory:Kg,computedLastInCategory:Bg,computedFirst:ye===0,computedLast:Kn,id:X,header:z.header??L.header??z.name??z.field};Ce&&(P+=fr,U.set(Ke.id,Ke),V[ye]=Ke,Fe==="start"&&(te.push(Ke),j+=Ke.computedWidth),Fe==="end"&&(fe.push(Ke),K+=Ke.computedWidth),Fe||(ne.push(Ke),re+=Ke.computedWidth),ee=Fe),Ke.groupByForColumn&&(Ke.computedSortType=z.sortType||L.sortType||to,Ge.push(Ke)),O.set(Ke.id,Ke),Ke.field&&!Ke.groupByForColumn&&!Ye.has(Ke.field)&&Ye.set(Ke.field,Ke)}),Ge.forEach(z=>{z.computedSortable=_u(z,{fieldsToColumn:Ye,sortable:p,columnDefaultSortable:x})});let We=new Map;Le.forEach(z=>{let X=O.get(z);X&&We.set(z,X)}),O.forEach(z=>{We.has(z.id)||We.set(z.id,z)});let yt=c!=null?Math.min(c,j):j,bn=u!=null?Math.min(u,K):K;return{computedRemainingSpace:e.width-(le+Ve+me),computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:K,computedUnpinnedColumnsWidth:re,computedColumnOrder:G,computedPinnedStartColumns:te,computedPinnedEndColumns:fe,computedUnpinnedOffset:j,computedPinnedEndOffset:j+re,computedUnpinnedColumns:ne,computedVisibleColumns:V,computedColumnsMap:O,computedColumnsMapInInitialOrder:We,computedVisibleColumnsMap:U,computedPinnedEndWidth:bn,computedPinnedStartWidth:yt,renderSelectionCheckBox:V.reduce((z,X)=>z||!!X.renderSelectionCheckBox,!1),fieldsToColumn:Ye}};function _u(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r}=e;if(t)return t;let i=o.defaultSortable??o.colType.defaultSortable;if(i!=null)return i;let a=r??Ur;return o.computedSortType!==to&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.groupField,g;if(m){let h=n.get(m),b=h?u.getColumnApi(h.id):void 0;h&&b?g=b.isSortable():g=!1}return g===void 0&&f.valueGetter&&(g=!0),g??r??Ur},!0)}}function et(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function Rn(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=et(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}import*as Fu from"react";var Yr=`${Je}HeaderCell__filter`,el=`${Je}HeaderCell__filterOperator`,tl=Fu.createContext(null);var Lb=`${Yr}__input`,qr=o=>o.stopPropagation();function Nu(o){let{filterOperatorMenuVisibleForColumnId:e}=iu(),{column:t}=Xr(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=Ou(!1),l=qe.useCallback(()=>{a(!0)},[]),s=qe.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return qe.createElement("div",{onPointerUp:qr,onPointerDown:qr,onFocus:l,onBlur:s,className:`${Yr} ${Ya({active:c})}`,style:{height:o.columnHeaderHeight}},qe.createElement(tl.Provider,{value:o},qe.createElement(r,null),qe.createElement(n,null)))}function Lu(){let{columnApi:o,disabled:e,operator:t}=Ho(),n=t?.components?.Icon??eo;return qe.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:Z(el,mu,e?`${el}--disabled`:"")},qe.createElement(n,{size:20,className:`${gu({disabled:e})}`}))}function ku(){return qe.createElement("div",{onPointerUp:qr,onPointerDown:qr,className:`${Yr} ${Ya({active:!1})} ${Vc["50%"]}`})}function Ho(){let o=Q(),{column:e,columnApi:t}=Xr(),n=Rn(e,o,"column-filter"),r=qe.useContext(tl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=Ou(l?.filter.value??""),d=qe.useCallback(h=>{u(h),r.onChange(h)},[r.onChange]),p=qe.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=qe.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);Nb(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==c&&u(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${pu} ${Lb}`}}function no(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Ho();return nl.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function Zr(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Ho();return nl.createElement("input",{"aria-label":o,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:n})}function kb(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:no},operators:[{name:"includes",components:{Icon:Zc},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Ga},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:ru},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Qc},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Zr},operators:[{label:"Equals",components:{Icon:Ga},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:ou},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:eu},fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>t},{name:"gte",components:{Icon:Jc},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>=t},{name:"lt",components:{Icon:nu},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<t},{name:"lte",components:{Icon:tu},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<=t}]}}}var vn=kb();function Qr(o,e,t,n){let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as fd,useState as md}from"react";var zu="_16lm1iw1",Vu="_16lm1iw1 _16lm1iw1c _16lm1iwe",Gu="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Hu="_1yeub2vt",Ku="_1yeub2vs",Bu=ue({defaultClassName:"_1yeub2v3",variantClassNames:{horizontalLayout:{true:"_1yeub2v4",false:"_1yeub2v5"},focused:{true:"_1yeub2v6",false:"_1yeub2v7"},focusedWithin:{true:"_1yeub2v8",false:"_1yeub2v9"},hasPinnedStart:{true:"_1yeub2va",false:"_1yeub2vb"},hasPinnedEnd:{true:"_1yeub2vc",false:"_1yeub2vd"},hasPinnedStartOverflow:{true:"_1yeub2ve",false:"_1yeub2vf"},hasPinnedEndOverflow:{true:"_1yeub2vg",false:"_1yeub2vh"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vi"]]});var ol="_1yeub2vq";var i1=ue({defaultClassName:"_1yeub2vm",variantClassNames:{pinned:{start:"_1yeub2vn",end:"_1yeub2vo",false:"_1yeub2vp"}},defaultVariants:{},compoundVariants:[]});var rl=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};var Ko={bodyWidth:{name:q(ae.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:q(ae.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:q(ae.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:q(ae.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:q(ae.runtime.browserScrollbarWidth),value:""}},zb=q($.scrollbarWidthHorizontal),Wu=q($.scrollbarWidthVertical),Vb=q($.columnWidthAtIndex),Gb=q($.columnZIndexAtIndex),ju=q($.scrollLeft),Hb=q($.activeCellColWidth),$u=q($.activeCellColOffset),Xu=q($.baseZIndexForCells),Kb=q($.pinnedStartWidth),Uu=q($.bodyWidth),Bb=q($.bodyHeight),Yu=q($.pinnedEndOffset),qu=q($.pinnedEndWidth),Wb=q($.computedVisibleColumnsCount);function il(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${Xu}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Zu(o){let e=rn(),{computed:t,state:n,actions:r,getState:i}=Q(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:c,onBlurWithin:u,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:g,wrapRowsHorizontally:h}=n,{computedPinnedStartColumnsWidth:b,computedPinnedEndColumnsWidth:T,computedPinnedStartColumns:S,computedPinnedEndColumns:C,computedVisibleColumns:y,computedUnpinnedColumnsWidth:v,scrollbars:w}=t,I=[],R=y.reduce((P,F)=>{let N=F.computedVisibleIndex;P[Te.columnWidths.varName.get(N)]=F.computedWidth+"px",P[Te.columnOffsets.varName.get(N)]=F.computedPinned==="start"?`calc( ${F.computedOffset}px + var(${ju}) )`:F.computedPinned==="end"?`calc( var(${Yu}) ${I.length?"+":""} ${I.map(H=>Te.columnWidths.get(H.computedVisibleIndex)).join(" + ")} + var(${ju}) )`:`${F.computedOffset}px`;let G=il(F,{pinnedStartColsCount:S.length,visibleColsCount:y.length});return P[`${Gb}-${N}`]=`${G}`,F.computedPinned==="end"&&I.push(F),P},{});if(m.width&&(R[Ko.browserScrollbarWidth.name]=`${rn()}px`),R[Ko.bodyWidth.name]=`calc(${$.bodyWidth} - ${$.scrollbarWidthVertical})`,R[Ko.totalVisibleColumnsWidthValue.name]=`${b+T+v}px`,R[Ko.totalVisibleColumnsWidthVar.name]=`calc(${y.map((P,F)=>`var(${Vb}-${F})`).join(" + ")})`,R[Ko.visibleColumnsCount.name]=y.length,g!=null){R[Hb]=Te.columnWidths.get(g[1]);let P=Te.columnOffsets.get(g[1]);if(n.brain.isHorizontalLayoutBrain){let F=n.brain.getPageIndexForRow(g[0]);R[$u]=F?`calc( ${ae.runtime.totalVisibleColumnsWidthVar} * ${F} + ${P})`:P}else R[$u]=P}R[Wb]=y.length,R[zb]=w.horizontal?`${e}px`:"0px",R[Wu]=w.vertical?`${e}px`:"0px",R[Kb]="calc( "+S.map(P=>Te.columnWidths.get(P.computedVisibleIndex)).join(" + ")+")",R[qu]="calc( "+C.map(P=>Te.columnWidths.get(P.computedVisibleIndex)).join(" + ")+")",R[Xu]=y.length*10,R[Yu]=`calc( var(${Uu}) - var(${qu}) - var(${Wu}) )`,R[Uu]=`${m.width}px`,R[Bb]=`${m.height}px`;let x=rl(P=>{r.focused=P}),D=rl(P=>{r.focusedWithin=P}),E={...o,onFocus:P=>{if(o?.onFocus?.(P),P.target===s.current||P.target===c.current){if(i().focused)return;x(!0),p?.(P),l&&(D(!1),u?.(P));return}l||(D(!0),d?.(P))},onBlur:P=>{if(o?.onBlur?.(P),P.target===s.current||P.target===c.current){if(!i().focused)return;x(!1),f?.(P),l&&(D(!1),u?.(P));return}s.current?.contains(P.relatedTarget)||(D(!1),u?.(P))}},_=Z(Gt,Gu,h?`${Gt}--horizontal-layout`:null,E?.className,b?`${Gt}--has-pinned-start ${Ku}`:null,T?`${Gt}--has-pinned-end ${Hu}`:null,a?`${Gt}--focused`:null,l?`${Gt}--focused-within`:null,a&&n.focusedClassName?n.focusedClassName:null,l&&n.focusedWithinClassName?n.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Gt}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Gt}--has-pinned-end-overflow`:null,Bu({horizontalLayout:!!h,hasPinnedStart:!!b,hasPinnedEnd:!!T,focused:a,focusedWithin:l}));return E.className=_,E.style={...o?.style,...R},a&&n.focusedStyle&&Object.assign(E.style,n.focusedStyle),l&&n.focusedWithinStyle&&Object.assign(E.style,n.focusedWithinStyle),E}var id=Wn(Tn());function Jr(o){return o.map(e=>e instanceof an?e:new an(null,[e]))}var an=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>jb(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function jb(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var $b=(...o)=>new an("+",Jr(o)),Qu=(...o)=>new an("-",Jr(o)),Ub=(...o)=>new an("*",Jr(o)),Yb=(...o)=>new an("/",Jr(o)),Bo={add:$b,subtract:Qu,minus:Qu,multiply:Ub,divide:Yb};var xn=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var Ju=o=>{let e=null,t=null;return{stop(){e!==null&&It(e),t!=null&&It(t)},scroll(n){e!==null&&It(e),t!=null&&It(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=Ae(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=Ae(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Ne=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,n=e.left-this.left;return{top:t,left:n}}};function ed(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function td(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function qb(o,e,t){let n=ed(o,t),r=ed(e,t);return n===r?td(t,e)-td(t,o):n-r}function nd(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>qb(n,r,t)),e}function Xb(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function Zb(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=nd(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function od(o,e){if(Xb(o))return Zb(o,e);o=nd(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(Qb([t,i,a],e))return!0}return!1}function Qb(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var oo=class{containsPoint(e){return od(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var ro=class o extends oo{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(Ne.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function Jb(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,c=Math.max(l,s);return new Se({top:n,left:t,width:a-t,height:c-n})}var Se=class o extends oo{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=Jb(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new ro(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Ne.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var rd=10,ey=q($.pinnedStartWidth);function ad(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:h,horizontalLayoutPageIndex:b,pageWidth:T}=o;function S(V){let U=V==="start"?N:G;return _===F?U:F===V?U+A.computedWidth:_===V?U-A.computedWidth:U}function C(V){if(V.columnIndex===E||b!=null)return!0;let U=e[V.columnIndex];if(U.computedPinned)return!0;let O=l.getScrollPosition().scrollLeft,re=U.computedOffset+(b!=null&&T!=null?T*b:0);return re>=O+S("start")&&re+U.computedWidth<=O+u.width-S("end")}let y=(V,U)=>{let{restrictToParentGroup:O,dragColumn:re}=U,j=[];if(V.forEach(ee=>{if(ee.computedVisibleIndex===E)return;let Y={columnId:ee.id,columnIndex:ee.computedVisibleIndex,offsetX:ee.computedOffset+Math.round(ee.computedWidth/2)};C(Y)&&j.push(Y)}),O){let Y=function(me,Ve,Ee){let Ge=V[me];Ge&&(Ge.columnGroup!==re.columnGroup&&Ee.add(Ge.id),Y(me+Ve,Ve,Ee))};var K=Y;let ee=re.computedVisibleIndex,le=new Set;Y(ee-1,-1,le),Y(ee+1,1,le),j=j.filter(me=>!le.has(me.columnId))}return j},w=r.length,I={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},R={left:I.clientX-u.left-(I.clientX-s.left)+rd,top:I.clientY-u.top-(I.clientY-s.top)+rd},x=l.getScrollPosition(),D=e.map(V=>V.computedVisibleIndex),M=D,A=t.get(i),E=A.computedVisibleIndex,_=A?.computedPinned,P=E,F=_,N=l.getFixedStartColsWidth(),G=l.getFixedEndColsWidth(),H=I,B={x:0,y:0},pe=1,de=0;function k(V){let U=Math.round(V.clientX),O=Math.round(V.clientY);if(U===H.clientX&&O===H.clientY)return Se.from(s).shift({left:B.x,top:B.y});H={clientX:U,clientY:O};let j=l.getScrollPosition().scrollLeft-x.scrollLeft;return B.x=H.clientX-I.clientX,B.y=H.clientY-I.clientY,de=B.x+j,pe=de<0?-1:1,f({left:R.left+B.x,top:R.top+B.y}),Se.from(s).shift({left:B.x,top:B.y})}function W(V){let U=0;_?_==="start"&&V.forEach((O,re)=>{U||e[O]?.computedPinned!=="start"&&(U=re)}):V.forEach((O,re)=>{e[O]?.computedPinned==="start"&&(U=re+1)}),w=U,se("start",V,U)}function se(V,U,O){if(V==="start"){let re=0;for(let j=0;j<O;j++){let K=U[j],ee=e[K];re+=ee.computedWidth}At(ey,`${re}px`,a)}}function ce(V){if(V==null||V===P)return;if(P===-1&&V!==-1&&(_o(E,"",a),m(!1)),P=V,V===-1){ie(E);return}let U=xn(D,E,P>E?P-1:P);w=0;let re=new Set;return U.forEach((j,K)=>{let ee=M[K];j!==ee&&re.add(j),W(U)}),M=U,oe(re),{newColumnIndexes:U,indexesWithTransition:re,pinnedStartCount:w}}function ie(V){M=M.filter(O=>O!==V),e.forEach(O=>{let re=O.computedVisibleIndex,j=re>V;wa(re,a);let K="";j&&(K=Bo.minus(Te.columnOffsets.get(re),Te.columnWidths.get(V)).done()),$n(re,K,a)}),_o(V,"hidden",a),m(!0)}function oe(V){e.forEach(U=>{let O=U.computedVisibleIndex;V.has(O)?wa(O,a):vr(O,a);let re=O===E,j=pe===-1?O<P||O>E:O<E||O>=P,K="";pe===-1?K=re?Te.columnOffsets.get(P):j?Te.columnOffsets.get(O):Bo.add(Te.columnOffsets.get(O),Te.columnWidths.get(E)).done():K=j?Te.columnOffsets.get(O):re?Bo.add(Te.columnOffsets.get(P-1),Te.columnWidths.get(P-1)).minus(Te.columnWidths.get(E)).done():Bo.minus(Te.columnOffsets.get(O),Te.columnWidths.get(E)).done(),$n(O,K,a)})}let te=u.left+S("start"),fe=u.right-S("end"),ne=Ju({scrollOffsetStart:te,scrollOffsetEnd:fe});return k(I),{speedScroller:ne,stop(){ne.stop()},onMove(V){let U=k(V);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(U.getCenter()))return p&&ce(-1),null;ne.scroll({mousePosition:H,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(Y){h.scrollLeft=Y}});let O=y(e,{dragColumn:A,restrictToParentGroup:c==="group"}),re=pe===-1?A.computedOffset+de:A.computedOffset+A.computedWidth+de,j=(0,id.default)(O,re,({offsetX:Y},le)=>Y<le?-1:Y>le?1:0);j<0&&(j=~j),O.length?j=O[j]?O[j].columnIndex:O[O.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),j=0),j===E+1&&(j=E),ce(j);let K={};n.forEach(Y=>{K[Y.id]="end"});for(let Y=0;Y<w;Y++){let le=M[Y],me=e[le];K[me.id]="start"}let ee=M.map(Y=>e[Y].id);return{columnPinning:K,columnOrder:ee}}}}function St(o,e,t){if(o===e)return!0;if(!o||!e)return!1;var n=Object.keys(o),r=Object.keys(e);t&&(n=n.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=n[a];if(!(t&&t.has(l))&&(o[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function al(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return n;if(a>i){let l=e.indexOf(r),s=e[l-1],c=n.indexOf(s),u=n.indexOf(r);return xn(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return xn(n,u,c)}return e}import*as it from"react";var Dn=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var ld=Wn(Tn());var sd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=n,p=c===a,f=Ne.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,b=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),T=(0,ld.default)(h,b,(w,I)=>w-I);T<0&&(T=~T),m===1&&T===u+1&&p&&T--;let S=Math.min(u,T),C=Math.max(u,T),y=p?i.map((w,I)=>{if(I===u&&p)return t;if(I<S||I>=C)return{left:0,top:0};let R=T<=I?1:-1;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}):i.map((w,I)=>{let R=T<=I?1:0;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}),v={offset:t,dropIndex:T,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:y,dragRect:g,status:"accepted"};return e.acceptsDrop(v)?{event:v,error:null,success:!0}:(v.status="rejected",{event:v,error:"rejected by interaction target",success:!1})},cd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=n,d=Ne.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((b,T)=>b.id===c.id?t:f?{left:0,top:0}:T>m?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(b=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var Re=class Re{static startDrag(e,t){let n=e instanceof io?e:new io(e),r=new ll({activeDragSource:n,startPoint:t});return r.on("start",Re.onDragStart),r.on("move",Re.onDragMove),r.on("drop",Re.onDragDrop),r.start(),r}static emit(e,...t){Re.emitter.emit(e,...t)}static on(e,t){return Re.emitter.on(e,t)}static registerDragInteractionTarget(e){if(Re.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return Re.dragInteractionTargetsMap.set(e.listId,e),Re.emit("register",e),()=>{Re.unregisterDragInteractionTarget(e)}}static unregisterAll(){Re.dragInteractionTargetsMap.forEach(e=>{Re.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!Re.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}Re.dragInteractionTargetsMap.delete(e.listId),e.unregister(),Re.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=Re.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;Re.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Re.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=Re.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(Re.dragInteractionTargetsMap.get(r))),Re.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=sd(e,s);if(c){t(s,c),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let c=cd(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Re.withDragMove(e,(c,{event:u})=>{c.move(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null,s=l?.dropTargetListId??null;Re.emit("drag-move",{dragSourceListId:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Re.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;Re.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),Re.unregisterAll()}};Re.dragInteractionTargetsMap=new Map,Re.emitter=new Dn;var pt=Re,io=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){St(this.data,e)||(this.data=e,this.dragRectangle=new Se(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=Se.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},ll=class extends Dn{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=io.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=io.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=pt;import{useEffect as ty}from"react";var ud=it.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),Pn=()=>it.useContext(ud),sl=o=>{let[e,t]=it.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=it.useRef(e);n.current=e;let r=it.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=it.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return ty(()=>{let a=pt.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=pt.on("drag-move",c=>{let u=n.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=pt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[pt,t]),it.createElement(ud.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var cl=`${Je}Body`,dd=o=>o.querySelector(`.${cl}`);var En=`${Je}HeaderCell`,ul=`${Je}HeaderWrapper`,pd=o=>Array.from(o.querySelectorAll(`.${ul}`));var ny=q($.baseZIndexForCells),oy=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:St(o,e)},gd=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=md(null),[a,l]=md(!1),{getCurrentDragSourceAndTarget:s}=Pn(),{actions:c,computed:u,getComputed:d,getState:p,api:f,state:{domRef:m}}=Q(),g=fd(b=>{let T=d().computedVisibleColumnsMap.get(o);if(!T||!T.computedSortable)return;let{multiSortBehavior:S}=p();f.toggleSortingForColumn(o,{multiSortBehavior:S==="replace"&&(b.ctrlKey||b.metaKey)?"append":S})},[]),h=fd(b=>{let T=b.target?.tagName;if(T==="INPUT"||T==="BUTTON")return;let{brain:S,draggableColumnsRestrictTo:C}=p(),{computedVisibleColumns:y,computedVisibleColumnsMap:v,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedPinnedEndColumns:R}=d(),x=v.get(o);if(!x.computedDraggable){g(b);return}let D=e.current,M=D.getBoundingClientRect(),A=m.current.getBoundingClientRect(),E=S.getAvailableSize(),_=x.computedVisibleIndex,P=S.getVirtualColIndex(x.computedVisibleIndex,{pageIndex:t||0}),F=S.isHorizontalLayoutBrain?S.getPageWidth():null,N=D.style.cursor??"auto",G=!1,H=m.current,B=Se.from(dd(H).getBoundingClientRect()),pe=pd(H).map(fe=>Se.from(fe.getBoundingClientRect())),de=B.getMinimumBoundingRectangle(...pe),k=ad({brain:S,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:F,draggableColumnsRestrictTo:C,computedPinnedEndColumns:R,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedVisibleColumns:y,computedVisibleColumnsMap:v,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:f,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:de,initialMousePosition:{clientX:b.clientX,clientY:b.clientY}}),W=null,se,ce;function ie(fe){let{columnPinning:ne,columnOrder:V}=fe;oy(p().columnPinning,ne)||(c.columnPinning=ne);let U=d().computedColumnOrder;JSON.stringify(V,U)&&(y.forEach(O=>{$n(O.computedVisibleIndex,"",m.current)}),c.columnOrder=al({newColumnOrder:V,visibleColumnOrder:d().computedVisibleColumns.map(O=>O.id),existingColumnOrder:U,dragColumnId:o}))}let oe=fe=>{let{headerBrain:ne,brain:V}=p();if(!G){G=!0;let U=V.keepColumnRendered(P),O=ne.keepColumnRendered(P);if(V.isHorizontalLayoutBrain){let j=V.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),K=ne.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ce=()=>{j(),K()}}se=()=>{U(),O()},c.columnReorderDragColumnId=x.id,t!=null&&(c.columnReorderInPageIndex=t),Ca(_,`calc( var(${ny}) + 10000 )`,m.current),m.current?.classList.add(ol),D.style.cursor="grabbing"}W=k.onMove(fe)},te=fe=>{let{multiSortBehavior:ne}=p(),V=e.current;m.current?.classList.remove(ol),k.stop(),S.update({...E}),se?.(),ce?.(),y.forEach(O=>{vr(O.computedVisibleIndex,m.current),$n(O.computedVisibleIndex,"",m.current)}),_o(_,"",m.current),Ca(_,il(x,{pinnedStartColsCount:w.length,visibleColsCount:y.length}),m.current),V.style.cursor=N,V.releasePointerCapture(fe.pointerId),V.removeEventListener("pointermove",oe),V.removeEventListener("pointerup",te),i(null);let U=f.getColumnApi(x.id)?.isSortable()??!1;!G&&U&&f.toggleSortingForColumn(x.id,{multiSortBehavior:ne==="replace"&&(fe.ctrlKey||fe.metaKey)?"append":ne}),W?ie(W):G&&n&&f.setVisibilityForColumn(x.id,!1),c.columnReorderDragColumnId=!1,t!=null&&(c.columnReorderInPageIndex=null)};D.addEventListener("pointermove",oe),D.addEventListener("pointerup",te),D.setPointerCapture(b.pointerId)},[o,t]);return{onPointerDown:u.computedVisibleColumnsMap.get(o)?.computedDraggable?h:g,dragColumnOutside:a,proxyPosition:r}};import*as lo from"react";import*as he from"react";import{useCallback as lt,useContext as by,useMemo as yy}from"react";import*as An from"react";var hd=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import*as Wo from"react";import{useState as ry}from"react";var bd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",yd=ue({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var ei=`${dt}-expand-collapse`;function Mn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=ry(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),on("expanded",o)||i(!r)};Wo.useEffect(()=>{on("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Wo.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:Z(o.className,bd,yd({direction:t||"start",expanded:r,disabled:n}),`${dt}`,`${ei}`,`${ei}--${l}`,`${ei}--${t==="end"?"end":"start"}`,n?`${ei}--disabled`:"")},Wo.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as ti from"react";var Td="_16lm1iwb _16lm1iw1d _16lm1iwk";var Sd=o=>ti.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:Z(o.className,Td,"InfiniteIcon","InfiniteIcon-loading")},ti.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},ti.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Cd=ue({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),wd="_7pupv00",Id=ue({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function vd({rowInfo:o}){return{[q(ae.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function ni({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=n,d=Z(Zn.flex,i.align==="end"?Vo.rowReverse:Vo.row,kc.center,`${_n}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c)?Cd({align:a}):null);if(e==="multi-column"){if(o+1!==u.groupNesting&&u.isGroupRow)return c?An.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return An.createElement("div",{className:d},s,c,An.createElement("div",{className:Ft},l??null))}}function oi({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return hd(u)?f=An.createElement(Sd,null):m&&(f=An.createElement(Mn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=An.createElement(at,{render:n,renderParam:r})),f}}function Rd(o,e,t){let{groupByForColumn:n,groupIndexForColumn:r,groupRenderStrategy:i}=o,a=n.column?{...n.column}:{},l={header:`Group by ${n.field||n.groupField}`,groupByForColumn:n,render:ni({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:oi({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(o,e)}:l={...l,...t}),l}function xd(o,e,t){let n=typeof t=="function"?t(o,e):t,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:ni({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...n,renderGroupIcon:oi({initialRenderGroupIcon:n?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Dd(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}import*as ri from"react";import{useEffect as iy,useRef as ay}from"react";var Pd="qz8ht90 _16lm1iwk";function ly(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:sy}=vt({forwardProps:ly,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function cy(){let{componentState:o,componentActions:e}=je(),{checked:t,domProps:n,disabled:r}=o,i=ay(null);return iy(()=>{i.current.indeterminate=t==null},[t]),ri.createElement("input",{...n,className:Z("InfiniteCheckBox",Pd,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function Ht(o){return ri.createElement(sy,{...o},ri.createElement(cy,null))}function uy(o){return typeof o.field=="string"}function Ed(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?n.get(i.field||i.groupField):void 0}!r&&e.field&&(r=n.get(e.field))}return r}function ft(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",b=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:T,formattedValueContext:{rawValue:S}}=ao({column:p,rowInfo:c,rowDetailState:b,columnsMap:e().computedColumnsMap,context:o}),C=et(p.id,o);return u?{api:a,dataSourceApi:l,column:p,columnApi:C,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:C,column:p,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:S}:{api:a,dataSourceApi:l,columnApi:C,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:S}:{api:a,dataSourceApi:l,columnApi:C,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:S}}function Md(o){return _d(o.column,o.rowInfo)}function Ad(o){let{column:e,context:t,rowInfo:n,visibleColumnsIds:r}=o,i=Ed({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=ao(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:dy({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnsIds:o.visibleColumnsIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function dy(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,b=p(),{selectionMode:T,cellSelection:S}=b,C=Ed({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),y=d.toggleGroupRow,v=S?.isCellSelected(n.id,e.id)??!1,w={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:v,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:C,selectionMode:T,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:h,toggleGroupRow:y,toggleCurrentGroupRow:()=>{n.isGroupRow&&y(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:b.groupBy,pivotBy:b.pivotBy};return Object.defineProperty(w,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),w}function _d(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:uy(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function py(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function ao(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=_d(e,t),a=py(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as Kt from"react";var{rootClassName:Fd}=Me,Fn=`${Fd}Cell`,dl=`${Fd}Cell_content`,fy=q($.columnWidthAtIndex),my=q($.columnReorderEffectDurationAtIndex);function gy(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=o,b=typeof m=="function"?m():m,T={width:`var(${fy}-${i.computedVisibleIndex})`,transition:`transform var(${my}-${i.computedVisibleIndex}, 0s)`,...h.style},S={...h,style:T,"data-column-id":i.id,"data-z-index":T.zIndex,className:Z(h.className,Fn,xc),children:Kt.createElement(Kt.Fragment,null,d,Kt.createElement("div",{className:Z(dl,e?Ft:Bc.hidden,s),style:r},b),u)};c!=null&&(S["data-row-id"]=`${c}`);let C=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return C?Kt.createElement(C,{...S,ref:a}):Kt.createElement("div",{...S,ref:a})}var ii=Kt.memo(gy);import*as On from"react";import{useCallback as Od,useRef as hy}from"react";function Nd(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=pl(),i=hy(null),a=On.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=Od(s=>{let{key:c}=s;c==="Enter"||c==="Tab"?t():c==="Escape"?n():s.stopPropagation()},[]);return On.createElement(On.Fragment,null,On.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:Z(Lc,Kc.none),type:"text",defaultValue:o,onChange:Od(s=>{e(s.target.value)},[])}))}var{rootClassName:Ty}=Me,Sy=q($.columnZIndexAtIndex),Cy=q($.columnVisibilityAtIndex);function wy({rowInfo:o}){return{[q(ae.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}var jo=he.createContext(null),_n=`${Ty}ColumnCell`,Iy=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return he.createElement(Mn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},vy={display:"inline-block",visibility:"visible"},fl=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return he.createElement(Mn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:vy,expanded:n,onChange:t})},Ry=o=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:n,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=o;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||Ht;return he.createElement(u,{domProps:{className:kr},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():n()},checked:e.rowSelected})};function ml(o,e){return o?typeof o=="function"?o(e):o:void 0}function gl(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function xy(o){let{rowInfo:e,rowStyle:t,rowClassName:n,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:c,width:u,column:d,onMouseLeave:p,onMouseEnter:f,onRowMouseEnter:m,onRowMouseLeave:g,rowIndex:h,rowHeight:b,columnsMap:T,fieldsToColumn:S,domRef:C,hidden:y,showZebraRows:v}=o,w=he.useRef(null),I=lt(Pe=>{w.current=Pe,C&&C(Pe)},[C]);if(!d)return he.createElement("div",{ref:I},"no column");let{rowSelected:R}=e,{getState:x,actions:D,computed:M,api:A,getDataSourceMasterContext:E}=Q(),{componentState:_,getState:P,api:F,componentActions:N}=De(),{activeRowIndex:G,keyboardNavigation:H,columnReorderInPageIndex:B}=x(),pe=h===G&&H==="row",de={getState:x,getDataSourceState:P,getDataSourceMasterContext:E,actions:D,dataSourceActions:N,api:A,dataSourceApi:F},k=e.rowDisabled,W=M.computedVisibleColumns.map(Pe=>Pe.id),se=Ad({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:c,columnsMap:T,visibleColumnsIds:W,fieldsToColumn:S,context:de}),{stylingParam:ce,renderParams:ie,formattedValueContext:oe,renderFunctions:te,groupByColumnReference:fe,inEdit:ne}=se,{align:V,verticalAlign:U}=ie,O=ie,re=he.useRef(O),j=m&&f?Pe=>{let kt={...oe,rowIndex:h};m(kt,Pe),f(Pe)}:f,K=g&&p?Pe=>{let Ze={...oe,rowIndex:h,rowInfo:e};g(Ze,Pe),p(Pe)}:p,ee=lt(Pe=>{let Ze=d.computedVisibleIndex;x().cellClick({rowIndex:h,colIndex:Ze,event:Pe})},[h,d.computedVisibleIndex,H]),Y=lt(Pe=>{let Ze=d.computedVisibleIndex;if(x().cellMouseDown({rowIndex:h,colIndex:Ze,event:Pe}),H==="row"){k||(D.activeRowIndex=h);return}H==="cell"&&(D.activeCellIndex=[h,Ze])},[h,k,d.computedVisibleIndex,H]),{selectionMode:le,cellSelection:me,isNodeReadOnly:Ve}=_,Ee=O.cellSelected;O.domRef=I,O.htmlElementRef=w,O.toggleCurrentTreeNode=lt(O.toggleCurrentTreeNode,[e]),O.selectCell=lt(O.selectCell,[e]),O.deselectCell=lt(O.deselectCell,[e]),O.selectCurrentRow=lt(O.selectCurrentRow,[e]),O.deselectCurrentRow=lt(O.deselectCurrentRow,[e]),O.toggleCurrentGroupRow=lt(O.toggleCurrentGroupRow,[e]),O.toggleCurrentRowSelection=lt(O.toggleCurrentRowSelection,[e]),O.toggleCurrentGroupRowSelection=lt(O.toggleCurrentGroupRowSelection,[e]),O.toggleCurrentTreeNodeSelection=lt(O.toggleCurrentTreeNodeSelection,[e]);let Ge=d.components?.Editor??Nd,Ue=ne?he.createElement(kd,{contextValue:O},he.createElement(Ge,null)):null,Le=lt(Qe(()=>{if(y||ne)return null;if(re.current=O,te.renderGroupIcon&&(O.renderBag.groupIcon=he.createElement(at,{render:te.renderGroupIcon,renderParam:{...O,renderBag:{...O.renderBag}}})),te.renderSelectionCheckBox&&le=="multi-row"&&(O.renderBag.selectionCheckBox=he.createElement(at,{render:Ry,renderParam:O}),te.renderSelectionCheckBox!==!0&&(O.renderBag.selectionCheckBox=he.createElement(at,{render:te.renderSelectionCheckBox,renderParam:{...O,renderBag:{...O.renderBag}}}))),e.isTreeNode){let{isParentNode:kt}=e,Fe;Fe=(kt?te.renderTreeIconForParentNode:te.renderTreeIconForLeafNode)||typeof te.renderTreeIcon=="function"?te.renderTreeIcon:kt&&te.renderTreeIcon===!0?fl:void 0,Fe===!0?Fe=fl:Fe&&(O.renderBag.treeIcon=he.createElement(at,{render:fl,renderParam:O})),Fe&&(O.renderBag.treeIcon=he.createElement(at,{render:Fe,renderParam:{...O,renderBag:{...O.renderBag}}}))}te.renderRowDetailIcon&&(O.renderBag.rowDetailsIcon=he.createElement(at,{render:Iy,renderParam:{...O,renderBag:{...O.renderBag}}}),typeof te.renderRowDetailIcon=="function"&&(O.renderBag.rowDetailsIcon=he.createElement(at,{render:te.renderRowDetailIcon,renderParam:{...O,renderBag:{...O.renderBag}}}))),te.renderValue&&(O.renderBag.value=he.createElement(at,{render:te.renderValue,renderParam:{...O,renderBag:{...O.renderBag}}})),e.isGroupRow&&te.renderGroupValue&&(O.renderBag.value=he.createElement(at,{render:te.renderGroupValue,renderParam:{...O,renderBag:{...O.renderBag}}})),!e.isGroupRow&&te.renderLeafValue&&(O.renderBag.value=he.createElement(at,{render:te.renderLeafValue,renderParam:{...O,renderBag:{...O.renderBag}}})),re.current=O;let Pe=O.renderBag.value;Pe instanceof Date&&(Pe=Pe.toLocaleDateString());let Ze=he.createElement(he.Fragment,null,V!=="end"?O.renderBag.treeIcon:null,V!=="end"?O.renderBag.groupIcon:null,V!=="end"?O.renderBag.rowDetailsIcon:null,V!=="end"?O.renderBag.selectionCheckBox:null,Pe,V==="end"?O.renderBag.selectionCheckBox:null,V==="end"?O.renderBag.rowDetailsIcon:null,V==="end"?O.renderBag.groupIcon:null,V==="end"?O.renderBag.treeIcon:null);return d.render?he.createElement(at,{render:d.render,renderParam:{...O,renderBag:{...O.renderBag,all:Ze}}}):Ze}),[d,y,ne,c,d.renderTreeIcon||d.renderTreeIconForParentNode?Ve:!1,...Dd(O,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),Ye=M.computedVisibleColumns.map(Pe=>Pe.id),We=M.computedColumnOrder,yt={...oe,visibleColumnIds:Ye,allColumnIds:We,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(yt,"rowHasSelectedCells",{get(){return e.hasSelectedCells(Ye)}});let bn=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),st=typeof n=="function"?n(yt):n,z;fe?.className&&(z=ml(fe.className,ce)),s&&(z=Z(z,ml(s,ce))),d.className&&(z=Z(z,ml(d.className,ce))),bn&&(z=Z(z,Id({align:V})));let X;e.dataSourceHasGrouping&&d.groupByForColumn&&(X=vd({rowInfo:e})),bn&&(X=wy({rowInfo:e})),t&&(X=typeof t=="function"?{...X,...t(yt)}:{...X,...t}),l&&(X=gl(X,l,ce)),fe?.style&&(X=gl(X,fe.style,ce)),d.style&&(X=gl(X,d.style,ce)),X=X||{},X.height=b,X.zIndex=`var(${Sy}-${d.computedVisibleIndex})`,X.visibility=`var(${Cy}-${d.computedVisibleIndex}, visible)`;let ye=yy(()=>X,[X?JSON.stringify(X):null]),Ce=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:h)%2===1,$e=v?Ce?"odd":"even":!1,L=!1,He=!1,Et=!1,ct=!1;if(me&&Ee){let Pe=a(),Ze=Pe[e.indexInAll-1],kt=Pe[e.indexInAll+1],Fe=M.computedVisibleColumns[d.computedVisibleIndex+1],Kn=M.computedVisibleColumns[d.computedVisibleIndex-1];L=Ze?!me.isCellSelected(Ze.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?He=!0:He=Kn?!me.isCellSelected(e.id,Kn.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?Et=!0:Et=Fe?!me.isCellSelected(e.id,Fe.id):!0,ct=kt?!me.isCellSelected(kt.id,d.id):!0}let Tt=me&&Ee?{top:L,left:He,right:Et,bottom:ct}:null,Mt=B!=null?i!==B:!1,oa=Ue,ra=Le(),vo={domRef:I,cellType:"body",column:d,width:u,rowId:e.id,horizontalLayoutPageIndex:i,style:ye,onMouseLeave:K,onMouseEnter:j,onClick:ee,afterChildren:oa,onMouseDown:Y,cssEllipsis:d.cssEllipsis??!0,className:Z(Tt?Pc(Tt):"",Qr(d,[_n,Fn],Dc,{dragging:!1,insideDisabledDraggingPage:Mt,zebra:$e,align:V,verticalAlign:U,rowDisabled:k,rowActive:pe,cellSelected:Ee,rowSelected:R,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),z,st),renderChildren:lt(()=>ra,[Le])},fr=jo.Provider;return he.createElement(fr,{value:re.current},he.createElement(ii,{...vo}))}var Ld=he.memo(xy);function ai(){return by(jo)}function pl(){let{api:o,state:{editingValueRef:e,editingCell:t}}=Q(),{column:n,rowInfo:r}=ai(),[i]=he.useState(()=>t?.value),[a,l]=he.useState(i),s=t?!t.active&&!!t.waiting:!1,c=he.useCallback(f=>{e.current=f,l(f)},[]);he.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function $o(o){return o.render(o.renderParam)??null}function at(o){let e=jo.Provider;return lo.createElement(e,{value:o.renderParam},lo.createElement($o,{render:o.render,renderParam:o.renderParam}))}function kd(o){let e=jo.Provider;return lo.createElement(e,{value:o.contextValue},o.children)}function ln(o){let e=li.Provider;return lo.createElement(e,{value:o.renderParam},lo.createElement($o,{render:o.render,renderParam:o.renderParam}))}import*as sn from"react";var Dy={width:"100%",pointerEvents:"none"},hl=`${dt}-menu`,bl=Br({"data-name":""}),yl={[bl["data-name"]]:"menu-icon"};function Uo(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...Dy,borderTop:`${ae.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return sn.createElement("div",{...n,style:e,...yl,onPointerDown:s=>s.stopPropagation(),className:Z(t,bu({menuVisible:i,reserveSpaceWhenHidden:r}),dt,`${dt}-menu`)},a??sn.createElement(sn.Fragment,null,sn.createElement("div",{className:hl,style:l}),sn.createElement("div",{className:hl,style:l}),sn.createElement("div",{className:hl,style:l})))}import*as so from"react";import{useEffect as Py,useState as Vd}from"react";var zd="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Ey={transition:"width 0.25s, opacity 0.25s"};function si(o){let[e,t]=Vd(!0),[n,r]=Vd(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Ey,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};Py(()=>{let b=i!=0?1:0;if(!e&&b&&t(!0),b!==n){let T=requestAnimationFrame(()=>{r(b)});return()=>{cancelAnimationFrame(T)}}return()=>{}},[i,e]);let g=()=>{let T=!(n===0&&i===0);T!==e&&t(T)};if(!e&&!o.forceSize)return null;let h={};return i===-1&&(h.top="100%"),so.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:Z(s,dt,zd,`${dt}-sort`)},u?so.createElement("div",{"data-name":"index",style:h,className:Su},c):null,so.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),so.createElement("div",{style:{width:f[1],...m}}),so.createElement("div",{style:{width:f[2],...m}}))}import*as jd from"react";import{useCallback as Wd}from"react";import{useRef as Kd,useState as My}from"react";import*as Yo from"react";function Gd(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Te.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Te.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?Sa(l,i,n.current):Te.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){Sa(c,i,n.current);continue}c.computedPinned!=="end"&&Te.columnOffsets.set(l,c.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||Te.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function Hd(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,c=i.current;if(n.forEach((u,d)=>{s+=u;let p=o[d],f=r[p],m=f.computedWidth+u;Te.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&Te.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&Te.columnOffsets.set(u,d.computedOffset+s,c)}}}}var ci="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",ui=ue({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0},"zneyzhn"]]}),di=ue({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:Ay}=Me,_y=`${Ay}HeaderCell_ResizeHandle`;function Fy(o){let{state:{brain:e,headerBrain:t}}=Q(),n=Kd(null),[r,i]=My(!1),a=Kd(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,b=g.pointerId,T=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let I=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),R=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{I(),R()}}S.setPointerCapture(b);let C=Gd(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),y=(I,{done:R}={})=>{s&&(I=I/(s+1),R&&(I=Math.round(I))),c==="end"&&(I*=-1);let{adjustedDiff:x,constrained:D}=o.computeResize({diff:I,shareSpaceOnResize:h});return a.current!==D&&i(D),C.resize(x),x},v=I=>{y(Math.round(I.clientX-T))},w=I=>{S.releasePointerCapture(b),S.removeEventListener("pointermove",v),S.removeEventListener("pointerup",w);let R=Math.round(I.clientX-T),x=y(R,{done:!0});p(),o.onResize({diff:x,shareSpaceOnResize:h})};S.addEventListener("pointermove",v),S.addEventListener("pointerup",w)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Yo.createElement("div",{ref:n,className:`${_y} ${ci} ${di({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},Yo.createElement("div",{style:m,className:ui({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Bd=Yo.memo(Fy);function $d(o,e){let{computed:{computedVisibleColumns:t},getState:n,getComputed:r,actions:i}=Q(),a=Wd(({diff:c,shareSpaceOnResize:u})=>{let d=n(),{columnSizing:p,viewportReservedWidth:f,bodySize:m}=d,g=r().computedVisibleColumns,h=!1,b=g.reduce((C,y)=>(y.computedFlex&&(C[y.id]={...p[y.id],flex:y.computedWidth},h=!0),C),{}),T=h?{...p,...b}:p;return Xa({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:f||0,dragHandleOffset:c,dragHandlePositionAfter:o.computedVisibleIndex,columnSizing:T,items:g.map(C=>({id:C.id,computedFlex:C.computedFlex,computedWidth:C.computedWidth,computedMinWidth:C.computedMinWidth,computedMaxWidth:C.computedMaxWidth}))})},[o]),l=Wd(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a]);return o.computedResizable?jd.createElement(Bd,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}import*as Xe from"react";import{useCallback as Tl,useEffect as Sl}from"react";var Ud=ue({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Yd=ue({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function qd(o,e){return St(o,e)}var pi=class extends Dn{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return qd(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return qd(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=u.filter(f=>f!==r):d=xn(u,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var Zd=Xe.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),qo=()=>Xe.useContext(Zd),Oy=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},Ny=o=>`${o.getAttribute(cn)}`;function Ly(o){let e=o.current?.querySelectorAll(fi)??[];return!e||e.length,Array.from(e).map(n=>{let r=Ny(n),i=n.getBoundingClientRect();return{id:r,rect:i}})}function ky(o){let{domRef:e,orientation:t,dragListId:n}=o,r=Se.from(e.current.getBoundingClientRect());return{draggableItems:Ly(e),orientation:t,listId:n,listRectangle:r,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial}}function Qd(o){return new pi(ky(o))}function zy(o,e){let t=ve(e),[n,r]=Xe.useState(null),i=Tl(l=>{if(l)pt.registerDragInteractionTarget(l);else{let s=a();s&&pt.unregisterDragInteractionTarget(s)}r(l)},[]),a=ve(n);return Sl(()=>pt.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&c?.includes(p.listId)){let f=Qd({domRef:o,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}var Nn=o=>{let e=Xe.useRef(null),{dropTargetListId:t,dragSourceListId:n}=Pn(),{updateDragOperationSourceAndTarget:r,dragItemId:i,status:a}=Pn(),l=ve(o.onDrop),s=ve(o.onAcceptDrop),c=ve(o.onRemove),u=ve(o.updatePosition??Oy),{interactionTarget:d,setInteractionTarget:p}=zy(e,o);Sl(()=>{let y=document.querySelector(`[${Xd}="${o.dragListId}"]`);y?e.current=y:console.warn(`DragList with id "${o.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[o.dragListId]),Sl(()=>{if(d){let y=o.dragListId,v=d.on("start",({dragItem:R,dragSourceListId:x,dropTargetListId:D})=>{r({dragSourceListId:x,dropTargetListId:D,dragItemId:R.id,status:"accepted"})}),w=d.on("move",({offsetsForItems:R,items:x,status:D})=>{if(D==="rejected")return;let M=m(),A=u();x.forEach((E,_)=>{let P=R[_],F=M[_];F&&A({id:E.id,node:F,offset:P})})}),I=d.on("drop",R=>{let{sortedIndexes:x,dragIndex:D,dropIndex:M,dragItem:A,items:E,dragSourceListId:_,dropTargetListId:P,outside:F,status:N}=R,G=m();f.current=[];let H=s(),B=c(),pe=l(),de=u();E.forEach((se,ce)=>{let ie=G[ce];ie&&de({id:se.id,node:ie,offset:null})}),y===P&&_!==y&&H&&N==="accepted"&&H({dragItemId:A.id,dragSourceListId:_,dropTargetListId:P,dragIndex:D,dropIndex:M,dropItemId:E[M]?.id});let W=null;M===-1&&_===y&&P===y&&F&&(W=B),M!==-1&&P===y&&_===y&&(W=pe),W&&W?.(x,{dragIndex:D,dropIndex:M,dragItemId:E[D].id,dropItemId:E[M]?.id})});return()=>{v(),w(),I()}}},[d,o.dragListId]);let f=Xe.useRef([]),m=Tl(()=>{let y=f.current;return(!y||y.length===0)&&(y=Array.from(e.current?.querySelectorAll(fi)??[]),f.current=y),y},[]),g=Tl(y=>{let v=y.currentTarget,w=v.getAttribute(cn);if(w==null){let F=tn(v,fi);F&&(w=F.getAttribute(cn))}if(w==null){console.warn("Could not find drag item id for element",v,`Make sure you have a parent element with a ${cn} attribute`);return}w=`${w}`;let I=null,R=Array.from(e.current?.querySelectorAll(fi)??[]);f.current=R;let x=Qd({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0}),D=x.getData().draggableItems,M=D.findIndex(F=>F.id===w),A=D[M];p(x);let E={left:y.clientX,top:y.clientY},_=F=>{I||(I=pt.startDrag({listId:o.dragListId,dragItem:A,dragIndex:M},E)),I.move({left:F.clientX,top:F.clientY})},P=()=>{if(we().removeEventListener("pointermove",_),!I){p(null);return}I.drop(),I=null};we().addEventListener("pointermove",_),we().addEventListener("pointerup",P,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside]),h=y=>y===void 0?i!=null:`${y}`===i,b=!!i,T=Xe.useMemo(()=>({dragItemId:i,onDragItemPointerDown:g,dragSourceListId:n,dropTargetListId:t,status:a,dragListId:o.dragListId,draggingInProgress:b}),[i,g,h,b,n,t,o.dragListId]),S={className:Z("DragList",b?"DragList--dragging":"",Ud({dragging:b})),[Xd]:o.dragListId},C=typeof o.children=="function"?o.children(S,T):o.children;return Xe.createElement(Zd.Provider,{value:T},C)},Xd="data-drag-list-id",cn="data-drag-item-id",fi=`[${cn}]`,Vy=Xe.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),Gy=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=qo(),l=i===n&&r===`${o.id}`,s=Xe.useMemo(()=>({dragItemId:o.id,active:l,dragListId:n,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,l,t,i,a]),c={"data-drag-item-id":`${o.id}`,onPointerDown:e,className:Z("DraggableItem",l?"DraggableItem--active":"",Yd({active:l,draggingInProgress:t}))},u=typeof o.children=="function"?o.children(c,s):o.children;return Xe.createElement(Vy.Provider,{value:s},u)};Nn.DraggableItem=Gy;import*as Cl from"react";var Jd=o=>Cl.createElement(_e,{...o,viewBox:"0 -960 960 960"},Cl.createElement("path",{d:"m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"}));import*as Zo from"react";function ep(){return{}}var tp=o=>({allowColumnHideWhileDragging:e=>e??!0});import{createContext as Hy}from"react";var Ky=Hy(null);function wl(){return Ky}import*as Rt from"react";function np(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let p=u.id,f=o[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let b={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],b);let T=u.columnGroup,S,C=b;for(;T;){let y=e[T];if(y){g.add(T);let v=[p,...g];S=h.has(T)?i.get(T):void 0,S||(S={id:T,type:"group",ref:y,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[T],computedWidth:0,computedPinned:b.computedPinned,depth:t.get(T)??0},r.set(v,S),i.set(T,S)),S.columnItems.push(b),S.uniqueGroupId.push(b.id),C&&!h.has(C.id)&&S.children.push(C),C=S,T=y.columnGroup}else break}});let l=[],s=new J,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&op(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=n+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function op(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&op(t.children),e+=n})}import*as un from"react";import{useCallback as vl,useEffect as Yy,useRef as qy}from"react";import*as Il from"react";import*as lp from"react";import{useCallback as ap}from"react";import{useRef as rp,useState as By}from"react";import*as Xo from"react";var{rootClassName:Wy}=Me,jy=`${Wy}HeaderCell_ResizeHandle`;function $y(o){let e=rp(null),[t,n]=By(!1),r=rp(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=Hd(o.groupColumns.map(C=>C.computedVisibleIndex),{columns:o.columns,domRef:e}),b=C=>{a==="end"&&(C*=-1);let{constrained:y,adjustedDiffs:v,adjustedDiff:w}=o.computeResize(C);return r.current!==y&&n(y),h.resize(v),w},T=C=>{if(g){let y=o.groupColumns.reduce((I,R)=>I+R.computedWidth-R.computedMinWidth,0),v=o.brain.getAvailableSize(),w={width:v.width+y,height:v.height};o.brain.update(w),g=!1}b(Math.round(C.clientX-f))},S=C=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",T),m.removeEventListener("pointerup",S);let y=Math.round(C.clientX-f),v=b(y);o.onResize(v)};m.addEventListener("pointermove",T),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ae.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Xo.createElement("div",{ref:e,className:`${jy} ${ci} ${di({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Xo.createElement("div",{style:{...u,...o.style},className:ui({constrained:t})}))}var ip=Xo.memo($y);function sp(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:c}=Q(),u=o[o.length-1],d=ap(g=>{let h=l(),{columnSizing:b,viewportReservedWidth:T,bodySize:S}=h,C=s().computedVisibleColumns,y=!1,v=C.reduce((R,x)=>(x.computedFlex&&(R[x.id]={...b[x.id],flex:x.computedWidth},y=!0),R),{}),w=y?{...b,...v}:b;return xu({availableSize:S.width,reservedWidth:T||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:w,columnGroupSize:o.length,items:C.map(R=>({id:R.id,resizable:R.computedResizable,computedFlex:R.computedFlex,computedWidth:R.computedWidth,computedMinWidth:R.computedMinWidth,computedMaxWidth:R.computedMaxWidth}))})},[u]),p=ap(g=>{let{columnSizing:h,reservedWidth:b}=d(g);c.viewportReservedWidth=b,c.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?lp.createElement(ip,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var cp=`${Je}HeaderGroup`,up=q($.columnWidthAtIndex),Uy=q($.columnZIndexAtIndex);function dp(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=sp(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(f=>`var(${up}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${up}-${c.computedVisibleIndex})`,d=`calc(var(${Uy}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,Il.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:Z(hu,cp),style:p,"data-z-index":d},Il.createElement("div",{className:Z(`${cp}__header-content`,Ft)},a),s)}var{rootClassName:Xy}=Me,Zy=[],pp=`${Xy}Header`,Qy=du({overflow:!1}),Jy=o=>{};function eT(o){let{bodyBrain:e,columns:t,style:n,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=o,{computed:s,getState:c,state:{headerBrain:u,headerOptions:d,showColumnFilters:p,headerRenderer:f,headerOnRenderUpdater:m}}=Q(),{computedColumnsMap:g}=s,h=qy(null),b=vl(y=>{h.current&&(h.current.style.transform=`translate3d(-${y.scrollLeft}px, 0px, 0px)`)},[]);Yy(()=>{let y=u.onScroll(b);return b(u.getScrollPosition()||{scrollLeft:0,scrollTop:0}),y},[u]);let T={ref:h,className:Z(pp,`${pp}--virtualized`,r,Qy),style:{...n,height:i}},S=vl(y=>{let{rowIndex:v,colIndex:w,domRef:I,height:R,widthWithColspan:x,heightWithRowspan:D,hidden:M}=y,A=t[w];if(!A||M)return null;let E=u.isHorizontalLayoutBrain?u.getPageIndexForRow(v):null,_=a?a.pathsToCells.get([v,w]):null;if(_&&_.type==="group"){let P=_.columnItems.map(G=>G.ref),F={..._.ref,id:_.id,uniqueGroupId:_.uniqueGroupId,depth:_.depth,columns:P.map(G=>G.id),computedWidth:_.computedWidth,groupOffset:_.groupOffset};return c().columnGroupVisibility[_.id]!==!1?un.createElement(dp,{horizontalLayoutPageIndex:E,bodyBrain:e,columnGroupsMaxDepth:l,domRef:I,columns:P,width:x,height:R,columnGroup:F}):null}return un.createElement(mp,{domRef:I,column:A,horizontalLayoutPageIndex:E,headerOptions:d,width:x,height:D,columnsMap:g})},[d,t,i,a,l,p,u]),C=vl(y=>{},[]);return un.createElement(Nn,{orientation:"horizontal",dragListId:"header",onDrop:C,updatePosition:Jy},y=>un.createElement("div",{...y,...T,className:Z(y.className,T.className)},un.createElement(Or,{name:"header",renderCell:S,brain:u,renderer:f,onRenderUpdater:m,cellHoverClassNames:Zy,cellDetachedClassNames:zr})))}var fp=un.memo(eT);function gp(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,r=Q(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:c,columnGroupsDepthsMap:u,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,g=m*c+(f?c:0),h=Rt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return np(l,p,u,d)},[l,p,u]),b=Rt.useCallback(({rowIndex:w,colIndex:I})=>{let R=l[I],x=1,D=1;if(!R||!h)return{rowspan:x,colspan:D};let M=h.pathsToCells.get([w,I]);if(!M)return{rowspan:x,colspan:D};if(M.type==="column")return{colspan:D,rowspan:m-M.depth};let A=M.columnItems.findIndex(E=>E.id===R.id);return{rowspan:x,colspan:A===0?M.columnItems.length:1}},[p,d,l,h,m,u]),T=Rt.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).rowspan,[b]),S=Rt.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).colspan,[b]),C=Rt.useCallback(w=>f?w<m-1?c:2*c:c,[m,f,c]);Vr(e,{colWidth:s,rowHeight:C,rows:m,cols:l.length,height:g,rowspan:T,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let y=Rt.createElement(fp,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:g,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:h}),v=n.vertical&&rn()?Rt.createElement("div",{className:yu,style:{zIndex:1e3,width:rn()}}):null;return Rt.createElement("div",{className:`${ul} ${wu}`,style:{height:g}},y,v)}var{ManagedComponentContextProvider:tT}=vt({initSetupState:ep,forwardProps:tp,Context:wl()});function Rl(o){let e=Q(),{state:t,getComputed:n}=e,{header:r,brain:i,headerBrain:a,wrapRowsHorizontally:l}=t,{scrollbars:s}=n();return r?Zo.createElement(tT,{...o},Zo.createElement(gp,{wrapRowsHorizontally:!!l,bodyBrain:i,headerBrain:a,scrollbars:s})):null}function hp(){return Zo.useContext(wl()).componentState}var aT=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||Ht;return Ie.createElement(s,{domProps:{className:kr},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},li=Ie.createContext(null);var lT=q($.columnZIndexAtIndex),sT=q($.columnVisibilityAtIndex),xl=Ie.createElement("div",{className:Hr[1]}),yp=Br({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[cn]:""});function mp(o){let e=o.column,{allowColumnHideWhileDragging:t}=hp(),{onDragItemPointerDown:n}=qo(),{api:r,getComputed:i,getState:a,actions:l,state:{showColumnFilters:s,components:c,portalDOMRef:u,columnHeaderHeight:d,columnReorderDragColumnId:p,columnMenuVisibleForColumnId:f,columnReorderInPageIndex:m},getDataSourceMasterContext:g}=Q(),{api:h,componentActions:b,getState:T,componentState:{filterDelay:S,filterTypes:C}}=De(),{allRowsSelected:y,someRowsSelected:v,selectionMode:w}=Jt(),I=o.horizontalLayoutPageIndex,R=p===e.id,x=m!=null?I!==m:!1,{onResize:D,height:M,width:A,headerOptions:E,columnsMap:_}=o,P=e.computedSortInfo,F=e.header,N=bp(L=>{ne.current=L,o.domRef?.(L)},[o.domRef]),G=E.alwaysReserveSpaceForSortIcon,H=e.headerAlign??e.align,B=(typeof H=="function"?H({isHeader:!0,column:e}):H)??"start",pe=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",de=et(e,{actions:l,api:r,dataSourceActions:b,dataSourceApi:h,getComputed:i,getDataSourceState:T,getDataSourceMasterContext:g,getState:a}),k=de.isSortable(),W=k&&(e.computedSorted||G)?Ie.createElement(si,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ae.spacing[2],marginInlineEnd:ae.spacing[2]},className:`${En}__sort-icon ${Tu} ${Cu({align:B})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,ce=e.computedFilterable&&e.computedFiltered?Ie.createElement(eo,null):null,ie=e.headerCssEllipsis??e.cssEllipsis??!0,oe={reserveSpaceWhenHidden:B==="center",menuVisible:f===e.id,style:B==="end"?{marginInlineStart:`calc(${ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ae.spacing[2]}:{marginInlineEnd:`calc(${ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ae.spacing[2]},domProps:{onMouseDown:L=>{L.stopPropagation(),de.toggleContextMenu(L.target)}}},te=e.components?.MenuIcon||c?.MenuIcon||Uo,fe=Ie.createElement(te,{...oe}),ne=rT(null),V={horizontalLayoutPageIndex:I,dragging:R,domRef:N,htmlElementRef:ne,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:P,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:v,allRowsSelected:y,selectionMode:w,api:r,dataSourceApi:h,columnApi:de,renderBag:{sortIcon:W,filterIcon:ce,menuIcon:fe,menuIconProps:oe,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},U=V,O=U.renderBag.header,re=()=>{let L={...V,renderBag:{...V.renderBag}};if(e.renderSortIcon&&(L.renderBag.sortIcon=Ie.createElement(ln,{render:e.renderSortIcon,renderParam:{...L,renderBag:{...L.renderBag}}})),e.renderFilterIcon&&(L.renderBag.filterIcon=Ie.createElement(ln,{render:e.renderFilterIcon,renderParam:{...L,renderBag:{...L.renderBag}}})),typeof e.renderMenuIcon=="function"&&(L.renderBag.menuIcon=Ie.createElement(ln,{render:Tt=>{if(typeof e.renderMenuIcon!="function")return null;let Mt=e.renderMenuIcon(Tt);return Mt?Mt.type===te||Mt.type===Uo?Mt:Ie.createElement(te,{...oe},Mt):null},renderParam:{...L,renderBag:{...L.renderBag}}})),e.renderSelectionCheckBox&&w==="multi-row"){L.renderBag.selectionCheckBox=Ie.createElement(ln,{render:aT,renderParam:{...L,renderBag:{...L.renderBag}}});let Tt=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Tt&&Tt!==!0&&(L.renderBag.selectionCheckBox=Ie.createElement(ln,{render:Tt,renderParam:{...L,renderBag:{...L.renderBag}}}))}F instanceof Function&&(L.renderBag.header=O=Ie.createElement(ln,{render:F,renderParam:{...L,renderBag:{...L.renderBag}}}));let He=e.renderMenuIcon===!1?null:L.renderBag.menuIcon,Et=ie?Ie.createElement("div",{className:Ft},L.renderBag.header):L.renderBag.header,ct=Ie.createElement(Ie.Fragment,null,B==="center"?xl:null,L.renderBag.selectionCheckBox,Et,L.renderBag.sortIcon,L.renderBag.filterIcon,B==="center"?xl:null,B!=="center"?xl:null,He);return e.renderHeader?Ie.createElement(ln,{render:e.renderHeader,renderParam:{...L,renderBag:{...L.renderBag,all:ct}}}):ct};oT(()=>{let L=null,He=ne.current;return D&&He&&(L=Eo(He,D)),()=>{L?.()}},[ne.current,o.onResize]);let j={height:M};e.headerStyle&&(j=typeof e.headerStyle=="function"?{...j,...e.headerStyle(U)||{}}:{...j,...e.headerStyle});let K=typeof e.headerClassName=="function"?e.headerClassName(U):e.headerClassName,{onPointerDown:ee,proxyPosition:Y,dragColumnOutside:le}=gd({columnId:e.id,domRef:ne,horizontalLayoutPageIndex:I,allowColumnHideOnDrag:t}),me=null,Ve=li.Provider,Ee={filtered:e.computedFiltered,verticalAlign:pe,align:B},Ge=Ie.useMemo(()=>{let L=He=>{r.setColumnFilter(e.id,He)};return S>0?zt(L,{wait:S}):L},[S,e.id]),Ue=e.computedFilterType,Le=C[Ue],Ye=e.computedFilterable?e.computedFilterValue?.filter.operator??Le?.defaultOperator:void 0,We=e.computedFilterable&&Le?Le.operators.find(L=>L.name===Ye):void 0,yt=We?.components?.FilterEditor||Le?.components?.FilterEditor||e.components?.FilterEditor||no,bn=Le?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,st=$d(e,{horizontalLayoutPageIndex:I}),z=`var(${lT}-${e.computedVisibleIndex})`;j.zIndex=z,j.visibility=`var(${sT}-${e.computedVisibleIndex}, visible)`;let X={"data-field":`${e.field||""}`,"data-column-id":e.id,[cn]:e.id,"data-header-align":B,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ye=e.computedFilterable?Ie.createElement(Nu,{horizontalLayoutPageIndex:I,filterEditor:yt,filterOperatorSwitch:bn??Lu,operator:We,filterTypes:C,onChange:Ge,columnFilterType:Ue,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:d}):Ie.createElement(ku,null);U.renderBag.filterEditor=ye;let Ce=bp(L=>{ee(L),n(L)},[ee,n]),$e=re();return R&&Y&&(me=Ie.createElement("div",{key:e.id,className:`${En}Proxy ${su}`,style:{height:M,width:A,left:Y.left??0,top:Y.top??0}},Ie.createElement("div",{className:cu({visible:le})},Ie.createElement(Jd,{size:16})),O),me=iT(me,u.current)),Ie.createElement(Ve,{value:U},Ie.createElement(ii,{domRef:N,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...X,"data-z-index":z,style:j,width:A,onPointerDown:Ce,contentClassName:Z(lu(Ee),Gc[B]),contentStyle:s?{height:M/2}:void 0,className:Z(En,jc.none,k?zc.pointer:"",K,Qr(e,[En,Fn],uu,{dragging:R,insideDisabledDraggingPage:x,align:B,verticalAlign:pe,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),au),cssEllipsis:ie,afterChildren:Ie.createElement(Ie.Fragment,null,s?ye:null,st),renderChildren:$e}),me)}function Xr(){return nT(li)}import*as Bt from"react";import{useEffect as cT}from"react";function Tp(o,e){let{separator:t}=e??{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Sp={padding:ae.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},uT={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Cp=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Tp(t),n,"important")},wp=Bt.forwardRef(function(e,t){let{rootClassName:n}=Gr(),r=Bt.useRef(null),i=Bt.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return cT(()=>{let a=()=>{setTimeout(()=>{Cp(r.current,Sp),Cp(r.current?.firstElementChild,uT)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),Bt.createElement("div",{ref:i,...e,className:Z(`${n}-Footer`,zu,e.className),style:Sp},"Powered by"," ",Bt.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});import*as co from"react";var Ip={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},vp="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Rp="qy58ya4";var{rootClassName:dT}=Me,Dl=`${dT}-LoadMask`;function pT(o){let{visible:e,children:t="Loading"}=o;return co.createElement("div",{className:`${Ip[e?"visible":"hidden"]} ${Dl}`},co.createElement("div",{className:`${vp} ${Dl}-Overlay`}),co.createElement("div",{className:`${Rp} ${Dl}-Text`},t))}var mi=co.memo(pT);function Pl(o){return o.map(Ot)}function Ot(o){if(we().structuredClone)return we().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Pl(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Pl(Array.from(o)));if(o instanceof Map)return new Map(Pl(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Ot(o[t]));return e}function Qo(o){return o}var Ln=Object.seal({data:null,field:null});var pn="____root____",Dp="____not_loaded_yet____";function dn(){return!1}function El(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function gi(o,e,t,n,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function Pp(o,e){let{reducers:t={},pivot:n,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=o,c=new J;function u(h,b,T,S=0,C=[]){let y=!T.length||S===T.length-1,v=b[s?.values||"values"]||{};for(let w in v)if(v.hasOwnProperty(w)){let I=w;C.push(I),d.set(C,!0),h.set(C,{reducerResults:v[w][s?.totals||"totals"]||{},items:[]}),y||u(h,v[w],T,S+1,C),C.pop()}}let d=n?new J:void 0,p=[],f=El(t),m=Ot(f);e.visitDepthFirst((h,b,T,S)=>{let[C,...y]=b,v=h.children,w=c.get(y);if(w&&(w.cache=h.cache,w.childrenLoading=h.childrenLoading,w.childrenAvailable=h.childrenAvailable,w.error=h.error),y.length==r.length&&r.length){if(w){w.items=v;for(let R=0,x=y.length;R<x;R++){let D=y.slice(0,R),M=c.get(D);M&&(M.items=M.items||[],M.items=M.items.concat(v))}v=i.indexArray(v,{toPrimaryKey:a,cache:l,nodesKey:void 0})}return S?.()}for(let I=0,R=v.length;I<R;I++){if(!v[I]){let A={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...y,`${Dp}${I}`],A);continue}let x=v[I].data,D=v[I].keys||[];if(D.length){let A=D[D.length-1];y.push(A)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:v[I].totalChildrenCount,reducerResults:v[I].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(y,M),n){let A=M.pivotDeepMap=new J,E=v[I].pivot;u(A,E,n,0,p)}D.length&&y.pop()}S?.()});let g={deepMap:c,groupParams:o,initialData:e,reducerResults:m};return n&&(g.topLevelPivotColumns=d,g.pivot=n),g}function xp(o,e,t,n,r,i,a,l,s,c=Qo){let{items:u,reducerResults:d,pivotDeepMap:p}=o.get(e);if(u.push(n),a&&gi(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:b}=i[f],T=g?n[g]:null;h&&(Ln.data=n,Ln.field=g,T=h(Ln));let S=(b||c)(T,n);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Ot(s),items:[]}));let{reducerResults:C,items:y}=p.get(t);y.push(n),a&&gi(n,r,a,C,e)}t.length=0}}function Ep(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let b=0,T=n.length;b<=T;b++){let S=n.slice(0,b),C=e.get(S),{reducerResults:y,items:v}=C;v.push(r),C.leavesAvailableCount++,C.totalLeafNodesCount++,a&&gi(r,i,a,y,S)}return}let m=Ot(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let h=c(r);if(!(!h||!Array.isArray(h))){for(let b=0,T=h.length;b<T;b++){let S=h[b];Ep(o,e,t,p,S,b,a,l)}a&&Jo(a,m,g)}}function Mp(o,e){let{reducers:t}=o,n=El(t),r=Ot(n),i=new J,a=new J;i.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,c=e.length;s<c;s++)Ep(o,i,a,[],e[s],s,t,n);return t&&Jo(t,r,e),{deepMap:i,treeParams:o,treePaths:a,initialData:e,reducerResults:r}}function Ml(o,e){let{groupBy:t,defaultToKey:n=Qo,pivot:r,reducers:i}=o,a=t.length,l=r?new J:void 0,s=new J,c=[],u=[],d=El(i),p=Ot(d);if(!a){let m={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ot(d)};r&&(m.pivotDeepMap=new J),s.set(c,m)}for(let m=0,g=e.length;m<g;m++){let h=e[m],b={};for(let T=0;T<a;T++){let{field:S,groupField:C,valueGetter:y,toKey:v}=t[T],w=S?h[S]:null;y&&(Ln.data=h,Ln.field=S,w=y(Ln));let I=(v||n)(w,h);if(b[S||C]=I,c.push(I),!s.has(c)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ot(d)};r&&(R.pivotDeepMap=new J),s.set(c,R)}xp(s,c,u,h,m,r,i,l,d,n)}a||xp(s,c,u,h,m,r,i,l,d,n),i&&gi(h,m,i,p,c),c.length=0}i&&(s.visitDepthFirst((m,g,h,b)=>{Jo(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:S},C,y,v)=>{Jo(i,S,T),v?.()}),b?.()}),Jo(i,p,e));let f={deepMap:s,groupParams:o,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function fT(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function mT(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let T in i)if(i.hasOwnProperty(T)){let C=i[T].field;C&&(f[C]=c[T]),C&&p[C]==null&&(p[C]=c[T])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let T=t[n.length-1];T&&T.field&&(h=p[T.field]),T&&T.toKey&&(h=T.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(Dp)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:dn,hasSelectedCells:dn,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function hi(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function Jo(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function Ap(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:b}=r,{deepMap:T}=u,S=o.length,C=t[t.length-1],y=C?C.nodeExpanded:!0;for(let v=0;v<S;v++){let w=o[v],I=c(w,v),R=[...e,I];if(l(w)){let P={id:I,nodePath:R,isGroupRow:!1,data:w,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:dn,hasSelectedCells:dn,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,v],indexInParent:v,indexInAll:y?i.length:-1};p&&(P.rowSelected=p(P)),d&&(P.rowDisabled=d(P)),f&&f(P);let F=h&&b!=null&&b>0&&P.indexInAll%b===0?P.indexInAll/b:null;for(let N=0,G=t.length;N<G;N++){let H=t[N];if(y||(H.collapsedLeafNodesCount+=1),H.deepRowInfoArray.push(P),F!=null&&y){if(typeof h=="function"&&h(H)!==!0)continue;let B=hi(H,P.indexInAll,F);i[B.indexInAll]=B,P.indexInAll++}}y&&(i[P.indexInAll]=P);continue}let M=T.get(R)?.totalLeafNodesCount??0,A={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:R,id:I,data:w,indexInAll:i.length,indexInParent:v,indexInParentNodes:[...n,v],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:dn,hasSelectedCells:dn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(A.rowSelected=p(A),g)){let P=g.getSelectionCountFor(A.nodePath);A.selectedLeafNodesCount=P.selectedCount,A.deselectedLeafNodesCount=P.deselectedCount}d&&(A.rowDisabled=d(A)),f&&f(A);let E=!0;if(m&&(A.selfExpanded=E=m(A)),y||(E=!1),A.nodeExpanded=E,y&&h&&b!=null&&b>0){let P=A.indexInAll,F=A.parentNodes;if(F.length>0&&P%b===0){let N=P/b,G=0;F.forEach(H=>{typeof h=="function"&&h(H)!==!0||(i.push(hi(H,P+G,N)),G++,A.indexInAll++)})}}y&&(i[A.indexInAll]=A);let _=s(w);Array.isArray(_)&&Ap(_,R,[...t,A],A.indexInParentNodes,r,i)}return i}function _p(o){let{dataArray:e}=o,t=[];return Ap(e,[],[],[],o,t),{data:t}}function Fp(o){let{lazyLoad:e,groupResult:t,rowsPerPage:n,repeatWrappedGroupRows:r,withRowInfo:i,toPrimaryKey:a,groupRowsState:l,isRowDisabled:s,isRowSelected:c,rowSelectionState:u,generateGroupRows:d,reducers:p={}}=o,{groupParams:f,deepMap:m,pivot:g}=t,{groupBy:h}=f,b=[],T=[],S=[],C=[];return m.visitDepthFirst((y,v,w,I)=>{let R=y.items,x=v.length,D=l?.isGroupRowCollapsed(v)??!1;C.push(w);let M=mT({lazyLoad:e,groupBy:h,parents:Array.from(S),reducers:p,indexInGroup:w,indexInParentGroups:Array.from(C),indexInAll:b.length,groupKeys:v,error:y.error,totalChildrenCount:y.totalChildrenCount,childrenLoading:(y.childrenLoading||!D&&!y.childrenAvailable)&&e,childrenAvailable:y.childrenAvailable,directChildrenCount:v.length===h.length?y.items.length:m.getDirectChildrenSizeFor(v),directChildrenLoadedCount:0},y);if(c&&(M.rowSelected=c(M),u)){let F=u.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=F.selectedCount,M.deselectedChildredCount=F.deselectedCount}s&&(M.rowDisabled=s(M));let A=S[S.length-1],E=A?.collapsed??!1;E&&(D=!0),M.collapsed=D;let _=d||D;if(E&&(_=!1),_){if(r&&n!=null&&n>0){let F=M.indexInAll,N=M.parents;if(N.length>0&&F%n===0){let G=F/n,H=0;N.forEach(B=>{typeof r=="function"&&r(B)!==!0||(b.push(hi(B,F+H,G)),H++,M.indexInAll++)})}}b.push(M),T.push(b.length-1)}M.collapsedChildrenCount=0,S.forEach(F=>{F.deepRowInfoArray.push(M),F.collapsedGroupsCount+=D?1:0}),A&&M.selfLoaded&&e&&(A.directChildrenLoadedCount+=1),i&&i(M),S.push(M);let P=!0;if(P){if(I)I();else if(!g){let F=b.length;D||(b.length+=R.length);let N=0;for(let G=0,H=R.length;G<H;G++){let B=R[G];if(!D&&r&&n!=null&&n>0){let W=F+G+N;if(W%n===0){let se=W/n;S.forEach(ce=>{if(typeof r=="function"&&r(ce)!==!0)return;let ie=F+G+N;b[ie]=hi(ce,ie,se),N++,b.length++})}}let pe=F+G+N,k={id:B?a(B,pe):`${v}-${G}`,data:B,isCellSelected:dn,hasSelectedCells:dn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!B,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:D,groupKeys:v,parents:Array.from(S),indexInParentGroups:[...C,G],indexInGroup:G,indexInAll:pe,groupBy:h,groupNesting:x+1,groupCount:M.groupCount};c&&(k.rowSelected=c(k)),s&&(k.rowDisabled=s(k)),i&&i(k),S.forEach((W,se)=>{se===S.length-1&&B&&(W.directChildrenLoadedCount+=1),D&&(W.collapsedChildrenCount+=1),W.deepRowInfoArray.push(k)}),D||(b[F+G+N]=k)}}}S.pop(),C.pop()}),{data:b,groupRowsIndexes:T}}import*as If from"react";var gT=()=>{};function hT(o,e){let t=new J,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function Op(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],p=r(n),f=Qe(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let b=m[g];Op(o,e,d,b)}});p?(c?.(n),s?.(n,gT)):(l?.(n,f,i(n)),s?.(n,f))}function Np(o,e,t){for(let n=0,r=t.length;n<r;n++)Op(o,e,[],t[n])}var bT=function(o,e){return o-e},yT=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},TT=function(o,e){return o-e},ST={number:bT,string:yT,date:TT},er=ST;function Lp(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var Wt=(o,e,t)=>{let n=typeof t=="function"?t:t?.get;return e.sort(kp(Lp(o),n)),e},Al=(o,e,t)=>{let n=kp(Lp(o),t.get),r=t.depthFirst??!1,i=t.inplace??!1;r||(i?e.sort(n):e=[...e].sort(n));let{nodesKey:a,toKey:l}=t,s=u=>u[a],c=u=>u[a]===void 0;return Np({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??s,toKey:l},{onParentNode:(u,d,p)=>{if(r&&d(),Array.isArray(p)){let f=i?p.sort(n):[...p].sort(n);u[a]=f}r||d()}},e),r&&(i?e.sort(n):e=[...e].sort(n)),e};Wt.knownTypes=er;var CT=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=Wt.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Wt.knownTypes).join(", ")}`)}return r||(r=er.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:n*c}},wT=o=>o.map(CT).filter(e=>e instanceof Function),kp=(o,e)=>{let t=wT(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var bi=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new J(n.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new J(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var mt=class extends bi{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function uo(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||Qo)(l,o);return t.push(s),t},[])}var xe=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new J;this.deselectedMap=new J;this.onlyUsePrimaryKeys=!1;this.selectionCache=new J;this.selectionCountCache=new J;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?uo(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(e);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let n=t?.get(e);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var IT="*",ze=class{constructor(e){this.wildcard=IT;this.cache=new J;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(n){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(n){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,n=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),n&&n.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let n=this.selectedRowsToColumns.get(e);if(n){if(n.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>n.has(r)):!1}return!1}error(e){Qt(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var vT=Be("InfiniteTable"),RT="#dc3545",xT="#eb9316";var Vp="Warn",Gp="Error",DT="Info",PT="Success",ET="Logs",yi=vT.extend(ET),GO=yi.extend(DT),MT=yi.extend(Vp),AT=yi.extend(Gp),HO=yi.extend(PT);var _T=xT,FT=RT;var OT=(o,e)=>{e=e?e.extend?e.extend(Vp):e:MT,e(typeof e.color=="function"?e.color(_T,o):o)},NT=(o,e)=>{e=e?e.extend?e.extend(Gp):e:AT,e(typeof e.color=="function"?e.color(FT,o):o)};var zp=new J,Hp=(o,...e)=>{zp.has(e)||(zp.set(e,!0),o())};var po=(o,e=o,t)=>{Hp(()=>OT(o,t),e,"warn")},Kp=(o,e=o,t)=>{Hp(()=>NT(o,t),e,"error")};function Ti(o,e){return new xe(o,tt(e))}function tt(o){return()=>{let e=typeof o=="function"?o():o;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function Bp(o){let{getDataSourceState:e,dataSourceActions:t}=o;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof xe))throw"Invalid row selection";let a=new xe(r,tt(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof xe))throw"Invalid row selection";let a=new xe(r,tt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof xe))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?uo(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof xe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?uo(d,c):[]}let u=new xe(a,tt(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof xe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?uo(d,c):[]}let u=new xe(l,tt(e));u.deselectRow(r,i),t.rowSelection=u}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof xe))throw"Invalid row selection";let s=new xe(a,tt(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof xe))throw"Invalid row selection";let s=new xe(a,tt(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof xe))throw"Invalid row selection";let s=new xe(a,tt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new xe(i,tt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof xe))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new xe(r,tt(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}var _l=new WeakMap,LT=o=>o;function Wp(o,e=50,t){_l.set(o,{lastCallTime:0,lastCallArg:null});let n=t??LT;return r=>{let{lastCallTime:i,lastCallArg:a}=_l.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=St(n(a),n(r));s<e&&c||(_l.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var Si=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new J;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}n?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),b=s?[...p,h]:void 0,T=s&&!!b,S=T?n?.getMutationsForNodePath(b):n?.getMutationsForPrimaryKey(h);if(S&&S.length){for(let C=0,y=S.length;C<y;C++){let v=S[C];if(v.type==="delete"&&!g&&(T?this.removeNodePath(b,t):this.remove(h),g=!0,d.splice(f,1),f--),v.type==="update"&&!g&&(m={...m,...v.data},d[f]=m),v.type==="update-children"&&!g){let w=v.children(m[l],m);m={...m},w!==void 0?m[l]=w:delete m[l],d[f]=m}v.type==="insert"&&(v.position==="before"?(d.splice(f,0,v.data),f--):d.splice(f+1,0,v.data))}T?n?.removeNodePathInfo(b):n?.removeInfo(h)}if(!g)if(T){this.addNodePath(b,m);let C=a(m),y=C?null:i(m);!C&&Array.isArray(y)&&(p.push(h),c&&(m[l]=y=y.concat()),u(y,p),p.pop())}else this.add(h,m)}}};u(e,[])}return e}}};import{useEffect as bo,useMemo as af,useRef as Pi,useState as UT}from"react";import{useEffect as jp,useLayoutEffect as kT,useRef as fo}from"react";function mo(o,e){let t=fo({}),n=fo({}),r=n.current,i=fo({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,jp(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function eN(o,e){let t=fo({}),n=fo({}),r=n.current,i=fo({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,kT(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function tN(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);jp(o,t)}function Fl(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Ol(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e?.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function Nl(o){let{pivotByAtIndex:e}=o;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function $p({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=Qe(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Ol({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let b=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let C=S;S=m.join("/");let y=m[m.length-1];c[S]=Nl({header:`${y}`,columnGroup:C,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:b,pivotIndex:m.length-1,pivotGroupKey:y})}l.forEach((C,y)=>{let v=d?`${m[m.length-1]}`:C.name||C.id,w=Ol({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:C,pivotAggregatorIndex:y,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:b,defaultSortable:!1,columnGroup:S,header:v,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[C.id]:null}),I=`${C.id}:${m.join("/")}`;s[I]=w})}else{let b=m.join("/"),T=m.slice(0,-1);if(c[b]=Nl({columnGroup:T.length?T.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let S=e[m.length-1],C=T.length?T.join("/"):void 0;if(!d){let y=C;C=`total:${m.join("/")}`,c[C]=Nl({header:`${m[m.length-1]} total`,columnGroup:y,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((y,v)=>{let w=d?`${m[m.length-1]} total `:`${y.name||y.id} total`,I=Ol({columnGroup:C,header:w,pivotAggregator:y,pivotAggregatorIndex:v,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[y.id]:null});s[`total:${y.id}:${m.join("/")}`]=I})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var Up=Symbol("CLEAR"),kn=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new J;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Up,n=this.primaryKeyToData.get(t)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Up);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>J.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:J.clone(e.nodePathToData),n}};function fn(o,e){return e().dataArray[o]}function Ci(o){return o().dataArray}var nt=class{constructor(e){this.collapsedPathsMap=new J;this.expandedPathsMap=new J;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:n,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?n.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?n.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var zT=(o,e)=>o.length-e.length,ot=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new J;this.cache=new J;let n=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.setConfigFn(t),this.update(n)}getTreeDeepMap(){return this.getConfig().treeDeepMap}getSelectedLeafNodePaths(e=[],t){t=t||this.getConfig().treeDeepMap;let n=[];return t.getLeafNodesStartingWith(e,r=>{this.isNodeSelected(r.keys)&&n.push(r.keys)}),n}getDeselectedLeafNodePaths(e=[],t){t=t||this.getConfig().treeDeepMap;let n=[];return t.getLeafNodesStartingWith(e,r=>{this.isNodeSelected(r.keys)||n.push(r.keys)}),n}isLeafNode(e){return!this.getTreeDeepMap().has(e)}getLeafNodesCount(e){let n=this.getTreeDeepMap().get(e);return n?n.items.length:1}static from(e,t){return new o(e,t)}setConfigFn(e){this.getConfig=e,this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let n=this.cache.get(e);if(n)return n;if(this.isLeafNode(e)){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(zT);if(!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.getSelectionStateForNode(e,!0).selected}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.getConfig=null,this.xcache(),this.selectionMap.clear()}};function Ii(o,e){return new ot(o,go(e))}function go(o){return()=>({treeDeepMap:(typeof o=="function"?o():o).treeDeepMap})}var wi=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof ot))throw"Invalid tree selection";let a=new ot(r,go(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current=e,this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!n)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new nt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new nt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new nt(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new nt(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new nt(n.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){let{treeDeepMap:t}=this.getState();if(!t||!e.length)return null;let n=this.getRowInfoByPath(e);return n?n.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?fn(n,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof ot))throw"Invalid node selection";let n=new ot(e,go(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof ot))throw"Invalid node selection";let n=new ot(e,go(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof ot))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var ho=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var gt=class extends ho{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var Ll=1e3;function Yp(o){return new kl(o)}var kl=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>Ci(this.getState);this.getRowInfoByIndex=e=>fn(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),n=t.getDataForNodePath(e);return n||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let n=this.getState().isTree,r=n?void 0:e.map(l=>this.toPrimaryKey(l)),i=n?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,n)=>{let r=n?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Ll:r;return isNaN(a)||(a=Ll),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=n?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let n=this.getState().rowDisabledState,r=n?new gt(n):new gt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let n=this.getRowInfoByPrimaryKey(e);n&&this.setRowEnabledAt(n.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new gt({enabledRows:!0,disabledRows:[]});return}let t=new gt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new gt({disabledRows:!0,enabledRows:[]});return}let t=new gt(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new wi({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:n,nodesKey:r}=this.getState(),i=t?kn.clone(t,{light:!0}):new kn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Ll,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,n.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function qp(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,b)=>h||typeof b!="function"?l.has(b):!1,!1),t))break}if(c&&c.length){if(l===!0)n=!0;else for(let m of c)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function vi(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function Ri(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function xi(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function Vl(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var Nt=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function zl(){return!1}function VT(o,e,t,n,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:zl,hasSelectedCells:zl};return n&&(a.rowSelected=n(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var GT=Qe(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
1
|
+
var Zg=Object.create;var _s=Object.defineProperty;var Qg=Object.getOwnPropertyDescriptor;var Jg=Object.getOwnPropertyNames;var eh=Object.getPrototypeOf,th=Object.prototype.hasOwnProperty;var nh=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var oh=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Jg(e))!th.call(o,r)&&r!==t&&_s(o,r,{get:()=>e[r],enumerable:!(n=Qg(e,r))||n.enumerable});return o};var Wn=(o,e,t)=>(t=o!=null?Zg(eh(o)):{},oh(e||!o||!o.__esModule?_s(t,"default",{value:o,enumerable:!0}):t,o));var Tn=nh((pv,lc)=>{"use strict";lc.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});function zt(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}import*as be from"react";var Z=(...o)=>o.filter(e=>!!`${e}`).join(" ");import*as yn from"react";import{useRef as Hs}from"react";function ge(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function Qe(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Fs=(o,e)=>o-e;var hr=(o,e)=>Fs(o.revision,e.revision),J=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let h=g?[]:[...e,p],b=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let T=t(f.value,h,l,b,f);if(n&&T===!0)return!0;l++}else b?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(n&&f===!0)return f}};this.fill(e)}static clone(e){let t=new o;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push(i)},t),n}getEntriesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push([r,i])},t),n}getLeafNodesStartingWith(e,t,n){let{respectOrder:r=!1}=n||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},n),r?i.sort(hr).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},c=this.map,u,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(u=c.get(m),!u||!u.map)if(d=!0,p===f-1){d=!0;break}else return[];c=u.map}else if(!n&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(n||(s({...u,keys:e}),d=!0)),d?i?a.sort(hr).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,c,r,n),i?a.sort(hr).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,p,f)=>{t(u,c,{...f,keys:u}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let n=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((n,r)=>{let{map:i}=n;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],c=Qe(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e({...n,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(hr);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=J;function we(){return globalThis}var yr=["#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],Os=Symbol("color"),br=new WeakMap,sa=ge();function ca(o=yr){br.set(o,o.map(e=>0))}ca();var rh=(o=yr)=>{let e=[];br.has(o)?e=br.get(o):(e=o.map(n=>0),br.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??yr[0]},xo=":",ua="*",Ns="-",ih=",",ah="debug",lh="diffdebug",ks=!1,Ro=new J,Do=new Map;function da(o,e){let t=o.split(xo),n=new J;n.set(t,!0);let r=e.split(xo),i=new Set(r).has(ua),a=r.indexOf(ua),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(xo)):!0}}function sh(o,e){let t=`channel=${o}_permissions=${e}`;if(Do.has(t))return Do.get(t);let n=e.split(ih);function r(l){return Do.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(ua)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Ns);if(c&&(s=s.substring(Ns.length)),da(o,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),da(o,s))return r(!c)}return r(!1)}var pa=()=>Be.enable??(we()&&we().localStorage?.getItem(ah))??"",ch=()=>Be.diffenable??(we()&&we().localStorage?.getItem(lh))??`${ks}`,fa="",zs=ks;function ma(o){zs=`${ch()}`=="true",fa!==o&&(fa=o,Do.clear())}function Vs(o){ma(pa()),typeof we()<"u"&&we().addEventListener&&we().addEventListener("storage",function(){ma(pa())});function e(t,n){let r=n?`${n}${xo}${t}`:t,i=r.split(xo),a=Ro.get(i);if(a)return a;let l=Ro.get(i.slice(0,-1)),s=(l?l.logFn:Be.logFn)??Gs,c=s,u,d=0,p=()=>u??sh(r,fa),f=rh(Be.colors),m=Object.defineProperties((...g)=>{let h=sa.getListenersCount(),b;if(h>0&&(b=b??Date.now(),sa({color:f,channel:r,args:g,timestamp:b})),p()){if(b=b??Date.now(),d&&zs){let C=b-d;c(`%c[${r}]`,`color: ${f}`,`+${C}ms:`)}d=b;let T=[],S;if(g.forEach(C=>{if(C[Os])S===void 0&&(S=!0),T.push(...C);else{if(typeof C!="string"&&typeof C!="number"){S=!1;return}T.push(`${C}%s`)}}),S){let C=[`%c[${r}]%c %s`,`color: ${f}`,"",...T,""];c(...C)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let b=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return b.toString=()=>h.join(" "),b[Os]=!0,b}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{Ro.delete(i)}}});return Ro.set(i,m),m}return e(o)}var Gs=console.log.bind(console),Ls;Object.defineProperty(Vs,"enable",{get:()=>Ls,set:o=>{Ls=o,ma(pa())}});var Be=Vs;Be.colors=yr;Be.logFn=Gs;var uh=(o,e)=>sa.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;da(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Be.onLogIntent=uh;Be.destroyAll=()=>{ca(),ca(Be.colors),Ro.clear(),Do.clear()};var ut=o=>{let e=Be(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},Qt=o=>{let e=Be(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Po=()=>Po;Po.extend=()=>Po;var rt=class{constructor(e){this.debug=Po,this.error=Po}};import*as dh from"react";import{useMemo as cI,useRef as ph,useEffect as fh,useLayoutEffect as mh,useCallback as uI}from"react";var Eo=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?zt(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}},Tr=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=ph({width:0,height:0}),r=i=>{let a;return o.current&&(a=Eo(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};fh(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),mh(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};var gh=Qt("CSSVariableWatch"),hh=ut("CSSVariableWatch"),bh={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},yh=o=>{let e=Hs(0),t=yn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);Tr(o.ref,t,{earlyAttach:!0}),yn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n)return e.current=n,hh(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);gh(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},Mo=o=>{let e=Hs(null);yh({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return yn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:bh},yn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};import*as Cr from"react";import*as Ks from"react";var ga;function Ao(){return ga||(ga=Ks.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}import*as Bs from"react";var ha;function Sr(){return ha||(ha=Bs.createContext(void 0))}function Jt(){let o=Ao();return Cr.useContext(o).componentState}function De(){let o=Ao();return Cr.useContext(o)}function ke(){let o=Sr();return Cr.useContext(o)}import*as wn from"react";import{useCallback as Mc,useEffect as _a,useRef as ab,useState as lb}from"react";import*as wr from"react";function Th(o){let{height:e,width:t,count:n}=o;return wr.createElement("div",{"data-count":n,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var Ws=wr.memo(Th);var js="mlx2t3";import*as Ir from"react";import{useRef as Ch}from"react";import{useEffect as Sh}from"react";var $s=(o,e)=>{Sh(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var Us={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Ys={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},qs={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},ba="_1ueijco1",Xs="_1ueijco0 _16lm1iw0";var Zs=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=Us[`${o}`]:e=Z(Ys[`${o.horizontal}`],qs[`${o.vertical}`]),e};var wh="InfiniteVirtualScrollContainer";var Qs=Ir.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??Ch(null);return $s(u,i),Ir.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:Z(a,wh,Xs,Zs(r))},n)});import*as Fr from"react";import{useLayoutEffect as Aa,useMemo as Lh}from"react";import*as Js from"react";import{useLayoutEffect as Ih,useRef as vh,useState as Rh}from"react";function xh(o){let[e,t]=Rh(o.updater.get),n=vh(null);return Ih(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{t(a)})):t(a)}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var en=Js.memo(xh);function tn(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function ec(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}function q(o){return o.slice(4,-1)}var Je="Infinite",Me={rootClassName:Je};var $={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var tc="true",ae={loaded:"var(--infinite-loaded)",themeName:"var(--infinite-theme-name)",themeMode:"var(--infinite-theme-mode)",color:{accent:"var(--infinite-accent-color)",success:"var(--infinite-success-color)",error:"var(--infinite-error-color)",color:"var(--infinite-color)"},spacing:{0:"var(--infinite-space-0)",1:"var(--infinite-space-1)",2:"var(--infinite-space-2)",3:"var(--infinite-space-3)",4:"var(--infinite-space-4)",5:"var(--infinite-space-5)",6:"var(--infinite-space-6)",7:"var(--infinite-space-7)",8:"var(--infinite-space-8)",9:"var(--infinite-space-9)",10:"var(--infinite-space-10)"},fontSize:{0:"var(--infinite-font-size-0)",1:"var(--infinite-font-size-1)",2:"var(--infinite-font-size-2)",3:"var(--infinite-font-size-3)",4:"var(--infinite-font-size-4)",5:"var(--infinite-font-size-5)",6:"var(--infinite-font-size-6)",7:"var(--infinite-font-size-7)"},fontFamily:"var(--infinite-font-family)",minHeight:"var(--infinite-min-height)",borderRadius:"var(--infinite-border-radius)",focusOutline:"var(--infinite-focus-outline)",background:"var(--infinite-background)",iconSize:"var(--infinite-icon-size)",runtime:{bodyWidth:"var(--infinite-runtime-body-content-width)",totalVisibleColumnsWidthValue:"var(--infinite-runtime-total-visible-columns-width)",totalVisibleColumnsWidthVar:"var(--infinite-runtime-total-visible-columns-width-var)",visibleColumnsCount:"var(--infinite-runtime-visible-columns-count)",browserScrollbarWidth:"var(--infinite-runtime-browser-scrollbar-width)"},components:{GroupingToolbar:{color:"var(--infinite-grouping-toolbar-color)",background:"var(--infinite-grouping-toolbar-background)",rejectBackground:"var(--infinite-grouping-toolbar-reject-background)",activeBackground:"var(--infinite-grouping-toolbar-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-active-background-alpha)",padding:"var(--infinite-grouping-toolbar-padding)",border:"var(--infinite-grouping-toolbar-border)",rejectBorder:"var(--infinite-grouping-toolbar-reject-border)",gap:"var(--infinite-grouping-toolbar-gap)"},GroupingToolbarItem:{border:"var(--infinite-grouping-toolbar-item-border)",borderRadius:"var(--infinite-grouping-toolbar-item-border-radius)",activeBorder:"var(--infinite-grouping-toolbar-item-active-border)",background:"var(--infinite-grouping-toolbar-item-background)",activeBackground:"var(--infinite-grouping-toolbar-item-active-background)",activeBackgroundAlpha:"var(--infinite-grouping-toolbar-item-active-background-alpha)"},LoadMask:{padding:"var(--infinite-load-mask-padding)",color:"var(--infinite-load-mask-color)",textBackground:"var(--infinite-load-mask-text-background)",overlayBackground:"var(--infinite-load-mask-overlay-background)",overlayOpacity:"var(--infinite-load-mask-overlay-opacity)",borderRadius:"var(--infinite-load-mask-border-radius)"},Header:{background:"var(--infinite-header-background)",color:"var(--infinite-header-color)",columnHeaderHeight:"var(--infinite-column-header-height)"},HeaderCell:{background:"var(--infinite-header-cell-background)",hoverBackground:"var(--infinite-header-cell-hover-background)",border:"var(--infinite-header-cell-border)",padding:"var(--infinite-header-cell-padding)",paddingX:"var(--infinite-header-cell-padding-x)",paddingY:"var(--infinite-header-cell-padding-y)",iconSize:"var(--infinite-header-cell-icon-size)",menuIconLineWidth:"var(--infinite-header-cell-menu-icon-line-width)",sortIconMargin:"var(--infinite-header-cell-sort-icon-margin)",borderRight:"var(--infinite-header-cell-border-right)",resizeHandleActiveAreaWidth:"var(--infinite-resize-handle-active-area-width)",resizeHandleWidth:"var(--infinite-resize-handle-width)",resizeHandleHoverBackground:"var(--infinite-resize-handle-hover-background)",resizeHandleConstrainedHoverBackground:"var(--infinite-resize-handle-constrained-hover-background)",filterOperatorPaddingX:"var(--infinite-filter-operator-padding-x)",filterEditorPaddingX:"var(--infinite-filter-editor-padding-x)",filterEditorMarginX:"var(--infinite-filter-editor-margin-x)",filterOperatorPaddingY:"var(--infinite-filter-operator-padding-y)",filterEditorPaddingY:"var(--infinite-filter-editor-padding-y)",filterEditorMarginY:"var(--infinite-filter-editor-margin-y)",filterEditorBackground:"var(--infinite-filter-editor-background)",filterEditorBorder:"var(--infinite-filter-editor-border)",filterEditorFocusBorderColor:"var(--infinite-filter-editor-focus-border-color)",filterEditorBorderRadius:"var(--infinite-filter-editor-border-radius)",filterEditorColor:"var(--infinite-filter-editor-color)"},ActiveCellIndicator:{inset:"var(--infinite-active-cell-indicator-inset)"},Cell:{flashingDuration:"var(--infinite-flashing-duration)",flashingAnimationName:"var(--infinite-flashing-animation-name)",flashingOverlayZIndex:"var(--infinite-flashing-overlay-z-index)",flashingBackground:"var(--infinite-flashing-background)",flashingUpBackground:"var(--infinite-flashing-up-background)",flashingDownBackground:"var(--infinite-flashing-down-background)",padding:"var(--infinite-cell-padding)",borderWidth:"var(--infinite-cell-border-width)",border:"var(--infinite-cell-border)",borderLeft:"var(--infinite-cell-border-left)",borderRight:"var(--infinite-cell-border-right)",borderTop:"var(--infinite-cell-border-top)",borderInvisible:"var(--infinite-cell-border-invisible)",borderRadius:"var(--infinite-cell-border-radius)",reorderEffectDuration:"var(--infinite-column-reorder-effect-duration)",pinnedBorder:"var(--infinite-pinned-cell-border)",horizontalLayoutColumnReorderDisabledPageOpacity:"var(--infinite-horizontal-layout-column-reorder-disabled-page-opacity)",color:"var(--infinite-cell-color)",selectedBackground:"var(--infinite-selected-cell-background)",selectedBackgroundDefault:"var(--infinite-selected-cell-background-default)",selectedBackgroundAlpha:"var(--infinite-selected-cell-background-alpha)",selectedBackgroundAlphaWhenTableUnfocused:"var(--infinite-selected-cell-background-alpha--table-unfocused)",selectedBorderColor:"var(--infinite-selected-cell-border-color)",selectedBorderWidth:"var(--infinite-selected-cell-border-width)",selectedBorderStyle:"var(--infinite-selected-cell-border-style)",selectedBorder:"var(--infinite-selected-cell-border)",activeBackgroundAlpha:"var(--infinite-active-cell-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-cell-background-alpha--table-unfocused)",activeBackground:"var(--infinite-active-cell-background)",activeBackgroundDefault:"var(--infinite-active-cell-background-default)",activeBorderColor:"var(--infinite-active-cell-border-color)",activeBorderWidth:"var(--infinite-active-cell-border-width)",activeBorderStyle:"var(--infinite-active-cell-border-style)",activeBorder:"var(--infinite-active-cell-border)"},SelectionCheckBox:{marginInline:"var(--infinite-selection-checkbox-margin-inline)"},ExpandCollapseIcon:{color:"var(--infinite-expand-collapse-icon-color)"},Menu:{background:"var(--infinite-menu-background)",color:"var(--infinite-menu-color)",separatorColor:"var(--infinite-menu-separator-color)",padding:"var(--infinite-menu-padding)",cellPaddingVertical:"var(--infinite-menu-cell-padding-vertical)",cellPaddingHorizontal:"var(--infinite-menu-cell-padding-horizontal)",cellMarginVertical:"var(--infinite-menu-cell-margin-vertical)",itemDisabledBackground:"var(--infinite-menu-item-disabled-background)",itemActiveBackground:"var(--infinite-menu-item-active-background)",itemActiveOpacity:"var(--infinite-menu-item-active-opacity)",itemPressedOpacity:"var(--infinite-menu-item-pressed-opacity)",itemPressedBackground:"var(--infinite-menu-item-pressed-background)",itemDisabledOpacity:"var(--infinite-menu-item-disabled-opacity)",borderRadius:"var(--infinite-menu-border-radius)",shadowColor:"var(--infinite-menu-shadow-color)"},RowDetail:{background:"var(--infinite-rowdetail-background)",padding:"var(--infinite-rowdetail-padding)",gridHeight:"var(--infinite-rowdetail-grid-height)"},Row:{background:"var(--infinite-row-background)",oddBackground:"var(--infinite-row-odd-background)",disabledBackground:"var(--infinite-row-disabled-background)",oddDisabledBackground:"var(--infinite-row-odd-disabled-background)",selectedBackground:"var(--infinite-row-selected-background)",disabledOpacity:"var(--infinite-row-disabled-opacity)",activeBackground:"var(--infinite-active-row-background)",activeBorderColor:"var(--infinite-active-row-border-color)",activeBorderWidth:"var(--infinite-active-row-border-width)",activeBorderStyle:"var(--infinite-active-row-border-style)",activeBorder:"var(--infinite-active-row-border)",activeBackgroundAlpha:"var(--infinite-active-row-background-alpha)",activeBackgroundAlphaWhenTableUnfocused:"var(--infinite-active-row-background-alpha--table-unfocused)",hoverBackground:"var(--infinite-row-hover-background)",selectedHoverBackground:"var(--infinite-row-selected-hover-background)",selectedDisabledBackground:"var(--infinite-row-selected-disabled-background)",groupRowBackground:"var(--infinite-group-row-background)",groupRowColumnNesting:"var(--infinite-group-row-column-nesting)",groupNesting:"var(--infinite-dont-override-group-row-nesting-length)",pointerEventsWhileScrolling:"var(--infinite-row-pointer-events-while-scrolling)"},ColumnCell:{background:"var(--infinite-column-cell-bg-dont-override)"}}},nc="column-header-height";var oc=`.${Me.rootClassName}`;function ya(o){return tn(o,oc)}var rc=q($.scrollLeft),Dh=q($.scrollTop),Ph=q($.columnWidthAtIndex),Ta=q($.columnOffsetAtIndex),ic=q($.columnReorderEffectDurationAtIndex),Eh=q($.columnOffsetAtIndexWhileReordering),Mh=q($.columnVisibilityAtIndex),Ah=q($.columnZIndexAtIndex);function At(o,e,t){let n=t?ya(t):document.querySelector(oc);_h(o,e,n)}function _h(o,e,t){if(t){let n=o,r=$[n]?q($[n]):o;t.style.setProperty(r,`${e}`)}}function jn(o,e){if(e)for(var t in o){let n=$[t]?q($[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function Sa(o,e,t){At(`${Ta}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${rc}))`:`${o.computedAbsoluteOffset+e}px`,t)}function Ca(o,e,t){At(`${Ah}-${o}`,`${e}`,t)}function $n(o,e,t){At(`${Eh}-${o}`,typeof e=="number"?`calc( var(${Ta}-${o}) + ${e}px )`:e,t)}function _o(o,e,t){At(`${Mh}-${o}`,e,t)}function vr(o,e,t){At(`${ic}-${o}`,t??"",e)}function wa(o,e){let t=`${ic}-${o}`;At(t,ae.components.Cell.reorderEffectDuration,e)}var Te={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Ph}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,At(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Ta}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,At(this.varName.get(o),e,t)}}};function ac(o,e){jn({[rc]:`${o.scrollLeft}px`,[Dh]:`${o.scrollTop}px`},e)}var Ae=we().requestAnimationFrame||(o=>setTimeout(o,16)),It=we().cancelAnimationFrame||(o=>clearTimeout(o));var sc=Wn(Tn());var Ia=(o,e)=>o-e,Vt={horizontal:!0,vertical:!0};function Rr(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var va="DebugID=";function nn(o,e){return e&&e.startsWith(va)?e:e?`${va}${o}:${e}`:`${va}${o}`}var xr={start:0,end:0},Ra=o=>{o()},xa=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},cc=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},Fo=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function Fh(o){return o.horizontalChange||o.verticalChange}var Sn=class extends rt{constructor(t){let n=nn(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=xr;this.verticalExtendRangeBy=xr;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{Fo(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Ra:Fo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Ra:Fo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=Vt)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=Vt)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=Vt)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,sc.default)(a,t,Ia);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let b=f;for(;h>1;)b+=1,d[b]=f,p[b]=0,h-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=xa;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=Vt){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",h=m&&r!==this.rows,b=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let T=a!=null,S=l!=null,C=T&&a!==this.rowHeight,y=S&&l!==this.colWidth;T&&(this.rowHeight=a),S&&(this.colWidth=l);let v=t.rowspan!=null,w=t.colspan!=null,I=v&&t.rowspan!=this.rowspan,R=w&&t.colspan!=this.colspan;I&&(this.rowspan=t.rowspan),R&&(this.colspan=t.colspan);let x=b||y||p||R,D=h||C||f||I;(n||Fh)({horizontalChange:x,verticalChange:D,colsChanged:b,colWidthChanged:y,widthChanged:p,colspanChanged:R,rowsChanged:h,rowHeightChanged:C,heightChanged:f,rowspanChanged:I})&&this.updateRenderCount({horizontal:x,vertical:D})}extendRenderRange(t){let{direction:n}=t,r=n==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(t=Vt){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=Vt){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(n?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Ra:Fo;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=Rr(l,u)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{Fo(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let n=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=xr,this.verticalExtendRangeBy=xr,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Pa=Wn(Tn());function uc(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function dc(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function Oo(o,e){for(let t of o)if(e(t))return t}import*as fc from"react";var pc=new Map,Oh=()=>{},Da=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=ge();let n=pc.get(e)??0,r=`${e}:GridCellReact:${n}`;pc.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=ge(),this.node=fc.createElement(en,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Oh,this.element=null,this.node=null}getNode(){return this.node}update(e,t){this.updater(e),this.cellInfo=t}getAdditionalInfo(){return this.cellInfo}getElement(){return this.element}},Un=class Un extends rt{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=ge();this.cellAttachmentChangeSubscription=ge();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=new Da(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,n=t.values().next().value;return n||(this.poolSize+=Un.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/Un.POOL_SIZE_INCREMENT)*Un.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};Un.POOL_SIZE_INCREMENT=1;var Dr=Un;var Pr=(o,e)=>o-e,Er=class extends rt{constructor(t){super(`${t}:GridCellManager`);this.matrix=new J;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,b=f>=s;(m||g||h||b)&&c.add(u)}),c};this.debugId=t,this.pool=new Dr(t),this.offRemoveCell=this.pool.onRemoveCell(n=>this.onRemoveCell(n))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=Oo(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=Oo(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Pr)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Pr)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((n,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,Pa.default)(n,t,Pr);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,Pa.default)(n,t,Pr);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return Oo(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return Oo(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var hc=Wn(Tn());import*as gc from"react";var mc=new Map,Nh=()=>{},Ea=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=ge();let t=mc.get(e)??0,n=`${e}:ListRowReact:${t}`;mc.set(e,t+1),this.debugId=n,this.updater=ge(),this.node=gc.createElement(en,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Nh,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Yn=class Yn extends rt{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=ge();this.rowAttachmentChangeSubscription=ge();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=new Ea(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,n=t.values().next().value;return n||(this.poolSize+=Yn.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/Yn.POOL_SIZE_INCREMENT)*Yn.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};Yn.POOL_SIZE_INCREMENT=1;var Mr=Yn;var Ar=class extends rt{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new Mr(t),this.offRemoveRow=this.pool.onRemoveRow(n=>this.onRemoveRow(n))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,hc.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var bc=!0,Cn=q($.y),yc=q($.scrollTop),Qv=q($.columnOffsetAtIndex),Ma=q($.columnOffsetAtIndexWhileReordering),qn=class extends rt{constructor(t,n){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(Cn,i?`calc( ${r}px + var(${yc}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${Cn}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=Te.columnOffsets.get(r),d=`${Ma}-${r}`,p=s?`calc( ${a}px + var(${yc}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(Cn,p));let f=`translate3d(var(${d}, ${u}), var(${Cn}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),c!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),this.brain.isHorizontalLayoutBrain){let b=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),T=this.getScrollPositionForScrollColumnIntoView(b,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});T&&(a=T.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,p]=c,[f,m]=u,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let h={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:u?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ae(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:c,y:u}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,bc){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let f=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==f&&(r.__zIndex=f,r.style.zIndex=f)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,bc&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(E=>{let _=i.getRowIndex(E);if(_!=null){let P=this.brain.getItemOffsetFor(_,"vertical");if(P==null)return;let F=E.getElement();if(!F)return;this.setDetailTransform(F,_,{y:P,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&ac(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:h}=this.brain.getRenderRange(),[b,T]=g,[S,C]=h;function y(E,_,P){let F=r.getCellAt([E,_]);if(F==null)return;let N=n.getCellOffset(E,_),G=F.getElement();G&&N&&P(E,_,G,N)}let v=(E,_,P,{x:F,y:N})=>{this.setTransform(P,E,_,{x:F,y:N,scrollLeft:!0},s-_)},w=(E,_,P,F)=>{this.setTransform(P,E,_,{x:F.x,y:F.y,scrollTop:!0},u-E)},I=(E,_,P,{y:F})=>{let N=f[_];this.setTransform(P,E,_,{x:N,y:F,scrollLeft:!0},a-_)},R=(E,_,P,F)=>{this.setTransform(P,E,_,{x:F.x,y:m[E],scrollTop:!0},l-E)},x=(E,_,P,{x:F,y:N})=>{this.setTransform(P,E,_,{x:F,scrollLeft:!0,y:N,scrollTop:!0},1e5)},D=(E,_,P,{x:F})=>{this.setTransform(P,E,_,{x:F,scrollLeft:!0,y:m[E],scrollTop:!0},2e5)},M=(E,_,P,F)=>{this.setTransform(P,E,_,{x:f[_],y:F.y,scrollLeft:!0,scrollTop:!0},3e5)},A=(E,_,P)=>{this.setTransform(P,E,_,{x:f[_],y:m[E],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let E=b;E<S;E++){for(let _=0;_<s;_++)y(E,_,v);if(c){let _=a-c;for(let P=_;P<a;P++)y(E,P,I)}}if(u||d)for(let E=T;E<C;E++){for(let _=0;_<u;_++)y(_,E,w);if(d){let _=l-d;for(let P=_;P<l;P++)y(P,E,R)}}if(s&&u)for(let E=0;E<u;E++)for(let _=0;_<s;_++)y(E,_,x);if(s&&d){let E=l-d;for(let _=E;_<l;_++)for(let P=0;P<s;P++)y(_,P,D)}if(c&&u){let E=a-c;for(let _=0;_<u;_++)for(let P=E;P<a;P++)y(_,P,M)}if(c&&d){let E=l-d,_=a-c;for(let P=E;P<l;P++)for(let F=_;F<a;F++)y(P,F,A)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new Er(n),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new Ar(n),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Ae(()=>{this.destroyed||this.adjustFixedElementsOnScroll()})}),a=t.onScrollStart(this.onScrollStart),l=t.onScrollStop(this.onScrollStop);this.onDestroy=()=>{r(),i(),a(),l()}}getInfiniteNode(t){return this.infiniteNode||(this.infiniteNode=ya(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],D=t.end[1];m.forEach(M=>{x<=M&&M<D||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([x,D])=>{g.set(`${x}:${D}`,!0)});let b=f.reduce((x,D)=>x+xa(D),0),T=r?f.reduce((x,D)=>x+cc(D),0):0,S=this.brain.getRowCount(),C=this.brain.getColCount();d.detachCellsStartingAt([S,C]);let y=Math.min(S*C,b);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>T&&(u.poolSize=T));let v=uc(...f.map(x=>d.getCellsOutsideRenderRange(x)));v=dc(v,x=>{let D=d.getCellPosition(x);return!(D&&g.has(`${D[0]}:${D[1]}`))}),d.detachCells(v),d.poolSize=y;let w=new Map,I=new Map;f.forEach(x=>{let{start:D,end:M}=x,[A,E]=D,[_,P]=M;for(let F=A;F<_;F++){for(let G=E;G<P;G++){let H=`${F}:${G}`;if(w.has(H))continue;w.set(H,!0);let{rendered:B,mapped:pe}=this.isCellRenderedAndMappedCorrectly(F,G);if(F===A||G===E){let k=this.isCellCovered(F,G);if(k&&g.has(`${k[0]}:${k[1]}`)){let W=d.getCellAt([F,G]);W!=null&&d.detachCell(W);continue}}if(B&&!i&&pe)continue;let de;B?de=d.getCellAt([F,G]):de=d.getCellFor([F,G],c?"row":"column"),de==null&&(de=d.getDetachedCell()),this.renderCellAt(F,G,de,n)}!r||I.has(F)||(I.set(F,!0),u.isRowAttachedAt(F)&&!i)||this.renderDetailRowAtElement(F,this.rowManager.getRowFor(F),r)}}),h.forEach(([x,D])=>{let{rendered:M,mapped:A}=this.isCellRenderedAndMappedCorrectly(x,D);if(M){if(i||!A){let _=[x,D],P=d.getCellAt(_);this.renderCellAt(x,D,P,n)}return}let E=d.getCellFor([x,D],c?"row":"column");E!=null&&this.renderCellAt(x,D,E,n)});let R=d.getAllCells().map(x=>x.getNode());return r&&u.getAllRows().forEach(x=>{R.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(R),R}renderDetailRowAtElement(t,n,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),p=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:b}=this.getCellRealCoordinates(t,n),T=i({rowIndex:h,colIndex:b,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:r.ref});r.isMounted()||r.onMount(C=>{let y=C.getElement();y&&(y.style.position="absolute",y.style.left="0px",y.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:b}:void 0;if(!T){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(T,r,[t,n],S),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var _r=class extends qn{constructor(t,n){super(t,n);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=ae.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=Te.columnOffsets.get(l.colIndex),f=`${Ma}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(Cn,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${Cn})`,b=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==b&&(t.__transformValue=b,t.style.transform=b)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function No(o){let e=o.isHorizontalLayoutBrain?new _r(o,`${o.name}:HorizontalLayoutTableRenderer`):new qn(o,`${o.name}:ReactHeadlessTableRenderer`),t=ge();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function kh(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=Lh(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:No(e),[e,o.onRenderUpdater,o.renderer]);return Aa(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),Aa(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),Aa(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),Fr.createElement(en,{updater:a})}var Or=Fr.memo(kh);import*as Lo from"react";import{useEffect as Wh,useLayoutEffect as jh,useRef as $h}from"react";import{useCallback as zh,useState as Vh}from"react";var _t=()=>{let[o,e]=Vh(0);return[o,zh(()=>{e(t=>t+1)},[e])]};function Gh(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function Hh(o){var e=Gh(o,"string");return typeof e=="symbol"?e:String(e)}function Kh(o,e,t){return e=Hh(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function Tc(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function Sc(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tc(Object(t),!0).forEach(function(n){Kh(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):Tc(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function Cc(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var Bh=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},ue=o=>{var e=t=>{var n=o.defaultClassName,r=Sc(Sc({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=o.variantClassNames[i][s];c&&(n+=" "+c)}}for(var[u,d]of o.compoundVariants)Bh(u,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return Cc(o.variantClassNames,t=>Cc(t,n=>n.split(" ")[0]))}},e};var wc=ue({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Nr="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Ic=ue({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Uh}=Me,Yh=`${Uh}-ActiveRowIndicator`,qh=`calc(${$.activeCellRowOffsetX} + var(${q($.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,Xh={[q($.activeCellOffsetY)]:$.activeCellRowOffset,transform:`translate3d(${qh}, calc( ${$.activeCellOffsetY} + var(${q($.scrollTopForActiveRow)}, 0px)), 0px)`,height:$.activeCellRowHeight,maxWidth:ae.runtime.totalVisibleColumnsWidthVar},Zh=o=>{let{brain:e}=o,t=$h(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=_t();return jh(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${ae.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};jn(d,u)},[o.activeRowIndex,e]),Wh(()=>{let a=c=>{jn({scrollTopForActiveRow:`${-c.scrollTop}px`,scrollLeftForActiveRowWhenHorizontalLayout:e.isHorizontalLayoutBrain?`${-c.scrollLeft}px`:"0px"},t.current)};a(e.getScrollPosition());let l=e.onScroll(a),s=e.onRenderCountChange(i);return()=>{s(),l()}},[e]),Lo.createElement("div",{className:Nr,"data-name":"active-row"},Lo.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${Yh} ${Ic({active:n})}`,style:n?Xh:void 0}))},vc=Lo.memo(Zh);import*as ko from"react";import{useEffect as Qh,useLayoutEffect as Jh,useRef as eb}from"react";var{rootClassName:tb}=Me,nb=`${tb}-ActiveCellIndicator`,ob=q($.columnZIndexAtIndex),rb=(o,e,t,n)=>{if(e==null)return;let[r]=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(r=r%o.rowsPerPage);let i=typeof t=="function"?t(r):t??o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;jn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},ib=o=>{let{brain:e}=o,[t,n]=_t(),r=eb(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return Jh(()=>{rb(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),Qh(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),ko.createElement("div",{className:Nr,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${ob}-${o.activeCellIndex[1]})`}:void 0},ko.createElement("div",{"data-name":"active-cell-indicator",className:`${nb} ${wc({visible:i})}`}))},Rc=ko.memo(ib);var xc="_1eexc2a7 _1eexc2a6",Dc=ue({defaultClassName:"_1eexc2an",variantClassNames:{dragging:{false:"_1eexc2ao",true:"_1eexc2ap"},insideDisabledDraggingPage:{true:"_1eexc2aq",false:"_1eexc2ar"},cellSelected:{false:"_1eexc2as",true:"_1eexc2at"},treeNode:{parent:"_1eexc2au",leaf:"_1eexc2av",false:"_1eexc2aw"},align:{start:"_1eexc2ax",end:"_1eexc2ay",center:"_1eexc2az"},verticalAlign:{start:"_1eexc2a10",end:"_1eexc2a11",center:"_1eexc2a12"},rowActive:{false:"_1eexc2a13",true:"_1eexc2a14"},groupRow:{false:"_1eexc2a15",true:"_1eexc2a16"},groupCell:{false:"_1eexc2a17",true:"_1eexc2a18"},rowDisabled:{false:"_1eexc2a19",true:"_1eexc2a1a"},zebra:{false:"_1eexc2a1b",even:"_1eexc2a1c",odd:"_1eexc2a1d"},rowSelected:{true:"_1eexc2a1e",false:"_1eexc2a1f",null:"_1eexc2a1g"},first:{true:"_1eexc2a1h",false:"_1eexc2a1i"},last:{true:"_1eexc2a1j",false:"_1eexc2a1k"},groupByField:{true:"_1eexc2a1l",false:"_1eexc2a1m"},firstInCategory:{true:"_1eexc2a1n",false:"_1eexc2a1o"},firstRow:{true:"_1eexc2a1p",false:"_1eexc2a1q"},firstRowInHorizontalLayoutPage:{true:"_1eexc2a1r",false:"_1eexc2a1s"},lastInCategory:{true:"_1eexc2a1t",false:"_1eexc2a1u"},pinned:{start:"_1eexc2a1v",end:"_1eexc2a1w",false:"_1eexc2a1x"},filtered:{true:"_1eexc2a1y",false:"_1eexc2a1z"}},defaultVariants:{},compoundVariants:[[{firstRowInHorizontalLayoutPage:!0,firstRow:!1},"_1eexc2a20"],[{pinned:"start",lastInCategory:!0},"_1eexc2a21"],[{pinned:"start",firstInCategory:!0},"_1eexc2a22"],[{pinned:"end",firstInCategory:!0},"_1eexc2a23"],[{pinned:"end",lastInCategory:!0},"_1eexc2a24"],[{align:"center",groupCell:!1},"_1eexc2a25"],[{rowDisabled:!0,zebra:"odd"},"_1eexc2a26"]]}),Pc=ue({defaultClassName:"_1eexc2ae",variantClassNames:{right:{true:"_1eexc2af",false:"_1eexc2ag"},left:{true:"_1eexc2ah",false:"_1eexc2ai"},top:{true:"_1eexc2aj",false:"_1eexc2ak"},bottom:{true:"_1eexc2al",false:"_1eexc2am"}},defaultVariants:{},compoundVariants:[]});var Ec="_1eexc2a5",Lr=ue({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),kr="_1eexc2a8";var zr=[Ec,`${Je}DetachedCell`];function Vr(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var sb=Z(js,ba);function Ac(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,b=ab(null),[T,S]=lb({width:0,height:0});_a(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),_a(()=>{let v=b.current?.parentNode;return v?(h&&document.activeElement!==v&&v.focus(),Eo(v,()=>{let R={height:v.clientHeight,width:v.clientWidth};e.update(R)},{debounce:50})):void 0},[p,e]);let C=Mc(v=>{requestAnimationFrame(()=>{b.current&&b.current.style.setProperty("transform",`translate3d(${-v.scrollLeft}px, ${-v.scrollTop}px, 0px)`)})},[]),y=Mc(v=>{e.setScrollPosition(v,C)},[e,C]);return _a(()=>{let v=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),C(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),v},[e]),wn.createElement(Qs,{onContainerScroll:y,...g,ref:t},wn.createElement("div",{ref:b,className:sb,"data-name":"scroll-transform-target"},wn.createElement(Or,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:zr}),u!=null?wn.createElement(Rc,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?wn.createElement(vc,{brain:e,activeRowIndex:c}):null,wn.createElement(Ws,{width:T.width,height:T.height}))}import*as Xn from"react";import{useReducer as gb,createContext as hb,useMemo as La,useEffect as bb,useState as Fc,useRef as Oc,useLayoutEffect as yb}from"react";function Fa(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var Oa=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function zo(o){return o!==void 0}function on(o,e){let t=e[o];return zo(t)}import{useCallback as cb,useEffect as ub,useRef as Na}from"react";var _c=o=>{let e=cb(o,[]),t=Na(!1),n=Na(!1),r=Na(void 0),[i,a]=_t();t.current&&(n.current=!0),ub(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};import{useCallback as db,useRef as pb}from"react";function ve(o){let e=pb(o);return e.current=o,db(()=>e.current,[])}import{useRef as fb,useLayoutEffect as mb}from"react";var In=(o,e)=>{let t=fb(e===void 0?o:e);return mb(()=>{t.current=o}),t.current};var Tb=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)},ka;function Nc(){return ka||(ka=hb(null))}function Sb(o,e,t,n,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:p=>{let f=t(),m=e(),g=m[u],h=!0;if(i&&typeof i[u]=="function"&&i[u](p,{actions:s,state:m})===!1&&(h=!1),h){let S=[p],C=`on${Oa(c)}Change`;if(a&&a[u]){let y=a[u](p,m);C=y.callbackName||C,S=y.callbackParams}Tb(f,C,S)}let b=n[u];typeof b=="function"&&(p=b(p));let T=!!r?.[u];on(c,f)&&!T||o({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function Cb(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=on(r,e)?e[r]:e[`default${Oa(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function vt(o){let e=o.getParentState||(()=>null);function t(r){let[i]=Fc(()=>o.initSetupState?o.initSetupState(r):{}),a=Oc(new Set),l=La(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=ve(s);function u(){let I={};l&&(I=Cb(l,r,i));let R={...i,...I};if(o.mapPropsToState){let{fn:x,propertyReads:D}=Fa(o.mapPropsToState,{getProxyTargetFromArgs:A=>A.props,putProxyToArgs:(A,E)=>[{...E,props:A}]}),M=x({props:r,state:R,oldState:null,parentState:s});return a.current=new Set([...a.current,...D]),{...R,...M}}return R}let[d]=Fc(u),p=ve(r),f=(I,R)=>{if(R.type==="REPLACE_STATE")return R.payload;let x=c?.()??null,D=R.payload.mappedState,M=R.payload.updatedPropsToState,A={...I};if(D&&Object.assign(A,D),o.mapPropsToState){let{fn:_,propertyReads:P}=Fa(o.mapPropsToState,{getProxyTargetFromArgs:N=>N.props,putProxyToArgs:(N,G)=>[{...G,props:N}]}),F=_({props:p(),state:A,oldState:I,parentState:x});a.current=new Set([...a.current,...P]),Object.assign(A,F)}return R.type==="ASSIGN_STATE"&&Object.assign(A,R.payload),o.concludeReducer?o.concludeReducer({previousState:I,state:A,updatedProps:M,parentState:x}):A},[m,g]=gb(f,d),h=ve(m),{allowedControlledPropOverrides:b}=o,T=La(()=>Sb(g,h,p,l,b,o.interceptActions,o.mappedCallbacks),[g,l,b]),S=o.Context??Nc(),C=La(()=>({componentState:m,componentActions:T,getComponentState:h,replaceState:I=>{g({type:"REPLACE_STATE",payload:I})},assignState:I=>{g({type:"ASSIGN_STATE",payload:I})}}),[m,T,h]),y=In(r),v=Oc(!1);v.current=!1;let w=o.layoutEffect?yb:bb;return w(()=>{let I=r,R={},x=0,D={},M=0,A={},E=0;if(new Set([...Object.keys(I),...Object.keys(y)]).forEach(F=>{let N=F,G=y[N],H=I[N];if(N!=="children"&&G!==H&&(A[N]={newValue:H,oldValue:G},E++,on(N,r)||on(N,y)))if(l.hasOwnProperty(F)){let B=H,pe=l[F];typeof pe=="function"&&(B=pe(H)),m[N]!==B&&(R[N]=B,x++)}else a.current.has(F)&&(D[N]=I[N],M++)}),M>0||x>0){(o.debugName?ut(typeof o.debugName=="function"?`${o.debugName(I)}:rerender`:`${o.debugName}:rerender`):ut("rerender"))("Triggered by new values for the following props",...Object.keys(R??{}),...Object.keys(D??{}));let N={payload:{mappedState:x?R:null,updatedPropsToState:M?D:null}};if(v.current=!0,g(N),o.onPropChange){for(var P in A)if(A.hasOwnProperty(P)){let{newValue:G,oldValue:H}=A[P];o.onPropChange({name:P,newValue:G,oldValue:H},r,T,m)}}o.onPropsChange&&E&&o.onPropsChange(A,r,T,m)}}),w(()=>{s!=null&&!v.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),_c(()=>()=>{o.cleanup?.(h())}),{contextValue:C,ContextComponent:S}}return{ManagedComponentContextProvider:Xn.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return Xn.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function je(o){return o=o??Nc(),Xn.useContext(o)}import*as Yc from"react";var Gr=()=>Me;var Lc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",kc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Ft="_16lm1iw3b _16lm1iw3c _16lm1iw35",zc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},Zn={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Hr={1:"_16lm1iw1c",none:"_16lm1iw1d"},Vo={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Vc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Gc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Hc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Kc={none:"_16lm1iwd"},Bc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Kr={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Wc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var jc={none:"_16lm1iw1x"};var $c={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Uc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function qc(o){let{rootClassName:e}=Gr();return Yc.createElement("div",{...o,className:Z(`${e}Footer`,Kr.relative,Zn.flex,Vo.row,o.className)})}import*as Ie from"react";import{useCallback as bp,useContext as nT,useEffect as oT,useRef as rT}from"react";import{createPortal as iT}from"react-dom";function Br(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}import*as Xc from"react";var _e=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return Xc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};import*as Go from"react";var Zc=o=>Go.createElement(_e,{...o},Go.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4H11.14M12 6.29L14.03 11.71H9.96L12 6.29"}),Go.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Go.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));import*as za from"react";var Qc=o=>za.createElement(_e,{...o},za.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M20 14V18H2V20H22V14Z"}));import*as Va from"react";var Ga=o=>Va.createElement(_e,{...o},Va.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));import*as Ha from"react";var Jc=o=>Ha.createElement(_e,{...o},Ha.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));import*as Ka from"react";var eu=o=>Ka.createElement(_e,{...o},Ka.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));import*as Ba from"react";var tu=o=>Ba.createElement(_e,{...o},Ba.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));import*as Wa from"react";var nu=o=>Wa.createElement(_e,{...o},Wa.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));import*as ja from"react";var ou=o=>ja.createElement(_e,{...o},ja.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));import*as $a from"react";var ru=o=>$a.createElement(_e,{...o},$a.createElement("path",{d:"M11.14 4L6.43 16H8.36L9.32 13.43H14.67L15.64 16H17.57L12.86 4M12 6.29L14.03 11.71H9.96M4 18V15H2V20H22V18Z"}));import*as nl from"react";import*as qe from"react";import{useEffect as Nb,useState as Ou}from"react";import{useContext as Ib}from"react";import{createContext as wb}from"react";var Ua;function Qn(){return Ua||(Ua=wb(null))}var Q=()=>{let o=Qn();return Ib(o)};import{useContext as vb}from"react";var iu=()=>{let o=Qn(),{state:e}=vb(o);return e};import*as Jn from"react";import{useEffect as Rb,useLayoutEffect as xb,useState as vu}from"react";var au="_1eexc2a6";var lu=ue({defaultClassName:"_12zfob12c _16lm1iw1z _16lm1iw22 _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw33",variantClassNames:{filtered:{false:"_12zfob12d",true:"_12zfob12e"},verticalAlign:{start:"_12zfob12f",end:"_12zfob12g",center:"_12zfob12h"},align:{start:"_12zfob12i",end:"_12zfob12j",center:"_12zfob12k"}},defaultVariants:{},compoundVariants:[]}),su="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",cu=ue({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),uu=ue({defaultClassName:"_12zfob1r",variantClassNames:{rowActive:{false:"_12zfob1s",true:"_12zfob1t"},cellSelected:{false:"_12zfob1u",true:"_12zfob1v"},rowSelected:{false:"_12zfob1w",true:"_12zfob1x",null:"_12zfob1y"},rowDisabled:{false:"_12zfob1z",true:"_12zfob110"},firstRow:{false:"_12zfob111",true:"_12zfob112"},treeNode:{parent:"_12zfob113",leaf:"_12zfob114",false:"_12zfob115"},firstRowInHorizontalLayoutPage:{false:"_12zfob116",true:"_12zfob117"},groupRow:{false:"_12zfob118",true:"_12zfob119"},groupCell:{false:"_12zfob11a",true:"_12zfob11b"},align:{start:"_12zfob11c",end:"_12zfob11d",center:"_12zfob11e"},verticalAlign:{start:"_12zfob11f",end:"_12zfob11g",center:"_12zfob11h"},zebra:{false:"_12zfob11i",even:"_12zfob11j",odd:"_12zfob11k"},dragging:{true:"_12zfob11l",false:"_12zfob11m"},insideDisabledDraggingPage:{true:"_12zfob11n",false:"_12zfob11o"},first:{true:"_12zfob11p",false:"_12zfob11q"},last:{true:"_12zfob11r",false:"_12zfob11s"},groupByField:{true:"_12zfob11t",false:"_12zfob11u"},firstInCategory:{true:"_12zfob11v",false:"_12zfob11w"},lastInCategory:{true:"_12zfob11x",false:"_12zfob11y"},pinned:{start:"_12zfob11z",end:"_12zfob120",false:"_12zfob121"},filtered:{true:"_12zfob122",false:"_12zfob123"}},defaultVariants:{},compoundVariants:[[{pinned:"start",lastInCategory:!0},"_12zfob124"],[{pinned:"end",firstInCategory:!0},"_12zfob125"],[{pinned:!1,lastInCategory:!0},"_12zfob126"]]}),du=ue({defaultClassName:"_12zfob1c _16lm1iw1s _16lm1iw2",variantClassNames:{pinned:{start:"_12zfob1d",end:"_12zfob1e",false:"_12zfob1f"},firstInCategory:{true:"_12zfob1g",false:"_12zfob1h"},lastInCategory:{true:"_12zfob1i",false:"_12zfob1j"},overflow:{true:"_12zfob1k",false:"_12zfob1l"}},defaultVariants:{},compoundVariants:[[{overflow:!0,pinned:"start"},"_12zfob1m"],[{pinned:"start",firstInCategory:!0},"_12zfob1n"],[{overflow:!0,pinned:"end"},"_12zfob1o"],[{pinned:"end",lastInCategory:!0},"_12zfob1p"]]}),pu="_12zfob12u _16lm1iw22 _16lm1iw1z";var fu="_12zfob17",mu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",gu=ue({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Ya=ue({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),hu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",bu=ue({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),yu="_12zfob1b _16lm1iw2",Tu="_16lm1iw1",Su="_12zfob16",Cu=ue({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),wu="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var dt="InfiniteIcon";var Iu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Db={transition:"width 0.25s, opacity 0.25s"};function eo(o){let[e,t]=vu(!0),[n,r]=vu(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...Db,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if(Rb(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),xb(()=>{t(!0)},[]),!e)return null;let m={};return Jn.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:Z(l,dt,Iu,`${dt}-filter`)},c?Jn.createElement("div",{"data-name":"index",style:m,className:fu},s):null,Jn.createElement("div",{style:{width:p[0],...f}}),Jn.createElement("div",{style:{width:p[1],...f}}),Jn.createElement("div",{style:{width:p[2],...f}}))}var qa=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((w,I)=>{let R=w.maxSize??r??void 0,x=w.minSize??n??void 0;s.push(x),c.push(R),w.size!=null&&(R!=null&&w.size>R&&(w.size=R),x!=null&&w.size<x&&(w.size=x));let D=w.flex==0?null:w.flex;if(w.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${I} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,i+=w.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((w,I)=>{if(w.flex!=null){let R=d*w.flex,x=w.maxSize??r??void 0,D=w.minSize??n??void 0,M=!1,A=0;x!=null&&R>x&&(p[I]=!0,M=!0,A=x),D!=null&&R<D&&(f[I]=!0,M=!0,A=D),M&&(m+=1,l-=1,a-=w.flex,u-=A)}}),m&&(d=u/a);let g=[],h=0,b=u,T=a,S=0,C=0,y=[];return{items:t.map((w,I)=>{let R={...w},x=w.maxSize??r??void 0,D=w.minSize??n??void 0,M=0,A=p[I],E=f[I],_=A||E,P=w.size??0;if(w.flex!=null){if(_)E&&(M=D),A&&(M=x);else{h+=1;let F=N=>(x!=null&&N>x&&(N=x),D!=null&&N<D&&(N=D),N);h===l?M=F(b):(M=F(Math.round(w.flex*d)),C+=M,b=u-C,T-=w.flex,d=b/T)}P=M,R.flexSize=M}return g.push(M),y.push(P),R.computedSize=P,S+=P,R}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:y,remainingSize:Math.round(e-S)}};function Wr(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}var Xa=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((x,D)=>(x[D]={...o.columnSizing[D]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],c=l.id,u=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,h=s?.computedMinWidth,b=s?.computedMaxWidth,T=s?.computedFlex?"flex":"width",S=!1,C=!1,y=r>0?1:-1,{value:v,clamped:w,diff:I}=Wr(d+r,p,f,y);if(o.shareSpaceOnResize){if(s==null)return n[c]={...n[c],[m]:v},C=w==="min",S=w==="max",{adjustedDiff:v-d,reservedWidth:t,columnSizing:n,minReached:C,maxReached:S,constrained:C||S};let{value:x,clamped:D,diff:M}=Wr(g-r,h,b,y);if(w&&D&&(Math.abs(I)>Math.abs(M)?D=!1:w=!1),!(!w&&!D)){if(w){let A=Wr(g-r-I,h,b,y);x=A.value,D=A.clamped,M=A.diff}else if(D){let A=Wr(d+r+M,p,f,y);v=A.value,w=A.clamped,I=A.diff}}n[c]={...n[c],[m]:v},n[u]={...n[u],[T]:x},C=w==="min"||D==="min",S=w==="max"||D==="max"}else n[c]={...n[c],[m]:v},C=w==="min",S=w==="max";let R=v-d;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?t:t-R,columnSizing:n,minReached:C,maxReached:S,constrained:C||S}};function Ru(o,e){return o+e}function Pb(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var xu=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((b,T)=>(b[T]={...o.columnSizing[T]},b),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((b,T)=>o.dragHandlePositionAfter-T).reverse(),a=i.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),s=a.map(b=>b.computedFlex?"flex":"width"),c=0,{computedSizes:u}=qa({items:a.map(b=>(b.resizable===!1&&(c+=b.computedWidth),{maxSize:b.computedMaxWidth,minSize:b.computedMinWidth,flex:b.resizable?b.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Ru,0)+r-c,0)}),d=a.map((b,T)=>u[T]-b.computedWidth),p=!0,f=!0,m=!0,g=[];d.forEach((b,T)=>{let S=a[T];if(!S.resizable){g.push(0);return}let C=s[T],y=l[T],v=Pb(n),{maxReached:w,minReached:I,constrained:R,adjustedDiff:x}=Xa({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:i[T],shareSpaceOnResize:!1,items:o.items,columnSizing:v});n[S.id]={...v[S.id],[C]:y+x},g.push(x),w||(f=!1),I||(p=!1),R||(m=!1)});let h=g.reduce(Ru,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:g,adjustedDiff:h,columnSizing:n,reservedWidth:t-h}};var jr;function rn(){if(jr!=null)return jr;let o=we().document??null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),jr=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),jr}var Du=["start",void 0,"end"],Pu=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Du.indexOf(r)-Du.indexOf(i)}),o);function Eu(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function Za(o,...e){return Eu(t=>t!=null,o,...e)}function Mu(o,e,...t){return Eu((n,r)=>!(r in o),e,...t)}var $r=Object.freeze({}),Eb={string:$r,number:{}};function Qa(o,e){let t=e.default||$r;return o.type===void 0?t:o.type===null?$r:typeof o.type=="string"?e[o.type]||Eb[o.type]||$r:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var Ur=!0,Mb=!0,Ab=!0,_b="string",to="unknown",Fb=Qt("getComputedVisibleColumns"),Ob=(o,e,t)=>o[t]!==!1,Ja=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},Au=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:g=vn,viewportReservedWidth:h,resizableColumns:b,draggableColumns:T,columnDefaultDraggable:S,columnOrder:C,columnPinning:y,editable:v,columnDefaultEditable:w,columnDefaultFilterable:I,columnDefaultGroupable:R,columnDefaultSortable:x,columnSizing:D,columnTypes:M,columnVisibility:A,columnVisibilityAssumeVisible:E,groupBy:_})=>{let P=0,F={};_.forEach((z,X)=>{z.field&&(F[z.field]=X)});let N=(d||[]).reduce((z,X)=>{let{id:ye,field:Ce}=X;return Ce&&(z[Ce]=X),ye&&(z[ye]=X),z},{}),G=Pu(C===!0?Object.keys(o):C,y),H=G.filter(z=>o[z]?Ob(A,E,z):(Fb(`Column with id "${z}" specified in columnOrder array cannot be found in the columns map.`),!1)),B=new Map,pe=H.map((z,X)=>{let ye=o[z];return B.set(z,X),ye}),de=(f??[]).reduce((z,X,ye)=>(X.id?z[X.id]={sortInfo:X,index:ye}:X.field&&(z[X.field]={sortInfo:X,index:ye}),z),{});function k(z){let X=o[z],ye=Qa(X,M),Ce={minWidth:ye?.minWidth,maxWidth:ye?.maxWidth,width:ye?.defaultWidth,flex:ye?.defaultFlex},$e=Za({width:X?.defaultWidth,flex:X?.defaultFlex,minWidth:X?.minWidth,maxWidth:X?.maxWidth},D[z]);$e.width!=null&&delete Ce.flex,$e.flex!=null&&delete Ce.width,$e=Za(Ce,$e);let L=$e.flex??void 0,He=$e.minWidth??X?.minWidth??t,Et=$e.maxWidth??X?.maxWidth??n,ct=L!=null?void 0:$e.width??(i?void 0:r);return!ct&&L==null&&(i?L=i:ct=He),{size:ct,flex:L,minSize:He,maxSize:Et}}let W=qa({availableSize:Math.max(e.width-(h??0)-(a??rn()),0),maxSize:n,minSize:t,items:H.map(k)}),{computedSizes:se,flexSizes:ce,minSizes:ie,maxSizes:oe}=W,te=[],fe=[],ne=[],V=[];V.length=H.length;let U=new Map,O=new Map,re=0,j=0,K=0,ee=null,Y=[],le=0,me=0,Ve=0;pe.forEach((z,X)=>{let ye=H[X],Ce=se[X],$e=Y[X]=Ja(ye,y);$e==="start"?le+=Ce:$e==="end"?Ve+=Ce:me+=Ce});let Ee=e.width-Ve,Ge=[],Ue=new Map;H.forEach((z,X)=>{let ye=pe[X];Ue.set(z,ye)});let Le=[];Object.keys(o).forEach(z=>{let X=o[z];Le.push(z),Ue.has(z)||Ue.set(z,X)});let Ye=new Map;Ue.forEach((z,X)=>{let ye=B.get(X);ye==null&&(ye=-1);let Ce=ye!=-1,$e=H[ye+1],L=Qa(z,M),He=ye,Et=de[X]?de[X]:z.field?de[z.field]??null:null,ct=Et?.sortInfo??null,Tt=!!ct,Mt=Tt&&ct.dir===1,oa=Tt&&!Mt,ra=Et?.index??-1,vo=Ce?{}:k(X),fr=Ce?se[ye]:vo.size||0,Pe=Ce&&ce[ye]||null,Ze=Ce?ie[ye]||0:vo.minSize||0,kt=Ce?oe[ye]||1e4:vo.maxSize||1e4,Fe=Ce?Ja(X,y):!1,Kn=Ce?ye===H.length-1:!1,mr=He,Gg=Ce?Fe==="start"?j:Fe==="end"?K:P-j:0;Fe=="start"?mr=Ce?He:-1:Fe==="end"?mr=Ce?He-(te.length+ne.length):-1:mr=Ce?He-te.length:-1;let Hg=Ce?Fe==="start"||Fe===!1?P:Ee+K:-1,Kg=Ce?Fe!==ee:!1,Bg=Ce?Kn||Fe!==Ja($e,y):!1,xs=z.cssEllipsis??L.cssEllipsis??l,Wg=z.headerCssEllipsis??L.cssEllipsis??z.cssEllipsis??L.headerCssEllipsis??s??xs,gr=Ce&&(N[X]||z.field||z.groupByForColumn)&&(N[X]||N[z.field||z.groupByForColumn])||null,jg=z.defaultFilterable??L.defaultFilterable??I??!0,$g=v??z.defaultEditable??L.defaultEditable??w??!1,ia=z.dataType||L.dataType||(Array.isArray(z.type)?z.type[0]:z.type)||_b,Ug=z.sortType||L.sortType||ia,Ds=z.filterType||L.filterType||ia,Ps=!1;if(gr!=null&&!gr.disabled){let la=g[Ds];la&&(!la.emptyValues||!la.emptyValues.includes(gr.filter.value))&&(Ps=!0)}let Bn=z.field??L.field,Es=z.valueGetter??L.valueGetter,Ms=z.defaultGroupable??L.defaultGroupable??R??!!Bn;z.groupByForColumn&&(Ms=!1);let aa=z.defaultSortable??L.defaultSortable;aa==null&&!z.groupByForColumn&&Bn==null&&Es==null&&(aa=!1);let As=Bn?F[Bn]!==void 0:!1,Yg=As?F[Bn]:void 0,qg=p??aa??x??Ur,Xg=z.resizable??L.resizable??b??Mb,Ke={colType:L,align:L.align,headerAlign:L.headerAlign,computedVisible:Ce,verticalAlign:L.verticalAlign,defaultHiddenWhenGroupedBy:L.defaultHiddenWhenGroupedBy,valueGetter:Es,valueFormatter:L.valueFormatter,renderValue:L.renderValue,render:L.render,style:L.style,contentFocusable:L.contentFocusable,renderMenuIcon:L.renderMenuIcon,renderSortIcon:L.renderSortIcon,renderRowDetailIcon:L.renderRowDetailIcon,renderSelectionCheckBox:L.renderSelectionCheckBox,renderHeaderSelectionCheckBox:L.renderHeaderSelectionCheckBox,headerStyle:L.headerStyle,headerClassName:L.headerClassName,columnGroup:L.columnGroup,getValueToEdit:L.getValueToEdit,getValueToPersist:L.getValueToPersist,shouldAcceptEdit:L.shouldAcceptEdit,field:Bn,...z,components:{...L.components,...z.components},computedResizable:Xg,computedMinWidth:Ze,computedMaxWidth:kt,computedFlex:Pe,computedDataType:ia,computedEditable:$g,computedSortType:Ug,computedFilterType:Ds,cssEllipsis:xs,headerCssEllipsis:Wg,computedFilterValue:gr,computedFiltered:Ps,computedFilterable:jg,computedGroupable:Ms,computedGroupedBy:As,computedGroupedByIndex:Yg,computedWidth:fr,computedAbsoluteOffset:Hg,computedPinningOffset:Gg,computedVisibleIndexInCategory:mr,computedOffset:P,computedSortable:qg,computedSortInfo:ct,computedSortIndex:ra,computedMultiSort:m,computedSorted:Tt,computedSortedAsc:Mt,computedSortedDesc:oa,computedVisibleIndex:He,computedPinned:Fe,computedDraggable:T??z.defaultDraggable??S??Ab,computedFirstInCategory:Kg,computedLastInCategory:Bg,computedFirst:ye===0,computedLast:Kn,id:X,header:z.header??L.header??z.name??z.field};Ce&&(P+=fr,U.set(Ke.id,Ke),V[ye]=Ke,Fe==="start"&&(te.push(Ke),j+=Ke.computedWidth),Fe==="end"&&(fe.push(Ke),K+=Ke.computedWidth),Fe||(ne.push(Ke),re+=Ke.computedWidth),ee=Fe),Ke.groupByForColumn&&(Ke.computedSortType=z.sortType||L.sortType||to,Ge.push(Ke)),O.set(Ke.id,Ke),Ke.field&&!Ke.groupByForColumn&&!Ye.has(Ke.field)&&Ye.set(Ke.field,Ke)}),Ge.forEach(z=>{z.computedSortable=_u(z,{fieldsToColumn:Ye,sortable:p,columnDefaultSortable:x})});let We=new Map;Le.forEach(z=>{let X=O.get(z);X&&We.set(z,X)}),O.forEach(z=>{We.has(z.id)||We.set(z.id,z)});let yt=c!=null?Math.min(c,j):j,bn=u!=null?Math.min(u,K):K;return{computedRemainingSpace:e.width-(le+Ve+me),computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:K,computedUnpinnedColumnsWidth:re,computedColumnOrder:G,computedPinnedStartColumns:te,computedPinnedEndColumns:fe,computedUnpinnedOffset:j,computedPinnedEndOffset:j+re,computedUnpinnedColumns:ne,computedVisibleColumns:V,computedColumnsMap:O,computedColumnsMapInInitialOrder:We,computedVisibleColumnsMap:U,computedPinnedEndWidth:bn,computedPinnedStartWidth:yt,renderSelectionCheckBox:V.reduce((z,X)=>z||!!X.renderSelectionCheckBox,!1),fieldsToColumn:Ye}};function _u(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r}=e;if(t)return t;let i=o.defaultSortable??o.colType.defaultSortable;if(i!=null)return i;let a=r??Ur;return o.computedSortType!==to&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.groupField,g;if(m){let h=n.get(m),b=h?u.getColumnApi(h.id):void 0;h&&b?g=b.isSortable():g=!1}return g===void 0&&f.valueGetter&&(g=!0),g??r??Ur},!0)}}function et(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function Rn(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=et(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}import*as Fu from"react";var Yr=`${Je}HeaderCell__filter`,el=`${Je}HeaderCell__filterOperator`,tl=Fu.createContext(null);var Lb=`${Yr}__input`,qr=o=>o.stopPropagation();function Nu(o){let{filterOperatorMenuVisibleForColumnId:e}=iu(),{column:t}=Xr(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=Ou(!1),l=qe.useCallback(()=>{a(!0)},[]),s=qe.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return qe.createElement("div",{onPointerUp:qr,onPointerDown:qr,onFocus:l,onBlur:s,className:`${Yr} ${Ya({active:c})}`,style:{height:o.columnHeaderHeight}},qe.createElement(tl.Provider,{value:o},qe.createElement(r,null),qe.createElement(n,null)))}function Lu(){let{columnApi:o,disabled:e,operator:t}=Ho(),n=t?.components?.Icon??eo;return qe.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:Z(el,mu,e?`${el}--disabled`:"")},qe.createElement(n,{size:20,className:`${gu({disabled:e})}`}))}function ku(){return qe.createElement("div",{onPointerUp:qr,onPointerDown:qr,className:`${Yr} ${Ya({active:!1})} ${Vc["50%"]}`})}function Ho(){let o=Q(),{column:e,columnApi:t}=Xr(),n=Rn(e,o,"column-filter"),r=qe.useContext(tl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=Ou(l?.filter.value??""),d=qe.useCallback(h=>{u(h),r.onChange(h)},[r.onChange]),p=qe.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=qe.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);Nb(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==c&&u(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${pu} ${Lb}`}}function no(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Ho();return nl.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function Zr(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Ho();return nl.createElement("input",{"aria-label":o,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:n})}function kb(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:no},operators:[{name:"includes",components:{Icon:Zc},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Ga},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:ru},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Qc},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Zr},operators:[{label:"Equals",components:{Icon:Ga},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:ou},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:eu},fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>t},{name:"gte",components:{Icon:Jc},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>=t},{name:"lt",components:{Icon:nu},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<t},{name:"lte",components:{Icon:tu},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<=t}]}}}var vn=kb();function Qr(o,e,t,n){let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}import{useCallback as fd,useState as md}from"react";var zu="_16lm1iw1",Vu="_16lm1iw1 _16lm1iw1c _16lm1iwe",Gu="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",Hu="_1yeub2vt",Ku="_1yeub2vs",Bu=ue({defaultClassName:"_1yeub2v3",variantClassNames:{horizontalLayout:{true:"_1yeub2v4",false:"_1yeub2v5"},focused:{true:"_1yeub2v6",false:"_1yeub2v7"},focusedWithin:{true:"_1yeub2v8",false:"_1yeub2v9"},hasPinnedStart:{true:"_1yeub2va",false:"_1yeub2vb"},hasPinnedEnd:{true:"_1yeub2vc",false:"_1yeub2vd"},hasPinnedStartOverflow:{true:"_1yeub2ve",false:"_1yeub2vf"},hasPinnedEndOverflow:{true:"_1yeub2vg",false:"_1yeub2vh"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vi"]]});var ol="_1yeub2vq";var i1=ue({defaultClassName:"_1yeub2vm",variantClassNames:{pinned:{start:"_1yeub2vn",end:"_1yeub2vo",false:"_1yeub2vp"}},defaultVariants:{},compoundVariants:[]});var rl=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};var Ko={bodyWidth:{name:q(ae.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:q(ae.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:q(ae.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:q(ae.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:q(ae.runtime.browserScrollbarWidth),value:""}},zb=q($.scrollbarWidthHorizontal),Wu=q($.scrollbarWidthVertical),Vb=q($.columnWidthAtIndex),Gb=q($.columnZIndexAtIndex),ju=q($.scrollLeft),Hb=q($.activeCellColWidth),$u=q($.activeCellColOffset),Xu=q($.baseZIndexForCells),Kb=q($.pinnedStartWidth),Uu=q($.bodyWidth),Bb=q($.bodyHeight),Yu=q($.pinnedEndOffset),qu=q($.pinnedEndWidth),Wb=q($.computedVisibleColumnsCount);function il(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${Xu}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Zu(o){let e=rn(),{computed:t,state:n,actions:r,getState:i}=Q(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:c,onBlurWithin:u,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:g,wrapRowsHorizontally:h}=n,{computedPinnedStartColumnsWidth:b,computedPinnedEndColumnsWidth:T,computedPinnedStartColumns:S,computedPinnedEndColumns:C,computedVisibleColumns:y,computedUnpinnedColumnsWidth:v,scrollbars:w}=t,I=[],R=y.reduce((P,F)=>{let N=F.computedVisibleIndex;P[Te.columnWidths.varName.get(N)]=F.computedWidth+"px",P[Te.columnOffsets.varName.get(N)]=F.computedPinned==="start"?`calc( ${F.computedOffset}px + var(${ju}) )`:F.computedPinned==="end"?`calc( var(${Yu}) ${I.length?"+":""} ${I.map(H=>Te.columnWidths.get(H.computedVisibleIndex)).join(" + ")} + var(${ju}) )`:`${F.computedOffset}px`;let G=il(F,{pinnedStartColsCount:S.length,visibleColsCount:y.length});return P[`${Gb}-${N}`]=`${G}`,F.computedPinned==="end"&&I.push(F),P},{});if(m.width&&(R[Ko.browserScrollbarWidth.name]=`${rn()}px`),R[Ko.bodyWidth.name]=`calc(${$.bodyWidth} - ${$.scrollbarWidthVertical})`,R[Ko.totalVisibleColumnsWidthValue.name]=`${b+T+v}px`,R[Ko.totalVisibleColumnsWidthVar.name]=`calc(${y.map((P,F)=>`var(${Vb}-${F})`).join(" + ")})`,R[Ko.visibleColumnsCount.name]=y.length,g!=null){R[Hb]=Te.columnWidths.get(g[1]);let P=Te.columnOffsets.get(g[1]);if(n.brain.isHorizontalLayoutBrain){let F=n.brain.getPageIndexForRow(g[0]);R[$u]=F?`calc( ${ae.runtime.totalVisibleColumnsWidthVar} * ${F} + ${P})`:P}else R[$u]=P}R[Wb]=y.length,R[zb]=w.horizontal?`${e}px`:"0px",R[Wu]=w.vertical?`${e}px`:"0px",R[Kb]="calc( "+S.map(P=>Te.columnWidths.get(P.computedVisibleIndex)).join(" + ")+")",R[qu]="calc( "+C.map(P=>Te.columnWidths.get(P.computedVisibleIndex)).join(" + ")+")",R[Xu]=y.length*10,R[Yu]=`calc( var(${Uu}) - var(${qu}) - var(${Wu}) )`,R[Uu]=`${m.width}px`,R[Bb]=`${m.height}px`;let x=rl(P=>{r.focused=P}),D=rl(P=>{r.focusedWithin=P}),E={...o,onFocus:P=>{if(o?.onFocus?.(P),P.target===s.current||P.target===c.current){if(i().focused)return;x(!0),p?.(P),l&&(D(!1),u?.(P));return}l||(D(!0),d?.(P))},onBlur:P=>{if(o?.onBlur?.(P),P.target===s.current||P.target===c.current){if(!i().focused)return;x(!1),f?.(P),l&&(D(!1),u?.(P));return}s.current?.contains(P.relatedTarget)||(D(!1),u?.(P))}},_=Z(Gt,Gu,h?`${Gt}--horizontal-layout`:null,E?.className,b?`${Gt}--has-pinned-start ${Ku}`:null,T?`${Gt}--has-pinned-end ${Hu}`:null,a?`${Gt}--focused`:null,l?`${Gt}--focused-within`:null,a&&n.focusedClassName?n.focusedClassName:null,l&&n.focusedWithinClassName?n.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Gt}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Gt}--has-pinned-end-overflow`:null,Bu({horizontalLayout:!!h,hasPinnedStart:!!b,hasPinnedEnd:!!T,focused:a,focusedWithin:l}));return E.className=_,E.style={...o?.style,...R},a&&n.focusedStyle&&Object.assign(E.style,n.focusedStyle),l&&n.focusedWithinStyle&&Object.assign(E.style,n.focusedWithinStyle),E}var id=Wn(Tn());function Jr(o){return o.map(e=>e instanceof an?e:new an(null,[e]))}var an=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>jb(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function jb(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var $b=(...o)=>new an("+",Jr(o)),Qu=(...o)=>new an("-",Jr(o)),Ub=(...o)=>new an("*",Jr(o)),Yb=(...o)=>new an("/",Jr(o)),Bo={add:$b,subtract:Qu,minus:Qu,multiply:Ub,divide:Yb};var xn=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var Ju=o=>{let e=null,t=null;return{stop(){e!==null&&It(e),t!=null&&It(t)},scroll(n){e!==null&&It(e),t!=null&&It(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=Ae(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=Ae(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Ne=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,n=e.left-this.left;return{top:t,left:n}}};function ed(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function td(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function qb(o,e,t){let n=ed(o,t),r=ed(e,t);return n===r?td(t,e)-td(t,o):n-r}function nd(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>qb(n,r,t)),e}function Xb(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function Zb(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=nd(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function od(o,e){if(Xb(o))return Zb(o,e);o=nd(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(Qb([t,i,a],e))return!0}return!1}function Qb(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var oo=class{containsPoint(e){return od(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var ro=class o extends oo{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(Ne.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function Jb(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,c=Math.max(l,s);return new Se({top:n,left:t,width:a-t,height:c-n})}var Se=class o extends oo{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=Jb(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new ro(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(Ne.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var rd=10,ey=q($.pinnedStartWidth);function ad(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:h,horizontalLayoutPageIndex:b,pageWidth:T}=o;function S(V){let U=V==="start"?N:G;return _===F?U:F===V?U+A.computedWidth:_===V?U-A.computedWidth:U}function C(V){if(V.columnIndex===E||b!=null)return!0;let U=e[V.columnIndex];if(U.computedPinned)return!0;let O=l.getScrollPosition().scrollLeft,re=U.computedOffset+(b!=null&&T!=null?T*b:0);return re>=O+S("start")&&re+U.computedWidth<=O+u.width-S("end")}let y=(V,U)=>{let{restrictToParentGroup:O,dragColumn:re}=U,j=[];if(V.forEach(ee=>{if(ee.computedVisibleIndex===E)return;let Y={columnId:ee.id,columnIndex:ee.computedVisibleIndex,offsetX:ee.computedOffset+Math.round(ee.computedWidth/2)};C(Y)&&j.push(Y)}),O){let Y=function(me,Ve,Ee){let Ge=V[me];Ge&&(Ge.columnGroup!==re.columnGroup&&Ee.add(Ge.id),Y(me+Ve,Ve,Ee))};var K=Y;let ee=re.computedVisibleIndex,le=new Set;Y(ee-1,-1,le),Y(ee+1,1,le),j=j.filter(me=>!le.has(me.columnId))}return j},w=r.length,I={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},R={left:I.clientX-u.left-(I.clientX-s.left)+rd,top:I.clientY-u.top-(I.clientY-s.top)+rd},x=l.getScrollPosition(),D=e.map(V=>V.computedVisibleIndex),M=D,A=t.get(i),E=A.computedVisibleIndex,_=A?.computedPinned,P=E,F=_,N=l.getFixedStartColsWidth(),G=l.getFixedEndColsWidth(),H=I,B={x:0,y:0},pe=1,de=0;function k(V){let U=Math.round(V.clientX),O=Math.round(V.clientY);if(U===H.clientX&&O===H.clientY)return Se.from(s).shift({left:B.x,top:B.y});H={clientX:U,clientY:O};let j=l.getScrollPosition().scrollLeft-x.scrollLeft;return B.x=H.clientX-I.clientX,B.y=H.clientY-I.clientY,de=B.x+j,pe=de<0?-1:1,f({left:R.left+B.x,top:R.top+B.y}),Se.from(s).shift({left:B.x,top:B.y})}function W(V){let U=0;_?_==="start"&&V.forEach((O,re)=>{U||e[O]?.computedPinned!=="start"&&(U=re)}):V.forEach((O,re)=>{e[O]?.computedPinned==="start"&&(U=re+1)}),w=U,se("start",V,U)}function se(V,U,O){if(V==="start"){let re=0;for(let j=0;j<O;j++){let K=U[j],ee=e[K];re+=ee.computedWidth}At(ey,`${re}px`,a)}}function ce(V){if(V==null||V===P)return;if(P===-1&&V!==-1&&(_o(E,"",a),m(!1)),P=V,V===-1){ie(E);return}let U=xn(D,E,P>E?P-1:P);w=0;let re=new Set;return U.forEach((j,K)=>{let ee=M[K];j!==ee&&re.add(j),W(U)}),M=U,oe(re),{newColumnIndexes:U,indexesWithTransition:re,pinnedStartCount:w}}function ie(V){M=M.filter(O=>O!==V),e.forEach(O=>{let re=O.computedVisibleIndex,j=re>V;wa(re,a);let K="";j&&(K=Bo.minus(Te.columnOffsets.get(re),Te.columnWidths.get(V)).done()),$n(re,K,a)}),_o(V,"hidden",a),m(!0)}function oe(V){e.forEach(U=>{let O=U.computedVisibleIndex;V.has(O)?wa(O,a):vr(O,a);let re=O===E,j=pe===-1?O<P||O>E:O<E||O>=P,K="";pe===-1?K=re?Te.columnOffsets.get(P):j?Te.columnOffsets.get(O):Bo.add(Te.columnOffsets.get(O),Te.columnWidths.get(E)).done():K=j?Te.columnOffsets.get(O):re?Bo.add(Te.columnOffsets.get(P-1),Te.columnWidths.get(P-1)).minus(Te.columnWidths.get(E)).done():Bo.minus(Te.columnOffsets.get(O),Te.columnWidths.get(E)).done(),$n(O,K,a)})}let te=u.left+S("start"),fe=u.right-S("end"),ne=Ju({scrollOffsetStart:te,scrollOffsetEnd:fe});return k(I),{speedScroller:ne,stop(){ne.stop()},onMove(V){let U=k(V);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(U.getCenter()))return p&&ce(-1),null;ne.scroll({mousePosition:H,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(Y){h.scrollLeft=Y}});let O=y(e,{dragColumn:A,restrictToParentGroup:c==="group"}),re=pe===-1?A.computedOffset+de:A.computedOffset+A.computedWidth+de,j=(0,id.default)(O,re,({offsetX:Y},le)=>Y<le?-1:Y>le?1:0);j<0&&(j=~j),O.length?j=O[j]?O[j].columnIndex:O[O.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),j=0),j===E+1&&(j=E),ce(j);let K={};n.forEach(Y=>{K[Y.id]="end"});for(let Y=0;Y<w;Y++){let le=M[Y],me=e[le];K[me.id]="start"}let ee=M.map(Y=>e[Y].id);return{columnPinning:K,columnOrder:ee}}}}function St(o,e,t){if(o===e)return!0;if(!o||!e)return!1;var n=Object.keys(o),r=Object.keys(e);t&&(n=n.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=n[a];if(!(t&&t.has(l))&&(o[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function al(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return n;if(a>i){let l=e.indexOf(r),s=e[l-1],c=n.indexOf(s),u=n.indexOf(r);return xn(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return xn(n,u,c)}return e}import*as it from"react";var Dn=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var ld=Wn(Tn());var sd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=n,p=c===a,f=Ne.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,b=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),T=(0,ld.default)(h,b,(w,I)=>w-I);T<0&&(T=~T),m===1&&T===u+1&&p&&T--;let S=Math.min(u,T),C=Math.max(u,T),y=p?i.map((w,I)=>{if(I===u&&p)return t;if(I<S||I>=C)return{left:0,top:0};let R=T<=I?1:-1;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}):i.map((w,I)=>{let R=T<=I?1:0;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}),v={offset:t,dropIndex:T,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:y,dragRect:g,status:"accepted"};return e.acceptsDrop(v)?{event:v,error:null,success:!0}:(v.status="rejected",{event:v,error:"rejected by interaction target",success:!1})},cd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=n,d=Ne.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((b,T)=>b.id===c.id?t:f?{left:0,top:0}:T>m?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(b=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var Re=class Re{static startDrag(e,t){let n=e instanceof io?e:new io(e),r=new ll({activeDragSource:n,startPoint:t});return r.on("start",Re.onDragStart),r.on("move",Re.onDragMove),r.on("drop",Re.onDragDrop),r.start(),r}static emit(e,...t){Re.emitter.emit(e,...t)}static on(e,t){return Re.emitter.on(e,t)}static registerDragInteractionTarget(e){if(Re.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return Re.dragInteractionTargetsMap.set(e.listId,e),Re.emit("register",e),()=>{Re.unregisterDragInteractionTarget(e)}}static unregisterAll(){Re.dragInteractionTargetsMap.forEach(e=>{Re.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!Re.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}Re.dragInteractionTargetsMap.delete(e.listId),e.unregister(),Re.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=Re.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;Re.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Re.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=Re.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(Re.dragInteractionTargetsMap.get(r))),Re.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=sd(e,s);if(c){t(s,c),i.splice(i.indexOf(s),1);break}}a||i.unshift(l);for(let s of i){let c=cd(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Re.withDragMove(e,(c,{event:u})=>{c.move(u),a.push(u),u.outside||(i=u)});let l=i??a[0]??null,s=l?.dropTargetListId??null;Re.emit("drag-move",{dragSourceListId:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Re.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;Re.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),Re.unregisterAll()}};Re.dragInteractionTargetsMap=new Map,Re.emitter=new Dn;var pt=Re,io=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){St(this.data,e)||(this.data=e,this.dragRectangle=new Se(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=Se.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},ll=class extends Dn{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=io.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=io.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=pt;import{useEffect as ty}from"react";var ud=it.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),Pn=()=>it.useContext(ud),sl=o=>{let[e,t]=it.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=it.useRef(e);n.current=e;let r=it.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=it.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return ty(()=>{let a=pt.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=pt.on("drag-move",c=>{let u=n.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=pt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[pt,t]),it.createElement(ud.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var cl=`${Je}Body`,dd=o=>o.querySelector(`.${cl}`);var En=`${Je}HeaderCell`,ul=`${Je}HeaderWrapper`,pd=o=>Array.from(o.querySelectorAll(`.${ul}`));var ny=q($.baseZIndexForCells),oy=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:St(o,e)},gd=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=md(null),[a,l]=md(!1),{getCurrentDragSourceAndTarget:s}=Pn(),{actions:c,computed:u,getComputed:d,getState:p,api:f,state:{domRef:m}}=Q(),g=fd(b=>{let T=d().computedVisibleColumnsMap.get(o);if(!T||!T.computedSortable)return;let{multiSortBehavior:S}=p();f.toggleSortingForColumn(o,{multiSortBehavior:S==="replace"&&(b.ctrlKey||b.metaKey)?"append":S})},[]),h=fd(b=>{let T=b.target?.tagName;if(T==="INPUT"||T==="BUTTON")return;let{brain:S,draggableColumnsRestrictTo:C}=p(),{computedVisibleColumns:y,computedVisibleColumnsMap:v,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedPinnedEndColumns:R}=d(),x=v.get(o);if(!x.computedDraggable){g(b);return}let D=e.current,M=D.getBoundingClientRect(),A=m.current.getBoundingClientRect(),E=S.getAvailableSize(),_=x.computedVisibleIndex,P=S.getVirtualColIndex(x.computedVisibleIndex,{pageIndex:t||0}),F=S.isHorizontalLayoutBrain?S.getPageWidth():null,N=D.style.cursor??"auto",G=!1,H=m.current,B=Se.from(dd(H).getBoundingClientRect()),pe=pd(H).map(fe=>Se.from(fe.getBoundingClientRect())),de=B.getMinimumBoundingRectangle(...pe),k=ad({brain:S,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:F,draggableColumnsRestrictTo:C,computedPinnedEndColumns:R,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedVisibleColumns:y,computedVisibleColumnsMap:v,dragColumnHeaderTargetRect:M,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:f,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:de,initialMousePosition:{clientX:b.clientX,clientY:b.clientY}}),W=null,se,ce;function ie(fe){let{columnPinning:ne,columnOrder:V}=fe;oy(p().columnPinning,ne)||(c.columnPinning=ne);let U=d().computedColumnOrder;JSON.stringify(V,U)&&(y.forEach(O=>{$n(O.computedVisibleIndex,"",m.current)}),c.columnOrder=al({newColumnOrder:V,visibleColumnOrder:d().computedVisibleColumns.map(O=>O.id),existingColumnOrder:U,dragColumnId:o}))}let oe=fe=>{let{headerBrain:ne,brain:V}=p();if(!G){G=!0;let U=V.keepColumnRendered(P),O=ne.keepColumnRendered(P);if(V.isHorizontalLayoutBrain){let j=V.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),K=ne.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ce=()=>{j(),K()}}se=()=>{U(),O()},c.columnReorderDragColumnId=x.id,t!=null&&(c.columnReorderInPageIndex=t),Ca(_,`calc( var(${ny}) + 10000 )`,m.current),m.current?.classList.add(ol),D.style.cursor="grabbing"}W=k.onMove(fe)},te=fe=>{let{multiSortBehavior:ne}=p(),V=e.current;m.current?.classList.remove(ol),k.stop(),S.update({...E}),se?.(),ce?.(),y.forEach(O=>{vr(O.computedVisibleIndex,m.current),$n(O.computedVisibleIndex,"",m.current)}),_o(_,"",m.current),Ca(_,il(x,{pinnedStartColsCount:w.length,visibleColsCount:y.length}),m.current),V.style.cursor=N,V.releasePointerCapture(fe.pointerId),V.removeEventListener("pointermove",oe),V.removeEventListener("pointerup",te),i(null);let U=f.getColumnApi(x.id)?.isSortable()??!1;!G&&U&&f.toggleSortingForColumn(x.id,{multiSortBehavior:ne==="replace"&&(fe.ctrlKey||fe.metaKey)?"append":ne}),W?ie(W):G&&n&&f.setVisibilityForColumn(x.id,!1),c.columnReorderDragColumnId=!1,t!=null&&(c.columnReorderInPageIndex=null)};D.addEventListener("pointermove",oe),D.addEventListener("pointerup",te),D.setPointerCapture(b.pointerId)},[o,t]);return{onPointerDown:u.computedVisibleColumnsMap.get(o)?.computedDraggable?h:g,dragColumnOutside:a,proxyPosition:r}};import*as lo from"react";import*as he from"react";import{useCallback as lt,useContext as by,useMemo as yy}from"react";import*as An from"react";var hd=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;import*as Wo from"react";import{useState as ry}from"react";var bd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",yd=ue({defaultClassName:"_6rdmyg1",variantClassNames:{expanded:{true:"_16lm1iwi",false:"_6rdmyg3"},direction:{end:"_6rdmyg4",start:"_6rdmyg5"},disabled:{true:"_6rdmyg6",false:"_6rdmyg7"}},defaultVariants:{},compoundVariants:[[{expanded:!1,direction:"end"},"_16lm1iwj"]]});var ei=`${dt}-expand-collapse`;function Mn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=ry(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),on("expanded",o)||i(!r)};Wo.useEffect(()=>{on("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Wo.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:Z(o.className,bd,yd({direction:t||"start",expanded:r,disabled:n}),`${dt}`,`${ei}`,`${ei}--${l}`,`${ei}--${t==="end"?"end":"start"}`,n?`${ei}--disabled`:"")},Wo.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}import*as ti from"react";var Td="_16lm1iwb _16lm1iw1d _16lm1iwk";var Sd=o=>ti.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:Z(o.className,Td,"InfiniteIcon","InfiniteIcon-loading")},ti.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},ti.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var Cd=ue({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),wd="_7pupv00",Id=ue({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function vd({rowInfo:o}){return{[q(ae.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function ni({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=n,d=Z(Zn.flex,i.align==="end"?Vo.rowReverse:Vo.row,kc.center,`${_n}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c)?Cd({align:a}):null);if(e==="multi-column"){if(o+1!==u.groupNesting&&u.isGroupRow)return c?An.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return An.createElement("div",{className:d},s,c,An.createElement("div",{className:Ft},l??null))}}function oi({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return hd(u)?f=An.createElement(Sd,null):m&&(f=An.createElement(Mn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=An.createElement(at,{render:n,renderParam:r})),f}}function Rd(o,e,t){let{groupByForColumn:n,groupIndexForColumn:r,groupRenderStrategy:i}=o,a=n.column?{...n.column}:{},l={header:`Group by ${n.field||n.groupField}`,groupByForColumn:n,render:ni({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:oi({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(o,e)}:l={...l,...t}),l}function xd(o,e,t){let n=typeof t=="function"?t(o,e):t,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:ni({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...n,renderGroupIcon:oi({initialRenderGroupIcon:n?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Dd(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}import*as ri from"react";import{useEffect as iy,useRef as ay}from"react";var Pd="qz8ht90 _16lm1iwk";function ly(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:sy}=vt({forwardProps:ly,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function cy(){let{componentState:o,componentActions:e}=je(),{checked:t,domProps:n,disabled:r}=o,i=ay(null);return iy(()=>{i.current.indeterminate=t==null},[t]),ri.createElement("input",{...n,className:Z("InfiniteCheckBox",Pd,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function Ht(o){return ri.createElement(sy,{...o},ri.createElement(cy,null))}function uy(o){return typeof o.field=="string"}function Ed(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?n.get(i.field||i.groupField):void 0}!r&&e.field&&(r=n.get(e.field))}return r}function ft(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",b=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:T,formattedValueContext:{rawValue:S}}=ao({column:p,rowInfo:c,rowDetailState:b,columnsMap:e().computedColumnsMap,context:o}),C=et(p.id,o);return u?{api:a,dataSourceApi:l,column:p,columnApi:C,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:C,column:p,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:S}:{api:a,dataSourceApi:l,columnApi:C,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:S}:{api:a,dataSourceApi:l,columnApi:C,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:T,rawValue:S}}function Md(o){return _d(o.column,o.rowInfo)}function Ad(o){let{column:e,context:t,rowInfo:n,visibleColumnsIds:r}=o,i=Ed({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=ao(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:dy({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnsIds:o.visibleColumnsIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function dy(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,b=p(),{selectionMode:T,cellSelection:S}=b,C=Ed({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),y=d.toggleGroupRow,v=S?.isCellSelected(n.id,e.id)??!1,w={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:v,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:C,selectionMode:T,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:h,toggleGroupRow:y,toggleCurrentGroupRow:()=>{n.isGroupRow&&y(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:b.groupBy,pivotBy:b.pivotBy};return Object.defineProperty(w,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),w}function _d(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:uy(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function py(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function ao(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=_d(e,t),a=py(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}import*as Kt from"react";var{rootClassName:Fd}=Me,Fn=`${Fd}Cell`,dl=`${Fd}Cell_content`,fy=q($.columnWidthAtIndex),my=q($.columnReorderEffectDurationAtIndex);function gy(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=o,b=typeof m=="function"?m():m,T={width:`var(${fy}-${i.computedVisibleIndex})`,transition:`transform var(${my}-${i.computedVisibleIndex}, 0s)`,...h.style},S={...h,style:T,"data-column-id":i.id,"data-z-index":T.zIndex,className:Z(h.className,Fn,xc),children:Kt.createElement(Kt.Fragment,null,d,Kt.createElement("div",{className:Z(dl,e?Ft:Bc.hidden,s),style:r},b),u)};c!=null&&(S["data-row-id"]=`${c}`);let C=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return C?Kt.createElement(C,{...S,ref:a}):Kt.createElement("div",{...S,ref:a})}var ii=Kt.memo(gy);import*as On from"react";import{useCallback as Od,useRef as hy}from"react";function Nd(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=pl(),i=hy(null),a=On.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=Od(s=>{let{key:c}=s;c==="Enter"||c==="Tab"?t():c==="Escape"?n():s.stopPropagation()},[]);return On.createElement(On.Fragment,null,On.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:Z(Lc,Kc.none),type:"text",defaultValue:o,onChange:Od(s=>{e(s.target.value)},[])}))}var{rootClassName:Ty}=Me,Sy=q($.columnZIndexAtIndex),Cy=q($.columnVisibilityAtIndex);function wy({rowInfo:o}){return{[q(ae.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}var jo=he.createContext(null),_n=`${Ty}ColumnCell`,Iy=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return he.createElement(Mn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},vy={display:"inline-block",visibility:"visible"},fl=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return he.createElement(Mn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:vy,expanded:n,onChange:t})},Ry=o=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:n,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=o;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||Ht;return he.createElement(u,{domProps:{className:kr},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():n()},checked:e.rowSelected})};function ml(o,e){return o?typeof o=="function"?o(e):o:void 0}function gl(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function xy(o){let{rowInfo:e,rowStyle:t,rowClassName:n,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:c,width:u,column:d,onMouseLeave:p,onMouseEnter:f,onRowMouseEnter:m,onRowMouseLeave:g,rowIndex:h,rowHeight:b,columnsMap:T,fieldsToColumn:S,domRef:C,hidden:y,showZebraRows:v}=o,w=he.useRef(null),I=lt(Pe=>{w.current=Pe,C&&C(Pe)},[C]);if(!d)return he.createElement("div",{ref:I},"no column");let{rowSelected:R}=e,{getState:x,actions:D,computed:M,api:A,getDataSourceMasterContext:E}=Q(),{componentState:_,getState:P,api:F,componentActions:N}=De(),{activeRowIndex:G,keyboardNavigation:H,columnReorderInPageIndex:B}=x(),pe=h===G&&H==="row",de={getState:x,getDataSourceState:P,getDataSourceMasterContext:E,actions:D,dataSourceActions:N,api:A,dataSourceApi:F},k=e.rowDisabled,W=M.computedVisibleColumns.map(Pe=>Pe.id),se=Ad({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:c,columnsMap:T,visibleColumnsIds:W,fieldsToColumn:S,context:de}),{stylingParam:ce,renderParams:ie,formattedValueContext:oe,renderFunctions:te,groupByColumnReference:fe,inEdit:ne}=se,{align:V,verticalAlign:U}=ie,O=ie,re=he.useRef(O),j=m&&f?Pe=>{let kt={...oe,rowIndex:h};m(kt,Pe),f(Pe)}:f,K=g&&p?Pe=>{let Ze={...oe,rowIndex:h,rowInfo:e};g(Ze,Pe),p(Pe)}:p,ee=lt(Pe=>{let Ze=d.computedVisibleIndex;x().cellClick({rowIndex:h,colIndex:Ze,event:Pe})},[h,d.computedVisibleIndex,H]),Y=lt(Pe=>{let Ze=d.computedVisibleIndex;if(x().cellMouseDown({rowIndex:h,colIndex:Ze,event:Pe}),H==="row"){k||(D.activeRowIndex=h);return}H==="cell"&&(D.activeCellIndex=[h,Ze])},[h,k,d.computedVisibleIndex,H]),{selectionMode:le,cellSelection:me,isNodeReadOnly:Ve}=_,Ee=O.cellSelected;O.domRef=I,O.htmlElementRef=w,O.toggleCurrentTreeNode=lt(O.toggleCurrentTreeNode,[e]),O.selectCell=lt(O.selectCell,[e]),O.deselectCell=lt(O.deselectCell,[e]),O.selectCurrentRow=lt(O.selectCurrentRow,[e]),O.deselectCurrentRow=lt(O.deselectCurrentRow,[e]),O.toggleCurrentGroupRow=lt(O.toggleCurrentGroupRow,[e]),O.toggleCurrentRowSelection=lt(O.toggleCurrentRowSelection,[e]),O.toggleCurrentGroupRowSelection=lt(O.toggleCurrentGroupRowSelection,[e]),O.toggleCurrentTreeNodeSelection=lt(O.toggleCurrentTreeNodeSelection,[e]);let Ge=d.components?.Editor??Nd,Ue=ne?he.createElement(kd,{contextValue:O},he.createElement(Ge,null)):null,Le=lt(Qe(()=>{if(y||ne)return null;if(re.current=O,te.renderGroupIcon&&(O.renderBag.groupIcon=he.createElement(at,{render:te.renderGroupIcon,renderParam:{...O,renderBag:{...O.renderBag}}})),te.renderSelectionCheckBox&&le=="multi-row"&&(O.renderBag.selectionCheckBox=he.createElement(at,{render:Ry,renderParam:O}),te.renderSelectionCheckBox!==!0&&(O.renderBag.selectionCheckBox=he.createElement(at,{render:te.renderSelectionCheckBox,renderParam:{...O,renderBag:{...O.renderBag}}}))),e.isTreeNode){let{isParentNode:kt}=e,Fe;Fe=(kt?te.renderTreeIconForParentNode:te.renderTreeIconForLeafNode)||typeof te.renderTreeIcon=="function"?te.renderTreeIcon:kt&&te.renderTreeIcon===!0?fl:void 0,Fe===!0?Fe=fl:Fe&&(O.renderBag.treeIcon=he.createElement(at,{render:fl,renderParam:O})),Fe&&(O.renderBag.treeIcon=he.createElement(at,{render:Fe,renderParam:{...O,renderBag:{...O.renderBag}}}))}te.renderRowDetailIcon&&(O.renderBag.rowDetailsIcon=he.createElement(at,{render:Iy,renderParam:{...O,renderBag:{...O.renderBag}}}),typeof te.renderRowDetailIcon=="function"&&(O.renderBag.rowDetailsIcon=he.createElement(at,{render:te.renderRowDetailIcon,renderParam:{...O,renderBag:{...O.renderBag}}}))),te.renderValue&&(O.renderBag.value=he.createElement(at,{render:te.renderValue,renderParam:{...O,renderBag:{...O.renderBag}}})),e.isGroupRow&&te.renderGroupValue&&(O.renderBag.value=he.createElement(at,{render:te.renderGroupValue,renderParam:{...O,renderBag:{...O.renderBag}}})),!e.isGroupRow&&te.renderLeafValue&&(O.renderBag.value=he.createElement(at,{render:te.renderLeafValue,renderParam:{...O,renderBag:{...O.renderBag}}})),re.current=O;let Pe=O.renderBag.value;Pe instanceof Date&&(Pe=Pe.toLocaleDateString());let Ze=he.createElement(he.Fragment,null,V!=="end"?O.renderBag.treeIcon:null,V!=="end"?O.renderBag.groupIcon:null,V!=="end"?O.renderBag.rowDetailsIcon:null,V!=="end"?O.renderBag.selectionCheckBox:null,Pe,V==="end"?O.renderBag.selectionCheckBox:null,V==="end"?O.renderBag.rowDetailsIcon:null,V==="end"?O.renderBag.groupIcon:null,V==="end"?O.renderBag.treeIcon:null);return d.render?he.createElement(at,{render:d.render,renderParam:{...O,renderBag:{...O.renderBag,all:Ze}}}):Ze}),[d,y,ne,c,d.renderTreeIcon||d.renderTreeIconForParentNode?Ve:!1,...Dd(O,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),Ye=M.computedVisibleColumns.map(Pe=>Pe.id),We=M.computedColumnOrder,yt={...oe,visibleColumnIds:Ye,allColumnIds:We,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(yt,"rowHasSelectedCells",{get(){return e.hasSelectedCells(Ye)}});let bn=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),st=typeof n=="function"?n(yt):n,z;fe?.className&&(z=ml(fe.className,ce)),s&&(z=Z(z,ml(s,ce))),d.className&&(z=Z(z,ml(d.className,ce))),bn&&(z=Z(z,Id({align:V})));let X;e.dataSourceHasGrouping&&d.groupByForColumn&&(X=vd({rowInfo:e})),bn&&(X=wy({rowInfo:e})),t&&(X=typeof t=="function"?{...X,...t(yt)}:{...X,...t}),l&&(X=gl(X,l,ce)),fe?.style&&(X=gl(X,fe.style,ce)),d.style&&(X=gl(X,d.style,ce)),X=X||{},X.height=b,X.zIndex=`var(${Sy}-${d.computedVisibleIndex})`,X.visibility=`var(${Cy}-${d.computedVisibleIndex}, visible)`;let ye=yy(()=>X,[X?JSON.stringify(X):null]),Ce=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:h)%2===1,$e=v?Ce?"odd":"even":!1,L=!1,He=!1,Et=!1,ct=!1;if(me&&Ee){let Pe=a(),Ze=Pe[e.indexInAll-1],kt=Pe[e.indexInAll+1],Fe=M.computedVisibleColumns[d.computedVisibleIndex+1],Kn=M.computedVisibleColumns[d.computedVisibleIndex-1];L=Ze?!me.isCellSelected(Ze.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?He=!0:He=Kn?!me.isCellSelected(e.id,Kn.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?Et=!0:Et=Fe?!me.isCellSelected(e.id,Fe.id):!0,ct=kt?!me.isCellSelected(kt.id,d.id):!0}let Tt=me&&Ee?{top:L,left:He,right:Et,bottom:ct}:null,Mt=B!=null?i!==B:!1,oa=Ue,ra=Le(),vo={domRef:I,cellType:"body",column:d,width:u,rowId:e.id,horizontalLayoutPageIndex:i,style:ye,onMouseLeave:K,onMouseEnter:j,onClick:ee,afterChildren:oa,onMouseDown:Y,cssEllipsis:d.cssEllipsis??!0,className:Z(Tt?Pc(Tt):"",Qr(d,[_n,Fn],Dc,{dragging:!1,insideDisabledDraggingPage:Mt,zebra:$e,align:V,verticalAlign:U,rowDisabled:k,rowActive:pe,cellSelected:Ee,rowSelected:R,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),z,st),renderChildren:lt(()=>ra,[Le])},fr=jo.Provider;return he.createElement(fr,{value:re.current},he.createElement(ii,{...vo}))}var Ld=he.memo(xy);function ai(){return by(jo)}function pl(){let{api:o,state:{editingValueRef:e,editingCell:t}}=Q(),{column:n,rowInfo:r}=ai(),[i]=he.useState(()=>t?.value),[a,l]=he.useState(i),s=t?!t.active&&!!t.waiting:!1,c=he.useCallback(f=>{e.current=f,l(f)},[]);he.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function $o(o){return o.render(o.renderParam)??null}function at(o){let e=jo.Provider;return lo.createElement(e,{value:o.renderParam},lo.createElement($o,{render:o.render,renderParam:o.renderParam}))}function kd(o){let e=jo.Provider;return lo.createElement(e,{value:o.contextValue},o.children)}function ln(o){let e=li.Provider;return lo.createElement(e,{value:o.renderParam},lo.createElement($o,{render:o.render,renderParam:o.renderParam}))}import*as sn from"react";var Dy={width:"100%",pointerEvents:"none"},hl=`${dt}-menu`,bl=Br({"data-name":""}),yl={[bl["data-name"]]:"menu-icon"};function Uo(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...Dy,borderTop:`${ae.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return sn.createElement("div",{...n,style:e,...yl,onPointerDown:s=>s.stopPropagation(),className:Z(t,bu({menuVisible:i,reserveSpaceWhenHidden:r}),dt,`${dt}-menu`)},a??sn.createElement(sn.Fragment,null,sn.createElement("div",{className:hl,style:l}),sn.createElement("div",{className:hl,style:l}),sn.createElement("div",{className:hl,style:l})))}import*as so from"react";import{useEffect as Py,useState as Vd}from"react";var zd="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Ey={transition:"width 0.25s, opacity 0.25s"};function si(o){let[e,t]=Vd(!0),[n,r]=Vd(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Ey,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};Py(()=>{let b=i!=0?1:0;if(!e&&b&&t(!0),b!==n){let T=requestAnimationFrame(()=>{r(b)});return()=>{cancelAnimationFrame(T)}}return()=>{}},[i,e]);let g=()=>{let T=!(n===0&&i===0);T!==e&&t(T)};if(!e&&!o.forceSize)return null;let h={};return i===-1&&(h.top="100%"),so.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:Z(s,dt,zd,`${dt}-sort`)},u?so.createElement("div",{"data-name":"index",style:h,className:Su},c):null,so.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),so.createElement("div",{style:{width:f[1],...m}}),so.createElement("div",{style:{width:f[2],...m}}))}import*as jd from"react";import{useCallback as Wd}from"react";import{useRef as Kd,useState as My}from"react";import*as Yo from"react";function Gd(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Te.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Te.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?Sa(l,i,n.current):Te.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){Sa(c,i,n.current);continue}c.computedPinned!=="end"&&Te.columnOffsets.set(l,c.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||Te.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function Hd(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,c=i.current;if(n.forEach((u,d)=>{s+=u;let p=o[d],f=r[p],m=f.computedWidth+u;Te.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&Te.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&Te.columnOffsets.set(u,d.computedOffset+s,c)}}}}var ci="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",ui=ue({defaultClassName:"zneyzhc _16lm1iw2 _16lm1iw23 _16lm1iw2a",variantClassNames:{constrained:{false:"zneyzhd",true:"zneyzhe"},computedPinned:{start:"zneyzhf",end:"zneyzhg",false:"zneyzhh"},computedFirstInCategory:{true:"zneyzhi",false:"zneyzhj"},computedLastInCategory:{true:"zneyzhk",false:"zneyzhl"}},defaultVariants:{},compoundVariants:[[{computedPinned:"start",computedLastInCategory:!0},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0},"zneyzhn"]]}),di=ue({defaultClassName:"zneyzh1",variantClassNames:{computedPinned:{start:"zneyzh2",end:"zneyzh3 _16lm1iw26 _16lm1iw2e",false:"zneyzh4"},computedFirstInCategory:{true:"zneyzh5",false:"zneyzh6"},computedLastInCategory:{true:"zneyzh7",false:"zneyzh8"}},defaultVariants:{},compoundVariants:[[{computedPinned:"end",computedLastInCategory:!1,computedFirstInCategory:!0},"zneyzh9"],[{computedPinned:!1,computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzha"],[{computedPinned:"start",computedFirstInCategory:!1,computedLastInCategory:!0},"zneyzhb"]]});var{rootClassName:Ay}=Me,_y=`${Ay}HeaderCell_ResizeHandle`;function Fy(o){let{state:{brain:e,headerBrain:t}}=Q(),n=Kd(null),[r,i]=My(!1),a=Kd(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,b=g.pointerId,T=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let I=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),R=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{I(),R()}}S.setPointerCapture(b);let C=Gd(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),y=(I,{done:R}={})=>{s&&(I=I/(s+1),R&&(I=Math.round(I))),c==="end"&&(I*=-1);let{adjustedDiff:x,constrained:D}=o.computeResize({diff:I,shareSpaceOnResize:h});return a.current!==D&&i(D),C.resize(x),x},v=I=>{y(Math.round(I.clientX-T))},w=I=>{S.releasePointerCapture(b),S.removeEventListener("pointermove",v),S.removeEventListener("pointerup",w);let R=Math.round(I.clientX-T),x=y(R,{done:!0});p(),o.onResize({diff:x,shareSpaceOnResize:h})};S.addEventListener("pointermove",v),S.addEventListener("pointerup",w)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Yo.createElement("div",{ref:n,className:`${_y} ${ci} ${di({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},Yo.createElement("div",{style:m,className:ui({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Bd=Yo.memo(Fy);function $d(o,e){let{computed:{computedVisibleColumns:t},getState:n,getComputed:r,actions:i}=Q(),a=Wd(({diff:c,shareSpaceOnResize:u})=>{let d=n(),{columnSizing:p,viewportReservedWidth:f,bodySize:m}=d,g=r().computedVisibleColumns,h=!1,b=g.reduce((C,y)=>(y.computedFlex&&(C[y.id]={...p[y.id],flex:y.computedWidth},h=!0),C),{}),T=h?{...p,...b}:p;return Xa({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:f||0,dragHandleOffset:c,dragHandlePositionAfter:o.computedVisibleIndex,columnSizing:T,items:g.map(C=>({id:C.id,computedFlex:C.computedFlex,computedWidth:C.computedWidth,computedMinWidth:C.computedMinWidth,computedMaxWidth:C.computedMaxWidth}))})},[o]),l=Wd(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a]);return o.computedResizable?jd.createElement(Bd,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}import*as Xe from"react";import{useCallback as Tl,useEffect as Sl}from"react";var Ud=ue({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Yd=ue({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function qd(o,e){return St(o,e)}var pi=class extends Dn{constructor(t){super();this.dragIndex=-1;this.breakpoints=[];this.activeDragSourcePosition="outside";this.previousAcceptsDropResult=!0;this.setData(t)}get listId(){return this.data.listId}setData(t){return qd(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return qd(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=u.filter(f=>f!==r):d=xn(u,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var Zd=Xe.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),qo=()=>Xe.useContext(Zd),Oy=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},Ny=o=>`${o.getAttribute(cn)}`;function Ly(o){let e=o.current?.querySelectorAll(fi)??[];return!e||e.length,Array.from(e).map(n=>{let r=Ny(n),i=n.getBoundingClientRect();return{id:r,rect:i}})}function ky(o){let{domRef:e,orientation:t,dragListId:n}=o,r=Se.from(e.current.getBoundingClientRect());return{draggableItems:Ly(e),orientation:t,listId:n,listRectangle:r,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial}}function Qd(o){return new pi(ky(o))}function zy(o,e){let t=ve(e),[n,r]=Xe.useState(null),i=Tl(l=>{if(l)pt.registerDragInteractionTarget(l);else{let s=a();s&&pt.unregisterDragInteractionTarget(s)}r(l)},[]),a=ve(n);return Sl(()=>pt.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&c?.includes(p.listId)){let f=Qd({domRef:o,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}var Nn=o=>{let e=Xe.useRef(null),{dropTargetListId:t,dragSourceListId:n}=Pn(),{updateDragOperationSourceAndTarget:r,dragItemId:i,status:a}=Pn(),l=ve(o.onDrop),s=ve(o.onAcceptDrop),c=ve(o.onRemove),u=ve(o.updatePosition??Oy),{interactionTarget:d,setInteractionTarget:p}=zy(e,o);Sl(()=>{let y=document.querySelector(`[${Xd}="${o.dragListId}"]`);y?e.current=y:console.warn(`DragList with id "${o.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[o.dragListId]),Sl(()=>{if(d){let y=o.dragListId,v=d.on("start",({dragItem:R,dragSourceListId:x,dropTargetListId:D})=>{r({dragSourceListId:x,dropTargetListId:D,dragItemId:R.id,status:"accepted"})}),w=d.on("move",({offsetsForItems:R,items:x,status:D})=>{if(D==="rejected")return;let M=m(),A=u();x.forEach((E,_)=>{let P=R[_],F=M[_];F&&A({id:E.id,node:F,offset:P})})}),I=d.on("drop",R=>{let{sortedIndexes:x,dragIndex:D,dropIndex:M,dragItem:A,items:E,dragSourceListId:_,dropTargetListId:P,outside:F,status:N}=R,G=m();f.current=[];let H=s(),B=c(),pe=l(),de=u();E.forEach((se,ce)=>{let ie=G[ce];ie&&de({id:se.id,node:ie,offset:null})}),y===P&&_!==y&&H&&N==="accepted"&&H({dragItemId:A.id,dragSourceListId:_,dropTargetListId:P,dragIndex:D,dropIndex:M,dropItemId:E[M]?.id});let W=null;M===-1&&_===y&&P===y&&F&&(W=B),M!==-1&&P===y&&_===y&&(W=pe),W&&W?.(x,{dragIndex:D,dropIndex:M,dragItemId:E[D].id,dropItemId:E[M]?.id})});return()=>{v(),w(),I()}}},[d,o.dragListId]);let f=Xe.useRef([]),m=Tl(()=>{let y=f.current;return(!y||y.length===0)&&(y=Array.from(e.current?.querySelectorAll(fi)??[]),f.current=y),y},[]),g=Tl(y=>{let v=y.currentTarget,w=v.getAttribute(cn);if(w==null){let F=tn(v,fi);F&&(w=F.getAttribute(cn))}if(w==null){console.warn("Could not find drag item id for element",v,`Make sure you have a parent element with a ${cn} attribute`);return}w=`${w}`;let I=null,R=Array.from(e.current?.querySelectorAll(fi)??[]);f.current=R;let x=Qd({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0}),D=x.getData().draggableItems,M=D.findIndex(F=>F.id===w),A=D[M];p(x);let E={left:y.clientX,top:y.clientY},_=F=>{I||(I=pt.startDrag({listId:o.dragListId,dragItem:A,dragIndex:M},E)),I.move({left:F.clientX,top:F.clientY})},P=()=>{if(we().removeEventListener("pointermove",_),!I){p(null);return}I.drop(),I=null};we().addEventListener("pointermove",_),we().addEventListener("pointerup",P,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside]),h=y=>y===void 0?i!=null:`${y}`===i,b=!!i,T=Xe.useMemo(()=>({dragItemId:i,onDragItemPointerDown:g,dragSourceListId:n,dropTargetListId:t,status:a,dragListId:o.dragListId,draggingInProgress:b}),[i,g,h,b,n,t,o.dragListId]),S={className:Z("DragList",b?"DragList--dragging":"",Ud({dragging:b})),[Xd]:o.dragListId},C=typeof o.children=="function"?o.children(S,T):o.children;return Xe.createElement(Zd.Provider,{value:T},C)},Xd="data-drag-list-id",cn="data-drag-item-id",fi=`[${cn}]`,Vy=Xe.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),Gy=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=qo(),l=i===n&&r===`${o.id}`,s=Xe.useMemo(()=>({dragItemId:o.id,active:l,dragListId:n,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,l,t,i,a]),c={"data-drag-item-id":`${o.id}`,onPointerDown:e,className:Z("DraggableItem",l?"DraggableItem--active":"",Yd({active:l,draggingInProgress:t}))},u=typeof o.children=="function"?o.children(c,s):o.children;return Xe.createElement(Vy.Provider,{value:s},u)};Nn.DraggableItem=Gy;import*as Cl from"react";var Jd=o=>Cl.createElement(_e,{...o,viewBox:"0 -960 960 960"},Cl.createElement("path",{d:"m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"}));import*as Zo from"react";function ep(){return{}}var tp=o=>({allowColumnHideWhileDragging:e=>e??!0});import{createContext as Hy}from"react";var Ky=Hy(null);function wl(){return Ky}import*as Rt from"react";function np(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let p=u.id,f=o[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let b={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],b);let T=u.columnGroup,S,C=b;for(;T;){let y=e[T];if(y){g.add(T);let v=[p,...g];S=h.has(T)?i.get(T):void 0,S||(S={id:T,type:"group",ref:y,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[T],computedWidth:0,computedPinned:b.computedPinned,depth:t.get(T)??0},r.set(v,S),i.set(T,S)),S.columnItems.push(b),S.uniqueGroupId.push(b.id),C&&!h.has(C.id)&&S.children.push(C),C=S,T=y.columnGroup}else break}});let l=[],s=new J,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&op(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=n+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function op(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&op(t.children),e+=n})}import*as un from"react";import{useCallback as vl,useEffect as Yy,useRef as qy}from"react";import*as Il from"react";import*as lp from"react";import{useCallback as ap}from"react";import{useRef as rp,useState as By}from"react";import*as Xo from"react";var{rootClassName:Wy}=Me,jy=`${Wy}HeaderCell_ResizeHandle`;function $y(o){let e=rp(null),[t,n]=By(!1),r=rp(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=Hd(o.groupColumns.map(C=>C.computedVisibleIndex),{columns:o.columns,domRef:e}),b=C=>{a==="end"&&(C*=-1);let{constrained:y,adjustedDiffs:v,adjustedDiff:w}=o.computeResize(C);return r.current!==y&&n(y),h.resize(v),w},T=C=>{if(g){let y=o.groupColumns.reduce((I,R)=>I+R.computedWidth-R.computedMinWidth,0),v=o.brain.getAvailableSize(),w={width:v.width+y,height:v.height};o.brain.update(w),g=!1}b(Math.round(C.clientX-f))},S=C=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",T),m.removeEventListener("pointerup",S);let y=Math.round(C.clientX-f),v=b(y);o.onResize(v)};m.addEventListener("pointermove",T),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ae.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Xo.createElement("div",{ref:e,className:`${jy} ${ci} ${di({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Xo.createElement("div",{style:{...u,...o.style},className:ui({constrained:t})}))}var ip=Xo.memo($y);function sp(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:c}=Q(),u=o[o.length-1],d=ap(g=>{let h=l(),{columnSizing:b,viewportReservedWidth:T,bodySize:S}=h,C=s().computedVisibleColumns,y=!1,v=C.reduce((R,x)=>(x.computedFlex&&(R[x.id]={...b[x.id],flex:x.computedWidth},y=!0),R),{}),w=y?{...b,...v}:b;return xu({availableSize:S.width,reservedWidth:T||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:w,columnGroupSize:o.length,items:C.map(R=>({id:R.id,resizable:R.computedResizable,computedFlex:R.computedFlex,computedWidth:R.computedWidth,computedMinWidth:R.computedMinWidth,computedMaxWidth:R.computedMaxWidth}))})},[u]),p=ap(g=>{let{columnSizing:h,reservedWidth:b}=d(g);c.viewportReservedWidth=b,c.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?lp.createElement(ip,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var cp=`${Je}HeaderGroup`,up=q($.columnWidthAtIndex),Uy=q($.columnZIndexAtIndex);function dp(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=sp(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(f=>`var(${up}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${up}-${c.computedVisibleIndex})`,d=`calc(var(${Uy}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,Il.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:Z(hu,cp),style:p,"data-z-index":d},Il.createElement("div",{className:Z(`${cp}__header-content`,Ft)},a),s)}var{rootClassName:Xy}=Me,Zy=[],pp=`${Xy}Header`,Qy=du({overflow:!1}),Jy=o=>{};function eT(o){let{bodyBrain:e,columns:t,style:n,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=o,{computed:s,getState:c,state:{headerBrain:u,headerOptions:d,showColumnFilters:p,headerRenderer:f,headerOnRenderUpdater:m}}=Q(),{computedColumnsMap:g}=s,h=qy(null),b=vl(y=>{h.current&&(h.current.style.transform=`translate3d(-${y.scrollLeft}px, 0px, 0px)`)},[]);Yy(()=>{let y=u.onScroll(b);return b(u.getScrollPosition()||{scrollLeft:0,scrollTop:0}),y},[u]);let T={ref:h,className:Z(pp,`${pp}--virtualized`,r,Qy),style:{...n,height:i}},S=vl(y=>{let{rowIndex:v,colIndex:w,domRef:I,height:R,widthWithColspan:x,heightWithRowspan:D,hidden:M}=y,A=t[w];if(!A||M)return null;let E=u.isHorizontalLayoutBrain?u.getPageIndexForRow(v):null,_=a?a.pathsToCells.get([v,w]):null;if(_&&_.type==="group"){let P=_.columnItems.map(G=>G.ref),F={..._.ref,id:_.id,uniqueGroupId:_.uniqueGroupId,depth:_.depth,columns:P.map(G=>G.id),computedWidth:_.computedWidth,groupOffset:_.groupOffset};return c().columnGroupVisibility[_.id]!==!1?un.createElement(dp,{horizontalLayoutPageIndex:E,bodyBrain:e,columnGroupsMaxDepth:l,domRef:I,columns:P,width:x,height:R,columnGroup:F}):null}return un.createElement(mp,{domRef:I,column:A,horizontalLayoutPageIndex:E,headerOptions:d,width:x,height:D,columnsMap:g})},[d,t,i,a,l,p,u]),C=vl(y=>{},[]);return un.createElement(Nn,{orientation:"horizontal",dragListId:"header",onDrop:C,updatePosition:Jy},y=>un.createElement("div",{...y,...T,className:Z(y.className,T.className)},un.createElement(Or,{name:"header",renderCell:S,brain:u,renderer:f,onRenderUpdater:m,cellHoverClassNames:Zy,cellDetachedClassNames:zr})))}var fp=un.memo(eT);function gp(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,r=Q(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:c,columnGroupsDepthsMap:u,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,g=m*c+(f?c:0),h=Rt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return np(l,p,u,d)},[l,p,u]),b=Rt.useCallback(({rowIndex:w,colIndex:I})=>{let R=l[I],x=1,D=1;if(!R||!h)return{rowspan:x,colspan:D};let M=h.pathsToCells.get([w,I]);if(!M)return{rowspan:x,colspan:D};if(M.type==="column")return{colspan:D,rowspan:m-M.depth};let A=M.columnItems.findIndex(E=>E.id===R.id);return{rowspan:x,colspan:A===0?M.columnItems.length:1}},[p,d,l,h,m,u]),T=Rt.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).rowspan,[b]),S=Rt.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).colspan,[b]),C=Rt.useCallback(w=>f?w<m-1?c:2*c:c,[m,f,c]);Vr(e,{colWidth:s,rowHeight:C,rows:m,cols:l.length,height:g,rowspan:T,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let y=Rt.createElement(fp,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:g,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:h}),v=n.vertical&&rn()?Rt.createElement("div",{className:yu,style:{zIndex:1e3,width:rn()}}):null;return Rt.createElement("div",{className:`${ul} ${wu}`,style:{height:g}},y,v)}var{ManagedComponentContextProvider:tT}=vt({initSetupState:ep,forwardProps:tp,Context:wl()});function Rl(o){let e=Q(),{state:t,getComputed:n}=e,{header:r,brain:i,headerBrain:a,wrapRowsHorizontally:l}=t,{scrollbars:s}=n();return r?Zo.createElement(tT,{...o},Zo.createElement(gp,{wrapRowsHorizontally:!!l,bodyBrain:i,headerBrain:a,scrollbars:s})):null}function hp(){return Zo.useContext(wl()).componentState}var aT=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||Ht;return Ie.createElement(s,{domProps:{className:kr},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},li=Ie.createContext(null);var lT=q($.columnZIndexAtIndex),sT=q($.columnVisibilityAtIndex),xl=Ie.createElement("div",{className:Hr[1]}),yp=Br({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[cn]:""});function mp(o){let e=o.column,{allowColumnHideWhileDragging:t}=hp(),{onDragItemPointerDown:n}=qo(),{api:r,getComputed:i,getState:a,actions:l,state:{showColumnFilters:s,components:c,portalDOMRef:u,columnHeaderHeight:d,columnReorderDragColumnId:p,columnMenuVisibleForColumnId:f,columnReorderInPageIndex:m},getDataSourceMasterContext:g}=Q(),{api:h,componentActions:b,getState:T,componentState:{filterDelay:S,filterTypes:C}}=De(),{allRowsSelected:y,someRowsSelected:v,selectionMode:w}=Jt(),I=o.horizontalLayoutPageIndex,R=p===e.id,x=m!=null?I!==m:!1,{onResize:D,height:M,width:A,headerOptions:E,columnsMap:_}=o,P=e.computedSortInfo,F=e.header,N=bp(L=>{ne.current=L,o.domRef?.(L)},[o.domRef]),G=E.alwaysReserveSpaceForSortIcon,H=e.headerAlign??e.align,B=(typeof H=="function"?H({isHeader:!0,column:e}):H)??"start",pe=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",de=et(e,{actions:l,api:r,dataSourceActions:b,dataSourceApi:h,getComputed:i,getDataSourceState:T,getDataSourceMasterContext:g,getState:a}),k=de.isSortable(),W=k&&(e.computedSorted||G)?Ie.createElement(si,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ae.spacing[2],marginInlineEnd:ae.spacing[2]},className:`${En}__sort-icon ${Tu} ${Cu({align:B})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,ce=e.computedFilterable&&e.computedFiltered?Ie.createElement(eo,null):null,ie=e.headerCssEllipsis??e.cssEllipsis??!0,oe={reserveSpaceWhenHidden:B==="center",menuVisible:f===e.id,style:B==="end"?{marginInlineStart:`calc(${ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ae.spacing[2]}:{marginInlineEnd:`calc(${ae.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ae.spacing[2]},domProps:{onMouseDown:L=>{L.stopPropagation(),de.toggleContextMenu(L.target)}}},te=e.components?.MenuIcon||c?.MenuIcon||Uo,fe=Ie.createElement(te,{...oe}),ne=rT(null),V={horizontalLayoutPageIndex:I,dragging:R,domRef:N,htmlElementRef:ne,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:P,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:v,allRowsSelected:y,selectionMode:w,api:r,dataSourceApi:h,columnApi:de,renderBag:{sortIcon:W,filterIcon:ce,menuIcon:fe,menuIconProps:oe,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},U=V,O=U.renderBag.header,re=()=>{let L={...V,renderBag:{...V.renderBag}};if(e.renderSortIcon&&(L.renderBag.sortIcon=Ie.createElement(ln,{render:e.renderSortIcon,renderParam:{...L,renderBag:{...L.renderBag}}})),e.renderFilterIcon&&(L.renderBag.filterIcon=Ie.createElement(ln,{render:e.renderFilterIcon,renderParam:{...L,renderBag:{...L.renderBag}}})),typeof e.renderMenuIcon=="function"&&(L.renderBag.menuIcon=Ie.createElement(ln,{render:Tt=>{if(typeof e.renderMenuIcon!="function")return null;let Mt=e.renderMenuIcon(Tt);return Mt?Mt.type===te||Mt.type===Uo?Mt:Ie.createElement(te,{...oe},Mt):null},renderParam:{...L,renderBag:{...L.renderBag}}})),e.renderSelectionCheckBox&&w==="multi-row"){L.renderBag.selectionCheckBox=Ie.createElement(ln,{render:aT,renderParam:{...L,renderBag:{...L.renderBag}}});let Tt=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Tt&&Tt!==!0&&(L.renderBag.selectionCheckBox=Ie.createElement(ln,{render:Tt,renderParam:{...L,renderBag:{...L.renderBag}}}))}F instanceof Function&&(L.renderBag.header=O=Ie.createElement(ln,{render:F,renderParam:{...L,renderBag:{...L.renderBag}}}));let He=e.renderMenuIcon===!1?null:L.renderBag.menuIcon,Et=ie?Ie.createElement("div",{className:Ft},L.renderBag.header):L.renderBag.header,ct=Ie.createElement(Ie.Fragment,null,B==="center"?xl:null,L.renderBag.selectionCheckBox,Et,L.renderBag.sortIcon,L.renderBag.filterIcon,B==="center"?xl:null,B!=="center"?xl:null,He);return e.renderHeader?Ie.createElement(ln,{render:e.renderHeader,renderParam:{...L,renderBag:{...L.renderBag,all:ct}}}):ct};oT(()=>{let L=null,He=ne.current;return D&&He&&(L=Eo(He,D)),()=>{L?.()}},[ne.current,o.onResize]);let j={height:M};e.headerStyle&&(j=typeof e.headerStyle=="function"?{...j,...e.headerStyle(U)||{}}:{...j,...e.headerStyle});let K=typeof e.headerClassName=="function"?e.headerClassName(U):e.headerClassName,{onPointerDown:ee,proxyPosition:Y,dragColumnOutside:le}=gd({columnId:e.id,domRef:ne,horizontalLayoutPageIndex:I,allowColumnHideOnDrag:t}),me=null,Ve=li.Provider,Ee={filtered:e.computedFiltered,verticalAlign:pe,align:B},Ge=Ie.useMemo(()=>{let L=He=>{r.setColumnFilter(e.id,He)};return S>0?zt(L,{wait:S}):L},[S,e.id]),Ue=e.computedFilterType,Le=C[Ue],Ye=e.computedFilterable?e.computedFilterValue?.filter.operator??Le?.defaultOperator:void 0,We=e.computedFilterable&&Le?Le.operators.find(L=>L.name===Ye):void 0,yt=We?.components?.FilterEditor||Le?.components?.FilterEditor||e.components?.FilterEditor||no,bn=Le?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,st=$d(e,{horizontalLayoutPageIndex:I}),z=`var(${lT}-${e.computedVisibleIndex})`;j.zIndex=z,j.visibility=`var(${sT}-${e.computedVisibleIndex}, visible)`;let X={"data-field":`${e.field||""}`,"data-column-id":e.id,[cn]:e.id,"data-header-align":B,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ye=e.computedFilterable?Ie.createElement(Nu,{horizontalLayoutPageIndex:I,filterEditor:yt,filterOperatorSwitch:bn??Lu,operator:We,filterTypes:C,onChange:Ge,columnFilterType:Ue,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:d}):Ie.createElement(ku,null);U.renderBag.filterEditor=ye;let Ce=bp(L=>{ee(L),n(L)},[ee,n]),$e=re();return R&&Y&&(me=Ie.createElement("div",{key:e.id,className:`${En}Proxy ${su}`,style:{height:M,width:A,left:Y.left??0,top:Y.top??0}},Ie.createElement("div",{className:cu({visible:le})},Ie.createElement(Jd,{size:16})),O),me=iT(me,u.current)),Ie.createElement(Ve,{value:U},Ie.createElement(ii,{domRef:N,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...X,"data-z-index":z,style:j,width:A,onPointerDown:Ce,contentClassName:Z(lu(Ee),Gc[B]),contentStyle:s?{height:M/2}:void 0,className:Z(En,jc.none,k?zc.pointer:"",K,Qr(e,[En,Fn],uu,{dragging:R,insideDisabledDraggingPage:x,align:B,verticalAlign:pe,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),au),cssEllipsis:ie,afterChildren:Ie.createElement(Ie.Fragment,null,s?ye:null,st),renderChildren:$e}),me)}function Xr(){return nT(li)}import*as Bt from"react";import{useEffect as cT}from"react";function Tp(o,e){let{separator:t}=e??{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Sp={padding:ae.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},uT={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Cp=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Tp(t),n,"important")},wp=Bt.forwardRef(function(e,t){let{rootClassName:n}=Gr(),r=Bt.useRef(null),i=Bt.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return cT(()=>{let a=()=>{setTimeout(()=>{Cp(r.current,Sp),Cp(r.current?.firstElementChild,uT)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),Bt.createElement("div",{ref:i,...e,className:Z(`${n}-Footer`,zu,e.className),style:Sp},"Powered by"," ",Bt.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});import*as co from"react";var Ip={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},vp="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Rp="qy58ya4";var{rootClassName:dT}=Me,Dl=`${dT}-LoadMask`;function pT(o){let{visible:e,children:t="Loading"}=o;return co.createElement("div",{className:`${Ip[e?"visible":"hidden"]} ${Dl}`},co.createElement("div",{className:`${vp} ${Dl}-Overlay`}),co.createElement("div",{className:`${Rp} ${Dl}-Text`},t))}var mi=co.memo(pT);function Pl(o){return o.map(Ot)}function Ot(o){if(we().structuredClone)return we().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Pl(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Pl(Array.from(o)));if(o instanceof Map)return new Map(Pl(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Ot(o[t]));return e}function Qo(o){return o}var Ln=Object.seal({data:null,field:null});var pn="____root____",Dp="____not_loaded_yet____";function dn(){return!1}function El(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function gi(o,e,t,n,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function Pp(o,e){let{reducers:t={},pivot:n,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=o,c=new J;function u(h,b,T,S=0,C=[]){let y=!T.length||S===T.length-1,v=b[s?.values||"values"]||{};for(let w in v)if(v.hasOwnProperty(w)){let I=w;C.push(I),d.set(C,!0),h.set(C,{reducerResults:v[w][s?.totals||"totals"]||{},items:[]}),y||u(h,v[w],T,S+1,C),C.pop()}}let d=n?new J:void 0,p=[],f=El(t),m=Ot(f);e.visitDepthFirst((h,b,T,S)=>{let[C,...y]=b,v=h.children,w=c.get(y);if(w&&(w.cache=h.cache,w.childrenLoading=h.childrenLoading,w.childrenAvailable=h.childrenAvailable,w.error=h.error),y.length==r.length&&r.length){if(w){w.items=v;for(let R=0,x=y.length;R<x;R++){let D=y.slice(0,R),M=c.get(D);M&&(M.items=M.items||[],M.items=M.items.concat(v))}v=i.indexArray(v,{toPrimaryKey:a,cache:l,nodesKey:void 0})}return S?.()}for(let I=0,R=v.length;I<R;I++){if(!v[I]){let A={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...y,`${Dp}${I}`],A);continue}let x=v[I].data,D=v[I].keys||[];if(D.length){let A=D[D.length-1];y.push(A)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:v[I].totalChildrenCount,reducerResults:v[I].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(y,M),n){let A=M.pivotDeepMap=new J,E=v[I].pivot;u(A,E,n,0,p)}D.length&&y.pop()}S?.()});let g={deepMap:c,groupParams:o,initialData:e,reducerResults:m};return n&&(g.topLevelPivotColumns=d,g.pivot=n),g}function xp(o,e,t,n,r,i,a,l,s,c=Qo){let{items:u,reducerResults:d,pivotDeepMap:p}=o.get(e);if(u.push(n),a&&gi(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:b}=i[f],T=g?n[g]:null;h&&(Ln.data=n,Ln.field=g,T=h(Ln));let S=(b||c)(T,n);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Ot(s),items:[]}));let{reducerResults:C,items:y}=p.get(t);y.push(n),a&&gi(n,r,a,C,e)}t.length=0}}function Ep(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let b=0,T=n.length;b<=T;b++){let S=n.slice(0,b),C=e.get(S),{reducerResults:y,items:v}=C;v.push(r),C.leavesAvailableCount++,C.totalLeafNodesCount++,a&&gi(r,i,a,y,S)}return}let m=Ot(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let h=c(r);if(!(!h||!Array.isArray(h))){for(let b=0,T=h.length;b<T;b++){let S=h[b];Ep(o,e,t,p,S,b,a,l)}a&&Jo(a,m,g)}}function Mp(o,e){let{reducers:t}=o,n=El(t),r=Ot(n),i=new J,a=new J;i.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,c=e.length;s<c;s++)Ep(o,i,a,[],e[s],s,t,n);return t&&Jo(t,r,e),{deepMap:i,treeParams:o,treePaths:a,initialData:e,reducerResults:r}}function Ml(o,e){let{groupBy:t,defaultToKey:n=Qo,pivot:r,reducers:i}=o,a=t.length,l=r?new J:void 0,s=new J,c=[],u=[],d=El(i),p=Ot(d);if(!a){let m={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Ot(d)};r&&(m.pivotDeepMap=new J),s.set(c,m)}for(let m=0,g=e.length;m<g;m++){let h=e[m],b={};for(let T=0;T<a;T++){let{field:S,groupField:C,valueGetter:y,toKey:v}=t[T],w=S?h[S]:null;y&&(Ln.data=h,Ln.field=S,w=y(Ln));let I=(v||n)(w,h);if(b[S||C]=I,c.push(I),!s.has(c)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:Ot(d)};r&&(R.pivotDeepMap=new J),s.set(c,R)}xp(s,c,u,h,m,r,i,l,d,n)}a||xp(s,c,u,h,m,r,i,l,d,n),i&&gi(h,m,i,p,c),c.length=0}i&&(s.visitDepthFirst((m,g,h,b)=>{Jo(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:T,reducerResults:S},C,y,v)=>{Jo(i,S,T),v?.()}),b?.()}),Jo(i,p,e));let f={deepMap:s,groupParams:o,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function fT(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function mT(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let T in i)if(i.hasOwnProperty(T)){let C=i[T].field;C&&(f[C]=c[T]),C&&p[C]==null&&(p[C]=c[T])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let T=t[n.length-1];T&&T.field&&(h=p[T.field]),T&&T.toKey&&(h=T.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(Dp)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:dn,hasSelectedCells:dn,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function hi(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function Jo(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function Ap(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:b}=r,{deepMap:T}=u,S=o.length,C=t[t.length-1],y=C?C.nodeExpanded:!0;for(let v=0;v<S;v++){let w=o[v],I=c(w,v),R=[...e,I];if(l(w)){let P={id:I,nodePath:R,isGroupRow:!1,data:w,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:dn,hasSelectedCells:dn,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,v],indexInParent:v,indexInAll:y?i.length:-1};p&&(P.rowSelected=p(P)),d&&(P.rowDisabled=d(P)),f&&f(P);let F=h&&b!=null&&b>0&&P.indexInAll%b===0?P.indexInAll/b:null;for(let N=0,G=t.length;N<G;N++){let H=t[N];if(y||(H.collapsedLeafNodesCount+=1),H.deepRowInfoArray.push(P),F!=null&&y){if(typeof h=="function"&&h(H)!==!0)continue;let B=hi(H,P.indexInAll,F);i[B.indexInAll]=B,P.indexInAll++}}y&&(i[P.indexInAll]=P);continue}let M=T.get(R)?.totalLeafNodesCount??0,A={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:R,id:I,data:w,indexInAll:i.length,indexInParent:v,indexInParentNodes:[...n,v],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:dn,hasSelectedCells:dn,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(A.rowSelected=p(A),g)){let P=g.getSelectionCountFor(A.nodePath);A.selectedLeafNodesCount=P.selectedCount,A.deselectedLeafNodesCount=P.deselectedCount}d&&(A.rowDisabled=d(A)),f&&f(A);let E=!0;if(m&&(A.selfExpanded=E=m(A)),y||(E=!1),A.nodeExpanded=E,y&&h&&b!=null&&b>0){let P=A.indexInAll,F=A.parentNodes;if(F.length>0&&P%b===0){let N=P/b,G=0;F.forEach(H=>{typeof h=="function"&&h(H)!==!0||(i.push(hi(H,P+G,N)),G++,A.indexInAll++)})}}y&&(i[A.indexInAll]=A);let _=s(w);Array.isArray(_)&&Ap(_,R,[...t,A],A.indexInParentNodes,r,i)}return i}function _p(o){let{dataArray:e}=o,t=[];return Ap(e,[],[],[],o,t),{data:t}}function Fp(o){let{lazyLoad:e,groupResult:t,rowsPerPage:n,repeatWrappedGroupRows:r,withRowInfo:i,toPrimaryKey:a,groupRowsState:l,isRowDisabled:s,isRowSelected:c,rowSelectionState:u,generateGroupRows:d,reducers:p={}}=o,{groupParams:f,deepMap:m,pivot:g}=t,{groupBy:h}=f,b=[],T=[],S=[],C=[];return m.visitDepthFirst((y,v,w,I)=>{let R=y.items,x=v.length,D=l?.isGroupRowCollapsed(v)??!1;C.push(w);let M=mT({lazyLoad:e,groupBy:h,parents:Array.from(S),reducers:p,indexInGroup:w,indexInParentGroups:Array.from(C),indexInAll:b.length,groupKeys:v,error:y.error,totalChildrenCount:y.totalChildrenCount,childrenLoading:(y.childrenLoading||!D&&!y.childrenAvailable)&&e,childrenAvailable:y.childrenAvailable,directChildrenCount:v.length===h.length?y.items.length:m.getDirectChildrenSizeFor(v),directChildrenLoadedCount:0},y);if(c&&(M.rowSelected=c(M),u)){let F=u.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=F.selectedCount,M.deselectedChildredCount=F.deselectedCount}s&&(M.rowDisabled=s(M));let A=S[S.length-1],E=A?.collapsed??!1;E&&(D=!0),M.collapsed=D;let _=d||D;if(E&&(_=!1),_){if(r&&n!=null&&n>0){let F=M.indexInAll,N=M.parents;if(N.length>0&&F%n===0){let G=F/n,H=0;N.forEach(B=>{typeof r=="function"&&r(B)!==!0||(b.push(hi(B,F+H,G)),H++,M.indexInAll++)})}}b.push(M),T.push(b.length-1)}M.collapsedChildrenCount=0,S.forEach(F=>{F.deepRowInfoArray.push(M),F.collapsedGroupsCount+=D?1:0}),A&&M.selfLoaded&&e&&(A.directChildrenLoadedCount+=1),i&&i(M),S.push(M);let P=!0;if(P){if(I)I();else if(!g){let F=b.length;D||(b.length+=R.length);let N=0;for(let G=0,H=R.length;G<H;G++){let B=R[G];if(!D&&r&&n!=null&&n>0){let W=F+G+N;if(W%n===0){let se=W/n;S.forEach(ce=>{if(typeof r=="function"&&r(ce)!==!0)return;let ie=F+G+N;b[ie]=hi(ce,ie,se),N++,b.length++})}}let pe=F+G+N,k={id:B?a(B,pe):`${v}-${G}`,data:B,isCellSelected:dn,hasSelectedCells:dn,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!B,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:D,groupKeys:v,parents:Array.from(S),indexInParentGroups:[...C,G],indexInGroup:G,indexInAll:pe,groupBy:h,groupNesting:x+1,groupCount:M.groupCount};c&&(k.rowSelected=c(k)),s&&(k.rowDisabled=s(k)),i&&i(k),S.forEach((W,se)=>{se===S.length-1&&B&&(W.directChildrenLoadedCount+=1),D&&(W.collapsedChildrenCount+=1),W.deepRowInfoArray.push(k)}),D||(b[F+G+N]=k)}}}S.pop(),C.pop()}),{data:b,groupRowsIndexes:T}}import*as If from"react";var gT=()=>{};function hT(o,e){let t=new J,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function Op(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],p=r(n),f=Qe(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let b=m[g];Op(o,e,d,b)}});p?(c?.(n),s?.(n,gT)):(l?.(n,f,i(n)),s?.(n,f))}function Np(o,e,t){for(let n=0,r=t.length;n<r;n++)Op(o,e,[],t[n])}var bT=function(o,e){return o-e},yT=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},TT=function(o,e){return o-e},ST={number:bT,string:yT,date:TT},er=ST;function Lp(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var Wt=(o,e,t)=>{let n=typeof t=="function"?t:t?.get;return e.sort(kp(Lp(o),n)),e},Al=(o,e,t)=>{let n=kp(Lp(o),t.get),r=t.depthFirst??!1,i=t.inplace??!1;r||(i?e.sort(n):e=[...e].sort(n));let{nodesKey:a,toKey:l}=t,s=u=>u[a],c=u=>u[a]===void 0;return Np({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??s,toKey:l},{onParentNode:(u,d,p)=>{if(r&&d(),Array.isArray(p)){let f=i?p.sort(n):[...p].sort(n);u[a]=f}r||d()}},e),r&&(i?e.sort(n):e=[...e].sort(n)),e};Wt.knownTypes=er;var CT=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=Wt.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Wt.knownTypes).join(", ")}`)}return r||(r=er.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:n*c}},wT=o=>o.map(CT).filter(e=>e instanceof Function),kp=(o,e)=>{let t=wT(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var bi=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new J(n.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new J(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var mt=class extends bi{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function uo(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||Qo)(l,o);return t.push(s),t},[])}var xe=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new J;this.deselectedMap=new J;this.onlyUsePrimaryKeys=!1;this.selectionCache=new J;this.selectionCountCache=new J;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?uo(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(e);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let n=t?.get(e);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var IT="*",ze=class{constructor(e){this.wildcard=IT;this.cache=new J;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(n){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(n){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,n=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),n&&n.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let n=this.selectedRowsToColumns.get(e);if(n){if(n.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>n.has(r)):!1}return!1}error(e){Qt(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var vT=Be("IT:InfiniteTable"),RT="#dc3545",xT="#eb9316";var Vp="Warn",Gp="Error",DT="Info",PT="Success",ET="Logs",yi=vT.extend(ET),GO=yi.extend(DT),MT=yi.extend(Vp),AT=yi.extend(Gp),HO=yi.extend(PT);var _T=xT,FT=RT;var OT=(o,e)=>{e=e?e.extend?e.extend(Vp):e:MT,e(typeof e.color=="function"?e.color(_T,o):o)},NT=(o,e)=>{e=e?e.extend?e.extend(Gp):e:AT,e(typeof e.color=="function"?e.color(FT,o):o)};var zp=new J,Hp=(o,...e)=>{zp.has(e)||(zp.set(e,!0),o())};var po=(o,e=o,t)=>{Hp(()=>OT(o,t),e,"warn")},Kp=(o,e=o,t)=>{Hp(()=>NT(o,t),e,"error")};function Ti(o,e){return new xe(o,tt(e))}function tt(o){return()=>{let e=typeof o=="function"?o():o;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function Bp(o){let{getDataSourceState:e,dataSourceActions:t}=o;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof xe))throw"Invalid row selection";let a=new xe(r,tt(e));a.selectAll(),t.rowSelection=a},deselectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof xe))throw"Invalid row selection";let a=new xe(r,tt(e));a.deselectAll(),t.rowSelection=a},isRowSelected(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row")return a===r;if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof xe))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?uo(u,c):[]}return a.isRowSelected(r,i)},isRowDeselected(r,i){return!this.isRowSelected(r,i)},selectRow(r,i){let{rowSelection:a,selectionMode:l,indexer:s,groupBy:c}=e();if(l==="single-row"){t.rowSelection=r;return}if(l!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(a instanceof xe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?uo(d,c):[]}let u=new xe(a,tt(e));u.selectRow(r,i),t.rowSelection=u},deselectRow(r,i){let{selectionMode:a,rowSelection:l,indexer:s,groupBy:c}=e();if(a==="single-row"){t.rowSelection=null;return}if(a!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(l instanceof xe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?uo(d,c):[]}let u=new xe(l,tt(e));u.deselectRow(r,i),t.rowSelection=u}},toggleRowSelection(r,i){this.isRowSelected(r,i)?this.deselectRow(r,i):this.selectRow(r,i)},selectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof xe))throw"Invalid row selection";let s=new xe(a,tt(e));s.selectGroupRow(r),t.rowSelection=s},deselectGroupRow(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof xe))throw"Invalid row selection";let s=new xe(a,tt(e));s.deselectGroupRow(r),t.rowSelection=s},toggleGroupRowSelection(r){let{selectionMode:i,rowSelection:a,groupBy:l}=e();if(i!=="multi-row")throw'Selection mode should be "multi-row"';if(!l)throw"No grouping specified";if(!(a instanceof xe))throw"Invalid row selection";let s=new xe(a,tt(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new xe(i,tt(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof xe))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new xe(r,tt(i)):i.rowSelection,l=[];return i.lazyLoad&&console.error("getSelectedPrimaryKeys should not be called for lazy-loaded datasources as it wont return reliable results"),i.originalDataArray.forEach(s=>{let c=i.toPrimaryKey(s);a.isRowSelected(c)&&l.push(c)}),l}}}var _l=new WeakMap,LT=o=>o;function Wp(o,e=50,t){_l.set(o,{lastCallTime:0,lastCallArg:null});let n=t??LT;return r=>{let{lastCallTime:i,lastCallArg:a}=_l.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=St(n(a),n(r));s<e&&c||(_l.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var Si=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new J;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}n?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),b=s?[...p,h]:void 0,T=s&&!!b,S=T?n?.getMutationsForNodePath(b):n?.getMutationsForPrimaryKey(h);if(S&&S.length){for(let C=0,y=S.length;C<y;C++){let v=S[C];if(v.type==="delete"&&!g&&(T?this.removeNodePath(b,t):this.remove(h),g=!0,d.splice(f,1),f--),v.type==="update"&&!g&&(m={...m,...v.data},d[f]=m),v.type==="update-children"&&!g){let w=v.children(m[l],m);m={...m},w!==void 0?m[l]=w:delete m[l],d[f]=m}v.type==="insert"&&(v.position==="before"?(d.splice(f,0,v.data),f--):d.splice(f+1,0,v.data))}T?n?.removeNodePathInfo(b):n?.removeInfo(h)}if(!g)if(T){this.addNodePath(b,m);let C=a(m),y=C?null:i(m);!C&&Array.isArray(y)&&(p.push(h),c&&(m[l]=y=y.concat()),u(y,p),p.pop())}else this.add(h,m)}}};u(e,[])}return e}}};import{useEffect as bo,useMemo as af,useRef as Pi,useState as UT}from"react";import{useEffect as jp,useLayoutEffect as kT,useRef as fo}from"react";function mo(o,e){let t=fo({}),n=fo({}),r=n.current,i=fo({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,jp(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function eN(o,e){let t=fo({}),n=fo({}),r=n.current,i=fo({}),a=i.current,l=[];for(let s in e)e.hasOwnProperty(s)&&(e[s]!==t.current[s]&&(a[s]=e[s],r[s]=t.current[s]),l.push(e[s]));t.current=e,kT(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function tN(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);jp(o,t)}function Fl(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Ol(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e?.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function Nl(o){let{pivotByAtIndex:e}=o;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function $p({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=Qe(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Ol({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let b=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let C=S;S=m.join("/");let y=m[m.length-1];c[S]=Nl({header:`${y}`,columnGroup:C,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:b,pivotIndex:m.length-1,pivotGroupKey:y})}l.forEach((C,y)=>{let v=d?`${m[m.length-1]}`:C.name||C.id,w=Ol({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:C,pivotAggregatorIndex:y,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:b,defaultSortable:!1,columnGroup:S,header:v,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[C.id]:null}),I=`${C.id}:${m.join("/")}`;s[I]=w})}else{let b=m.join("/"),T=m.slice(0,-1);if(c[b]=Nl({columnGroup:T.length?T.join("/"):void 0,header:`${m[m.length-1]}`,pivotBy:e,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:e[m.length-1],pivotGroupKey:m[m.length-1]}),t!==!1){let S=e[m.length-1],C=T.length?T.join("/"):void 0;if(!d){let y=C;C=`total:${m.join("/")}`,c[C]=Nl({header:`${m[m.length-1]} total`,columnGroup:y,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((y,v)=>{let w=d?`${m[m.length-1]} total `:`${y.name||y.id} total`,I=Ol({columnGroup:C,header:w,pivotAggregator:y,pivotAggregatorIndex:v,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[y.id]:null});s[`total:${y.id}:${m.join("/")}`]=I})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var Up=Symbol("CLEAR"),kn=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new J;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Up,n=this.primaryKeyToData.get(t)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Up);this.clear=()=>{this.allFieldsAffected=!1,this.affectedFields.clear(),this.primaryKeyToData.clear()};this.isEmpty=()=>this.primaryKeyToData.size===0&&this.nodePathToData.size===0;this.removeInfo=e=>{this.primaryKeyToData.delete(e)};this.removeNodePathInfo=e=>{this.nodePathToData.delete(e)};this.getMutationsForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getMutationsForNodePath=e=>this.nodePathToData.get(e);this.getMutationsCount=()=>this.primaryKeyToData.size;this.getMutations=()=>new Map(this.primaryKeyToData);this.getTreeMutations=()=>J.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:J.clone(e.nodePathToData),n}};function fn(o,e){return e().dataArray[o]}function Ci(o){return o().dataArray}var nt=class{constructor(e){this.collapsedPathsMap=new J;this.expandedPathsMap=new J;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:n,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?n.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?n.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var zT=(o,e)=>o.length-e.length,ot=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new J;this.cache=new J;let n=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.setConfigFn(t),this.update(n)}getTreeDeepMap(){return this.getConfig().treeDeepMap}getSelectedLeafNodePaths(e=[],t){t=t||this.getConfig().treeDeepMap;let n=[];return t.getLeafNodesStartingWith(e,r=>{this.isNodeSelected(r.keys)&&n.push(r.keys)}),n}getDeselectedLeafNodePaths(e=[],t){t=t||this.getConfig().treeDeepMap;let n=[];return t.getLeafNodesStartingWith(e,r=>{this.isNodeSelected(r.keys)||n.push(r.keys)}),n}isLeafNode(e){return!this.getTreeDeepMap().has(e)}getLeafNodesCount(e){let n=this.getTreeDeepMap().get(e);return n?n.items.length:1}static from(e,t){return new o(e,t)}setConfigFn(e){this.getConfig=e,this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}isNodeSelected(e){return this.isPathSelected(e)}isSelfSelected(e){return this.selectionMap.get(e)??null}cacheIt(e,t){return this.cache.set(e,t),t}getSelectionStateForNode(e,t){let n=this.cache.get(e);if(n)return n;if(this.isLeafNode(e)){let d=this.isSelfSelected(e);if(d!==null)return this.cacheIt(e,{selected:d,selectedCount:d?1:0,deselectedCount:d?0:1,leafCount:1})}let r=this.getLeafNodesCount(e),i=this.isSelfSelected(e),{selectionMap:a}=this,l=a.getKeysOfFirstChildOnEachBranchStartingWith(e,{excludeSelf:!0}).sort(zT);if(!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.getSelectionStateForNode(e,!0).selected}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.selectionMap.getKeysStartingWith(e).forEach(r=>{this.selectionMap.delete(r)}),!(e.length===1&&this.defaultSelection===t)){if(this.setSelectionForPath(e,t),e.length>1){let r=e.slice(0,-1);this.isNodeSelected(r)===t&&this.setNodeSelection(r,t)}}}selectNode(e){this.setNodeSelection(e,!0)}deselectNode(e){this.setNodeSelection(e,!1)}toggleNodeSelection(e){this.setNodeSelection(e,!this.isNodeSelected(e))}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[]){let{selectedCount:t,deselectedCount:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.getConfig=null,this.xcache(),this.selectionMap.clear()}};function Ii(o,e){return new ot(o,go(e))}function go(o){return()=>({treeDeepMap:(typeof o=="function"?o():o).treeDeepMap})}var wi=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof ot))throw"Invalid tree selection";let a=new ot(r,go(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current=e,this.actions.treeSelection=a};this.getCallbackParam=e=>({dataSourceApi:this.dataSourceApi});this.getState=e.getState,this.actions=e.actions,this.dataSourceApi=e.dataSourceApi}getSelectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!n)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new nt({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new nt({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new nt(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new nt(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new nt(n.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){let{treeDeepMap:t}=this.getState();if(!t||!e.length)return null;let n=this.getRowInfoByPath(e);return n?n.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?fn(n,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof ot))throw"Invalid node selection";let n=new ot(e,go(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof ot))throw"Invalid node selection";let n=new ot(e,go(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof ot))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var ho=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var gt=class extends ho{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var Ll=1e3;function Yp(o){return new kl(o)}var kl=class{constructor(e){this.pendingOperations=[];this.batchOperationRafId=0;this.batchOperationTimeoutId=0;this.pendingPromise=null;this.resolvePendingPromise=null;this.toPrimaryKey=e=>this.getState().toPrimaryKey(e);this.getRowInfoArray=()=>Ci(this.getState);this.getRowInfoByIndex=e=>fn(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),n=t.getDataForNodePath(e);return n||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let n=this.getState().isTree,r=n?void 0:e.map(l=>this.toPrimaryKey(l)),i=n?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,n)=>{let r=n?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Ll:r;return isNaN(a)||(a=Ll),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=n?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let n=this.getState().rowDisabledState,r=n?new gt(n):new gt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let n=this.getRowInfoByPrimaryKey(e);n&&this.setRowEnabledAt(n.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new gt({enabledRows:!0,disabledRows:[]});return}let t=new gt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new gt({disabledRows:!0,enabledRows:[]});return}let t=new gt(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new wi({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:n,nodesKey:r}=this.getState(),i=t?kn.clone(t,{light:!0}):new kn({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Ll,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,n.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function qp(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,b)=>h||typeof b!="function"?l.has(b):!1,!1),t))break}if(c&&c.length){if(l===!0)n=!0;else for(let m of c)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function vi(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function Ri(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function xi(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function Vl(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var Nt=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function zl(){return!1}function VT(o,e,t,n,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:zl,hasSelectedCells:zl};return n&&(a.rowSelected=n(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var GT=Qe(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
2
2
|
|
|
3
3
|
Your filtering function probably looks like this:
|
|
4
4
|
|
|
@@ -26,5 +26,5 @@ Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},tr=o=>{let{debugId:e,key:t}=o,n=
|
|
|
26
26
|
|
|
27
27
|
`);let n=go(t);if(o instanceof ot)return o.setConfigFn(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??aS,i=Dt.get(r);return i&&i.setConfigFn(n),i=i??new ot(r,n),Dt.set(r,i),i}function mf(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=zo(e.sortInfo),a=zo(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((E,_)=>{let P=l[_].operators;E[_]=E[_]||{};let F=E[_];return P.forEach(N=>{F[N.name]=N}),E},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let E=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(E!==void 0&&(E&&typeof E=="object"?u="multi-row":u="single-row"),!u){let _=c.treeSelection??c.defaultTreeSelection;_!==void 0&&(u=typeof _=="object"?"multi-row":"single-row")}u=u??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(f===null?d=u==="single-row"?null:new xe({selectedRows:[],deselectedRows:[],defaultSelection:!1},tt(t)):u==="single-row"||f instanceof xe?d=f:d=new xe(f,tt(t))),u==="single-cell"||u==="multi-cell"))if(m===null)p=u==="single-cell"?null:new ze;else if(m instanceof ze)p=m;else{let E=Dt.get(m)??new ze(m);Dt.set(m,E),p=E}let g=t.primaryKey,h=typeof g=="function"?E=>g(E):E=>E[g],b=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(b&&!(b instanceof nt)){let E=Dt.get(b)??new nt(b);Dt.set(b,E),b=E}b=b||new nt({defaultExpanded:!0,collapsedPaths:[]});let T=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(T&&!(T instanceof mt)){let E=Dt.get(T)??new mt(T);Dt.set(T,E),T=E}T=T||new mt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=iS(e.shouldReloadData||{}),C=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),y=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,v=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&po('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&po('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&po('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let w=typeof e.data=="function"?C??"local":"local",I=e.sortFunction?"local":y??(i?"remote":"local"),R=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":v??(typeof e.data=="function"?"remote":"local"),x=S.pivotBy?"remote":"local",D=t.rowDisabledState,M=e.isRowDisabled;if(!M&&D){let E=Dt.get(D);E?M=E:(M=_=>D.isRowDisabled(_.id),Dt.set(D,M))}let A={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:T,treeExpandState:b,treeExpandMode:b.mode,shouldReloadData:{filterValue:S?.filterValue??R==="remote",sortInfo:S?.sortInfo??I==="remote",groupBy:S?.groupBy??w==="remote",pivotBy:S?.pivotBy??x==="remote"},isRowDisabled:M,rowSelection:d,cellSelection:p,groupMode:w,sortMode:I,filterMode:R,pivotMode:x,toPrimaryKey:h,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let E=!n||n.originalDataArray!==t.originalDataArray,_=typeof e.livePaginationCursor=="function"?E?rS(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;A.livePaginationCursor=_}if(t.devToolsDetected&&t.debugId){let E=$t.get(t.debugId);E&&(A={...A,...E})}return A}var lS=ut("DataSource:fullLazyLoad");function gf(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&lS('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new mt({collapsedRows:!0,expandedRows:[]})))}function hf(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let t=e.__apiRef.current,n=t.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,selectionMode:"multi-row",lastUpdatedNodePath:e.lastSelectionUpdatedNodePathRef.current,dataSourceApi:t,treeApi:n}]}},treeExpandState:(o,e)=>({callbackParams:[o.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof ze?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function bf(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Ae(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=Yt(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>St(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(ut(nn(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function yf(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}import Tf,{useCallback as sS,useEffect as Sf,useLayoutEffect as Cf,useState as cS}from"react";function or(o){let e=ke(),t=ve(e),n=!!e,r=n?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=wf(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=ve(s),[d]=cS(()=>Yp({getState:u,actions:l})),p={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:u,assignState:c,api:d},f=ve(i),m=ve(p),g=Ao(),h=sS(({children:b})=>(typeof b=="function"&&(b=b(u())),Tf.createElement(a.Provider,{key:r,value:f()},Tf.createElement(g.Provider,{value:m()},b))),[a,n,r]);return Cf(()=>{e&&e.registerDetail(p)},[]),Cf(()=>()=>{let b=u();b.onCleanup(b)},[]),sf({componentState:s,componentActions:l,getComponentState:u}),Sf(()=>{s.onDataArrayChange?.(s.originalDataArray,s.originalDataArrayChangedInfo),s.onDataMutations&&s.originalDataArrayChangedInfo.mutations&&s.originalDataArrayChangedInfo.mutations.size&&s.onDataMutations({primaryKeyField:typeof s.primaryKey=="string"?s.primaryKey:void 0,dataArray:s.originalDataArray,mutations:s.originalDataArrayChangedInfo.mutations,timestamp:s.originalDataArrayChangedInfo.timestamp}),s.onTreeDataMutations&&s.originalDataArrayChangedInfo.treeMutations&&s.originalDataArrayChangedInfo.treeMutations.size&&s.onTreeDataMutations({nodesKey:s.nodesKey?s.nodesKey:void 0,dataArray:s.originalDataArray,treeMutations:s.originalDataArrayChangedInfo.treeMutations,timestamp:s.originalDataArrayChangedInfo.timestamp})},[s.originalDataArrayChangedInfo]),Sf(()=>{s.onReady?.(d)},[]),{DataSource:h,state:p.componentState}}var wt=class extends ho{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var Mi=class Mi{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??Mi.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};Mi.DEFAULT_SIZE=10;var Ei=Mi;var Hl=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Ai=class{constructor(e){this.storage=new Ei(e)}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},Kl=class{constructor(){this.storage=new Map}add(e,t){this.storage.set(e,t)}get(e){return this.storage.get(e)}delete(e){this.storage.delete(e)}has(e){return this.storage.has(e)}},rr=class{constructor(e){this.cacheStorage=e===!1?new Hl:e===!0?new Kl:typeof e=="number"?new Ai(e):new Ai(5)}add(e,t){this.cacheStorage.add(e,t)}get(e){return this.cacheStorage.get(e)}delete(e){this.cacheStorage.delete(e)}has(e){return this.cacheStorage.has(e)}};var uS=(e=>(e.INIT="INIT",e))(uS||{});var{useManagedComponent:wf}=vt({debugName:"DataSource",initSetupState:df,forwardProps:ff,concludeReducer:Qp,mapPropsToState:mf,onPropChange:gf,cleanup:pf,interceptActions:bf(),mappedCallbacks:hf()});function K0(o){let{DataSource:e}=or(o);return If.createElement(e,null,o.children??null)}function B0(){let{rowInfoReducerResults:o}=Jt();return o}function W0(){let o=ke();if(o)return o.masterRowInfo}function Bl(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[c+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,p;for(;!p&&u<l.length&&(u++,p=s(u,d),p||(d*=-1,p=s(u,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function Wl(o){if(o==null)return!1;let e=o;return!0}function _i(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function jl(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function vf(o,e,t){if(jl(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/n),p=Math.floor(c/n),f=l%n,m=c%n,g=Math.min(f,m),h=Math.max(f,m),b=[];for(let T=d;T<=p;T++)for(let S=g;S<=h;S++){let C=T*n+S;if(T===d)for(let y=s;y<r;y++)b.push({rowIndex:C,colIndex:y});else if(T===p)for(let y=0;y<=u;y++)b.push({rowIndex:C,colIndex:y});else for(let y=0;y<r;y++)b.push({rowIndex:C,colIndex:y})}return b}function dS(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var $l=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??fn(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new ze(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=fn(l,this.getDataSourceState),h=fn(c,this.getDataSourceState);if(!g||!h)return;let b=g.indexInAll,T=h.indexInAll,[S,C]=_i({rowIndex:b,colIndex:f},{rowIndex:T,colIndex:m});for(let y=S.rowIndex;y<=C.rowIndex;y++)for(let v=S.colIndex;v<=C.colIndex;v++){let w={rowIndex:y,colIndex:v},[I,R]=this.getCellSelectionPosition(w);n?a.selectCell(I,R):a.deselectCell(I,R)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=Ci(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=dS(Array.from(a),i),u=l.map(d=>c.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new ze(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new ze(t);n.debugId=e.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new ze:new ze(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new ze(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new ze(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new ze(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Rf(o){return new $l(o)}function xf(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new wt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new wt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(i){let a=t().isRowDetailExpanded;if(!a)return!0;let l=e.getRowInfoByPrimaryKey(i);return l?!a(l):!0},isRowDetailEnabledForRow(i){let{isRowDetailEnabled:a}=t();if(!a)return!1;if(typeof a=="function"){let l=e.getRowInfoByPrimaryKey(i);return l?a(l):!1}return!0},isRowDetailExpanded(i){return!r.isRowDetailCollapsed(i)},collapseRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new wt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new wt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function gn(o,e,t){return Math.min(Math.max(o,e),t)}function Fi(o,e,t){let n=o().dataArray,r=0,i=n.length-1,a=e;do{a+=t;let l=n[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return gn(a,r,i)}function pS(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:p}=u;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,b=0,T=c-1,S={ArrowDown:()=>{p=Fi(n,p,1)},ArrowUp:()=>{p=Fi(n,p,-1)},ArrowLeft:()=>{let y=s[p];if(d.isHorizontalLayoutBrain){let v=d.rowsPerPage;p-v>=b?p=p-v:S.ArrowUp();return}return y&&y.isGroupRow?i.collapseGroupRow(y.groupKeys):y&&i.rowDetailApi.isRowDetailEnabledForRow(y.id)?i.rowDetailApi.collapseRowDetail(y.id):!1},ArrowRight:()=>{let y=s[p];if(d.isHorizontalLayoutBrain){let v=d.rowsPerPage;p+v<=T?p=p+v:S.ArrowDown();return}return y&&y.isGroupRow?i.expandGroupRow(y.groupKeys):y&&i.rowDetailApi.isRowDetailEnabledForRow(y.id)?i.rowDetailApi.expandRowDetail(y.id):!1},Enter:()=>{let y=s[p];return y&&y.isGroupRow?i.toggleGroupRow(y.groupKeys):y&&y.isTreeNode&&y.isParentNode?a.treeApi.toggleNode(y.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(y.id)?i.rowDetailApi.toggleRowDetail(y.id):!1},PageDown:()=>{p=Math.min(p+h,c-1)},PageUp:()=>{p=Math.max(p-h,b)},End:()=>{p=T},Home:()=>{p=b}},C=S[l];return C?(C(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Ul(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,c=i().dataArray,u=n(),{activeCellIndex:d,brain:p}=u;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[b,T]}=p.getRenderRange(),S=b-g-1,C=T-h-1,y=i().dataArray.length-1,v=r().computedVisibleColumns.length-1,w=0,I=0;f=gn(f,0,y),m=gn(m,0,v);let R={ArrowDown:()=>{f=gn(f+1,w,y)},ArrowUp:()=>{f=gn(f-1,w,y)},ArrowLeft:()=>{if(m===I)if(f!==w&&(m=v),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f-D>=w?f=f-D:R.ArrowUp()}else R.ArrowUp();else m=gn(m-1,I,v)},ArrowRight:()=>{if(m===v)if(f!==y&&(m=I),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f+D<=y?f=f+D:R.ArrowDown()}else R.ArrowDown();else m=gn(m+1,I,v)},Enter:()=>{let D=c[f];return D&&D.isGroupRow?t.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&t.rowDetailApi.isRowDetailEnabledForRow(D.id)?t.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{s?m=Math.min(m+C,v):f=Math.min(f+S,y)},PageUp:()=>{s?m=Math.max(m-C,I):f=Math.max(f-S,w)},End:()=>{s?m=v:f=y},Home:()=>{s?m=I:f=w}},x=R[l];return x?(x(),[f,m]):!1}function fS(o,e){let t=Ul(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var mS={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Df(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!mS[t]?!1:i!=null&&l==="row"?pS(o,e):a!=null&&l==="cell"?fS(o,e):!1}var Yl=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:n}=this.param,{activeRowIndex:r,keyboardNavigation:i}=n();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Fi(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,n=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Ul(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Pf(o){return new Yl(o)}function Ef(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var ql=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...ft({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;n.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),c;try{c=await s(a)}catch(d){c=d}let u=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:u},Promise.resolve(u)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...ft({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let c=l.computedEditable(ft({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>et(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=ao({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new mt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),n=new mt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[pn,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||zn(t.data,t,this.dataSourceActions,{groupKeys:e},this.context.getDataSourceMasterContext()):i?.cache||(t.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(e).forEach(l=>{t.lazyLoadCacheOfLoadedBatches.delete(l)}),this.dataSourceActions.lazyLoadCacheOfLoadedBatches=J.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=xt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let g=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>p+(n.offset||0);return f&&m?!1:(c.scrollLeft!==u.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=Bp({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Pf({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=xf({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Rf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(Bl(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Bl(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Md({column:u,rowInfo:d}),f=p;u.getValueToEdit&&(p=await u.getValueToEdit(ft({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,n){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,n);return}let l=i.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(f=>f.valueGetter?m=>f.valueGetter({data:m,field:f.field}):f.field?f.field:f.groupField??void 0).filter(Wl);u.length&&(s=u);let d=i.computedSortType;c.length&&d===to&&(d=c.flatMap(m=>{let g=m.field??m.groupField,h=g?r.get(g):null;return h?h.computedSortType:to}));let p={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(p.valueGetter=f=>i.valueGetter({data:f,field:i.field})),this.setSortInfoForColumn(e,p,n)}setSortInfoForColumn(e,t,n){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!Ef(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:Ef(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;n.computedFilterValue?(u={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(u.field=n.field)),u.id=n.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],c=n.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,p=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:p}}}return a}).filter(Wl),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n={...this.getState().columnVisibility};t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current.scrollLeft=Math.max(e,0)}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current.scrollTop=Math.max(e,0)}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=n.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(n.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),c=n.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Mf(o){return new ql(o)}import{useEffect as Af,useRef as gS,useState as hS}from"react";var bS=10;function yS(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${Fn} > .${dl}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${En}`);if(t===!1&&d)return;let p=u.getAttribute("data-column-id"),f=c.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Ft.split(" ")),f.style.position="absolute",f.style.width="auto",u.appendChild(f);let m=f.offsetWidth;if(u.removeChild(f),!s[p]){let g=we().getComputedStyle(u);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+bS}if(m+=s[p],d){let g=0;u.childNodes.forEach(h=>{if(h!==c){let b=h,T=Math.max(b.offsetWidth,parseInt(b.style.width,10));if(isNaN(T)&&(T=0),g+=T,T>0){let S=we().getComputedStyle(b);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function _f(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=je(),[a,l]=hS(0),s=typeof r=="object"?r.key:r,c=ve(s),u=gS(null);Af(()=>{if(c()==null)return;let{current:p}=u,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),Af(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=yS(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let b=o().columnSizing,T={...b},S=!1;h.forEach(C=>{T[C]={width:g[C]},S=S||T[C].width!==b[C]?.width}),S&&(e.columnSizing=T)},[s,n,a])}import{useMemo as xS}from"react";import{useCallback as DS,useEffect as yo,useRef as PS}from"react";import*as Oi from"react";function Ff(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return Vr(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}import*as ir from"react";var Of=ue({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});import{useMemo as Nf,useRef as TS}from"react";function SS(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function CS(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=yf(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(o,l),r.detailDataSourcesStateToRestore=a}function wS(o,e){let t=TS(!1);return{currentRowCache:Nf(()=>({getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)}),[e,o]),cacheCalledByRowDetailRenderer:t}}function Lf(o){let{rowDetailsCache:e,rowInfo:t}=o,{getState:n,componentActions:r}=De(),{getState:i}=Q(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=wS(t.id,e),s=Nf(()=>{let c=n().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:Qe(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}SS(t.id,{masterState:n(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&CS(t.id,{detailState:d.getState(),masterActions:r,masterState:n(),cacheEntryForRow:p})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:IS}=Me,vS=`${IS}RowDetail`;function RS(o){let e=Sr(),{domRef:t,rowDetailRenderer:n,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=o,{masterDetailContextValue:s,currentRowCache:c}=Lf({rowDetailsCache:l,rowInfo:i});return ir.createElement(e.Provider,{value:s},ir.createElement("div",{ref:t,className:Z(vS,Of({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${$.bodyWidth} - ${$.scrollbarWidthVertical})`,height:r}},n(i,c)))}var kf=ir.memo(RS);var ES=1;function zf(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,state:i,getState:a}=Q(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedColumnsMap:u,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:g,columnSize:h}=e,{componentState:b,getState:T,componentActions:S,api:C}=De(),{dataArray:y,isNodeReadOnly:v}=b,w=ve(y),{rowHeight:I,rowDetailHeight:R,onRowMouseEnter:x,onRowMouseLeave:D,groupRenderStrategy:M,brain:A,showZebraRows:E,rowDetailRenderer:_,isRowDetailExpanded:P,isRowDetailEnabled:F,cellClassName:N,cellStyle:G,rowStyle:H,rowDetailCache:B,rowClassName:pe,onScrollToTop:de,onScrollToBottom:k,onScrollStop:W,scrollToBottomOffset:se,wrapRowsHorizontally:ce,ready:ie}=i,oe=b.updatedAt;Ff({columnSize:h,brain:A,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedRowHeight:d,dataArray:y,bodySize:t,rowspan:m});let te=PS(0);yo(()=>A.onRenderCountChange(()=>{te.current=A.scrollTopMax}),[A]),yo(()=>A.onRenderRangeChange(U=>{a().onRenderRangeChange?.(U)}),[A]),yo(()=>A.onScrollStop(U=>{let{scrollTop:O,scrollLeft:re}=U;if(O===0&&de?.(),O+(se??ES)>=te.current){k?.();let{livePagination:ee,livePaginationCursor:Y,dataArray:le}=T();ee&&(S.cursorId=Y!==void 0?Date.now():le.length)}if(W){let ee=A.getRenderRange();W({scrollTop:O,scrollLeft:re,renderRange:ee,viewportSize:a().bodySize,firstVisibleRowIndex:ee.start[0],lastVisibleRowIndex:ee.end[0],firstVisibleColIndex:ee.start[1],lastVisibleColIndex:ee.end[1]})}}),[A,de,k,W]),yo(()=>{t.height&&(r.ready=!0)},[!!t.height]),yo(()=>{let{onReady:U}=a();U&&U({api:n,dataSourceApi:C})},[ie]);let[,fe]=_t();yo(()=>{fe()},[b]);let ne=DS(U=>{let{rowIndex:O,colIndex:re,heightWithRowspan:j,domRef:K,hidden:ee,width:Y,onMouseLeave:le,onMouseEnter:me}=U,Ee=w()[O],Ge=c[re];if(!Ee||!Ge)return null;let Ue=p?p.getRowHeight(O):j,Le=!1;!F||typeof F=="function"&&!F(Ee)?Le=!1:P&&(Le=P(Ee)?"expanded":"collapsed");let Ye=ce?A.getRowIndexInPage(O):null,We=ce?A.getPageIndexForRow(O):null;return Oi.createElement(Ld,{...{getData:w,virtualized:!0,showZebraRows:E,groupRenderStrategy:M,rowIndexInHorizontalLayoutPage:Ye,horizontalLayoutPageIndex:We,rowIndex:O,rowInfo:Ee,hidden:ee,toggleGroupRow:g,rowHeight:Ue,rowDetailState:Le,onMouseEnter:me,onMouseLeave:le,onRowMouseEnter:x,onRowMouseLeave:D,domRef:K,width:Y,column:Ge,columnsMap:u,fieldsToColumn:f,rowStyle:H,rowClassName:pe,cellStyle:G,cellClassName:N}})},[I,R,x,D,p,d,P,w,c,u,f,M,ce,g,E,A,oe,v,H,pe,N,G]),V=xS(()=>{if(P)return U=>{let{rowIndex:O,domRef:re}=U,K=w()[O];if(!K||!P(K)||!p)return Oi.createElement("div",{ref:re,className:$c.hidden});let{rowDetailHeight:ee,rowHeight:Y}=p.getSize(O);return Oi.createElement(kf,{rowInfo:K,rowDetailsCache:B,rowIndex:O,domRef:re,detailOffset:Y,rowDetailHeight:ee,rowDetailRenderer:_})}},[ie,ne,_,R,P,B]);return{renderCell:ne,renderDetailRow:V}}import{useEffect as qS,useState as es}from"react";var Ni=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,n,r){if(r.horizontalLayout&&!jl(e,t,r)){vf(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=_i(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function Vf(o,e){return o<e?[o,e]:[e,o]}var Li=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[n,r]=Vf(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[n,r]=Vf(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let n;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))n=r;else break}this.multiSelectEndIndex=n}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};import{useMemo as MS}from"react";function Gf(o){let{getState:e}=De();return MS(()=>o.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,c=o[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}import{useCallback as AS}from"react";var Pz=ut("useColumnSizeFn");function Hf(o){return AS(t=>{let n=o[t];return n?n.computedWidth:0},[o])}import{useEffect as To,useLayoutEffect as NS,useMemo as LS}from"react";import{createRef as Vn}from"react";var _S={scrollLeft:0,scrollTop:0},ar=class{constructor(){this.scrollPosition=_S;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let n=0,r=t.length;n<r;n++)t[n](e)}};function Kf(o,e){let t=new Map;function n(r){return e[r]!==!1}return Object.keys(o).forEach(r=>{let a=o[r].columnGroup,l=0;for(n(r)||(l=-1);a;){let s=o[a];if(!s)break;n(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}import*as Bf from"react";function Wf(o){return(e,t)=>Bf.createElement(o,{key:e.id,rowInfo:e,cache:t})}var lr=class extends Sn{constructor(t,n){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,n,r,i){if(t==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(t,n,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=Rr(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,p=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&h&&(this.initialCols=r,this.cols=r);let b=i!=null,T=a!=null,S=b&&i!==this.rowHeight,C=T&&a!==this.initialColWidth;b&&(this.rowHeight=i),T&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let y=g||S||p,v=h||C||d||y;(v||y)&&this.updateRenderCount({horizontal:v,vertical:y})}getInitialRowHeight(){return typeof this.rowHeight!="number"?this.getRowHeight(0):this.rowHeight}get totalPageCount(){return this.options.masterBrain?this.options.masterBrain.totalPageCount:this._totalPageCount}set totalPageCount(t){this.options.masterBrain||(this._totalPageCount=t)}getPageWidth(){return this.pageWidth}doUpdateRenderCount(t=Vt){let n=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/n);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(n=>{Ae(()=>{this.destroyed||t.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(t,n){return this.initialCols*(n?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var jf={};function Xl(o){return`.${_n}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Zl(o,e){let t=nn(o),n=e?new lr(t,{isHeader:!1}):new Sn(t),r=`${t}:header`,i=e?new lr(r,{isHeader:!0,masterBrain:n}):new Sn(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=No(n),{renderer:s,onRenderUpdater:c}=No(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function $f({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Zl(o,!!e),c=Vn();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:u=>{if(!c.current)return null;let d=Xl(u);return c.current.querySelector(d)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:Vn(),editingValueRef:Vn(),scrollerDOMRef:Vn(),portalDOMRef:Vn(),focusDetectDOMRef:Vn(),activeCellIndicatorDOMRef:Vn(),onColumnMenuClick:ge(),cellContextMenu:ge(),contextMenu:ge(),onFilterOperatorMenuClick:ge(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:ge(),onRowHeightCSSVarChange:ge(),onRowDetailHeightCSSVarChange:ge(),onColumnHeaderHeightCSSVarChange:ge(),cellClick:ge(),cellMouseDown:ge(),keyDown:ge(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new ar,pinnedEndScrollListener:new ar,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Uf=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new rr(e),hideColumnWhenGrouped:e=>e??!1,columnMinWidth:e=>e??30,columnMaxWidth:e=>e??5e3,columnDefaultWidth:e=>e??200,columnCssEllipsis:e=>e??!0,draggableColumns:1,columnDefaultDraggable:1,headerOptions:e=>({alwaysReserveSpaceForSortIcon:!0,...e}),showSeparatePivotColumnForSingleAggregation:e=>e??!1,sortable:1,hideEmptyGroupColumns:e=>e??!1,pivotTotalColumnPosition:e=>e??"end",pivotGrandTotalColumnPosition:1,licenseKey:e=>e||"",keyboardSelection:e=>e??!0,activeRowIndex:1,activeCellIndex:1,columnOrder:e=>e??!0,header:e=>e??!0,showZebraRows:e=>e??!0,showHoverRows:e=>e??!0,virtualizeColumns:e=>e??!0,rowHeight:e=>typeof e=="number"||typeof e=="function"?e:0,rowDetailHeight:e=>typeof e=="number"||typeof e=="function"?e:300,columnHeaderHeight:e=>typeof e=="number"?e:30,columns:1,columnVisibility:e=>e??jf,columnGroupVisibility:e=>e??jf,columnSizing:e=>e||{},columnTypes:e=>e||{},onEditCancelled:1,onEditRejected:1,onEditAccepted:1,persistEdit:1,shouldAcceptEdit:1,onEditPersistError:1,onEditPersistSuccess:1,multiSortBehavior:e=>e??"replace",collapsedColumnGroups:e=>e??new Map,columnGroups:1});function FS(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Yf=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function qf(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var ki=new WeakMap;function Xf(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Zf=o=>{let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=n?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=n?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=n?.pivotColumnGroups?Kf(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=FS({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let h=ki.get(d);h||(h=Wf(d),ki.set(d,h)),u=h}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof wt)&&(c=new wt(c)),c=c||new wt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=c?e.isRowDetailExpanded:void 0;!f&&c&&(f=ki.get(c),f||(f=h=>c.isRowDetailsExpanded(h.id),typeof c=="object"&&ki.set(c,f)));let m=u?e.isRowDetailEnabled||!0:!1,g={isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||ae.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=jt.get(t.debugId);h&&(g={...g,...h})}return g};function Qf(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function Jf(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(c=Math.max(c,f.groupNesting-1),c===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}import{useCallback as OS}from"react";function Ql(){let{getState:o,componentActions:e,getDataSourceMasterContext:t}=De();return OS(r=>{let i=o(),a=new mt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[pn,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||zn(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=J.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=xt())}},[])}function kS(o){return LS(()=>qf(o),[o])}function em(){let{componentState:{groupBy:o},componentActions:e}=De(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:n,pivotGrandTotalColumnPosition:r}}=je();To(()=>{e.generateGroupRows=t!=="inline"},[t]),To(()=>{e.pivotTotalColumnPosition=n},[n]),To(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=kS(o);zS(i);let{toggleGroupRow:a}=VS();return GS(i),{toggleGroupRow:a}}function zS(o){let e=Ql(),{componentActions:t,componentState:{columns:n,groupRenderStrategy:r,isTree:i}}=je();function a(l,s,c,u){let d={};if(c==="inline")return Object.keys(l).forEach(p=>{let f=l[p],m={},g=s.get(f.field);if(g&&c==="inline"){let{groupIndex:b}=g;m={groupByForColumn:g.groupBy,field:g.groupBy?.field,valueGetter:g.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[b]:T.value,rowspan:({rowInfo:T,dataArray:S})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let C=S[T.indexInAll-1]||{indexInParentGroups:[]};if(!C||!C.dataSourceHasGrouping)return 1;let y=C.indexInParentGroups||[],v=T.indexInParentGroups||[],w=!1;for(let x=0;x<=b;x++){let D=y[x];if(v[x]!==D){w=!0;break}}if(!w)return 1;let I=T.parents[b];return I?I.groupCount-(I.collapsedChildrenCount||0)+(I.collapsedGroupsCount||0):1},renderGroupIcon:oi({groupIndexForColumn:b,groupRenderStrategy:c,toggleGroupRow:u,initialRenderGroupIcon:f.renderGroupIcon}),render:ni({groupIndexForColumn:b,groupRenderStrategy:c})}}let h={...m,...f};d[p]=h}),Object.keys(d).length===0?void 0:d}To(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(n,o,r,e)})()},[n,o,r,e])}function VS(){let{componentState:{groupBy:o,pivotBy:e,selectionMode:t}}=De(),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:p}=je(),f=Ql();return To(()=>{(()=>{let{columns:g,groupColumnIds:h}=HS({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let b=p().columnOrder;if(h.length&&Array.isArray(b)){let T=new Set(b),S=!1;h.forEach(C=>{T.has(C)||(S=!0,b=[C,...b])}),S&&(n.columnOrder=b)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:f}}function GS(o){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:n,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=De(),{getComponentState:l,componentActions:s,componentState:{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=je();NS(()=>{if(f!=="multi-column")return;let m=l(),g=Qf(u,o),h=Jf({computedGroupColumns:g,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:n,groupByMap:o});St(m.columnVisibility,h)||(s.columnVisibility=h)},[a,f,i,n,o,u,p?e:null,p?r:null,p?t:null,p]),To(()=>{let m=n.length>0,g=l(),{columnVisibility:h,columnVisibilityForGrouping:b,hideColumnWhenGrouped:T}=g,S={...h},C={...b},y=!1,v=new Set,w=new Set;Object.keys(u).forEach(I=>{let R=u[I];if(R.defaultHiddenWhenGroupedBy||T!=null)if(R.defaultHiddenWhenGroupedBy==="*"&&m||(R.defaultHiddenWhenGroupedBy===!0||T)&&R.field&&o.get(R.field)||typeof R.defaultHiddenWhenGroupedBy=="string"&&o.get(R.defaultHiddenWhenGroupedBy)||typeof R.defaultHiddenWhenGroupedBy=="object"&&Object.keys(R.defaultHiddenWhenGroupedBy).reduce((D,M)=>D||o.has(M),!1)){if(C[I]!==!1){if(h[I]===!1)return;C[I]=!1,y=!0,v.add(I)}}else C[I]===!1&&(delete C[I],y=!0,w.add(I))}),y&&(s.columnVisibilityForGrouping=C,w.forEach(I=>{delete S[I]}),v.forEach(I=>{S[I]=!1}),s.columnVisibility=S)},[u,c,n,o,d])}function HS(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=o;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(c==="multi-column")t.forEach((m,g,h)=>{let b=Rd({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:c,selectionMode:r},u,i),T=b.id||`group-by-${m.field||m.groupField}`;f.push(T),p[T]=b});else if(c==="single-column"&&t.length){let m=xd({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";f.push(g),p[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let h=d[g];h.field&&(m[h.field]=h)}),Object.keys(e).forEach(g=>{let h=e[g],b=h.pivotTotalColumn&&h.columnGroup,T=h.pivotTotalColumn&&!h.columnGroup;if(b&&a===!1||T&&l===!1)return;let S={...h};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:n,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=C=>S.renderValue(C)),p[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];p[m]=g});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}import{useMemo as KS}from"react";var tm=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:p,filterValue:f,filterTypes:m,columnOrder:g,columnPinning:h,editable:b,columnDefaultEditable:T,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:y,scrollbarWidth:v,columnTypes:w,pinnedEndMaxWidth:I,pinnedStartMaxWidth:R,viewportReservedWidth:x,resizableColumns:D,columnVisibility:M,columnVisibilityAssumeVisible:A,columnSizing:E,groupBy:_})=>{let{computedRemainingSpace:F,computedColumnOrder:N,computedVisibleColumns:G,computedVisibleColumnsMap:H,computedPinnedStartColumns:B,computedPinnedEndColumns:pe,computedUnpinnedColumns:de,computedPinnedStartColumnsWidth:k,computedPinnedEndColumnsWidth:W,computedUnpinnedColumnsWidth:se,computedUnpinnedOffset:ce,computedPinnedEndOffset:ie,computedPinnedEndWidth:oe,computedPinnedStartWidth:te,renderSelectionCheckBox:fe,computedColumnsMap:ne,computedColumnsMapInInitialOrder:V,fieldsToColumn:U}=KS(()=>Au({columns:o,scrollbarWidth:v,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:x,resizableColumns:D,filterValue:f,filterTypes:m,sortable:a,sortInfo:d,multiSort:p,pinnedEndMaxWidth:I,pinnedStartMaxWidth:R,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:h,columnDefaultEditable:T,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:y,editable:b,columnSizing:E,columnTypes:w,columnVisibility:M,columnVisibilityAssumeVisible:A??!0,groupBy:_}),[o,e.width,t,n,r,x,v,a,d,p,f,m,g,M,A,u,c,D,I,R,E,w,h,T,S,C,b,_,1]);return{renderSelectionCheckBox:fe,columns:o,computedColumnsMap:ne,computedPinnedEndWidth:oe,computedPinnedStartWidth:te,computedRemainingSpace:F,computedUnpinnedOffset:ce,computedPinnedEndOffset:ie,computedPinnedStartColumnsWidth:k,computedPinnedEndColumnsWidth:W,computedUnpinnedColumnsWidth:se,computedPinnedStartColumns:B,computedPinnedEndColumns:pe,computedUnpinnedColumns:de,computedVisibleColumns:G,computedVisibleColumnsMap:H,computedColumnOrder:N,computedColumnsMapInInitialOrder:V,fieldsToColumn:U}};import{useMemo as BS}from"react";var Jl=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function WS(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],p=d?n(d):0;return e&&e.rowHeight.set(u,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,m)),p+m}}function nm(o){return BS(()=>{let e=new Jl;return{computedRowHeight:WS(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}},[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}import{useState as jS,useEffect as $S,useLayoutEffect as US}from"react";var YS={vertical:!1,horizontal:!1};function om(o){let{getComponentState:e}=je(),{getState:t}=De(),[n,r]=jS(YS);return $S(()=>o.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=o;r({vertical:i>0,horizontal:a>0})}),[o]),US(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function rm(){let{componentActions:o,componentState:e}=je(),{componentActions:t,componentState:n,getState:r,api:i}=De(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:c,editable:u,columnDefaultEditable:d,columnDefaultFilterable:p,columnDefaultGroupable:f,columnTypes:m,rowHeight:g,rowDetailHeight:h,isRowDetailExpanded:b,isRowDetailEnabled:T,brain:S,bodySize:C,showSeparatePivotColumnForSingleAggregation:y}=e;es(()=>{e.onRowHeightCSSVarChange.onChange(Y=>{Y&&(o.rowHeight=Y)}),e.onFlashingDurationCSSVarChange.onChange(Y=>{let le=Y?Y*1:null;le!=null&&!isNaN(le)&&(o.flashingDurationCSSVarValue=le)}),e.onRowDetailHeightCSSVarChange.onChange(Y=>{Y&&(o.rowDetailHeight=Y)}),e.onColumnHeaderHeightCSSVarChange.onChange(Y=>{Y&&(o.columnHeaderHeight=Y)})}),qS(()=>{t.showSeparatePivotColumnForSingleAggregation=y},[y]);let{multiSort:v,filterValue:w,filterTypes:I,groupBy:R}=n,{toggleGroupRow:x}=em(),D=e.computedColumns,{computedColumnOrder:M,computedVisibleColumns:A,computedVisibleColumnsMap:E,computedPinnedStartColumns:_,computedPinnedEndColumns:P,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:N,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:H,computedUnpinnedOffset:B,computedPinnedEndOffset:pe,computedRemainingSpace:de,computedPinnedStartWidth:k,computedPinnedEndWidth:W,renderSelectionCheckBox:se,computedColumnsMap:ce,computedColumnsMapInInitialOrder:ie,fieldsToColumn:oe}=tm({columns:D,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:C,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:n.sortInfo??void 0,multiSort:v,groupBy:R,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:u,columnDefaultEditable:d,columnDefaultFilterable:p,columnDefaultGroupable:f,filterValue:w,filterTypes:I,columnSizing:c,columnTypes:m}),te=Gf(A),fe=Hf(A),ne=om(S),V=k?N>k:!1,U=W?G>W:!1,[O]=es(()=>new Li({isRowDisabledAt:le=>r().dataArray[le]?.rowDisabled??!1,getIdForIndex:le=>r().dataArray[le]?.id??-1})),re=ve(A),[j]=es(()=>new Ni({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:Y=>re()[Y]?.id||""})),{computedRowHeight:K,computedRowSizeCacheForDetails:ee}=nm({rowDetailHeight:h,rowHeight:g,isRowDetailsExpanded:b,isRowDetailsEnabled:T,getDataSourceState:r});return{multiRowSelector:O,multiCellSelector:j,computedRowSizeCacheForDetails:ee,computedRowHeight:K,scrollbars:ne,columnSize:fe,rowspan:te,toggleGroupRow:x,computedColumnsMap:ce,computedColumnsMapInInitialOrder:ie,renderSelectionCheckBox:se,computedPinnedStartOverflow:V,computedPinnedEndOverflow:U,computedPinnedStartWidth:k,computedPinnedEndWidth:W,computedVisibleColumns:A,computedColumnOrder:M,computedRemainingSpace:de,computedVisibleColumnsMap:E,computedPinnedStartColumns:_,computedPinnedEndColumns:P,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:N,computedPinnedEndColumnsWidth:G,computedUnpinnedColumnsWidth:H,computedUnpinnedOffset:B,computedPinnedEndOffset:pe,fieldsToColumn:oe}}import{useMemo as nC}from"react";function XS(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function ZS(){return 4294967295}function QS(o,e,t){return e=e>>>8^o[t^e&255],e}function JS(o){return o=~o,o=o<0?4294967295+o+1:o,o}function ts(o,e=3988292384){var t=XS(e),n=0,r;for(n=ZS(),r=0;r<o.length;r++)n=QS(t,n,o.charCodeAt(r));return n=JS(n),`${n}`}var eC=o=>{let e=o.reduce((n,r)=>(n.set(r.name,r.value),n),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},im=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+8,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},am=(o="",e,t)=>{let n;try{n=tC(o)}catch{return im(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(n.end);return i<r?(im([`
|
|
28
28
|
Your Infinite Table license has expired on ${i.toDateString()}.
|
|
29
|
-
`,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},tC=o=>{let e="",t=o.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if(ts(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(ts(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),eC(t)};var oC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,rC=/(https):\/\/\S+(\.csb\.app)/g,lm=typeof window<"u"?window.location.origin:"",iC=()=>{let[o,e,t]=Array.from(oC.exec(lm)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},aC=()=>{let[o,e,t]=Array.from(rC.exec(lm)||[]);return e==="https"&&t===".csb.app"},lC=aC()||iC(),sm=(o="")=>{let t=!!ke();return nC(()=>{if(t)return!0;let r=am(o,{publishedAt:1624970570587,version:"7.2.2"});return!o&&!r&&lC?!0:r},[o,t])};import{useRef as cm,useEffect as um}from"react";var sC=10;function dm(o,e,t){let n=cm(!1),r=cm(null);um(()=>{o!=null&&(n.current=!1,It(r.current))},[o]),um(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,It(r.current),r.current=Ae(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<sC&&a(l)})};var i=a;a()}return()=>{It(r.current)}},[o,e])}import{useRef as pm,useEffect as fm}from"react";var cC=10;function mm(o,e,t){let n=pm(!1),r=pm(null);fm(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),fm(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<cC&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}var gm=o=>`--infinite-${o}`;import{useCallback as TC,useMemo as SC,useEffect as CC}from"react";function hm(o,e){ns(o,e),dC(o,e),e.detail===2&&uC(o,e),o.getState().onCellClick?.(o,e)}function uC(o,e){let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function dC(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,b=new ze(u);b.debugId=m??"",d.cellSelectionState=b;let T={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(T);else if(e.shiftKey){let S=!!n().wrapRowsHorizontally;d.multiSelectClick(T,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:S})}else d.resetClick(T);l.cellSelection=b}function ns(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=n(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=u;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:h}=u;if(h=l(h),s.rowSelectionState=h,h&&typeof h=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=h,!0}else if(d==="single-row"){let b=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(b):a.rowSelectionApi.selectRow(b)}return!1}function bm(o,e){e.detail!==2&&void 0}var pC={Enter:!0," ":!0,a:!0};function ym(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:c,ctrlKey:u,metaKey:d}=e;if(!pC[c])return!1;let p=t(),f=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:h,keyboardSelection:b}=p,{selectionMode:T,groupBy:S,rowSelection:C,treeSelectionState:y,isTree:v}=f;if(b===!1)return!1;let w=h==="row"&&m!=null?m:h==="cell"&&g!=null?g[0]:null,I=w!=null?f.dataArray[w]:null;if(!I||w==null)return!1;if(T==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(I.id),!0;if(T!=="multi-row")return!1;if(c==="a"&&(u||d)){if(v&&y){let x=s(y);return x.selectAll(),r.treeSelection=x,!0}let R=l(C);return R.selectAll(),r.rowSelection=R,!0}if(c===" "){if(S.length)return I.isGroupRow&&I.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(I.groupKeys):i.rowSelectionApi.toggleRowSelection(I.id),!0;if(v){if(I.isTreeNode&&I.nodePath)return a.treeApi.toggleNodeSelection(I.nodePath),!0}else{let R={...e},{renderSelectionCheckBox:x}=o.getComputed();return x&&(R.metaKey=!1,R.ctrlKey=!0),ns({...o,rowIndex:w},R)}}return!1}var Tm=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Sm=o=>Array.from(o.querySelectorAll(Tm)).filter(t=>!!t.offsetParent),zi=o=>o.querySelector(Tm);var wm=Wn(Tn());async function Cm(o,e=10,t=300){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})}var fC=10,mC=(o,e)=>o-e;function Vi(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=c[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=et(p.id,e);return p.contentFocusable({column:p,...ao({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function os(o,e,t){let n=t.getState().editingCell;return gC(o,e,t,{isCellFocusable:Vi,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function Im(o,e,t){let n=(0,wm.default)(t,o+e,mC);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=Im;function gC(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:Im(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function vm(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=Vi(e,o)?e:os(e,-1,o);if(t){await rs([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;zi(n)?.focus()}}async function rs([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=fC,l=null,s=!1;function c(u=0){u++,It(l),l=Ae(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await Cm(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var hC=`.${_n}`;function Rm(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:tn(n,hC),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=o.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&Vi({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:os({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=Sm(document.body),d=o.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return rs([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;zi(u)?.focus()}),!0}var xm={control:"ctrl"},Dm={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},bC={esc:"escape"},Em={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Mm=Object.keys(Em),is=new Set(Mm),yC=new Set(["shift","alt"]);function as(o,e){return Array.isArray(e)?e.some(t=>Pm(o,t)):Pm(o,e)}function Pm(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>Dm[p]),i=n.map(p=>xm[p]||Dm[p]||bC[p]||p),a=i.filter(p=>is.has(p)),l=i.filter(p=>!is.has(p)),s=Mm.reduce((p,f)=>(p[f]=Em[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!yC.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||is.has(t)||t==="meta"||xm[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function Am(o,e){let t={...o,cloneRowSelection:a=>Ti(a,o.getDataSourceState),cloneTreeSelection:a=>Ii(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&ym(t,e)&&e.preventDefault(),(Rm(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&Df(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,c=o.getComputed().computedVisibleColumns[s];c.computedEditable&&o.api.startEdit({rowIndex:l,columnId:c.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!as(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function wC(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=Q(),{getState:i,componentActions:a,api:l}=De();return SC(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>Ii(u,i),cloneRowSelection:u=>Ti(u,i)}),[o,e,i,a,t,l,n])}function IC(){let o=wC();CC(()=>{let e=o.getState().keyDown.onChange(a=>{Am(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=et(s.id,o);hm({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=o.getComputed().computedVisibleColumns[c],d=et(u.id,o);bm({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function vC(){let{getState:o}=Q();return{onKeyDown:TC(t=>{o().keyDown(t)},[])}}function _m(){return IC(),vC()}import{useEffect as eg}from"react";import*as Oe from"react";import{useCallback as ss,useEffect as RC,useLayoutEffect as xC,useState as Hi}from"react";import{createPortal as DC}from"react-dom";function ls(o){return!!o.tagName}function Nm(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Se.from(ls(e)?e.getBoundingClientRect():e),a=Se.from(ls(t)?t.getBoundingClientRect():t),l=n?Se.from(ls(n)?n.getBoundingClientRect():n):null;if(!l)return{...Fm({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=Fm({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function Fm(o){let e=Se.from(o.targetRect),t=Se.from(o.anchorRect),n=o.constrainRect?Se.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Om(e,i),s=Om(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function Om(o,e){return e==="TopLeft"?Ne.from({top:o.top,left:o.left}):e==="TopCenter"?Ne.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Ne.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Ne.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Ne.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Ne.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Ne.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Ne.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Ne.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}var Gi="__is_infinite_menu_component";function PC(o){return o&&typeof o.then=="function"||o instanceof Promise}function zm(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Lm(o){return typeof o=="function"&&(o=o()),PC(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&zm(o)&&(o=o.getBoundingClientRect()),o?Se.from(o):null}async function EC(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),zm(n)&&(r=n),r||null}return t(await e)}function MC(o){return Oe.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function AC(o){let e=Oe.useRef(null);return RC(()=>o.realign.onChange(t=>{e.current&&t&&km(e.current,t)}),[o.realign]),Oe.createElement("div",{style:{position:"absolute",top:0,left:0},ref:ss(t=>{t&&km(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}async function km(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Lm(t)||void 0,a=n?await Lm(n):void 0,l=Se.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Nm({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function _C(o,e){let[t,n]=Hi(null);return xC(()=>{async function r(){let i=e?await EC(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?DC(o,t):Oe.createElement(Oe.Fragment,null):e===null||e===!1?o:Oe.createElement(MC,null,o)}function FC(o){if(Oe.Children.count(o)===1){let e=Oe.Children.only(o);if(Oe.isValidElement(e))return e.props.id||e.key}return null}function OC(o,e,t){if(Oe.Children.count(o)===1){let n=Oe.Children.only(o);if(Oe.isValidElement(n)&&n.type[Gi]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Oe.cloneElement(n,r)}}return o}globalThis.allhandles={};globalThis.thehandles={};function qt(o){let e=o,[t]=Hi(()=>new Map),[n,r]=Hi(null),[i,a]=Hi(0),l=ss(()=>{let m=[];for(let[g,h]of t)m.push(Oe.createElement(AC,{...h,key:h.key}));return m},[]),[s,c]=_t(),u=_C(l(),o.portalContainer),d=ss((m,g)=>{let b=`${g.id||FC(m)||xt()}`,T=t.get(b),S=v=>()=>{let w=typeof v=="function"?v():v;return OC(w,e.portalContainer,g.constrainTo??e.constrainTo)},C=S(m),y=(v,w)=>{if(!T)return;let I=S(v);Object.assign(T,{children:I}),c(),!!!w?.skipRealign&&(r(T.key),a(Date.now()))};return T?(Object.assign(T,g),y(m),y):(T={key:b,children:C,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:ge()},t.set(T.key,T),c(),y)},[t,e.portalContainer,c]);Oe.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},f=()=>{t.clear(),c()};return Oe.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}import*as Qm from"react";import*as Co from"react";import*as So from"react";import*as sr from"react";function Ki(o){return null}Ki.defaultProps={__is_menu_item:!0};var Vm="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Gm=ue({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),Hm="db3arf1",Km="db3arfd";var NC="-";function LC(){return sr.createElement("hr",{className:Km})}var Bi=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===NC?sr.createElement(LC,null):r:null;return i!=null?{type:"item",parentMenuId:n,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}};function Bm(o,e){return sr.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Ki)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Bi(o,n)}return Bi(o,t)})||[]}var Wm="submenu";function jm(){let o=So.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:xt(),focused:!1,destroyed:!1,domRef:o}}var $m=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),kC=[{name:"label"}],Um=o=>{let{props:e,state:t}=o,{activeItemKey:n,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||kC],d={columns:u,keyboardActiveItemKey:r,activeItemKey:n,menuId:c},p=[];i?p=i.map(Bi.bind(null,d)):!i&&typeof a!="function"&&(p=Bm(d,a)),l&&p.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==Wm)&&u.push({name:Wm,render:({domProps:g,item:h})=>h.menu?So.createElement("div",{...g},So.createElement(Mn,{expanded:!1})):So.createElement("div",{...g})});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:u,menuId:c}};import*as Pt from"react";import{useCallback as Gn,useLayoutEffect as $C,useRef as UC,useState as ds}from"react";var cr=class extends ro{constructor(e){super(e.slice(0,3))}};var zC=250;function VC(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}Ae(i)};Ae(()=>{i()})})}var GC=we(),Wi=class{constructor(e){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||zC;this.getPointerMoveTarget=()=>document.documentElement||GC;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=e=>{if(clearTimeout(this.mouseMoveTimeoutId),!e){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let t=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=t);let r=t-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=t;let i=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e)};if(r){i();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&i()},this.getTimeout());let l=new Ne({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new cr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new cr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(e,t)=>{if(e!==this.activeItem){if(e==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=e,this.params.onItemActivate(e,t),this.activeItemMenuRect=null,VC(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Ne({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};import{createContext as HC,useContext as KC}from"react";var cs=HC(null);function us(){return KC(cs)}import{useCallback as BC,useEffect as WC,useRef as jC}from"react";function Ym(){let o=jC(!0);return WC(()=>(o.current=!0,()=>{o.current=!1}),[]),BC(()=>o.current,[])}function YC(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=o.menu;return u?(typeof u=="function"&&(u=u()),Pt.createElement(Lt,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),n(p)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function qC(o,e){let t=qm(o,e);if(!t.length)return null;let n=Se.from(t[0]?.getBoundingClientRect()),r=Se.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function qm(o,e){let t=tn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function XC(o,e){let t=qm(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}function ZC({onItemActivate:o}){let{getState:e}=us(),[{onItemEnter:t,onItemLeave:n}]=ds(()=>new Wi({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?Se.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:Gn(t,[]),onItemLeave:Gn(n,[])}}function Xm(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:b}=us(),T=Gn(k=>{h.keyboardActiveItemKey=k},[]),S=Gn(k=>{h.activeItemKey=k},[]),C=Ym(),[y,v]=ds(null),w=null;$C(()=>{let{runtimeItems:k}=b(),W=k.filter(se=>se.type==="item"&&i===se.key)[0];if(!W||!W.menu){v(null),D();return}if(W){let se=qC(r,W.key);se&&R(()=>YC(W,{constrainTo:l,setSubmenuApi:v,setActiveItemKey:S,setKeyboardActiveItemKey:T,parentMenuId:r,onHideIntent:H,api:B}),{id:`${r}-submenu`,alignTo:se,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let I=(k,W)=>{T(W.key),S(W.key),W.originalMenuItem.onClick&&W.originalMenuItem.onClick(k);let se={key:W.key,item:W.originalMenuItem,hideMenu:H};W.originalMenuItem.onAction&&W.originalMenuItem.onAction(se),c&&c(se),W.originalMenuItem.hideMenuOnAction&&H()},{showOverlay:R,portal:x,clearAll:D}=qt({portalContainer:!1}),{onItemEnter:M,onItemLeave:A}=ZC({onItemActivate:k=>{if(!C())return;let W=k?k.key:null;S(W)}});w=n.map((k,W)=>Pt.createElement(QC,{key:k.type==="item"?k.key:W,onItemEnter:(se,ce)=>{M(se.key,ce)},onItemLeave:(se,ce)=>{A(se.key,ce)},columns:t,active:k.type==="item"&&k.key===i,keyboardActive:k.type==="item"&&k.key===a,item:k,index:W,onClick:I}));let E=t.map(k=>k.width||(typeof k.flex=="number"?`${k.flex}fr`:k.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:E,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function P(k){let{runtimeItems:W,runtimeSelectableItems:se}=b(),ce=W.findIndex(ne=>ne.type==="item"&&ne.key===a),ie=a,oe=W[ce],te={ArrowUp:()=>{let ne=W.slice(0,ce).filter(V=>V.type==="item"&&!V.disabled).pop();ne&&ne.type==="item"&&ne.key&&(ie=ne.key)},ArrowDown:()=>{let ne=W.slice(ce+1).filter(V=>V.type==="item"&&!V.disabled)[0];ne&&ne.type==="item"&&ne.key&&(ie=ne.key)},Home:()=>{te.PageUp()},End:()=>{te.PageDown()},PageUp:()=>{ie=se[0].key},PageDown:()=>{ie=se[se.length-1].key},ArrowLeft:()=>{S(null),b().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{oe&&(S(oe.key),Ae(()=>{C()&&y&&y.getParentMenuId()===b().menuId&&y.focus()}))},Enter:()=>{if(oe)if(oe.originalMenuItem?.menu){if(oe&&oe.originalMenuItem.menu&&y){te.ArrowLeft();return}oe&&S(oe.key)}else I(k,oe)}," ":()=>{if(!oe)return;oe.originalMenuItem.menu||I(k,oe);let ne=XC(r,oe.key);ne&&ne.click()},Escape:()=>{te.ArrowLeft();let ne=b();ne.parentMenuId||ne.onHideIntent?.(ne)}},fe=te[k.key];fe&&(fe(),k.preventDefault()),ie!=a&&T(ie)}function F(){h.focused=!1}let N=Gn(function(){h.focused=!0,setTimeout(()=>{G.current&&g.current&&g.current===document.activeElement&&b().keyboardActiveItemKey==null&&T(b().runtimeSelectableItems[0]?.key??null)})},[]),G=UC(!0),H=Gn(()=>{let k=b();k.onHideIntent?.(k)},[b]),[B]=ds(()=>({hideMenu:H,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),N())},getMenuId:()=>b().menuId,getParentMenuId:()=>b().parentMenuId})),pe=Gn(k=>{k?(g.current=k,d?.(b(),B),f&&B.focus()):(p?.(b()),g.current=k)},[]),de=Pt.createElement("div",{className:Zn.contents},Pt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:pe,onKeyDown:k=>{e.onKeyDown?.(k),P(k)},onMouseDown:k=>{G.current=!1,e.onMouseDown?.(k)},onMouseUp:k=>{G.current=!0,e.onMouseUp?.(k)},onFocus:N,onBlur:F,className:Z(Vm,e.className,"InfiniteMenu"),style:_},w),x);return s?null:de}function QC(o){let[e,t]=Pt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=Pt.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<u)return null;u=h;let T={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:h},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:Z(Gm({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:S=>{r.disabled||o.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||o.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||o.onClick(S,r)}};return d.render?Pt.createElement($o,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:T}}):Pt.createElement("div",{key:`${s}-${m}`,...T},f[m])}).filter(Boolean)}return Pt.createElement("div",{className:Hm},c)}var{ManagedComponentContextProvider:JC}=vt({initSetupState:jm,forwardProps:$m,mapPropsToState:Um,layoutEffect:!0});function ew(o){let{componentActions:e,componentState:t}=je(),n=ve(t);return Co.createElement(cs.Provider,{value:{componentActions:e,componentState:t,getState:n}},Co.createElement(Xm,{domProps:o.domProps}))}function Lt(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:b,...T}=o;return Co.createElement(JC,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},Co.createElement(ew,{domProps:T}))}Lt[Gi]=!0;import*as ps from"react";function Zm(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a}=e,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=Rn(p,e,"column-menu");u.push({key:f,label:m,check:ps.createElement(Ht,{key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let h=!!g;i.setVisibilityForColumn(p.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=Rn(p,e,"column-menu");u.push({key:f,label:m,check:ps.createElement(Ht,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Jm(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Lt,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:et(s.id,e),...e},u=Zm([],c),d=a?a(u,c):u,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:Qm.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var tw=`[${bl["data-name"]}="${yl["data-name"]}"]`;function nw(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){n(),a.columnMenuVisibleForColumnId=null}let u=o.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${yp["data-column-id"]}="${e}"] ${tw}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Jm(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function tg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});eg(()=>{let{actions:c,getState:u}=o,d=u();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,c.contextMenuVisibleFor=null,c.cellContextMenuVisibleFor=null,c.filterOperatorMenuVisibleForColumnId=null,c.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return eg(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=t();if(c){let p=function(f){f.__insideMenu!==!0&&(a(),n.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),nw({columnId:c,context:o,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else u.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}import*as ng from"react";import{useCallback as ow}from"react";var rw={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function og(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=Q(),{getState:a,getDataSourceMasterContext:l}=De(),{focusDetectDOMRef:s}=o(),c=ow(async()=>{vm({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return ng.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:rw})}import{useEffect as ur}from"react";function iw(){let o=Q(),{getState:e}=o,{editingCell:t}=e(),n=t&&!t.active?t.cancelled:void 0;ur(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...ft({rowIndex:r,columnId:i,...o}),initialValue:a})}},[n])}function aw(){let o=Q(),{getState:e,state:{editingCell:t}}=o,n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;ur(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...ft({rowIndex:r,columnId:i,...o}),value:a,error:n,initialValue:l})}},[n])}function lw(){let o=Q(),{state:{editingCell:e}}=o,t=e?.active,n=In(t);ur(()=>{!t&&n&&o.api.focus()},[t,n])}function sw(){let o=Q(),{state:{editingCell:e},getState:t}=o,n=e&&!e.active&&!e.cancelled&&e.accepted===!0;ur(()=>{if(n){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...ft({rowIndex:a,columnId:l,...o}),value:i,initialValue:s};t().onEditAccepted?.(c),o.api.persistEdit({value:i})}},[n])}function cw(){let o=Q(),{state:{editingCell:e},getState:t}=o,n=e?e.persisted:void 0;ur(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...ft({rowIndex:l,columnId:s,...o}),value:c,initialValue:u};n instanceof Error?i?.({...d,error:n}):a?.(d)}},[n])}function rg(){iw(),aw(),sw(),cw(),lw()}import{useEffect as lg}from"react";import*as hn from"react";import*as fs from"react";var ji=o=>fs.createElement(_e,{...o},fs.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));import*as ms from"react";var ig=o=>ms.createElement(_e,{...o},ms.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function ag(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),p=u?.Menu??Lt,f=n().computedColumnsMap.get(o);if(!f)return null;let m=w=>{w.__insideMenu=!0},g=w=>{w.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),b=h[f.computedFilterType];if(!b)return null;let T=b.operators.map(w=>{let I=w.name,R=f.computedFilterValue?f.computedFilterValue.filter.operator===I:I===b.defaultOperator,x=w.components?.Icon??eo;return{key:I,icon:hn.createElement(x,null),label:hn.createElement(hn.Fragment,null,w.label??w.name),onAction:()=>{c.setColumnFilterOperator(o,I)},checked:R?hn.createElement(ig,{size:16}):null}}),C=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:hn.createElement(ji,null),disabled:!f.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...T],y={column:f,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},v=d?d(C,y):C;return hn.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:v,onShow:w=>{w.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:w=>{g(w),t?.()}})}var $i=10;function sg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return lg(()=>{let{actions:l,getState:s}=o;return s().onFilterOperatorMenuClick.onChange(u=>{if(!u)return;let{target:d,column:p}=u;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,g=Se.from(m.getBoundingClientRect());g.top-=$i,g.left-=$i,g.width+=2*$i,g.height+=2*$i,r(()=>ag(p.id,o,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:g,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),lg(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as Yi}from"react";import*as ys from"react";import*as gs from"react";function Ui(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function hs(o){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),o.onHideIntent?.()}}}function bs(o,e,t){if(!o)return null;let n=ge();return o.then(r=>{let{items:i,columns:a}=Ui(r);i&&i.length&&n(gs.createElement(t,{...e,items:i||[],columns:a}))}),gs.createElement(en,{updater:n})}function cg(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Lt,{computedColumnsMap:d}=a(),p=d.get(n),f={...ft({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!c)return{cellContext:f,menu:null,preventDefault:!1};let m=hs({onHideIntent:t}),g=c(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:bs(g,m,u),preventDefault:h};let{items:b,columns:T}=Ui(g);return!b||!b.length?{cellContext:f,menu:null,preventDefault:Array.isArray(b)}:{preventDefault:h,menu:ys.createElement(u,{...m,columns:T,items:b}),cellContext:f}}function ug(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??Lt,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...ft({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=hs({onHideIntent:t}),p=a(u,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:u,menu:bs(p,d,l),preventDefault:f};let{items:m,columns:g}=Ui(p);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:ys.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var qi=5,dg=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function pg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Yi(()=>{let{actions:l,getState:s,getDataSourceState:c}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:h}=cg(d,o,f),b=Se.fromPoint({top:p.clientY,left:p.clientX});b.width+=qi,b.height+=qi,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:b,alignPosition:dg}),h&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:T}=s();T&&T({...g,getState:s,getDataSourceState:c},p)})},[]),Yi(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function fg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Yi(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=ug(u,o,p),h={top:d.clientY,left:d.clientX},b=Se.fromPoint(h);b.width+=qi,b.height+=qi,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:b,alignPosition:dg}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:h,...u};let{onContextMenu:T}=s();T&&T({...o,...m},d)})},[]),Yi(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as pw}from"react";import*as mg from"react";import{useCallback as uw,useEffect as dw}from"react";function Ts(o,e){let{state:{brain:t}}=Q(),n=uw(o,e);dw(()=>t.onScroll(n),[t,n])}var Ss="yzx0vj0";function gg(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=pw(null);Ts(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=ae.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ae.runtime.bodyWidth),n==="column"?l.minWidth=ae.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=ae.runtime.bodyWidth),t==="column"?l.maxWidth=ae.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ae.runtime.bodyWidth),mg.createElement("div",{ref:a,...i,className:i.className?Z(i.className,Ss):Ss,style:l},i.children)}var fw=q($.columnWidthAtIndex),mw=q($.columnOffsetAtIndex);function gw(){return Q().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${fw}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${mw}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Xi="InfiniteTable";import{useEffect as hw}from"react";function hg(){let{state:o,getState:e,actions:t}=Q(),{wrapRowsHorizontally:n}=o,r=In(n);hw(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Zl(Xi,!!n);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,n])}import{useEffect as bw}from"react";function bg(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=Q(),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),bw(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,b=(r&&r.length>0||i)&&h>0?h:null;return f!=b&&(t.rowsPerPage=b,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}import{useEffect as Zi,useRef as yw}from"react";var dr=ue({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),yg="_143ofgf5",Tg="_143ofgf3";var Tw=q(ae.loaded),Cs={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Sg(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...Cs,url:ws(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Cs,url:ws(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var ws=Qe(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function Sw(o){window.postMessage(o)}var Cw=Qe(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){Ct.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(Sg({type:"update",debugId:e},t))}else nf(e),window.postMessage(Sg({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Be.onLogIntent("*",e=>{Sw({...Cs,url:ws(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>typeof t=="object"&&t!==null?JSON.stringify(t):String(t)),timestamp:e.timestamp}})}),o});function Cg(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=Q(),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(Tw)!==`${tc}`&&tr({debugId:i,key:"CSS001_CSS"}),Zi(()=>{e().debugId!==i&&(t.debugId=i)},[i]),vw()}var Qi=ge(),ww={revertAll:o=>{let e=Ct.get(o.debugId);if(e){let t=mn.get(o.debugId);mn.delete(o.debugId),jt.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Ut.get(o.debugId);Ut.delete(o.debugId),$t.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=Ct.get(o.debugId);if(e){let t=o.property,n=jt.get(o.debugId),r=mn.get(o.debugId),i=$t.get(o.debugId),a=Ut.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=Ut.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=Ct.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),nr(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),nr(o.debugId))}}},discardAllWarnings:o=>{let e=Ct.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),nr(o.debugId))},setColumnVisibility:o=>{Gl(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{Di(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{Gl(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{Di(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{Di(o.debugId,"multiSort",o.multiSort)},highlight:o=>{let e=Ct.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${dr.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(dr.classNames.base),r.innerHTML=[`<div class="${Tg}"></div>`,`<div class="${yg}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(dr.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(dr.classNames.variants.active.true)}}}}};function Iw(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(Cw(),Qi(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=ww[e];t&&t(o.data.payload)}})}Iw();function vw(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=Q(),s=o().debugId,c=yw(s);return c.current=s,Zi(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=Qi.get();if(p){d(p);return}return Qi.onChange(f=>{f&&d(f)})},[]),Zi(()=>{let u=c.current;if(!u)return;let d=Qi.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),Zi(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function Rw(){let o=ke(),e=o?o.getMasterState():null,t=Q().getState();return(e||t).portalDOMRef.current}import*as ht from"react";import{useCallback as xw}from"react";var wg="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Ig=ue({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),vg="hs68h81",Rg=ue({defaultClassName:"hs68h80 _16lm1iw1p",variantClassNames:{orientation:{horizontal:"_16lm1iw2h _16lm1iw2j",vertical:"_16lm1iw2f"},draggingInProgress:{true:"_16lm1iw1h",false:"hs68h86"},dropRejected:{true:"hs68h87",false:"hs68h88"},active:{true:"hs68h89",false:"hs68h8a"}},defaultVariants:{},compoundVariants:[[{dropRejected:!0,active:!0},"hs68h8b"],[{dropRejected:!1,active:!0},"hs68h8c"],[{active:!1,dropRejected:!1},"hs68h8d"]]});import*as Hn from"react";function xg(o){return Hn.createElement("div",{...o.domProps})}function Dg(o){let{active:e}=o;return Hn.createElement("div",{className:vg},e?"Drop to group":"Drag columns to group")}function Pg(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return Hn.createElement("div",{...o.domProps},o.label,Hn.createElement("div",{className:Hr[1]}),Hn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:wg,onKeyDown:e,onMouseDown:o.onClear},Hn.createElement(ji,{size:20})))}var Dw=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};we().addEventListener("mousemove",i,{once:!0}),we().addEventListener("mouseup",()=>{r||(we().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function Pw(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=qo(),c=l===wo,u=Q(),d=(e?Rn(e.id,u,"grouping-toolbar"):r)??i,p=e?ht.createElement(si,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=ht.createElement(ht.Fragment,null,d,p),m=s===i&&l===wo,g=Z(Ig({draggingInProgress:c,active:m}),o.domProps?.className),h=Dw(a,o.domProps?.onMouseDown),b={...o.domProps,className:g,onMouseDown:h},T=n?.ToolbarItem??Pg;return ht.createElement(T,{active:m,domProps:b,column:e,field:r,label:f,onClear:t})}var wo="grouping-toolbar";function Eg(o){let{groupBy:e}=Jt(),{getComputed:t,dataSourceApi:n,api:r}=Q(),{dropTargetListId:i,dragSourceListId:a}=Pn(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===wo,u=a===wo,d=o.components?.Placeholder??Dg,p=o.components?.Host??xg,f=e.length?ht.createElement(ht.Fragment,null,e.map((S,C)=>{let y=S.field?l.get(S.field):void 0,v=`${S.field??`idx-${C}`}`;return ht.createElement(Nn.DraggableItem,{key:v,id:v},w=>ht.createElement(Pw,{id:v,components:o.components,domProps:w,field:S.field,column:y,toggleSorting:()=>{y&&r.toggleSortingForColumn(y.id)},onClear:()=>{let I=e.filter(R=>R!==S).filter(Boolean);n.setGroupBy(I)}}))})):ht.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let C=S.map(y=>e[y]);n.setGroupBy(C)},g=S=>{let{dragItemId:C}=S,y=C,v=s.get(y);if(!v||!v.field||!v.computedGroupable)return;let w=[...e];w.splice(S.dropIndex,0,{field:v.field}),n.setGroupBy(w)},h=xw(S=>{let{computedColumnsMap:C}=t(),y=S.dragItem.id,v=C.get(y);return!(!v||!v.computedGroupable||e.some(w=>w.field===v.field))},[e]),b=o.orientation??"horizontal",{domProps:T}=o;return ht.createElement(Nn,{orientation:b,dragListId:wo,acceptDropsFrom:["header",wo],onDrop:m,onAcceptDrop:g,shouldAcceptDrop:h},(S,{draggingInProgress:C,status:y})=>{let v=Z(Rg({active:c,orientation:b,draggingInProgress:C,dropRejected:y==="rejected"}),S.className,T?.className),w={...S,...T,className:v,children:f};return ht.createElement(p,{active:c,rejectDrop:y==="rejected",domProps:w,orientation:b})})}var Gt=Me.rootClassName,Ew=[wd,"InfiniteColumnCell--hovered"],{ManagedComponentContextProvider:Mw}=vt({initSetupState:$f,forwardProps:Uf,mapPropsToState:Zf,cleanup:Yf,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Xf(),getParentState:()=>Jt(),debugName:o=>nn(o.debugId,Xi)}),Mg=Z(Vu,cl);function Aw(o){return be.createElement("div",{...o,className:o.className?Z(Mg,o.className):Mg})}function Ag(){let o=Q(),e=ke(),{state:t,getComputed:n,api:r}=o,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,scrollStopDelay:d,brain:p,scrollerDOMRef:f,components:m,bodySize:g,activeCellIndex:h,rowDetailRenderer:b,showHoverRows:T,wrapRowsHorizontally:S,domProps:C,domRef:y}=t,v=m?.LoadMask??mi,w=n(),{computedRowHeight:I,computedRowSizeCacheForDetails:R}=w,x=R?.getRowHeight||I,{componentState:{loading:D}}=De(),M=be.useCallback(F=>{let N=o.getState(),G=F.target;if(!e&&F._from_row_detail)return;e&&(F._from_row_detail=!0);let H=ec(G,Xl(),N.domRef.current),B,pe,de,k;H&&(pe=Number(H.dataset.colIndex),k=Number(H.dataset.rowIndex),B=o.getComputed().computedVisibleColumns[pe].id,de=o.dataSourceApi.getRowInfoArray()[k].id);let W={columnId:B,colIndex:pe,rowId:de,rowIndex:k,event:F,target:H??F.target};H&&N.cellContextMenu(W),N.contextMenu(W)},[]),{renderCell:A,renderDetailRow:E}=zf({imperativeApi:r,getComputed:n,domRef:y,bodySize:g,computed:w}),{autoFocus:_,tabIndex:P}=C??{};return hg(),be.createElement(Aw,{onContextMenu:M},be.createElement(Ac,{forceRerenderTimestamp:t.forceBodyRerenderTimestamp,debugId:l,tabIndex:P??0,autoFocus:_??void 0,activeRowIndex:t.ready&&s==="row"?c:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?h:null,scrollStopDelay:d,renderer:i,wrapRowsHorizontally:S,onRenderUpdater:a,brain:p,activeCellRowHeight:x,renderCell:A,renderDetailRow:b?E:void 0,cellHoverClassNames:T?Ew:void 0,scrollerDOMRef:f,scrollVarHostRef:y}),be.createElement(v,{visible:D},u))}var _w=be.memo(function(){let e=Q(),t=ke(),{state:n,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=De(),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:b,scrollStopDelay:T,brain:S,activeRowIndex:C,activeCellIndex:y}=n,{licenseKey:v}=n;!v&&Xt.licenseKey&&(v=Xt.licenseKey),mm(C,a.length,r),dm(y,a.length,r);let{onKeyDown:w}=_m();be.useEffect(()=>{let G=l(),H=zt(B=>{G.notifyRenderRangeChange({renderStartIndex:B[0],renderEndIndex:B[1]})},{wait:T});return S.onVerticalRenderRangeChange(H)},[S,T]);let I=sm(v),{autoFocus:R,tabIndex:x,...D}=n.domProps??{},M=Zu(D);be.useEffect(()=>{S.setScrollStopDelay(T),s.scrollStopDelayUpdatedByTable=T},[T]),_f(),bg(),rg();let{menuPortal:A}=tg(),{menuPortal:E}=pg(),{menuPortal:_}=fg(),{menuPortal:P}=sg();be.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(n.id,n.ready,e.api,e)},[n.ready]);let F=Cg();be.useEffect(()=>{t&&(u.current=t.getMasterState().portalDOMRef.current)},[]);let N=i??be.createElement(be.Fragment,null,be.createElement(Rl,null),be.createElement(Ag,null));return be.createElement("div",{"data-debug-id":F,onKeyDown:w,ref:c,...M},N,be.createElement("div",{ref:u,className:Z(`${Je}Portal`,Uc[1e7],Kr.absolute,Wc[0],Hc[0])},A,E,_,P),g?be.createElement(Mo,{key:"row-height",varName:g,onChange:d}):null,be.createElement(Mo,{key:"flashing-duration",allowInts:!0,varName:ae.components.Cell.flashingDuration,onChange:p}),h?be.createElement(Mo,{key:"row-detail-height",varName:h,onChange:f}):null,b?be.createElement(Mo,{key:"column-header-height",varName:b,onChange:m}):null,I?null:be.createElement(wp,null),be.createElement(og,null))});function Fw({children:o}){let{componentActions:e,componentState:t}=je(),{scrollerDOMRef:n,scrollTopKey:r}=t,i=rm(),a=ve(i),l=ve(t),s=ke(),{getState:c,componentActions:u,getDataSourceMasterContext:d,api:p}=De(),[f]=be.useState(()=>Mf({getComputed:a,getState:l,getDataSourceState:c,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:u})),m={actions:e,state:t,computed:i,dataSourceActions:u,getDataSourceMasterContext:d,getDataSourceState:c,getComputed:a,getState:l,api:f,dataSourceApi:p,children:o};Tr(n,h=>{let b={width:h.width,height:h.height};e.bodySize=b},{earlyAttach:!0,debounce:50}),be.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[r,n]);let g=Qn();return be.createElement(g.Provider,{value:m},be.createElement(_w,null))}var Ow=40,Nw=gm(nc),Xt=function(o){return be.createElement(Mw,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:Ow,columnHeaderHeight:Nw,...o},be.createElement(sl,null,be.createElement(Fw,{children:o.children})))};Xt.Header=Rl;Xt.Body=Ag;Xt.HScrollSyncContent=gg;Xt.Footer=()=>be.createElement(qc,null);Xt.GroupingToolbar=Eg;import*as _g from"react";function RW(o){let{DataSource:e}=or({nodesKey:"children",...o});return _g.createElement(e,null,o.children??null)}import*as Fg from"react";function Lw(o){return Fg.createElement(Xt,{...o})}var Ji=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,n(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Be(`${e}:DataQuery`)}};function Io(o){if(Array.isArray(o))return o.map(Io);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=Io(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var Zt=class Zt{constructor(e){this.queryCache=new J;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Io(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new Ji(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Io(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Io(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Io(e);this.queryCache.delete(t)};if(this.options=e,Zt.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}Zt.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Zt.clients.get(e);t&&t.destroy()}static destroyAll(){Zt.clients.forEach(e=>{Zt.destroy(e.name)})}destroy(){Zt.clients.delete(this.options.name)}};Zt.clients=new Map;var Og=Zt;var kw={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},zw={instantEdit:kw};import{useEffect as UW}from"react";function Vw(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var ea=class ea{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ea.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};ea.DEFAULT_SIZE=10;var Is=ea;var ta=class ta{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ta.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};ta.DEFAULT_SIZE=10;var vs=ta;import{useEffect as Gw,useRef as na}from"react";var Hw=(o,e)=>o.every((t,n)=>t===e[n]),Kw=(o,e)=>{let t=na(e),n=Hw(e,t.current),r=na(!0);t.current=e;let i=na(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=na(o);l.current=o,Gw(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as Bw,useRef as pr}from"react";var Ng=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),Rs=(o,e)=>{let{same:t,different:n,compare:r}=e,i=pr(t),a=pr(n),l=Ng(t,i.current,r),s=!Ng(n,a.current,r),c=pr(!0);i.current=t,a.current=n;let u=pr(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=pr(o);p.current=o,l&&s&&(c.current=!1),Bw(()=>{if(!c.current)return p.current()},d)};import*as bt from"react";var Lg=q($.currentFlashingDuration),Ww=({children:o})=>bt.createElement(bt.Fragment,null,o),kg=1e3,zg={up:Lr({direction:"up"}).split(" "),down:Lr({direction:"down"}).split(" "),neutral:Lr({direction:"neutral"}).split(" ")},Vg=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=Ww}=o;return bt.forwardRef((i,a)=>{let l=ai(),{state:{flashingDurationCSSVarValue:s}}=Q(),c=typeof s=="number"?s??e??kg:e??kg,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,b=bt.useRef(!0),T=bt.useRef(d),S=b.current?null:T.current;b.current=!1;let C=bt.useRef(void 0),y=bt.useRef(void 0),v=bt.useRef(void 0);return Rs(()=>{if(d===T.current)return;let w=()=>{let D=m.current;if(C.current&&(clearTimeout(C.current),C.current=void 0),v.current&&(clearTimeout(v.current),v.current=void 0),y.current&&D){let M=y.current,A=zg[M];D.classList.remove(...t?[t,...A]:A),D.style.removeProperty(Lg),y.current=void 0}};T.current=d;let I=m.current;if(!I)return;w();let R=typeof d=="number"?d>S?"up":"down":"neutral",x=zg[R];return I.style.setProperty(Lg,`${c}`),I.classList.add(...t?[t,...x]:x),y.current=R,C.current=setTimeout(w,c),w},{same:[h,g],different:[d]}),bt.createElement("div",{ref:u,...i,className:Z(i.className)},n({children:i.children,oldValue:S}))})},jw=Vg();var b6={CheckBox:Ht,LoadMask:mi,MenuIcon:Uo,StringFilterEditor:no,NumberFilterEditor:Zr};export{ze as CellSelectionState,Og as DataClient,K0 as DataSource,uS as DataSourceActionType,J as DeepMap,Is as FixedSizeSet,jw as FlashingColumnCell,mt as GroupRowsState,Xt as InfiniteTable,Gt as InfiniteTableClassName,_w as InfiniteTableComponent,Lt as Menu,rr as RowDetailCache,wt as RowDetailState,gt as RowDisabledState,xe as RowSelectionState,RW as TreeDataSource,nt as TreeExpandState,Lw as TreeGrid,ot as TreeSelectionState,vs as WeakFixedSizeSet,km as alignNode,b6 as components,Vg as createFlashingColumnCellComponent,zt as debounce,Be as debug,vn as defaultFilterTypes,as as eventMatchesKeyboardShortcut,Zp as filterDataArray,vn as filterTypes,fT as flatten,vt as getComponentStateRoot,Ml as group,Vw as interceptMap,zw as keyboardShortcuts,Wt as multisort,Al as multisortNested,Io as queryKeyToCacheKey,hT as toTreeDataArray,je as useComponentState,or as useDataSourceInternal,Jt as useDataSourceState,Rs as useEffectWhen,Kw as useEffectWhenSameDeps,mo as useEffectWithChanges,tN as useEffectWithObject,Ts as useGridScroll,ai as useInfiniteColumnCell,pl as useInfiniteColumnEditor,Ho as useInfiniteColumnFilterEditor,Xr as useInfiniteHeaderCell,Rw as useInfinitePortalContainer,eN as useLayoutEffectWithChanges,wf as useManagedDataSource,W0 as useMasterRowInfo,qt as useOverlay,_C as useOverlayPortal,In as usePrevious,B0 as useRowInfoReducers,gw as useVisibleColumnSizes};
|
|
29
|
+
`,`You are using version "${e.version}" of Infinite Table, which was published on ${r.toDateString()}.`,"Please visit infinite-table.com to renew your license.","Thank you for playing fair!"],t),!1):!0},tC=o=>{let e="",t=o.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if(ts(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(ts(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),eC(t)};var oC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,rC=/(https):\/\/\S+(\.csb\.app)/g,lm=typeof window<"u"?window.location.origin:"",iC=()=>{let[o,e,t]=Array.from(oC.exec(lm)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},aC=()=>{let[o,e,t]=Array.from(rC.exec(lm)||[]);return e==="https"&&t===".csb.app"},lC=aC()||iC(),sm=(o="")=>{let t=!!ke();return nC(()=>{if(t)return!0;let r=am(o,{publishedAt:1624970570587,version:"7.2.3"});return!o&&!r&&lC?!0:r},[o,t])};import{useRef as cm,useEffect as um}from"react";var sC=10;function dm(o,e,t){let n=cm(!1),r=cm(null);um(()=>{o!=null&&(n.current=!1,It(r.current))},[o]),um(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,It(r.current),r.current=Ae(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<sC&&a(l)})};var i=a;a()}return()=>{It(r.current)}},[o,e])}import{useRef as pm,useEffect as fm}from"react";var cC=10;function mm(o,e,t){let n=pm(!1),r=pm(null);fm(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),fm(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<cC&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}var gm=o=>`--infinite-${o}`;import{useCallback as TC,useMemo as SC,useEffect as CC}from"react";function hm(o,e){ns(o,e),dC(o,e),e.detail===2&&uC(o,e),o.getState().onCellClick?.(o,e)}function uC(o,e){let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function dC(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,b=new ze(u);b.debugId=m??"",d.cellSelectionState=b;let T={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(T);else if(e.shiftKey){let S=!!n().wrapRowsHorizontally;d.multiSelectClick(T,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:S})}else d.resetClick(T);l.cellSelection=b}function ns(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=n(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=u;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:h}=u;if(h=l(h),s.rowSelectionState=h,h&&typeof h=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=h,!0}else if(d==="single-row"){let b=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(b):a.rowSelectionApi.selectRow(b)}return!1}function bm(o,e){e.detail!==2&&void 0}var pC={Enter:!0," ":!0,a:!0};function ym(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:c,ctrlKey:u,metaKey:d}=e;if(!pC[c])return!1;let p=t(),f=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:h,keyboardSelection:b}=p,{selectionMode:T,groupBy:S,rowSelection:C,treeSelectionState:y,isTree:v}=f;if(b===!1)return!1;let w=h==="row"&&m!=null?m:h==="cell"&&g!=null?g[0]:null,I=w!=null?f.dataArray[w]:null;if(!I||w==null)return!1;if(T==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(I.id),!0;if(T!=="multi-row")return!1;if(c==="a"&&(u||d)){if(v&&y){let x=s(y);return x.selectAll(),r.treeSelection=x,!0}let R=l(C);return R.selectAll(),r.rowSelection=R,!0}if(c===" "){if(S.length)return I.isGroupRow&&I.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(I.groupKeys):i.rowSelectionApi.toggleRowSelection(I.id),!0;if(v){if(I.isTreeNode&&I.nodePath)return a.treeApi.toggleNodeSelection(I.nodePath),!0}else{let R={...e},{renderSelectionCheckBox:x}=o.getComputed();return x&&(R.metaKey=!1,R.ctrlKey=!0),ns({...o,rowIndex:w},R)}}return!1}var Tm=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Sm=o=>Array.from(o.querySelectorAll(Tm)).filter(t=>!!t.offsetParent),zi=o=>o.querySelector(Tm);var wm=Wn(Tn());async function Cm(o,e=10,t=300){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})}var fC=10,mC=(o,e)=>o-e;function Vi(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=c[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=et(p.id,e);return p.contentFocusable({column:p,...ao({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function os(o,e,t){let n=t.getState().editingCell;return gC(o,e,t,{isCellFocusable:Vi,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function Im(o,e,t){let n=(0,wm.default)(t,o+e,mC);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=Im;function gC(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:Im(u,e,a),u===null){if(c+=e,c<0||c>=s.length)return null;continue}if(i({colIndex:u,rowIndex:c},t))return{colIndex:u,rowIndex:c}}return null}async function vm(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=Vi(e,o)?e:os(e,-1,o);if(t){await rs([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;zi(n)?.focus()}}async function rs([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=fC,l=null,s=!1;function c(u=0){u++,It(l),l=Ae(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await Cm(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var hC=`.${_n}`;function Rm(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:tn(n,hC),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=o.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&Vi({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:os({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=Sm(document.body),d=o.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return rs([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;zi(u)?.focus()}),!0}var xm={control:"ctrl"},Dm={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},bC={esc:"escape"},Em={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Mm=Object.keys(Em),is=new Set(Mm),yC=new Set(["shift","alt"]);function as(o,e){return Array.isArray(e)?e.some(t=>Pm(o,t)):Pm(o,e)}function Pm(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>Dm[p]),i=n.map(p=>xm[p]||Dm[p]||bC[p]||p),a=i.filter(p=>is.has(p)),l=i.filter(p=>!is.has(p)),s=Mm.reduce((p,f)=>(p[f]=Em[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!yC.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||is.has(t)||t==="meta"||xm[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function Am(o,e){let t={...o,cloneRowSelection:a=>Ti(a,o.getDataSourceState),cloneTreeSelection:a=>Ii(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&ym(t,e)&&e.preventDefault(),(Rm(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&Df(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,c=o.getComputed().computedVisibleColumns[s];c.computedEditable&&o.api.startEdit({rowIndex:l,columnId:c.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!as(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function wC(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=Q(),{getState:i,componentActions:a,api:l}=De();return SC(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>Ii(u,i),cloneRowSelection:u=>Ti(u,i)}),[o,e,i,a,t,l,n])}function IC(){let o=wC();CC(()=>{let e=o.getState().keyDown.onChange(a=>{Am(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=et(s.id,o);hm({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=o.getComputed().computedVisibleColumns[c],d=et(u.id,o);bm({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function vC(){let{getState:o}=Q();return{onKeyDown:TC(t=>{o().keyDown(t)},[])}}function _m(){return IC(),vC()}import{useEffect as eg}from"react";import*as Oe from"react";import{useCallback as ss,useEffect as RC,useLayoutEffect as xC,useState as Hi}from"react";import{createPortal as DC}from"react-dom";function ls(o){return!!o.tagName}function Nm(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Se.from(ls(e)?e.getBoundingClientRect():e),a=Se.from(ls(t)?t.getBoundingClientRect():t),l=n?Se.from(ls(n)?n.getBoundingClientRect():n):null;if(!l)return{...Fm({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=Fm({anchorRect:a,targetRect:i,position:r[c],constrainRect:l});if(c===0&&(s={...d,index:0}),d.valid)return{...d,index:c}}return s}function Fm(o){let e=Se.from(o.targetRect),t=Se.from(o.anchorRect),n=o.constrainRect?Se.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=Om(e,i),s=Om(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function Om(o,e){return e==="TopLeft"?Ne.from({top:o.top,left:o.left}):e==="TopCenter"?Ne.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Ne.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Ne.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Ne.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Ne.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Ne.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Ne.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Ne.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}var Gi="__is_infinite_menu_component";function PC(o){return o&&typeof o.then=="function"||o instanceof Promise}function zm(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function Lm(o){return typeof o=="function"&&(o=o()),PC(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&zm(o)&&(o=o.getBoundingClientRect()),o?Se.from(o):null}async function EC(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),zm(n)&&(r=n),r||null}return t(await e)}function MC(o){return Oe.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function AC(o){let e=Oe.useRef(null);return RC(()=>o.realign.onChange(t=>{e.current&&t&&km(e.current,t)}),[o.realign]),Oe.createElement("div",{style:{position:"absolute",top:0,left:0},ref:ss(t=>{t&&km(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}async function km(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Lm(t)||void 0,a=n?await Lm(n):void 0,l=Se.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Nm({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function _C(o,e){let[t,n]=Hi(null);return xC(()=>{async function r(){let i=e?await EC(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?DC(o,t):Oe.createElement(Oe.Fragment,null):e===null||e===!1?o:Oe.createElement(MC,null,o)}function FC(o){if(Oe.Children.count(o)===1){let e=Oe.Children.only(o);if(Oe.isValidElement(e))return e.props.id||e.key}return null}function OC(o,e,t){if(Oe.Children.count(o)===1){let n=Oe.Children.only(o);if(Oe.isValidElement(n)&&n.type[Gi]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Oe.cloneElement(n,r)}}return o}globalThis.allhandles={};globalThis.thehandles={};function qt(o){let e=o,[t]=Hi(()=>new Map),[n,r]=Hi(null),[i,a]=Hi(0),l=ss(()=>{let m=[];for(let[g,h]of t)m.push(Oe.createElement(AC,{...h,key:h.key}));return m},[]),[s,c]=_t(),u=_C(l(),o.portalContainer),d=ss((m,g)=>{let b=`${g.id||FC(m)||xt()}`,T=t.get(b),S=v=>()=>{let w=typeof v=="function"?v():v;return OC(w,e.portalContainer,g.constrainTo??e.constrainTo)},C=S(m),y=(v,w)=>{if(!T)return;let I=S(v);Object.assign(T,{children:I}),c(),!!!w?.skipRealign&&(r(T.key),a(Date.now()))};return T?(Object.assign(T,g),y(m),y):(T={key:b,children:C,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:ge()},t.set(T.key,T),c(),y)},[t,e.portalContainer,c]);Oe.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},f=()=>{t.clear(),c()};return Oe.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}import*as Qm from"react";import*as Co from"react";import*as So from"react";import*as sr from"react";function Ki(o){return null}Ki.defaultProps={__is_menu_item:!0};var Vm="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Gm=ue({defaultClassName:"db3arf2 _16lm1iw1p _16lm1iw2j _16lm1iw1x",variantClassNames:{disabled:{true:"db3arf3 _16lm1iwl _16lm1iw1x",false:"_16lm1iwk"},active:{true:"db3arf5",false:"db3arf6"},pressed:{false:"db3arf7",true:"db3arf8"},keyboardActive:{true:"db3arf9",false:"db3arfa"}},defaultVariants:{},compoundVariants:[[{active:!0,disabled:!1},"db3arfb"],[{pressed:!0,active:!0,disabled:!1},"db3arfc"]]}),Hm="db3arf1",Km="db3arfd";var NC="-";function LC(){return sr.createElement("hr",{className:Km})}var Bi=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===NC?sr.createElement(LC,null):r:null;return i!=null?{type:"item",parentMenuId:n,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}};function Bm(o,e){return sr.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Ki)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Bi(o,n)}return Bi(o,t)})||[]}var Wm="submenu";function jm(){let o=So.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:xt(),focused:!1,destroyed:!1,domRef:o}}var $m=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),kC=[{name:"label"}],Um=o=>{let{props:e,state:t}=o,{activeItemKey:n,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||kC],d={columns:u,keyboardActiveItemKey:r,activeItemKey:n,menuId:c},p=[];i?p=i.map(Bi.bind(null,d)):!i&&typeof a!="function"&&(p=Bm(d,a)),l&&p.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==Wm)&&u.push({name:Wm,render:({domProps:g,item:h})=>h.menu?So.createElement("div",{...g},So.createElement(Mn,{expanded:!1})):So.createElement("div",{...g})});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:u,menuId:c}};import*as Pt from"react";import{useCallback as Gn,useLayoutEffect as $C,useRef as UC,useState as ds}from"react";var cr=class extends ro{constructor(e){super(e.slice(0,3))}};var zC=250;function VC(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}Ae(i)};Ae(()=>{i()})})}var GC=we(),Wi=class{constructor(e){this.activeItem=null;this.currentHoveredItem=null;this.activeItemLeavePoint=null;this.menuLeaveTimeoutId=null;this.activeItemMenuRect=null;this.lastPointerMoveTimestamp=0;this.mouseMoveTimeoutId=0;this.lastHorizontalDiff=0;this.getTimeout=()=>this.params.timeout||zC;this.getPointerMoveTarget=()=>document.documentElement||GC;this.removePointerMoveListener=()=>{this.getPointerMoveTarget().removeEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.onPointerMoveWhileActiveItem=e=>{if(clearTimeout(this.mouseMoveTimeoutId),!e){this.lastPointerMoveTimestamp=Date.now();return}if(!this.currentHoveredItem||this.currentHoveredItem===this.activeItem)return;let t=Date.now();this.lastPointerMoveTimestamp||(this.lastPointerMoveTimestamp=t);let r=t-this.lastPointerMoveTimestamp>this.getTimeout();this.lastPointerMoveTimestamp=t;let i=()=>{this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e)};if(r){i();return}let a=this.currentHoveredItem;this.mouseMoveTimeoutId=setTimeout(()=>{if(a!==this.currentHoveredItem)return;Date.now()-this.lastPointerMoveTimestamp>this.getTimeout()&&i()},this.getTimeout());let l=new Ne({left:e.clientX,top:e.clientY});if(!this.activeItemMenuRect||!this.activeItemLeavePoint)return;let s=this.activeItemLeavePoint.left<this.activeItemMenuRect.left,u=(s?1:-1)*(l.left-this.activeItemLeavePoint.left);if(u-this.lastHorizontalDiff<0){this.lastHorizontalDiff=0,i();return}this.lastHorizontalDiff=u,(s?new cr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new cr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopRight(),this.activeItemMenuRect.getBottomRight()])).containsPoint(l)||(this.setActiveItem(null,null),this.onItemChange(!0,this.currentHoveredItem,e))};this.setupMenuLeaveTracking=()=>{this.menuLeaveTimeoutId=setTimeout(()=>{this.activeItem&&this.params.itemHasSubMenu(this.activeItem)||this.setActiveItem(null,null)},this.getTimeout())};this.setActiveItem=(e,t)=>{if(e!==this.activeItem){if(e==null){this.removePointerMoveListener(),this.params.onItemActivate(null,null),this.activeItem=null,this.activeItemMenuRect=null;return}this.activeItem=e,this.params.onItemActivate(e,t),this.activeItemMenuRect=null,VC(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Ne({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};import{createContext as HC,useContext as KC}from"react";var cs=HC(null);function us(){return KC(cs)}import{useCallback as BC,useEffect as WC,useRef as jC}from"react";function Ym(){let o=jC(!0);return WC(()=>(o.current=!0,()=>{o.current=!1}),[]),BC(()=>o.current,[])}function YC(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=o.menu;return u?(typeof u=="function"&&(u=u()),Pt.createElement(Lt,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),n(p)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function qC(o,e){let t=qm(o,e);if(!t.length)return null;let n=Se.from(t[0]?.getBoundingClientRect()),r=Se.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function qm(o,e){let t=tn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function XC(o,e){let t=qm(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}function ZC({onItemActivate:o}){let{getState:e}=us(),[{onItemEnter:t,onItemLeave:n}]=ds(()=>new Wi({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?Se.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:Gn(t,[]),onItemLeave:Gn(n,[])}}function Xm(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:b}=us(),T=Gn(k=>{h.keyboardActiveItemKey=k},[]),S=Gn(k=>{h.activeItemKey=k},[]),C=Ym(),[y,v]=ds(null),w=null;$C(()=>{let{runtimeItems:k}=b(),W=k.filter(se=>se.type==="item"&&i===se.key)[0];if(!W||!W.menu){v(null),D();return}if(W){let se=qC(r,W.key);se&&R(()=>YC(W,{constrainTo:l,setSubmenuApi:v,setActiveItemKey:S,setKeyboardActiveItemKey:T,parentMenuId:r,onHideIntent:H,api:B}),{id:`${r}-submenu`,alignTo:se,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let I=(k,W)=>{T(W.key),S(W.key),W.originalMenuItem.onClick&&W.originalMenuItem.onClick(k);let se={key:W.key,item:W.originalMenuItem,hideMenu:H};W.originalMenuItem.onAction&&W.originalMenuItem.onAction(se),c&&c(se),W.originalMenuItem.hideMenuOnAction&&H()},{showOverlay:R,portal:x,clearAll:D}=qt({portalContainer:!1}),{onItemEnter:M,onItemLeave:A}=ZC({onItemActivate:k=>{if(!C())return;let W=k?k.key:null;S(W)}});w=n.map((k,W)=>Pt.createElement(QC,{key:k.type==="item"?k.key:W,onItemEnter:(se,ce)=>{M(se.key,ce)},onItemLeave:(se,ce)=>{A(se.key,ce)},columns:t,active:k.type==="item"&&k.key===i,keyboardActive:k.type==="item"&&k.key===a,item:k,index:W,onClick:I}));let E=t.map(k=>k.width||(typeof k.flex=="number"?`${k.flex}fr`:k.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:E,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function P(k){let{runtimeItems:W,runtimeSelectableItems:se}=b(),ce=W.findIndex(ne=>ne.type==="item"&&ne.key===a),ie=a,oe=W[ce],te={ArrowUp:()=>{let ne=W.slice(0,ce).filter(V=>V.type==="item"&&!V.disabled).pop();ne&&ne.type==="item"&&ne.key&&(ie=ne.key)},ArrowDown:()=>{let ne=W.slice(ce+1).filter(V=>V.type==="item"&&!V.disabled)[0];ne&&ne.type==="item"&&ne.key&&(ie=ne.key)},Home:()=>{te.PageUp()},End:()=>{te.PageDown()},PageUp:()=>{ie=se[0].key},PageDown:()=>{ie=se[se.length-1].key},ArrowLeft:()=>{S(null),b().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{oe&&(S(oe.key),Ae(()=>{C()&&y&&y.getParentMenuId()===b().menuId&&y.focus()}))},Enter:()=>{if(oe)if(oe.originalMenuItem?.menu){if(oe&&oe.originalMenuItem.menu&&y){te.ArrowLeft();return}oe&&S(oe.key)}else I(k,oe)}," ":()=>{if(!oe)return;oe.originalMenuItem.menu||I(k,oe);let ne=XC(r,oe.key);ne&&ne.click()},Escape:()=>{te.ArrowLeft();let ne=b();ne.parentMenuId||ne.onHideIntent?.(ne)}},fe=te[k.key];fe&&(fe(),k.preventDefault()),ie!=a&&T(ie)}function F(){h.focused=!1}let N=Gn(function(){h.focused=!0,setTimeout(()=>{G.current&&g.current&&g.current===document.activeElement&&b().keyboardActiveItemKey==null&&T(b().runtimeSelectableItems[0]?.key??null)})},[]),G=UC(!0),H=Gn(()=>{let k=b();k.onHideIntent?.(k)},[b]),[B]=ds(()=>({hideMenu:H,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),N())},getMenuId:()=>b().menuId,getParentMenuId:()=>b().parentMenuId})),pe=Gn(k=>{k?(g.current=k,d?.(b(),B),f&&B.focus()):(p?.(b()),g.current=k)},[]),de=Pt.createElement("div",{className:Zn.contents},Pt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:pe,onKeyDown:k=>{e.onKeyDown?.(k),P(k)},onMouseDown:k=>{G.current=!1,e.onMouseDown?.(k)},onMouseUp:k=>{G.current=!0,e.onMouseUp?.(k)},onFocus:N,onBlur:F,className:Z(Vm,e.className,"InfiniteMenu"),style:_},w),x);return s?null:de}function QC(o){let[e,t]=Pt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=Pt.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<u)return null;u=h;let T={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:h},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:Z(Gm({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:S=>{r.disabled||o.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||o.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||o.onClick(S,r)}};return d.render?Pt.createElement($o,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:T}}):Pt.createElement("div",{key:`${s}-${m}`,...T},f[m])}).filter(Boolean)}return Pt.createElement("div",{className:Hm},c)}var{ManagedComponentContextProvider:JC}=vt({initSetupState:jm,forwardProps:$m,mapPropsToState:Um,layoutEffect:!0});function ew(o){let{componentActions:e,componentState:t}=je(),n=ve(t);return Co.createElement(cs.Provider,{value:{componentActions:e,componentState:t,getState:n}},Co.createElement(Xm,{domProps:o.domProps}))}function Lt(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:b,...T}=o;return Co.createElement(JC,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},Co.createElement(ew,{domProps:T}))}Lt[Gi]=!0;import*as ps from"react";function Zm(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a}=e,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=Rn(p,e,"column-menu");u.push({key:f,label:m,check:ps.createElement(Ht,{key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let h=!!g;i.setVisibilityForColumn(p.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=Rn(p,e,"column-menu");u.push({key:f,label:m,check:ps.createElement(Ht,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Jm(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Lt,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:et(s.id,e),...e},u=Zm([],c),d=a?a(u,c):u,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:Qm.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var tw=`[${bl["data-name"]}="${yl["data-name"]}"]`;function nw(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){n(),a.columnMenuVisibleForColumnId=null}let u=o.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${yp["data-column-id"]}="${e}"] ${tw}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Jm(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function tg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});eg(()=>{let{actions:c,getState:u}=o,d=u();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,c.contextMenuVisibleFor=null,c.cellContextMenuVisibleFor=null,c.filterOperatorMenuVisibleForColumnId=null,c.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return eg(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=t();if(c){let p=function(f){f.__insideMenu!==!0&&(a(),n.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),nw({columnId:c,context:o,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else u.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}import*as ng from"react";import{useCallback as ow}from"react";var rw={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function og(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=Q(),{getState:a,getDataSourceMasterContext:l}=De(),{focusDetectDOMRef:s}=o(),c=ow(async()=>{vm({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return ng.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:rw})}import{useEffect as ur}from"react";function iw(){let o=Q(),{getState:e}=o,{editingCell:t}=e(),n=t&&!t.active?t.cancelled:void 0;ur(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...ft({rowIndex:r,columnId:i,...o}),initialValue:a})}},[n])}function aw(){let o=Q(),{getState:e,state:{editingCell:t}}=o,n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;ur(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...ft({rowIndex:r,columnId:i,...o}),value:a,error:n,initialValue:l})}},[n])}function lw(){let o=Q(),{state:{editingCell:e}}=o,t=e?.active,n=In(t);ur(()=>{!t&&n&&o.api.focus()},[t,n])}function sw(){let o=Q(),{state:{editingCell:e},getState:t}=o,n=e&&!e.active&&!e.cancelled&&e.accepted===!0;ur(()=>{if(n){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...ft({rowIndex:a,columnId:l,...o}),value:i,initialValue:s};t().onEditAccepted?.(c),o.api.persistEdit({value:i})}},[n])}function cw(){let o=Q(),{state:{editingCell:e},getState:t}=o,n=e?e.persisted:void 0;ur(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...ft({rowIndex:l,columnId:s,...o}),value:c,initialValue:u};n instanceof Error?i?.({...d,error:n}):a?.(d)}},[n])}function rg(){iw(),aw(),sw(),cw(),lw()}import{useEffect as lg}from"react";import*as hn from"react";import*as fs from"react";var ji=o=>fs.createElement(_e,{...o},fs.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));import*as ms from"react";var ig=o=>ms.createElement(_e,{...o},ms.createElement("path",{d:"m9.55 19-6.725-6.725L5.25 9.85l4.3 4.325 9.225-9.225 2.425 2.4Z"}));function ag(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),p=u?.Menu??Lt,f=n().computedColumnsMap.get(o);if(!f)return null;let m=w=>{w.__insideMenu=!0},g=w=>{w.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),b=h[f.computedFilterType];if(!b)return null;let T=b.operators.map(w=>{let I=w.name,R=f.computedFilterValue?f.computedFilterValue.filter.operator===I:I===b.defaultOperator,x=w.components?.Icon??eo;return{key:I,icon:hn.createElement(x,null),label:hn.createElement(hn.Fragment,null,w.label??w.name),onAction:()=>{c.setColumnFilterOperator(o,I)},checked:R?hn.createElement(ig,{size:16}):null}}),C=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:hn.createElement(ji,null),disabled:!f.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...T],y={column:f,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},v=d?d(C,y):C;return hn.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:v,onShow:w=>{w.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:w=>{g(w),t?.()}})}var $i=10;function sg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return lg(()=>{let{actions:l,getState:s}=o;return s().onFilterOperatorMenuClick.onChange(u=>{if(!u)return;let{target:d,column:p}=u;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,g=Se.from(m.getBoundingClientRect());g.top-=$i,g.left-=$i,g.width+=2*$i,g.height+=2*$i,r(()=>ag(p.id,o,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:g,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),lg(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}import{useEffect as Yi}from"react";import*as ys from"react";import*as gs from"react";function Ui(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function hs(o){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),o.onHideIntent?.()}}}function bs(o,e,t){if(!o)return null;let n=ge();return o.then(r=>{let{items:i,columns:a}=Ui(r);i&&i.length&&n(gs.createElement(t,{...e,items:i||[],columns:a}))}),gs.createElement(en,{updater:n})}function cg(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Lt,{computedColumnsMap:d}=a(),p=d.get(n),f={...ft({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!c)return{cellContext:f,menu:null,preventDefault:!1};let m=hs({onHideIntent:t}),g=c(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:bs(g,m,u),preventDefault:h};let{items:b,columns:T}=Ui(g);return!b||!b.length?{cellContext:f,menu:null,preventDefault:Array.isArray(b)}:{preventDefault:h,menu:ys.createElement(u,{...m,columns:T,items:b}),cellContext:f}}function ug(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??Lt,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...ft({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=hs({onHideIntent:t}),p=a(u,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:u,menu:bs(p,d,l),preventDefault:f};let{items:m,columns:g}=Ui(p);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:ys.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var qi=5,dg=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function pg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Yi(()=>{let{actions:l,getState:s,getDataSourceState:c}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:h}=cg(d,o,f),b=Se.fromPoint({top:p.clientY,left:p.clientX});b.width+=qi,b.height+=qi,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:b,alignPosition:dg}),h&&p.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:T}=s();T&&T({...g,getState:s,getDataSourceState:c},p)})},[]),Yi(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function fg(){let o=Q(),e=ke(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return Yi(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=ug(u,o,p),h={top:d.clientY,left:d.clientX},b=Se.fromPoint(h);b.width+=qi,b.height+=qi,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:b,alignPosition:dg}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:h,...u};let{onContextMenu:T}=s();T&&T({...o,...m},d)})},[]),Yi(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}import{useRef as pw}from"react";import*as mg from"react";import{useCallback as uw,useEffect as dw}from"react";function Ts(o,e){let{state:{brain:t}}=Q(),n=uw(o,e);dw(()=>t.onScroll(n),[t,n])}var Ss="yzx0vj0";function gg(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=pw(null);Ts(s=>{a.current&&r!==!1&&(a.current.style.transform=`translate3d(${-s.scrollLeft}px, 0px, 0px)`)},[r]);let l={...i.style};return e==="column"?l.width=ae.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ae.runtime.bodyWidth),n==="column"?l.minWidth=ae.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=ae.runtime.bodyWidth),t==="column"?l.maxWidth=ae.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ae.runtime.bodyWidth),mg.createElement("div",{ref:a,...i,className:i.className?Z(i.className,Ss):Ss,style:l},i.children)}var fw=q($.columnWidthAtIndex),mw=q($.columnOffsetAtIndex);function gw(){return Q().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${fw}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${mw}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Xi="InfiniteTable";import{useEffect as hw}from"react";function hg(){let{state:o,getState:e,actions:t}=Q(),{wrapRowsHorizontally:n}=o,r=In(n);hw(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Zl(Xi,!!n);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,n])}import{useEffect as bw}from"react";function bg(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=Q(),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),bw(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,b=(r&&r.length>0||i)&&h>0?h:null;return f!=b&&(t.rowsPerPage=b,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}import{useEffect as Zi,useRef as yw}from"react";var dr=ue({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),yg="_143ofgf5",Tg="_143ofgf3";var Tw=q(ae.loaded),Cs={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Sg(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...Cs,url:ws(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Cs,url:ws(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var ws=Qe(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function Sw(o){window.postMessage(o)}var Cw=Qe(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){Ct.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(Sg({type:"update",debugId:e},t))}else nf(e),window.postMessage(Sg({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Be.onLogIntent("IT:*",e=>{Sw({...Cs,url:ws(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let n="";try{n=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return n}return String(t)}),timestamp:e.timestamp}})}),o});function Cg(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=Q(),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(Tw)!==`${tc}`&&tr({debugId:i,key:"CSS001_CSS"}),Zi(()=>{e().debugId!==i&&(t.debugId=i)},[i]),vw()}var Qi=ge(),ww={revertAll:o=>{let e=Ct.get(o.debugId);if(e){let t=mn.get(o.debugId);mn.delete(o.debugId),jt.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=Ut.get(o.debugId);Ut.delete(o.debugId),$t.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=Ct.get(o.debugId);if(e){let t=o.property,n=jt.get(o.debugId),r=mn.get(o.debugId),i=$t.get(o.debugId),a=Ut.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=Ut.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=Ct.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),nr(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),nr(o.debugId))}}},discardAllWarnings:o=>{let e=Ct.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),nr(o.debugId))},setColumnVisibility:o=>{Gl(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{Di(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{Gl(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{Di(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{Di(o.debugId,"multiSort",o.multiSort)},highlight:o=>{let e=Ct.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${dr.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(dr.classNames.base),r.innerHTML=[`<div class="${Tg}"></div>`,`<div class="${yg}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(dr.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(dr.classNames.variants.active.true)}}}}};function Iw(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(Cw(),Qi(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=ww[e];t&&t(o.data.payload)}})}Iw();function vw(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=Q(),s=o().debugId,c=yw(s);return c.current=s,Zi(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=Qi.get();if(p){d(p);return}return Qi.onChange(f=>{f&&d(f)})},[]),Zi(()=>{let u=c.current;if(!u)return;let d=Qi.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),Zi(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function Rw(){let o=ke(),e=o?o.getMasterState():null,t=Q().getState();return(e||t).portalDOMRef.current}import*as ht from"react";import{useCallback as xw}from"react";var wg="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Ig=ue({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),vg="hs68h81",Rg=ue({defaultClassName:"hs68h80 _16lm1iw1p",variantClassNames:{orientation:{horizontal:"_16lm1iw2h _16lm1iw2j",vertical:"_16lm1iw2f"},draggingInProgress:{true:"_16lm1iw1h",false:"hs68h86"},dropRejected:{true:"hs68h87",false:"hs68h88"},active:{true:"hs68h89",false:"hs68h8a"}},defaultVariants:{},compoundVariants:[[{dropRejected:!0,active:!0},"hs68h8b"],[{dropRejected:!1,active:!0},"hs68h8c"],[{active:!1,dropRejected:!1},"hs68h8d"]]});import*as Hn from"react";function xg(o){return Hn.createElement("div",{...o.domProps})}function Dg(o){let{active:e}=o;return Hn.createElement("div",{className:vg},e?"Drop to group":"Drag columns to group")}function Pg(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return Hn.createElement("div",{...o.domProps},o.label,Hn.createElement("div",{className:Hr[1]}),Hn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:wg,onKeyDown:e,onMouseDown:o.onClear},Hn.createElement(ji,{size:20})))}var Dw=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};we().addEventListener("mousemove",i,{once:!0}),we().addEventListener("mouseup",()=>{r||(we().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function Pw(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=qo(),c=l===wo,u=Q(),d=(e?Rn(e.id,u,"grouping-toolbar"):r)??i,p=e?ht.createElement(si,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=ht.createElement(ht.Fragment,null,d,p),m=s===i&&l===wo,g=Z(Ig({draggingInProgress:c,active:m}),o.domProps?.className),h=Dw(a,o.domProps?.onMouseDown),b={...o.domProps,className:g,onMouseDown:h},T=n?.ToolbarItem??Pg;return ht.createElement(T,{active:m,domProps:b,column:e,field:r,label:f,onClear:t})}var wo="grouping-toolbar";function Eg(o){let{groupBy:e}=Jt(),{getComputed:t,dataSourceApi:n,api:r}=Q(),{dropTargetListId:i,dragSourceListId:a}=Pn(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===wo,u=a===wo,d=o.components?.Placeholder??Dg,p=o.components?.Host??xg,f=e.length?ht.createElement(ht.Fragment,null,e.map((S,C)=>{let y=S.field?l.get(S.field):void 0,v=`${S.field??`idx-${C}`}`;return ht.createElement(Nn.DraggableItem,{key:v,id:v},w=>ht.createElement(Pw,{id:v,components:o.components,domProps:w,field:S.field,column:y,toggleSorting:()=>{y&&r.toggleSortingForColumn(y.id)},onClear:()=>{let I=e.filter(R=>R!==S).filter(Boolean);n.setGroupBy(I)}}))})):ht.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let C=S.map(y=>e[y]);n.setGroupBy(C)},g=S=>{let{dragItemId:C}=S,y=C,v=s.get(y);if(!v||!v.field||!v.computedGroupable)return;let w=[...e];w.splice(S.dropIndex,0,{field:v.field}),n.setGroupBy(w)},h=xw(S=>{let{computedColumnsMap:C}=t(),y=S.dragItem.id,v=C.get(y);return!(!v||!v.computedGroupable||e.some(w=>w.field===v.field))},[e]),b=o.orientation??"horizontal",{domProps:T}=o;return ht.createElement(Nn,{orientation:b,dragListId:wo,acceptDropsFrom:["header",wo],onDrop:m,onAcceptDrop:g,shouldAcceptDrop:h},(S,{draggingInProgress:C,status:y})=>{let v=Z(Rg({active:c,orientation:b,draggingInProgress:C,dropRejected:y==="rejected"}),S.className,T?.className),w={...S,...T,className:v,children:f};return ht.createElement(p,{active:c,rejectDrop:y==="rejected",domProps:w,orientation:b})})}var Gt=Me.rootClassName,Ew=[wd,"InfiniteColumnCell--hovered"],{ManagedComponentContextProvider:Mw}=vt({initSetupState:$f,forwardProps:Uf,mapPropsToState:Zf,cleanup:Yf,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Xf(),getParentState:()=>Jt(),debugName:o=>nn(o.debugId,Xi)}),Mg=Z(Vu,cl);function Aw(o){return be.createElement("div",{...o,className:o.className?Z(Mg,o.className):Mg})}function Ag(){let o=Q(),e=ke(),{state:t,getComputed:n,api:r}=o,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,scrollStopDelay:d,brain:p,scrollerDOMRef:f,components:m,bodySize:g,activeCellIndex:h,rowDetailRenderer:b,showHoverRows:T,wrapRowsHorizontally:S,domProps:C,domRef:y}=t,v=m?.LoadMask??mi,w=n(),{computedRowHeight:I,computedRowSizeCacheForDetails:R}=w,x=R?.getRowHeight||I,{componentState:{loading:D}}=De(),M=be.useCallback(F=>{let N=o.getState(),G=F.target;if(!e&&F._from_row_detail)return;e&&(F._from_row_detail=!0);let H=ec(G,Xl(),N.domRef.current),B,pe,de,k;H&&(pe=Number(H.dataset.colIndex),k=Number(H.dataset.rowIndex),B=o.getComputed().computedVisibleColumns[pe].id,de=o.dataSourceApi.getRowInfoArray()[k].id);let W={columnId:B,colIndex:pe,rowId:de,rowIndex:k,event:F,target:H??F.target};H&&N.cellContextMenu(W),N.contextMenu(W)},[]),{renderCell:A,renderDetailRow:E}=zf({imperativeApi:r,getComputed:n,domRef:y,bodySize:g,computed:w}),{autoFocus:_,tabIndex:P}=C??{};return hg(),be.createElement(Aw,{onContextMenu:M},be.createElement(Ac,{forceRerenderTimestamp:t.forceBodyRerenderTimestamp,debugId:l,tabIndex:P??0,autoFocus:_??void 0,activeRowIndex:t.ready&&s==="row"?c:null,activeCellIndex:t.ready&&s==="cell"&&!t.columnReorderDragColumnId?h:null,scrollStopDelay:d,renderer:i,wrapRowsHorizontally:S,onRenderUpdater:a,brain:p,activeCellRowHeight:x,renderCell:A,renderDetailRow:b?E:void 0,cellHoverClassNames:T?Ew:void 0,scrollerDOMRef:f,scrollVarHostRef:y}),be.createElement(v,{visible:D},u))}var _w=be.memo(function(){let e=Q(),t=ke(),{state:n,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=De(),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:b,scrollStopDelay:T,brain:S,activeRowIndex:C,activeCellIndex:y}=n,{licenseKey:v}=n;!v&&Xt.licenseKey&&(v=Xt.licenseKey),mm(C,a.length,r),dm(y,a.length,r);let{onKeyDown:w}=_m();be.useEffect(()=>{let G=l(),H=zt(B=>{G.notifyRenderRangeChange({renderStartIndex:B[0],renderEndIndex:B[1]})},{wait:T});return S.onVerticalRenderRangeChange(H)},[S,T]);let I=sm(v),{autoFocus:R,tabIndex:x,...D}=n.domProps??{},M=Zu(D);be.useEffect(()=>{S.setScrollStopDelay(T),s.scrollStopDelayUpdatedByTable=T},[T]),_f(),bg(),rg();let{menuPortal:A}=tg(),{menuPortal:E}=pg(),{menuPortal:_}=fg(),{menuPortal:P}=sg();be.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(n.id,n.ready,e.api,e)},[n.ready]);let F=Cg();be.useEffect(()=>{t&&(u.current=t.getMasterState().portalDOMRef.current)},[]);let N=i??be.createElement(be.Fragment,null,be.createElement(Rl,null),be.createElement(Ag,null));return be.createElement("div",{"data-debug-id":F,onKeyDown:w,ref:c,...M},N,be.createElement("div",{ref:u,className:Z(`${Je}Portal`,Uc[1e7],Kr.absolute,Wc[0],Hc[0])},A,E,_,P),g?be.createElement(Mo,{key:"row-height",varName:g,onChange:d}):null,be.createElement(Mo,{key:"flashing-duration",allowInts:!0,varName:ae.components.Cell.flashingDuration,onChange:p}),h?be.createElement(Mo,{key:"row-detail-height",varName:h,onChange:f}):null,b?be.createElement(Mo,{key:"column-header-height",varName:b,onChange:m}):null,I?null:be.createElement(wp,null),be.createElement(og,null))});function Fw({children:o}){let{componentActions:e,componentState:t}=je(),{scrollerDOMRef:n,scrollTopKey:r}=t,i=rm(),a=ve(i),l=ve(t),s=ke(),{getState:c,componentActions:u,getDataSourceMasterContext:d,api:p}=De(),[f]=be.useState(()=>Mf({getComputed:a,getState:l,getDataSourceState:c,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:u})),m={actions:e,state:t,computed:i,dataSourceActions:u,getDataSourceMasterContext:d,getDataSourceState:c,getComputed:a,getState:l,api:f,dataSourceApi:p,children:o};Tr(n,h=>{let b={width:h.width,height:h.height};e.bodySize=b},{earlyAttach:!0,debounce:50}),be.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[r,n]);let g=Qn();return be.createElement(g.Provider,{value:m},be.createElement(_w,null))}var Ow=40,Nw=gm(nc),Xt=function(o){return be.createElement(Mw,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:Ow,columnHeaderHeight:Nw,...o},be.createElement(sl,null,be.createElement(Fw,{children:o.children})))};Xt.Header=Rl;Xt.Body=Ag;Xt.HScrollSyncContent=gg;Xt.Footer=()=>be.createElement(qc,null);Xt.GroupingToolbar=Eg;import*as _g from"react";function RW(o){let{DataSource:e}=or({nodesKey:"children",...o});return _g.createElement(e,null,o.children??null)}import*as Fg from"react";function Lw(o){return Fg.createElement(Xt,{...o})}var Ji=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,n(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Be(`IT:${e}:DataQuery`)}};function Io(o){if(Array.isArray(o))return o.map(Io);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=Io(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var Zt=class Zt{constructor(e){this.queryCache=new J;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=Io(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new Ji(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=Io(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=Io(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=Io(e);this.queryCache.delete(t)};if(this.options=e,Zt.clients.has(e.name)){let t=`There's already a DataClient with name "${e.name}". Specify a different name for the client`;throw new Error(t)}Zt.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Zt.clients.get(e);t&&t.destroy()}static destroyAll(){Zt.clients.forEach(e=>{Zt.destroy(e.name)})}destroy(){Zt.clients.delete(this.options.name)}};Zt.clients=new Map;var Og=Zt;var kw={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},zw={instantEdit:kw};import{useEffect as UW}from"react";function Vw(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var ea=class ea{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ea.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};ea.DEFAULT_SIZE=10;var Is=ea;var ta=class ta{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ta.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};ta.DEFAULT_SIZE=10;var vs=ta;import{useEffect as Gw,useRef as na}from"react";var Hw=(o,e)=>o.every((t,n)=>t===e[n]),Kw=(o,e)=>{let t=na(e),n=Hw(e,t.current),r=na(!0);t.current=e;let i=na(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=na(o);l.current=o,Gw(()=>{if(r.current){r.current=!1;return}return l.current()},a)};import{useEffect as Bw,useRef as pr}from"react";var Ng=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),Rs=(o,e)=>{let{same:t,different:n,compare:r}=e,i=pr(t),a=pr(n),l=Ng(t,i.current,r),s=!Ng(n,a.current,r),c=pr(!0);i.current=t,a.current=n;let u=pr(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=pr(o);p.current=o,l&&s&&(c.current=!1),Bw(()=>{if(!c.current)return p.current()},d)};import*as bt from"react";var Lg=q($.currentFlashingDuration),Ww=({children:o})=>bt.createElement(bt.Fragment,null,o),kg=1e3,zg={up:Lr({direction:"up"}).split(" "),down:Lr({direction:"down"}).split(" "),neutral:Lr({direction:"neutral"}).split(" ")},Vg=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=Ww}=o;return bt.forwardRef((i,a)=>{let l=ai(),{state:{flashingDurationCSSVarValue:s}}=Q(),c=typeof s=="number"?s??e??kg:e??kg,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,b=bt.useRef(!0),T=bt.useRef(d),S=b.current?null:T.current;b.current=!1;let C=bt.useRef(void 0),y=bt.useRef(void 0),v=bt.useRef(void 0);return Rs(()=>{if(d===T.current)return;let w=()=>{let D=m.current;if(C.current&&(clearTimeout(C.current),C.current=void 0),v.current&&(clearTimeout(v.current),v.current=void 0),y.current&&D){let M=y.current,A=zg[M];D.classList.remove(...t?[t,...A]:A),D.style.removeProperty(Lg),y.current=void 0}};T.current=d;let I=m.current;if(!I)return;w();let R=typeof d=="number"?d>S?"up":"down":"neutral",x=zg[R];return I.style.setProperty(Lg,`${c}`),I.classList.add(...t?[t,...x]:x),y.current=R,C.current=setTimeout(w,c),w},{same:[h,g],different:[d]}),bt.createElement("div",{ref:u,...i,className:Z(i.className)},n({children:i.children,oldValue:S}))})},jw=Vg();var b6={CheckBox:Ht,LoadMask:mi,MenuIcon:Uo,StringFilterEditor:no,NumberFilterEditor:Zr};export{ze as CellSelectionState,Og as DataClient,K0 as DataSource,uS as DataSourceActionType,J as DeepMap,Is as FixedSizeSet,jw as FlashingColumnCell,mt as GroupRowsState,Xt as InfiniteTable,Gt as InfiniteTableClassName,_w as InfiniteTableComponent,Lt as Menu,rr as RowDetailCache,wt as RowDetailState,gt as RowDisabledState,xe as RowSelectionState,RW as TreeDataSource,nt as TreeExpandState,Lw as TreeGrid,ot as TreeSelectionState,vs as WeakFixedSizeSet,km as alignNode,b6 as components,Vg as createFlashingColumnCellComponent,zt as debounce,Be as debug,vn as defaultFilterTypes,as as eventMatchesKeyboardShortcut,Zp as filterDataArray,vn as filterTypes,fT as flatten,vt as getComponentStateRoot,Ml as group,Vw as interceptMap,zw as keyboardShortcuts,Wt as multisort,Al as multisortNested,Io as queryKeyToCacheKey,hT as toTreeDataArray,je as useComponentState,or as useDataSourceInternal,Jt as useDataSourceState,Rs as useEffectWhen,Kw as useEffectWhenSameDeps,mo as useEffectWithChanges,tN as useEffectWithObject,Ts as useGridScroll,ai as useInfiniteColumnCell,pl as useInfiniteColumnEditor,Ho as useInfiniteColumnFilterEditor,Xr as useInfiniteHeaderCell,Rw as useInfinitePortalContainer,eN as useLayoutEffectWithChanges,wf as useManagedDataSource,W0 as useMasterRowInfo,qt as useOverlay,_C as useOverlayPortal,In as usePrevious,B0 as useRowInfoReducers,gw as useVisibleColumnSizes};
|
|
30
30
|
//!collapsed || lazyLoad;
|