@infinite-table/infinite-react 8.0.2 → 8.0.4
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.d.ts +10 -1
- package/index.dev.js +68 -16
- package/index.dev.mjs +65 -16
- package/index.js +8 -8
- package/index.mjs +8 -8
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Ib=Object.create;var fi=Object.defineProperty;var Rb=Object.getOwnPropertyDescriptor;var vb=Object.getOwnPropertyNames;var Db=Object.getPrototypeOf,xb=Object.prototype.hasOwnProperty;var Pb=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Mb=(n,e)=>{for(var t in e)fi(n,t,{get:e[t],enumerable:!0})},Kc=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of vb(e))!xb.call(n,r)&&r!==t&&fi(n,r,{get:()=>e[r],enumerable:!(o=Rb(e,r))||o.enumerable});return n};var j=(n,e,t)=>(t=n!=null?Ib(Db(n)):{},Kc(e||!n||!n.__esModule?fi(t,"default",{value:n,enumerable:!0}):t,n)),Ab=n=>Kc(fi({},"__esModule",{value:!0}),n);var on=Pb((_D,Pd)=>{"use strict";Pd.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});var Hw={};Mb(Hw,{AutoScroller:()=>fn,CellSelectionState:()=>$e,DRAG_ITEM_ATTRIBUTE:()=>xt,DataClient:()=>Nc,DataSource:()=>YT,DataSourceActionType:()=>Am,DeepMap:()=>oe,DragDropProvider:()=>zi,DragInteractionTarget:()=>$n,DragList:()=>zo,FixedSizeSet:()=>cl,FlashingColumnCell:()=>fb,GroupRowsState:()=>wt,INTERNAL_MatrixDebugger:()=>mb,InfiniteTable:()=>ao,InfiniteTableClassName:()=>Zt,InfiniteTableComponent:()=>eb,Menu:()=>Ut,RowDetailCache:()=>rr,RowDetailState:()=>Pt,RowDisabledState:()=>It,RowSelectionState:()=>_e,TreeDataSource:()=>Fw,TreeExpandState:()=>st,TreeGrid:()=>nb,TreeSelectionState:()=>Je,WeakFixedSizeSet:()=>dl,alignNode:()=>yc,components:()=>Gw,createDefaultProxy:()=>Ss,createFlashingColumnCellComponent:()=>Lc,debounce:()=>_t,debug:()=>Ue,defaultDragProxyMove:()=>Ts,defaultFilterTypes:()=>Oo,eventMatchesKeyboardShortcut:()=>$a,filterDataArray:()=>Zs,filterTypes:()=>Oo,flatten:()=>Gp,getComponentStateRoot:()=>Ft,group:()=>Ta,interceptMap:()=>ab,keyboardShortcuts:()=>ib,multisort:()=>oo,multisortNested:()=>Ca,queryKeyToCacheKey:()=>vn,toTreeDataArray:()=>Wp,useComponentState:()=>Nt,useDataSourceInternal:()=>nr,useDataSourceSelector:()=>Fe,useDataSourceState:()=>Ia,useDragDropProvider:()=>uo,useDragListContext:()=>pn,useEffectWhen:()=>pl,useEffectWhenSameDeps:()=>lb,useEffectWithChanges:()=>yn,useEffectWithObject:()=>pT,useGridScroll:()=>nl,useInfiniteColumnCell:()=>zr,useInfiniteColumnEditor:()=>qi,useInfiniteColumnFilterEditor:()=>Ln,useInfiniteHeaderCell:()=>Er,useInfinitePortalContainer:()=>Ph,useLayoutEffectWithChanges:()=>fT,useManagedDataSource:()=>Js,useMasterRowInfo:()=>xo,useOverlay:()=>ro,useOverlayPortal:()=>Bg,usePrevious:()=>Eo,useRowInfoReducers:()=>qT,useVisibleColumnSizes:()=>Ch,withSelectedLeafNodesOnly:()=>rb});module.exports=Ab(Hw);function _t(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}var ve=j(require("react"));var te=(...n)=>n.filter(e=>!!`${e}`).join(" ");var Jo=j(require("react")),Pl=require("react");function Te(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=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 pt(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var Bc=(n,e)=>n-e;var pi=(n,e)=>Bc(n.revision,e.revision),oe=class n{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,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,f)=>{let p=r.get(f);if(!p)return;let{map:m}=p,g=f===this.emptyKey;if(g&&!c)return;let b=g?[]:[...e,f],h=m?()=>this.visitWithNext(b,t,o,m,i!==void 0?i-1:void 0):void 0;if(p.hasOwnProperty("value")){let y=t(p.value,b,l,h,p);if(o&&y===!0)return!0;l++}else h?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,f]of r){let p=u(f,d);if(o&&p===!0)return p}};this.fill(e)}static clone(e){let t=new n;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push(i)},t),o}getEntriesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push([r,i])},t),o}getLeafNodesStartingWith(e,t,o){let{respectOrder:r=!1}=o||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},o),r?i.sort(pi).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>o.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>[o.keys,o.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:o,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=f=>{i?a.push(f):l.push(f.keys)},c=this.map,u,d=!1;if(e.length)for(let f=0,p=e.length;f<p;f++){let m=e[f];if(u=c.get(m),!u||!u.map)if(d=!0,f===p-1){d=!0;break}else return[];c=u.map}else if(!o&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(o||(s({...u,keys:e}),d=!0)),d?i?a.sort(pi).map(f=>f.keys):l:(this.visitWithNext(e,(f,p,m,g,b)=>{s({...b,keys:p})},!1,c,r,o),i?a.sort(pi).map(f=>f.keys):l)}getKeysStartingWith(e,t){let o=[];return this.getStartingWith(e,r=>{o.push(r)},t),o}getStartingWith(e,t,o){let{excludeSelf:r,depthLimit:i}=o||{},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,f,p)=>{t(u,c,{...p,keys:u}),f?.()},!1,a,i,r)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===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 o=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=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===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((o,r)=>{let{map:i}=o;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 o=[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,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.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 o=0,r=e.length;o<r;o++){let i=e[o],a=o===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,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],c=pt(()=>{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((o,r)=>{let i=e({...o,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 o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}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(pi);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=oe;function De(){return globalThis}var gi=["#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"],Wc=Symbol("color"),mi=new WeakMap,Cl=Te();function wl(n=gi){mi.set(n,n.map(e=>0))}wl();var Eb=(n=gi)=>{let e=[];mi.has(n)?e=mi.get(n):(e=n.map(o=>0),mi.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??gi[0]},Cr=":",Il="*",jc="-",_b=",",Ob="debug",Fb="diffdebug",Uc=!1,Tr=new oe,wr=new Map;function Rl(n,e){let t=n.split(Cr),o=new oe;o.set(t,!0);let r=e.split(Cr),i=new Set(r).has(Il),a=r.indexOf(Il),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(Cr)):!0}}function Yc(n,e){let t=`channel=${n}_permissions=${e}`;if(wr.has(t))return wr.get(t);let o=e.split(_b);function r(l){return wr.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(Il)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(jc);if(c&&(s=s.substring(jc.length)),Rl(n,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)),Rl(n,s))return r(!c)}return r(!1)}var vl=()=>Ue.enable??(De()&&De().localStorage?.getItem(Ob))??"",Nb=()=>Ue.diffenable??(De()&&De().localStorage?.getItem(Fb))??`${Uc}`,Dl="",qc=Uc;function xl(n){qc=`${Nb()}`=="true",Dl!==n&&(Dl=n,wr.clear())}function Xc(n){xl(vl()),typeof De()<"u"&&De().addEventListener&&De().addEventListener("storage",function(){xl(vl())});function e(t,o){let r=o?`${o}${Cr}${t}`:t,i=r.split(Cr),a=Tr.get(i);if(a)return a;let l=Tr.get(i.slice(0,-1)),s=(l?l.logFn:Ue.logFn)??Zc,c=s,u,d=0,f=()=>u??Yc(r,Dl),p=Eb(Ue.colors),m=Object.defineProperties((...g)=>{let b=Cl.getListenersCount(),h;if(b>0&&(h=h??Date.now(),Cl({color:p,channel:r,args:g,timestamp:h})),f()){if(h=h??Date.now(),d&&qc){let T=h-d;c(`%c[${r}]`,`color: ${p}`,`+${T}ms:`)}d=h;let y=[],S;if(g.forEach(T=>{if(T[Wc])S===void 0&&(S=!0),y.push(...T);else{if(typeof T!="string"&&typeof T!="number"){S=!1;return}y.push(`${T}%s`)}}),S){let T=[`%c[${r}]%c %s`,`color: ${p}`,"",...y,""];c(...T)}else c(`%c[${r}]%c %s`,`color: ${p}`,"",...g)}},{channel:{value:r},color:{value:(g,...b)=>{let h=[`%c${b.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>b.join(" "),h[Wc]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>f(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{Tr.delete(i)}}});return Tr.set(i,m),m}return e(n)}var Zc=console.log.bind(console),$c;Object.defineProperty(Xc,"enable",{get:()=>$c,set:n=>{$c=n,xl(vl())}});var Ue=Xc;Ue.colors=gi;Ue.logFn=Zc;var Lb=(n,e)=>Cl.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;Rl(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Ue.onLogIntent=Lb;Ue.isChannelEnabled=Yc;Ue.destroyAll=()=>{wl(),wl(Ue.colors),Tr.clear(),wr.clear()};var Ot=n=>{let e=Ue(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},Ro=n=>{let e=Ue(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},Ir=()=>Ir;Ir.extend=()=>Ir;var bt=class{constructor(e){this.debug=Ir,this.error=Ir}};var kb=j(require("react")),vo=require("react");var Rr=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?_t(e,{wait:o}):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=n.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(n),()=>{a.disconnect()}},hi=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=(0,vo.useRef)({width:0,height:0}),r=i=>{let a;return n.current&&(a=Rr(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,vo.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),(0,vo.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};var zb=Ro("CSSVariableWatch"),Vb=Ot("CSSVariableWatch"),Gb={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},Hb=n=>{let e=(0,Pl.useRef)(0),t=Jo.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);hi(n.ref,t,{earlyAttach:!0}),Jo.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,Vb(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);zb(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},vr=n=>{let e=(0,Pl.useRef)(null);Hb({...n,ref:e});let t=n.varName.startsWith("var(")?n.varName:`var(${n.varName})`,{allowInts:o=!1}=n;return Jo.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:Gb},Jo.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};var An=require("react");var so=require("react");function yt(n,e,t){if(n===e)return!0;if(!n||!e)return!1;let o=typeof n;if(o!==typeof e||o!=="object")return!1;var i=Object.keys(n),a=Object.keys(e);t&&(i=i.filter(u=>!t.has(u)),a=a.filter(u=>!t.has(u)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var c=i[s];if(!(t&&t.has(c))&&(n[c]!==e[c]||!Object.prototype.hasOwnProperty.call(e,c)))return!1}return!0}function Do(){let n=null,e=new Set;return{getSnapshot(){return n},setSnapshot(t){n=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}function Qc(n,e,t){let o=(0,so.useRef)(e);o.current=e;let r=(0,so.useRef)(t);r.current=t;let i=(0,so.useRef)(void 0),a=(0,so.useRef)(!1),l=(0,so.useCallback)(()=>{let s=n.getSnapshot(),c=o.current(s);return a.current&&r.current(i.current,c)?i.current:(i.current=c,a.current=!0,c)},[n]);return(0,so.useSyncExternalStore)(n.subscribe,l,l)}function bi(n,e){return Qc(n,e,Object.is)}function Pn(n,e){return Qc(n,e,yt)}var Jc=j(require("react")),Ml;function Mn(){return Ml||(Ml=Jc.createContext(null))}var eu=Do(),tu=()=>{};function yi(){let n=Mn();return(0,An.useContext)(n)||void 0}function Si(){let n=yi();return(0,An.useCallback)(()=>n?.getSnapshot(),[n])}function co(n){let e=Mn(),t=(0,An.useContext)(e),o=Pn(t||eu,t?n:tu);return t?o??void 0:void 0}function xo(){let n=Mn(),e=(0,An.useContext)(n),o=bi(e||eu,e?r=>r.masterRowInfo:tu);return e?o:void 0}var En=j(require("react")),Qe=require("react");function Al(n,e){let t=new Set;function o(...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 n.apply(this,s)}return{fn:o,propertyReads:t}}var El=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function Po(n){if(n==null)return!1;let e=n;return!0}function Dr(n){return n!==void 0}function Mo(n,e){let t=e[n];return Dr(t)}var Ao=require("react");var Ti=require("react"),Yt=()=>{let[n,e]=(0,Ti.useState)(0);return[n,(0,Ti.useCallback)(()=>{e(t=>t+1)},[e])]};var ou=n=>{let e=(0,Ao.useCallback)(n,[]),t=(0,Ao.useRef)(!1),o=(0,Ao.useRef)(!1),r=(0,Ao.useRef)(void 0),[i,a]=Yt();t.current&&(o.current=!0),(0,Ao.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};var Ci=require("react");function Oe(n){let e=(0,Ci.useRef)(n);return e.current=n,(0,Ci.useCallback)(()=>e.current,[])}var wi=require("react"),Eo=(n,e)=>{let t=(0,wi.useRef)(e===void 0?n:e);return(0,wi.useLayoutEffect)(()=>{t.current=n}),t.current};var xr={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var _l=class n{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,o=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",c=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(u=>[u.name,u.value]):void 0,tooltipText:l}}}),this};this.debugId=e}static create(e){return new n(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(xr).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:xr[o].track,label:i.label}),get label(){let i=xr[o];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:c=>e.end({...c,track:i.track,label:i.labels[l]})};return Object.defineProperty(a,l,{get:()=>(e.markerDetails.label=i.labels[l],s)}),a},{})}};return Object.defineProperty(t,o,{get:()=>{let i=xr[o];return e.markerDetails.track=i.track,r}}),t},{})}};function nt(n){return _l.create(n)}var Kb=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)},Ol;function nu(){return Ol||(Ol=(0,Qe.createContext)(null))}function Bb(n,e,t,o,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:f=>{let p=t(),m=e(),g=m[u],b=!0;if(i&&typeof i[u]=="function"&&i[u](f,{actions:s,state:m})===!1&&(b=!1),b){let S=[f],T=`on${El(c)}Change`;if(a&&a[u]){let C=a[u](f,m);T=C.callbackName||T,S=C.callbackParams}Kb(p,T,S)}let h=o[u];typeof h=="function"&&(f=h(f));let y=!!r?.[u];Mo(c,p)&&!y||n({payload:{updatedProps:null,mappedState:{[c]:f}}})}}),s},{})}function Wb(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=Mo(r,e)?e[r]:e[`default${El(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function Ft(n){let e=n.getParentState||(()=>null);function t(r){let[i]=(0,Qe.useState)(()=>n.initSetupState?n.initSetupState(r):{}),a=(0,Qe.useRef)(new Set),l=(0,Qe.useMemo)(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),c=Oe(s);function u(){let v={};l&&(v=Wb(l,r,i));let x={...i,...v};if(n.mapPropsToState){let{fn:R,propertyReads:P}=Al(n.mapPropsToState,{getProxyTargetFromArgs:M=>M.props,putProxyToArgs:(M,D)=>[{...D,props:M}]}),A=R({props:r,state:x,oldState:null,parentState:s});return a.current=new Set([...a.current,...P]),{...x,...A}}return x}let[d]=(0,Qe.useState)(u),f=Oe(r),p=(v,x)=>{if(x.type==="REPLACE_STATE")return x.payload;let R=c?.()??null,P=x.payload.mappedState,A=x.payload.updatedPropsToState,M={...v};if(P&&Object.assign(M,P),n.mapPropsToState){let{fn:_,propertyReads:O}=Al(n.mapPropsToState,{getProxyTargetFromArgs:V=>V.props,putProxyToArgs:(V,z)=>[{...z,props:V}]}),L=_({props:f(),state:M,oldState:v,parentState:R});a.current=new Set([...a.current,...O]),Object.assign(M,L)}return x.type==="ASSIGN_STATE"&&Object.assign(M,x.payload),n.concludeReducer?n.concludeReducer({previousState:v,state:M,updatedProps:A,parentState:R}):M},[m,g]=(0,Qe.useReducer)(p,d),b=Oe(m),{allowedControlledPropOverrides:h}=n,y=(0,Qe.useMemo)(()=>Bb(g,b,f,l,h,n.interceptActions,n.mappedCallbacks),[g,l,h]),S=n.Context??nu(),T=(0,Qe.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:b,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,y,b]),C=Eo(r),w=(0,Qe.useRef)(!1);w.current=!1;let I=n.layoutEffect?Qe.useLayoutEffect:Qe.useEffect;return I(()=>{let v=r,x={},R=0,P={},A=0,M={},D=0;if(new Set([...Object.keys(v),...Object.keys(C)]).forEach(L=>{let V=L,z=C[V],G=v[V];if(V!=="children"&&z!==G&&(M[V]={newValue:G,oldValue:z},D++,Mo(V,r)||Mo(V,C)))if(l.hasOwnProperty(L)){let E=G,F=l[L];typeof F=="function"&&(E=F(G)),m[V]!==E&&(x[V]=E,R++)}else a.current.has(L)&&(P[V]=v[V],A++)}),A>0||R>0){let L=m.debugId,V=L?nt(L).track.ComponentState.label.PropUpdate.start():void 0,z=n.debugName?typeof n.debugName=="function"?`${n.debugName(v)}:rerender`:`${n.debugName}:rerender`:"rerender";Ot(z)("Triggered by new values for the following props",...Object.keys(x??{}),...Object.keys(P??{})),V&&V.end({label:z,details:[R>0?{name:"Updated properties",value:Object.keys(x).join(", ")}:void 0,A>0?{name:"Updated props",value:Object.keys(P).join(", ")}:void 0,A>0||P?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(Po)});let E={payload:{mappedState:R?x:null,updatedPropsToState:A?P:null}};if(w.current=!0,g(E),n.onPropChange){for(var O in M)if(M.hasOwnProperty(O)){let{newValue:F,oldValue:X}=M[O];n.onPropChange({name:O,newValue:F,oldValue:X},r,y,m)}}n.onPropsChange&&D&&n.onPropsChange(M,r,y,m)}}),I(()=>{s!=null&&!w.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),ou(()=>()=>{n.cleanup?.(b())}),{contextValue:T,ContextComponent:S}}return{ManagedComponentContextProvider:En.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return En.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Nt(n){return n=n??nu(),En.useContext(n)}var hu=j(require("react"));var mt="Infinite",ke={rootClassName:mt};var Ii=()=>ke;var ru="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",iu={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var qt="_16lm1iw3b _16lm1iw3c _16lm1iw35",au={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},_n={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var Ri={1:"_16lm1iw1c",none:"_16lm1iw1d"},Pr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var lu={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},su={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},cu={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var uu={none:"_16lm1iwd"},du={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var vi={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var fu={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var pu={none:"_16lm1iw1x"};var mu={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var gu={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function bu(n){let{rootClassName:e}=Ii();return hu.createElement("div",{...n,className:te(`${e}Footer`,vi.relative,_n.flex,Pr.row,n.className)})}var Pe=j(require("react")),ho=require("react"),Mp=require("react-dom");function Di(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function ee(n){return n.slice(4,-1)}var yu=j(require("react")),ze=n=>{let e=n.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...n.style};return yu.createElement("svg",{viewBox:"0 0 24 24",...n,style:t},n.children)};var Mr=j(require("react")),Su=n=>Mr.createElement(ze,{...n},Mr.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"}),Mr.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Mr.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));var Fl=j(require("react")),Tu=n=>Fl.createElement(ze,{...n},Fl.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"}));var Nl=j(require("react")),Ll=n=>Nl.createElement(ze,{...n},Nl.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));var kl=j(require("react")),Cu=n=>kl.createElement(ze,{...n},kl.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));var zl=j(require("react")),wu=n=>zl.createElement(ze,{...n},zl.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));var Vl=j(require("react")),Iu=n=>Vl.createElement(ze,{...n},Vl.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));var Gl=j(require("react")),Ru=n=>Gl.createElement(ze,{...n},Gl.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));var Hl=j(require("react")),vu=n=>Hl.createElement(ze,{...n},Hl.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));var Kl=j(require("react")),Du=n=>Kl.createElement(ze,{...n},Kl.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"}));var Ql=j(require("react"));var lt=j(require("react")),Ar=require("react");var On=j(require("react")),en=require("react");function jb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function $b(n){var e=jb(n,"string");return typeof e=="symbol"?e:String(e)}function Ub(n,e,t){return e=$b(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xu(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Pu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xu(Object(t),!0).forEach(function(o){Ub(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xu(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Mu(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var Yb=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},ye=n=>{var e=t=>{var o=n.defaultClassName,r=Pu(Pu({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=n.variantClassNames[i][s];c&&(o+=" "+c)}}for(var[u,d]of n.compoundVariants)Yb(u,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return Mu(n.variantClassNames,t=>Mu(t,o=>o.split(" ")[0]))}},e};var Au="_1eexc2a6";var Eu=ye({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:[]}),_u="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Ou=ye({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Fu=ye({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"]]}),Nu=ye({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"]]}),Lu="_12zfob12u _16lm1iw22 _16lm1iw1z";var ku="_12zfob17",zu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Vu=ye({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Bl=ye({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Gu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Hu=ye({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Ku="_12zfob1b _16lm1iw2",Bu="_16lm1iw1",Wu="_12zfob16",ju=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),$u="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var vt="InfiniteIcon";var Uu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var qb={transition:"width 0.25s, opacity 0.25s"};function Fn(n){let[e,t]=(0,en.useState)(!0),[o,r]=(0,en.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=n,c=s!=null&&s>0,u=n.size??16,d=Math.floor(u/4),f=[u-1*d,u-2*d,u-3*d],p={...qb,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if((0,en.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,en.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return On.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:te(l,vt,Uu,`${vt}-filter`)},c?On.createElement("div",{"data-name":"index",style:m,className:ku},s):null,On.createElement("div",{style:{width:f[0],...p}}),On.createElement("div",{style:{width:f[1],...p}}),On.createElement("div",{style:{width:f[2],...p}}))}var Wl=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((I,v)=>{let x=I.maxSize??r??void 0,R=I.minSize??o??void 0;s.push(R),c.push(x),I.size!=null&&(x!=null&&I.size>x&&(I.size=x),R!=null&&I.size<R&&(I.size=R));let P=I.flex==0?null:I.flex;if(I.size==null&&P==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;P!=null&&(l+=1),a+=P??0,i+=I.size??0});let u=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,f={},p={},m=0;t.forEach((I,v)=>{if(I.flex!=null){let x=d*I.flex,R=I.maxSize??r??void 0,P=I.minSize??o??void 0,A=!1,M=0;R!=null&&x>R&&(f[v]=!0,A=!0,M=R),P!=null&&x<P&&(p[v]=!0,A=!0,M=P),A&&(m+=1,l-=1,a-=I.flex,u-=M)}}),m&&(d=u/a);let g=[],b=0,h=u,y=a,S=0,T=0,C=[];return{items:t.map((I,v)=>{let x={...I},R=I.maxSize??r??void 0,P=I.minSize??o??void 0,A=0,M=f[v],D=p[v],_=M||D,O=I.size??0;if(I.flex!=null){if(_)D&&(A=P),M&&(A=R);else{b+=1;let L=V=>(R!=null&&V>R&&(V=R),P!=null&&V<P&&(V=P),V);b===l?A=L(h):(A=L(Math.round(I.flex*d)),T+=A,h=u-T,y-=I.flex,d=h/y)}O=A,x.flexSize=A}return g.push(A),C.push(O),x.computedSize=O,S+=O,x}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:C,remainingSize:Math.round(e-S)}};function xi(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}var jl=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((R,P)=>(R[P]={...n.columnSizing[P]},R),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],c=l.id,u=s?.id,d=l.computedWidth,f=l.computedMinWidth,p=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,b=s?.computedMinWidth,h=s?.computedMaxWidth,y=s?.computedFlex?"flex":"width",S=!1,T=!1,C=r>0?1:-1,{value:w,clamped:I,diff:v}=xi(d+r,f,p,C);if(n.shareSpaceOnResize){if(s==null)return o[c]={...o[c],[m]:w},T=I==="min",S=I==="max",{adjustedDiff:w-d,reservedWidth:t,columnSizing:o,minReached:T,maxReached:S,constrained:T||S};let{value:R,clamped:P,diff:A}=xi(g-r,b,h,C);if(I&&P&&(Math.abs(v)>Math.abs(A)?P=!1:I=!1),!(!I&&!P)){if(I){let M=xi(g-r-v,b,h,C);R=M.value,P=M.clamped,A=M.diff}else if(P){let M=xi(d+r+A,f,p,C);w=M.value,I=M.clamped,v=M.diff}}o[c]={...o[c],[m]:w},o[u]={...o[u],[y]:R},T=I==="min"||P==="min",S=I==="max"||P==="max"}else o[c]={...o[c],[m]:w},T=I==="min",S=I==="max";let x=w-d;return{adjustedDiff:x,reservedWidth:n.shareSpaceOnResize?t:t-x,columnSizing:o,minReached:T,maxReached:S,constrained:T||S}};function Yu(n,e){return n+e}function Xb(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var qu=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((h,y)=>(h[y]={...n.columnSizing[y]},h),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((h,y)=>n.dragHandlePositionAfter-y).reverse(),a=i.map(h=>n.items[h]),l=a.map(h=>h.computedWidth),s=a.map(h=>h.computedFlex?"flex":"width"),c=0,{computedSizes:u}=Wl({items:a.map(h=>(h.resizable===!1&&(c+=h.computedWidth),{maxSize:h.computedMaxWidth,minSize:h.computedMinWidth,flex:h.resizable?h.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Yu,0)+r-c,0)}),d=a.map((h,y)=>u[y]-h.computedWidth),f=!0,p=!0,m=!0,g=[];d.forEach((h,y)=>{let S=a[y];if(!S.resizable){g.push(0);return}let T=s[y],C=l[y],w=Xb(o),{maxReached:I,minReached:v,constrained:x,adjustedDiff:R}=jl({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[y],shareSpaceOnResize:!1,items:n.items,columnSizing:w});o[S.id]={...w[S.id],[T]:C+R},g.push(R),I||(p=!1),v||(f=!1),x||(m=!1)});let b=g.reduce(Yu,0);return{minReached:f,maxReached:p,constrained:m,adjustedDiffs:g,adjustedDiff:b,columnSizing:o,reservedWidth:t-b}};var Pi;function _o(){if(Pi!=null)return Pi;let n=De().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),Pi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Pi}var Xu=["start",void 0,"end"],Zu=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Xu.indexOf(r)-Xu.indexOf(i)}),n);function Qu(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function $l(n,...e){return Qu(t=>t!=null,n,...e)}function Ju(n,e,...t){return Qu((o,r)=>!(r in n),e,...t)}var Mi=Object.freeze({}),Zb={string:Mi,number:{}};function Ul(n,e){let t=e.default||Mi;return n.type===void 0?t:n.type===null?Mi:typeof n.type=="string"?e[n.type]||Zb[n.type]||Mi:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var Ai=!0,Qb=!0,Jb=!0,ey="string",Nn="unknown",ty=Ro("getComputedVisibleColumns"),oy=(n,e,t)=>n[t]!==!1,Yl=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1},ed=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:f,sortInfo:p,multiSort:m,filterTypes:g=Oo,viewportReservedWidth:b,resizableColumns:h,draggableColumns:y,columnDefaultDraggable:S,columnOrder:T,columnPinning:C,editable:w,columnDefaultEditable:I,columnDefaultFilterable:v,columnDefaultGroupable:x,columnDefaultSortable:R,columnSizing:P,columnTypes:A,columnVisibility:M,columnVisibilityAssumeVisible:D,groupBy:_})=>{let O=0,L={};_.forEach(($,se)=>{$.field&&(L[$.field]=se)});let V=(d||[]).reduce(($,se)=>{let{id:ue,field:Se}=se;return Se&&($[Se]=se),ue&&($[ue]=se),$},{}),z=Zu(T===!0?Object.keys(n):T,C),G=z.filter($=>n[$]?oy(M,D,$):(ty(`Column with id "${$}" specified in columnOrder array cannot be found in the columns map.`),!1)),E=new Map,F=G.map(($,se)=>{let ue=n[$];return E.set($,se),ue}),X=(p??[]).reduce(($,se,ue)=>(se.id?$[se.id]={sortInfo:se,index:ue}:se.field&&($[se.field]={sortInfo:se,index:ue}),$),{});function B($){let se=n[$],ue=Ul(se,A),Se={minWidth:ue?.minWidth,maxWidth:ue?.maxWidth,width:ue?.defaultWidth,flex:ue?.defaultFlex},qe=$l({width:se?.defaultWidth,flex:se?.defaultFlex,minWidth:se?.minWidth,maxWidth:se?.maxWidth},P[$]);qe.width!=null&&delete Se.flex,qe.flex!=null&&delete Se.width,qe=$l(Se,qe);let le=qe.flex??void 0,W=qe.minWidth??se?.minWidth??t,it=qe.maxWidth??se?.maxWidth??o,we=le!=null?void 0:qe.width??(i?void 0:r);return!we&&le==null&&(i?le=i:we=W),{size:we,flex:le,minSize:W,maxSize:it}}let Y=Wl({availableSize:Math.max(e.width-(b??0)-(a??_o()),0),maxSize:o,minSize:t,items:G.map(B)}),{computedSizes:re,flexSizes:ge,minSizes:be,maxSizes:ae}=Y,de=[],pe=[],q=[],k=[];k.length=G.length;let U=new Map,K=new Map,Z=0,ne=0,H=0,ce=null,N=[],J=0,fe=0,me=0;F.forEach(($,se)=>{let ue=G[se],Se=re[se],qe=N[se]=Yl(ue,C);qe==="start"?J+=Se:qe==="end"?me+=Se:fe+=Se});let Me=e.width-me,Ae=[],Ge=new Map;G.forEach(($,se)=>{let ue=F[se];Ge.set($,ue)});let Ne=[];Object.keys(n).forEach($=>{let se=n[$];Ne.push($),Ge.has($)||Ge.set($,se)});let Le=new Map;Ge.forEach(($,se)=>{let ue=E.get(se);ue==null&&(ue=-1);let Se=ue!=-1,qe=G[ue+1],le=Ul($,A),W=ue,it=X[se]?X[se]:$.field?X[$.field]??null:null,we=it?.sortInfo??null,at=!!we,Rt=at&&we.dir===1,zt=at&&!Rt,br=it?.index??-1,xn=Se?{}:B(se),yr=Se?re[ue]:xn.size||0,ml=Se&&ge[ue]||null,gl=Se?be[ue]||0:xn.minSize||0,hl=Se?ae[ue]||1e4:xn.maxSize||1e4,dt=Se?Yl(se,C):!1,ui=Se?ue===G.length-1:!1,Ee=W,ft=Se?dt==="start"?ne:dt==="end"?H:O-ne:0;dt=="start"?Ee=Se?W:-1:dt==="end"?Ee=Se?W-(de.length+q.length):-1:Ee=Se?W-de.length:-1;let lo=Se?dt==="start"||dt===!1?O:Me+H:-1,Vt=Se?dt!==ce:!1,Sr=Se?ui||dt!==Yl(qe,C):!1,kc=$.cssEllipsis??le.cssEllipsis??l,hb=$.headerCssEllipsis??le.cssEllipsis??$.cssEllipsis??le.headerCssEllipsis??s??kc,di=Se&&(V[se]||$.field||$.groupByForColumn)&&(V[se]||V[$.field||$.groupByForColumn])||null,bb=$.defaultFilterable??le.defaultFilterable??v??!0,yb=w??$.defaultEditable??le.defaultEditable??I??!1,bl=$.dataType||le.dataType||(Array.isArray($.type)?$.type[0]:$.type)||ey,Sb=$.sortType||le.sortType||bl,zc=$.filterType||le.filterType||bl,Vc=!1;if(di!=null&&!di.disabled){let Tl=g[zc];Tl&&(!Tl.emptyValues||!Tl.emptyValues.includes(di.filter.value))&&(Vc=!0)}let Qo=$.field??le.field,Gc=$.valueGetter??le.valueGetter,yl=$.defaultGroupable??le.defaultGroupable??x??!!Qo;Qo||(yl=!1),$.groupByForColumn&&(yl=!1);let Sl=$.defaultSortable??le.defaultSortable;Sl==null&&!$.groupByForColumn&&Qo==null&&Gc==null&&(Sl=!1);let Hc=Qo?L[Qo]!==void 0:!1,Tb=Hc?L[Qo]:void 0,Cb=f??Sl??R??Ai,wb=$.resizable??le.resizable??h??Qb,Xe={colType:le,align:le.align,headerAlign:le.headerAlign,computedVisible:Se,verticalAlign:le.verticalAlign,defaultHiddenWhenGroupedBy:le.defaultHiddenWhenGroupedBy,valueGetter:Gc,valueFormatter:le.valueFormatter,renderValue:le.renderValue,render:le.render,style:le.style,className:le.className,contentFocusable:le.contentFocusable,renderMenuIcon:le.renderMenuIcon,renderSortIcon:le.renderSortIcon,renderRowDetailIcon:le.renderRowDetailIcon,renderSelectionCheckBox:le.renderSelectionCheckBox,renderHeaderSelectionCheckBox:le.renderHeaderSelectionCheckBox,headerStyle:le.headerStyle,headerClassName:le.headerClassName,columnGroup:le.columnGroup,getValueToEdit:le.getValueToEdit,getValueToPersist:le.getValueToPersist,shouldAcceptEdit:le.shouldAcceptEdit,field:Qo,...$,components:{...le.components,...$.components},computedResizable:wb,computedMinWidth:gl,computedMaxWidth:hl,computedFlex:ml,computedDataType:bl,computedEditable:yb,computedSortType:Sb,computedFilterType:zc,cssEllipsis:kc,headerCssEllipsis:hb,computedFilterValue:di,computedFiltered:Vc,computedFilterable:bb,computedGroupable:yl,computedGroupedBy:Hc,computedGroupedByIndex:Tb,computedWidth:yr,computedAbsoluteOffset:lo,computedPinningOffset:ft,computedVisibleIndexInCategory:Ee,computedOffset:O,computedSortable:Cb,computedSortInfo:we,computedSortIndex:br,computedMultiSort:m,computedSorted:at,computedSortedAsc:Rt,computedSortedDesc:zt,computedVisibleIndex:W,computedPinned:dt,computedDraggable:y??$.defaultDraggable??S??Jb,computedFirstInCategory:Vt,computedLastInCategory:Sr,computedFirst:ue===0,computedLast:ui,id:se,header:$.header??le.header??$.name??$.field};Se&&(O+=yr,U.set(Xe.id,Xe),k[ue]=Xe,dt==="start"&&(de.push(Xe),ne+=Xe.computedWidth),dt==="end"&&(pe.push(Xe),H+=Xe.computedWidth),dt||(q.push(Xe),Z+=Xe.computedWidth),ce=dt),Xe.groupByForColumn&&(Xe.computedSortType=$.sortType||le.sortType||Nn,Ae.push(Xe)),K.set(Xe.id,Xe),Xe.field&&!Xe.groupByForColumn&&!Le.has(Xe.field)&&Le.set(Xe.field,Xe)}),Ae.forEach($=>{$.computedSortable=td($,{fieldsToColumn:Le,sortable:f,columnDefaultSortable:R})});let We=new Map;Ne.forEach($=>{let se=K.get($);se&&We.set($,se)}),K.forEach($=>{We.has($.id)||We.set($.id,$)});let et=c!=null?Math.min(c,ne):ne,tt=u!=null?Math.min(u,H):H;return{computedRemainingSpace:e.width-(J+me+fe),computedPinnedStartColumnsWidth:ne,computedPinnedEndColumnsWidth:H,computedUnpinnedColumnsWidth:Z,computedColumnOrder:z,computedPinnedStartColumns:de,computedPinnedEndColumns:pe,computedUnpinnedOffset:ne,computedPinnedEndOffset:ne+Z,computedUnpinnedColumns:q,computedVisibleColumns:k,computedColumnsMap:K,computedColumnsMapInInitialOrder:We,computedVisibleColumnsMap:U,computedPinnedEndWidth:tt,computedPinnedStartWidth:et,renderSelectionCheckBox:k.reduce(($,se)=>$||!!se.renderSelectionCheckBox,!1),fieldsToColumn:Le}};function td(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r}=e;if(t)return t;let i=n.defaultSortable??n.colType.defaultSortable;if(i!=null)return i;let a=r??Ai;return n.computedSortType!==Nn&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((f,p)=>{if(!f)return!1;let m=p.field||p.groupField,g;if(m){let b=o.get(m),h=b?u.getColumnApi(b.id):void 0;b&&h?g=h.isSortable():g=!1}return g===void 0&&p.valueGetter&&(g=!0),g??r??Ai},!0)}}function gt(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;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){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().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 tn(n,e,t){let o=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:f,selectionMode:p}=u,m=i(),g=o.header&&typeof o.header!="function"?o.header:o.name||o.id||"";if(typeof o.header=="function"){let b=gt(o.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=o.header({horizontalLayoutPageIndex:null,column:o,columnApi:b,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:o.computedSortInfo,columnFilterValue:o.computedFilterValue,filtered:o.computedFiltered,allRowsSelected:d,someRowsSelected:f,selectionMode:p,api:r,renderBag:{header:g}})??null}return g}var od=j(require("react"));var Ei=`${mt}HeaderCell__filter`,ql=`${mt}HeaderCell__filterOperator`,Xl=od.createContext(null);var rd=require("react");var nd=require("react"),Zl;function _i(){return Zl||(Zl=(0,nd.createContext)(null))}function ie(n){let e=_i(),t=(0,rd.useContext)(e);return Pn(t,n)}function He(){return ie(n=>({getState:n.getState,actions:n.actions,getComputed:n.getComputed,getDataSourceState:n.getDataSourceState,dataSourceApi:n.dataSourceApi,dataSourceActions:n.dataSourceActions,api:n.api,getDataSourceMasterContext:n.getDataSourceMasterContext}))}var ny=`${Ei}__input`,Oi=n=>n.stopPropagation();function id(n){let{filterOperatorMenuVisibleForColumnId:e}=ie(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Er(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=(0,Ar.useState)(!1),l=lt.useCallback(()=>{a(!0)},[]),s=lt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return lt.createElement("div",{onPointerUp:Oi,onPointerDown:Oi,onFocus:l,onBlur:s,className:`${Ei} ${Bl({active:c})}`,style:{height:n.columnHeaderHeight}},lt.createElement(Xl.Provider,{value:n},lt.createElement(r,null),lt.createElement(o,null)))}function ad(){let{columnApi:n,disabled:e,operator:t}=Ln(),o=t?.components?.Icon??Fn;return lt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:te(ql,zu,e?`${ql}--disabled`:"")},lt.createElement(o,{size:20,className:`${Vu({disabled:e})}`}))}function ld(){return lt.createElement("div",{onPointerUp:Oi,onPointerDown:Oi,className:`${Ei} ${Bl({active:!1})} ${lu["50%"]}`})}function Ln(){let n=He(),{column:e,columnApi:t}=Er(),o=tn(e,n,"column-filter"),r=lt.useContext(Xl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,Ar.useState)(l?.filter.value??""),d=lt.useCallback(b=>{u(b),r.onChange(b)},[r.onChange]),f=lt.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),p=lt.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);(0,Ar.useEffect)(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let b=[...s.emptyValues][0];b!==c&&u(b)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:n.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:f,removeColumnFilter:p,ariaLabel:`Filter for ${o}`,className:`${Lu} ${ny}`}}function kn(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Ln();return Ql.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function Fi(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Ln();return Ql.createElement("input",{"aria-label":n,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:o})}function ry(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:kn},operators:[{name:"includes",components:{Icon:Su},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Ll},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:Du},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Tu},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Fi},operators:[{label:"Equals",components:{Icon:Ll},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:vu},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:wu},fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>t},{name:"gte",components:{Icon:Cu},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>=t},{name:"lt",components:{Icon:Ru},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<t},{name:"lte",components:{Icon:Iu},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<=t}]}}}var Oo=ry();function Ni(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Kn=require("react"),jd=require("react-dom");function Fo(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function sd(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}var Q={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 cd="true",he={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)",borderColor:"var(--infinite-cell-border-color)",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)"}}},ud="column-header-height";var dd=`.${ke.rootClassName}`;function Jl(n){return Fo(n,dd)}var fd=ee(Q.scrollLeft),iy=ee(Q.scrollTop),ay=ee(Q.columnWidthAtIndex),es=ee(Q.columnOffsetAtIndex),pd=ee(Q.columnReorderEffectDurationAtIndex),ly=ee(Q.columnOffsetAtIndexWhileReordering),sy=ee(Q.columnVisibilityAtIndex),cy=ee(Q.columnZIndexAtIndex);function Xt(n,e,t){let o=t?Jl(t):document.querySelector(dd);uy(n,e,o)}function uy(n,e,t){if(t){let o=n,r=Q[o]?ee(Q[o]):n;t.style.setProperty(r,`${e}`)}}function zn(n,e){if(e)for(var t in n){let o=Q[t]?ee(Q[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function ts(n,e,t){Xt(`${es}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${fd}))`:`${n.computedAbsoluteOffset+e}px`,t)}function os(n,e,t){Xt(`${cy}-${n}`,`${e}`,t)}function _r(n,e,t){Xt(`${ly}-${n}`,typeof e=="number"?`calc( var(${es}-${n}) + ${e}px )`:e,t)}function Or(n,e,t){Xt(`${sy}-${n}`,e,t)}function Li(n,e,t){Xt(`${pd}-${n}`,t??"",e)}function ns(n,e){let t=`${pd}-${n}`;Xt(t,he.components.Cell.reorderEffectDuration,e)}var Ie={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${ay}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Xt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${es}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Xt(this.varName.get(n),e,t)}}};function md(n,e){zn({[fd]:`${n.scrollLeft}px`,[iy]:`${n.scrollTop}px`},e)}var gd="_16lm1iw1",hd="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",bd="_1yeub2vs",yd="_1yeub2vr",Sd=ye({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var rs="_1yeub2vp";var yD=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var is=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};var Fr={bodyWidth:{name:ee(he.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:ee(he.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:ee(he.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:ee(he.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:ee(he.runtime.browserScrollbarWidth),value:""}},dy=ee(Q.scrollbarWidthHorizontal),Td=ee(Q.scrollbarWidthVertical),fy=ee(Q.columnWidthAtIndex),py=ee(Q.columnZIndexAtIndex),Cd=ee(Q.scrollLeft),my=ee(Q.activeCellColWidth),wd=ee(Q.activeCellColOffset),Dd=ee(Q.baseZIndexForCells),gy=ee(Q.pinnedStartWidth),Id=ee(Q.bodyWidth),hy=ee(Q.bodyHeight),Rd=ee(Q.pinnedEndOffset),vd=ee(Q.pinnedEndWidth),by=ee(Q.computedVisibleColumnsCount);function as(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${Dd}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function xd(n){let e=_o(),{actions:t,getState:o,focused:r,focusedWithin:i,domRef:a,scrollerDOMRef:l,onBlurWithin:s,onFocusWithin:c,onSelfFocus:u,onSelfBlur:d,bodySize:f,activeCellIndex:p,wrapRowsHorizontally:m,computedPinnedStartColumnsWidth:g,computedPinnedEndColumnsWidth:b,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedVisibleColumns:S,computedUnpinnedColumnsWidth:T,scrollbars:C,focusedClassName:w,focusedWithinClassName:I,computedPinnedStartOverflow:v,computedPinnedEndOverflow:x,focusedStyle:R,focusedWithinStyle:P,brain:A}=ie(E=>{let{state:F,computed:X}=E;return{brain:F.brain,actions:E.actions,getState:E.getState,focused:F.focused,focusedWithin:F.focusedWithin,domRef:F.domRef,scrollerDOMRef:F.scrollerDOMRef,onBlurWithin:F.onBlurWithin,onFocusWithin:F.onFocusWithin,onSelfFocus:F.onSelfFocus,onSelfBlur:F.onSelfBlur,bodySize:F.bodySize,activeCellIndex:F.activeCellIndex,wrapRowsHorizontally:F.wrapRowsHorizontally,computedPinnedStartColumnsWidth:X.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:X.computedPinnedEndColumnsWidth,computedPinnedStartColumns:X.computedPinnedStartColumns,computedPinnedEndColumns:X.computedPinnedEndColumns,computedVisibleColumns:X.computedVisibleColumns,computedUnpinnedColumnsWidth:X.computedUnpinnedColumnsWidth,scrollbars:X.scrollbars,focusedClassName:E.state.focusedClassName,focusedWithinClassName:E.state.focusedWithinClassName,computedPinnedStartOverflow:X.computedPinnedStartOverflow,computedPinnedEndOverflow:X.computedPinnedEndOverflow,focusedStyle:E.state.focusedStyle,focusedWithinStyle:E.state.focusedWithinStyle}}),M=[],D=S.reduce((E,F)=>{let X=F.computedVisibleIndex;E[Ie.columnWidths.varName.get(X)]=F.computedWidth+"px",E[Ie.columnOffsets.varName.get(X)]=F.computedPinned==="start"?`calc( ${F.computedOffset}px + var(${Cd}) )`:F.computedPinned==="end"?`calc( var(${Rd}) ${M.length?"+":""} ${M.map(Y=>Ie.columnWidths.get(Y.computedVisibleIndex)).join(" + ")} + var(${Cd}) )`:`${F.computedOffset}px`;let B=as(F,{pinnedStartColsCount:h.length,visibleColsCount:S.length});return E[`${py}-${X}`]=`${B}`,F.computedPinned==="end"&&M.push(F),E},{});if(f.width&&(D[Fr.browserScrollbarWidth.name]=`${_o()}px`),D[Fr.bodyWidth.name]=`calc(${Q.bodyWidth} - ${Q.scrollbarWidthVertical})`,D[Fr.totalVisibleColumnsWidthValue.name]=`${g+b+T}px`,D[Fr.totalVisibleColumnsWidthVar.name]=`calc(${S.map((E,F)=>`var(${fy}-${F})`).join(" + ")})`,D[Fr.visibleColumnsCount.name]=S.length,p!=null){D[my]=Ie.columnWidths.get(p[1]);let E=Ie.columnOffsets.get(p[1]);if(A.isHorizontalLayoutBrain){let F=A.getPageIndexForRow(p[0]);D[wd]=F?`calc( ${he.runtime.totalVisibleColumnsWidthVar} * ${F} + ${E})`:E}else D[wd]=E}D[by]=S.length,D[dy]=C.horizontal?`${e}px`:"0px",D[Td]=C.vertical?`${e}px`:"0px",D[gy]="calc( "+h.map(E=>Ie.columnWidths.get(E.computedVisibleIndex)).join(" + ")+")",D[vd]="calc( "+y.map(E=>Ie.columnWidths.get(E.computedVisibleIndex)).join(" + ")+")",D[Dd]=S.length*10,D[Rd]=`calc( var(${Id}) - var(${vd}) - var(${Td}) )`,D[Id]=`${f.width}px`,D[hy]=`${f.height}px`;let _=is(E=>{t.focused=E}),O=is(E=>{t.focusedWithin=E}),z={...n,onFocus:E=>{if(n?.onFocus?.(E),E.target===a.current||E.target===l.current){if(o().focused)return;_(!0),u?.(E),i&&(O(!1),s?.(E));return}i||(O(!0),c?.(E))},onBlur:E=>{if(n?.onBlur?.(E),E.target===a.current||E.target===l.current){if(!o().focused)return;_(!1),d?.(E),i&&(O(!1),s?.(E));return}a.current?.contains(E.relatedTarget)||(O(!1),s?.(E))}},G=te(Zt,hd,m?`${Zt}--horizontal-layout`:null,z?.className,g?`${Zt}--has-pinned-start ${yd}`:null,b?`${Zt}--has-pinned-end ${bd}`:null,r?`${Zt}--focused`:null,i?`${Zt}--focused-within`:null,r&&w?w:null,i&&I?I:null,v?`${Zt}--has-pinned-start-overflow`:null,x?`${Zt}--has-pinned-end-overflow`:null,Sd({horizontalLayout:!!m,hasPinnedStart:!!g,hasPinnedEnd:!!b,focused:r,focusedWithin:i}));return z.className=G,z.style={...n?.style,...D},r&&R&&Object.assign(z.style,R),i&&P&&Object.assign(z.style,P),z}var Ld=j(on());function ki(n){return n.map(e=>e instanceof No?e:new No(null,[e]))}var No=class n{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new n("+",[this,...e])}subtract(...e){return new n("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new n("*",[this,...e])}divide(...e){return new n("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>yy(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function yy(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var Sy=(...n)=>new No("+",ki(n)),Md=(...n)=>new No("-",ki(n)),Ty=(...n)=>new No("*",ki(n)),Cy=(...n)=>new No("/",ki(n)),Nr={add:Sy,subtract:Md,minus:Md,multiply:Ty,divide:Cy};var nn=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var Ve=De().requestAnimationFrame||(n=>setTimeout(n,16)),Gt=De().cancelAnimationFrame||(n=>clearTimeout(n));var Ad=n=>{let e=null,t=null;return{stop(){e!==null&&Gt(e),t!=null&&Gt(t)},scroll(o){e!==null&&Gt(e),t!=null&&Gt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},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),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft-f,e=Ve(()=>{i.scroll(o)}),!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),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft+f,t=Ve(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var je=class n{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new n(e)}static from(e){return new n(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,o=e.left-this.left;return{top:t,left:o}}};function Ed(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function _d(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function wy(n,e,t){let o=Ed(n,t),r=Ed(e,t);return o===r?_d(t,e)-_d(t,n):o-r}function Od(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>wy(o,r,t)),e}function Iy(n){if(n.length<2)return!1;let e=n[0].left,t=n[0].top,o={left:!1,top:!1};for(let r=1,i=n.length;r<i;r++){if(o.left&&o.top)return!1;n[r].left!==e&&(o.left=!0),n[r].top!==t&&(o.top=!0)}return!(o.left&&o.top)}function Ry(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=Od(n);let t=n[0],o=n[n.length-1];return t.left===o.left?e.left===t.left&&e.top>=Math.min(t.top,o.top)&&e.top<=Math.max(t.top,o.top):e.top===t.top&&e.left>=Math.min(t.left,o.left)&&e.left<=Math.max(t.left,o.left)}function Fd(n,e){if(Iy(n))return Ry(n,e);n=Od(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(vy([t,i,a],e))return!0}return!1}function vy(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var Vn=class{containsPoint(e){return Fd(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Gn=class n extends Vn{static clone(e){return new n(e)}constructor(e){super(),this.points=e.map(je.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function Dy(n,e){let t=Math.min(n.left,e.left),o=Math.min(n.top,e.top),r=n.left+n.width,i=e.left+e.width,a=Math.max(r,i),l=n.top+n.height,s=e.top+e.height,c=Math.max(l,s);return new xe({top:o,left:t,width:a-t,height:c-o})}var xe=class n extends Vn{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 n(t)}static clone(t){return new n(t)}static from(t){return n.clone(t)}static fromPoint(t){return n.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let o=this;for(let r of t)o=Dy(o,r);return o}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 Gn(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(je.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var Nd=10,xy=ee(Q.pinnedStartWidth);function kd(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:f,setProxyPosition:p,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:b,horizontalLayoutPageIndex:h,pageWidth:y}=n;function S(k){let U=k==="start"?V:z;return _===L?U:L===k?U+M.computedWidth:_===k?U-M.computedWidth:U}function T(k){if(k.columnIndex===D||h!=null)return!0;let U=e[k.columnIndex];if(U.computedPinned)return!0;let K=l.getScrollPosition().scrollLeft,Z=U.computedOffset+(h!=null&&y!=null?y*h:0);return Z>=K+S("start")&&Z+U.computedWidth<=K+u.width-S("end")}let C=(k,U)=>{let{restrictToParentGroup:K,dragColumn:Z}=U,ne=[];if(k.forEach(ce=>{if(ce.computedVisibleIndex===D)return;let N={columnId:ce.id,columnIndex:ce.computedVisibleIndex,offsetX:ce.computedOffset+Math.round(ce.computedWidth/2)};T(N)&&ne.push(N)}),K){let N=function(fe,me,Me){let Ae=k[fe];Ae&&(Ae.columnGroup!==Z.columnGroup&&Me.add(Ae.id),N(fe+me,me,Me))};var H=N;let ce=Z.computedVisibleIndex,J=new Set;N(ce-1,-1,J),N(ce+1,1,J),ne=ne.filter(fe=>!J.has(fe.columnId))}return ne},I=r.length,v={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},x={left:v.clientX-u.left-(v.clientX-s.left)+Nd,top:v.clientY-u.top-(v.clientY-s.top)+Nd},R=l.getScrollPosition(),P=e.map(k=>k.computedVisibleIndex),A=P,M=t.get(i),D=M.computedVisibleIndex,_=M?.computedPinned,O=D,L=_,V=l.getFixedStartColsWidth(),z=l.getFixedEndColsWidth(),G=v,E={x:0,y:0},F=1,X=0;function B(k){let U=Math.round(k.clientX),K=Math.round(k.clientY);if(U===G.clientX&&K===G.clientY)return xe.from(s).shift({left:E.x,top:E.y});G={clientX:U,clientY:K};let ne=l.getScrollPosition().scrollLeft-R.scrollLeft;return E.x=G.clientX-v.clientX,E.y=G.clientY-v.clientY,X=E.x+ne,F=X<0?-1:1,p({left:x.left+E.x,top:x.top+E.y}),xe.from(s).shift({left:E.x,top:E.y})}function Y(k){let U=0;_?_==="start"&&k.forEach((K,Z)=>{U||e[K]?.computedPinned!=="start"&&(U=Z)}):k.forEach((K,Z)=>{e[K]?.computedPinned==="start"&&(U=Z+1)}),I=U,re("start",k,U)}function re(k,U,K){if(k==="start"){let Z=0;for(let ne=0;ne<K;ne++){let H=U[ne],ce=e[H];Z+=ce.computedWidth}Xt(xy,`${Z}px`,a)}}function ge(k){if(k==null||k===O)return;if(O===-1&&k!==-1&&(Or(D,"",a),m(!1)),O=k,k===-1){be(D);return}let U=nn(P,D,O>D?O-1:O);I=0;let Z=new Set;return U.forEach((ne,H)=>{let ce=A[H];ne!==ce&&Z.add(ne),Y(U)}),A=U,ae(Z),{newColumnIndexes:U,indexesWithTransition:Z,pinnedStartCount:I}}function be(k){A=A.filter(K=>K!==k),e.forEach(K=>{let Z=K.computedVisibleIndex,ne=Z>k;ns(Z,a);let H="";ne&&(H=Nr.minus(Ie.columnOffsets.get(Z),Ie.columnWidths.get(k)).done()),_r(Z,H,a)}),Or(k,"hidden",a),m(!0)}function ae(k){e.forEach(U=>{let K=U.computedVisibleIndex;k.has(K)?ns(K,a):Li(K,a);let Z=K===D,ne=F===-1?K<O||K>D:K<D||K>=O,H="";F===-1?H=Z?Ie.columnOffsets.get(O):ne?Ie.columnOffsets.get(K):Nr.add(Ie.columnOffsets.get(K),Ie.columnWidths.get(D)).done():H=ne?Ie.columnOffsets.get(K):Z?Nr.add(Ie.columnOffsets.get(O-1),Ie.columnWidths.get(O-1)).minus(Ie.columnWidths.get(D)).done():Nr.minus(Ie.columnOffsets.get(K),Ie.columnWidths.get(D)).done(),_r(K,H,a)})}let de=u.left+S("start"),pe=u.right-S("end"),q=Ad({scrollOffsetStart:de,scrollOffsetEnd:pe});return B(v),{speedScroller:q,stop(){q.stop()},onMove(k){let U=B(k);if(g().dropTargetListId==="grouping-toolbar"||f&&!d.containsPoint(U.getCenter()))return f&&ge(-1),null;q.scroll({mousePosition:G,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(N){b.scrollLeft=N}});let K=C(e,{dragColumn:M,restrictToParentGroup:c==="group"}),Z=F===-1?M.computedOffset+X:M.computedOffset+M.computedWidth+X,ne=(0,Ld.default)(K,Z,({offsetX:N},J)=>N<J?-1:N>J?1:0);ne<0&&(ne=~ne),K.length?ne=K[ne]?K[ne].columnIndex:K[K.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ne=0),ne===D+1&&(ne=D),ge(ne);let H={};o.forEach(N=>{H[N.id]="end"});for(let N=0;N<I;N++){let J=A[N],fe=e[J];H[fe.id]="start"}let ce=A.map(N=>e[N].id);return{columnPinning:H,columnOrder:ce}}}}function ls(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;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 o;if(a>i){let l=e.indexOf(r),s=e[l-1],c=o.indexOf(s),u=o.indexOf(r);return nn(o,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=o.indexOf(s),u=o.indexOf(r);return nn(o,u,c)}return e}var Tt=j(require("react"));var rn=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 o=((...r)=>{this.off(e,o),t(...r)});return this.on(e,o)}off(e,t){let o=this.listeners[e];if(!o)return;let r=o.indexOf(t);r!==-1&&o.splice(r,1)}emit(e,...t){let o=this.listeners[e];o&&o.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 zd=j(on());var Vd=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=o,f=c===a,p=je.from(d.getCenter());if(!l.containsPoint(p))return null;e.activeDragSourcePosition="inside";let m=f?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),b=e.breakpoints,h=Math.round(m===1?r==="horizontal"?g.right-(f?0:g.width/2):g.bottom-(f?0:g.height/2):r==="horizontal"?g.left+(f?0:g.width/2):g.top+(f?0:g.height/2)),y=(0,zd.default)(b,h,(I,v)=>I-v);y<0&&(y=~y),m===1&&y===u+1&&f&&y--;let S=Math.min(u,y),T=Math.max(u,y),C=f?i.map((I,v)=>{if(v===u&&f)return t;if(v<S||v>=T)return{left:0,top:0};let x=y<=v?1:-1;return r==="horizontal"?{left:Math.round(x*g.width),top:0}:{left:0,top:Math.round(x*g.height)}}):i.map((I,v)=>{let x=y<=v?1:0;return r==="horizontal"?{left:Math.round(x*g.width),top:0}:{left:0,top:Math.round(x*g.height)}}),w={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:C,dragRect:g,status:"accepted"};return e.acceptsDrop(w)?{event:w,error:null,success:!0}:(w.status="rejected",{event:w,error:"rejected by interaction target",success:!1})},Gd=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=o,d=je.from(s.getCenter()),f=u===i,p=a.containsPoint(d);if(p&&!(f&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!f)return null;e.activeDragSourcePosition="outside";let m=f?o.dragIndex:-1,g=s.toDOMRect(),b={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!p,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:f?l.map((h,y)=>h.id===c.id?t:p?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(h=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(b)?{event:b,error:null,success:!0}:(b.status="rejected",{event:b,error:"rejected by interaction target",success:!1})};var Re=class Re{static startDrag(e,t){let o=e instanceof Hn?e:new Hn(e),r=new ss({activeDragSource:o,startPoint:t});return Re.currentDragOperation=r,r.on("start",Re.onDragStart),r.on("move",Re.onDragMove),r.on("drop",Re.onDragDrop),r.start(),r}static retriggerMove(){let e=Re.currentDragOperation;e&&e.phase==="move"&&Re.onDragMove(e)}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:o}=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?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Re.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:o})}static withDragMove(e,t){let{activeDragSource:o}=e,{listId:r}=o,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=Vd(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=Gd(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,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:o,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:o,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:o,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),Re.currentDragOperation=null,Re.unregisterAll()}};Re.dragInteractionTargetsMap=new Map,Re.currentDragOperation=null,Re.emitter=new rn;var St=Re,Hn=class n{static clone(e){let t=e.getData();return new n(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){yt(this.data,e)||(this.data=e,this.dragRectangle=new xe(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=xe.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},ss=class extends rn{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=Hn.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:o}=this.activeDragSource,r={dragSourceListId:t,dragItemId:o.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 o={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=Hn.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=St;var Hd=require("react"),Kd=Tt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),uo=()=>Tt.useContext(Kd),zi=n=>{let[e,t]=Tt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=Tt.useRef(e);o.current=e;let r=Tt.useCallback(()=>{let a=o.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=Tt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,Hd.useEffect)(()=>{let a=St.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=St.on("drag-move",c=>{let u=o.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=St.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[St,t]),Tt.createElement(Kd.Provider,{value:i},typeof n.children=="function"?n.children(i):n.children)};var cs=`${mt}Body`,Bd=n=>n.querySelector(`.${cs}`);var an=`${mt}HeaderCell`,us=`${mt}HeaderWrapper`,Wd=n=>Array.from(n.querySelectorAll(`.${us}`));function Vi(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var Py=ee(Q.baseZIndexForCells),My=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:yt(n,e)},$d=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=(0,Kn.useState)(null),[a,l]=(0,Kn.useState)(!1),{getCurrentDragSourceAndTarget:s}=uo(),{getComputed:c,getState:u,api:d,computedDraggable:f,rootRef:p,actions:m}=ie(h=>({actions:h.actions,getComputed:h.getComputed,getState:h.getState,api:h.api,computedDraggable:h.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:h.state.domRef})),g=(0,Kn.useCallback)(h=>{let y=c().computedVisibleColumnsMap.get(n);if(!y||!y.computedSortable)return;let{multiSortBehavior:S}=u();d.toggleSortingForColumn(n,{multiSortBehavior:S==="replace"&&(h.ctrlKey||h.metaKey)?"append":S})},[]),b=(0,Kn.useCallback)(h=>{if(Vi(h.target))return;let{brain:y,draggableColumnsRestrictTo:S}=u(),{computedVisibleColumns:T,computedVisibleColumnsMap:C,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedPinnedEndColumns:v}=c(),x=C.get(n);if(!x.computedDraggable){g(h);return}let R=e.current,P=R.getBoundingClientRect(),A=p.current.getBoundingClientRect(),M=y.getAvailableSize(),D=x.computedVisibleIndex,_=y.getVirtualColIndex(x.computedVisibleIndex,{pageIndex:t||0}),O=y.isHorizontalLayoutBrain?y.getPageWidth():null,L=R.style.cursor??"auto",V=!1,z=p.current,G=xe.from(Bd(z).getBoundingClientRect()),E=Wd(z).map(de=>xe.from(de.getBoundingClientRect())),F=G.getMinimumBoundingRectangle(...E),X=kd({brain:y,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:O,draggableColumnsRestrictTo:S,computedPinnedEndColumns:v,computedPinnedStartColumns:w,computedUnpinnedColumns:I,computedVisibleColumns:T,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:P,dragColumnId:n,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:p.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:F,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),B=null,Y,re;function ge(de){let{columnPinning:pe,columnOrder:q}=de;My(u().columnPinning,pe)||(m.columnPinning=pe);let k=c().computedColumnOrder;JSON.stringify(q,k)&&(m.columnOrder=ls({newColumnOrder:q,visibleColumnOrder:c().computedVisibleColumns.map(U=>U.id),existingColumnOrder:k,dragColumnId:n}))}let be=de=>{let{headerBrain:pe,brain:q}=u();if(!V){V=!0;let k=q.keepColumnRendered(_),U=pe.keepColumnRendered(_);if(q.isHorizontalLayoutBrain){let Z=q.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ne=pe.extendRenderRange({start:!0,end:!0,direction:"horizontal"});re=()=>{Z(),ne()}}Y=()=>{k(),U()},m.columnReorderDragColumnId=x.id,t!=null&&(m.columnReorderInPageIndex=t),os(D,`calc( var(${Py}) + 10000 )`,p.current),p.current?.classList.add(rs),R.style.cursor="grabbing"}B=X.onMove(de)},ae=de=>{let pe=de.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:q}=u(),k=e.current,U=p.current;U?.classList.remove(rs),X.stop(),y.update({...M}),Y?.(),re?.(),k.style.cursor=L,k.releasePointerCapture(pe),k.removeEventListener("pointermove",be),k.removeEventListener("pointerup",ae),i(null);let K=d.getColumnApi(x.id)?.isSortable()??!1;!V&&K&&d.toggleSortingForColumn(x.id,{multiSortBehavior:q==="replace"&&(de.ctrlKey||de.metaKey)?"append":q}),(0,jd.flushSync)(()=>{B?ge(B):V&&o&&d.setVisibilityForColumn(x.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),T.forEach(Z=>{Li(Z.computedVisibleIndex,U),Or(Z.computedVisibleIndex,"",U),_r(Z.computedVisibleIndex,"",U)}),os(D,as(x,{pinnedStartColsCount:w.length,visibleColsCount:T.length}),U)})};R.addEventListener("pointermove",be),R.addEventListener("pointerup",ae),R.setPointerCapture(h.pointerId)},[n,t]);return{onPointerDown:f?b:g,dragColumnOutside:a,proxyPosition:r}};var Wn=j(require("react"));var Ce=j(require("react")),Ke=require("react");var sn=j(require("react"));var Ud=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;var Lr=j(require("react")),Xd=require("react");var Yd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",qd=ye({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 Gi=`${vt}-expand-collapse`;function ln(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=(0,Xd.useState)(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),Mo("expanded",n)||i(!r)};Lr.useEffect(()=>{Mo("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return Lr.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:te(n.className,Yd,qd({direction:t||"start",expanded:r,disabled:o}),`${vt}`,`${Gi}`,`${Gi}--${l}`,`${Gi}--${t==="end"?"end":"start"}`,o?`${Gi}--disabled`:"")},Lr.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}var Hi=j(require("react"));var Zd="_16lm1iwb _16lm1iw1d _16lm1iwk";var Qd=n=>Hi.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:te(n.className,Zd,"InfiniteIcon","InfiniteIcon-loading")},Hi.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},Hi.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var{rootClassName:Ay}=ke,Qt=`${Ay}ColumnCell`;var Jd=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),ef="_7pupv00",tf=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function of({rowInfo:n}){return{[ee(he.components.Row.groupNesting)]:n.dataSourceHasGrouping?n.isGroupRow?n.groupNesting-1:n.groupNesting:0}}function Ki({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=o,d=te(_n.flex,i.align==="end"?Pr.rowReverse:Pr.row,iu.center,`${Qt}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||c)?Jd({align:a}):null);if(e==="multi-column"){if(n+1!==u.groupNesting&&u.isGroupRow)return c?sn.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return sn.createElement("div",{className:d},s,c,sn.createElement("div",{className:qt},l??null))}}function Bi({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===n&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&n+1!==u.groupNesting)return null;let f=u.groupKeys,p=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return Ud(u)?p=sn.createElement(Qd,null):m&&(p=sn.createElement(ln,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(f)}})),o&&(r.renderBag.groupIcon=p,p=sn.createElement(Ct,{render:o,renderParam:r})),p}}function nf(n,e,t){let{groupByForColumn:o,groupIndexForColumn:r,groupRenderStrategy:i}=n,a=o.column?{...o.column}:{},l={header:`Group by ${o.field||o.groupField}`,groupByForColumn:o,render:Ki({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:Bi({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(n,e)}:l={...l,...t}),l}function rf(n,e,t){let o=typeof t=="function"?t(n,e):t,r={};return n.sortable!=null&&(r.sortable=n.sortable),{...r,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:Ki({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...o,renderGroupIcon:Bi({initialRenderGroupIcon:o?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}var af="_1eexc2a7 _1eexc2a6",lf=ye({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"]]}),sf=ye({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 cf="_1eexc2a5",Wi=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),ji="_1eexc2a8";var $i=j(require("react")),Ui=require("react");var uf="qz8ht90 _16lm1iwk";function Ey(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:_y}=Ft({forwardProps:Ey,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function Oy(){let{componentState:n,componentActions:e}=Nt(),{checked:t,domProps:o,disabled:r}=n,i=(0,Ui.useRef)(null);return(0,Ui.useEffect)(()=>{i.current.indeterminate=t==null},[t]),$i.createElement("input",{...o,className:te("InfiniteCheckBox",uf,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function fo(n){return $i.createElement(_y,{...n},$i.createElement(Oy,null))}function Fy(n){return typeof n.field=="string"}function df(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?o.get(i.field||i.groupField):void 0}!r&&e.field&&(r=o.get(e.field))}return r}function Dt(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,f=e().computedColumnsMap.get(i),{activeRowIndex:p,keyboardNavigation:m,isRowDetailEnabled:g}=o(),b=r===p&&m==="row",h=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:S}}=Bn({column:f,rowInfo:c,rowDetailState:h,columnsMap:e().computedColumnsMap,context:n}),T=gt(f.id,n);return u?{api:a,dataSourceApi:l,column:f,columnApi:T,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}}function ff(n){return mf(n.column,n.rowInfo)}function pf(n){let{column:e,context:t,rowInfo:o,visibleColumnsIds:r}=n,i=df({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Bn(n),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let f=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",p=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:Ny({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnsIds:n.visibleColumnsIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:f,verticalAlign:p,formattedValueContext:c}),groupByColumnReference:i}}function Ny(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=n,{value:u}=c,{api:d,getDataSourceState:f,getState:p,dataSourceApi:m}=t,{editingCell:g}=p(),{indexInAll:b}=o,h=f(),{selectionMode:y,cellSelection:S}=h,T=df({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,w=S?.isCellSelected(o.id,e.id)??!1,I={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:w,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===o.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:T,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.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:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:b,toggleGroupRow:C,toggleCurrentGroupRow:()=>{o.isGroupRow&&C(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:h.groupBy,pivotBy:h.pivotBy};return Object.defineProperty(I,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),I}function mf(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:Fy(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function Ly(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:n,rawValue:n,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:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}}function Bn(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=mf(e,t),a=Ly(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var po=j(require("react"));var{rootClassName:gf}=ke,cn=`${gf}Cell`,ds=`${gf}Cell_content`,ky=ee(Q.columnWidthAtIndex),zy=ee(Q.columnReorderEffectDurationAtIndex);function Vy(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:f,cssPosition:p,renderChildren:m,horizontalLayoutPageIndex:g,...b}=n,h=typeof m=="function"?m():m,y={width:`var(${ky}-${i.computedVisibleIndex})`,transition:`transform var(${zy}-${i.computedVisibleIndex}, 0s)`,...b.style},S={...b,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:te(b.className,cn,af),children:po.createElement(po.Fragment,null,d,po.createElement("div",{className:te(ds,e?qt:du.hidden,s),style:r},h),u)};c!=null&&(S["data-row-id"]=`${c}`);let T=f==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?po.createElement(T,{...S,ref:a}):po.createElement("div",{...S,ref:a})}var Yi=po.memo(Vy);var dn=j(require("react")),un=require("react");function hf(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=qi(),i=(0,un.useRef)(null),a=(0,un.useRef)(!1),l=dn.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=(0,un.useCallback)(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):u.stopPropagation()},[]),c=(0,un.useCallback)(()=>{a.current||t()},[]);return dn.createElement(dn.Fragment,null,dn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:te(ru,uu.none),type:"text",defaultValue:n,onChange:(0,un.useCallback)(u=>{e(u.target.value)},[])}))}function bf(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var Gy=ee(Q.columnZIndexAtIndex),Hy=ee(Q.columnVisibilityAtIndex);function Ky({rowInfo:n}){return{[ee(he.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}var kr=Ce.createContext(null),By=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Ce.createElement(ln,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},Wy={display:"inline-block",visibility:"visible"},fs=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Ce.createElement(ln,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:Wy,expanded:o,onChange:t})},jy=n=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:o,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=n;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||fo;return Ce.createElement(u,{domProps:{className:ji},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():o()},checked:e.rowSelected})};function ps(n,e){return n?typeof n=="function"?n(e):n:void 0}function ms(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function $y(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,cellStyle:s,cellClassName:c,rowDetailState:u,width:d,column:f,onMouseLeave:p,onMouseEnter:m,onRowMouseEnter:g,onRowMouseLeave:b,rowIndex:h,rowHeight:y,columnsMap:S,fieldsToColumn:T,domRef:C,hidden:w,showZebraRows:I,getDataSourceState:v,dataSourceApi:x,dataSourceActions:R,getState:P,imperativeApi:A,componentActions:M,getComputed:D,getDataSourceMasterContext:_}=n,O=(0,Ke.useSyncExternalStore)((0,Ke.useCallback)(Ee=>t.subscribeToRowIndex(h,Ee),[t,h]),(0,Ke.useCallback)(()=>t.getRowInfoAtIndex(h),[t,h])),L=!O,V=!f,z=Ce.useRef(null),G=(0,Ke.useCallback)(Ee=>{z.current=Ee,C&&C(Ee)},[C]),E=O??{id:"",indexInAll:h,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:F}=E,X=D(),{activeRowIndex:B,keyboardNavigation:Y,columnReorderInPageIndex:re}=P(),ge=h===B&&Y==="row",be={getState:P,getDataSourceState:v,getDataSourceMasterContext:_,actions:M,dataSourceActions:R,api:A,dataSourceApi:x},ae=E.rowDisabled,de=X.computedVisibleColumns.map(Ee=>Ee.id),pe=pf({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:f,rowInfo:E,rowDetailState:u,columnsMap:S,visibleColumnsIds:de,fieldsToColumn:T,context:be}),{stylingParam:q,renderParams:k,formattedValueContext:U,renderFunctions:K,groupByColumnReference:Z,inEdit:ne}=pe,{align:H,verticalAlign:ce}=k,N=k,J=Ce.useRef(N),fe=g&&m?Ee=>{let lo={...U,rowIndex:h};g(lo,Ee),m(Ee)}:m,me=b&&p?Ee=>{let ft={...U,rowIndex:h,rowInfo:E};b(ft,Ee),p(Ee)}:p,Me=(0,Ke.useCallback)(Ee=>{let ft=f.computedVisibleIndex;P().cellClick({rowIndex:h,colIndex:ft,event:Ee})},[h,f.computedVisibleIndex,Y]),Ae=(0,Ke.useCallback)(Ee=>{let ft=f.computedVisibleIndex;if(P().cellMouseDown({rowIndex:h,colIndex:ft,event:Ee}),Y==="row"){ae||(M.activeRowIndex=h);return}Y==="cell"&&(M.activeCellIndex=[h,ft])},[h,ae,f.computedVisibleIndex,Y]),{selectionMode:Ge,cellSelection:Ne,isNodeReadOnly:Le}=e,We=N.cellSelected;N.domRef=G,N.htmlElementRef=z,N.toggleCurrentTreeNode=(0,Ke.useCallback)(N.toggleCurrentTreeNode,[E]),N.selectCell=(0,Ke.useCallback)(N.selectCell,[E]),N.deselectCell=(0,Ke.useCallback)(N.deselectCell,[E]),N.selectCurrentRow=(0,Ke.useCallback)(N.selectCurrentRow,[E]),N.deselectCurrentRow=(0,Ke.useCallback)(N.deselectCurrentRow,[E]),N.toggleCurrentGroupRow=(0,Ke.useCallback)(N.toggleCurrentGroupRow,[E]),N.toggleCurrentRowSelection=(0,Ke.useCallback)(N.toggleCurrentRowSelection,[E]),N.toggleCurrentGroupRowSelection=(0,Ke.useCallback)(N.toggleCurrentGroupRowSelection,[E]),N.toggleCurrentTreeNodeSelection=(0,Ke.useCallback)(N.toggleCurrentTreeNodeSelection,[E]);let et=f.components?.Editor??hf,tt=ne?Ce.createElement(Sf,{contextValue:N},Ce.createElement(et,null)):null,ot=(0,Ke.useCallback)(pt(()=>{if(w||ne)return null;if(J.current=N,K.renderGroupIcon&&(N.renderBag.groupIcon=Ce.createElement(Ct,{render:K.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),K.renderSelectionCheckBox&&Ge=="multi-row"&&(N.renderBag.selectionCheckBox=Ce.createElement(Ct,{render:jy,renderParam:N}),K.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=Ce.createElement(Ct,{render:K.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),E.isTreeNode){let{isParentNode:lo}=E,Vt;Vt=(lo?K.renderTreeIconForParentNode:K.renderTreeIconForLeafNode)||typeof K.renderTreeIcon=="function"?K.renderTreeIcon:lo&&K.renderTreeIcon===!0?fs:void 0,Vt===!0?Vt=fs:Vt&&(N.renderBag.treeIcon=Ce.createElement(Ct,{render:fs,renderParam:N})),Vt&&(N.renderBag.treeIcon=Ce.createElement(Ct,{render:Vt,renderParam:{...N,renderBag:{...N.renderBag}}}))}K.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=Ce.createElement(Ct,{render:By,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof K.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=Ce.createElement(Ct,{render:K.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),K.renderValue&&(N.renderBag.value=Ce.createElement(Ct,{render:K.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),E.isGroupRow&&K.renderGroupValue&&(N.renderBag.value=Ce.createElement(Ct,{render:K.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!E.isGroupRow&&K.renderLeafValue&&(N.renderBag.value=Ce.createElement(Ct,{render:K.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),J.current=N;let Ee=N.renderBag.value;Ee instanceof Date&&(Ee=Ee.toLocaleDateString());let ft=Ce.createElement(Ce.Fragment,null,H!=="end"?N.renderBag.treeIcon:null,H!=="end"?N.renderBag.groupIcon:null,H!=="end"?N.renderBag.rowDetailsIcon:null,H!=="end"?N.renderBag.selectionCheckBox:null,Ee,H==="end"?N.renderBag.selectionCheckBox:null,H==="end"?N.renderBag.rowDetailsIcon:null,H==="end"?N.renderBag.groupIcon:null,H==="end"?N.renderBag.treeIcon:null);return f.render?Ce.createElement(Ct,{render:f.render,renderParam:{...N,renderBag:{...N.renderBag,all:ft}}}):ft}),[f,w,ne,u,f.renderTreeIcon||f.renderTreeIconForParentNode?Le:!1,...bf(N,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),$=X.computedVisibleColumns.map(Ee=>Ee.id),se=X.computedColumnOrder,ue={...U,visibleColumnIds:$,allColumnIds:se,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(ue,"rowHasSelectedCells",{get(){return E.hasSelectedCells($)}});let Se=E.isTreeNode&&(f.renderTreeIcon||f.renderTreeIconForLeafNode||f.renderTreeIconForParentNode),qe=typeof r=="function"?r(ue):r,le;Z?.className&&(le=ps(Z.className,q)),c&&(le=te(le,ps(c,q))),f.className&&(le=te(le,ps(f.className,q))),Se&&(le=te(le,tf({align:H})));let W;E.dataSourceHasGrouping&&f.groupByForColumn&&(W=of({rowInfo:E})),Se&&(W=Ky({rowInfo:E})),o&&(W=typeof o=="function"?{...W,...o(ue)}:{...W,...o}),s&&(W=ms(W,s,q)),Z?.style&&(W=ms(W,Z.style,q)),f.style&&(W=ms(W,f.style,q)),W=W||{},W.height=y,W.zIndex=`var(${Gy}-${f.computedVisibleIndex})`,W.visibility=`var(${Hy}-${f.computedVisibleIndex}, visible)`;let it=(0,Ke.useMemo)(()=>W,[W?JSON.stringify(W):null]),we=i!=null?i%2===1:(E.indexInAll!=null?E.indexInAll:h)%2===1,at=I?we?"odd":"even":!1,Rt=!1,zt=!1,br=!1,xn=!1;if(Ne&&We){let Ee=l(),ft=Ee[E.indexInAll-1],lo=Ee[E.indexInAll+1],Vt=X.computedVisibleColumns[f.computedVisibleIndex+1],Sr=X.computedVisibleColumns[f.computedVisibleIndex-1];Rt=ft?!Ne.isCellSelected(ft.id,f.id):!0,f.computedPinned==="end"&&f.computedFirstInCategory?zt=!0:zt=Sr?!Ne.isCellSelected(E.id,Sr.id):!0,f.computedPinned==="start"&&f.computedLastInCategory?br=!0:br=Vt?!Ne.isCellSelected(E.id,Vt.id):!0,xn=lo?!Ne.isCellSelected(lo.id,f.id):!0}let yr=Ne&&We?{top:Rt,left:zt,right:br,bottom:xn}:null,ml=re!=null?a!==re:!1,gl=tt,hl=ot(),dt={domRef:G,cellType:"body",column:f,width:d,rowId:E.id,horizontalLayoutPageIndex:a,style:it,onMouseLeave:me,onMouseEnter:fe,onClick:Me,afterChildren:gl,onMouseDown:Ae,cssEllipsis:f.cssEllipsis??!0,className:te(yr?sf(yr):"",Ni(f,[Qt,cn],lf,{dragging:!1,insideDisabledDraggingPage:ml,zebra:at,align:H,verticalAlign:ce,rowDisabled:ae,rowActive:ge,cellSelected:We,rowSelected:F,treeNode:E.isTreeNode?E.isParentNode?"parent":"leaf":!1,firstRow:E.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:E.isGroupRow,groupCell:E.isGroupRow?!!f.groupByForColumn:!1,rowExpanded:E.isGroupRow?!E.collapsed:!1}),le,qe),renderChildren:(0,Ke.useCallback)(()=>hl,[ot])},ui=kr.Provider;return V||L?Ce.createElement("div",{ref:G,style:{display:"none"}}):Ce.createElement(ui,{value:J.current},Ce.createElement(Yi,{...dt}))}var yf=Ce.memo($y);function zr(){return(0,Ke.useContext)(kr)}function qi(){let{api:n,editingValueRef:e,editingCell:t}=ie(p=>({api:p.api,editingCell:p.state.editingCell,editingValueRef:p.state.editingValueRef})),{column:o,rowInfo:r}=zr(),[i]=Ce.useState(()=>t?.value),[a,l]=Ce.useState(i),s=t?!t.active&&!!t.waiting:!1,c=Ce.useCallback(p=>{e.current=p,l(p)},[]);Ce.useLayoutEffect(()=>{e.current=i},[]);let u=n.confirmEdit,d=n.cancelEdit,f=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:f}}function Vr(n){return n.render(n.renderParam)??null}function Ct(n){let e=kr.Provider;return Wn.createElement(e,{value:n.renderParam},Wn.createElement(Vr,{render:n.render,renderParam:n.renderParam}))}function Sf(n){let e=kr.Provider;return Wn.createElement(e,{value:n.contextValue},n.children)}function Lo(n){let e=Xi.Provider;return Wn.createElement(e,{value:n.renderParam},Wn.createElement(Vr,{render:n.render,renderParam:n.renderParam}))}var ko=j(require("react"));var Uy={width:"100%",pointerEvents:"none"},gs=`${vt}-menu`,hs=Di({"data-name":""}),bs={[hs["data-name"]]:"menu-icon"};function Gr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...Uy,borderTop:`${he.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return ko.createElement("div",{...o,style:e,...bs,onPointerDown:s=>s.stopPropagation(),className:te(t,Hu({menuVisible:i,reserveSpaceWhenHidden:r}),vt,`${vt}-menu`)},a??ko.createElement(ko.Fragment,null,ko.createElement("div",{className:gs,style:l}),ko.createElement("div",{className:gs,style:l}),ko.createElement("div",{className:gs,style:l})))}var jn=j(require("react")),Hr=require("react");var Tf="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Yy={transition:"width 0.25s, opacity 0.25s"};function Zi(n){let[e,t]=(0,Hr.useState)(!0),[o,r]=(0,Hr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=n,u=c!=null&&c>0,d=n.size??16,f=Math.floor(d/4),p=i?[d-3*f,d-2*f,d-f]:[0,0,0];i===-1&&p.reverse();let m={...Yy,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};(0,Hr.useEffect)(()=>{let h=i!=0?1:0;if(!e&&h&&t(!0),h!==o){let y=requestAnimationFrame(()=>{r(h)});return()=>{cancelAnimationFrame(y)}}return()=>{}},[i,e]);let g=()=>{let y=!(o===0&&i===0);y!==e&&t(y)};if(!e&&!n.forceSize)return null;let b={};return i===-1&&(b.top="100%"),jn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:te(s,vt,Tf,`${vt}-sort`)},u?jn.createElement("div",{"data-name":"index",style:b,className:Wu},c):null,jn.createElement("div",{style:{width:p[0],...m},onTransitionEnd:g}),jn.createElement("div",{style:{width:p[1],...m}}),jn.createElement("div",{style:{width:p[2],...m}}))}var Rf=j(require("react")),ys=require("react");var Kr=require("react"),Br=j(require("react"));function Cf(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){Ie.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;Ie.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?ts(l,i,o.current):Ie.columnOffsets.set(a,l.computedOffset+i,o.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"){ts(c,i,o.current);continue}c.computedPinned!=="end"&&Ie.columnOffsets.set(l,c.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||Ie.columnOffsets.set(l,c.computedOffset+i,o.current)}}}}}function wf(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,c=i.current;if(o.forEach((u,d)=>{s+=u;let f=n[d],p=r[f],m=p.computedWidth+u;Ie.columnWidths.set(f,m,c),p.computedPinned!=="end"&&(l&&Ie.columnOffsets.set(f,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&Ie.columnOffsets.set(u,d.computedOffset+s,c)}}}}var Qi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Ji=ye({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,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),ea=ye({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:qy}=ke,Xy=`${qy}HeaderCell_ResizeHandle`;function Zy(n){let{brain:e,headerBrain:t}=ie(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=(0,Kr.useRef)(null),[r,i]=(0,Kr.useState)(!1),a=(0,Kr.useRef)(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,f=()=>{},p=g=>{g.stopPropagation();let b=!!g.shiftKey,h=g.pointerId,y=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),x=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});f=()=>{v(),x()}}S.setPointerCapture(h);let T=Cf(n.columnIndex,{columns:n.columns,shareSpaceOnResize:b,domRef:o}),C=(v,{done:x}={})=>{s&&(v=v/(s+1),x&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:R,constrained:P}=n.computeResize({diff:v,shareSpaceOnResize:b});return a.current!==P&&i(P),T.resize(R),R},w=v=>{C(Math.round(v.clientX-y))},I=v=>{S.releasePointerCapture(h),S.removeEventListener("pointermove",w),S.removeEventListener("pointerup",I);let x=Math.round(v.clientX-y),R=C(x,{done:!0});f(),n.onResize({diff:R,shareSpaceOnResize:b})};S.addEventListener("pointermove",w),S.addEventListener("pointerup",I)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Br.createElement("div",{ref:o,className:`${Xy} ${Qi} ${ea({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:p},Br.createElement("div",{style:m,className:Ji({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var If=Br.memo(Zy);function vf(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=ie(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=(0,ys.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let d=o(),{columnSizing:f,viewportReservedWidth:p,bodySize:m}=d,g=r().computedVisibleColumns,b=!1,h=g.reduce((T,C)=>(C.computedFlex&&(T[C.id]={...f[C.id],flex:C.computedWidth},b=!0),T),{}),y=b?{...f,...h}:f;return jl({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:p||0,dragHandleOffset:c,dragHandlePositionAfter:n.computedVisibleIndex,columnSizing:y,items:g.map(T=>({id:T.id,computedFlex:T.computedFlex,computedWidth:T.computedWidth,computedMinWidth:T.computedMinWidth,computedMaxWidth:T.computedMaxWidth}))})},[n,o,r]),l=(0,ys.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:f}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=f),i.columnSizing=d},[a,i]);return n.computedResizable?Rf.createElement(If,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}var Ye=j(require("react"));var Jt=require("react");var Df=ye({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),xf=ye({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Pf(n,e){return yt(n,e)}var $n=class extends rn{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 Pf(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Pf(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let o=!0;return typeof this.data.shouldAcceptDrop=="function"&&(o=this.data.shouldAcceptDrop(t)),o=!!o,o!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=o,o?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),o}adjustForScroll(t){this.breakpoints=this.breakpoints.map(o=>o-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let o=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>o||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=o?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:o,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(p,m)=>m),d=[];o===-1?d=u.filter(p=>p!==r):d=nn(u,r,o>r?o-1:o);let f={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",f)}};var Qy={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function Jy(n,e){let t=getComputedStyle(n),o=e==="vertical"?t.overflowY:t.overflowX;return o!=="auto"&&o!=="scroll"?!1:e==="vertical"?n.scrollHeight>n.clientHeight:n.scrollWidth>n.clientWidth}function eS(n,e){let t=n;for(;t&&!(t===document.documentElement||t===document.body);){if(Jy(t,e))return t;t=t.parentElement}return null}function tS(n,e){return{startScrollingFrom:n*e.startFromPercentage,maxScrollValueAt:n*e.maxScrollAtPercentage}}var Ef=1;function Mf(n,e,t){if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return t.maxPixelScroll;if(n===e.startScrollingFrom)return Ef;let r=1-(n-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function oS(n,e,t){let{accelerateAt:o,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return n;if(i<o)return Ef;let a=(i-o)/(r-o);return Math.ceil(n*t.ease(a))}function Af(n,e,t,o,r,i,a){if(n<e||n>t)return 0;let l=tS(o,r),s=n-e,c=t-n,u=c<s,d;return u?d=Mf(c,l,r):d=-Mf(s,l,r),d===0?0:a?(d>0?1:-1)*oS(Math.abs(d),i,r):d}var fn=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...Qy,...e.config}}start(e){this.scrollContainer=eS(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},o=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=o,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,o=0;return this.orientation==="vertical"?t=Af(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):o=Af(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:o}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var Ff=Ye.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),pn=()=>Ye.useContext(Ff),nS=n=>{let{node:e,offset:t}=n;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},rS=n=>`${n.getAttribute(xt)}`;function iS(n){let e=n.current?.querySelectorAll(ta)??[];return!e||e.length,Array.from(e).map(o=>{let r=rS(o),i=o.getBoundingClientRect();return{id:r,rect:i}})}function aS(n){let{domRef:e,orientation:t,dragListId:o}=n,r=iS(e),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,c=i.right;for(let f of r){let p=f.rect;p.top<a&&(a=p.top),p.left<l&&(l=p.left),p.bottom>s&&(s=p.bottom),p.right>c&&(c=p.right)}let u=xe.from({top:a,left:l,width:c-l,height:s-a});return{draggableItems:r,orientation:t,listId:o,listRectangle:u,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial,preserveDragSpace:n.preserveDragSpace}}function Nf(n){return new $n(aS(n))}function lS(n,e){let t=Oe(e),[o,r]=Ye.useState(null),i=(0,Jt.useCallback)(l=>{if(l)St.registerDragInteractionTarget(l);else{let s=a();s&&St.unregisterDragInteractionTarget(s)}r(l)},[]),a=Oe(o);return(0,Jt.useEffect)(()=>St.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),f=l.getData();if(f.initial&&f.listId!==s&&c?.includes(f.listId)){let p=Nf({domRef:n,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(p)}}),[t]),{interactionTarget:o,setInteractionTarget:i,getInteractionTarget:a}}function Ss(n,e){let t=n.cloneNode(!0);return t.removeAttribute(xt),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function Ts({proxyElement:n,dx:e,dy:t}){n.style.transform=`translate3d(${e}px, ${t}px, 0)`}function _f(n){let e=n.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",n.current=null)}var zo=n=>{let e=Ye.useRef(null),t=Ye.useRef(null),[o,r]=(0,Jt.useState)(null),i=Ye.useRef({top:0,left:0}),a=Ye.useRef(null),l=Ye.useCallback(R=>{a.current=R},[]),{dropTargetListId:s,dragSourceListId:c}=uo(),{updateDragOperationSourceAndTarget:u,dragItemId:d,status:f}=uo(),p=Oe(n.onDrop),m=Oe(n.onAcceptDrop),g=Oe(n.onRemove),b=Oe(n.updatePosition??nS),{interactionTarget:h,setInteractionTarget:y}=lS(e,n);(0,Jt.useEffect)(()=>{let R=document.querySelector(`[${Of}="${n.dragListId}"]`);R?e.current=R:console.warn(`DragList with id "${n.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[n.dragListId]),(0,Jt.useEffect)(()=>{if(h){let R=n.dragListId,P=h.on("start",({dragItem:V,dragSourceListId:z,dropTargetListId:G})=>{u({dragSourceListId:z,dropTargetListId:G,dragItemId:V.id,status:"accepted"})}),A=h.on("move",({offsetsForItems:V,items:z,status:G,dragItem:E})=>{if(G==="rejected")return;let F=T(),X=b(),B=t.current;z.forEach((Y,re)=>{let ge=V[re],be=F[re];if(be&&!(B&&Y.id===B.dragItemId)){if(!B&&Y.id===E.id){let ae=i.current;ge={left:ge.left+ae.left,top:ge.top+ae.top}}X({id:Y.id,node:be,offset:ge})}})}),M=h.on("drop",V=>{let{sortedIndexes:z,dragIndex:G,dropIndex:E,dragItem:F,items:X,dragSourceListId:B,dropTargetListId:Y,outside:re,status:ge}=V,be=T();S.current=[];let ae=m(),de=g(),pe=p(),q=b();X.forEach((K,Z)=>{let ne=be[Z];ne&&q({id:K.id,node:ne,offset:null})}),_f(t),r(K=>K&&(requestAnimationFrame(()=>r(null)),{...K,dragItemId:null})),R===Y&&B!==R&&ae&&ge==="accepted"&&ae({dragItemId:F.id,dragSourceListId:B,dropTargetListId:Y,dragIndex:G,dropIndex:E,dropItemId:X[E]?.id});let U=null;E===-1&&B===R&&Y===R&&re&&(U=de),E!==-1&&Y===R&&B===R&&(U=pe),U&&U?.(z,{dragIndex:G,dropIndex:E,dragItemId:X[G].id,dropItemId:X[E]?.id})}),D=null,_=null,O=null,L=null;if(!h.getData().initial&&e.current){if(D=new fn({orientation:n.orientation,onScroll:()=>{}}),D.start(e.current),_=D.getScrollContainer(),_){let V=n.orientation==="vertical"?_.scrollTop:_.scrollLeft;O=()=>{let z=n.orientation==="vertical"?_.scrollTop:_.scrollLeft,G=z-V;V=z,G!==0&&(h.adjustForScroll(G),St.retriggerMove())},_.addEventListener("scroll",O)}L=V=>{D.updatePointer({left:V.clientX,top:V.clientY})},De().addEventListener("pointermove",L)}return()=>{P(),A(),M(),D&&D.stop(),_&&O&&_.removeEventListener("scroll",O),L&&De().removeEventListener("pointermove",L)}}},[h,n.dragListId]);let S=Ye.useRef([]),T=(0,Jt.useCallback)(()=>{let R=S.current;return(!R||R.length===0)&&(R=Array.from(e.current?.querySelectorAll(ta)??[]),S.current=R),R},[]),C=(0,Jt.useCallback)(R=>{let P=R.currentTarget,A=P.getAttribute(xt);if(A==null){let k=Fo(P,ta);k&&(A=k.getAttribute(xt))}if(A==null){console.warn("Could not find drag item id for element",P,`Make sure you have a parent element with a ${xt} attribute`);return}A=`${A}`;let M=null,D=Array.from(e.current?.querySelectorAll(ta)??[]);S.current=D;let _=Nf({domRef:e,orientation:n.orientation,dragListId:n.dragListId,acceptDropsFrom:n.acceptDropsFrom,initial:!0,preserveDragSpace:n.preserveDragSpace}),O=_.getData().draggableItems,L=O.findIndex(k=>k.id===A),V=O[L],z=D[L].getAttribute(xt)===`${A}`?D[L]:D.find(k=>k.getAttribute(xt)===`${A}`);y(_);let G={left:R.clientX,top:R.clientY},E={left:R.clientX,top:R.clientY};i.current={top:0,left:0};let F=new fn({orientation:n.orientation,onScroll:()=>{}});e.current&&F.start(e.current);let X=F.getScrollContainer(),B=X?n.orientation==="vertical"?X.scrollTop:X.scrollLeft:0;function Y(){M&&M.move({left:E.left,top:E.top})}let re=()=>{if(!X)return;let k=n.orientation==="vertical"?X.scrollTop:X.scrollLeft,U=k-B;B=k,U!==0&&(_.adjustForScroll(U),n.orientation==="vertical"?i.current.top+=U:i.current.left+=U),Y()};X?.addEventListener("scroll",re);let ge=n.dragStrategy??"proxy",be=ge==="proxy"&&!n.renderDragProxy,ae=ge==="proxy"&&!!n.renderDragProxy,de=n.onDragProxyMove??Ts,pe=k=>{if(E={left:k.clientX,top:k.clientY},!M){if(M=St.startDrag({listId:n.dragListId,dragItem:V,dragIndex:L},G),z&&be){let Z=z.getBoundingClientRect(),ne=null,H={dragItemNode:z,dragItemId:`${A}`,initialRect:Z,initialCoords:G,get proxyElement(){return ne||(ne=Ss(z,Z)),ne}},ce=n.onDragProxySetup?.(H),N=ce?.proxyElement??H.proxyElement;z.style.visibility="hidden",t.current={proxyElement:N,originalNode:z,dragItemId:`${A}`,initialRect:Z,cleanup:ce?.cleanup}}if(z&&ae){let Z=z.getBoundingClientRect();z.style.visibility="hidden",t.current={proxyElement:z,originalNode:z,dragItemId:`${A}`,initialRect:Z,cleanup:()=>{}},r({dragItemId:`${A}`,initialRect:Z,dx:0,dy:0})}}let U=k.clientX-G.left,K=k.clientY-G.top;if(ae)r(Z=>Z&&{...Z,dx:U,dy:K});else{let Z=t.current;Z&&de({proxyElement:Z.proxyElement,dx:U,dy:K})}F.updatePointer({left:k.clientX,top:k.clientY}),Y()},q=()=>{if(F.stop(),X?.removeEventListener("scroll",re),De().removeEventListener("pointermove",pe),ae&&(r(k=>k&&{...k,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!M){_f(t),y(null);return}M.drop(),M=null};De().addEventListener("pointermove",pe),De().addEventListener("pointerup",q,{once:!0})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside,n.dragStrategy,n.renderDragProxy,n.onDragProxySetup,n.onDragProxyMove]),w=!!d,I=Ye.useMemo(()=>({dragItemId:d,onDragItemPointerDown:C,dragSourceListId:c,dropTargetListId:s,status:f,dragListId:n.dragListId,draggingInProgress:w}),[d,C,w,c,s,n.dragListId]),v={className:te("DragList",w?"DragList--dragging":"",Df({dragging:w})),[Of]:n.dragListId},x=typeof n.children=="function"?n.children(v,I):n.children;return Ye.createElement(Ff.Provider,{value:I},x,o&&n.renderDragProxy?n.renderDragProxy({...o,ref:l}):null)},Of="data-drag-list-id",xt="data-drag-item-id",ta=`[${xt}]`,sS=Ye.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),cS=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=pn(),l=i===o&&r===`${n.id}`,s=Ye.useMemo(()=>({dragItemId:n.id,active:l,dragListId:o,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,l,t,i,a]),c={"data-drag-item-id":`${n.id}`,onPointerDown:e,className:te("DraggableItem",l?"DraggableItem--active":"",xf({active:l,draggingInProgress:t}))},u=typeof n.children=="function"?n.children(c,s):n.children;return Ye.createElement(sS.Provider,{value:s},u)};zo.DraggableItem=cS;var Cs=j(require("react")),Lf=n=>Cs.createElement(ze,{...n,viewBox:"0 -960 960 960"},Cs.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"}));var Zr=j(require("react"));function kf(){return{}}var zf=n=>({allowColumnHideWhileDragging:e=>e??!0});var Vf=require("react"),uS=(0,Vf.createContext)(null);function ws(){return uS}var Kt=j(require("react"));var hn=j(require("react")),Ht=require("react");var oa=j(require("react"));function dS(n){let{height:e,width:t,count:o}=n;return oa.createElement("div",{"data-count":o,"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 Gf=oa.memo(dS);var Hf="mlx2t3";var na=j(require("react")),qf=require("react");var Kf=require("react"),Bf=(n,e)=>{(0,Kf.useEffect)(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var Wf={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},jf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},$f={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Is="_1ueijco1",Uf="_1ueijco0 _16lm1iw0";var Yf=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=Wf[`${n}`]:e=te(jf[`${n.horizontal}`],$f[`${n.vertical}`]),e};var fS="InfiniteVirtualScrollContainer";var Xf=na.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,qf.useRef)(null);return Bf(u,i),na.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:te(a,fS,Uf,Yf(r))},o)});var fa=j(require("react")),Xn=require("react");var Zf=j(require("react")),Vo=require("react");function pS(n){let[e,t]=(0,Vo.useState)(n.updater.get),o=(0,Vo.useRef)(null),r=(0,Vo.useRef)(n.afterCommit);return r.current=n.afterCommit,(0,Vo.useLayoutEffect)(()=>{function i(l){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(l)})):t(l)}let a=n.updater.onChange(i);return()=>{o.current!=null&&cancelAnimationFrame(o.current),a()}},[n.updater,n.useraf]),(0,Vo.useLayoutEffect)(()=>{r.current?.()}),e??null}var Go=Zf.memo(pS);var Qf=j(on());var Rs=(n,e)=>n-e,mo={horizontal:!0,vertical:!0};function ra(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var vs="DebugID=";function Ho(n,e){return e&&e.startsWith(vs)?e:e?`${vs}${n}:${e}`:`${vs}${n}`}var ia={start:0,end:0},Ds=n=>{n()},xs=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},Jf=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},Wr=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function mS(n){return n.horizontalChange||n.verticalChange}var mn=class extends bt{constructor(t){let o=Ho(t,`${t}:MatrixBrain`);super(o);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=ia;this.verticalExtendRangeBy=ia;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 o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{Wr(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?Ds:Wr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?Ds:Wr;o.forEach(a=>{i(()=>{this.destroyed||o.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 o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=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:o);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:o}=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:o);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 o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=mo)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(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:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,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:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=mo)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.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 f=l;for(;d[f]!=f;)f--;a.push([f,u])}}}if(r){let l=t.startIndex,s=o.startIndex,c=o.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let f=l;for(;d[f]!=f;)f--;a.push([u,f])}}}return a};this.computeRenderRange=(t=mo)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=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 o!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,f=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),f&&(r+=f);let p=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return p>m&&(p=m,u=Math.max(a,p-r)),{startIndex:u,endIndex:p}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="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,o),d=u,u=a[c],d===u&&d!=0))return i-1;let f=(0,Qf.default)(a,t,Rs);return f>=0?f:~f-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="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 ${o==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,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),f=u.get(a);if(d[i]===void 0){let p=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:o};for(;p<=m;p++)if(d[p]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=p;let b=s(g);d[p]=p,f[p]=b;let h=p;for(;b>1;)h+=1,d[h]=p,f[h]=0,b-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;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,o,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;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,o,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o: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,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="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,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=xs;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(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==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(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,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=mo){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,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",f=u&&s!==this.availableWidth,p=d&&c!==this.availableHeight;f&&(this.availableWidth=s,this.availableRenderWidth=s),p&&(this.availableHeight=c,this.availableRenderHeight=c),(f||p)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",b=m&&r!==this.rows,h=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,S=l!=null,T=y&&a!==this.rowHeight,C=S&&l!==this.colWidth;y&&(this.rowHeight=a),S&&(this.colWidth=l);let w=t.rowspan!=null,I=t.colspan!=null,v=w&&t.rowspan!=this.rowspan,x=I&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),x&&(this.colspan=t.colspan);let R=h||C||f||x,P=b||T||p||v;(o||mS)({horizontalChange:R,verticalChange:P,colsChanged:h,colWidthChanged:C,widthChanged:f,colspanChanged:x,rowsChanged:b,rowHeightChanged:T,heightChanged:p,rowspanChanged:v})&&this.updateRenderCount({horizontal:R,vertical:P})}extendRenderRange(t){let{direction:o}=t,r=o==="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:o})}}updateRenderCount(t=mo){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=mo){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?Ds:Wr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,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 o=="function"){let u=[],d=0,f=r;d+=s,f-=c;for(let p=d;p<f;p++)u.push(this.getItemSize(p,t));a=ra(l,u)}else a=(o?Math.ceil(l/o):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:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{Wr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="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 o=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*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=ia,this.verticalExtendRangeBy=ia,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var Ms=j(on());function ep(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function tp(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function jr(n,e){for(let t of n)if(e(t))return t}var np=j(require("react"));var op=new Map,gS=()=>{},Ps=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Te();this.afterCommit=()=>{if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}};let o=op.get(e)??0,r=`${e}:GridCellReact:${o}`;op.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=Te(),this.node=np.createElement(Go,{key:r,name:r,updater:this.updater,afterCommit:this.afterCommit}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=gS,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 bt{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=Te();this.cellAttachmentChangeSubscription=Te();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 Ps(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,o=t.values().next().value;return o||(this.poolSize+=Un.POOL_SIZE_INCREMENT,o=t.values().next().value),o||this.error("No cells available in the pool!"),o}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 o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-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 aa=Un;var la=(n,e)=>n-e,sa=class extends bt{constructor(t){super(`${t}:GridCellManager`);this.matrix=new oe;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[f,p]=d,m=f<i,g=f>=l,b=p<a,h=p>=s;(m||g||b||h)&&c.add(u)}),c};this.debugId=t,this.pool=new aa(t),this.offRemoveCell=this.pool.onRemoveCell(o=>this.onRemoveCell(o))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,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,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);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,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=jr(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=jr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+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(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(la)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(la)}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((o,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(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,Ms.default)(o,t,la);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,Ms.default)(o,t,la);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>o&&this.detachCellAt(a),l===o&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return jr(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return jr(t,r=>this.getCellPosition(r)?.[1]===o)}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 ap=j(on());var ip=j(require("react"));var rp=new Map,hS=()=>{},As=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Te();let t=rp.get(e)??0,o=`${e}:ListRowReact:${t}`;rp.set(e,t+1),this.debugId=o,this.updater=Te(),this.node=ip.createElement(Go,{key:`detail-row-${o}`,name:`detail-row-${o}`,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(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=hS,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Yn=class Yn extends bt{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=Te();this.rowAttachmentChangeSubscription=Te();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 As(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,o=t.values().next().value;return o||(this.poolSize+=Yn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}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 o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-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 ca=Yn;var ua=class extends bt{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new ca(t),this.offRemoveRow=this.pool.onRemoveRow(o=>this.onRemoveRow(o))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}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,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,ap.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.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 o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}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 lp=!0,gn=ee(Q.y),sp=ee(Q.scrollTop),KE=ee(Q.columnOffsetAtIndex),Es=ee(Q.columnOffsetAtIndexWhileReordering),qn=class extends bt{constructor(t,o){o=o||"ReactHeadlessTableRenderer";super(o);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,o,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(gn,i?`calc( ${r}px + var(${sp}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${gn}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=Ie.columnOffsets.get(r),d=`${Es}-${r}`,f=s?`calc( ${a}px + var(${sp}) )`:`${a}px`;t.__currentTransformY!==f&&(t.__currentTransformY=f,t.style.setProperty(gn,f));let p=`translate3d(var(${d}, ${u}), var(${gn}), 0)`;t.__transformValue!==p&&(t.__transformValue=p,t.style.transform=p),c!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),f=r.getFixedEndRowsHeight(),p=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=p+m.height;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollTop;if(l==="center"?b=c-Math.floor((r.getAvailableSize().height-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),this.brain.isHorizontalLayoutBrain){let h=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(h,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:b}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;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(),f=r.getFixedStartColsWidth(),p=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=p+m.width;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollLeft;return l==="center"?b=c-Math.floor((r.getAvailableSize().width-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),{...i,scrollLeft:b}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{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,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=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-o,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=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-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,f]=c,[p,m]=u,g=[];if(i&&(o&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,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:[p,i]})),a&&(o&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,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:[p,l]})),o){let b={start:[0,f],end:[o,m],rowFixed:"start",colFixed:!1};g.push(b)}if(r){let b={rowFixed:"end",colFixed:!1,start:[s-r,f],end:[s,m]};g.push(b)}return g};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,f=!1;if(t<r&&(u=!0,f="start"),i&&!u){let p=c-i;t>=p&&(u=!0,f="end")}if(o<a&&(d=!0,f="start"),l&&!d){let p=s-l;o>=p&&(d=!0,f="end")}return{row:u?f:!1,col:d?f:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(o)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.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(o=>{let r=o.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 o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ve(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o)=>{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){let d=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=f.rowIndex,r.dataset.colIndex=f.colIndex,lp){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(o?o.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=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;o&&(o.dataset.detailRowIndex=r,lp&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.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:o,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(D=>{let _=i.getRowIndex(D);if(_!=null){let O=this.brain.getItemOffsetFor(_,"vertical");if(O==null)return;let L=D.getElement();if(!L)return;this.setDetailTransform(L,_,{y:O,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let f=this.cellManager.getOneAttachedCell();f&&md(t,this.getInfiniteNode(f.getElement()));let p=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:b}=this.brain.getRenderRange(),[h,y]=g,[S,T]=b;function C(D,_,O){let L=r.getCellAt([D,_]);if(L==null)return;let V=o.getCellOffset(D,_),z=L.getElement();z&&V&&O(D,_,z,V)}let w=(D,_,O,{x:L,y:V})=>{this.setTransform(O,D,_,{x:L,y:V,scrollLeft:!0},s-_)},I=(D,_,O,L)=>{this.setTransform(O,D,_,{x:L.x,y:L.y,scrollTop:!0},u-D)},v=(D,_,O,{y:L})=>{let V=p[_];this.setTransform(O,D,_,{x:V,y:L,scrollLeft:!0},a-_)},x=(D,_,O,L)=>{this.setTransform(O,D,_,{x:L.x,y:m[D],scrollTop:!0},l-D)},R=(D,_,O,{x:L,y:V})=>{this.setTransform(O,D,_,{x:L,scrollLeft:!0,y:V,scrollTop:!0},1e5)},P=(D,_,O,{x:L})=>{this.setTransform(O,D,_,{x:L,scrollLeft:!0,y:m[D],scrollTop:!0},2e5)},A=(D,_,O,L)=>{this.setTransform(O,D,_,{x:p[_],y:L.y,scrollLeft:!0,scrollTop:!0},3e5)},M=(D,_,O)=>{this.setTransform(O,D,_,{x:p[_],y:m[D],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let D=h;D<S;D++){for(let _=0;_<s;_++)C(D,_,w);if(c){let _=a-c;for(let O=_;O<a;O++)C(D,O,v)}}if(u||d)for(let D=y;D<T;D++){for(let _=0;_<u;_++)C(_,D,I);if(d){let _=l-d;for(let O=_;O<l;O++)C(O,D,x)}}if(s&&u)for(let D=0;D<u;D++)for(let _=0;_<s;_++)C(D,_,R);if(s&&d){let D=l-d;for(let _=D;_<l;_++)for(let O=0;O<s;O++)C(_,O,P)}if(c&&u){let D=a-c;for(let _=0;_<u;_++)for(let O=D;O<a;O++)C(_,O,A)}if(c&&d){let D=l-d,_=a-c;for(let O=D;O<l;O++)for(let L=_;L<a;L++)C(O,L,M)}};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=o,this.cellManager=new sa(o),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new ua(o),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(),Ve(()=>{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=Jl(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:o,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,f=this.getFixedRanges(t),p=[t,...f],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let R=t.start[1],P=t.end[1];m.forEach(A=>{R<=A&&A<P||p.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let g=new Map,b=p.map(this.getExtraSpanCellsForRange).flat();b&&b.forEach(([R,P])=>{g.set(`${R}:${P}`,!0)});let h=p.reduce((R,P)=>R+xs(P),0),y=r?p.reduce((R,P)=>R+Jf(P),0):0,S=this.brain.getRowCount(),T=this.brain.getColCount();d.detachCellsStartingAt([S,T]);let C=Math.min(S*T,h);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let w=ep(...p.map(R=>d.getCellsOutsideRenderRange(R)));w=tp(w,R=>{let P=d.getCellPosition(R);return!(P&&g.has(`${P[0]}:${P[1]}`))}),d.detachCells(w),d.poolSize=C;let I=new Map,v=new Map;p.forEach(R=>{let{start:P,end:A}=R,[M,D]=P,[_,O]=A;for(let L=M;L<_;L++){for(let z=D;z<O;z++){let G=`${L}:${z}`;if(I.has(G))continue;I.set(G,!0);let{rendered:E,mapped:F}=this.isCellRenderedAndMappedCorrectly(L,z);if(L===M||z===D){let B=this.isCellCovered(L,z);if(B&&g.has(`${B[0]}:${B[1]}`)){let Y=d.getCellAt([L,z]);Y!=null&&d.detachCell(Y);continue}}if(E&&!i&&F)continue;let X;E?X=d.getCellAt([L,z]):X=d.getCellFor([L,z],c?"row":"column"),X==null&&(X=d.getDetachedCell()),this.renderCellAt(L,z,X,o)}!r||v.has(L)||(v.set(L,!0),u.isRowAttachedAt(L)&&!i)||this.renderDetailRowAtElement(L,this.rowManager.getRowFor(L),r)}}),b.forEach(([R,P])=>{let{rendered:A,mapped:M}=this.isCellRenderedAndMappedCorrectly(R,P);if(A){if(i||!M){let _=[R,P],O=d.getCellAt(_);this.renderCellAt(R,P,O,o)}return}let D=d.getCellFor([R,P],c?"row":"column");D!=null&&this.renderCellAt(R,P,D,o)});let x=d.getAllCells().map(R=>R.getNode());return r&&u.getAllRows().forEach(R=>{x.push(R.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(x),x}renderDetailRowAtElement(t,o,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:o.ref});if(o.isMounted()||o.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(c,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}getMatrixRowIndexFromElement(t){let o=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(o):o}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),c=this.brain.getRowspan(t,o),u=this.brain.getColspan(t,o),d=c===1?l:this.brain.getRowHeightWithSpan(t,o,c),f=u===1?s:this.brain.getColWidthWithSpan(t,o,u),{row:p,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:b,colIndex:h}=this.getCellRealCoordinates(t,o),y=i({rowIndex:b,colIndex:h,height:l,width:s,rowspan:c,colspan:u,rowFixed:p,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(C=>{let w=C.getElement();w&&(w.style.position="absolute",w.style.left="0px",w.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:b,renderColIndex:h}:void 0,T=this.brain.isHorizontalLayoutBrain;if(!y){T?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,o],S),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var da=class extends qn{constructor(t,o){super(t,o);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=he.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",f=Ie.columnOffsets.get(l.colIndex),p=`${Es}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(gn,m));let g=`calc(var(${p}, ${f}) + ${d})`,b=`var(${gn})`,h=`translate3d(${g}, ${b}, 0px)`;t.__transformValue!==h&&(t.__transformValue=h,t.style.transform=h)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),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,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function $r(n){let e=n.isHorizontalLayoutBrain?new da(n,`${n.name}:HorizontalLayoutTableRenderer`):new qn(n,`${n.name}:ReactHeadlessTableRenderer`),t=Te();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function bS(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=(0,Xn.useMemo)(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:$r(e),[e,n.onRenderUpdater,n.renderer]);return(0,Xn.useLayoutEffect)(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),(0,Xn.useLayoutEffect)(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),(0,Xn.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o}),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:o})})},[i,e,t,o,a,r]),fa.createElement(Go,{updater:a})}var pa=fa.memo(bS);var Ur=j(require("react")),Zn=require("react");var cp=ye({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ma="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var up=ye({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:yS}=ke,SS=`${yS}-ActiveRowIndicator`,TS=`calc(${Q.activeCellRowOffsetX} + var(${ee(Q.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,CS={[ee(Q.activeCellOffsetY)]:Q.activeCellRowOffset,transform:`translate3d(${TS}, calc( ${Q.activeCellOffsetY} + var(${ee(Q.scrollTopForActiveRow)}, 0px)), 0px)`,height:Q.activeCellRowHeight,maxWidth:he.runtime.totalVisibleColumnsWidthVar},wS=n=>{let{brain:e}=n,t=(0,Zn.useRef)(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=Yt();return(0,Zn.useLayoutEffect)(()=>{if(n.activeRowIndex==null)return;let a="0px",l=n.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let f=e.getPageIndexForRow(l);f>0&&(a=`calc(${he.runtime.totalVisibleColumnsWidthVar} * ${f})`),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};zn(d,u)},[n.activeRowIndex,e]),(0,Zn.useEffect)(()=>{let a=c=>{zn({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]),Ur.createElement("div",{className:ma,"data-name":"active-row"},Ur.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${SS} ${up({active:o})}`,style:o?CS:void 0}))},dp=Ur.memo(wS);var Yr=j(require("react")),Qn=require("react");var{rootClassName:IS}=ke,RS=`${IS}-ActiveCellIndicator`,vS=ee(Q.columnZIndexAtIndex),DS=(n,e,t,o)=>{if(e==null)return;let[r]=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(r=r%n.rowsPerPage);let i=typeof t=="function"?t(r):t??n.getRowHeight(r),a=n.getItemOffsetFor(r,"vertical"),l=o.current;zn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},xS=n=>{let{brain:e}=n,[t,o]=Yt(),r=(0,Qn.useRef)(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];return(0,Qn.useLayoutEffect)(()=>{DS(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]),(0,Qn.useEffect)(()=>{let a=e.onRenderCountChange(()=>{o()});return()=>{a()}},[e]),Yr.createElement("div",{className:ma,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${vS}-${n.activeCellIndex[1]})`}:void 0},Yr.createElement("div",{"data-name":"active-cell-indicator",className:`${RS} ${cp({visible:i})}`}))},fp=Yr.memo(xS);var ga=[cf,`${mt}DetachedCell`];function ha(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.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 PS=te(Hf,Is);function pp(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:f,forceRerenderTimestamp:p,scrollVarHostRef:m,...g}=n,{autoFocus:b}=g,h=(0,Ht.useRef)(null),[y,S]=(0,Ht.useState)({width:0,height:0});(0,Ht.useEffect)(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),(0,Ht.useEffect)(()=>{let w=h.current?.parentNode;return w?(b&&document.activeElement!==w&&w.focus(),Rr(w,()=>{let x={height:w.clientHeight,width:w.clientWidth};e.update(x)},{debounce:50})):void 0},[f,e]);let T=(0,Ht.useCallback)(w=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-w.scrollLeft}px, ${-w.scrollTop}px, 0px)`)})},[]),C=(0,Ht.useCallback)(w=>{e.setScrollPosition(w,T)},[e,T]);return(0,Ht.useEffect)(()=>{let w=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),w},[e]),hn.createElement(Xf,{onContainerScroll:C,...g,ref:t},hn.createElement("div",{ref:h,className:PS,"data-name":"scroll-transform-target"},hn.createElement(pa,{forceRerenderTimestamp:p,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ga}),u!=null?hn.createElement(fp,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?hn.createElement(dp,{brain:e,activeRowIndex:c}):null,hn.createElement(Gf,{width:y.width,height:y.height}))}function mp(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((u,d)=>{let f=u.id,p=n[d-1],m=p?.id??"",g=new Set,b=p?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(f,g);let h={type:"column",id:f,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([f],h);let y=u.columnGroup,S,T=h;for(;y;){let C=e[y];if(C){g.add(y);let w=[f,...g];S=b.has(y)?i.get(y):void 0,S||(S={id:y,type:"group",ref:C,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:h.computedPinned,depth:t.get(y)??0},r.set(w,S),i.set(y,S)),S.columnItems.push(h),S.uniqueGroupId.push(h.id),T&&!b.has(T.id)&&S.children.push(T),T=S,y=C.columnGroup}else break}});let l=[],s=new oe,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((f,p)=>f+p.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&gp(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<=o+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function gp(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&gp(t.children),e+=o})}var Ko=j(require("react")),go=require("react");var Os=j(require("react"));var bp=j(require("react")),_s=require("react");var qr=require("react"),Xr=j(require("react"));var{rootClassName:MS}=ke,AS=`${MS}HeaderCell_ResizeHandle`;function ES(n){let e=(0,qr.useRef)(null),[t,o]=(0,qr.useState)(!1),r=(0,qr.useRef)(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let f=d.pointerId,p=d.clientX,m=d.target;m.setPointerCapture(f);let g=!0,b=wf(n.groupColumns.map(T=>T.computedVisibleIndex),{columns:n.columns,domRef:e}),h=T=>{a==="end"&&(T*=-1);let{constrained:C,adjustedDiffs:w,adjustedDiff:I}=n.computeResize(T);return r.current!==C&&o(C),b.resize(w),I},y=T=>{if(g){let C=n.groupColumns.reduce((v,x)=>v+x.computedWidth-x.computedMinWidth,0),w=n.brain.getAvailableSize(),I={width:w.width+C,height:w.height};n.brain.update(I),g=!1}h(Math.round(T.clientX-p))},S=T=>{m.releasePointerCapture(f),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",S);let C=Math.round(T.clientX-p),w=h(C);n.onResize(w)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:he.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Xr.createElement("div",{ref:e,className:`${AS} ${Qi} ${ea({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Xr.createElement("div",{style:{...u,...n.style},className:Ji({constrained:t})}))}var hp=Xr.memo(ES);function yp(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:c}=ie(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),u=n[n.length-1],d=(0,_s.useCallback)(g=>{let b=l(),{columnSizing:h,viewportReservedWidth:y,bodySize:S}=b,T=s().computedVisibleColumns,C=!1,w=T.reduce((x,R)=>(R.computedFlex&&(x[R.id]={...h[R.id],flex:R.computedWidth},C=!0),x),{}),I=C?{...h,...w}:h;return qu({availableSize:S.width,reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:I,columnGroupSize:n.length,items:T.map(x=>({id:x.id,resizable:x.computedResizable,computedFlex:x.computedFlex,computedWidth:x.computedWidth,computedMinWidth:x.computedMinWidth,computedMaxWidth:x.computedMaxWidth}))})},[u]),f=(0,_s.useCallback)(g=>{let{columnSizing:b,reservedWidth:h}=d(g);c.viewportReservedWidth=h,c.columnSizing=b},[d]);return n.some(g=>g.computedResizable)?bp.createElement(hp,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:f}):null}var Sp=`${mt}HeaderGroup`,Tp=ee(Q.columnWidthAtIndex),_S=ee(Q.columnZIndexAtIndex);function Cp(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=yp(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=o[0],u=o.length>1?"calc( "+o.map(p=>`var(${Tp}-${p.computedVisibleIndex})`).join(" + ")+" )":`var(${Tp}-${c.computedVisibleIndex})`,d=`calc(var(${_S}-${c.computedVisibleIndex}) + ${i-e.depth})`,f=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return f=f&&typeof f=="object"?f:{},f.width=u,f.height=t,Os.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:te(Gu,Sp),style:f,"data-z-index":d},Os.createElement("div",{className:te(`${Sp}__header-content`,qt)},a),s)}var wp=require("react");var Ls=j(require("react")),Fs;function ks(){return Fs||(Fs=Ls.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var Ns;function ba(){return Ns||(Ns=Ls.createContext(null))}function Fe(n){let e=ba(),t=(0,wp.useContext)(e);return Pn(t,n)}function eo(){return Fe(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:OS}=ke,FS=[],Ip=`${OS}Header`,NS=Nu({overflow:!1}),Rp=()=>{};function LS(n){let{bodyBrain:e,headerBrain:t,columns:o,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=n,{getState:c,headerOptions:u,headerRenderer:d,headerOnRenderUpdater:f,showColumnFilters:p,computedColumnsMap:m}=ie(A=>({computedColumnsMap:A.computed.computedColumnsMap,getState:A.getState,headerOptions:A.state.headerOptions,headerRenderer:A.state.headerRenderer,headerOnRenderUpdater:A.state.headerOnRenderUpdater,showColumnFilters:A.state.showColumnFilters})),g=(0,go.useRef)(null),b=(0,go.useCallback)(A=>{g.current&&(g.current.style.transform=`translate3d(-${A.scrollLeft}px, 0px, 0px)`)},[]);(0,go.useEffect)(()=>{let A=t.onScroll(b);return b(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),A},[t]);let h={ref:g,className:te(Ip,`${Ip}--virtualized`,i,NS),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:S,dataSourceActions:T}=eo(),{allRowsSelected:C,someRowsSelected:w,selectionMode:I,filterTypes:v,filterDelay:x}=Fe(A=>({allRowsSelected:A.dataSourceState.allRowsSelected,someRowsSelected:A.dataSourceState.someRowsSelected,selectionMode:A.dataSourceState.selectionMode,filterTypes:A.dataSourceState.filterTypes,filterDelay:A.dataSourceState.filterDelay})),R=(0,go.useMemo)(()=>({allRowsSelected:C,someRowsSelected:w,selectionMode:I}),[C,w,I]),P=(0,go.useCallback)(A=>{let{rowIndex:M,colIndex:D,domRef:_,height:O,widthWithColspan:L,heightWithRowspan:V,hidden:z}=A,G=o[D];if(!G||z)return null;let E=t.isHorizontalLayoutBrain?t.getPageIndexForRow(M):null,F=l?l.pathsToCells.get([M,D]):null;if(F&&F.type==="group"){let X=F.columnItems.map(re=>re.ref),B={...F.ref,id:F.id,uniqueGroupId:F.uniqueGroupId,depth:F.depth,columns:X.map(re=>re.id),computedWidth:F.computedWidth,groupOffset:F.groupOffset};return c().columnGroupVisibility[F.id]!==!1?Ko.createElement(Cp,{horizontalLayoutPageIndex:E,bodyBrain:e,columnGroupsMaxDepth:s,domRef:_,columns:X,width:L,height:O,columnGroup:B}):null}return Ko.createElement(Dp,{domRef:_,column:G,horizontalLayoutPageIndex:E,headerOptions:u,dataSourceStatePartialForHeaderCell:R,filterTypes:v,filterDelay:x,getDataSourceState:y,dataSourceApi:S,dataSourceActions:T,width:L,height:V,columnsMap:m})},[u,o,a,l,s,p,t,y,S,T,v,x,R]);return Ko.createElement(zo,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:Rp,updatePosition:Rp},A=>Ko.createElement("div",{...A,...h,className:te(A.className,h.className)},Ko.createElement(pa,{name:"header",renderCell:P,brain:t,renderer:d,onRenderUpdater:f,cellHoverClassNames:FS,cellDetachedClassNames:ga})))}var vp=Ko.memo(LS);function xp(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=ie(w=>({computedPinnedStartColumns:w.computed.computedPinnedStartColumns,computedPinnedEndColumns:w.computed.computedPinnedEndColumns,computedVisibleColumns:w.computed.computedVisibleColumns,columnSize:w.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:f}=ie(w=>({columnHeaderHeight:w.state.columnHeaderHeight,columnGroupsDepthsMap:w.state.columnGroupsDepthsMap,columnGroupsMaxDepth:w.state.columnGroupsMaxDepth,computedColumnGroups:w.state.computedColumnGroups,showColumnFilters:w.state.showColumnFilters})),p=!d||!Object.keys(d).length?1:u+2,m=p*s+(f?s:0),g=Kt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return mp(a,d,c,u)},[a,d,c]),b=Kt.useCallback(({rowIndex:w,colIndex:I})=>{let v=a[I],x=1,R=1;if(!v||!g)return{rowspan:x,colspan:R};let P=g.pathsToCells.get([w,I]);if(!P)return{rowspan:x,colspan:R};if(P.type==="column")return{colspan:R,rowspan:p-P.depth};let A=P.columnItems.findIndex(M=>M.id===v.id);return{rowspan:x,colspan:A===0?P.columnItems.length:1}},[d,u,a,g,p,c]),h=Kt.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).rowspan,[b]),y=Kt.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).colspan,[b]),S=Kt.useCallback(w=>f?w<p-1?s:2*s:s,[p,f,s]);ha(e,{colWidth:l,rowHeight:S,rows:p,cols:a.length,height:m,rowspan:h,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Kt.createElement(vp,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),C=o.vertical&&_o()?Kt.createElement("div",{className:Ku,style:{zIndex:1e3,width:_o()}}):null;return Kt.createElement("div",{className:`${us} ${$u}`,style:{height:m}},T,C)}var{ManagedComponentContextProvider:kS}=Ft({initSetupState:kf,forwardProps:zf,Context:ws()});function zs(n){let{getComputed:e,header:t,brain:o,headerBrain:r,wrapRowsHorizontally:i}=ie(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?Zr.createElement(kS,{...n},Zr.createElement(xp,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function Pp(){return Zr.useContext(ws()).componentState}var zS=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||fo;return Pe.createElement(s,{domProps:{className:ji},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},Xi=Pe.createContext(null);var VS=ee(Q.columnZIndexAtIndex),GS=ee(Q.columnVisibilityAtIndex),Vs=Pe.createElement("div",{className:Ri[1]}),Ap=Di({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[xt]:""});function HS(n){let e=n.column,{allowColumnHideWhileDragging:t}=Pp(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=n,{allRowsSelected:u,someRowsSelected:d,selectionMode:f}=o,{onDragItemPointerDown:p}=pn(),{api:m,getComputed:g,getState:b,actions:h,getDataSourceMasterContext:y,showColumnFilters:S,components:T,portalDOMRef:C,columnHeaderHeight:w,columnReorderDragColumnId:I,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:x}=ie(W=>({api:W.api,getComputed:W.getComputed,getState:W.getState,actions:W.actions,getDataSourceMasterContext:W.getDataSourceMasterContext,showColumnFilters:W.state.showColumnFilters,components:W.state.components,portalDOMRef:W.state.portalDOMRef,columnHeaderHeight:W.state.columnHeaderHeight,columnReorderDragColumnId:W.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:W.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:W.state.columnReorderInPageIndex})),R=I===e.id,P=x!=null?r!==x:!1,{onResize:A,height:M,width:D,headerOptions:_,columnsMap:O}=n,L=e.computedSortInfo,V=e.header,z=(0,ho.useCallback)(W=>{k.current=W,n.domRef?.(W)},[n.domRef]),G=_.alwaysReserveSpaceForSortIcon,E=e.headerAlign??e.align,F=(typeof E=="function"?E({isHeader:!0,column:e}):E)??"start",X=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",B=gt(e,{actions:h,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:y,getState:b}),Y=B.isSortable(),re=Y&&(e.computedSorted||G)?Pe.createElement(Zi,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:he.spacing[2],marginInlineEnd:he.spacing[2]},className:`${an}__sort-icon ${Bu} ${ju({align:F})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,be=e.computedFilterable&&e.computedFiltered?Pe.createElement(Fn,null):null,ae=e.headerCssEllipsis??e.cssEllipsis??!0,de={reserveSpaceWhenHidden:F==="center",menuVisible:v===e.id,style:F==="end"?{marginInlineStart:`calc(${he.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:he.spacing[2]}:{marginInlineEnd:`calc(${he.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:he.spacing[2]},domProps:{onMouseDown:W=>{W.stopPropagation(),B.toggleContextMenu(W.target)}}},pe=e.components?.MenuIcon||T?.MenuIcon||Gr,q=Pe.createElement(pe,{...de}),k=(0,ho.useRef)(null),U={horizontalLayoutPageIndex:r,dragging:R,domRef:z,htmlElementRef:k,renderLocation:"column-header",column:e,columnsMap:O,columnSortInfo:L,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:f,api:m,dataSourceApi:a,columnApi:B,renderBag:{sortIcon:re,filterIcon:be,menuIcon:q,menuIconProps:de,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},K=U,Z=K.renderBag.header,ne=()=>{let W={...U,renderBag:{...U.renderBag}};if(e.renderSortIcon&&(W.renderBag.sortIcon=Pe.createElement(Lo,{render:e.renderSortIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderFilterIcon&&(W.renderBag.filterIcon=Pe.createElement(Lo,{render:e.renderFilterIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),typeof e.renderMenuIcon=="function"&&(W.renderBag.menuIcon=Pe.createElement(Lo,{render:Rt=>{if(typeof e.renderMenuIcon!="function")return null;let zt=e.renderMenuIcon(Rt);return zt?zt.type===pe||zt.type===Gr?zt:Pe.createElement(pe,{...de},zt):null},renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderSelectionCheckBox&&f==="multi-row"){W.renderBag.selectionCheckBox=Pe.createElement(Lo,{render:zS,renderParam:{...W,renderBag:{...W.renderBag}}});let Rt=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Rt&&Rt!==!0&&(W.renderBag.selectionCheckBox=Pe.createElement(Lo,{render:Rt,renderParam:{...W,renderBag:{...W.renderBag}}}))}V instanceof Function&&(W.renderBag.header=Z=Pe.createElement(Lo,{render:V,renderParam:{...W,renderBag:{...W.renderBag}}}));let it=e.renderMenuIcon===!1?null:W.renderBag.menuIcon,we=ae?Pe.createElement("div",{className:qt},W.renderBag.header):W.renderBag.header,at=Pe.createElement(Pe.Fragment,null,F==="center"?Vs:null,W.renderBag.selectionCheckBox,we,W.renderBag.sortIcon,W.renderBag.filterIcon,F==="center"?Vs:null,F!=="center"?Vs:null,it);return e.renderHeader?Pe.createElement(Lo,{render:e.renderHeader,renderParam:{...W,renderBag:{...W.renderBag,all:at}}}):at};(0,ho.useEffect)(()=>{let W=null,it=k.current;return A&&it&&(W=Rr(it,A)),()=>{W?.()}},[k.current,n.onResize]);let H={height:M};e.headerStyle&&(H=typeof e.headerStyle=="function"?{...H,...e.headerStyle(K)||{}}:{...H,...e.headerStyle});let ce=typeof e.headerClassName=="function"?e.headerClassName(K):e.headerClassName,{onPointerDown:N,proxyPosition:J,dragColumnOutside:fe}=$d({columnId:e.id,domRef:k,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),me=null,Me=Xi.Provider,Ae={filtered:e.computedFiltered,verticalAlign:X,align:F},Ge=Pe.useMemo(()=>{let W=it=>{m.setColumnFilter(e.id,it)};return c>0?_t(W,{wait:c}):W},[c,e.id]),Ne=e.computedFilterType,Le=s[Ne],We=e.computedFilterable?e.computedFilterValue?.filter.operator??Le?.defaultOperator:void 0,et=e.computedFilterable&&Le?Le.operators.find(W=>W.name===We):void 0,tt=et?.components?.FilterEditor||Le?.components?.FilterEditor||e.components?.FilterEditor||kn,ot=Le?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,$=vf(e,{horizontalLayoutPageIndex:r}),se=`var(${VS}-${e.computedVisibleIndex})`;H.zIndex=se,H.visibility=`var(${GS}-${e.computedVisibleIndex}, visible)`;let ue={"data-field":`${e.field||""}`,"data-column-id":e.id,[xt]:e.id,"data-header-align":F,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},Se=e.computedFilterable?Pe.createElement(id,{horizontalLayoutPageIndex:r,filterEditor:tt,filterOperatorSwitch:ot??ad,operator:et,filterTypes:s,onChange:Ge,columnFilterType:Ne,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:w}):Pe.createElement(ld,null);K.renderBag.filterEditor=Se;let qe=(0,ho.useCallback)(W=>{N(W),p(W)},[N,p]),le=ne();return R&&J&&(me=Pe.createElement("div",{key:e.id,className:`${an}Proxy ${_u}`,style:{height:M,width:D,left:J.left??0,top:J.top??0}},Pe.createElement("div",{className:Ou({visible:fe})},Pe.createElement(Lf,{size:16})),Z),me=(0,Mp.createPortal)(me,C.current)),Pe.createElement(Me,{value:K},Pe.createElement(Yi,{domRef:z,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...ue,"data-z-index":se,style:H,width:D,onPointerDown:qe,contentClassName:te(Eu(Ae),su[F]),contentStyle:S?{height:M/2}:void 0,className:te(an,pu.none,Y?au.pointer:"",ce,Ni(e,[an,cn],Fu,{dragging:R,insideDisabledDraggingPage:P,align:F,verticalAlign:X,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Au),cssEllipsis:ae,afterChildren:Pe.createElement(Pe.Fragment,null,S?Se:null,$),renderChildren:le}),me)}var Dp=Pe.memo(HS);function Er(){return(0,ho.useContext)(Xi)}var bo=j(require("react")),Fp=require("react");function Ep(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var _p={padding:he.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},KS={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Op=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(Ep(t),o,"important")},Np=bo.forwardRef(function(e,t){let{rootClassName:o}=Ii(),r=bo.useRef(null),i=bo.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,Fp.useEffect)(()=>{let a=()=>{setTimeout(()=>{Op(r.current,_p),Op(r.current?.firstElementChild,KS)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),bo.createElement("div",{ref:i,...e,className:te(`${o}-Footer`,gd,e.className),style:_p},"Powered by"," ",bo.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function Gs(n){return n.map(to)}function to(n){if(De().structuredClone)return De().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return Gs(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(Gs(Array.from(n)));if(n instanceof Map)return new Map(Gs(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=to(n[t]));return e}function Qr(n){return n}var bn=Object.seal({data:null,field:null});var Wo="____root____",kp="____not_loaded_yet____";function Bo(){return!1}function Hs(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function ya(n,e,t,o,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=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function zp(n,e){let{marker:t,reducers:o={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:c}=n;t&&t.start();let u=new oe;function d(h,y,S,T=0,C=[]){let w=!S.length||T===S.length-1,I=y[c?.values||"values"]||{};for(let v in I)if(I.hasOwnProperty(v)){let x=v;C.push(x),f.set(C,!0),h.set(C,{reducerResults:I[v][c?.totals||"totals"]||{},items:[]}),w||d(h,I[v],S,T+1,C),C.pop()}}let f=r?new oe:void 0,p=[],m=Hs(o),g=to(m);e.visitDepthFirst((h,y,S,T)=>{let[C,...w]=y,I=h.children,v=u.get(w);if(v&&(v.cache=h.cache,v.childrenLoading=h.childrenLoading,v.childrenAvailable=h.childrenAvailable,v.error=h.error),w.length==i.length&&i.length){if(v){v.items=I;for(let R=0,P=w.length;R<P;R++){let A=w.slice(0,R),M=u.get(A);M&&(M.items=M.items||[],M.items=M.items.concat(I))}I=a.indexArray(I,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let x=0,R=I.length;x<R;x++){if(!I[x]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...w,`${kp}${x}`],D);continue}let P=I[x].data,A=I[x].keys||[];if(A.length){let D=A[A.length-1];w.push(D)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:P,totalChildrenCount:I[x].totalChildrenCount,reducerResults:I[x].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(w,M),r){let D=M.pivotDeepMap=new oe,_=I[x].pivot;d(D,_,r,0,p)}A.length&&w.pop()}T?.()});let b={deepMap:u,groupParams:n,initialData:e,reducerResults:g};return r&&(b.topLevelPivotColumns=f,b.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),b}function Lp(n,e,t,o,r,i,a,l,s,c=Qr){let{items:u,reducerResults:d,pivotDeepMap:f}=n.get(e);if(u.push(o),a&&ya(o,r,a,d,e),i){for(let p=0,m=i.length;p<m;p++){let{field:g,valueGetter:b,toKey:h}=i[p],y=g?o[g]:null;b&&(bn.data=o,bn.field=g,y=b(bn));let S=(h||c)(y,o);t.push(S),f.has(t)||(l.set(t,!0),f?.set(t,{reducerResults:to(s),items:[]}));let{reducerResults:T,items:C}=f.get(t);C.push(o),a&&ya(o,r,a,T,e)}t.length=0}}function Vp(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=n,d=u(r),f=[...o,d],p=s(r);if(t.set(f,!0),p){for(let h=0,y=o.length;h<=y;h++){let S=o.slice(0,h),T=e.get(S),{reducerResults:C,items:w}=T;w.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&ya(r,i,a,C,S)}return}let m=to(l),g=[];e.set(f,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let b=c(r);if(!(!b||!Array.isArray(b))){for(let h=0,y=b.length;h<y;h++){let S=b[h];Vp(n,e,t,f,S,h,a,l)}a&&Jr(a,m,g)}}function Ks(n,e){let{reducers:t,marker:o}=n;if(o){let c=Object.keys(t??{});o.start({details:c.length>0?[{name:"Reducers",value:c.join(", ")}]:void 0})}let r=Hs(t),i=to(r),a=new oe,l=new oe;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let c=0,u=e.length;c<u;c++)Vp(n,a,l,[],e[c],c,t,r);t&&Jr(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function Ta(n,e){let{marker:t,groupBy:o,defaultToKey:r=Qr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new oe:void 0,c=new oe,u=[],d=[],f=Hs(a),p=to(f);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:to(f)};i&&(g.pivotDeepMap=new oe),c.set(u,g)}for(let g=0,b=e.length;g<b;g++){let h=e[g],y={};for(let S=0;S<l;S++){let{field:T,groupField:C,valueGetter:w,toKey:I}=o[S],v=T?h[T]:null;w&&(bn.data=h,bn.field=T,v=w(bn));let x=(I||r)(v,h);if(y[T||C]=x,u.push(x),!c.has(u)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:to(f)};i&&(R.pivotDeepMap=new oe),c.set(u,R)}Lp(c,u,d,h,g,i,a,s,f,r)}l||Lp(c,u,d,h,g,i,a,s,f,r),a&&ya(h,g,a,p,u),u.length=0}a&&(c.visitDepthFirst((g,b,h,y)=>{Jr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:T},C,w,I)=>{Jr(a,T,S),I?.()}),y?.()}),Jr(a,p,e));let m={deepMap:c,groupParams:n,initialData:e,reducerResults:p};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:o.map(g=>g.field).join(", ")}]}),m}function Gp(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function BS(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,f=d??null,p;if(Object.keys(c).length>0){f={...d},p={};for(let y in i)if(i.hasOwnProperty(y)){let T=i[y].field;T&&(p[T]=c[y]),T&&f[T]==null&&(f[T]=c[y])}}let m=!0,g=o[o.length-1],b=g;if(f!=null){let y=t[o.length-1];y&&y.field&&(b=f[y.field]),y&&y.toKey&&(b=y.toKey(b,f)),b=b??g}return typeof b=="string"&&b.startsWith(kp)&&(m=!1,b=null),{data:f,reducerData:p,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Bo,hasSelectedCells:Bo,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:b,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function Sa(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function Jr(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function Hp(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:f,withRowInfo:p,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:b,rowsPerPage:h}=r,{deepMap:y}=u,S=n.length,T=t[t.length-1],C=T?T.nodeExpanded:!0;for(let w=0;w<S;w++){let I=n[w],v=c(I,w),x=[...e,v];if(l(I)){let O={id:v,nodePath:x,isGroupRow:!1,data:I,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Bo,hasSelectedCells:Bo,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,w],indexInParent:w,indexInAll:C?i.length:-1};f&&(O.rowSelected=f(O)),d&&(O.rowDisabled=d(O)),p&&p(O);let L=b&&h!=null&&h>0&&O.indexInAll%h===0?O.indexInAll/h:null;for(let V=0,z=t.length;V<z;V++){let G=t[V];if(C||(G.collapsedLeafNodesCount+=1),G.deepRowInfoArray.push(O),L!=null&&C){if(typeof b=="function"&&b(G)!==!0)continue;let E=Sa(G,O.indexInAll,L);i[E.indexInAll]=E,O.indexInAll++}}C&&(i[O.indexInAll]=O);continue}let A=y.get(x)?.totalLeafNodesCount??0,M={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:x,id:v,data:I,indexInAll:i.length,indexInParent:w,indexInParentNodes:[...o,w],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Bo,hasSelectedCells:Bo,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(M.rowSelected=f(M),g)){let O=g.getSelectionCountFor(M.nodePath);M.selectedLeafNodesCount=O.selectedCount,M.deselectedLeafNodesCount=O.deselectedCount}d&&(M.rowDisabled=d(M)),p&&p(M);let D=!0;if(m&&(M.selfExpanded=D=m(M)),C||(D=!1),M.nodeExpanded=D,C&&b&&h!=null&&h>0){let O=M.indexInAll,L=M.parentNodes;if(L.length>0&&O%h===0){let V=O/h,z=0;L.forEach(G=>{typeof b=="function"&&b(G)!==!0||(i.push(Sa(G,O+z,V)),z++,M.indexInAll++)})}}C&&(i[M.indexInAll]=M);let _=s(I);Array.isArray(_)&&Hp(_,x,[...t,M],M.indexInParentNodes,r,i)}return i}function Kp(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return Hp(e,[],[],[],n,o),t&&t.end(),{data:o}}function Bp(n){let{marker:e,lazyLoad:t,groupResult:o,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:f,reducers:p={}}=n,{groupParams:m,deepMap:g,pivot:b}=o,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(w=>w.field).join(", ")}]});let y=[],S=[],T=[],C=[];return g.visitDepthFirst((w,I,v,x)=>{let R=w.items,P=I.length,A=s?.isGroupRowCollapsed(I)??!1;C.push(v);let M=BS({lazyLoad:t,groupBy:h,parents:Array.from(T),reducers:p,indexInGroup:v,indexInParentGroups:Array.from(C),indexInAll:y.length,groupKeys:I,error:w.error,totalChildrenCount:w.totalChildrenCount,childrenLoading:(w.childrenLoading||!A&&!w.childrenAvailable)&&t,childrenAvailable:w.childrenAvailable,directChildrenCount:I.length===h.length?w.items.length:g.getDirectChildrenSizeFor(I),directChildrenLoadedCount:0},w);if(u&&(M.rowSelected=u(M),d)){let V=d.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=V.selectedCount,M.deselectedChildredCount=V.deselectedCount}c&&(M.rowDisabled=c(M));let D=T[T.length-1],_=D?.collapsed??!1;_&&(A=!0),M.collapsed=A;let O=f||A;if(_&&(O=!1),O){if(i&&r!=null&&r>0){let V=M.indexInAll,z=M.parents;if(z.length>0&&V%r===0){let G=V/r,E=0;z.forEach(F=>{typeof i=="function"&&i(F)!==!0||(y.push(Sa(F,V+E,G)),E++,M.indexInAll++)})}}y.push(M),S.push(y.length-1)}M.collapsedChildrenCount=0,T.forEach(V=>{V.deepRowInfoArray.push(M),V.collapsedGroupsCount+=A?1:0}),D&&M.selfLoaded&&t&&(D.directChildrenLoadedCount+=1),a&&a(M),T.push(M);let L=!0;if(L){if(x)x();else if(!b){let V=y.length;A||(y.length+=R.length);let z=0;for(let G=0,E=R.length;G<E;G++){let F=R[G];if(!A&&i&&r!=null&&r>0){let re=V+G+z;if(re%r===0){let ge=re/r;T.forEach(be=>{if(typeof i=="function"&&i(be)!==!0)return;let ae=V+G+z;y[ae]=Sa(be,ae,ge),z++,y.length++})}}let X=V+G+z,Y={id:F?l(F,X):`${I}-${G}`,data:F,isCellSelected:Bo,hasSelectedCells:Bo,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!F,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:A,groupKeys:I,parents:Array.from(T),indexInParentGroups:[...C,G],indexInGroup:G,indexInAll:X,groupBy:h,groupNesting:P+1,groupCount:M.groupCount};u&&(Y.rowSelected=u(Y)),c&&(Y.rowDisabled=c(Y)),a&&a(Y),T.forEach((re,ge)=>{ge===T.length-1&&F&&(re.directChildrenLoadedCount+=1),A&&(re.collapsedChildrenCount+=1),re.deepRowInfoArray.push(Y)}),A||(y[V+G+z]=Y)}}}T.pop(),C.pop()}),e&&e.end(),{data:y,groupRowsIndexes:S}}var Em=j(require("react"));var WS=()=>{};function Wp(n,e){let t=new oe,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){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]],f=t.get(d),p=f?f[o]??[]:[];a(d,p),p.length&&(f||(f=typeof r=="function"?r(d,p):r),f[o]=p),s.push(f)}return s}return a([],[])}function jp(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(o),d=[...t,u],f=r(o),p=pt(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,b=m.length;g<b;g++){let h=m[g];jp(n,e,d,h)}});f?(c?.(o),s?.(o,WS)):(l?.(o,p,i(o)),s?.(o,p))}function $p(n,e,t){for(let o=0,r=t.length;o<r;o++)jp(n,e,[],t[o])}var jS=function(n,e){return n-e},$S=function(n,e){return n=`${n}`,e=`${e}`,n.localeCompare(e)},US=function(n,e){return n-e},YS={number:jS,string:$S,date:US},ei=YS;function Up(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var oo=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(Yp(Up(n),o)),r&&r.end(),e},Ca=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=Yp(Up(n),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,c=d=>d[l],u=d=>d[l]===void 0;return $p({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,f,p)=>{if(i&&f(),Array.isArray(p)){let m=a?p.sort(r):[...p].sort(r);d[l]=m}i||f()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),o&&o.end(),e};oo.knownTypes=ei;var qS=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=oo.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(oo.knownTypes).join(", ")}`)}return r||(r=ei.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:o*c}},XS=n=>n.map(qS).filter(e=>e instanceof Function),Yp=(n,e)=>{let t=XS(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var wa=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new oe(o.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 oe(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 wt=class extends wa{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)}};var ZS=j(require("react"));function Ia(n){return Fe(e=>n(e.dataSourceState))}function Jn(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||Qr)(l,n);return t.push(s),t},[])}var _e=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new oe;this.deselectedMap=new oe;this.onlyUsePrimaryKeys=!1;this.selectionCache=new oe;this.selectionCountCache=new oe;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,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Jn(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let o=this.getGroupDeepMap()?.get(e);return o?o.totalChildrenCount??(o.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 o=t?.get(e);return o?o.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new n(e,t,o)}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()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}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 o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!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(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!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 o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),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 o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),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 o=this.selectionCountCache.get(e);if(o!=null)return o;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(p=>{if(this.defaultSelection){if(this.deselectedMap.has([p])){d++;return}u++}else{if(this.selectedMap.has([p])){u++;return}d++}});let f={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,f),f}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,f=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=u-(d+f),m={selectedCount:d+(c?p:0),deselectedCount:f+(c?0:p)};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),f=u?!0:d?!1:t,{selectedCount:p,deselectedCount:m}=this.getSelectionCountFor(c,f);a+=p,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var QS="*",$e=class{constructor(e){this.wildcard=QS;this.cache=new oe;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,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)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[f,p]=d;p===t&&l.push([f,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[f]=d;f===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),o)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,o){if(o){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(o){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,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){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(o){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,o=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)}),o&&o.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 o=this.selectedRowsToColumns.get(e);if(o){if(o.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=>o.has(r)):!1}return!1}error(e){Ro(`${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 o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!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 p=this.selectedRowsToColumns.get(e);return p&&p.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((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var JS=Ue("IT:InfiniteTable"),eT="#dc3545",tT="#eb9316";var Xp="Warn",Zp="Error",oT="Info",nT="Success",rT="Logs",Ra=JS.extend(rT),dF=Ra.extend(oT),iT=Ra.extend(Xp),aT=Ra.extend(Zp),fF=Ra.extend(nT);var lT=tT,sT=eT;var cT=(n,e)=>{e=e?e.extend?e.extend(Xp):e:iT,e(typeof e.color=="function"?e.color(lT,n):n)},uT=(n,e)=>{e=e?e.extend?e.extend(Zp):e:aT,e(typeof e.color=="function"?e.color(sT,n):n)};var qp=new oe,Qp=(n,...e)=>{qp.has(e)||(qp.set(e,!0),n())};var er=(n,e=n,t)=>{Qp(()=>cT(n,t),e,"warn")},Jp=(n,e=n,t)=>{Qp(()=>uT(n,t),e,"error")};function va(n,e){return new _e(n,ht(e))}function ht(n){return()=>{let e=typeof n=="function"?n():n;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function em(n){let{getDataSourceState:e,dataSourceActions:t}=n;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 _e))throw"Invalid row selection";let a=new _e(r,ht(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 _e))throw"Invalid row selection";let a=new _e(r,ht(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 _e))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Jn(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 _e))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Jn(d,c):[]}let u=new _e(a,ht(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 _e))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Jn(d,c):[]}let u=new _e(l,ht(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 _e))throw"Invalid row selection";let s=new _e(a,ht(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 _e))throw"Invalid row selection";let s=new _e(a,ht(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 _e))throw"Invalid row selection";let s=new _e(a,ht(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new _e(i,ht(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof _e))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new _e(r,ht(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 Bs=new WeakMap,dT=n=>n;function tm(n,e=50,t){Bs.set(n,{lastCallTime:0,lastCallArg:null});let o=t??dT;return r=>{let{lastCallTime:i,lastCallArg:a}=Bs.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=yt(o(a),o(r));s<e&&c||(Bs.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var Da=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new oe;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[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,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};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:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let c=o&&!o.isEmpty();if(c&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let u=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,f=u.length;d<f;d++){let p=u[d];if(p.type==="insert"){let m=r(p.data);s?this.addNodePath([m],p.data,t):this.add(m,p.data),e.push(p.data)}}o?.removeInfo(void 0)}}else{let u=(d,f)=>{for(let p=0;p<d.length;p++){let m=d[p];c&&s&&Array.isArray(m[l])&&(m=d[p]={...m});let g=!1;if(m!=null){let b=r(m),h=s?[...f,b]:void 0,y=s&&!!h,S=y?o?.getMutationsForNodePath(h):o?.getMutationsForPrimaryKey(b);if(S&&S.length){for(let T=0,C=S.length;T<C;T++){let w=S[T];if(w.type==="delete"&&!g&&(y?this.removeNodePath(h,t):this.remove(b),g=!0,d.splice(p,1),p--),w.type==="update"&&!g&&(m={...m,...w.data},d[p]=m),w.type==="update-children"&&!g){let I=w.children(m[l],m);m={...m},I!==void 0?m[l]=I:delete m[l],d[p]=m}w.type==="insert"&&(w.position==="before"?(d.splice(p,0,w.data),p--):d.splice(p+1,0,w.data))}y?o?.removeNodePathInfo(h):o?.removeInfo(b)}if(!g)if(y){this.addNodePath(h,m);let T=a(m),C=T?null:i(m);!T&&Array.isArray(C)&&(f.push(b),c&&(m[l]=C=C.concat()),u(C,f),f.pop())}else this.add(b,m)}}};u(e,[])}return e}}};var rt=require("react");var Lt=require("react");function yn(n,e){let t=(0,Lt.useRef)({}),o=(0,Lt.useRef)({}),r=o.current,i=(0,Lt.useRef)({}),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,(0,Lt.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function fT(n,e){let t=(0,Lt.useRef)({}),o=(0,Lt.useRef)({}),r=o.current,i=(0,Lt.useRef)({}),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,(0,Lt.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function pT(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);(0,Lt.useEffect)(n,t)}function Ws(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function js(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function $s(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function om({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(p=>({...r[p],id:p}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=pt(function(){l.forEach((p,m)=>{s[`total:${p.id}`]=js({header:`${p.name||p.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:p,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[p.id]:null})})});(!a&&t==="start"||o==="start")&&u();let d=!i&&l.length===1;return n.visitDepthFirst((p,m,g,b)=>{if(m=[...m],t==="end"&&b?.(),m.length===a){let h=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let T=S;S=m.join("/");let C=m[m.length-1];c[S]=$s({header:`${C}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((T,C)=>{let w=d?`${m[m.length-1]}`:T.name||T.id,I=js({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:T,pivotAggregatorIndex:C,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:h,defaultSortable:!1,columnGroup:S,header:w,valueFormatter:({rowInfo:x})=>x.isGroupRow?x.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),v=`${T.id}:${m.join("/")}`;s[v]=I})}else{let h=m.join("/"),y=m.slice(0,-1);if(c[h]=$s({columnGroup:y.length?y.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],T=y.length?y.join("/"):void 0;if(!d){let C=T;T=`total:${m.join("/")}`,c[T]=$s({header:`${m[m.length-1]} total`,columnGroup:C,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((C,w)=>{let I=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,v=js({columnGroup:T,header:I,pivotAggregator:C,pivotAggregatorIndex:w,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:x})=>x.isGroupRow?x.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&b?.()}),(!a&&t==="end"||o==="end")&&u(),{columns:s,columnGroups:c}}var nm=Symbol("CLEAR"),Sn=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new oe;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,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:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,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:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=nm,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(nm);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=()=>oe.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 o=new n({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:oe.clone(e.nodePathToData),o}};function jo(n,e){return e().dataArray[n]}function xa(n){return n().dataArray}var st=class{constructor(e){this.collapsedPathsMap=new oe;this.expandedPathsMap=new oe;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:o,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)?o.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)?o.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,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var mT=(n,e)=>n.length-e.length,Je=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new oe;this.cache=new oe;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new oe})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Array.isArray(e)?new oe(e.map(t=>[t,!0])):e:this.config.treePaths}withTreePaths(e,t){let o=this.config.treePaths;t=this.getTreePaths(t);let r=t!==o;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=o,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(o=>o.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],o){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},o)}getSelectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&o.push(i.keys)})},t),o}getDeselectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||o.push(i.keys)})},t),o}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new n(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Array.isArray(t.treePaths)?new oe(t.treePaths.map(o=>[o,!0])):t.treePaths,strictCheckPaths:t.strictCheckPaths??!0},this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}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 o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)!==!1){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(mT);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let f=r?i:!1;return this.cacheIt(e,{selected:f,selectedCount:f?r:0,deselectedCount:f?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,f=l.length;d<f;d++){let p=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(p);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.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.xcache(),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:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function Ma(n,e){return new Je(n,tr(e))}function tr(n){return()=>({treePaths:(typeof n=="function"?n():n).treePaths})}var Pa=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.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 Je))throw"Invalid tree selection";let a=new Je(r,tr(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},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(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!o)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(o.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),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new st({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new st({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 o=this.getState(),r=new st(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new st(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new st(o.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?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?jo(o,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 Je))throw"Invalid node selection";let o=new Je(e,tr(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,tr(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Je))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 or=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)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 It=class extends or{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}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,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var Us=1e3;function rm(n){return new Ys(n)}var Ys=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=()=>xa(this.getState);this.getRowInfoByIndex=e=>jo(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(),o=t.getDataForNodePath(e);return o||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 o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?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,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Us:r;return isNaN(a)||(a=Us),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,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.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 o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,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 o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};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 o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&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=o?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,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});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 o=this.getState().rowDisabledState,r=o?new It(o):new It({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new It({enabledRows:!0,disabledRows:[]});return}let t=new It(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new It({disabledRows:!0,enabledRows:[]});return}let t=new It(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 Pa({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});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:o,nodesKey:r}=this.getState(),i=t?Sn.clone(t,{light:!0}):new Sn({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let f=a.primaryKeys[d],p=this.getDataByPrimaryKey(f);p&&i.update(a.primaryKeys[d],u,p,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[d]);f&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,f,a.metadata):i.updateNodePath(a.nodePaths[d],u,f,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 o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Us,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=f=>{clearTimeout(d),u=f,o.waitForNodePathPromises.delete(e),c(f)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return o.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 im(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:f,isTree:p}=n;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((b,h)=>b||typeof h!="function"?l.has(h):!1,!1),t))break}if(c&&c.length){if(l===!0)o=!0;else for(let m of c)if(m.field&&l.has(m.field)){o=!0;break}}if(p&&(l===!0?r=!0:r=l.has(f)),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:o,filterValue:i,aggregationReducers:a,tree:r}}function Aa(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function Ea(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function _a(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function Xs(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var no=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function qs(){return!1}function gT(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:qs,hasSelectedCells:qs};return o&&(a.rowSelected=o(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 hT=pt(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
|
|
1
|
+
"use strict";var Pb=Object.create;var pi=Object.defineProperty;var Mb=Object.getOwnPropertyDescriptor;var Ab=Object.getOwnPropertyNames;var Eb=Object.getPrototypeOf,_b=Object.prototype.hasOwnProperty;var Ob=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Fb=(n,e)=>{for(var t in e)pi(n,t,{get:e[t],enumerable:!0})},Bc=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ab(e))!_b.call(n,r)&&r!==t&&pi(n,r,{get:()=>e[r],enumerable:!(o=Mb(e,r))||o.enumerable});return n};var j=(n,e,t)=>(t=n!=null?Pb(Eb(n)):{},Bc(e||!n||!n.__esModule?pi(t,"default",{value:n,enumerable:!0}):t,n)),Nb=n=>Bc(pi({},"__esModule",{value:!0}),n);var on=Ob((kD,Md)=>{"use strict";Md.exports=function(n,e,t,o,r){var i,a;if(o===void 0)o=0;else if(o=o|0,o<0||o>=n.length)throw new RangeError("invalid lower bound");if(r===void 0)r=n.length-1;else if(r=r|0,r<o||r>=n.length)throw new RangeError("invalid upper bound");for(;o<=r;)if(i=o+(r-o>>>1),a=+t(n[i],e,i,n),a<0)o=i+1;else if(a>0)r=i-1;else return i;return~o}});var $I={};Fb($I,{AutoScroller:()=>fn,CellSelectionState:()=>$e,DRAG_ITEM_ATTRIBUTE:()=>It,DataClient:()=>Lc,DataSource:()=>JT,DataSourceActionType:()=>Om,DeepMap:()=>oe,DragDropProvider:()=>Vi,DragInteractionTarget:()=>$n,DragList:()=>zo,FixedSizeSet:()=>cl,FlashingColumnCell:()=>bb,GroupRowsState:()=>wt,INTERNAL_MatrixDebugger:()=>Sb,InfiniteTable:()=>ao,InfiniteTableClassName:()=>Zt,InfiniteTableComponent:()=>ib,Menu:()=>Ut,RowDetailCache:()=>rr,RowDetailState:()=>Pt,RowDisabledState:()=>Rt,RowSelectionState:()=>Oe,TreeDataSource:()=>VI,TreeExpandState:()=>st,TreeGrid:()=>sb,TreeSelectionState:()=>Je,WeakFixedSizeSet:()=>dl,alignNode:()=>Sc,components:()=>jI,createDefaultProxy:()=>Ts,createFlashingColumnCellComponent:()=>kc,debounce:()=>_t,debug:()=>Ue,defaultDragProxyMove:()=>Cs,defaultFilterTypes:()=>Oo,eventMatchesKeyboardShortcut:()=>$a,filterDataArray:()=>Qs,filterTypes:()=>Oo,flatten:()=>Kp,getComponentStateRoot:()=>Ft,group:()=>Ta,interceptMap:()=>db,keyboardShortcuts:()=>ub,multisort:()=>oo,multisortNested:()=>Ca,queryKeyToCacheKey:()=>vn,toTreeDataArray:()=>$p,useComponentState:()=>Nt,useDataSourceApi:()=>_m,useDataSourceInternal:()=>nr,useDataSourceSelector:()=>_e,useDataSourceState:()=>wa,useDragDropProvider:()=>uo,useDragListContext:()=>pn,useEffectWhen:()=>pl,useEffectWhenSameDeps:()=>fb,useEffectWithChanges:()=>yn,useEffectWithObject:()=>yT,useGridScroll:()=>nl,useInfiniteColumnApi:()=>rb,useInfiniteColumnCell:()=>zr,useInfiniteColumnEditor:()=>Xi,useInfiniteColumnFilterEditor:()=>Ln,useInfiniteHeaderCell:()=>Er,useInfinitePortalContainer:()=>Eh,useInfiniteTableApi:()=>nb,useLayoutEffectWithChanges:()=>bT,useManagedDataSource:()=>ec,useMasterRowInfo:()=>xo,useOverlay:()=>ro,useOverlayPortal:()=>$g,usePrevious:()=>Eo,useRowInfoReducers:()=>eC,useVisibleColumnSizes:()=>Rh,withSelectedLeafNodesOnly:()=>cb});module.exports=Nb($I);function _t(n,{wait:e}){let t=null;return function(...o){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{n.apply(r,o)},e)}}var ve=j(require("react"));var te=(...n)=>n.filter(e=>!!`${e}`).join(" ");var Jo=j(require("react")),Pl=require("react");function Te(n=!1){let e=null,t=[],o=null,r=(i,a)=>{let l=[];if(n)o!=null&&(cancelAnimationFrame(o),o=null),requestAnimationFrame(()=>{e=i,o=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 pt(n){let e=!1,t=null;return(...r)=>(e||(e=!0,t=n(...r)),t)}var Wc=(n,e)=>n-e;var mi=(n,e)=>Wc(n.revision,e.revision),oe=class n{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,o)=>this.visitKey(o,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,o,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,f)=>{let p=r.get(f);if(!p)return;let{map:m}=p,g=f===this.emptyKey;if(g&&!c)return;let b=g?[]:[...e,f],h=m?()=>this.visitWithNext(b,t,o,m,i!==void 0?i-1:void 0):void 0;if(p.hasOwnProperty("value")){let y=t(p.value,b,l,h,p);if(o&&y===!0)return!0;l++}else h?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,f]of r){let p=u(f,d);if(o&&p===!0)return p}};this.fill(e)}static clone(e){let t=new n;return e.visit((o,r)=>{t.set(r,o.value)}),t}fill(e){e&&e.forEach(t=>{let[o,r]=t;this.set(o,r)})}getValuesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push(i)},t),o}getEntriesStartingWith(e,t){let o=[];return this.getStartingWith(e,(r,i)=>{o.push([r,i])},t),o}getLeafNodesStartingWith(e,t,o){let{respectOrder:r=!1}=o||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},o),r?i.sort(mi).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>o.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,o=>[o.keys,o.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:o,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=f=>{i?a.push(f):l.push(f.keys)},c=this.map,u,d=!1;if(e.length)for(let f=0,p=e.length;f<p;f++){let m=e[f];if(u=c.get(m),!u||!u.map)if(d=!0,f===p-1){d=!0;break}else return[];c=u.map}else if(!o&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(o||(s({...u,keys:e}),d=!0)),d?i?a.sort(mi).map(f=>f.keys):l:(this.visitWithNext(e,(f,p,m,g,b)=>{s({...b,keys:p})},!1,c,r,o),i?a.sort(mi).map(f=>f.keys):l)}getKeysStartingWith(e,t){let o=[];return this.getStartingWith(e,r=>{o.push(r)},t),o}getStartingWith(e,t,o){let{excludeSelf:r,depthLimit:i}=o||{},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,f,p)=>{t(u,c,{...p,keys:u}),f?.()},!1,a,i,r)}getMapAt(e){let t=this.map,o;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return;t=o.map}return t}getAllChildrenSizeFor(e){let t=this.map,o;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(o=t.get(a),!o||!o.map)return 0;t=o.map}return o.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===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 o=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=o.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,o.set(a,s),this.length++):(s.map||(s.map=new Map,o.set(a,s)),s.length++,o=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let o=0,r=e.length;o<r;o++){let i=e[o],a=o===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((o,r)=>{let{map:i}=o;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 o=[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,o.push(t)}}for(;o.length;){let a=o.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=o[o.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 o=0,r=e.length;o<r;o++){let i=e[o],a=o===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,o,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...o,e],c=pt(()=>{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((o,r)=>{let i=e({...o,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 o=[];return t.forEach(r=>{r.value!==void 0&&o.push(r.value)}),o}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(mi);function*o(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return o()}};globalThis.DeepMap=oe;function De(){return globalThis}var hi=["#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"],jc=Symbol("color"),gi=new WeakMap,Cl=Te();function Il(n=hi){gi.set(n,n.map(e=>0))}Il();var Lb=(n=hi)=>{let e=[];gi.has(n)?e=gi.get(n):(e=n.map(o=>0),gi.set(n,e));let t=e.reduce((o,r,i,a)=>r<a[o]?i:o,0);return e[t]!=null&&e[t]++,n[t]??n[0]??hi[0]},Cr=":",wl="*",$c="-",kb=",",zb="debug",Vb="diffdebug",Yc=!1,Tr=new oe,Ir=new Map;function Rl(n,e){let t=n.split(Cr),o=new oe;o.set(t,!0);let r=e.split(Cr),i=new Set(r).has(wl),a=r.indexOf(wl),l=i?r.slice(0,a):r;if(o.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?n.endsWith(s.join(Cr)):!0}}function qc(n,e){let t=`channel=${n}_permissions=${e}`;if(Ir.has(t))return Ir.get(t);let o=e.split(kb);function r(l){return Ir.set(t,l),l}let i=[],a=[];o.forEach(l=>{l.includes(wl)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith($c);if(c&&(s=s.substring($c.length)),Rl(n,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)),Rl(n,s))return r(!c)}return r(!1)}var vl=()=>Ue.enable??(De()&&De().localStorage?.getItem(zb))??"",Gb=()=>Ue.diffenable??(De()&&De().localStorage?.getItem(Vb))??`${Yc}`,Dl="",Xc=Yc;function xl(n){Xc=`${Gb()}`=="true",Dl!==n&&(Dl=n,Ir.clear())}function Zc(n){xl(vl()),typeof De()<"u"&&De().addEventListener&&De().addEventListener("storage",function(){xl(vl())});function e(t,o){let r=o?`${o}${Cr}${t}`:t,i=r.split(Cr),a=Tr.get(i);if(a)return a;let l=Tr.get(i.slice(0,-1)),s=(l?l.logFn:Ue.logFn)??Qc,c=s,u,d=0,f=()=>u??qc(r,Dl),p=Lb(Ue.colors),m=Object.defineProperties((...g)=>{let b=Cl.getListenersCount(),h;if(b>0&&(h=h??Date.now(),Cl({color:p,channel:r,args:g,timestamp:h})),f()){if(h=h??Date.now(),d&&Xc){let T=h-d;c(`%c[${r}]`,`color: ${p}`,`+${T}ms:`)}d=h;let y=[],S;if(g.forEach(T=>{if(T[jc])S===void 0&&(S=!0),y.push(...T);else{if(typeof T!="string"&&typeof T!="number"){S=!1;return}y.push(`${T}%s`)}}),S){let T=[`%c[${r}]%c %s`,`color: ${p}`,"",...y,""];c(...T)}else c(`%c[${r}]%c %s`,`color: ${p}`,"",...g)}},{channel:{value:r},color:{value:(g,...b)=>{let h=[`%c${b.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>b.join(" "),h[jc]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>f(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{Tr.delete(i)}}});return Tr.set(i,m),m}return e(n)}var Qc=console.log.bind(console),Uc;Object.defineProperty(Zc,"enable",{get:()=>Uc,set:n=>{Uc=n,xl(vl())}});var Ue=Zc;Ue.colors=hi;Ue.logFn=Qc;var Hb=(n,e)=>Cl.onChange(t=>{if(!t)return;let{channel:o,args:r,color:i,timestamp:a}=t;Rl(o,n)&&e({channel:o,color:i,args:r,timestamp:a})});Ue.onLogIntent=Hb;Ue.isChannelEnabled=qc;Ue.destroyAll=()=>{Il(),Il(Ue.colors),Tr.clear(),Ir.clear()};var Ot=n=>{let e=Ue(n?`IT:${n}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},Ro=n=>{let e=Ue(n?`IT:${n}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},wr=()=>wr;wr.extend=()=>wr;var bt=class{constructor(e){this.debug=wr,this.error=wr}};var Kb=j(require("react")),vo=require("react");var Rr=(n,e,t={debounce:0})=>{let o=t.debounce??0,r=window.ResizeObserver,i=o?_t(e,{wait:o}):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=n.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(n),()=>{a.disconnect()}},bi=(n,e,t={earlyAttach:!1,debounce:0})=>{let o=(0,vo.useRef)({width:0,height:0}),r=i=>{let a;return n.current&&(a=Rr(n.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=o.current;(s.width!==l.width||s.height!==l.height)&&(o.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,vo.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[n.current,e,t.earlyAttach,t.debounce]),(0,vo.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[n.current,e,t.earlyAttach])};var Bb=Ro("CSSVariableWatch"),Wb=Ot("CSSVariableWatch"),jb={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},$b=n=>{let e=(0,Pl.useRef)(0),t=Jo.useCallback(({height:o})=>{o!=null&&o!==e.current&&(e.current=o,n.onChange(o))},[n.onChange]);bi(n.ref,t,{earlyAttach:!0}),Jo.useLayoutEffect(()=>{let o=n.ref.current.getBoundingClientRect().height;if(o!=null)return e.current=o,Wb(`Variable ${n.varName} found and equals ${o}.`),n.onChange(o);Bb(`Specified variable ${n.varName} not found or does not have a numeric value.`)},[])},vr=n=>{let e=(0,Pl.useRef)(null);$b({...n,ref:e});let t=n.varName.startsWith("var(")?n.varName:`var(${n.varName})`,{allowInts:o=!1}=n;return Jo.createElement("div",{"data-name":"css-variable-watcher","data-var":n.varName,style:jb},Jo.createElement("div",{ref:e,style:{height:o?`calc(1px * ${t})`:t}}))};var An=require("react");var so=require("react");function yt(n,e,t){if(n===e)return!0;if(!n||!e)return!1;let o=typeof n;if(o!==typeof e||o!=="object")return!1;var i=Object.keys(n),a=Object.keys(e);t&&(i=i.filter(u=>!t.has(u)),a=a.filter(u=>!t.has(u)));var l=i.length;if(a.length!==l)return!1;for(var s=0;s<l;s++){var c=i[s];if(!(t&&t.has(c))&&(n[c]!==e[c]||!Object.prototype.hasOwnProperty.call(e,c)))return!1}return!0}function Do(){let n=null,e=new Set;return{getSnapshot(){return n},setSnapshot(t){n=t},subscribe(t){return e.add(t),()=>{e.delete(t)}},notify(){for(let t of e)t()}}}function Jc(n,e,t){let o=(0,so.useRef)(e);o.current=e;let r=(0,so.useRef)(t);r.current=t;let i=(0,so.useRef)(void 0),a=(0,so.useRef)(!1),l=(0,so.useCallback)(()=>{let s=n.getSnapshot(),c=o.current(s);return a.current&&r.current(i.current,c)?i.current:(i.current=c,a.current=!0,c)},[n]);return(0,so.useSyncExternalStore)(n.subscribe,l,l)}function yi(n,e){return Jc(n,e,Object.is)}function Pn(n,e){return Jc(n,e,yt)}var eu=j(require("react")),Ml;function Mn(){return Ml||(Ml=eu.createContext(null))}var tu=Do(),ou=()=>{};function Si(){let n=Mn();return(0,An.useContext)(n)||void 0}function Ti(){let n=Si();return(0,An.useCallback)(()=>n?.getSnapshot(),[n])}function co(n){let e=Mn(),t=(0,An.useContext)(e),o=Pn(t||tu,t?n:ou);return t?o??void 0:void 0}function xo(){let n=Mn(),e=(0,An.useContext)(n),o=yi(e||tu,e?r=>r.masterRowInfo:ou);return e?o:void 0}var En=j(require("react")),Qe=require("react");function Al(n,e){let t=new Set;function o(...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 n.apply(this,s)}return{fn:o,propertyReads:t}}var El=n=>n&&n.substr(0,1).toUpperCase()+n.substr(1);function Po(n){if(n==null)return!1;let e=n;return!0}function Dr(n){return n!==void 0}function Mo(n,e){let t=e[n];return Dr(t)}var Ao=require("react");var Ci=require("react"),Yt=()=>{let[n,e]=(0,Ci.useState)(0);return[n,(0,Ci.useCallback)(()=>{e(t=>t+1)},[e])]};var nu=n=>{let e=(0,Ao.useCallback)(n,[]),t=(0,Ao.useRef)(!1),o=(0,Ao.useRef)(!1),r=(0,Ao.useRef)(void 0),[i,a]=Yt();t.current&&(o.current=!0),(0,Ao.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{o.current&&r.current&&r.current()}),[])};var Ii=require("react");function Fe(n){let e=(0,Ii.useRef)(n);return e.current=n,(0,Ii.useCallback)(()=>e.current,[])}var wi=require("react"),Eo=(n,e)=>{let t=(0,wi.useRef)(e===void 0?n:e);return(0,wi.useLayoutEffect)(()=>{t.current=n}),t.current};var xr={DataSource:{track:"DataSource",labels:{RemoteDataLoad:"Remote data load",TreeUnfilteredTreePaths:"Computing unfiltered tree paths",Filter:"Filter",Sort:"Sort",Group:"Group",LazyGroup:"Lazy group",Tree:"Tree",FlattenTree:"Flatten tree",Flatten:"Flatten groups",PrepareData:"Preparing data",ComputeSelectionCount:"Computing selection count",ComputeSelectionCountLazy:"Computing selection count (lazy)",PrepareRowInfo:"Preparing row info array",DiffRowInfoInStore:"setDataArray diffing in RowInfoStore"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}},ComponentState:{track:"ComponentState",labels:{PropUpdate:"Prop update"}}};var _l=class n{constructor(e){this.debugId=e;this.markerDetails={label:"",track:"",trackGroup:void 0,color:void 0,details:[],tooltip:void 0};this.stopped=!1;this.start=e=>{if(this.markerDetails.startTs)return this;let t=performance.now();return this.markerDetails.details=e?.details??[],this.markerDetails.startTs=t,this};this.end=(e={})=>{if(this.stopped)return this;this.stopped=!0;let t=e.startTs??this.markerDetails.startTs,o=e.endTs??this.markerDetails.endTs??performance.now(),r=e.color||this.markerDetails.color||"primary",i=e.trackGroup||this.markerDetails.trackGroup||`Infinite Table (${this.debugId})`,a=[...this.markerDetails.details||[],...e.details||[]],l=e.tooltip||this.markerDetails.tooltip,s=e.label||this.markerDetails.label||"Unknown",c=e.track||this.markerDetails.track||"Unknown";return performance.measure(s,{start:t,end:o,detail:{devtools:{dataType:"track-entry",trackGroup:i,track:c,color:r,properties:a.length>0?a.map(u=>[u.name,u.value]):void 0,tooltipText:l}}}),this};this.debugId=e}static create(e){return new n(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(xr).reduce((t,o)=>{let r={start:e.start,end:i=>e.end({...i,track:xr[o].track,label:i.label}),get label(){let i=xr[o];return Object.keys(i.labels).reduce((a,l)=>{let s={start:e.start,end:c=>e.end({...c,track:i.track,label:i.labels[l]})};return Object.defineProperty(a,l,{get:()=>(e.markerDetails.label=i.labels[l],s)}),a},{})}};return Object.defineProperty(t,o,{get:()=>{let i=xr[o];return e.markerDetails.track=i.track,r}}),t},{})}};function nt(n){return _l.create(n)}var Ub=(n,e,t)=>{let o=n[e];typeof o=="function"&&o(...t)},Ol;function ru(){return Ol||(Ol=(0,Qe.createContext)(null))}function Yb(n,e,t,o,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:f=>{let p=t(),m=e(),g=m[u],b=!0;if(i&&typeof i[u]=="function"&&i[u](f,{actions:s,state:m})===!1&&(b=!1),b){let S=[f],T=`on${El(c)}Change`;if(a&&a[u]){let C=a[u](f,m);T=C.callbackName||T,S=C.callbackParams}Ub(p,T,S)}let h=o[u];typeof h=="function"&&(f=h(f));let y=!!r?.[u];Mo(c,p)&&!y||n({payload:{updatedProps:null,mappedState:{[c]:f}}})}}),s},{})}function qb(n,e,t){let o={};for(let r in n)if(n.hasOwnProperty(r)){let i=n[r],a=Mo(r,e)?e[r]:e[`default${El(r)}`];typeof i=="function"&&(a=i(a,t)),o[r]=a}return o}function Ft(n){let e=n.getParentState||(()=>null);function t(r){let[i]=(0,Qe.useState)(()=>n.initSetupState?n.initSetupState(r):{}),a=(0,Qe.useRef)(new Set),l=(0,Qe.useMemo)(()=>n.forwardProps?n.forwardProps(i,r):{},[i]),s=e(),c=Fe(s);function u(){let v={};l&&(v=qb(l,r,i));let x={...i,...v};if(n.mapPropsToState){let{fn:R,propertyReads:P}=Al(n.mapPropsToState,{getProxyTargetFromArgs:M=>M.props,putProxyToArgs:(M,D)=>[{...D,props:M}]}),A=R({props:r,state:x,oldState:null,parentState:s});return a.current=new Set([...a.current,...P]),{...x,...A}}return x}let[d]=(0,Qe.useState)(u),f=Fe(r),p=(v,x)=>{if(x.type==="REPLACE_STATE")return x.payload;let R=c?.()??null,P=x.payload.mappedState,A=x.payload.updatedPropsToState,M={...v};if(P&&Object.assign(M,P),n.mapPropsToState){let{fn:_,propertyReads:O}=Al(n.mapPropsToState,{getProxyTargetFromArgs:V=>V.props,putProxyToArgs:(V,z)=>[{...z,props:V}]}),L=_({props:f(),state:M,oldState:v,parentState:R});a.current=new Set([...a.current,...O]),Object.assign(M,L)}return x.type==="ASSIGN_STATE"&&Object.assign(M,x.payload),n.concludeReducer?n.concludeReducer({previousState:v,state:M,updatedProps:A,parentState:R}):M},[m,g]=(0,Qe.useReducer)(p,d),b=Fe(m),{allowedControlledPropOverrides:h}=n,y=(0,Qe.useMemo)(()=>Yb(g,b,f,l,h,n.interceptActions,n.mappedCallbacks),[g,l,h]),S=n.Context??ru(),T=(0,Qe.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:b,replaceState:v=>{g({type:"REPLACE_STATE",payload:v})},assignState:v=>{g({type:"ASSIGN_STATE",payload:v})}}),[m,y,b]),C=Eo(r),I=(0,Qe.useRef)(!1);I.current=!1;let w=n.layoutEffect?Qe.useLayoutEffect:Qe.useEffect;return w(()=>{let v=r,x={},R=0,P={},A=0,M={},D=0;if(new Set([...Object.keys(v),...Object.keys(C)]).forEach(L=>{let V=L,z=C[V],G=v[V];if(V!=="children"&&z!==G&&(M[V]={newValue:G,oldValue:z},D++,Mo(V,r)||Mo(V,C)))if(l.hasOwnProperty(L)){let E=G,F=l[L];typeof F=="function"&&(E=F(G)),m[V]!==E&&(x[V]=E,R++)}else a.current.has(L)&&(P[V]=v[V],A++)}),A>0||R>0){let L=m.debugId,V=L?nt(L).track.ComponentState.label.PropUpdate.start():void 0,z=n.debugName?typeof n.debugName=="function"?`${n.debugName(v)}:rerender`:`${n.debugName}:rerender`:"rerender";Ot(z)("Triggered by new values for the following props",...Object.keys(x??{}),...Object.keys(P??{})),V&&V.end({label:z,details:[R>0?{name:"Updated properties",value:Object.keys(x).join(", ")}:void 0,A>0?{name:"Updated props",value:Object.keys(P).join(", ")}:void 0,A>0||P?{name:"Details",value:"The time for this marker is not accurate. The marker is only displayed so you can easily identify the props that triggered the rerender."}:void 0].filter(Po)});let E={payload:{mappedState:R?x:null,updatedPropsToState:A?P:null}};if(I.current=!0,g(E),n.onPropChange){for(var O in M)if(M.hasOwnProperty(O)){let{newValue:F,oldValue:X}=M[O];n.onPropChange({name:O,newValue:F,oldValue:X},r,y,m)}}n.onPropsChange&&D&&n.onPropsChange(M,r,y,m)}}),w(()=>{s!=null&&!I.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),nu(()=>()=>{n.cleanup?.(b())}),{contextValue:T,ContextComponent:S}}return{ManagedComponentContextProvider:En.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return En.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function Nt(n){return n=n??ru(),En.useContext(n)}var bu=j(require("react"));var mt="Infinite",ke={rootClassName:mt};var Ri=()=>ke;var iu="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",au={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var qt="_16lm1iw3b _16lm1iw3c _16lm1iw35",lu={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},_n={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var vi={1:"_16lm1iw1c",none:"_16lm1iw1d"},Pr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var su={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},cu={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},uu={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var du={none:"_16lm1iwd"},fu={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var Di={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var pu={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var mu={none:"_16lm1iw1x"};var gu={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var hu={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function yu(n){let{rootClassName:e}=Ri();return bu.createElement("div",{...n,className:te(`${e}Footer`,Di.relative,_n.flex,Pr.row,n.className)})}var Pe=j(require("react")),ho=require("react"),Ep=require("react-dom");function xi(n){let e={};return Object.keys(n).forEach(t=>{e[t]=t}),e}function ee(n){return n.slice(4,-1)}var Su=j(require("react")),ze=n=>{let e=n.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...n.style};return Su.createElement("svg",{viewBox:"0 0 24 24",...n,style:t},n.children)};var Mr=j(require("react")),Tu=n=>Mr.createElement(ze,{...n},Mr.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"}),Mr.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),Mr.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));var Fl=j(require("react")),Cu=n=>Fl.createElement(ze,{...n},Fl.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"}));var Nl=j(require("react")),Ll=n=>Nl.createElement(ze,{...n},Nl.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));var kl=j(require("react")),Iu=n=>kl.createElement(ze,{...n},kl.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));var zl=j(require("react")),wu=n=>zl.createElement(ze,{...n},zl.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));var Vl=j(require("react")),Ru=n=>Vl.createElement(ze,{...n},Vl.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));var Gl=j(require("react")),vu=n=>Gl.createElement(ze,{...n},Gl.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));var Hl=j(require("react")),Du=n=>Hl.createElement(ze,{...n},Hl.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));var Kl=j(require("react")),xu=n=>Kl.createElement(ze,{...n},Kl.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"}));var Ql=j(require("react"));var lt=j(require("react")),Ar=require("react");var On=j(require("react")),en=require("react");function Xb(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var o=t.call(n,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Zb(n){var e=Xb(n,"string");return typeof e=="symbol"?e:String(e)}function Qb(n,e,t){return e=Zb(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Pu(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,o)}return t}function Mu(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Pu(Object(t),!0).forEach(function(o){Qb(n,o,t[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Pu(Object(t)).forEach(function(o){Object.defineProperty(n,o,Object.getOwnPropertyDescriptor(t,o))})}return n}function Au(n,e){var t={};for(var o in n)t[o]=e(n[o],o);return t}var Jb=(n,e,t)=>{for(var o of Object.keys(n)){var r;if(n[o]!==((r=e[o])!==null&&r!==void 0?r:t[o]))return!1}return!0},ye=n=>{var e=t=>{var o=n.defaultClassName,r=Mu(Mu({},n.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:n.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=n.variantClassNames[i][s];c&&(o+=" "+c)}}for(var[u,d]of n.compoundVariants)Jb(u,r,n.defaultVariants)&&(o+=" "+d);return o};return e.variants=()=>Object.keys(n.variantClassNames),e.classNames={get base(){return n.defaultClassName.split(" ")[0]},get variants(){return Au(n.variantClassNames,t=>Au(t,o=>o.split(" ")[0]))}},e};var Eu="_1eexc2a6";var _u=ye({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:[]}),Ou="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",Fu=ye({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),Nu=ye({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"]]}),Lu=ye({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"]]}),ku="_12zfob12u _16lm1iw22 _16lm1iw1z";var zu="_12zfob17",Vu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Gu=ye({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Bl=ye({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Hu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Ku=ye({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Bu="_12zfob1b _16lm1iw2",Wu="_16lm1iw1",ju="_12zfob16",$u=ye({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),Uu="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Dt="InfiniteIcon";var Yu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var ey={transition:"width 0.25s, opacity 0.25s"};function Fn(n){let[e,t]=(0,en.useState)(!0),[o,r]=(0,en.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=n,c=s!=null&&s>0,u=n.size??16,d=Math.floor(u/4),f=[u-1*d,u-2*d,u-3*d],p={...ey,borderTop:`${i}px solid currentColor`,...n.lineStyle,opacity:o};if((0,en.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,en.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return On.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:te(l,Dt,Yu,`${Dt}-filter`)},c?On.createElement("div",{"data-name":"index",style:m,className:zu},s):null,On.createElement("div",{style:{width:f[0],...p}}),On.createElement("div",{style:{width:f[1],...p}}),On.createElement("div",{style:{width:f[2],...p}}))}var Wl=n=>{let{availableSize:e,items:t,minSize:o,maxSize:r}=n;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((w,v)=>{let x=w.maxSize??r??void 0,R=w.minSize??o??void 0;s.push(R),c.push(x),w.size!=null&&(x!=null&&w.size>x&&(w.size=x),R!=null&&w.size<R&&(w.size=R));let P=w.flex==0?null:w.flex;if(w.size==null&&P==null)throw`Items must specify either a size or a flex property. Item at index ${v} doesn't have either of those.`;P!=null&&(l+=1),a+=P??0,i+=w.size??0});let u=n.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,f={},p={},m=0;t.forEach((w,v)=>{if(w.flex!=null){let x=d*w.flex,R=w.maxSize??r??void 0,P=w.minSize??o??void 0,A=!1,M=0;R!=null&&x>R&&(f[v]=!0,A=!0,M=R),P!=null&&x<P&&(p[v]=!0,A=!0,M=P),A&&(m+=1,l-=1,a-=w.flex,u-=M)}}),m&&(d=u/a);let g=[],b=0,h=u,y=a,S=0,T=0,C=[];return{items:t.map((w,v)=>{let x={...w},R=w.maxSize??r??void 0,P=w.minSize??o??void 0,A=0,M=f[v],D=p[v],_=M||D,O=w.size??0;if(w.flex!=null){if(_)D&&(A=P),M&&(A=R);else{b+=1;let L=V=>(R!=null&&V>R&&(V=R),P!=null&&V<P&&(V=P),V);b===l?A=L(h):(A=L(Math.round(w.flex*d)),T+=A,h=u-T,y-=w.flex,d=h/y)}O=A,x.flexSize=A}return g.push(A),C.push(O),x.computedSize=O,S+=O,x}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:C,remainingSize:Math.round(e-S)}};function Pi(n,e,t,o){return e!=null&&n<=e?{value:e,clamped:"min",diff:(n-e)*o}:t!=null&&n>=t?{value:t,clamped:"max",diff:(t-n)*o}:{value:n,clamped:!1,diff:0}}var jl=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((R,P)=>(R[P]={...n.columnSizing[P]},R),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=n.dragHandlePositionAfter,a=n.dragHandlePositionAfter+1,l=n.items[i],s=n.items[a],c=l.id,u=s?.id,d=l.computedWidth,f=l.computedMinWidth,p=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,b=s?.computedMinWidth,h=s?.computedMaxWidth,y=s?.computedFlex?"flex":"width",S=!1,T=!1,C=r>0?1:-1,{value:I,clamped:w,diff:v}=Pi(d+r,f,p,C);if(n.shareSpaceOnResize){if(s==null)return o[c]={...o[c],[m]:I},T=w==="min",S=w==="max",{adjustedDiff:I-d,reservedWidth:t,columnSizing:o,minReached:T,maxReached:S,constrained:T||S};let{value:R,clamped:P,diff:A}=Pi(g-r,b,h,C);if(w&&P&&(Math.abs(v)>Math.abs(A)?P=!1:w=!1),!(!w&&!P)){if(w){let M=Pi(g-r-v,b,h,C);R=M.value,P=M.clamped,A=M.diff}else if(P){let M=Pi(d+r+A,f,p,C);I=M.value,w=M.clamped,v=M.diff}}o[c]={...o[c],[m]:I},o[u]={...o[u],[y]:R},T=w==="min"||P==="min",S=w==="max"||P==="max"}else o[c]={...o[c],[m]:I},T=w==="min",S=w==="max";let x=I-d;return{adjustedDiff:x,reservedWidth:n.shareSpaceOnResize?t:t-x,columnSizing:o,minReached:T,maxReached:S,constrained:T||S}};function qu(n,e){return n+e}function ty(n){return Object.keys(n).reduce((t,o)=>(t[o]={...n[o]},t),{})}var Xu=n=>{let{availableSize:e,reservedWidth:t=0}=n,o=Object.keys(n.columnSizing).reduce((h,y)=>(h[y]={...n.columnSizing[y]},h),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=n.dragHandleOffset,i=[...new Array(n.columnGroupSize)].map((h,y)=>n.dragHandlePositionAfter-y).reverse(),a=i.map(h=>n.items[h]),l=a.map(h=>h.computedWidth),s=a.map(h=>h.computedFlex?"flex":"width"),c=0,{computedSizes:u}=Wl({items:a.map(h=>(h.resizable===!1&&(c+=h.computedWidth),{maxSize:h.computedMaxWidth,minSize:h.computedMinWidth,flex:h.resizable?h.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(qu,0)+r-c,0)}),d=a.map((h,y)=>u[y]-h.computedWidth),f=!0,p=!0,m=!0,g=[];d.forEach((h,y)=>{let S=a[y];if(!S.resizable){g.push(0);return}let T=s[y],C=l[y],I=ty(o),{maxReached:w,minReached:v,constrained:x,adjustedDiff:R}=jl({availableSize:n.availableSize,reservedWidth:n.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[y],shareSpaceOnResize:!1,items:n.items,columnSizing:I});o[S.id]={...I[S.id],[T]:C+R},g.push(R),w||(p=!1),v||(f=!1),x||(m=!1)});let b=g.reduce(qu,0);return{minReached:f,maxReached:p,constrained:m,adjustedDiffs:g,adjustedDiff:b,columnSizing:o,reservedWidth:t-b}};var Mi;function _o(){if(Mi!=null)return Mi;let n=De().document??null;if(!n)return 0;let e=n.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",n.body.appendChild(e);let t=n.createElement("div");return e.appendChild(t),Mi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),Mi}var Zu=["start",void 0,"end"],Qu=(n,e)=>(e&&Object.keys(e).length>0&&n.sort((t,o)=>{let r=e[t],i=e[o];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Zu.indexOf(r)-Zu.indexOf(i)}),n);function Ju(n,e,...t){let o=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&n(r[i],i)&&(o[i]=r[i])}),o}function $l(n,...e){return Ju(t=>t!=null,n,...e)}function ed(n,e,...t){return Ju((o,r)=>!(r in n),e,...t)}var Ai=Object.freeze({}),oy={string:Ai,number:{}};function Ul(n,e){let t=e.default||Ai;return n.type===void 0?t:n.type===null?Ai:typeof n.type=="string"?e[n.type]||oy[n.type]||Ai:n.type.reduce((o,r)=>Object.assign(o,e[r]),{})}var Ei=!0,ny=!0,ry=!0,iy="string",Nn="unknown",ay=Ro("getComputedVisibleColumns"),ly=(n,e,t)=>n[t]!==!1,Yl=(n,e)=>{if(!e)return!1;let t=e[n];return t==="start"||t===!0?"start":t==="end"?"end":!1},td=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:f,sortInfo:p,multiSort:m,filterTypes:g=Oo,viewportReservedWidth:b,resizableColumns:h,draggableColumns:y,columnDefaultDraggable:S,columnOrder:T,columnPinning:C,editable:I,columnDefaultEditable:w,columnDefaultFilterable:v,columnDefaultGroupable:x,columnDefaultSortable:R,columnSizing:P,columnTypes:A,columnVisibility:M,columnVisibilityAssumeVisible:D,groupBy:_})=>{let O=0,L={};_.forEach(($,se)=>{$.field&&(L[$.field]=se)});let V=(d||[]).reduce(($,se)=>{let{id:ue,field:Se}=se;return Se&&($[Se]=se),ue&&($[ue]=se),$},{}),z=Qu(T===!0?Object.keys(n):T,C),G=z.filter($=>n[$]?ly(M,D,$):(ay(`Column with id "${$}" specified in columnOrder array cannot be found in the columns map.`),!1)),E=new Map,F=G.map(($,se)=>{let ue=n[$];return E.set($,se),ue}),X=(p??[]).reduce(($,se,ue)=>(se.id?$[se.id]={sortInfo:se,index:ue}:se.field&&($[se.field]={sortInfo:se,index:ue}),$),{});function B($){let se=n[$],ue=Ul(se,A),Se={minWidth:ue?.minWidth,maxWidth:ue?.maxWidth,width:ue?.defaultWidth,flex:ue?.defaultFlex},qe=$l({width:se?.defaultWidth,flex:se?.defaultFlex,minWidth:se?.minWidth,maxWidth:se?.maxWidth},P[$]);qe.width!=null&&delete Se.flex,qe.flex!=null&&delete Se.width,qe=$l(Se,qe);let le=qe.flex??void 0,W=qe.minWidth??se?.minWidth??t,it=qe.maxWidth??se?.maxWidth??o,Ie=le!=null?void 0:qe.width??(i?void 0:r);return!Ie&&le==null&&(i?le=i:Ie=W),{size:Ie,flex:le,minSize:W,maxSize:it}}let Y=Wl({availableSize:Math.max(e.width-(b??0)-(a??_o()),0),maxSize:o,minSize:t,items:G.map(B)}),{computedSizes:ie,flexSizes:ge,minSizes:be,maxSizes:ae}=Y,de=[],pe=[],q=[],k=[];k.length=G.length;let U=new Map,K=new Map,Z=0,ne=0,H=0,ce=null,N=[],J=0,fe=0,me=0;F.forEach(($,se)=>{let ue=G[se],Se=ie[se],qe=N[se]=Yl(ue,C);qe==="start"?J+=Se:qe==="end"?me+=Se:fe+=Se});let Me=e.width-me,Ae=[],Ge=new Map;G.forEach(($,se)=>{let ue=F[se];Ge.set($,ue)});let Ne=[];Object.keys(n).forEach($=>{let se=n[$];Ne.push($),Ge.has($)||Ge.set($,se)});let Le=new Map;Ge.forEach(($,se)=>{let ue=E.get(se);ue==null&&(ue=-1);let Se=ue!=-1,qe=G[ue+1],le=Ul($,A),W=ue,it=X[se]?X[se]:$.field?X[$.field]??null:null,Ie=it?.sortInfo??null,at=!!Ie,vt=at&&Ie.dir===1,zt=at&&!vt,br=it?.index??-1,xn=Se?{}:B(se),yr=Se?ie[ue]:xn.size||0,ml=Se&&ge[ue]||null,gl=Se?be[ue]||0:xn.minSize||0,hl=Se?ae[ue]||1e4:xn.maxSize||1e4,dt=Se?Yl(se,C):!1,di=Se?ue===G.length-1:!1,Ee=W,ft=Se?dt==="start"?ne:dt==="end"?H:O-ne:0;dt=="start"?Ee=Se?W:-1:dt==="end"?Ee=Se?W-(de.length+q.length):-1:Ee=Se?W-de.length:-1;let lo=Se?dt==="start"||dt===!1?O:Me+H:-1,Vt=Se?dt!==ce:!1,Sr=Se?di||dt!==Yl(qe,C):!1,zc=$.cssEllipsis??le.cssEllipsis??l,Cb=$.headerCssEllipsis??le.cssEllipsis??$.cssEllipsis??le.headerCssEllipsis??s??zc,fi=Se&&(V[se]||$.field||$.groupByForColumn)&&(V[se]||V[$.field||$.groupByForColumn])||null,Ib=$.defaultFilterable??le.defaultFilterable??v??!0,wb=I??$.defaultEditable??le.defaultEditable??w??!1,bl=$.dataType||le.dataType||(Array.isArray($.type)?$.type[0]:$.type)||iy,Rb=$.sortType||le.sortType||bl,Vc=$.filterType||le.filterType||bl,Gc=!1;if(fi!=null&&!fi.disabled){let Tl=g[Vc];Tl&&(!Tl.emptyValues||!Tl.emptyValues.includes(fi.filter.value))&&(Gc=!0)}let Qo=$.field??le.field,Hc=$.valueGetter??le.valueGetter,yl=$.defaultGroupable??le.defaultGroupable??x??!!Qo;Qo||(yl=!1),$.groupByForColumn&&(yl=!1);let Sl=$.defaultSortable??le.defaultSortable;Sl==null&&!$.groupByForColumn&&Qo==null&&Hc==null&&(Sl=!1);let Kc=Qo?L[Qo]!==void 0:!1,vb=Kc?L[Qo]:void 0,Db=f??Sl??R??Ei,xb=$.resizable??le.resizable??h??ny,Xe={colType:le,align:le.align,headerAlign:le.headerAlign,computedVisible:Se,verticalAlign:le.verticalAlign,defaultHiddenWhenGroupedBy:le.defaultHiddenWhenGroupedBy,valueGetter:Hc,valueFormatter:le.valueFormatter,renderValue:le.renderValue,render:le.render,style:le.style,className:le.className,contentFocusable:le.contentFocusable,renderMenuIcon:le.renderMenuIcon,renderSortIcon:le.renderSortIcon,renderRowDetailIcon:le.renderRowDetailIcon,renderSelectionCheckBox:le.renderSelectionCheckBox,renderHeaderSelectionCheckBox:le.renderHeaderSelectionCheckBox,headerStyle:le.headerStyle,headerClassName:le.headerClassName,columnGroup:le.columnGroup,getValueToEdit:le.getValueToEdit,getValueToPersist:le.getValueToPersist,shouldAcceptEdit:le.shouldAcceptEdit,field:Qo,...$,components:{...le.components,...$.components},computedResizable:xb,computedMinWidth:gl,computedMaxWidth:hl,computedFlex:ml,computedDataType:bl,computedEditable:wb,computedSortType:Rb,computedFilterType:Vc,cssEllipsis:zc,headerCssEllipsis:Cb,computedFilterValue:fi,computedFiltered:Gc,computedFilterable:Ib,computedGroupable:yl,computedGroupedBy:Kc,computedGroupedByIndex:vb,computedWidth:yr,computedAbsoluteOffset:lo,computedPinningOffset:ft,computedVisibleIndexInCategory:Ee,computedOffset:O,computedSortable:Db,computedSortInfo:Ie,computedSortIndex:br,computedMultiSort:m,computedSorted:at,computedSortedAsc:vt,computedSortedDesc:zt,computedVisibleIndex:W,computedPinned:dt,computedDraggable:y??$.defaultDraggable??S??ry,computedFirstInCategory:Vt,computedLastInCategory:Sr,computedFirst:ue===0,computedLast:di,id:se,header:$.header??le.header??$.name??$.field};Se&&(O+=yr,U.set(Xe.id,Xe),k[ue]=Xe,dt==="start"&&(de.push(Xe),ne+=Xe.computedWidth),dt==="end"&&(pe.push(Xe),H+=Xe.computedWidth),dt||(q.push(Xe),Z+=Xe.computedWidth),ce=dt),Xe.groupByForColumn&&(Xe.computedSortType=$.sortType||le.sortType||Nn,Ae.push(Xe)),K.set(Xe.id,Xe),Xe.field&&!Xe.groupByForColumn&&!Le.has(Xe.field)&&Le.set(Xe.field,Xe)}),Ae.forEach($=>{$.computedSortable=od($,{fieldsToColumn:Le,sortable:f,columnDefaultSortable:R})});let We=new Map;Ne.forEach($=>{let se=K.get($);se&&We.set($,se)}),K.forEach($=>{We.has($.id)||We.set($.id,$)});let et=c!=null?Math.min(c,ne):ne,tt=u!=null?Math.min(u,H):H;return{computedRemainingSpace:e.width-(J+me+fe),computedPinnedStartColumnsWidth:ne,computedPinnedEndColumnsWidth:H,computedUnpinnedColumnsWidth:Z,computedColumnOrder:z,computedPinnedStartColumns:de,computedPinnedEndColumns:pe,computedUnpinnedOffset:ne,computedPinnedEndOffset:ne+Z,computedUnpinnedColumns:q,computedVisibleColumns:k,computedColumnsMap:K,computedColumnsMapInInitialOrder:We,computedVisibleColumnsMap:U,computedPinnedEndWidth:tt,computedPinnedStartWidth:et,renderSelectionCheckBox:k.reduce(($,se)=>$||!!se.renderSelectionCheckBox,!1),fieldsToColumn:Le}};function od(n,e){let{sortable:t,fieldsToColumn:o,columnDefaultSortable:r}=e;if(t)return t;let i=n.defaultSortable??n.colType.defaultSortable;if(i!=null)return i;let a=r??Ei;return n.computedSortType!==Nn&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((f,p)=>{if(!f)return!1;let m=p.field||p.groupField,g;if(m){let b=o.get(m),h=b?u.getColumnApi(b.id):void 0;b&&h?g=h.isSortable():g=!1}return g===void 0&&p.valueGetter&&(g=!0),g??r??Ei},!0)}}function gt(n,e){let{getComputed:t,getState:o,actions:r,api:i}=e;typeof n=="number"&&(n=t().computedVisibleColumns[n]);let a=typeof n=="string"?t().computedColumnsMap.get(n):n;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){o().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){o().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){o().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){o().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)},getColumnId(){return a.id},getComputedColumn(){return a}};return l}function tn(n,e,t){let o=typeof n=="string"?e.getComputed().computedColumnsMap.get(n):n,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:f,selectionMode:p}=u,m=i(),g=o.header&&typeof o.header!="function"?o.header:o.name||o.id||"";if(typeof o.header=="function"){let b=gt(o.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=o.header({horizontalLayoutPageIndex:null,column:o,columnApi:b,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:o.computedSortInfo,columnFilterValue:o.computedFilterValue,filtered:o.computedFiltered,allRowsSelected:d,someRowsSelected:f,selectionMode:p,api:r,renderBag:{header:g}})??null}return g}var nd=j(require("react"));var _i=`${mt}HeaderCell__filter`,ql=`${mt}HeaderCell__filterOperator`,Xl=nd.createContext(null);var id=require("react");var rd=require("react"),Zl;function Oi(){return Zl||(Zl=(0,rd.createContext)(null))}function re(n){let e=Oi(),t=(0,id.useContext)(e);return Pn(t,n)}function He(){return re(n=>({getState:n.getState,actions:n.actions,getComputed:n.getComputed,getDataSourceState:n.getDataSourceState,dataSourceApi:n.dataSourceApi,dataSourceActions:n.dataSourceActions,api:n.api,getDataSourceMasterContext:n.getDataSourceMasterContext}))}var sy=`${_i}__input`,Fi=n=>n.stopPropagation();function ad(n){let{filterOperatorMenuVisibleForColumnId:e}=re(u=>({filterOperatorMenuVisibleForColumnId:u.state.filterOperatorMenuVisibleForColumnId})),{column:t}=Er(),o=n.filterEditor,r=n.filterOperatorSwitch,[i,a]=(0,Ar.useState)(!1),l=lt.useCallback(()=>{a(!0)},[]),s=lt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return lt.createElement("div",{onPointerUp:Fi,onPointerDown:Fi,onFocus:l,onBlur:s,className:`${_i} ${Bl({active:c})}`,style:{height:n.columnHeaderHeight}},lt.createElement(Xl.Provider,{value:n},lt.createElement(r,null),lt.createElement(o,null)))}function ld(){let{columnApi:n,disabled:e,operator:t}=Ln(),o=t?.components?.Icon??Fn;return lt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&n.toggleFilterOperatorMenu(r.target)},className:te(ql,Vu,e?`${ql}--disabled`:"")},lt.createElement(o,{size:20,className:`${Gu({disabled:e})}`}))}function sd(){return lt.createElement("div",{onPointerUp:Fi,onPointerDown:Fi,className:`${_i} ${Bl({active:!1})} ${su["50%"]}`})}function Ln(){let n=He(),{column:e,columnApi:t}=Er(),o=tn(e,n,"column-filter"),r=lt.useContext(Xl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,Ar.useState)(l?.filter.value??""),d=lt.useCallback(b=>{u(b),r.onChange(b)},[r.onChange]),f=lt.useCallback(()=>{n.api.clearColumnFilter(e.id)},[e.id]),p=lt.useCallback(()=>{n.api.removeColumnFilter(e.id)},[e.id]);(0,Ar.useEffect)(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let b=[...s.emptyValues][0];b!==c&&u(b)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:n.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:f,removeColumnFilter:p,ariaLabel:`Filter for ${o}`,className:`${ku} ${sy}`}}function kn(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Ln();return Ql.createElement("input",{"data-xxx":!0,"aria-label":n,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:o})}function Ni(){let{ariaLabel:n,value:e,setValue:t,className:o,disabled:r}=Ln();return Ql.createElement("input",{"aria-label":n,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:o})}function cy(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:kn},operators:[{name:"includes",components:{Icon:Tu},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Ll},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:xu},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Cu},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Ni},operators:[{label:"Equals",components:{Icon:Ll},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:Du},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:wu},fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>t},{name:"gte",components:{Icon:Iu},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e>=t},{name:"lt",components:{Icon:vu},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<t},{name:"lte",components:{Icon:Ru},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:o})=>o.includes(e)?!0:e<=t}]}}}var Oo=cy();function Li(n,e,t,o){let r=[...e],i={filtered:n.computedFiltered,first:n.computedFirst,last:n.computedLast,groupByField:!!n.groupByForColumn,firstInCategory:n.computedFirstInCategory,lastInCategory:n.computedLastInCategory,pinned:n.computedPinned||!1,cellSelected:o.cellSelected||!1,rowSelected:o.rowSelected??"null",rowActive:o.rowActive,dragging:o.dragging,insideDisabledDraggingPage:o.insideDisabledDraggingPage,firstRow:o.firstRow??!1,firstRowInHorizontalLayoutPage:o.firstRowInHorizontalLayoutPage??!1,rowDisabled:o.rowDisabled,groupRow:o.groupRow,groupCell:o.groupCell,treeNode:o.treeNode,verticalAlign:o.verticalAlign,align:o.align,zebra:o.zebra},a=t(i);return r.push(a),n.computedFirst&&r.push(...e.map(l=>`${l}--first`)),n.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),n.computedLast&&r.push(...e.map(l=>`${l}--last`)),n.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),n.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),o.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),o.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),o.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),o.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),o.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),o.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${o.treeNode}-node`)),o.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${o.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),n.computedPinned?r.push(...e.map(l=>`${l}--pinned-${n.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Kn=require("react"),$d=require("react-dom");function Fo(n,e){let t=n;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function cd(n,e,t){let o=n;if(!o)return null;if(o&&o.matches(e))return o;for(;o=o.parentElement;){if(o.matches(e))return o;if(o===t)return null}return null}var Q={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 ud="true",he={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)",borderColor:"var(--infinite-cell-border-color)",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)"}}},dd="column-header-height";var fd=`.${ke.rootClassName}`;function Jl(n){return Fo(n,fd)}var pd=ee(Q.scrollLeft),uy=ee(Q.scrollTop),dy=ee(Q.columnWidthAtIndex),es=ee(Q.columnOffsetAtIndex),md=ee(Q.columnReorderEffectDurationAtIndex),fy=ee(Q.columnOffsetAtIndexWhileReordering),py=ee(Q.columnVisibilityAtIndex),my=ee(Q.columnZIndexAtIndex);function Xt(n,e,t){let o=t?Jl(t):document.querySelector(fd);gy(n,e,o)}function gy(n,e,t){if(t){let o=n,r=Q[o]?ee(Q[o]):n;t.style.setProperty(r,`${e}`)}}function zn(n,e){if(e)for(var t in n){let o=Q[t]?ee(Q[t]):t,r=`${n[t]}`;e.style.setProperty(o,r)}}function ts(n,e,t){Xt(`${es}-${n.computedVisibleIndex}`,n.computedPinned?`calc( ${n.computedAbsoluteOffset+e}px + var(${pd}))`:`${n.computedAbsoluteOffset+e}px`,t)}function os(n,e,t){Xt(`${my}-${n}`,`${e}`,t)}function _r(n,e,t){Xt(`${fy}-${n}`,typeof e=="number"?`calc( var(${es}-${n}) + ${e}px )`:e,t)}function Or(n,e,t){Xt(`${py}-${n}`,e,t)}function ki(n,e,t){Xt(`${md}-${n}`,t??"",e)}function ns(n,e){let t=`${md}-${n}`;Xt(t,he.components.Cell.reorderEffectDuration,e)}var we={columnWidths:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${dy}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Xt(this.varName.get(n),e,t)}},columnOffsets:{get(n){return`var(${this.getVarName(n)})`},getVarName(n){return this.varName.get(n)},varName:{get(n){return`${es}-${n}`}},set(n,e,t){e=typeof e=="number"?e+"px":e,Xt(this.varName.get(n),e,t)}}};function gd(n,e){zn({[pd]:`${n.scrollLeft}px`,[uy]:`${n.scrollTop}px`},e)}var hd="_16lm1iw1",bd="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",yd="_1yeub2vs",Sd="_1yeub2vr",Td=ye({defaultClassName:"_1yeub2v2",variantClassNames:{horizontalLayout:{true:"_1yeub2v3",false:"_1yeub2v4"},focused:{true:"_1yeub2v5",false:"_1yeub2v6"},focusedWithin:{true:"_1yeub2v7",false:"_1yeub2v8"},hasPinnedStart:{true:"_1yeub2v9",false:"_1yeub2va"},hasPinnedEnd:{true:"_1yeub2vb",false:"_1yeub2vc"},hasPinnedStartOverflow:{true:"_1yeub2vd",false:"_1yeub2ve"},hasPinnedEndOverflow:{true:"_1yeub2vf",false:"_1yeub2vg"}},defaultVariants:{},compoundVariants:[[{focused:!1,focusedWithin:!1},"_1yeub2vh"]]});var rs="_1yeub2vp";var wD=ye({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var is=n=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,n(...t)})}};var Fr={bodyWidth:{name:ee(he.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:ee(he.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:ee(he.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:ee(he.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:ee(he.runtime.browserScrollbarWidth),value:""}},hy=ee(Q.scrollbarWidthHorizontal),Cd=ee(Q.scrollbarWidthVertical),by=ee(Q.columnWidthAtIndex),yy=ee(Q.columnZIndexAtIndex),Id=ee(Q.scrollLeft),Sy=ee(Q.activeCellColWidth),wd=ee(Q.activeCellColOffset),xd=ee(Q.baseZIndexForCells),Ty=ee(Q.pinnedStartWidth),Rd=ee(Q.bodyWidth),Cy=ee(Q.bodyHeight),vd=ee(Q.pinnedEndOffset),Dd=ee(Q.pinnedEndWidth),Iy=ee(Q.computedVisibleColumnsCount);function as(n,e){let t="auto",o=n.computedVisibleIndex;return n.computedPinned?n.computedPinned==="start"?t=e.pinnedStartColsCount-n.computedVisibleIndexInCategory:n.computedPinned==="end"&&(t=e.visibleColsCount+n.computedVisibleIndexInCategory):t=-o*10,typeof t=="number"?`calc( var(${xd}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function Pd(n){let e=_o(),{actions:t,getState:o,focused:r,focusedWithin:i,domRef:a,scrollerDOMRef:l,onBlurWithin:s,onFocusWithin:c,onSelfFocus:u,onSelfBlur:d,bodySize:f,activeCellIndex:p,wrapRowsHorizontally:m,computedPinnedStartColumnsWidth:g,computedPinnedEndColumnsWidth:b,computedPinnedStartColumns:h,computedPinnedEndColumns:y,computedVisibleColumns:S,computedUnpinnedColumnsWidth:T,scrollbars:C,focusedClassName:I,focusedWithinClassName:w,computedPinnedStartOverflow:v,computedPinnedEndOverflow:x,focusedStyle:R,focusedWithinStyle:P,brain:A}=re(E=>{let{state:F,computed:X}=E;return{brain:F.brain,actions:E.actions,getState:E.getState,focused:F.focused,focusedWithin:F.focusedWithin,domRef:F.domRef,scrollerDOMRef:F.scrollerDOMRef,onBlurWithin:F.onBlurWithin,onFocusWithin:F.onFocusWithin,onSelfFocus:F.onSelfFocus,onSelfBlur:F.onSelfBlur,bodySize:F.bodySize,activeCellIndex:F.activeCellIndex,wrapRowsHorizontally:F.wrapRowsHorizontally,computedPinnedStartColumnsWidth:X.computedPinnedStartColumnsWidth,computedPinnedEndColumnsWidth:X.computedPinnedEndColumnsWidth,computedPinnedStartColumns:X.computedPinnedStartColumns,computedPinnedEndColumns:X.computedPinnedEndColumns,computedVisibleColumns:X.computedVisibleColumns,computedUnpinnedColumnsWidth:X.computedUnpinnedColumnsWidth,scrollbars:X.scrollbars,focusedClassName:E.state.focusedClassName,focusedWithinClassName:E.state.focusedWithinClassName,computedPinnedStartOverflow:X.computedPinnedStartOverflow,computedPinnedEndOverflow:X.computedPinnedEndOverflow,focusedStyle:E.state.focusedStyle,focusedWithinStyle:E.state.focusedWithinStyle}}),M=[],D=S.reduce((E,F)=>{let X=F.computedVisibleIndex;E[we.columnWidths.varName.get(X)]=F.computedWidth+"px",E[we.columnOffsets.varName.get(X)]=F.computedPinned==="start"?`calc( ${F.computedOffset}px + var(${Id}) )`:F.computedPinned==="end"?`calc( var(${vd}) ${M.length?"+":""} ${M.map(Y=>we.columnWidths.get(Y.computedVisibleIndex)).join(" + ")} + var(${Id}) )`:`${F.computedOffset}px`;let B=as(F,{pinnedStartColsCount:h.length,visibleColsCount:S.length});return E[`${yy}-${X}`]=`${B}`,F.computedPinned==="end"&&M.push(F),E},{});if(f.width&&(D[Fr.browserScrollbarWidth.name]=`${_o()}px`),D[Fr.bodyWidth.name]=`calc(${Q.bodyWidth} - ${Q.scrollbarWidthVertical})`,D[Fr.totalVisibleColumnsWidthValue.name]=`${g+b+T}px`,D[Fr.totalVisibleColumnsWidthVar.name]=`calc(${S.map((E,F)=>`var(${by}-${F})`).join(" + ")})`,D[Fr.visibleColumnsCount.name]=S.length,p!=null){D[Sy]=we.columnWidths.get(p[1]);let E=we.columnOffsets.get(p[1]);if(A.isHorizontalLayoutBrain){let F=A.getPageIndexForRow(p[0]);D[wd]=F?`calc( ${he.runtime.totalVisibleColumnsWidthVar} * ${F} + ${E})`:E}else D[wd]=E}D[Iy]=S.length,D[hy]=C.horizontal?`${e}px`:"0px",D[Cd]=C.vertical?`${e}px`:"0px",D[Ty]="calc( "+h.map(E=>we.columnWidths.get(E.computedVisibleIndex)).join(" + ")+")",D[Dd]="calc( "+y.map(E=>we.columnWidths.get(E.computedVisibleIndex)).join(" + ")+")",D[xd]=S.length*10,D[vd]=`calc( var(${Rd}) - var(${Dd}) - var(${Cd}) )`,D[Rd]=`${f.width}px`,D[Cy]=`${f.height}px`;let _=is(E=>{t.focused=E}),O=is(E=>{t.focusedWithin=E}),z={...n,onFocus:E=>{if(n?.onFocus?.(E),E.target===a.current||E.target===l.current){if(o().focused)return;_(!0),u?.(E),i&&(O(!1),s?.(E));return}i||(O(!0),c?.(E))},onBlur:E=>{if(n?.onBlur?.(E),E.target===a.current||E.target===l.current){if(!o().focused)return;_(!1),d?.(E),i&&(O(!1),s?.(E));return}a.current?.contains(E.relatedTarget)||(O(!1),s?.(E))}},G=te(Zt,bd,m?`${Zt}--horizontal-layout`:null,z?.className,g?`${Zt}--has-pinned-start ${Sd}`:null,b?`${Zt}--has-pinned-end ${yd}`:null,r?`${Zt}--focused`:null,i?`${Zt}--focused-within`:null,r&&I?I:null,i&&w?w:null,v?`${Zt}--has-pinned-start-overflow`:null,x?`${Zt}--has-pinned-end-overflow`:null,Td({horizontalLayout:!!m,hasPinnedStart:!!g,hasPinnedEnd:!!b,focused:r,focusedWithin:i}));return z.className=G,z.style={...n?.style,...D},r&&R&&Object.assign(z.style,R),i&&P&&Object.assign(z.style,P),z}var kd=j(on());function zi(n){return n.map(e=>e instanceof No?e:new No(null,[e]))}var No=class n{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new n("+",[this,...e])}subtract(...e){return new n("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new n("*",[this,...e])}divide(...e){return new n("/",[this,...e])}__get(e){let{__operation:t,__operands:o}=this,r=o.map(a=>wy(a,this)).join(` ${t} `);return(o.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function wy(n,e){return typeof n=="string"||typeof n=="number"?`${n}`:e?n.__get(e):n.done()}var Ry=(...n)=>new No("+",zi(n)),Ad=(...n)=>new No("-",zi(n)),vy=(...n)=>new No("*",zi(n)),Dy=(...n)=>new No("/",zi(n)),Nr={add:Ry,subtract:Ad,minus:Ad,multiply:vy,divide:Dy};var nn=(n,e,t)=>{if(n=[...n],e===t||n[e]===void 0||n[t]===void 0)return n;let o=n[e];return t<e,n.splice(e,1),n.splice(t,0,o),n};var Ve=De().requestAnimationFrame||(n=>setTimeout(n,16)),Gt=De().cancelAnimationFrame||(n=>clearTimeout(n));var Ed=n=>{let e=null,t=null;return{stop(){e!==null&&Gt(e),t!=null&&Gt(t)},scroll(o){e!==null&&Gt(e),t!=null&&Gt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...n,...o},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),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft-f,e=Ve(()=>{i.scroll(o)}),!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),f=0;for(let p=0;p<u;p++)s>(p+1)*d&&(f=r.scrollAmountsPerRaf[p]);return o.scrollLeft=o.scrollLeft+f,t=Ve(()=>{i.scroll(o)}),!0}return!!(a()||l())}}};var je=class n{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new n(e)}static from(e){return new n(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,o=e.left-this.left;return{top:t,left:o}}};function _d(n,e){let t=Math.atan2(n.top-e.top,n.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function Od(n,e){return Math.sqrt((e.top-n.top)**2+(e.left-n.left)**2)}function xy(n,e,t){let o=_d(n,t),r=_d(e,t);return o===r?Od(t,e)-Od(t,n):o-r}function Fd(n){if(n.length<3)return n;let[...e]=n,t={top:0,left:0};return n.forEach(o=>{t.top+=o.top,t.left+=o.left}),t.top/=n.length,t.left/=n.length,e.sort((o,r)=>xy(o,r,t)),e}function Py(n){if(n.length<2)return!1;let e=n[0].left,t=n[0].top,o={left:!1,top:!1};for(let r=1,i=n.length;r<i;r++){if(o.left&&o.top)return!1;n[r].left!==e&&(o.left=!0),n[r].top!==t&&(o.top=!0)}return!(o.left&&o.top)}function My(n,e){if(n.length<2)return n[0]?n[0].left===e.left&&n[0].top===e.top:!1;n=Fd(n);let t=n[0],o=n[n.length-1];return t.left===o.left?e.left===t.left&&e.top>=Math.min(t.top,o.top)&&e.top<=Math.max(t.top,o.top):e.top===t.top&&e.left>=Math.min(t.left,o.left)&&e.left<=Math.max(t.left,o.left)}function Nd(n,e){if(Py(n))return My(n,e);n=Fd(n);let[t]=n;for(let o=1,r=n.length-1;o<r;o++){let i=n[o],a=n[o+1];if(Ay([t,i,a],e))return!0}return!1}function Ay(n,e){let[t,o,r]=n,i=e,a=(o.left-t.left)*(r.top-t.top)-(o.top-t.top)*(r.left-t.left);return a*((o.left-t.left)*(i.top-t.top)-(o.top-t.top)*(i.left-t.left))>=0&&a*((r.left-o.left)*(i.top-o.top)-(r.top-o.top)*(i.left-o.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var Vn=class{containsPoint(e){return Nd(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let o=0,r=t.length;o<r;o++)if(!this.containsPoint(t[o]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let o=e.getPoints();for(let r=0,i=o.length;r<i;r++)if(this.containsPoint(o[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Gn=class n extends Vn{static clone(e){return new n(e)}constructor(e){super(),this.points=e.map(je.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function Ey(n,e){let t=Math.min(n.left,e.left),o=Math.min(n.top,e.top),r=n.left+n.width,i=e.left+e.width,a=Math.max(r,i),l=n.top+n.height,s=e.top+e.height,c=Math.max(l,s);return new xe({top:o,left:t,width:a-t,height:c-o})}var xe=class n extends Vn{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 n(t)}static clone(t){return new n(t)}static from(t){return n.clone(t)}static fromPoint(t){return n.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let o=this;for(let r of t)o=Ey(o,r);return o}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 Gn(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(je.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var Ld=10,_y=ee(Q.pinnedStartWidth);function zd(n){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:f,setProxyPosition:p,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:b,horizontalLayoutPageIndex:h,pageWidth:y}=n;function S(k){let U=k==="start"?V:z;return _===L?U:L===k?U+M.computedWidth:_===k?U-M.computedWidth:U}function T(k){if(k.columnIndex===D||h!=null)return!0;let U=e[k.columnIndex];if(U.computedPinned)return!0;let K=l.getScrollPosition().scrollLeft,Z=U.computedOffset+(h!=null&&y!=null?y*h:0);return Z>=K+S("start")&&Z+U.computedWidth<=K+u.width-S("end")}let C=(k,U)=>{let{restrictToParentGroup:K,dragColumn:Z}=U,ne=[];if(k.forEach(ce=>{if(ce.computedVisibleIndex===D)return;let N={columnId:ce.id,columnIndex:ce.computedVisibleIndex,offsetX:ce.computedOffset+Math.round(ce.computedWidth/2)};T(N)&&ne.push(N)}),K){let N=function(fe,me,Me){let Ae=k[fe];Ae&&(Ae.columnGroup!==Z.columnGroup&&Me.add(Ae.id),N(fe+me,me,Me))};var H=N;let ce=Z.computedVisibleIndex,J=new Set;N(ce-1,-1,J),N(ce+1,1,J),ne=ne.filter(fe=>!J.has(fe.columnId))}return ne},w=r.length,v={clientX:Math.round(n.initialMousePosition.clientX),clientY:Math.round(n.initialMousePosition.clientY)},x={left:v.clientX-u.left-(v.clientX-s.left)+Ld,top:v.clientY-u.top-(v.clientY-s.top)+Ld},R=l.getScrollPosition(),P=e.map(k=>k.computedVisibleIndex),A=P,M=t.get(i),D=M.computedVisibleIndex,_=M?.computedPinned,O=D,L=_,V=l.getFixedStartColsWidth(),z=l.getFixedEndColsWidth(),G=v,E={x:0,y:0},F=1,X=0;function B(k){let U=Math.round(k.clientX),K=Math.round(k.clientY);if(U===G.clientX&&K===G.clientY)return xe.from(s).shift({left:E.x,top:E.y});G={clientX:U,clientY:K};let ne=l.getScrollPosition().scrollLeft-R.scrollLeft;return E.x=G.clientX-v.clientX,E.y=G.clientY-v.clientY,X=E.x+ne,F=X<0?-1:1,p({left:x.left+E.x,top:x.top+E.y}),xe.from(s).shift({left:E.x,top:E.y})}function Y(k){let U=0;_?_==="start"&&k.forEach((K,Z)=>{U||e[K]?.computedPinned!=="start"&&(U=Z)}):k.forEach((K,Z)=>{e[K]?.computedPinned==="start"&&(U=Z+1)}),w=U,ie("start",k,U)}function ie(k,U,K){if(k==="start"){let Z=0;for(let ne=0;ne<K;ne++){let H=U[ne],ce=e[H];Z+=ce.computedWidth}Xt(_y,`${Z}px`,a)}}function ge(k){if(k==null||k===O)return;if(O===-1&&k!==-1&&(Or(D,"",a),m(!1)),O=k,k===-1){be(D);return}let U=nn(P,D,O>D?O-1:O);w=0;let Z=new Set;return U.forEach((ne,H)=>{let ce=A[H];ne!==ce&&Z.add(ne),Y(U)}),A=U,ae(Z),{newColumnIndexes:U,indexesWithTransition:Z,pinnedStartCount:w}}function be(k){A=A.filter(K=>K!==k),e.forEach(K=>{let Z=K.computedVisibleIndex,ne=Z>k;ns(Z,a);let H="";ne&&(H=Nr.minus(we.columnOffsets.get(Z),we.columnWidths.get(k)).done()),_r(Z,H,a)}),Or(k,"hidden",a),m(!0)}function ae(k){e.forEach(U=>{let K=U.computedVisibleIndex;k.has(K)?ns(K,a):ki(K,a);let Z=K===D,ne=F===-1?K<O||K>D:K<D||K>=O,H="";F===-1?H=Z?we.columnOffsets.get(O):ne?we.columnOffsets.get(K):Nr.add(we.columnOffsets.get(K),we.columnWidths.get(D)).done():H=ne?we.columnOffsets.get(K):Z?Nr.add(we.columnOffsets.get(O-1),we.columnWidths.get(O-1)).minus(we.columnWidths.get(D)).done():Nr.minus(we.columnOffsets.get(K),we.columnWidths.get(D)).done(),_r(K,H,a)})}let de=u.left+S("start"),pe=u.right-S("end"),q=Ed({scrollOffsetStart:de,scrollOffsetEnd:pe});return B(v),{speedScroller:q,stop(){q.stop()},onMove(k){let U=B(k);if(g().dropTargetListId==="grouping-toolbar"||f&&!d.containsPoint(U.getCenter()))return f&&ge(-1),null;q.scroll({mousePosition:G,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(N){b.scrollLeft=N}});let K=C(e,{dragColumn:M,restrictToParentGroup:c==="group"}),Z=F===-1?M.computedOffset+X:M.computedOffset+M.computedWidth+X,ne=(0,kd.default)(K,Z,({offsetX:N},J)=>N<J?-1:N>J?1:0);ne<0&&(ne=~ne),K.length?ne=K[ne]?K[ne].columnIndex:K[K.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),ne=0),ne===D+1&&(ne=D),ge(ne);let H={};o.forEach(N=>{H[N.id]="end"});for(let N=0;N<w;N++){let J=A[N],fe=e[J];H[fe.id]="start"}let ce=A.map(N=>e[N].id);return{columnPinning:H,columnOrder:ce}}}}function ls(n){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:o,dragColumnId:r}=n;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 o;if(a>i){let l=e.indexOf(r),s=e[l-1],c=o.indexOf(s),u=o.indexOf(r);return nn(o,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=o.indexOf(s),u=o.indexOf(r);return nn(o,u,c)}return e}var Tt=j(require("react"));var rn=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 o=((...r)=>{this.off(e,o),t(...r)});return this.on(e,o)}off(e,t){let o=this.listeners[e];if(!o)return;let r=o.indexOf(t);r!==-1&&o.splice(r,1)}emit(e,...t){let o=this.listeners[e];o&&o.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 Vd=j(on());var Gd=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=o,f=c===a,p=je.from(d.getCenter());if(!l.containsPoint(p))return null;e.activeDragSourcePosition="inside";let m=f?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),b=e.breakpoints,h=Math.round(m===1?r==="horizontal"?g.right-(f?0:g.width/2):g.bottom-(f?0:g.height/2):r==="horizontal"?g.left+(f?0:g.width/2):g.top+(f?0:g.height/2)),y=(0,Vd.default)(b,h,(w,v)=>w-v);y<0&&(y=~y),m===1&&y===u+1&&f&&y--;let S=Math.min(u,y),T=Math.max(u,y),C=f?i.map((w,v)=>{if(v===u&&f)return t;if(v<S||v>=T)return{left:0,top:0};let x=y<=v?1:-1;return r==="horizontal"?{left:Math.round(x*g.width),top:0}:{left:0,top:Math.round(x*g.height)}}):i.map((w,v)=>{let x=y<=v?1:0;return r==="horizontal"?{left:Math.round(x*g.width),top:0}:{left:0,top:Math.round(x*g.height)}}),I={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:C,dragRect:g,status:"accepted"};return e.acceptsDrop(I)?{event:I,error:null,success:!0}:(I.status="rejected",{event:I,error:"rejected by interaction target",success:!1})},Hd=(n,e)=>{let{offset:t,activeDragSource:o}=n,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=o,d=je.from(s.getCenter()),f=u===i,p=a.containsPoint(d);if(p&&!(f&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!f)return null;e.activeDragSourcePosition="outside";let m=f?o.dragIndex:-1,g=s.toDOMRect(),b={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!p,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:f?l.map((h,y)=>h.id===c.id?t:p?{left:0,top:0}:y>m&&!e.getData().preserveDragSpace?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(h=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(b)?{event:b,error:null,success:!0}:(b.status="rejected",{event:b,error:"rejected by interaction target",success:!1})};var Re=class Re{static startDrag(e,t){let o=e instanceof Hn?e:new Hn(e),r=new ss({activeDragSource:o,startPoint:t});return Re.currentDragOperation=r,r.on("start",Re.onDragStart),r.on("move",Re.onDragMove),r.on("drop",Re.onDragDrop),r.start(),r}static retriggerMove(){let e=Re.currentDragOperation;e&&e.phase==="move"&&Re.onDragMove(e)}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:o}=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?o:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Re.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:o})}static withDragMove(e,t){let{activeDragSource:o}=e,{listId:r}=o,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=Gd(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=Hd(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:o,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:o,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:o,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:o,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),Re.currentDragOperation=null,Re.unregisterAll()}};Re.dragInteractionTargetsMap=new Map,Re.currentDragOperation=null,Re.emitter=new rn;var St=Re,Hn=class n{static clone(e){let t=e.getData();return new n(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){yt(this.data,e)||(this.data=e,this.dragRectangle=new xe(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let o=n.clone(e),r=xe.from(o.dragRectangle);return r.shift(t),o.dragRectangle=r,o}},ss=class extends rn{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=Hn.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:o}=this.activeDragSource,r={dragSourceListId:t,dragItemId:o.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 o={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=Hn.shift(this.initialDragSource,o),this.currentOffset=o,this.emit("move",this)}};globalThis.DragManager=St;var Kd=require("react"),Bd=Tt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:n=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),uo=()=>Tt.useContext(Bd),Vi=n=>{let[e,t]=Tt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),o=Tt.useRef(e);o.current=e;let r=Tt.useCallback(()=>{let a=o.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=Tt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,Kd.useEffect)(()=>{let a=St.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=St.on("drag-move",c=>{let u=o.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=St.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[St,t]),Tt.createElement(Bd.Provider,{value:i},typeof n.children=="function"?n.children(i):n.children)};var cs=`${mt}Body`,Wd=n=>n.querySelector(`.${cs}`);var an=`${mt}HeaderCell`,us=`${mt}HeaderWrapper`,jd=n=>Array.from(n.querySelectorAll(`.${us}`));function Gi(n){if(!n)return!1;let e=n.tagName;return e==="INPUT"||e==="BUTTON"}var Oy=ee(Q.baseZIndexForCells),Fy=(n,e)=>{let t=!n||Object.keys(n).length===0,o=!e||Object.keys(e).length===0;return t&&o?!0:!!n!=!!e?!1:yt(n,e)},Ud=({columnId:n,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o})=>{let[r,i]=(0,Kn.useState)(null),[a,l]=(0,Kn.useState)(!1),{getCurrentDragSourceAndTarget:s}=uo(),{getComputed:c,getState:u,api:d,computedDraggable:f,rootRef:p,actions:m}=re(h=>({actions:h.actions,getComputed:h.getComputed,getState:h.getState,api:h.api,computedDraggable:h.computed.computedVisibleColumnsMap.get(n)?.computedDraggable,rootRef:h.state.domRef})),g=(0,Kn.useCallback)(h=>{let y=c().computedVisibleColumnsMap.get(n);if(!y||!y.computedSortable)return;let{multiSortBehavior:S}=u();d.toggleSortingForColumn(n,{multiSortBehavior:S==="replace"&&(h.ctrlKey||h.metaKey)?"append":S})},[]),b=(0,Kn.useCallback)(h=>{if(Gi(h.target))return;let{brain:y,draggableColumnsRestrictTo:S}=u(),{computedVisibleColumns:T,computedVisibleColumnsMap:C,computedPinnedStartColumns:I,computedUnpinnedColumns:w,computedPinnedEndColumns:v}=c(),x=C.get(n);if(!x.computedDraggable){g(h);return}let R=e.current,P=R.getBoundingClientRect(),A=p.current.getBoundingClientRect(),M=y.getAvailableSize(),D=x.computedVisibleIndex,_=y.getVirtualColIndex(x.computedVisibleIndex,{pageIndex:t||0}),O=y.isHorizontalLayoutBrain?y.getPageWidth():null,L=R.style.cursor??"auto",V=!1,z=p.current,G=xe.from(Wd(z).getBoundingClientRect()),E=jd(z).map(de=>xe.from(de.getBoundingClientRect())),F=G.getMinimumBoundingRectangle(...E),X=zd({brain:y,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:o,pageWidth:O,draggableColumnsRestrictTo:S,computedPinnedEndColumns:v,computedPinnedStartColumns:I,computedUnpinnedColumns:w,computedVisibleColumns:T,computedVisibleColumnsMap:C,dragColumnHeaderTargetRect:P,dragColumnId:n,getCurrentDragSourceAndTarget:s,api:d,infiniteDOMNode:p.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:F,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),B=null,Y,ie;function ge(de){let{columnPinning:pe,columnOrder:q}=de;Fy(u().columnPinning,pe)||(m.columnPinning=pe);let k=c().computedColumnOrder;JSON.stringify(q,k)&&(m.columnOrder=ls({newColumnOrder:q,visibleColumnOrder:c().computedVisibleColumns.map(U=>U.id),existingColumnOrder:k,dragColumnId:n}))}let be=de=>{let{headerBrain:pe,brain:q}=u();if(!V){V=!0;let k=q.keepColumnRendered(_),U=pe.keepColumnRendered(_);if(q.isHorizontalLayoutBrain){let Z=q.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),ne=pe.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ie=()=>{Z(),ne()}}Y=()=>{k(),U()},m.columnReorderDragColumnId=x.id,t!=null&&(m.columnReorderInPageIndex=t),os(D,`calc( var(${Oy}) + 10000 )`,p.current),p.current?.classList.add(rs),R.style.cursor="grabbing"}B=X.onMove(de)},ae=de=>{let pe=de.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:q}=u(),k=e.current,U=p.current;U?.classList.remove(rs),X.stop(),y.update({...M}),Y?.(),ie?.(),k.style.cursor=L,k.releasePointerCapture(pe),k.removeEventListener("pointermove",be),k.removeEventListener("pointerup",ae),i(null);let K=d.getColumnApi(x.id)?.isSortable()??!1;!V&&K&&d.toggleSortingForColumn(x.id,{multiSortBehavior:q==="replace"&&(de.ctrlKey||de.metaKey)?"append":q}),(0,$d.flushSync)(()=>{B?ge(B):V&&o&&d.setVisibilityForColumn(x.id,!1),m.columnReorderDragColumnId=!1,t!=null&&(m.columnReorderInPageIndex=null)}),T.forEach(Z=>{ki(Z.computedVisibleIndex,U),Or(Z.computedVisibleIndex,"",U),_r(Z.computedVisibleIndex,"",U)}),os(D,as(x,{pinnedStartColsCount:I.length,visibleColsCount:T.length}),U)})};R.addEventListener("pointermove",be),R.addEventListener("pointerup",ae),R.setPointerCapture(h.pointerId)},[n,t]);return{onPointerDown:f?b:g,dragColumnOutside:a,proxyPosition:r}};var Wn=j(require("react"));var Ce=j(require("react")),Ke=require("react");var sn=j(require("react"));var Yd=n=>n.dataSourceHasGrouping&&n.isGroupRow&&n.childrenLoading||!n.selfLoaded;var Lr=j(require("react")),Zd=require("react");var qd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",Xd=ye({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 Hi=`${Dt}-expand-collapse`;function ln(n){let{size:e=24,direction:t="start",disabled:o=!1}=n,[r,i]=(0,Zd.useState)(n.expanded??n.defaultExpanded),a=()=>{n.onChange?.(!r),Mo("expanded",n)||i(!r)};Lr.useEffect(()=>{Mo("expanded",n)&&i(n.expanded)},[n.expanded]);let l=r?"expanded":"collapsed";return Lr.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":o,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:n.style,onClick:o?void 0:a,className:te(n.className,qd,Xd({direction:t||"start",expanded:r,disabled:o}),`${Dt}`,`${Hi}`,`${Hi}--${l}`,`${Hi}--${t==="end"?"end":"start"}`,o?`${Hi}--disabled`:"")},Lr.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}var Ki=j(require("react"));var Qd="_16lm1iwb _16lm1iw1d _16lm1iwk";var Jd=n=>Ki.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:te(n.className,Qd,"InfiniteIcon","InfiniteIcon-loading")},Ki.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},Ki.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var{rootClassName:Ny}=ke,Qt=`${Ny}ColumnCell`;var ef=ye({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),tf="_7pupv00",of=ye({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function nf({rowInfo:n}){return{[ee(he.components.Row.groupNesting)]:n.dataSourceHasGrouping?n.isGroupRow?n.groupNesting-1:n.groupNesting:0}}function Bi({groupIndexForColumn:n,groupRenderStrategy:e}){return t=>{let{rowInfo:o,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=o,d=te(_n.flex,i.align==="end"?Pr.rowReverse:Pr.row,au.center,`${Qt}Expander`,e==="single-column"||e==="multi-column"&&(!o.isGroupRow||c)?ef({align:a}):null);if(e==="multi-column"){if(n+1!==u.groupNesting&&u.isGroupRow)return c?sn.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return sn.createElement("div",{className:d},s,c,sn.createElement("div",{className:qt},l??null))}}function Wi({groupIndexForColumn:n,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:o}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[n]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===n&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&n+1!==u.groupNesting)return null;let f=u.groupKeys,p=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return Yd(u)?p=sn.createElement(Jd,null):m&&(p=sn.createElement(ln,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(f)}})),o&&(r.renderBag.groupIcon=p,p=sn.createElement(Ct,{render:o,renderParam:r})),p}}function rf(n,e,t){let{groupByForColumn:o,groupIndexForColumn:r,groupRenderStrategy:i}=n,a=o.column?{...o.column}:{},l={header:`Group by ${o.field||o.groupField}`,groupByForColumn:o,render:Bi({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:Wi({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(n,e)}:l={...l,...t}),l}function af(n,e,t){let o=typeof t=="function"?t(n,e):t,r={};return n.sortable!=null&&(r.sortable=n.sortable),{...r,header:"Group",groupByForColumn:n.groupBy,renderSelectionCheckBox:n.selectionMode==="multi-row",render:Bi({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...o,renderGroupIcon:Wi({initialRenderGroupIcon:o?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}var lf="_1eexc2a7 _1eexc2a6",sf=ye({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"]]}),cf=ye({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 uf="_1eexc2a5",ji=ye({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),$i="_1eexc2a8";var Ui=j(require("react")),Yi=require("react");var df="qz8ht90 _16lm1iwk";function Ly(){return{checked:1,disabled:n=>n??!1,domProps:1}}var{ManagedComponentContextProvider:ky}=Ft({forwardProps:Ly,mappedCallbacks:{checked:n=>({callbackName:"onChange",callbackParams:[n]})},debugName:"InfiniteCheckBox"});function zy(){let{componentState:n,componentActions:e}=Nt(),{checked:t,domProps:o,disabled:r}=n,i=(0,Yi.useRef)(null);return(0,Yi.useEffect)(()=>{i.current.indeterminate=t==null},[t]),Ui.createElement("input",{...o,className:te("InfiniteCheckBox",df,o?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function fo(n){return Ui.createElement(ky,{...n},Ui.createElement(zy,null))}function Vy(n){return typeof n.field=="string"}function ff(n){let{column:e,rowInfo:t,fieldsToColumn:o}=n,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?o.get(i.field||i.groupField):void 0}!r&&e.field&&(r=o.get(e.field))}return r}function xt(n){let{getComputed:e,getDataSourceState:t,getState:o,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=n,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,f=e().computedColumnsMap.get(i),{activeRowIndex:p,keyboardNavigation:m,isRowDetailEnabled:g}=o(),b=r===p&&m==="row",h=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:S}}=Bn({column:f,rowInfo:c,rowDetailState:h,columnsMap:e().computedColumnsMap,context:n}),T=gt(f.id,n);return u?{api:a,dataSourceApi:l,column:f,columnApi:T,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,nodeExpanded:!1,rowDetailState:!1,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:T,column:f,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,nodeExpanded:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}}function pf(n){return gf(n.column,n.rowInfo)}function mf(n){let{column:e,context:t,rowInfo:o,visibleColumnsIds:r}=n,i=ff({rowInfo:o,column:e,fieldsToColumn:n.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Bn(n),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:o.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===o.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return o.hasSelectedCells(r)}});let f=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",p=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:Gy({rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,column:n.column,rowInfo:n.rowInfo,visibleColumnsIds:n.visibleColumnsIds,columnsMap:n.columnsMap,fieldsToColumn:n.fieldsToColumn,context:n.context,align:f,verticalAlign:p,formattedValueContext:c}),groupByColumnReference:i}}function Gy(n){let{column:e,context:t,rowInfo:o,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=n,{value:u}=c,{api:d,getDataSourceState:f,getState:p,dataSourceApi:m}=t,{editingCell:g}=p(),{indexInAll:b}=o,h=f(),{selectionMode:y,cellSelection:S}=h,T=ff({rowInfo:o,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),C=d.toggleGroupRow,I=S?.isCellSelected(o.id,e.id)??!1,w={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:I,rowHasSelectedCells:!1,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:n.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===o.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:T,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(o.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(o.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:()=>{o.isTreeNode&&m.treeApi.toggleNodeSelection(o.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:o.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:o.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.selectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},deselectCurrentRow:()=>{if(!o.isTreeNode)return d.rowSelectionApi.deselectRow(o.id,o.dataSourceHasGrouping?o.groupKeys:void 0)},rowIndex:b,toggleGroupRow:C,toggleCurrentGroupRow:()=>{o.isGroupRow&&C(o.groupKeys)},toggleCurrentRowSelection:()=>{if(!(o.isGroupRow||o.isTreeNode))return d.rowSelectionApi.toggleRowSelection(o.id)},toggleCurrentGroupRowSelection:()=>{if(o.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(o.isGroupRow?o.groupKeys:[])},rootGroupBy:h.groupBy,pivotBy:h.pivotBy};return Object.defineProperty(w,"rowHasSelectedCells",{get(){return o.hasSelectedCells(a)}}),w}function gf(n,e){let{data:t,isGroupRow:o,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=o&&i&&n.groupByForColumn&&(Array.isArray(n.groupByForColumn)||n.groupByForColumn===i[i.length-1])?e.value:Vy(n)?t?.[n.field]:null;return n.field&&e.isGroupRow&&e.reducerData&&e.reducerData[n.field]!=null&&(a=e.reducerData[n.field]),n.valueGetter&&!e.isGroupRow&&e.data&&(a=n.valueGetter({data:e.data,field:n.field})),a}function Hy(n,e,t,o,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=o.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:n,rawValue:n,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:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:n,rawValue:n,field:e.field}}function Bn(n){let{column:e,rowInfo:t,context:o,rowDetailState:r}=n,i=gf(e,t),a=Hy(i,e,t,o,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var po=j(require("react"));var{rootClassName:hf}=ke,cn=`${hf}Cell`,ds=`${hf}Cell_content`,Ky=ee(Q.columnWidthAtIndex),By=ee(Q.columnReorderEffectDurationAtIndex);function Wy(n){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:o=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:f,cssPosition:p,renderChildren:m,horizontalLayoutPageIndex:g,...b}=n,h=typeof m=="function"?m():m,y={width:`var(${Ky}-${i.computedVisibleIndex})`,transition:`transform var(${By}-${i.computedVisibleIndex}, 0s)`,...b.style},S={...b,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:te(b.className,cn,lf),children:po.createElement(po.Fragment,null,d,po.createElement("div",{className:te(ds,e?qt:fu.hidden,s),style:r},h),u)};c!=null&&(S["data-row-id"]=`${c}`);let T=f==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return T?po.createElement(T,{...S,ref:a}):po.createElement("div",{...S,ref:a})}var qi=po.memo(Wy);var dn=j(require("react")),un=require("react");function bf(){let{initialValue:n,setValue:e,confirmEdit:t,cancelEdit:o,readOnly:r}=Xi(),i=(0,un.useRef)(null),a=(0,un.useRef)(!1),l=dn.useCallback(u=>{i.current=u,u&&u.focus()},[]),s=(0,un.useCallback)(u=>{let{key:d}=u;d==="Enter"||d==="Tab"?t():d==="Escape"?(a.current=!0,o()):u.stopPropagation()},[]),c=(0,un.useCallback)(()=>{a.current||t()},[]);return dn.createElement(dn.Fragment,null,dn.createElement("input",{readOnly:r,ref:l,onKeyDown:s,onBlur:c,className:te(iu,du.none),type:"text",defaultValue:n,onChange:(0,un.useCallback)(u=>{e(u.target.value)},[])}))}function yf(n,e){let t=[];for(let o in n)n.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&t.push(n[o]);return t}var jy=ee(Q.columnZIndexAtIndex),$y=ee(Q.columnVisibilityAtIndex);function Uy({rowInfo:n}){return{[ee(he.components.Row.groupNesting)]:n.isTreeNode?n.isParentNode?n.treeNesting:n.treeNesting+1:0}}var kr=Ce.createContext(null),Yy=n=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=n;return Ce.createElement(ln,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},qy={display:"inline-block",visibility:"visible"},fs=n=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:o,api:r}=n,i=r.getDataSourceState().isNodeReadOnly;return Ce.createElement(ln,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:qy,expanded:o,onChange:t})},Xy=n=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:o,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=n;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||fo;return Ce.createElement(u,{domProps:{className:$i},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():o()},checked:e.rowSelected})};function ps(n,e){return n?typeof n=="function"?n(e):n:void 0}function ms(n,e,t){return typeof e=="function"?{...n,...e(t)}:{...n,...e}}function Zy(n){let{dataSourceStatePartialForCell:e,rowInfoStore:t,rowStyle:o,rowClassName:r,rowIndexInHorizontalLayoutPage:i,horizontalLayoutPageIndex:a,getData:l,cellStyle:s,cellClassName:c,rowDetailState:u,width:d,column:f,onMouseLeave:p,onMouseEnter:m,onRowMouseEnter:g,onRowMouseLeave:b,rowIndex:h,rowHeight:y,columnsMap:S,fieldsToColumn:T,domRef:C,hidden:I,showZebraRows:w,getDataSourceState:v,dataSourceApi:x,dataSourceActions:R,getState:P,imperativeApi:A,componentActions:M,getComputed:D,getDataSourceMasterContext:_}=n,O=(0,Ke.useSyncExternalStore)((0,Ke.useCallback)(Ee=>t.subscribeToRowIndex(h,Ee),[t,h]),(0,Ke.useCallback)(()=>t.getRowInfoAtIndex(h),[t,h])),L=!O,V=!f,z=Ce.useRef(null),G=(0,Ke.useCallback)(Ee=>{z.current=Ee,C&&C(Ee)},[C]),E=O??{id:"",indexInAll:h,rowSelected:!1,rowDisabled:!1,isCellSelected:()=>!1,hasSelectedCells:()=>!1,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,treeNesting:0,nodePath:[],collapsed:!1,dataSourceHasGrouping:!1,selfLoaded:!0,data:{}},{rowSelected:F}=E,X=D(),{activeRowIndex:B,keyboardNavigation:Y,columnReorderInPageIndex:ie}=P(),ge=h===B&&Y==="row",be={getState:P,getDataSourceState:v,getDataSourceMasterContext:_,actions:M,dataSourceActions:R,api:A,dataSourceApi:x},ae=E.rowDisabled,de=X.computedVisibleColumns.map(Ee=>Ee.id),pe=mf({horizontalLayoutPageIndex:a,rowIndexInHorizontalLayoutPage:i,column:f,rowInfo:E,rowDetailState:u,columnsMap:S,visibleColumnsIds:de,fieldsToColumn:T,context:be}),{stylingParam:q,renderParams:k,formattedValueContext:U,renderFunctions:K,groupByColumnReference:Z,inEdit:ne}=pe,{align:H,verticalAlign:ce}=k,N=k,J=Ce.useRef(N),fe=g&&m?Ee=>{let lo={...U,rowIndex:h};g(lo,Ee),m(Ee)}:m,me=b&&p?Ee=>{let ft={...U,rowIndex:h,rowInfo:E};b(ft,Ee),p(Ee)}:p,Me=(0,Ke.useCallback)(Ee=>{let ft=f.computedVisibleIndex;P().cellClick({rowIndex:h,colIndex:ft,event:Ee})},[h,f.computedVisibleIndex,Y]),Ae=(0,Ke.useCallback)(Ee=>{let ft=f.computedVisibleIndex;if(P().cellMouseDown({rowIndex:h,colIndex:ft,event:Ee}),Y==="row"){ae||(M.activeRowIndex=h);return}Y==="cell"&&(M.activeCellIndex=[h,ft])},[h,ae,f.computedVisibleIndex,Y]),{selectionMode:Ge,cellSelection:Ne,isNodeReadOnly:Le}=e,We=N.cellSelected;N.domRef=G,N.htmlElementRef=z,N.toggleCurrentTreeNode=(0,Ke.useCallback)(N.toggleCurrentTreeNode,[E]),N.selectCell=(0,Ke.useCallback)(N.selectCell,[E]),N.deselectCell=(0,Ke.useCallback)(N.deselectCell,[E]),N.selectCurrentRow=(0,Ke.useCallback)(N.selectCurrentRow,[E]),N.deselectCurrentRow=(0,Ke.useCallback)(N.deselectCurrentRow,[E]),N.toggleCurrentGroupRow=(0,Ke.useCallback)(N.toggleCurrentGroupRow,[E]),N.toggleCurrentRowSelection=(0,Ke.useCallback)(N.toggleCurrentRowSelection,[E]),N.toggleCurrentGroupRowSelection=(0,Ke.useCallback)(N.toggleCurrentGroupRowSelection,[E]),N.toggleCurrentTreeNodeSelection=(0,Ke.useCallback)(N.toggleCurrentTreeNodeSelection,[E]);let et=f.components?.Editor??bf,tt=ne?Ce.createElement(Tf,{contextValue:N},Ce.createElement(et,null)):null,ot=(0,Ke.useCallback)(pt(()=>{if(I||ne)return null;if(J.current=N,K.renderGroupIcon&&(N.renderBag.groupIcon=Ce.createElement(Ct,{render:K.renderGroupIcon,renderParam:{...N,renderBag:{...N.renderBag}}})),K.renderSelectionCheckBox&&Ge=="multi-row"&&(N.renderBag.selectionCheckBox=Ce.createElement(Ct,{render:Xy,renderParam:N}),K.renderSelectionCheckBox!==!0&&(N.renderBag.selectionCheckBox=Ce.createElement(Ct,{render:K.renderSelectionCheckBox,renderParam:{...N,renderBag:{...N.renderBag}}}))),E.isTreeNode){let{isParentNode:lo}=E,Vt;Vt=(lo?K.renderTreeIconForParentNode:K.renderTreeIconForLeafNode)||typeof K.renderTreeIcon=="function"?K.renderTreeIcon:lo&&K.renderTreeIcon===!0?fs:void 0,Vt===!0?Vt=fs:Vt&&(N.renderBag.treeIcon=Ce.createElement(Ct,{render:fs,renderParam:N})),Vt&&(N.renderBag.treeIcon=Ce.createElement(Ct,{render:Vt,renderParam:{...N,renderBag:{...N.renderBag}}}))}K.renderRowDetailIcon&&(N.renderBag.rowDetailsIcon=Ce.createElement(Ct,{render:Yy,renderParam:{...N,renderBag:{...N.renderBag}}}),typeof K.renderRowDetailIcon=="function"&&(N.renderBag.rowDetailsIcon=Ce.createElement(Ct,{render:K.renderRowDetailIcon,renderParam:{...N,renderBag:{...N.renderBag}}}))),K.renderValue&&(N.renderBag.value=Ce.createElement(Ct,{render:K.renderValue,renderParam:{...N,renderBag:{...N.renderBag}}})),E.isGroupRow&&K.renderGroupValue&&(N.renderBag.value=Ce.createElement(Ct,{render:K.renderGroupValue,renderParam:{...N,renderBag:{...N.renderBag}}})),!E.isGroupRow&&K.renderLeafValue&&(N.renderBag.value=Ce.createElement(Ct,{render:K.renderLeafValue,renderParam:{...N,renderBag:{...N.renderBag}}})),J.current=N;let Ee=N.renderBag.value;Ee instanceof Date&&(Ee=Ee.toLocaleDateString());let ft=Ce.createElement(Ce.Fragment,null,H!=="end"?N.renderBag.treeIcon:null,H!=="end"?N.renderBag.groupIcon:null,H!=="end"?N.renderBag.rowDetailsIcon:null,H!=="end"?N.renderBag.selectionCheckBox:null,Ee,H==="end"?N.renderBag.selectionCheckBox:null,H==="end"?N.renderBag.rowDetailsIcon:null,H==="end"?N.renderBag.groupIcon:null,H==="end"?N.renderBag.treeIcon:null);return f.render?Ce.createElement(Ct,{render:f.render,renderParam:{...N,renderBag:{...N.renderBag,all:ft}}}):ft}),[f,I,ne,u,f.renderTreeIcon||f.renderTreeIconForParentNode?Le:!1,...yf(N,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),$=X.computedVisibleColumns.map(Ee=>Ee.id),se=X.computedColumnOrder,ue={...U,visibleColumnIds:$,allColumnIds:se,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(ue,"rowHasSelectedCells",{get(){return E.hasSelectedCells($)}});let Se=E.isTreeNode&&(f.renderTreeIcon||f.renderTreeIconForLeafNode||f.renderTreeIconForParentNode),qe=typeof r=="function"?r(ue):r,le;Z?.className&&(le=ps(Z.className,q)),c&&(le=te(le,ps(c,q))),f.className&&(le=te(le,ps(f.className,q))),Se&&(le=te(le,of({align:H})));let W;E.dataSourceHasGrouping&&f.groupByForColumn&&(W=nf({rowInfo:E})),Se&&(W=Uy({rowInfo:E})),o&&(W=typeof o=="function"?{...W,...o(ue)}:{...W,...o}),s&&(W=ms(W,s,q)),Z?.style&&(W=ms(W,Z.style,q)),f.style&&(W=ms(W,f.style,q)),W=W||{},W.height=y,W.zIndex=`var(${jy}-${f.computedVisibleIndex})`,W.visibility=`var(${$y}-${f.computedVisibleIndex}, visible)`;let it=(0,Ke.useMemo)(()=>W,[W?JSON.stringify(W):null]),Ie=i!=null?i%2===1:(E.indexInAll!=null?E.indexInAll:h)%2===1,at=w?Ie?"odd":"even":!1,vt=!1,zt=!1,br=!1,xn=!1;if(Ne&&We){let Ee=l(),ft=Ee[E.indexInAll-1],lo=Ee[E.indexInAll+1],Vt=X.computedVisibleColumns[f.computedVisibleIndex+1],Sr=X.computedVisibleColumns[f.computedVisibleIndex-1];vt=ft?!Ne.isCellSelected(ft.id,f.id):!0,f.computedPinned==="end"&&f.computedFirstInCategory?zt=!0:zt=Sr?!Ne.isCellSelected(E.id,Sr.id):!0,f.computedPinned==="start"&&f.computedLastInCategory?br=!0:br=Vt?!Ne.isCellSelected(E.id,Vt.id):!0,xn=lo?!Ne.isCellSelected(lo.id,f.id):!0}let yr=Ne&&We?{top:vt,left:zt,right:br,bottom:xn}:null,ml=ie!=null?a!==ie:!1,gl=tt,hl=ot(),dt={domRef:G,cellType:"body",column:f,width:d,rowId:E.id,horizontalLayoutPageIndex:a,style:it,onMouseLeave:me,onMouseEnter:fe,onClick:Me,afterChildren:gl,onMouseDown:Ae,cssEllipsis:f.cssEllipsis??!0,className:te(yr?cf(yr):"",Li(f,[Qt,cn],sf,{dragging:!1,insideDisabledDraggingPage:ml,zebra:at,align:H,verticalAlign:ce,rowDisabled:ae,rowActive:ge,cellSelected:We,rowSelected:F,treeNode:E.isTreeNode?E.isParentNode?"parent":"leaf":!1,firstRow:E.indexInAll===0,firstRowInHorizontalLayoutPage:i===0,groupRow:E.isGroupRow,groupCell:E.isGroupRow?!!f.groupByForColumn:!1,rowExpanded:E.isGroupRow?!E.collapsed:!1}),le,qe),renderChildren:(0,Ke.useCallback)(()=>hl,[ot])},di=kr.Provider;return V||L?Ce.createElement("div",{ref:G,style:{display:"none"}}):Ce.createElement(di,{value:J.current},Ce.createElement(qi,{...dt}))}var Sf=Ce.memo(Zy);function zr(){return(0,Ke.useContext)(kr)}function Xi(){let{api:n,editingValueRef:e,editingCell:t}=re(p=>({api:p.api,editingCell:p.state.editingCell,editingValueRef:p.state.editingValueRef})),{column:o,rowInfo:r}=zr(),[i]=Ce.useState(()=>t?.value),[a,l]=Ce.useState(i),s=t?!t.active&&!!t.waiting:!1,c=Ce.useCallback(p=>{e.current=p,l(p)},[]);Ce.useLayoutEffect(()=>{e.current=i},[]);let u=n.confirmEdit,d=n.cancelEdit,f=n.rejectEdit;return{api:n,initialValue:i,value:a,readOnly:s,column:o,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:f}}function Vr(n){return n.render(n.renderParam)??null}function Ct(n){let e=kr.Provider;return Wn.createElement(e,{value:n.renderParam},Wn.createElement(Vr,{render:n.render,renderParam:n.renderParam}))}function Tf(n){let e=kr.Provider;return Wn.createElement(e,{value:n.contextValue},n.children)}function Lo(n){let e=Zi.Provider;return Wn.createElement(e,{value:n.renderParam},Wn.createElement(Vr,{render:n.render,renderParam:n.renderParam}))}var ko=j(require("react"));var Qy={width:"100%",pointerEvents:"none"},gs=`${Dt}-menu`,hs=xi({"data-name":""}),bs={[hs["data-name"]]:"menu-icon"};function Gr(n){let{style:e,className:t,domProps:o,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=n,l={...Qy,borderTop:`${he.components.HeaderCell.menuIconLineWidth} solid currentColor`,...n.lineStyle};return ko.createElement("div",{...o,style:e,...bs,onPointerDown:s=>s.stopPropagation(),className:te(t,Ku({menuVisible:i,reserveSpaceWhenHidden:r}),Dt,`${Dt}-menu`)},a??ko.createElement(ko.Fragment,null,ko.createElement("div",{className:gs,style:l}),ko.createElement("div",{className:gs,style:l}),ko.createElement("div",{className:gs,style:l})))}var jn=j(require("react")),Hr=require("react");var Cf="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Jy={transition:"width 0.25s, opacity 0.25s"};function Qi(n){let[e,t]=(0,Hr.useState)(!0),[o,r]=(0,Hr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=n,u=c!=null&&c>0,d=n.size??16,f=Math.floor(d/4),p=i?[d-3*f,d-2*f,d-f]:[0,0,0];i===-1&&p.reverse();let m={...Jy,borderTop:`${a}px solid currentColor`,...n.lineStyle,opacity:o};(0,Hr.useEffect)(()=>{let h=i!=0?1:0;if(!e&&h&&t(!0),h!==o){let y=requestAnimationFrame(()=>{r(h)});return()=>{cancelAnimationFrame(y)}}return()=>{}},[i,e]);let g=()=>{let y=!(o===0&&i===0);y!==e&&t(y)};if(!e&&!n.forceSize)return null;let b={};return i===-1&&(b.top="100%"),jn.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:te(s,Dt,Cf,`${Dt}-sort`)},u?jn.createElement("div",{"data-name":"index",style:b,className:ju},c):null,jn.createElement("div",{style:{width:p[0],...m},onTransitionEnd:g}),jn.createElement("div",{style:{width:p[1],...m}}),jn.createElement("div",{style:{width:p[2],...m}}))}var vf=j(require("react")),ys=require("react");var Kr=require("react"),Br=j(require("react"));function If(n,{columns:e,shareSpaceOnResize:t,domRef:o}){let r=e[n];return{resize(i){we.columnWidths.set(n,r.computedWidth+i,o.current);let a=n+1;if(t){let l=e[a];if(!l)return;we.columnWidths.set(a,l.computedWidth-i,o.current),l.computedPinned==="start"?ts(l,i,o.current):we.columnOffsets.set(a,l.computedOffset+i,o.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"){ts(c,i,o.current);continue}c.computedPinned!=="end"&&we.columnOffsets.set(l,c.computedOffset+i,o.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||we.columnOffsets.set(l,c.computedOffset+i,o.current)}}}}}function wf(n,e){let t=n[n.length-1];return{resize(o){let{columns:r,domRef:i}=e,a=r[n[0]],l=a.computedOffset,s=0,c=i.current;if(o.forEach((u,d)=>{s+=u;let f=n[d],p=r[f],m=p.computedWidth+u;we.columnWidths.set(f,m,c),p.computedPinned!=="end"&&(l&&we.columnOffsets.set(f,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&we.columnOffsets.set(u,d.computedOffset+s,c)}}}}var Ji="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",ea=ye({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,computedFirstInCategory:!1},"zneyzhm"],[{computedPinned:"end",computedFirstInCategory:!0,computedLastInCategory:!1},"zneyzhn"]]}),ta=ye({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:eS}=ke,tS=`${eS}HeaderCell_ResizeHandle`;function oS(n){let{brain:e,headerBrain:t}=re(g=>({brain:g.state.brain,headerBrain:g.state.headerBrain})),o=(0,Kr.useRef)(null),[r,i]=(0,Kr.useState)(!1),a=(0,Kr.useRef)(r);a.current=r;let l=n.columns[n.columnIndex],s=n.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,f=()=>{},p=g=>{g.stopPropagation();let b=!!g.shiftKey,h=g.pointerId,y=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let v=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),x=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});f=()=>{v(),x()}}S.setPointerCapture(h);let T=If(n.columnIndex,{columns:n.columns,shareSpaceOnResize:b,domRef:o}),C=(v,{done:x}={})=>{s&&(v=v/(s+1),x&&(v=Math.round(v))),c==="end"&&(v*=-1);let{adjustedDiff:R,constrained:P}=n.computeResize({diff:v,shareSpaceOnResize:b});return a.current!==P&&i(P),T.resize(R),R},I=v=>{C(Math.round(v.clientX-y))},w=v=>{S.releasePointerCapture(h),S.removeEventListener("pointermove",I),S.removeEventListener("pointerup",w);let x=Math.round(v.clientX-y),R=C(x,{done:!0});f(),n.onResize({diff:R,shareSpaceOnResize:b})};S.addEventListener("pointermove",I),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 Br.createElement("div",{ref:o,className:`${tS} ${Ji} ${ta({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:p},Br.createElement("div",{style:m,className:ea({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Rf=Br.memo(oS);function Df(n,e){let{computedVisibleColumns:t,getState:o,getComputed:r,actions:i}=re(c=>({computedVisibleColumns:c.computed.computedVisibleColumns,getState:c.getState,getComputed:c.getComputed,actions:c.actions})),a=(0,ys.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let d=o(),{columnSizing:f,viewportReservedWidth:p,bodySize:m}=d,g=r().computedVisibleColumns,b=!1,h=g.reduce((T,C)=>(C.computedFlex&&(T[C.id]={...f[C.id],flex:C.computedWidth},b=!0),T),{}),y=b?{...f,...h}:f;return jl({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:p||0,dragHandleOffset:c,dragHandlePositionAfter:n.computedVisibleIndex,columnSizing:y,items:g.map(T=>({id:T.id,computedFlex:T.computedFlex,computedWidth:T.computedWidth,computedMinWidth:T.computedMinWidth,computedMaxWidth:T.computedMaxWidth}))})},[n,o,r]),l=(0,ys.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:f}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=f),i.columnSizing=d},[a,i]);return n.computedResizable?vf.createElement(Rf,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:n.computedVisibleIndex,computeResize:a,onResize:l}):null}var Ye=j(require("react"));var Jt=require("react");var xf=ye({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),Pf=ye({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function Mf(n,e){return yt(n,e)}var $n=class extends rn{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 Mf(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return Mf(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let o=!0;return typeof this.data.shouldAcceptDrop=="function"&&(o=this.data.shouldAcceptDrop(t)),o=!!o,o!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=o,o?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),o}adjustForScroll(t){this.breakpoints=this.breakpoints.map(o=>o-t),this.data.orientation==="vertical"?this.data.listRectangle.shift({top:-t,left:0}):this.data.listRectangle.shift({top:0,left:-t})}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let o=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>o||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=o?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:o,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(p,m)=>m),d=[];o===-1?d=u.filter(p=>p!==r):d=nn(u,r,o>r?o-1:o);let f={dragIndex:r,dropIndex:o,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",f)}};var nS={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360}};function rS(n,e){let t=getComputedStyle(n),o=e==="vertical"?t.overflowY:t.overflowX;return o!=="auto"&&o!=="scroll"?!1:e==="vertical"?n.scrollHeight>n.clientHeight:n.scrollWidth>n.clientWidth}function iS(n,e){let t=n;for(;t&&!(t===document.documentElement||t===document.body);){if(rS(t,e))return t;t=t.parentElement}return null}function aS(n,e){return{startScrollingFrom:n*e.startFromPercentage,maxScrollValueAt:n*e.maxScrollAtPercentage}}var _f=1;function Af(n,e,t){if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return t.maxPixelScroll;if(n===e.startScrollingFrom)return _f;let r=1-(n-e.maxScrollValueAt)/(e.startScrollingFrom-e.maxScrollValueAt);return Math.ceil(t.maxPixelScroll*t.ease(r))}function lS(n,e,t){let{accelerateAt:o,stopDampeningAt:r}=t.durationDampening,i=Date.now()-e;if(i>=r)return n;if(i<o)return _f;let a=(i-o)/(r-o);return Math.ceil(n*t.ease(a))}function Ef(n,e,t,o,r,i,a){if(n<e||n>t)return 0;let l=aS(o,r),s=n-e,c=t-n,u=c<s,d;return u?d=Af(c,l,r):d=-Af(s,l,r),d===0?0:a?(d>0?1:-1)*lS(Math.abs(d),i,r):d}var fn=class{constructor(e){this.scrollContainer=null;this.rafId=null;this.lastPointer={left:0,top:0};this.dragStartTime=0;this.shouldUseDampening=!1;this.active=!1;this.maxScrollTop=0;this.maxScrollLeft=0;this.orientation=e.orientation,this.onScroll=e.onScroll,this.config={...nS,...e.config}}start(e){this.scrollContainer=iS(e,this.orientation),this.scrollContainer&&(this.maxScrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight,this.maxScrollLeft=this.scrollContainer.scrollWidth-this.scrollContainer.clientWidth),this.dragStartTime=Date.now(),this.shouldUseDampening=!0,this.active=!0}getScrollContainer(){return this.scrollContainer}updatePointer(e){this.lastPointer=e,!this.rafId&&this.active&&this.scheduleScroll()}scheduleScroll(){this.rafId=requestAnimationFrame(()=>{if(this.rafId=null,!this.active||!this.scrollContainer)return;let e=this.computeScroll();if(e.top===0&&e.left===0)return;let t={top:this.scrollContainer.scrollTop,left:this.scrollContainer.scrollLeft},o=Math.max(0,Math.min(this.maxScrollTop,t.top+e.top)),r=Math.max(0,Math.min(this.maxScrollLeft,t.left+e.left));this.scrollContainer.scrollTop=o,this.scrollContainer.scrollLeft=r;let i={top:this.scrollContainer.scrollTop-t.top,left:this.scrollContainer.scrollLeft-t.left},a=i.top!==0||i.left!==0;a&&this.onScroll(i),this.active&&a&&this.scheduleScroll()})}computeScroll(){if(!this.scrollContainer)return{top:0,left:0};let e=this.scrollContainer.getBoundingClientRect();if(this.orientation==="vertical"){if(this.lastPointer.left<e.left||this.lastPointer.left>e.right)return{top:0,left:0}}else if(this.lastPointer.top<e.top||this.lastPointer.top>e.bottom)return{top:0,left:0};let t=0,o=0;return this.orientation==="vertical"?t=Ef(this.lastPointer.top,e.top,e.bottom,e.height,this.config,this.dragStartTime,this.shouldUseDampening):o=Ef(this.lastPointer.left,e.left,e.right,e.width,this.config,this.dragStartTime,this.shouldUseDampening),{top:t,left:o}}stop(){this.active=!1,this.rafId!=null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollContainer=null}};var Nf=Ye.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),pn=()=>Ye.useContext(Nf),sS=n=>{let{node:e,offset:t}=n;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},cS=n=>`${n.getAttribute(It)}`;function Ss(n,e){let t=n.current?.querySelectorAll(kf)??[];return Array.from(t).filter(r=>r.getAttribute(Wr)===`${e}`)}function uS(n,e){let t=Ss(n,e);return!t||t.length,Array.from(t).map(r=>{let i=cS(r),a=r.getBoundingClientRect();return{id:i,rect:a}})}function dS(n){let{domRef:e,orientation:t,dragListId:o}=n,r=uS(e,o),i=e.current.getBoundingClientRect(),a=i.top,l=i.left,s=i.bottom,c=i.right;for(let f of r){let p=f.rect;p.top<a&&(a=p.top),p.left<l&&(l=p.left),p.bottom>s&&(s=p.bottom),p.right>c&&(c=p.right)}let u=xe.from({top:a,left:l,width:c-l,height:s-a});return{draggableItems:r,orientation:t,listId:o,listRectangle:u,acceptDropsFrom:n.acceptDropsFrom,shouldAcceptDrop:n.shouldAcceptDrop,initial:n.initial,preserveDragSpace:n.preserveDragSpace}}function Lf(n){return new $n(dS(n))}function fS(n,e){let t=Fe(e),[o,r]=Ye.useState(null),i=(0,Jt.useCallback)(l=>{if(l)St.registerDragInteractionTarget(l);else{let s=a();s&&St.unregisterDragInteractionTarget(s)}r(l)},[]),a=Fe(o);return(0,Jt.useEffect)(()=>St.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),f=l.getData();if(f.initial&&f.listId!==s&&c?.includes(f.listId)){let p=Lf({domRef:n,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(p)}}),[t]),{interactionTarget:o,setInteractionTarget:i,getInteractionTarget:a}}function Ts(n,e){let t=n.cloneNode(!0);return t.removeAttribute(It),t.style.position="fixed",t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.zIndex="999999",t.style.pointerEvents="none",t.style.margin="0",t.style.boxSizing="border-box",t.style.transform="none",document.body.appendChild(t),t}function Cs({proxyElement:n,dx:e,dy:t}){n.style.transform=`translate3d(${e}px, ${t}px, 0)`}function Of(n){let e=n.current;e&&(e.cleanup?e.cleanup({proxyElement:e.proxyElement}):e.proxyElement.remove(),e.originalNode.style.visibility="",n.current=null)}var zo=n=>{let e=Ye.useRef(null),t=Ye.useRef(null),[o,r]=(0,Jt.useState)(null),i=Ye.useRef({top:0,left:0}),a=Ye.useRef(null),l=Ye.useCallback(R=>{a.current=R},[]),{dropTargetListId:s,dragSourceListId:c}=uo(),{updateDragOperationSourceAndTarget:u,dragItemId:d,status:f}=uo(),p=Fe(n.onDrop),m=Fe(n.onAcceptDrop),g=Fe(n.onRemove),b=Fe(n.updatePosition??sS),{interactionTarget:h,setInteractionTarget:y}=fS(e,n);(0,Jt.useEffect)(()=>{let R=document.querySelector(`[${Ff}="${n.dragListId}"]`);R?e.current=R:console.warn(`DragList with id "${n.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[n.dragListId]),(0,Jt.useEffect)(()=>{if(h){let R=n.dragListId,P=h.on("start",({dragItem:V,dragSourceListId:z,dropTargetListId:G})=>{u({dragSourceListId:z,dropTargetListId:G,dragItemId:V.id,status:"accepted"})}),A=h.on("move",({offsetsForItems:V,items:z,status:G,dragItem:E})=>{if(G==="rejected")return;let F=T(),X=b(),B=t.current;z.forEach((Y,ie)=>{let ge=V[ie],be=F[ie];if(be&&!(B&&Y.id===B.dragItemId)){if(!B&&Y.id===E.id){let ae=i.current;ge={left:ge.left+ae.left,top:ge.top+ae.top}}X({id:Y.id,node:be,offset:ge})}})}),M=h.on("drop",V=>{let{sortedIndexes:z,dragIndex:G,dropIndex:E,dragItem:F,items:X,dragSourceListId:B,dropTargetListId:Y,outside:ie,status:ge}=V,be=T();S.current=[];let ae=m(),de=g(),pe=p(),q=b();X.forEach((K,Z)=>{let ne=be[Z];ne&&q({id:K.id,node:ne,offset:null})}),Of(t),r(K=>K&&(requestAnimationFrame(()=>r(null)),{...K,dragItemId:null})),R===Y&&B!==R&&ae&&ge==="accepted"&&ae({dragItemId:F.id,dragSourceListId:B,dropTargetListId:Y,dragIndex:G,dropIndex:E,dropItemId:X[E]?.id});let U=null;E===-1&&B===R&&Y===R&&ie&&(U=de),E!==-1&&Y===R&&B===R&&(U=pe),U&&U?.(z,{dragIndex:G,dropIndex:E,dragItemId:X[G].id,dropItemId:X[E]?.id})}),D=null,_=null,O=null,L=null;if(!h.getData().initial&&e.current){if(D=new fn({orientation:n.orientation,onScroll:()=>{}}),D.start(e.current),_=D.getScrollContainer(),_){let V=n.orientation==="vertical"?_.scrollTop:_.scrollLeft;O=()=>{let z=n.orientation==="vertical"?_.scrollTop:_.scrollLeft,G=z-V;V=z,G!==0&&(h.adjustForScroll(G),St.retriggerMove())},_.addEventListener("scroll",O)}L=V=>{D.updatePointer({left:V.clientX,top:V.clientY})},De().addEventListener("pointermove",L)}return()=>{P(),A(),M(),D&&D.stop(),_&&O&&_.removeEventListener("scroll",O),L&&De().removeEventListener("pointermove",L)}}},[h,n.dragListId]);let S=Ye.useRef([]),T=(0,Jt.useCallback)(()=>{let R=S.current;return(!R||R.length===0)&&(R=Ss(e,n.dragListId),S.current=R),R},[n.dragListId]),C=(0,Jt.useCallback)(R=>{let P=R.currentTarget,A=P.getAttribute(It);if(A==null){let k=Fo(P,kf);k&&(A=k.getAttribute(It))}if(A==null){console.warn("Could not find drag item id for element",P,`Make sure you have a parent element with a ${It} attribute`);return}A=`${A}`;let M=null,D=Ss(e,n.dragListId);S.current=D;let _=Lf({domRef:e,orientation:n.orientation,dragListId:n.dragListId,acceptDropsFrom:n.acceptDropsFrom,initial:!0,preserveDragSpace:n.preserveDragSpace}),O=_.getData().draggableItems,L=O.findIndex(k=>k.id===A),V=O[L],z=D[L].getAttribute(It)===`${A}`?D[L]:D.find(k=>k.getAttribute(It)===`${A}`);y(_);let G={left:R.clientX,top:R.clientY},E={left:R.clientX,top:R.clientY};i.current={top:0,left:0};let F=new fn({orientation:n.orientation,onScroll:()=>{}});e.current&&F.start(e.current);let X=F.getScrollContainer(),B=X?n.orientation==="vertical"?X.scrollTop:X.scrollLeft:0;function Y(){M&&M.move({left:E.left,top:E.top})}let ie=()=>{if(!X)return;let k=n.orientation==="vertical"?X.scrollTop:X.scrollLeft,U=k-B;B=k,U!==0&&(_.adjustForScroll(U),n.orientation==="vertical"?i.current.top+=U:i.current.left+=U),Y()};X?.addEventListener("scroll",ie);let ge=n.dragStrategy??"proxy",be=ge==="proxy"&&!n.renderDragProxy,ae=ge==="proxy"&&!!n.renderDragProxy,de=n.onDragProxyMove??Cs,pe=k=>{if(E={left:k.clientX,top:k.clientY},!M){if(M=St.startDrag({listId:n.dragListId,dragItem:V,dragIndex:L},G),z&&be){let Z=z.getBoundingClientRect(),ne=null,H={dragItemNode:z,dragItemId:`${A}`,initialRect:Z,initialCoords:G,get proxyElement(){return ne||(ne=Ts(z,Z)),ne}},ce=n.onDragProxySetup?.(H),N=ce?.proxyElement??H.proxyElement;z.style.visibility="hidden",t.current={proxyElement:N,originalNode:z,dragItemId:`${A}`,initialRect:Z,cleanup:ce?.cleanup}}if(z&&ae){let Z=z.getBoundingClientRect();z.style.visibility="hidden",t.current={proxyElement:z,originalNode:z,dragItemId:`${A}`,initialRect:Z,cleanup:()=>{}},r({dragItemId:`${A}`,initialRect:Z,dx:0,dy:0})}}let U=k.clientX-G.left,K=k.clientY-G.top;if(ae)r(Z=>Z&&{...Z,dx:U,dy:K});else{let Z=t.current;Z&&de({proxyElement:Z.proxyElement,dx:U,dy:K})}F.updatePointer({left:k.clientX,top:k.clientY}),Y()},q=()=>{if(F.stop(),X?.removeEventListener("scroll",ie),De().removeEventListener("pointermove",pe),ae&&(r(k=>k&&{...k,dragItemId:null}),requestAnimationFrame(()=>{r(null)})),!M){Of(t),y(null);return}M.drop(),M=null};De().addEventListener("pointermove",pe),De().addEventListener("pointerup",q,{once:!0})},[n.orientation,n.dragListId,n.acceptDropsFrom,n.removeOnDropOutside,n.dragStrategy,n.renderDragProxy,n.onDragProxySetup,n.onDragProxyMove]),I=!!d,w=Ye.useMemo(()=>({dragItemId:d,onDragItemPointerDown:C,dragSourceListId:c,dropTargetListId:s,status:f,dragListId:n.dragListId,draggingInProgress:I}),[d,C,I,c,s,n.dragListId]),v={className:te("DragList",I?"DragList--dragging":"",xf({dragging:I})),[Ff]:n.dragListId},x=typeof n.children=="function"?n.children(v,w):n.children;return Ye.createElement(Nf.Provider,{value:w},x,o&&n.renderDragProxy?n.renderDragProxy({...o,ref:l}):null)},Ff="data-drag-list-id",It="data-drag-item-id",Wr="data-drag-item-list-id",kf=`[${It}]`,pS=Ye.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),mS=n=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:o,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=pn(),l=n.dragListId??o,s=i===l&&r===`${n.id}`,c=Ye.useMemo(()=>({dragItemId:n.id,active:s,dragListId:l,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[n.id,s,l,t,i,a]),u={[It]:`${n.id}`,[Wr]:l,onPointerDown:e,className:te("DraggableItem",s?"DraggableItem--active":"",Pf({active:s,draggingInProgress:t}))},d=typeof n.children=="function"?n.children(u,c):n.children;return Ye.createElement(pS.Provider,{value:c},d)};zo.DraggableItem=mS;var Is=j(require("react")),zf=n=>Is.createElement(ze,{...n,viewBox:"0 -960 960 960"},Is.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"}));var Qr=j(require("react"));function Vf(){return{}}var Gf=n=>({allowColumnHideWhileDragging:e=>e??!0});var Hf=require("react"),gS=(0,Hf.createContext)(null);function ws(){return gS}var Kt=j(require("react"));var hn=j(require("react")),Ht=require("react");var oa=j(require("react"));function hS(n){let{height:e,width:t,count:o}=n;return oa.createElement("div",{"data-count":o,"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 Kf=oa.memo(hS);var Bf="mlx2t3";var na=j(require("react")),Zf=require("react");var Wf=require("react"),jf=(n,e)=>{(0,Wf.useEffect)(()=>{let t=n?.current,o=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",o,r),()=>{t?.removeEventListener("scroll",o)}},[e,n?.current])};var $f={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},Uf={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},Yf={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},Rs="_1ueijco1",qf="_1ueijco0 _16lm1iw0";var Xf=n=>{let e="";return typeof n=="boolean"||typeof n=="string"?e=$f[`${n}`]:e=te(Uf[`${n.horizontal}`],Yf[`${n.vertical}`]),e};var bS="InfiniteVirtualScrollContainer";var Qf=na.forwardRef(function(e,t){let{children:o,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,Zf.useRef)(null);return jf(u,i),na.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:te(a,bS,qf,Xf(r))},o)});var fa=j(require("react")),Xn=require("react");var Jf=j(require("react")),Vo=require("react");function yS(n){let[e,t]=(0,Vo.useState)(n.updater.get),o=(0,Vo.useRef)(null),r=(0,Vo.useRef)(n.afterCommit);return r.current=n.afterCommit,(0,Vo.useLayoutEffect)(()=>{function i(l){n.useraf?(o.current!=null&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{t(l)})):t(l)}let a=n.updater.onChange(i);return()=>{o.current!=null&&cancelAnimationFrame(o.current),a()}},[n.updater,n.useraf]),(0,Vo.useLayoutEffect)(()=>{r.current?.()}),e??null}var Go=Jf.memo(yS);var ep=j(on());var vs=(n,e)=>n-e,mo={horizontal:!0,vertical:!0};function ra(n,e){let t=e.length;if(!t)return 0;let o=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=o)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>n){a>o&&(o=a);break}}return o<0?t:Math.min(o,t)}var Ds="DebugID=";function Ho(n,e){return e&&e.startsWith(Ds)?e:e?`${Ds}${n}:${e}`:`${Ds}${n}`}var ia={start:0,end:0},xs=n=>{n()},Ps=n=>{let{start:e,end:t}=n,[o,r]=e,[i,a]=t,l=i-o,s=a-r;return l*s},tp=n=>{let{start:e,end:t}=n,[o]=e,[r]=t;return r-o},jr=typeof window<"u"?requestAnimationFrame:n=>setTimeout(n,0);function SS(n){return n.horizontalChange||n.verticalChange}var mn=class extends bt{constructor(t){let o=Ho(t,`${t}:MatrixBrain`);super(o);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=ia;this.verticalExtendRangeBy=ia;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 o=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==o&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let o=0,r=t.length;o<r;o++)t[o]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,o=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](o,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,o=this.getAvailableSize();t.forEach(r=>{jr(()=>{this.destroyed||t.has(r)&&r(o)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?xs:jr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let o=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?xs:jr;o.forEach(a=>{i(()=>{this.destroyed||o.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 o=this.cols-this.fixedColsEnd;o<this.cols;o++)t+=this.getColWidth(o);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:o}=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:o);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:o}=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:o);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 o=0;o<this.fixedColsStart;o++)t+=this.getColWidth(o);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let o=this.rows-this.fixedRowsEnd;o<this.rows;o++)t+=this.getRowHeight(o);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let o=0;o<this.fixedRowsStart;o++)t+=this.getRowHeight(o);return t};this.computeRenderCount=(t=mo)=>{let o=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return o&&(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:o})=>{t===void 0&&(t=this.horizontalRenderCount),o===void 0&&(o=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=o===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=o,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:o,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:o,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=mo)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:o})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=o.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 f=l;for(;d[f]!=f;)f--;a.push([f,u])}}}if(r){let l=t.startIndex,s=o.startIndex,c=o.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let f=l;for(;d[f]!=f;)f--;a.push([u,f])}}}return a};this.computeRenderRange=(t=mo)=>{let o=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:o,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:o,vertical:r})}};this.computeDirectionalRenderRange=t=>{let o=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 o!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,f=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,f+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),f&&(r+=f);let p=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return p>m&&(p=m,u=Math.max(a,p-r)),{startIndex:u,endIndex:p}};this.getItemAt=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o==="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,o),d=u,u=a[c],d===u&&d!=0))return i-1;let f=(0,ep.default)(a,t,vs);return f>=0?f:~f-1};this.computeCacheFor=(t,o)=>{let r=o==="horizontal"?this.colWidth:this.rowHeight,i=o==="horizontal"?this.colWidthCache:this.rowHeightCache,a=o==="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 ${o==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${o==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,o,r)=>{let i=r==="horizontal"?o:t,a=r==="horizontal"?t:o,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),f=u.get(a);if(d[i]===void 0){let p=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:o};for(;p<=m;p++)if(d[p]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=p;let b=s(g);d[p]=p,f[p]=b;let h=p;for(;b>1;)h+=1,d[h]=p,f[h]=0,b-=1}}};this.getCellSpan=(t,o,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;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,o,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,o)=>this.getCellSpan(t,o,"vertical");this.getColspan=(t,o)=>this.getCellSpan(t,o,"horizontal");this.getRowspanParent=(t,o)=>this.getItemSpanParent(t,o,"vertical");this.getColspanParent=(t,o)=>this.getItemSpanParent(t,o,"horizontal");this.getItemSpanParent=(t,o,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?o:t,l=r==="horizontal"?t:o;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,o,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"vertical");this.getColWidthWithSpan=(t,o,r)=>this.getItemSizeWithSpan(t,o,r,"horizontal");this.getItemSizeWithSpan=(t,o,r,i)=>{let a=i==="horizontal"?o: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,o)=>{let r=o==="horizontal"?this.cols:this.rows,i=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,o),l=o==="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,o);a=this.getItemSizeCacheFor(t,o)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:o,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(o.startIndex!==this.verticalRenderRange.startIndex||o.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=o,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=Ps;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(o=>o!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(o=>o!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(o=>o!==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(o=>o!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=o,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=mo){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,o){return t}update(t,o){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",f=u&&s!==this.availableWidth,p=d&&c!==this.availableHeight;f&&(this.availableWidth=s,this.availableRenderWidth=s),p&&(this.availableHeight=c,this.availableRenderHeight=c),(f||p)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",b=m&&r!==this.rows,h=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,S=l!=null,T=y&&a!==this.rowHeight,C=S&&l!==this.colWidth;y&&(this.rowHeight=a),S&&(this.colWidth=l);let I=t.rowspan!=null,w=t.colspan!=null,v=I&&t.rowspan!=this.rowspan,x=w&&t.colspan!=this.colspan;v&&(this.rowspan=t.rowspan),x&&(this.colspan=t.colspan);let R=h||C||f||x,P=b||T||p||v;(o||SS)({horizontalChange:R,verticalChange:P,colsChanged:h,colWidthChanged:C,widthChanged:f,colspanChanged:x,rowsChanged:b,rowHeightChanged:T,heightChanged:p,rowspanChanged:v})&&this.updateRenderCount({horizontal:R,vertical:P})}extendRenderRange(t){let{direction:o}=t,r=o==="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:o})}}updateRenderCount(t=mo){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=mo){if(!this.availableWidth||!this.availableHeight){let o={horizontal:void 0,vertical:void 0};this.availableWidth||(o.horizontal=0),this.availableHeight||(o.vertical=0),this.setRenderCount(o)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,o){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(o?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let o=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?xs:jr;o.forEach(a=>{i(()=>{this.destroyed||o.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,o=this.onScrollFns;for(let r=0,i=o.length;r<i;r++)o[r](t)}computeDirectionalRenderCount(t,o,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 o=="function"){let u=[],d=0,f=r;d+=s,f-=c;for(let p=d;p<f;p++)u.push(this.getItemSize(p,t));a=ra(l,u)}else a=(o?Math.ceil(l/o):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:o}=this,r={horizontal:t,vertical:o},i=this.onRenderCountChangeFns;i.forEach(a=>{jr(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,o){return{x:this.getItemOffsetFor(o,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,o){let r=o==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=o==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=o==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,o);l=i[t]}return l}getItemSizeCacheFor(t,o){return(o==="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 o=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*o;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=o?this.getItemSize(o-1,t):0,s=o?a[o-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let o=0,r=t.length;o<r;o++)t[o]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=ia,this.verticalExtendRangeBy=ia,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var As=j(on());function op(...n){if(!n.length)return new Set;let[e,...t]=n;return new Set([...e].filter(o=>t.every(r=>r.has(o))))}function np(n,e){let t=new Set;for(let o of n)e(o)&&t.add(o);return t}function $r(n,e){for(let t of n)if(e(t))return t}var ip=j(require("react"));var rp=new Map,TS=()=>{},Ms=class{constructor(e,t){this.element=null;this.mounted=!1;this.pendingAfterCommitWork=null;this.mountSubscription=Te();this.afterCommit=()=>{if(this.pendingAfterCommitWork){let e=this.pendingAfterCommitWork;this.pendingAfterCommitWork=null,e()}};let o=rp.get(e)??0,r=`${e}:GridCellReact:${o}`;rp.set(e,o+1),this.debugId=r,this.cellInfo=t,this.updater=Te(),this.node=ip.createElement(Go,{key:r,name:r,updater:this.updater,afterCommit:this.afterCommit}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}setPendingAfterCommitWork(e){this.pendingAfterCommitWork=e}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.pendingAfterCommitWork=null,this.ref=TS,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 bt{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=Te();this.cellAttachmentChangeSubscription=Te();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 Ms(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,o=t.values().next().value;return o||(this.poolSize+=Un.POOL_SIZE_INCREMENT,o=t.values().next().value),o||this.error("No cells available in the pool!"),o}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 o=this.poolSize;if(t===o)return;let{detachedCells:r}=this,i=o-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 aa=Un;var la=(n,e)=>n-e,sa=class extends bt{constructor(t){super(`${t}:GridCellManager`);this.matrix=new oe;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[f,p]=d,m=f<i,g=f>=l,b=p<a,h=p>=s;(m||g||b||h)&&c.add(u)}),c};this.debugId=t,this.pool=new aa(t),this.offRemoveCell=this.pool.onRemoveCell(o=>this.onRemoveCell(o))}onRemoveCell(t){let o=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),o&&this.clearCellFromMatrix(t,o,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,o,r){if(this.matrix.delete(o),r.skipHistory)return;let[i,a]=o,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,o){let[r,i]=o;this.matrix.set(o,t),this.cellToMatrixPosition.set(t,o);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,o){let r=this.cellToMatrixPosition.get(t);if(o==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=o,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,o)}renderNodeAtCell(t,o,r,i){let a=this.getCellAt(r);return a&&a!==o&&this.detachCellAt(r),this.pool.attachCell(o),this.setCellPositionInMatrix(o,r),o.update(t,i),o}getCellPosition(t){let o=this.cellToMatrixPosition.get(t);return!o||this.getCellAt(o)!=t?null:o}getCellAt(t){return this.matrix.get(t)}getCellFor(t,o){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(o==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=$r(l,s=>!this.isCellAttached(s)))}if(o==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=$r(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let o=this.getCellAt(t);return o?this.isCellAttached(o):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,o=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:o+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(o=>this.getCellAt(o)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(la)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(la)}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((o,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(o=>this.detachCell(o))}detachRowsStartingWith(t){let o=this.getRowsWithCells().sort(),r=(0,As.default)(o,t,la);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let o=this.getColumnsWithCells().sort(),r=(0,As.default)(o,t,la);r<0&&(r=~r),o.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[o,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>o&&this.detachCellAt(a),l===o&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let o=this.getCellAt(t);return o?this.detachCell(o):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,o){return $r(t,r=>this.getCellPosition(r)?.[0]===o)}getCellFromListForColumn(t,o){return $r(t,r=>this.getCellPosition(r)?.[1]===o)}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 sp=j(on());var lp=j(require("react"));var ap=new Map,CS=()=>{},Es=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=Te();let t=ap.get(e)??0,o=`${e}:ListRowReact:${t}`;ap.set(e,t+1),this.debugId=o,this.updater=Te(),this.node=lp.createElement(Go,{key:`detail-row-${o}`,name:`detail-row-${o}`,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(o=>{o!=null&&e(o)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=CS,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Yn=class Yn extends bt{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=Te();this.rowAttachmentChangeSubscription=Te();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 Es(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,o=t.values().next().value;return o||(this.poolSize+=Yn.POOL_SIZE_INCREMENT),o=t.values().next().value,o||this.error("No rows available in the pool!"),o}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 o=this.poolSize;if(t===o)return;let{detachedRows:r}=this,i=o-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 ca=Yn;var ua=class extends bt{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new ca(t),this.offRemoveRow=this.pool.onRemoveRow(o=>this.onRemoveRow(o))}onRemoveRow(t){let o=this.rowToIndex.get(t);o!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(o))}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,o){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),o==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,o),this.indexToRow.set(o,t))}detachStartingWith(t){let o=this.getAttachedIndexes(),r=(0,sp.default)(o,t,(a,l)=>a-l);r<0&&(r=~r),o.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 o=this.getRowAt(t);o&&(this.setRowIndexInList(o,null),this.pool.detachRow(o))}detachRow(t){let o=this.getRowIndex(t);o!=null&&this.detachRowAt(o)}renderNodeAtRow(t,o,r){let i=this.getRowAt(r);return i&&i!==o&&this.detachRowAt(r),this.pool.attachRow(o),this.setRowIndexInList(o,r),o.update(t),o}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 cp=!0,gn=ee(Q.y),up=ee(Q.scrollTop),UE=ee(Q.columnOffsetAtIndex),_s=ee(Q.columnOffsetAtIndexWhileReordering),qn=class extends bt{constructor(t,o){o=o||"ReactHeadlessTableRenderer";super(o);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,o,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(gn,i?`calc( ${r}px + var(${up}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${gn}), 0)`};this.setTransform=(t,o,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=we.columnOffsets.get(r),d=`${_s}-${r}`,f=s?`calc( ${a}px + var(${up}) )`:`${a}px`;t.__currentTransformY!==f&&(t.__currentTransformY=f,t.style.setProperty(gn,f));let p=`translate3d(var(${d}, ${u}), var(${gn}), 0)`;t.__transformValue!==p&&(t.__transformValue=p,t.style.transform=p),c!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[o]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===o)return null;for(;!this.isRowFullyVisible(o);)if(o--,o===t)return null;return{start:t,end:o}};this.getScrollPositionForScrollRowIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=o;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),f=r.getFixedEndRowsHeight(),p=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=p+m.height;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollTop;if(l==="center"?b=c-Math.floor((r.getAvailableSize().height-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),this.brain.isHorizontalLayoutBrain){let h=o.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(h,{...o,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:b}};this.getScrollPositionForScrollColumnIntoView=(t,o={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=o.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=o;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(),f=r.getFixedStartColsWidth(),p=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=p+m.width;l||(l=c>g-f?"end":c<p+d?"start":"end");let b=i.scrollLeft;return l==="center"?b=c-Math.floor((r.getAvailableSize().width-d-f)/2):l==="start"?(s=-s,b+=c-p+s-d):(s+=u,b+=c-g+s+f),{...i,scrollLeft:b}};this.getScrollPositionForScrollCellIntoView=(t,o,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(o,{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,o=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-o);this.isRowVisible=(t,o=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-o,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+o,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let o=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===o).length>0};this.isCellVisible=(t,o)=>this.isRowVisible(t)&&this.isColumnVisible(o);this.isCellFullyVisible=(t,o,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(o,void 0,r);this.isColumnFullyVisible=(t,o=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-o,r);this.isColumnVisible=(t,o=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-o-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+o+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,o,r)=>this.isRowRendered(t)&&this.isColumnRendered(o,r);this.isColumnRendered=(t,o)=>{let{start:[r]}=this.brain.getRenderRange();return o?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*o.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:o,end:r}=t,[i,a]=o,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:o,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!o&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,f]=c,[p,m]=u,g=[];if(i&&(o&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[o,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:[p,i]})),a&&(o&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[o,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:[p,l]})),o){let b={start:[0,f],end:[o,m],rowFixed:"start",colFixed:!1};g.push(b)}if(r){let b={rowFixed:"end",colFixed:!1,start:[s-r,f],end:[s,m]};g.push(b)}return g};this.isCellFixed=(t,o)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,f=!1;if(t<r&&(u=!0,f="start"),i&&!u){let p=c-i;t>=p&&(u=!0,f="end")}if(o<a&&(d=!0,f="start"),l&&!d){let p=s-l;o>=p&&(d=!0,f="end")}return{row:u?f:!1,col:d?f:!1}};this.isCellCovered=(t,o)=>{let r=this.brain.getRowspanParent(t,o),i=this.brain.getColspanParent(t,o),a=r!=t,l=i!=o;return a||l?[r,i]:!1};this.onMouseEnterNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseEnter(o)};this.onMouseLeaveNotBound=t=>{let o=this.getMatrixRowIndexFromElement(t.currentTarget);this.onMouseLeave(o)};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(o=>{let r=o.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(o=>{let r=o.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 o=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Ve(()=>{this.destroyed||(o(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,o)=>{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){let d=()=>{this.updateHoverClassNamesForRow(a);let f=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=f.rowIndex,r.dataset.colIndex=f.colIndex,cp){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let m=(o?o.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==m&&(r.__zIndex=m,r.style.zIndex=m)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`};this.scrolling&&this.brain.isHorizontalLayoutBrain?t.setPendingAfterCommitWork(d):d()}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let o=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;o&&(o.dataset.detailRowIndex=r,cp&&(this.setDetailTransform(o,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.zIndex=o.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:o,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(D=>{let _=i.getRowIndex(D);if(_!=null){let O=this.brain.getItemOffsetFor(_,"vertical");if(O==null)return;let L=D.getElement();if(!L)return;this.setDetailTransform(L,_,{y:O,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let f=this.cellManager.getOneAttachedCell();f&&gd(t,this.getInfiniteNode(f.getElement()));let p=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:b}=this.brain.getRenderRange(),[h,y]=g,[S,T]=b;function C(D,_,O){let L=r.getCellAt([D,_]);if(L==null)return;let V=o.getCellOffset(D,_),z=L.getElement();z&&V&&O(D,_,z,V)}let I=(D,_,O,{x:L,y:V})=>{this.setTransform(O,D,_,{x:L,y:V,scrollLeft:!0},s-_)},w=(D,_,O,L)=>{this.setTransform(O,D,_,{x:L.x,y:L.y,scrollTop:!0},u-D)},v=(D,_,O,{y:L})=>{let V=p[_];this.setTransform(O,D,_,{x:V,y:L,scrollLeft:!0},a-_)},x=(D,_,O,L)=>{this.setTransform(O,D,_,{x:L.x,y:m[D],scrollTop:!0},l-D)},R=(D,_,O,{x:L,y:V})=>{this.setTransform(O,D,_,{x:L,scrollLeft:!0,y:V,scrollTop:!0},1e5)},P=(D,_,O,{x:L})=>{this.setTransform(O,D,_,{x:L,scrollLeft:!0,y:m[D],scrollTop:!0},2e5)},A=(D,_,O,L)=>{this.setTransform(O,D,_,{x:p[_],y:L.y,scrollLeft:!0,scrollTop:!0},3e5)},M=(D,_,O)=>{this.setTransform(O,D,_,{x:p[_],y:m[D],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let D=h;D<S;D++){for(let _=0;_<s;_++)C(D,_,I);if(c){let _=a-c;for(let O=_;O<a;O++)C(D,O,v)}}if(u||d)for(let D=y;D<T;D++){for(let _=0;_<u;_++)C(_,D,w);if(d){let _=l-d;for(let O=_;O<l;O++)C(O,D,x)}}if(s&&u)for(let D=0;D<u;D++)for(let _=0;_<s;_++)C(D,_,R);if(s&&d){let D=l-d;for(let _=D;_<l;_++)for(let O=0;O<s;O++)C(_,O,P)}if(c&&u){let D=a-c;for(let _=0;_<u;_++)for(let O=D;O<a;O++)C(_,O,A)}if(c&&d){let D=l-d,_=a-c;for(let O=D;O<l;O++)for(let L=_;L<a;L++)C(O,L,M)}};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=o,this.cellManager=new sa(o),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new ua(o),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(),Ve(()=>{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=Jl(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let o=t.getElement();o&&this.cellDetachedClassNames.forEach(r=>{o.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,o){let r=!!this.cellManager.getCellAt([t,o]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:o,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,f=this.getFixedRanges(t),p=[t,...f],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let R=t.start[1],P=t.end[1];m.forEach(A=>{R<=A&&A<P||p.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let g=new Map,b=p.map(this.getExtraSpanCellsForRange).flat();b&&b.forEach(([R,P])=>{g.set(`${R}:${P}`,!0)});let h=p.reduce((R,P)=>R+Ps(P),0),y=r?p.reduce((R,P)=>R+tp(P),0):0,S=this.brain.getRowCount(),T=this.brain.getColCount();d.detachCellsStartingAt([S,T]);let C=Math.min(S*T,h);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let I=op(...p.map(R=>d.getCellsOutsideRenderRange(R)));I=np(I,R=>{let P=d.getCellPosition(R);return!(P&&g.has(`${P[0]}:${P[1]}`))}),d.detachCells(I),d.poolSize=C;let w=new Map,v=new Map;p.forEach(R=>{let{start:P,end:A}=R,[M,D]=P,[_,O]=A;for(let L=M;L<_;L++){for(let z=D;z<O;z++){let G=`${L}:${z}`;if(w.has(G))continue;w.set(G,!0);let{rendered:E,mapped:F}=this.isCellRenderedAndMappedCorrectly(L,z);if(L===M||z===D){let B=this.isCellCovered(L,z);if(B&&g.has(`${B[0]}:${B[1]}`)){let Y=d.getCellAt([L,z]);Y!=null&&d.detachCell(Y);continue}}if(E&&!i&&F)continue;let X;E?X=d.getCellAt([L,z]):X=d.getCellFor([L,z],c?"row":"column"),X==null&&(X=d.getDetachedCell()),this.renderCellAt(L,z,X,o)}!r||v.has(L)||(v.set(L,!0),u.isRowAttachedAt(L)&&!i)||this.renderDetailRowAtElement(L,this.rowManager.getRowFor(L),r)}}),b.forEach(([R,P])=>{let{rendered:A,mapped:M}=this.isCellRenderedAndMappedCorrectly(R,P);if(A){if(i||!M){let _=[R,P],O=d.getCellAt(_);this.renderCellAt(R,P,O,o)}return}let D=d.getCellFor([R,P],c?"row":"column");D!=null&&this.renderCellAt(R,P,D,o)});let x=d.getAllCells().map(R=>R.getNode());return r&&u.getAllRows().forEach(R=>{x.push(R.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(x),x}renderDetailRowAtElement(t,o,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:o.ref});if(o.isMounted()||o.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(o);return}this.rowManager.renderNodeAtRow(c,o,t),this.updateDetailElementPosition(o)}getCellRealCoordinates(t,o){return{rowIndex:t,colIndex:o}}getMatrixRowIndexFromElement(t){let o=Number(t.dataset.rowIndex);return this.brain.isHorizontalLayoutBrain?this.brain.getRowIndexInPage(o):o}renderCellAt(t,o,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,o),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(o),c=this.brain.getRowspan(t,o),u=this.brain.getColspan(t,o),d=c===1?l:this.brain.getRowHeightWithSpan(t,o,c),f=u===1?s:this.brain.getColWidthWithSpan(t,o,u),{row:p,col:m}=this.isCellFixed(t,o),g=!!a,{rowIndex:b,colIndex:h}=this.getCellRealCoordinates(t,o),y=i({rowIndex:b,colIndex:h,height:l,width:s,rowspan:c,colspan:u,rowFixed:p,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:f,onMouseEnter:this.onMouseEnterNotBound,onMouseLeave:this.onMouseLeaveNotBound,domRef:r.ref});r.isMounted()||r.onMount(C=>{let I=C.getElement();I&&(I.style.position="absolute",I.style.left="0px",I.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:b,renderColIndex:h}:void 0,T=this.brain.isHorizontalLayoutBrain;if(!y){T?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,o],S),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var da=class extends qn{constructor(t,o){super(t,o);this.setTransform=(t,o,r,i,a)=>{let l=this.getCellRealCoordinates(o,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=he.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",f=we.columnOffsets.get(l.colIndex),p=`${_s}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(gn,m));let g=`calc(var(${p}, ${f}) + ${d})`,b=`var(${gn})`,h=`translate3d(${g}, ${b}, 0px)`;t.__transformValue!==h&&(t.__transformValue=h,t.style.transform=h)};this.brain=t}getCellRealCoordinates(t,o){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:o})}isCellRenderedAndMappedCorrectly(t,o){let r=this.cellManager.getCellAt([t,o]),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,o),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function Ur(n){let e=n.isHorizontalLayoutBrain?new da(n,`${n.name}:HorizontalLayoutTableRenderer`):new qn(n,`${n.name}:ReactHeadlessTableRenderer`),t=Te();return n.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function IS(n){let{brain:e,renderCell:t,renderDetailRow:o,forceRerenderTimestamp:r}=n,{renderer:i,onRenderUpdater:a}=(0,Xn.useMemo)(()=>n.onRenderUpdater&&n.renderer?{renderer:n.renderer,onRenderUpdater:n.onRenderUpdater}:Ur(e),[e,n.onRenderUpdater,n.renderer]);return(0,Xn.useLayoutEffect)(()=>{i.cellHoverClassNames=n.cellHoverClassNames||[]},[i,n.cellHoverClassNames]),(0,Xn.useLayoutEffect)(()=>{i.cellDetachedClassNames=n.cellDetachedClassNames||[]},[i,n.cellDetachedClassNames]),(0,Xn.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:o}),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:o})})},[i,e,t,o,a,r]),fa.createElement(Go,{updater:a})}var pa=fa.memo(IS);var Yr=j(require("react")),Zn=require("react");var dp=ye({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ma="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var fp=ye({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:wS}=ke,RS=`${wS}-ActiveRowIndicator`,vS=`calc(${Q.activeCellRowOffsetX} + var(${ee(Q.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,DS={[ee(Q.activeCellOffsetY)]:Q.activeCellRowOffset,transform:`translate3d(${vS}, calc( ${Q.activeCellOffsetY} + var(${ee(Q.scrollTopForActiveRow)}, 0px)), 0px)`,height:Q.activeCellRowHeight,maxWidth:he.runtime.totalVisibleColumnsWidthVar},xS=n=>{let{brain:e}=n,t=(0,Zn.useRef)(null),o=n.activeRowIndex!=null&&e.getInitialRows()>n.activeRowIndex,[r,i]=Yt();return(0,Zn.useLayoutEffect)(()=>{if(n.activeRowIndex==null)return;let a="0px",l=n.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let f=e.getPageIndexForRow(l);f>0&&(a=`calc(${he.runtime.totalVisibleColumnsWidthVar} * ${f})`),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};zn(d,u)},[n.activeRowIndex,e]),(0,Zn.useEffect)(()=>{let a=c=>{zn({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]),Yr.createElement("div",{className:ma,"data-name":"active-row"},Yr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${RS} ${fp({active:o})}`,style:o?DS:void 0}))},pp=Yr.memo(xS);var qr=j(require("react")),Qn=require("react");var{rootClassName:PS}=ke,MS=`${PS}-ActiveCellIndicator`,AS=ee(Q.columnZIndexAtIndex),ES=(n,e,t,o)=>{if(e==null)return;let[r]=e;n.isHorizontalLayoutBrain&&n.rowsPerPage&&(r=r%n.rowsPerPage);let i=typeof t=="function"?t(r):t??n.getRowHeight(r),a=n.getItemOffsetFor(r,"vertical"),l=o.current;zn({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},_S=n=>{let{brain:e}=n,[t,o]=Yt(),r=(0,Qn.useRef)(null),i=n.activeCellIndex!=null&&e.getInitialRows()>n.activeCellIndex[0];return(0,Qn.useLayoutEffect)(()=>{ES(e,n.activeCellIndex,n.rowHeight,r)},[n.activeCellIndex,n.rowHeight,e]),(0,Qn.useEffect)(()=>{let a=e.onRenderCountChange(()=>{o()});return()=>{a()}},[e]),qr.createElement("div",{className:ma,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${AS}-${n.activeCellIndex[1]})`}:void 0},qr.createElement("div",{"data-name":"active-cell-indicator",className:`${MS} ${dp({visible:i})}`}))},mp=qr.memo(_S);var ga=[uf,`${mt}DetachedCell`];function ha(n,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&n.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),n.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 OS=te(Bf,Rs);function gp(n){let{brain:e,scrollerDOMRef:t,scrollStopDelay:o,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:f,forceRerenderTimestamp:p,scrollVarHostRef:m,...g}=n,{autoFocus:b}=g,h=(0,Ht.useRef)(null),[y,S]=(0,Ht.useState)({width:0,height:0});(0,Ht.useEffect)(()=>{o!=null&&e.setScrollStopDelay(o)},[o,e]),(0,Ht.useEffect)(()=>{let I=h.current?.parentNode;return I?(b&&document.activeElement!==I&&I.focus(),Rr(I,()=>{let x={height:I.clientHeight,width:I.clientWidth};e.update(x)},{debounce:50})):void 0},[f,e]);let T=(0,Ht.useCallback)(I=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-I.scrollLeft}px, ${-I.scrollTop}px, 0px)`)})},[]),C=(0,Ht.useCallback)(I=>{e.setScrollPosition(I,T)},[e,T]);return(0,Ht.useEffect)(()=>{let I=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),T(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),I},[e]),hn.createElement(Qf,{onContainerScroll:C,...g,ref:t},hn.createElement("div",{ref:h,className:OS,"data-name":"scroll-transform-target"},hn.createElement(pa,{forceRerenderTimestamp:p,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ga}),u!=null?hn.createElement(mp,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?hn.createElement(pp,{brain:e,activeRowIndex:c}):null,hn.createElement(Kf,{width:y.width,height:y.height}))}function hp(n,e,t,o){let r=new Map,i=new Map,a=new Map;n.forEach((u,d)=>{let f=u.id,p=n[d-1],m=p?.id??"",g=new Set,b=p?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(f,g);let h={type:"column",id:f,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([f],h);let y=u.columnGroup,S,T=h;for(;y;){let C=e[y];if(C){g.add(y);let I=[f,...g];S=b.has(y)?i.get(y):void 0,S||(S={id:y,type:"group",ref:C,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:h.computedPinned,depth:t.get(y)??0},r.set(I,S),i.set(y,S)),S.columnItems.push(h),S.uniqueGroupId.push(h.id),T&&!b.has(T.id)&&S.children.push(T),T=S,y=C.columnGroup}else break}});let l=[],s=new oe,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((f,p)=>f+p.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&bp(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<=o+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function bp(n,e=0){n.forEach(t=>{let o=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=o,t.groupOffset=e,t.type==="group"&&bp(t.children),e+=o})}var Ko=j(require("react")),go=require("react");var Fs=j(require("react"));var Sp=j(require("react")),Os=require("react");var Xr=require("react"),Zr=j(require("react"));var{rootClassName:FS}=ke,NS=`${FS}HeaderCell_ResizeHandle`;function LS(n){let e=(0,Xr.useRef)(null),[t,o]=(0,Xr.useState)(!1),r=(0,Xr.useRef)(t);r.current=t;let i=n.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let f=d.pointerId,p=d.clientX,m=d.target;m.setPointerCapture(f);let g=!0,b=wf(n.groupColumns.map(T=>T.computedVisibleIndex),{columns:n.columns,domRef:e}),h=T=>{a==="end"&&(T*=-1);let{constrained:C,adjustedDiffs:I,adjustedDiff:w}=n.computeResize(T);return r.current!==C&&o(C),b.resize(I),w},y=T=>{if(g){let C=n.groupColumns.reduce((v,x)=>v+x.computedWidth-x.computedMinWidth,0),I=n.brain.getAvailableSize(),w={width:I.width+C,height:I.height};n.brain.update(w),g=!1}h(Math.round(T.clientX-p))},S=T=>{m.releasePointerCapture(f),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",S);let C=Math.round(T.clientX-p),I=h(C);n.onResize(I)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:he.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Zr.createElement("div",{ref:e,className:`${NS} ${Ji} ${ta({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Zr.createElement("div",{style:{...u,...n.style},className:ea({constrained:t})}))}var yp=Zr.memo(LS);function Tp(n,e){let{bodyBrain:t,groupHeight:o,columnGroup:r,columnGroupsMaxDepth:i}=e,{computedVisibleColumns:a,getState:l,getComputed:s,actions:c}=re(g=>({computedVisibleColumns:g.computed.computedVisibleColumns,getState:g.getState,getComputed:g.getComputed,actions:g.actions})),u=n[n.length-1],d=(0,Os.useCallback)(g=>{let b=l(),{columnSizing:h,viewportReservedWidth:y,bodySize:S}=b,T=s().computedVisibleColumns,C=!1,I=T.reduce((x,R)=>(R.computedFlex&&(x[R.id]={...h[R.id],flex:R.computedWidth},C=!0),x),{}),w=C?{...h,...I}:h;return Xu({availableSize:S.width,reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:w,columnGroupSize:n.length,items:T.map(x=>({id:x.id,resizable:x.computedResizable,computedFlex:x.computedFlex,computedWidth:x.computedWidth,computedMinWidth:x.computedMinWidth,computedMaxWidth:x.computedMaxWidth}))})},[u]),f=(0,Os.useCallback)(g=>{let{columnSizing:b,reservedWidth:h}=d(g);c.viewportReservedWidth=h,c.columnSizing=b},[d]);return n.some(g=>g.computedResizable)?Sp.createElement(yp,{brain:t,style:{height:o*(i-r.depth+2)},columns:a,groupColumns:n,computeResize:d,onResize:f}):null}var Cp=`${mt}HeaderGroup`,Ip=ee(Q.columnWidthAtIndex),kS=ee(Q.columnZIndexAtIndex);function wp(n){let{columnGroup:e,height:t,columns:o,bodyBrain:r,columnGroupsMaxDepth:i}=n,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}));let s=Tp(o,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=o[0],u=o.length>1?"calc( "+o.map(p=>`var(${Ip}-${p.computedVisibleIndex})`).join(" + ")+" )":`var(${Ip}-${c.computedVisibleIndex})`,d=`calc(var(${kS}-${c.computedVisibleIndex}) + ${i-e.depth})`,f=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}):l;return f=f&&typeof f=="object"?f:{},f.width=u,f.height=t,Fs.createElement("div",{ref:n.domRef,"data-group-id":e.uniqueGroupId,className:te(Hu,Cp),style:f,"data-z-index":d},Fs.createElement("div",{className:te(`${Cp}__header-content`,qt)},a),s)}var Rp=require("react");var ks=j(require("react")),Ns;function zs(){return Ns||(Ns=ks.createContext({dataSourceApi:null,getDataSourceState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},dataSourceState:null,dataSourceActions:null}))}var Ls;function ba(){return Ls||(Ls=ks.createContext(null))}function _e(n){let e=ba(),t=(0,Rp.useContext)(e);return Pn(t,n)}function eo(){return _e(n=>({getDataSourceState:n.getDataSourceState,getDataSourceMasterContext:n.getDataSourceMasterContext,dataSourceActions:n.dataSourceActions,dataSourceApi:n.dataSourceApi,assignState:n.assignState}))}var{rootClassName:zS}=ke,VS=[],vp=`${zS}Header`,GS=Lu({overflow:!1}),Dp=()=>{};function HS(n){let{bodyBrain:e,headerBrain:t,columns:o,style:r,className:i,columnHeaderHeight:a,columnAndGroupTreeInfo:l,columnGroupsMaxDepth:s}=n,{getState:c,headerOptions:u,headerRenderer:d,headerOnRenderUpdater:f,showColumnFilters:p,computedColumnsMap:m}=re(A=>({computedColumnsMap:A.computed.computedColumnsMap,getState:A.getState,headerOptions:A.state.headerOptions,headerRenderer:A.state.headerRenderer,headerOnRenderUpdater:A.state.headerOnRenderUpdater,showColumnFilters:A.state.showColumnFilters})),g=(0,go.useRef)(null),b=(0,go.useCallback)(A=>{g.current&&(g.current.style.transform=`translate3d(-${A.scrollLeft}px, 0px, 0px)`)},[]);(0,go.useEffect)(()=>{let A=t.onScroll(b);return b(t.getScrollPosition()||{scrollLeft:0,scrollTop:0}),A},[t]);let h={ref:g,className:te(vp,`${vp}--virtualized`,i,GS),style:{...r,height:a}},{getDataSourceState:y,dataSourceApi:S,dataSourceActions:T}=eo(),{allRowsSelected:C,someRowsSelected:I,selectionMode:w,filterTypes:v,filterDelay:x}=_e(A=>({allRowsSelected:A.dataSourceState.allRowsSelected,someRowsSelected:A.dataSourceState.someRowsSelected,selectionMode:A.dataSourceState.selectionMode,filterTypes:A.dataSourceState.filterTypes,filterDelay:A.dataSourceState.filterDelay})),R=(0,go.useMemo)(()=>({allRowsSelected:C,someRowsSelected:I,selectionMode:w}),[C,I,w]),P=(0,go.useCallback)(A=>{let{rowIndex:M,colIndex:D,domRef:_,height:O,widthWithColspan:L,heightWithRowspan:V,hidden:z}=A,G=o[D];if(!G||z)return null;let E=t.isHorizontalLayoutBrain?t.getPageIndexForRow(M):null,F=l?l.pathsToCells.get([M,D]):null;if(F&&F.type==="group"){let X=F.columnItems.map(ie=>ie.ref),B={...F.ref,id:F.id,uniqueGroupId:F.uniqueGroupId,depth:F.depth,columns:X.map(ie=>ie.id),computedWidth:F.computedWidth,groupOffset:F.groupOffset};return c().columnGroupVisibility[F.id]!==!1?Ko.createElement(wp,{horizontalLayoutPageIndex:E,bodyBrain:e,columnGroupsMaxDepth:s,domRef:_,columns:X,width:L,height:O,columnGroup:B}):null}return Ko.createElement(Pp,{domRef:_,column:G,horizontalLayoutPageIndex:E,headerOptions:u,dataSourceStatePartialForHeaderCell:R,filterTypes:v,filterDelay:x,getDataSourceState:y,dataSourceApi:S,dataSourceActions:T,width:L,height:V,columnsMap:m})},[u,o,a,l,s,p,t,y,S,T,v,x,R]);return Ko.createElement(zo,{orientation:"horizontal",dragListId:"header",dragStrategy:"inline",onDrop:Dp,updatePosition:Dp},A=>Ko.createElement("div",{...A,...h,className:te(A.className,h.className)},Ko.createElement(pa,{name:"header",renderCell:P,brain:t,renderer:d,onRenderUpdater:f,cellHoverClassNames:VS,cellDetachedClassNames:ga})))}var xp=Ko.memo(HS);function Mp(n){let{headerBrain:e,bodyBrain:t,scrollbars:o}=n,{computedPinnedStartColumns:r,computedPinnedEndColumns:i,computedVisibleColumns:a,columnSize:l}=re(I=>({computedPinnedStartColumns:I.computed.computedPinnedStartColumns,computedPinnedEndColumns:I.computed.computedPinnedEndColumns,computedVisibleColumns:I.computed.computedVisibleColumns,columnSize:I.computed.columnSize})),{columnHeaderHeight:s,columnGroupsDepthsMap:c,columnGroupsMaxDepth:u,computedColumnGroups:d,showColumnFilters:f}=re(I=>({columnHeaderHeight:I.state.columnHeaderHeight,columnGroupsDepthsMap:I.state.columnGroupsDepthsMap,columnGroupsMaxDepth:I.state.columnGroupsMaxDepth,computedColumnGroups:I.state.computedColumnGroups,showColumnFilters:I.state.showColumnFilters})),p=!d||!Object.keys(d).length?1:u+2,m=p*s+(f?s:0),g=Kt.useMemo(()=>{if(!(!d||!Object.keys(d).length))return hp(a,d,c,u)},[a,d,c]),b=Kt.useCallback(({rowIndex:I,colIndex:w})=>{let v=a[w],x=1,R=1;if(!v||!g)return{rowspan:x,colspan:R};let P=g.pathsToCells.get([I,w]);if(!P)return{rowspan:x,colspan:R};if(P.type==="column")return{colspan:R,rowspan:p-P.depth};let A=P.columnItems.findIndex(M=>M.id===v.id);return{rowspan:x,colspan:A===0?P.columnItems.length:1}},[d,u,a,g,p,c]),h=Kt.useCallback(({rowIndex:I,colIndex:w})=>b({rowIndex:I,colIndex:w}).rowspan,[b]),y=Kt.useCallback(({rowIndex:I,colIndex:w})=>b({rowIndex:I,colIndex:w}).colspan,[b]),S=Kt.useCallback(I=>f?I<p-1?s:2*s:s,[p,f,s]);ha(e,{colWidth:l,rowHeight:S,rows:p,cols:a.length,height:m,rowspan:h,colspan:y},{fixedColsEnd:i.length,fixedColsStart:r.length});let T=Kt.createElement(xp,{columns:a,headerBrain:e,bodyBrain:t,columnHeaderHeight:m,columnGroupsMaxDepth:u,columnAndGroupTreeInfo:g}),C=o.vertical&&_o()?Kt.createElement("div",{className:Bu,style:{zIndex:1e3,width:_o()}}):null;return Kt.createElement("div",{className:`${us} ${Uu}`,style:{height:m}},T,C)}var{ManagedComponentContextProvider:KS}=Ft({initSetupState:Vf,forwardProps:Gf,Context:ws()});function Vs(n){let{getComputed:e,header:t,brain:o,headerBrain:r,wrapRowsHorizontally:i}=re(l=>({getComputed:l.getComputed,header:l.state.header,brain:l.state.brain,headerBrain:l.state.headerBrain,wrapRowsHorizontally:l.state.wrapRowsHorizontally})),{scrollbars:a}=e();return t?Qr.createElement(KS,{...n},Qr.createElement(Mp,{wrapRowsHorizontally:!!i,bodyBrain:o,headerBrain:r,scrollbars:a})):null}function Ap(){return Qr.useContext(ws()).componentState}var BS=n=>{let{allRowsSelected:e,someRowsSelected:t,api:o,dataSourceApi:r}=n,i=e?!0:t?null:!1,{components:a,isTree:l}=o.getState(),s=a?.CheckBox||fo;return Pe.createElement(s,{domProps:{className:$i},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?o.rowSelectionApi.selectAll():o.rowSelectionApi.deselectAll()},checked:i})},Zi=Pe.createContext(null);var WS=ee(Q.columnZIndexAtIndex),jS=ee(Q.columnVisibilityAtIndex),Gs=Pe.createElement("div",{className:vi[1]}),_p=xi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[It]:"",[Wr]:""});function $S(n){let e=n.column,{allowColumnHideWhileDragging:t}=Ap(),{dataSourceStatePartialForHeaderCell:o,horizontalLayoutPageIndex:r,getDataSourceState:i,dataSourceApi:a,dataSourceActions:l,filterTypes:s,filterDelay:c}=n,{allRowsSelected:u,someRowsSelected:d,selectionMode:f}=o,{onDragItemPointerDown:p}=pn(),{api:m,getComputed:g,getState:b,actions:h,getDataSourceMasterContext:y,showColumnFilters:S,components:T,portalDOMRef:C,columnHeaderHeight:I,columnReorderDragColumnId:w,columnMenuVisibleForColumnId:v,columnReorderInPageIndex:x}=re(W=>({api:W.api,getComputed:W.getComputed,getState:W.getState,actions:W.actions,getDataSourceMasterContext:W.getDataSourceMasterContext,showColumnFilters:W.state.showColumnFilters,components:W.state.components,portalDOMRef:W.state.portalDOMRef,columnHeaderHeight:W.state.columnHeaderHeight,columnReorderDragColumnId:W.state.columnReorderDragColumnId,columnMenuVisibleForColumnId:W.state.columnMenuVisibleForColumnId,columnReorderInPageIndex:W.state.columnReorderInPageIndex})),R=w===e.id,P=x!=null?r!==x:!1,{onResize:A,height:M,width:D,headerOptions:_,columnsMap:O}=n,L=e.computedSortInfo,V=e.header,z=(0,ho.useCallback)(W=>{k.current=W,n.domRef?.(W)},[n.domRef]),G=_.alwaysReserveSpaceForSortIcon,E=e.headerAlign??e.align,F=(typeof E=="function"?E({isHeader:!0,column:e}):E)??"start",X=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",B=gt(e,{actions:h,api:m,dataSourceActions:l,dataSourceApi:a,getComputed:g,getDataSourceState:i,getDataSourceMasterContext:y,getState:b}),Y=B.isSortable(),ie=Y&&(e.computedSorted||G)?Pe.createElement(Qi,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:he.spacing[2],marginInlineEnd:he.spacing[2]},className:`${an}__sort-icon ${Wu} ${$u({align:F})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,be=e.computedFilterable&&e.computedFiltered?Pe.createElement(Fn,null):null,ae=e.headerCssEllipsis??e.cssEllipsis??!0,de={reserveSpaceWhenHidden:F==="center",menuVisible:v===e.id,style:F==="end"?{marginInlineStart:`calc(${he.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:he.spacing[2]}:{marginInlineEnd:`calc(${he.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:he.spacing[2]},domProps:{onMouseDown:W=>{W.stopPropagation(),B.toggleContextMenu(W.target)}}},pe=e.components?.MenuIcon||T?.MenuIcon||Gr,q=Pe.createElement(pe,{...de}),k=(0,ho.useRef)(null),U={horizontalLayoutPageIndex:r,dragging:R,domRef:z,htmlElementRef:k,renderLocation:"column-header",column:e,columnsMap:O,columnSortInfo:L,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:d,allRowsSelected:u,selectionMode:f,api:m,dataSourceApi:a,columnApi:B,renderBag:{sortIcon:ie,filterIcon:be,menuIcon:q,menuIconProps:de,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},K=U,Z=K.renderBag.header,ne=()=>{let W={...U,renderBag:{...U.renderBag}};if(e.renderSortIcon&&(W.renderBag.sortIcon=Pe.createElement(Lo,{render:e.renderSortIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderFilterIcon&&(W.renderBag.filterIcon=Pe.createElement(Lo,{render:e.renderFilterIcon,renderParam:{...W,renderBag:{...W.renderBag}}})),typeof e.renderMenuIcon=="function"&&(W.renderBag.menuIcon=Pe.createElement(Lo,{render:vt=>{if(typeof e.renderMenuIcon!="function")return null;let zt=e.renderMenuIcon(vt);return zt?zt.type===pe||zt.type===Gr?zt:Pe.createElement(pe,{...de},zt):null},renderParam:{...W,renderBag:{...W.renderBag}}})),e.renderSelectionCheckBox&&f==="multi-row"){W.renderBag.selectionCheckBox=Pe.createElement(Lo,{render:BS,renderParam:{...W,renderBag:{...W.renderBag}}});let vt=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;vt&&vt!==!0&&(W.renderBag.selectionCheckBox=Pe.createElement(Lo,{render:vt,renderParam:{...W,renderBag:{...W.renderBag}}}))}V instanceof Function&&(W.renderBag.header=Z=Pe.createElement(Lo,{render:V,renderParam:{...W,renderBag:{...W.renderBag}}}));let it=e.renderMenuIcon===!1?null:W.renderBag.menuIcon,Ie=ae?Pe.createElement("div",{className:qt},W.renderBag.header):W.renderBag.header,at=Pe.createElement(Pe.Fragment,null,F==="center"?Gs:null,W.renderBag.selectionCheckBox,Ie,W.renderBag.sortIcon,W.renderBag.filterIcon,F==="center"?Gs:null,F!=="center"?Gs:null,it);return e.renderHeader?Pe.createElement(Lo,{render:e.renderHeader,renderParam:{...W,renderBag:{...W.renderBag,all:at}}}):at};(0,ho.useEffect)(()=>{let W=null,it=k.current;return A&&it&&(W=Rr(it,A)),()=>{W?.()}},[k.current,n.onResize]);let H={height:M};e.headerStyle&&(H=typeof e.headerStyle=="function"?{...H,...e.headerStyle(K)||{}}:{...H,...e.headerStyle});let ce=typeof e.headerClassName=="function"?e.headerClassName(K):e.headerClassName,{onPointerDown:N,proxyPosition:J,dragColumnOutside:fe}=Ud({columnId:e.id,domRef:k,horizontalLayoutPageIndex:r,allowColumnHideOnDrag:t}),me=null,Me=Zi.Provider,Ae={filtered:e.computedFiltered,verticalAlign:X,align:F},Ge=Pe.useMemo(()=>{let W=it=>{m.setColumnFilter(e.id,it)};return c>0?_t(W,{wait:c}):W},[c,e.id]),Ne=e.computedFilterType,Le=s[Ne],We=e.computedFilterable?e.computedFilterValue?.filter.operator??Le?.defaultOperator:void 0,et=e.computedFilterable&&Le?Le.operators.find(W=>W.name===We):void 0,tt=et?.components?.FilterEditor||Le?.components?.FilterEditor||e.components?.FilterEditor||kn,ot=Le?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,$=Df(e,{horizontalLayoutPageIndex:r}),se=`var(${WS}-${e.computedVisibleIndex})`;H.zIndex=se,H.visibility=`var(${jS}-${e.computedVisibleIndex}, visible)`;let ue={"data-field":`${e.field||""}`,"data-column-id":e.id,[It]:e.id,[Wr]:"header","data-header-align":F,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},Se=e.computedFilterable?Pe.createElement(ad,{horizontalLayoutPageIndex:r,filterEditor:tt,filterOperatorSwitch:ot??ld,operator:et,filterTypes:s,onChange:Ge,columnFilterType:Ne,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:I}):Pe.createElement(sd,null);K.renderBag.filterEditor=Se;let qe=(0,ho.useCallback)(W=>{N(W),p(W)},[N,p]),le=ne();return R&&J&&(me=Pe.createElement("div",{key:e.id,className:`${an}Proxy ${Ou}`,style:{height:M,width:D,left:J.left??0,top:J.top??0}},Pe.createElement("div",{className:Fu({visible:fe})},Pe.createElement(zf,{size:16})),Z),me=(0,Ep.createPortal)(me,C.current)),Pe.createElement(Me,{value:K},Pe.createElement(qi,{domRef:z,horizontalLayoutPageIndex:n.horizontalLayoutPageIndex,cellType:"header",column:e,...ue,"data-z-index":se,style:H,width:D,onPointerDown:qe,contentClassName:te(_u(Ae),cu[F]),contentStyle:S?{height:M/2}:void 0,className:te(an,mu.none,Y?lu.pointer:"",ce,Li(e,[an,cn],Nu,{dragging:R,insideDisabledDraggingPage:P,align:F,verticalAlign:X,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),Eu),cssEllipsis:ae,afterChildren:Pe.createElement(Pe.Fragment,null,S?Se:null,$),renderChildren:le}),me)}var Pp=Pe.memo($S);function Er(){return(0,ho.useContext)(Zi)}var bo=j(require("react")),Lp=require("react");function Op(n,e){let{separator:t}=e??{separator:"-"};return n.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var Fp={padding:he.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},US={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},Np=(n,e)=>{if(n)for(let[t,o]of Object.entries(e))n.style.setProperty(Op(t),o,"important")},kp=bo.forwardRef(function(e,t){let{rootClassName:o}=Ri(),r=bo.useRef(null),i=bo.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,Lp.useEffect)(()=>{let a=()=>{setTimeout(()=>{Np(r.current,Fp),Np(r.current?.firstElementChild,US)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),bo.createElement("div",{ref:i,...e,className:te(`${o}-Footer`,hd,e.className),style:Fp},"Powered by"," ",bo.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function Hs(n){return n.map(to)}function to(n){if(De().structuredClone)return De().structuredClone(n);if(n===null||typeof n!="object")return n;if(Array.isArray(n))return Hs(n);if(n instanceof Date)return new Date(n);if(n instanceof Set)return new Set(Hs(Array.from(n)));if(n instanceof Map)return new Map(Hs(Array.from(n)));let e={};for(let t in n)n.hasOwnProperty(t)&&(e[t]=to(n[t]));return e}function Jr(n){return n}var bn=Object.seal({data:null,field:null});var Wo="____root____",Vp="____not_loaded_yet____";function Bo(){return!1}function Ks(n){if(!n||!Object.keys(n).length)return{};let e={};for(let t in n)if(n.hasOwnProperty(t)){let o=n[t].initialValue;e[t]=typeof o=="function"?o():o}return e}function ya(n,e,t,o,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=o[i],s=a.getter?a.getter(n)??null:a.field?n[a.field]:null;o[i]=a.reducer(l,s,n,e,r)}}}function Gp(n,e){let{marker:t,reducers:o={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:c}=n;t&&t.start();let u=new oe;function d(h,y,S,T=0,C=[]){let I=!S.length||T===S.length-1,w=y[c?.values||"values"]||{};for(let v in w)if(w.hasOwnProperty(v)){let x=v;C.push(x),f.set(C,!0),h.set(C,{reducerResults:w[v][c?.totals||"totals"]||{},items:[]}),I||d(h,w[v],S,T+1,C),C.pop()}}let f=r?new oe:void 0,p=[],m=Ks(o),g=to(m);e.visitDepthFirst((h,y,S,T)=>{let[C,...I]=y,w=h.children,v=u.get(I);if(v&&(v.cache=h.cache,v.childrenLoading=h.childrenLoading,v.childrenAvailable=h.childrenAvailable,v.error=h.error),I.length==i.length&&i.length){if(v){v.items=w;for(let R=0,P=I.length;R<P;R++){let A=I.slice(0,R),M=u.get(A);M&&(M.items=M.items||[],M.items=M.items.concat(w))}w=a.indexArray(w,{toPrimaryKey:l,cache:s,nodesKey:void 0})}return T?.()}for(let x=0,R=w.length;x<R;x++){if(!w[x]){let D={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...I,`${Vp}${x}`],D);continue}let P=w[x].data,A=w[x].keys||[];if(A.length){let D=A[A.length-1];I.push(D)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:P,totalChildrenCount:w[x].totalChildrenCount,reducerResults:w[x].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(I,M),r){let D=M.pivotDeepMap=new oe,_=w[x].pivot;d(D,_,r,0,p)}A.length&&I.pop()}T?.()});let b={deepMap:u,groupParams:n,initialData:e,reducerResults:g};return r&&(b.topLevelPivotColumns=f,b.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),b}function zp(n,e,t,o,r,i,a,l,s,c=Jr){let{items:u,reducerResults:d,pivotDeepMap:f}=n.get(e);if(u.push(o),a&&ya(o,r,a,d,e),i){for(let p=0,m=i.length;p<m;p++){let{field:g,valueGetter:b,toKey:h}=i[p],y=g?o[g]:null;b&&(bn.data=o,bn.field=g,y=b(bn));let S=(h||c)(y,o);t.push(S),f.has(t)||(l.set(t,!0),f?.set(t,{reducerResults:to(s),items:[]}));let{reducerResults:T,items:C}=f.get(t);C.push(o),a&&ya(o,r,a,T,e)}t.length=0}}function Hp(n,e,t,o,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=n,d=u(r),f=[...o,d],p=s(r);if(t.set(f,!0),p){for(let h=0,y=o.length;h<=y;h++){let S=o.slice(0,h),T=e.get(S),{reducerResults:C,items:I}=T;I.push(r),T.leavesAvailableCount++,T.totalLeafNodesCount++,a&&ya(r,i,a,C,S)}return}let m=to(l),g=[];e.set(f,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:o.length});let b=c(r);if(!(!b||!Array.isArray(b))){for(let h=0,y=b.length;h<y;h++){let S=b[h];Hp(n,e,t,f,S,h,a,l)}a&&ei(a,m,g)}}function Bs(n,e){let{reducers:t,marker:o}=n;if(o){let c=Object.keys(t??{});o.start({details:c.length>0?[{name:"Reducers",value:c.join(", ")}]:void 0})}let r=Ks(t),i=to(r),a=new oe,l=new oe;a.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:i,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let c=0,u=e.length;c<u;c++)Hp(n,a,l,[],e[c],c,t,r);t&&ei(t,i,e);let s={deepMap:a,treeParams:n,treePaths:l,initialData:e,reducerResults:i};return o&&o.end(),s}function Ta(n,e){let{marker:t,groupBy:o,defaultToKey:r=Jr,pivot:i,reducers:a}=n;t&&t.start();let l=o.length,s=i?new oe:void 0,c=new oe,u=[],d=[],f=Ks(a),p=to(f);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:to(f)};i&&(g.pivotDeepMap=new oe),c.set(u,g)}for(let g=0,b=e.length;g<b;g++){let h=e[g],y={};for(let S=0;S<l;S++){let{field:T,groupField:C,valueGetter:I,toKey:w}=o[S],v=T?h[T]:null;I&&(bn.data=h,bn.field=T,v=I(bn));let x=(w||r)(v,h);if(y[T||C]=x,u.push(x),!c.has(u)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:to(f)};i&&(R.pivotDeepMap=new oe),c.set(u,R)}zp(c,u,d,h,g,i,a,s,f,r)}l||zp(c,u,d,h,g,i,a,s,f,r),a&&ya(h,g,a,p,u),u.length=0}a&&(c.visitDepthFirst((g,b,h,y)=>{ei(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:T},C,I,w)=>{ei(a,T,S),w?.()}),y?.()}),ei(a,p,e));let m={deepMap:c,groupParams:n,initialData:e,reducerResults:p};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:o.map(g=>g.field).join(", ")}]}),m}function Kp(n){let{groupParams:e,deepMap:t}=n,o=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===o){let l=t.get(a).items;i.push(...l)}return i},r),r}function YS(n,e){let{groupBy:t,groupKeys:o,parents:r,reducers:i,lazyLoad:a}=n,l=o.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,f=d??null,p;if(Object.keys(c).length>0){f={...d},p={};for(let y in i)if(i.hasOwnProperty(y)){let T=i[y].field;T&&(p[T]=c[y]),T&&f[T]==null&&(f[T]=c[y])}}let m=!0,g=o[o.length-1],b=g;if(f!=null){let y=t[o.length-1];y&&y.field&&(b=f[y.field]),y&&y.toKey&&(b=y.toKey(b,f)),b=b??g}return typeof b=="string"&&b.startsWith(Vp)&&(m=!1,b=null),{data:f,reducerData:p,groupCount:s.length,groupData:s,groupKeys:o,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${o}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:Bo,hasSelectedCells:Bo,selfLoaded:m,error:n.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:n.totalChildrenCount,childrenAvailable:a?n.childrenAvailable:!0,childrenLoading:n.childrenLoading,indexInParentGroups:n.indexInParentGroups,indexInGroup:n.indexInGroup,indexInAll:n.indexInAll,directChildrenCount:n.directChildrenCount,directChildrenLoadedCount:a?n.directChildrenLoadedCount:n.directChildrenCount,value:b,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function Sa(n,e,t){return{...n,id:`duplicate_row_on_page_${t}_for__${n.id}`,indexInAll:e,duplicateOf:n.id}}function ei(n,e,t){if(n){for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];r.done&&(e[o]=r.done(e[o],t))}}return e}function Bp(n,e,t,o,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:f,withRowInfo:p,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:b,rowsPerPage:h}=r,{deepMap:y}=u,S=n.length,T=t[t.length-1],C=T?T.nodeExpanded:!0;for(let I=0;I<S;I++){let w=n[I],v=c(w,I),x=[...e,v];if(l(w)){let O={id:v,nodePath:x,isGroupRow:!1,data:w,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Bo,hasSelectedCells:Bo,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...o,I],indexInParent:I,indexInAll:C?i.length:-1};f&&(O.rowSelected=f(O)),d&&(O.rowDisabled=d(O)),p&&p(O);let L=b&&h!=null&&h>0&&O.indexInAll%h===0?O.indexInAll/h:null;for(let V=0,z=t.length;V<z;V++){let G=t[V];if(C||(G.collapsedLeafNodesCount+=1),G.deepRowInfoArray.push(O),L!=null&&C){if(typeof b=="function"&&b(G)!==!0)continue;let E=Sa(G,O.indexInAll,L);i[E.indexInAll]=E,O.indexInAll++}}C&&(i[O.indexInAll]=O);continue}let A=y.get(x)?.totalLeafNodesCount??0,M={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:x,id:v,data:w,indexInAll:i.length,indexInParent:I,indexInParentNodes:[...o,I],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:Bo,hasSelectedCells:Bo,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(f&&(M.rowSelected=f(M),g)){let O=g.getSelectionCountFor(M.nodePath);M.selectedLeafNodesCount=O.selectedCount,M.deselectedLeafNodesCount=O.deselectedCount}d&&(M.rowDisabled=d(M)),p&&p(M);let D=!0;if(m&&(M.selfExpanded=D=m(M)),C||(D=!1),M.nodeExpanded=D,C&&b&&h!=null&&h>0){let O=M.indexInAll,L=M.parentNodes;if(L.length>0&&O%h===0){let V=O/h,z=0;L.forEach(G=>{typeof b=="function"&&b(G)!==!0||(i.push(Sa(G,O+z,V)),z++,M.indexInAll++)})}}C&&(i[M.indexInAll]=M);let _=s(w);Array.isArray(_)&&Bp(_,x,[...t,M],M.indexInParentNodes,r,i)}return i}function Wp(n){let{dataArray:e,marker:t}=n;t&&t.start();let o=[];return Bp(e,[],[],[],n,o),t&&t.end(),{data:o}}function jp(n){let{marker:e,lazyLoad:t,groupResult:o,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:f,reducers:p={}}=n,{groupParams:m,deepMap:g,pivot:b}=o,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(I=>I.field).join(", ")}]});let y=[],S=[],T=[],C=[];return g.visitDepthFirst((I,w,v,x)=>{let R=I.items,P=w.length,A=s?.isGroupRowCollapsed(w)??!1;C.push(v);let M=YS({lazyLoad:t,groupBy:h,parents:Array.from(T),reducers:p,indexInGroup:v,indexInParentGroups:Array.from(C),indexInAll:y.length,groupKeys:w,error:I.error,totalChildrenCount:I.totalChildrenCount,childrenLoading:(I.childrenLoading||!A&&!I.childrenAvailable)&&t,childrenAvailable:I.childrenAvailable,directChildrenCount:w.length===h.length?I.items.length:g.getDirectChildrenSizeFor(w),directChildrenLoadedCount:0},I);if(u&&(M.rowSelected=u(M),d)){let V=d.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=V.selectedCount,M.deselectedChildredCount=V.deselectedCount}c&&(M.rowDisabled=c(M));let D=T[T.length-1],_=D?.collapsed??!1;_&&(A=!0),M.collapsed=A;let O=f||A;if(_&&(O=!1),O){if(i&&r!=null&&r>0){let V=M.indexInAll,z=M.parents;if(z.length>0&&V%r===0){let G=V/r,E=0;z.forEach(F=>{typeof i=="function"&&i(F)!==!0||(y.push(Sa(F,V+E,G)),E++,M.indexInAll++)})}}y.push(M),S.push(y.length-1)}M.collapsedChildrenCount=0,T.forEach(V=>{V.deepRowInfoArray.push(M),V.collapsedGroupsCount+=A?1:0}),D&&M.selfLoaded&&t&&(D.directChildrenLoadedCount+=1),a&&a(M),T.push(M);let L=!0;if(L){if(x)x();else if(!b){let V=y.length;A||(y.length+=R.length);let z=0;for(let G=0,E=R.length;G<E;G++){let F=R[G];if(!A&&i&&r!=null&&r>0){let ie=V+G+z;if(ie%r===0){let ge=ie/r;T.forEach(be=>{if(typeof i=="function"&&i(be)!==!0)return;let ae=V+G+z;y[ae]=Sa(be,ae,ge),z++,y.length++})}}let X=V+G+z,Y={id:F?l(F,X):`${w}-${G}`,data:F,isCellSelected:Bo,hasSelectedCells:Bo,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!F,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:A,groupKeys:w,parents:Array.from(T),indexInParentGroups:[...C,G],indexInGroup:G,indexInAll:X,groupBy:h,groupNesting:P+1,groupCount:M.groupCount};u&&(Y.rowSelected=u(Y)),c&&(Y.rowDisabled=c(Y)),a&&a(Y),T.forEach((ie,ge)=>{ge===T.length-1&&F&&(ie.directChildrenLoadedCount+=1),A&&(ie.collapsedChildrenCount+=1),ie.deepRowInfoArray.push(Y)}),A||(y[V+G+z]=Y)}}}T.pop(),C.pop()}),e&&e.end(),{data:y,groupRowsIndexes:S}}var Fm=j(require("react"));var qS=()=>{};function $p(n,e){let t=new oe,o=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of n){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]],f=t.get(d),p=f?f[o]??[]:[];a(d,p),p.length&&(f||(f=typeof r=="function"?r(d,p):r),f[o]=p),s.push(f)}return s}return a([],[])}function Up(n,e,t,o){let{isLeafNode:r,getNodeChildren:i,toKey:a}=n,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(o),d=[...t,u],f=r(o),p=pt(()=>{let m=i(o);if(!(!m||!Array.isArray(m)))for(let g=0,b=m.length;g<b;g++){let h=m[g];Up(n,e,d,h)}});f?(c?.(o),s?.(o,qS)):(l?.(o,p,i(o)),s?.(o,p))}function Yp(n,e,t){for(let o=0,r=t.length;o<r;o++)Up(n,e,[],t[o])}var XS=function(n,e){return n-e},ZS=function(n,e){return n=`${n}`,e=`${e}`,n.localeCompare(e)},QS=function(n,e){return n-e},JS={number:XS,string:ZS,date:QS},ti=JS;function qp(n){return n.map(t=>Array.isArray(t.field)?t.field.map((o,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof o=="function"?{...t,valueGetter:o,field:void 0,type:i}:{...t,type:i,field:o}}):t).flat()}var oo=(n,e,t)=>{let o=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(Xp(qp(n),o)),r&&r.end(),e},Ca=(n,e,t)=>{let{marker:o}=t;o&&o.start();let r=Xp(qp(n),t.get),i=t.depthFirst??!1,a=t.inplace??!1;i||(a?e.sort(r):e=[...e].sort(r));let{nodesKey:l,toKey:s}=t,c=d=>d[l],u=d=>d[l]===void 0;return Yp({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,f,p)=>{if(i&&f(),Array.isArray(p)){let m=a?p.sort(r):[...p].sort(r);d[l]=m}i||f()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),o&&o.end(),e};oo.knownTypes=ti;var eT=n=>{if(!n)return;let e=n.field,t=n.valueGetter,o=n.dir<0?-1:n.dir>0?1:0;if(!o)return;let r=n.fn;if(!r&&n.type){let i=Array.isArray(n.type)?n.type[0]:n.type;r=oo.knownTypes[i],r||console.warn(`Unknown sort type "${n.type}" - please pass one of ${Object.keys(oo.knownTypes).join(", ")}`)}return r||(r=ti.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:o*c}},tT=n=>n.map(eT).filter(e=>e instanceof Function),Xp=(n,e)=>{let t=tT(n);return(o,r)=>{e&&(o=e(o),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(o,r),i!==0))return i;return i}};var Ia=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";o!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(o.map(r=>[r,!0]))):this.negativeMap=new oe(o.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 oe(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 wt=class extends Ia{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)}};var oT=j(require("react"));function wa(n){return _e(e=>n(e.dataSourceState))}function Jn(n,e){return e.reduce((t,o)=>{let{field:r,valueGetter:i,toKey:a}=o,l=r?n[r]:i?.({data:n,field:r}),s=(a||Jr)(l,n);return t.push(s),t},[])}var Oe=class n{constructor(e,t,o){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new oe;this.deselectedMap=new oe;this.onlyUsePrimaryKeys=!1;this.selectionCache=new oe;this.selectionCountCache=new oe;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,o&&Object.assign(this,o),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:o}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Jn(r,o):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let o=this.getGroupDeepMap()?.get(e);return o?o.totalChildrenCount??(o.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 o=t?.get(e);return o?o.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,o){return new n(e,t,o)}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()),o=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:o}}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 o=[...t,e],r=this.selectionCache.get(o);if(r!==void 0)return r;let i=this.selectedMap.has(o),a=this.deselectedMap.has(o);if(i)return this.selectionCache.set(o,!0),!0;if(a)return this.selectionCache.set(o,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(o,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(o,!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(o,!0),!0;if(s)return this.selectionCache.set(o,!1),!1}return this.selectionCache.set(o,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,o){t?this.setRowAsSelected(e,o):this.setRowAsDeselected(e,o)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:o,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=o&&r?null:!!o;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],o=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!o?!0:o&&!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 o=[...t,e];this.deselectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(o),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 o=[...t,e];this.selectedMap.delete(o),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(o),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 o=this.selectionCountCache.get(e);if(o!=null)return o;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(p=>{if(this.defaultSelection){if(this.deselectedMap.has([p])){d++;return}u++}else{if(this.selectedMap.has([p])){u++;return}d++}});let f={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,f),f}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,f=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=u-(d+f),m={selectedCount:d+(c?p:0),deselectedCount:f+(c?0:p)};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),f=u?!0:d?!1:t,{selectedCount:p,deselectedCount:m}=this.getSelectionCountFor(c,f);a+=p,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var nT="*",$e=class{constructor(e){this.wildcard=nT;this.cache=new oe;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,o){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===o)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[f,p]=d;p===t&&l.push([f,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[f]=d;f===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),o)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,o){if(o){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(o){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,o){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(o){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(o){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,o=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)}),o&&o.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 o=this.selectedRowsToColumns.get(e);if(o){if(o.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=>o.has(r)):!1}return!1}error(e){Ro(`${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 o=[e,t],{cache:r}=this,i=r.get(o);if(i!=null)return i;let a=()=>(r.set(o,!1),!1),l=()=>(r.set(o,!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 p=this.selectedRowsToColumns.get(e);return p&&p.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((o,r)=>{o.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((o,r)=>{o.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var rT=Ue("IT:InfiniteTable"),iT="#dc3545",aT="#eb9316";var Qp="Warn",Jp="Error",lT="Info",sT="Success",cT="Logs",Ra=rT.extend(cT),hF=Ra.extend(lT),uT=Ra.extend(Qp),dT=Ra.extend(Jp),bF=Ra.extend(sT);var fT=aT,pT=iT;var mT=(n,e)=>{e=e?e.extend?e.extend(Qp):e:uT,e(typeof e.color=="function"?e.color(fT,n):n)},gT=(n,e)=>{e=e?e.extend?e.extend(Jp):e:dT,e(typeof e.color=="function"?e.color(pT,n):n)};var Zp=new oe,em=(n,...e)=>{Zp.has(e)||(Zp.set(e,!0),n())};var er=(n,e=n,t)=>{em(()=>mT(n,t),e,"warn")},tm=(n,e=n,t)=>{em(()=>gT(n,t),e,"error")};function va(n,e){return new Oe(n,ht(e))}function ht(n){return()=>{let e=typeof n=="function"?n():n;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function om(n){let{getDataSourceState:e,dataSourceActions:t}=n;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 Oe))throw"Invalid row selection";let a=new Oe(r,ht(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 Oe))throw"Invalid row selection";let a=new Oe(r,ht(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 Oe))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Jn(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 Oe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Jn(d,c):[]}let u=new Oe(a,ht(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 Oe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Jn(d,c):[]}let u=new Oe(l,ht(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 Oe))throw"Invalid row selection";let s=new Oe(a,ht(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 Oe))throw"Invalid row selection";let s=new Oe(a,ht(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 Oe))throw"Invalid row selection";let s=new Oe(a,ht(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Oe(i,ht(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Oe))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Oe(r,ht(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 Ws=new WeakMap,hT=n=>n;function nm(n,e=50,t){Ws.set(n,{lastCallTime:0,lastCallArg:null});let o=t??hT;return r=>{let{lastCallTime:i,lastCallArg:a}=Ws.get(n)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=yt(o(a),o(r));s<e&&c||(Ws.set(n,{lastCallTime:l,lastCallArg:r}),n(r))}}var Da=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new oe;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let o=this.nodePathsToData.get(e);if(o){let r=t.getNodeChildren?t.getNodeChildren(o):t.nodesKey?o[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,o)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!o)return;let r=o.getNodeChildren?o.getNodeChildren(t):o.nodesKey?t[o.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,o.toPrimaryKey(l)];this.addNodePath(s,l,o)}};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:o,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;o&&o.shouldResetDataSource()&&(this.clear(),e=[]);let c=o&&!o.isEmpty();if(c&&(e=e.concat()),!e.length&&o){if(!o.isEmpty()){let u=[...o.getMutationsArray(),...o.getTreeMutationsArray()];for(let d=0,f=u.length;d<f;d++){let p=u[d];if(p.type==="insert"){let m=r(p.data);s?this.addNodePath([m],p.data,t):this.add(m,p.data),e.push(p.data)}}o?.removeInfo(void 0)}}else{let u=(d,f)=>{for(let p=0;p<d.length;p++){let m=d[p];c&&s&&Array.isArray(m[l])&&(m=d[p]={...m});let g=!1;if(m!=null){let b=r(m),h=s?[...f,b]:void 0,y=s&&!!h,S=y?o?.getMutationsForNodePath(h):o?.getMutationsForPrimaryKey(b);if(S&&S.length){for(let T=0,C=S.length;T<C;T++){let I=S[T];if(I.type==="delete"&&!g&&(y?this.removeNodePath(h,t):this.remove(b),g=!0,d.splice(p,1),p--),I.type==="update"&&!g&&(m={...m,...I.data},d[p]=m),I.type==="update-children"&&!g){let w=I.children(m[l],m);m={...m},w!==void 0?m[l]=w:delete m[l],d[p]=m}I.type==="insert"&&(I.position==="before"?(d.splice(p,0,I.data),p--):d.splice(p+1,0,I.data))}y?o?.removeNodePathInfo(h):o?.removeInfo(b)}if(!g)if(y){this.addNodePath(h,m);let T=a(m),C=T?null:i(m);!T&&Array.isArray(C)&&(f.push(b),c&&(m[l]=C=C.concat()),u(C,f),f.pop())}else this.add(b,m)}}};u(e,[])}return e}}};var rt=require("react");var Lt=require("react");function yn(n,e){let t=(0,Lt.useRef)({}),o=(0,Lt.useRef)({}),r=o.current,i=(0,Lt.useRef)({}),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,(0,Lt.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function bT(n,e){let t=(0,Lt.useRef)({}),o=(0,Lt.useRef)({}),r=o.current,i=(0,Lt.useRef)({}),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,(0,Lt.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=n(s,r)),i.current={},o.current={},c},l)}function yT(n,e){let t=[];for(let o in e)e.hasOwnProperty(o)&&t.push(e[o]);(0,Lt.useEffect)(n,t)}function js(...n){return(...t)=>{n.forEach(o=>{typeof o=="function"&&o(...t)})}}function $s(n){let{pivotByAtIndex:e,pivotAggregator:t}=n;return e?.column&&(typeof e.column=="function"?Object.assign(n,e.column({column:n})):Object.assign(n,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(n,t.pivotColumn({column:n})):Object.assign(n,t.pivotColumn)),n}function Us(n){let{pivotByAtIndex:e}=n;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(n,e.columnGroup({columnGroup:n})):Object.assign(n,e.columnGroup)),n}function rm({deepMap:n,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:o,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(p=>({...r[p],id:p}));l.length||(i=!0,o=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=pt(function(){l.forEach((p,m)=>{s[`total:${p.id}`]=$s({header:`${p.name||p.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:p,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[p.id]:null})})});(!a&&t==="start"||o==="start")&&u();let d=!i&&l.length===1;return n.visitDepthFirst((p,m,g,b)=>{if(m=[...m],t==="end"&&b?.(),m.length===a){let h=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let T=S;S=m.join("/");let C=m[m.length-1];c[S]=Us({header:`${C}`,columnGroup:T,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:C})}l.forEach((T,C)=>{let I=d?`${m[m.length-1]}`:T.name||T.id,w=$s({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:T,pivotAggregatorIndex:C,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:h,defaultSortable:!1,columnGroup:S,header:I,valueFormatter:({rowInfo:x})=>x.isGroupRow?x.pivotValuesMap?.get(m)?.reducerResults[T.id]:null}),v=`${T.id}:${m.join("/")}`;s[v]=w})}else{let h=m.join("/"),y=m.slice(0,-1);if(c[h]=Us({columnGroup:y.length?y.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],T=y.length?y.join("/"):void 0;if(!d){let C=T;T=`total:${m.join("/")}`,c[T]=Us({header:`${m[m.length-1]} total`,columnGroup:C,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((C,I)=>{let w=d?`${m[m.length-1]} total `:`${C.name||C.id} total`,v=$s({columnGroup:T,header:w,pivotAggregator:C,pivotAggregatorIndex:I,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:x})=>x.isGroupRow?x.pivotValuesMap?.get(m)?.reducerResults[C.id]:null});s[`total:${C.id}:${m.join("/")}`]=v})}}(t==="start"||t===!1)&&b?.()}),(!a&&t==="end"||o==="end")&&u(),{columns:s,columnGroups:c}}var im=Symbol("CLEAR"),Sn=class n{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new oe;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,o)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:o}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,o)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:o}),this.nodePathToData.set(e,r)};this.insert=(e,t,o,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:o,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,o,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:o,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,o,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:o,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,o,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:o,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,o,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:o,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=im,o=this.primaryKeyToData.get(t)||[];o.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,o)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(im);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=()=>oe.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 o=new n({nodesKey:e.nodesKey});return o.allFieldsAffected=e.allFieldsAffected,o.affectedFields=new Set(e.affectedFields),o.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),o.nodePathToData=t?e.nodePathToData:oe.clone(e.nodePathToData),o}};function jo(n,e){return e().dataArray[n]}function xa(n){return n().dataArray}var st=class{constructor(e){this.collapsedPathsMap=new oe;this.expandedPathsMap=new oe;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:o,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)?o.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)?o.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,o=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(o)for(let r=0,i=o.length;r<i;r++)this.collapsedIdsMap.set(o[r],!0)}getState(){if(this._mode==="path"){let o=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:o,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var ST=(n,e)=>n.length-e.length,Je=class n{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new oe;this.cache=new oe;this.strictMode=!1;let o=e instanceof Object.getPrototypeOf(this).constructor,r=o?e.getState():e;this.setConfig(t||(o?e.config:{treePaths:new oe})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Array.isArray(e)?new oe(e.map(t=>[t,!0])):e:this.config.treePaths}withTreePaths(e,t){let o=this.config.treePaths;t=this.getTreePaths(t);let r=t!==o;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=o,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(o=>o.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],o){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},o)}getSelectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&o.push(i.keys)})},t),o}getDeselectedLeafNodePaths(e=[],t){let o=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||o.push(i.keys)})},t),o}isLeafNode(e){let{treePaths:t}=this.config;return t.has(e)?t.getKeysForLeafNodesStartingWith(e).length===1:null}getLeafNodesCount(e){return this.config.treePaths.getKeysForLeafNodesStartingWith(e).length}static from(e,t){return new n(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Array.isArray(t.treePaths)?new oe(t.treePaths.map(o=>[o,!0])):t.treePaths,strictCheckPaths:t.strictCheckPaths??!0},this.xcache()}xcache(){this.cache.clear()}update(e){this.selectedPaths=e.selectedPaths||null,this.deselectedPaths=e.deselectedPaths||null;let{selectionMap:t,selectedPaths:o,deselectedPaths:r}=this;t.clear(),o?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([o,r])=>{r?e.push(o):t.push(o)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}enableStrictMode(){this.strictMode=!0}disableStrictMode(){this.strictMode=!1}isPathAvailable(e){if(!this.strictMode)return!0;let{treePaths:t}=this.config;return t.has(e)}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 o=this.cache.get(e);if(o)return o;if(this.isLeafNode(e)!==!1){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(ST);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let f=r?i:!1;return this.cacheIt(e,{selected:f,selectedCount:f?r:0,deselectedCount:f?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,f=l.length;d<f;d++){let p=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(p);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.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:o}=this;if(!e.length)return t;let r=[...e];do{let i=o.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.xcache(),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:o}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:o}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function Ma(n,e){return new Je(n,tr(e))}function tr(n){return()=>({treePaths:(typeof n=="function"?n():n).treePaths})}var Pa=class{constructor(e){this.setNodeSelection=(e,t,o)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!o?.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 Je))throw"Invalid tree selection";let a=new Je(r,tr(this.getState));a.setNodeSelection(e,t),this.getState().lastSelectionUpdatedNodePathRef.current={nodePath:e,selected:t},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(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;return o?o.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),o=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!o)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(o.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),o=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&o?o(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),o=this.getState().isNodeSelectable;return t&&t.isTreeNode?o(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:o,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!o(a,i);if(o)return o(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new st({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new st({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 o=this.getState(),r=new st(o.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,o.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let o=this.getState(),r=new st(o.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,o.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let o=this.getState(),r=new st(o.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?o.onNodeExpand?.(e,this.getCallbackParam(e)):o.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),o=t.get(e);return o!==void 0?jo(o,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 Je))throw"Invalid node selection";let o=new Je(e,tr(this.getState));o.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Je))throw"Invalid node selection";let o=new Je(e,tr(this.getState));o.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=o}isNodeSelected(e){let{treeSelectionState:t,treeSelection:o,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(o)?treeSelection.join(",")===e.join(","):o===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Je))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 or=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,o=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:o})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:o}=e;if(this.allNegative=o===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(o&&o!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of o)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 Rt=class extends or{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:o}}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,o){return this.setItemValue(t,o)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var Ys=1e3;function am(n){return new qs(n)}var qs=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=()=>xa(this.getState);this.getRowInfoByIndex=e=>jo(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(),o=t.getDataForNodePath(e);return o||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 o=this.getState().isTree,r=o?void 0:e.map(l=>this.toPrimaryKey(l)),i=o?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,o)=>{let r=o?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?Ys:r;return isNaN(a)||(a=Ys),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,o)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,o),o);this.updateChildrenByNodePath_Internal=(e,t,o)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],o)};this.updateDataByNodePath=(e,t,o)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],o),o);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let o=e.map(i=>i.nodePath);return Promise.allSettled(o.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 o=[],r=[];e.forEach(a=>{a.data?o.push(a.data):a.children&&o.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:o,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 o=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),o};this.batchDeletePrimaryKeys=(e,t)=>{let o=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),o};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 o=this.getState().isTree,r="before",i,a=t.nodePath;if(o&&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=o?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,o,r)=>{if(o.length&&!this.isNodePathAvailable(o))return this.withWaitForNode(o,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:o});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 o=this.getState().rowDisabledState,r=o?new Rt(o):new Rt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let o=this.getRowInfoByPrimaryKey(e);o&&this.setRowEnabledAt(o.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Rt({enabledRows:!0,disabledRows:[]});return}let t=new Rt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new Rt({disabledRows:!0,enabledRows:[]});return}let t=new Rt(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 Pa({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(o=>{this.resolvePendingPromise=o});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:o,nodesKey:r}=this.getState(),i=t?Sn.clone(t,{light:!0}):new Sn({nodesKey:o?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let f=a.primaryKeys[d],p=this.getDataByPrimaryKey(f);p&&i.update(a.primaryKeys[d],u,p,a.metadata)}else if(a.nodePaths){let f=this.getDataByNodePath(a.nodePaths[d]);f&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,f,a.metadata):i.updateNodePath(a.nodePaths[d],u,f,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 o=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??Ys,i=o.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=f=>{clearTimeout(d),u=f,o.waitForNodePathPromises.delete(e),c(f)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return o.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 lm(n){let e=n.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,o=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:f,isTree:p}=n;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((b,h)=>b||typeof h!="function"?l.has(h):!1,!1),t))break}if(c&&c.length){if(l===!0)o=!0;else for(let m of c)if(m.field&&l.has(m.field)){o=!0;break}}if(p&&(l===!0?r=!0:r=l.has(f)),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:o,filterValue:i,aggregationReducers:a,tree:r}}function Aa(n){if(!n)return;let e=Object.keys(n);if(!e.length)return;let t={};for(let o=0,r=e.length;o<r;o++){let i=e[o],a=n[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function Ea(n){let e=n.reducerKeys,t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;o[a]=l(o[a],n.rowInfo)}}function _a(n){let e=Object.keys(n.reducers||{});if(!e.length||!n.results)return n.results;let t=n.reducers,o=n.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(o[a]=l(o[a],n.array))}return o}function Zs(n,e){return n&&n.filter(t=>{let o=e[t.filter.type];return!(!o||o.emptyValues&&o.emptyValues.includes(t.filter.value))})}var no=(n,e,t)=>{for(let o=0,r=t.length;o<r;o++){let i=t[o],a=n[i],l=e[i];if(a!==l)return!0}return!1};function Xs(){return!1}function TT(n,e,t,o,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:n,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Xs,hasSelectedCells:Xs};return o&&(a.rowSelected=o(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 CT=pt(()=>{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
|
|
|
@@ -10,21 +10,21 @@ function treeFilterFunction({ data }) {
|
|
|
10
10
|
|
|
11
11
|
Make sure you avoid mutations.
|
|
12
12
|
|
|
13
|
-
`)});function am(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a}=n,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=am({...n,dataArray:u});return d.length===0?!1:(c={...c,[a]:d},c)};for(let c=0,u=e.length;c<u;c++){let d=e[c],f=r(d),p=t({data:d,index:c,dataArray:e,primaryKey:o(d,c),filterTreeNode:s});p&&(p===!0?p=d:typeof p=="object"&&p===d&&f!==r(p)&&hT(),l.push(p))}return l}function Zs(n){let{filterTypes:e,marker:t,operatorsByFilterType:o,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}=n,{dataArray:u}=n;t?.start({details:[{name:"Count before",value:u.length}]}),r&&(u=u.filter((f,p,m)=>r({data:f,index:p,dataArray:m,primaryKey:i(f,p)}))),a&&(u=am({...n,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}));let d=Xs(n.filterValue,e)||[];if(d&&d.length){let f=u.filter((p,m,g)=>{let b={data:p,index:m,dataArray:g,primaryKey:i(p,m),field:void 0};for(let h=0,y=d.length;h<y;h++){let S=d[h],{disabled:T,field:C,valueGetter:w,filter:{type:I,value:v,operator:x}}=S,R=e[I];if(T||!R)continue;let P=o[I]?.[x];if(!P)continue;let M=w||R.valueGetter||(({data:_,field:O})=>O?_[O]:_);b.field=C;let D=b;if(D.filterValue=v,D.currentValue=M(D),D.emptyValues=R.emptyValues,!P.fn(D))return!1}return!0});return t?.end({details:[{name:"Count after",value:f.length}]}),f}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function lm(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=nt(r).track.DataSource.label.PrepareData.start());let a=im(t),l=t.sortInfo,s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=no(o,t,["refetchKey"]),d=no(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new oe,d=!0);let p=t.cache?Sn.clone(t.cache):void 0;p&&!p.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,b=t.isTree,h=g?J=>J[g]:void 0,y=g?J=>J[g]===void 0:void 0,S,T;d&&(t.indexer.clear(),t.lazyLoad||(S=p?.getMutations(),T=p?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:p,getNodeChildren:h,isLeafNode:y,nodesKey:g}),b&&t.waitForNodePathPromises.visit(({value:J},fe)=>{J&&t.indexer.getDataForNodePath(fe)!==void 0&&J.resolve(!0)}))),p&&(p.clear(),t.cache=void 0);let{filterFunction:w,treeFilterFunction:I,filterValue:v,filterTypes:x,operatorsByFilterType:R}=t,P=!!w||!!I||Array.isArray(v)&&v.length,A=P&&t.filterMode==="local",M=no(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=d||M,_=no(o,t,["sortInfo"]),O=d||M||_,L=t.filterMode==="local"&&(D||!t.lastFilterDataArray),V=c&&(O||!t.lastSortDataArray||a.sortInfo),z=t.groupBy,G=t.pivotBy,E=!b&&(z.length>0||!!G),F=b,X=no(o,t,["rowDisabledState","isRowDisabled"]),B=no(o,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),Y=no(o,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),re=d||O||no(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),ge=d||O||no(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),be=no(o,t,["rowInfoReducers"]),ae=E&&(re||!t.lastGroupDataArray||a.groupBy)||B||X||be,de=F&&(ge||a.tree||!t.lastTreeDataArray)||Y||X||be,pe=Date.now(),q=t.originalDataArray;if(F&&de){let J={marker:r?nt(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=Ks(J,q).treePaths}if(P||(t.unfilteredCount=q.length),A){t.unfilteredCount=q.length;let J=pe;L?(t.devToolsDetected&&(J=Date.now()),q=Zs({marker:r?nt(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:y,nodesKey:g,treeFilterFunction:I,dataArray:q,toPrimaryKey:m,filterTypes:x,operatorsByFilterType:R,filterFunction:w,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-J)):q=t.lastFilterDataArray,t.lastFilterDataArray=q,t.filteredAt=pe}if(t.filteredCount=q.length,t.postFilterDataArray=q,c){let J=oo.knownTypes;if(oo.knownTypes={...J,...t.sortTypes},V){let fe=pe;if(t.devToolsDetected&&(fe=Date.now()),r&&(e=nt(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:q.length}]})),t.sortFunction?(q=t.sortFunction(l,[...q]),e&&(e.end(),e=void 0)):b?q=Ca(l,q,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:h,toKey:m,nodesKey:g}):q=oo(l,[...q],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let me=Date.now()-fe;t.debugTimings.set("sort",me)}}else q=t.lastSortDataArray;oo.knownTypes=J,t.lastSortDataArray=q,t.sortedAt=pe}t.postSortDataArray=q;let k=t.dataArray,U=t.rowSelection instanceof _e?t.rowSelection:void 0,K=t.treeExpandState instanceof st?t.treeExpandState:void 0,Z=t.cellSelection instanceof $e?t.cellSelection:void 0;U?.xcache();let ne=t.selectionMode==="single-row"?J=>J.id===t.rowSelection:t.selectionMode==="multi-row"?J=>{let fe=U;return J.isGroupRow?fe.getGroupRowSelectionState(J.groupKeys):fe.isRowSelected(J.id,J.dataSourceHasGrouping?J.groupKeys:void 0)}:void 0,H=t.isRowDisabled||qs;t.isRowSelected&&t.selectionMode==="multi-row"&&(ne=J=>t.isRowSelected(J,U,t.selectionMode));let ce;t.isNodeExpanded&&(ce=J=>t.isNodeExpanded(J,K)),t.isNodeCollapsed&&(ce=J=>!t.isNodeExpanded(J,K)),ce||(ce=fe=>K.isNodeExpanded(fe.nodePath));let N=t.rowInfoReducers;if(E){if(ae){let J=pe;t.devToolsDetected&&(J=Date.now());let fe=t.aggregationReducers,me=t.lazyLoad?zp({groupBy:z,pivot:G,mappings:t.pivotMappings,reducers:fe,indexer:t.indexer,toPrimaryKey:m,cache:p,marker:r?nt(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):Ta({groupBy:z,pivot:G,reducers:fe,marker:r?nt(r).track.DataSource.label.Group.start():void 0},q);t.groupDeepMap=me.deepMap,U&&(U.getConfig=ht(t));let Me=Object.keys(N||{}),Ae=Aa(N),Ge={reducers:N,results:Ae,reducerKeys:Me,rowInfo:{}},Ne=Ae?ot=>{Ge.rowInfo=ot,Ea(Ge)}:void 0,Le=Z?ot=>{ot.isCellSelected=$=>Z.isCellSelected(ot.id,$)}:void 0,We=Ne||Le?Ws(Ne,Le):void 0,et=Bp({marker:r?nt(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:me,lazyLoad:!!t.lazyLoad,reducers:fe,toPrimaryKey:m,isRowSelected:ne,rowSelectionState:U,withRowInfo:We,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});k=et.data,t.rowInfoReducerResults=_a({reducers:N,results:Ae,array:k}),t.groupRowsIndexesInDataArray=et.groupRowsIndexes,t.reducerResults=me.reducerResults;let tt=G?om({deepMap:me.topLevelPivotColumns,pivotBy:G,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=tt?.columns,t.pivotColumnGroups=tt?.columnGroups,t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-J)}else k=t.lastGroupDataArray;t.lastGroupDataArray=k,t.groupedAt=pe}else if(F){if(de){let J=pe;t.devToolsDetected&&(J=Date.now());let fe=t.aggregationReducers,me={marker:r?nt(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m,reducers:fe},Me=Ks(me,q);t.treeDeepMap=Me.deepMap,t.treePaths=Me.treePaths;let Ae=t.selectionMode==="multi-row"?sm(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Ae;let Ge=Object.keys(N||{}),Ne=Aa(N),Le={reducers:N,results:Ne,reducerKeys:Ge,rowInfo:{}},We=Ne?ue=>{Le.rowInfo=ue,Ea(Le)}:void 0,et=Z?ue=>{ue.isCellSelected=Se=>Z.isCellSelected(ue.id,Se)}:void 0,tt=We||et?Ws(We,et):void 0,ot=t.selectionMode==="single-row"?ue=>ue.id===t.treeSelection:t.selectionMode==="multi-row"?ue=>Ae.isNodeSelected(ue.nodePath):void 0,$=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;k=Kp({marker:r?nt(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Me,treeParams:me,dataArray:q,reducers:fe,toPrimaryKey:m,isNodeSelected:ot,isNodeExpanded:ce,treeSelectionState:Ae,withRowInfo:tt,repeatWrappedGroupRows:$,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=_a({reducers:N,results:Ne,array:k}),t.reducerResults=Me.reducerResults,t.totalLeafNodesCount=Me.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=pe,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-J)}else k=t.lastTreeDataArray;t.lastTreeDataArray=k}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||re||B||X||be){let fe=Object.keys(N||{}),me=Aa(N),Me={reducers:N,results:me,reducerKeys:fe,rowInfo:{}};k=q.map((Ae,Ge)=>{let Ne=gT(Ae,Ae?m(Ae):Ge,Ge,ne,H,Z);return me&&(Me.rowInfo=Ne,Ea(Me)),Ne}),t.rowInfoReducerResults=_a({reducers:N,results:me,array:k})}if(t.postGroupDataArray=k,k!==t.dataArray&&(t.updatedAt=pe),t.dataArray=k,t.reducedAt=pe,t.selectionMode==="multi-row")if(E&&t.lazyLoad){r&&(e=nt(r).track.DataSource.label.ComputeSelectionCountLazy.start());let J=!0,fe=!1;t.dataArray.forEach(me=>{if(!me.isTreeNode&&me.isGroupRow&&me.groupKeys.length===1){let{rowSelected:Me}=me;Me!==!0&&(J=!1),(Me===!0||Me===null)&&(fe=!0)}}),t.allRowsSelected=J,t.someRowsSelected=fe,r&&(e?.end(),e=void 0)}else{r&&(e=nt(r).track.DataSource.label.ComputeSelectionCount.start());let J=t.isTree?t.totalLeafNodesCount:t.filteredCount,fe=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=J===fe,t.someRowsSelected=fe>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:pe,mutations:S?.size?S:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(k,{marker:r?nt(r).track.DataSource.label.DiffRowInfoInStore:void 0}),i&&i?.track.DataSource.label.PrepareData.end({details:[L||V||ae||de?{name:"Performed operations",value:[L?"filter":null,V?"sort":null,ae?"group":null,de?"tree":null].filter(Po).join(", ")}:null,u?{name:"Refetch key",value:`Old ${o.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(Po)}),t}function Bt(){let n=De().performance?.now();return`${Date.now()}:${n}`}function bT(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
|
|
13
|
+
`)});function sm(n){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:o,getNodeChildren:r,isLeafNode:i,nodesKey:a}=n,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=sm({...n,dataArray:u});return d.length===0?!1:(c={...c,[a]:d},c)};for(let c=0,u=e.length;c<u;c++){let d=e[c],f=r(d),p=t({data:d,index:c,dataArray:e,primaryKey:o(d,c),filterTreeNode:s});p&&(p===!0?p=d:typeof p=="object"&&p===d&&f!==r(p)&&CT(),l.push(p))}return l}function Qs(n){let{filterTypes:e,marker:t,operatorsByFilterType:o,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}=n,{dataArray:u}=n;t?.start({details:[{name:"Count before",value:u.length}]}),r&&(u=u.filter((f,p,m)=>r({data:f,index:p,dataArray:m,primaryKey:i(f,p)}))),a&&(u=sm({...n,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}));let d=Zs(n.filterValue,e)||[];if(d&&d.length){let f=u.filter((p,m,g)=>{let b={data:p,index:m,dataArray:g,primaryKey:i(p,m),field:void 0};for(let h=0,y=d.length;h<y;h++){let S=d[h],{disabled:T,field:C,valueGetter:I,filter:{type:w,value:v,operator:x}}=S,R=e[w];if(T||!R)continue;let P=o[w]?.[x];if(!P)continue;let M=I||R.valueGetter||(({data:_,field:O})=>O?_[O]:_);b.field=C;let D=b;if(D.filterValue=v,D.currentValue=M(D),D.emptyValues=R.emptyValues,!P.fn(D))return!1}return!0});return t?.end({details:[{name:"Count after",value:f.length}]}),f}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function cm(n){let e,{state:t,previousState:o}=n,r=t.debugId,i;r&&(i=nt(r).track.DataSource.label.PrepareData.start());let a=lm(t),l=t.sortInfo,s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=no(o,t,["refetchKey"]),d=no(o,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new oe,d=!0);let p=t.cache?Sn.clone(t.cache):void 0;p&&!p.isEmpty()&&(d=!0);let m=t.toPrimaryKey,g=t.nodesKey,b=t.isTree,h=g?J=>J[g]:void 0,y=g?J=>J[g]===void 0:void 0,S,T;d&&(t.indexer.clear(),t.lazyLoad||(S=p?.getMutations(),T=p?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:p,getNodeChildren:h,isLeafNode:y,nodesKey:g}),b&&t.waitForNodePathPromises.visit(({value:J},fe)=>{J&&t.indexer.getDataForNodePath(fe)!==void 0&&J.resolve(!0)}))),p&&(p.clear(),t.cache=void 0);let{filterFunction:I,treeFilterFunction:w,filterValue:v,filterTypes:x,operatorsByFilterType:R}=t,P=!!I||!!w||Array.isArray(v)&&v.length,A=P&&t.filterMode==="local",M=no(o,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=d||M,_=no(o,t,["sortInfo"]),O=d||M||_,L=t.filterMode==="local"&&(D||!t.lastFilterDataArray),V=c&&(O||!t.lastSortDataArray||a.sortInfo),z=t.groupBy,G=t.pivotBy,E=!b&&(z.length>0||!!G),F=b,X=no(o,t,["rowDisabledState","isRowDisabled"]),B=no(o,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),Y=no(o,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ie=d||O||no(o,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),ge=d||O||no(o,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),be=no(o,t,["rowInfoReducers"]),ae=E&&(ie||!t.lastGroupDataArray||a.groupBy)||B||X||be,de=F&&(ge||a.tree||!t.lastTreeDataArray)||Y||X||be,pe=Date.now(),q=t.originalDataArray;if(F&&de){let J={marker:r?nt(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=Bs(J,q).treePaths}if(P||(t.unfilteredCount=q.length),A){t.unfilteredCount=q.length;let J=pe;L?(t.devToolsDetected&&(J=Date.now()),q=Qs({marker:r?nt(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:y,nodesKey:g,treeFilterFunction:w,dataArray:q,toPrimaryKey:m,filterTypes:x,operatorsByFilterType:R,filterFunction:I,filterValue:v}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-J)):q=t.lastFilterDataArray,t.lastFilterDataArray=q,t.filteredAt=pe}if(t.filteredCount=q.length,t.postFilterDataArray=q,c){let J=oo.knownTypes;if(oo.knownTypes={...J,...t.sortTypes},V){let fe=pe;if(t.devToolsDetected&&(fe=Date.now()),r&&(e=nt(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:q.length}]})),t.sortFunction?(q=t.sortFunction(l,[...q]),e&&(e.end(),e=void 0)):b?q=Ca(l,q,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:h,toKey:m,nodesKey:g}):q=oo(l,[...q],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let me=Date.now()-fe;t.debugTimings.set("sort",me)}}else q=t.lastSortDataArray;oo.knownTypes=J,t.lastSortDataArray=q,t.sortedAt=pe}t.postSortDataArray=q;let k=t.dataArray,U=t.rowSelection instanceof Oe?t.rowSelection:void 0,K=t.treeExpandState instanceof st?t.treeExpandState:void 0,Z=t.cellSelection instanceof $e?t.cellSelection:void 0;U?.xcache();let ne=t.selectionMode==="single-row"?J=>J.id===t.rowSelection:t.selectionMode==="multi-row"?J=>{let fe=U;return J.isGroupRow?fe.getGroupRowSelectionState(J.groupKeys):fe.isRowSelected(J.id,J.dataSourceHasGrouping?J.groupKeys:void 0)}:void 0,H=t.isRowDisabled||Xs;t.isRowSelected&&t.selectionMode==="multi-row"&&(ne=J=>t.isRowSelected(J,U,t.selectionMode));let ce;t.isNodeExpanded&&(ce=J=>t.isNodeExpanded(J,K)),t.isNodeCollapsed&&(ce=J=>!t.isNodeExpanded(J,K)),ce||(ce=fe=>K.isNodeExpanded(fe.nodePath));let N=t.rowInfoReducers;if(E){if(ae){let J=pe;t.devToolsDetected&&(J=Date.now());let fe=t.aggregationReducers,me=t.lazyLoad?Gp({groupBy:z,pivot:G,mappings:t.pivotMappings,reducers:fe,indexer:t.indexer,toPrimaryKey:m,cache:p,marker:r?nt(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):Ta({groupBy:z,pivot:G,reducers:fe,marker:r?nt(r).track.DataSource.label.Group.start():void 0},q);t.groupDeepMap=me.deepMap,U&&(U.getConfig=ht(t));let Me=Object.keys(N||{}),Ae=Aa(N),Ge={reducers:N,results:Ae,reducerKeys:Me,rowInfo:{}},Ne=Ae?ot=>{Ge.rowInfo=ot,Ea(Ge)}:void 0,Le=Z?ot=>{ot.isCellSelected=$=>Z.isCellSelected(ot.id,$)}:void 0,We=Ne||Le?js(Ne,Le):void 0,et=jp({marker:r?nt(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:me,lazyLoad:!!t.lazyLoad,reducers:fe,toPrimaryKey:m,isRowSelected:ne,rowSelectionState:U,withRowInfo:We,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});k=et.data,t.rowInfoReducerResults=_a({reducers:N,results:Ae,array:k}),t.groupRowsIndexesInDataArray=et.groupRowsIndexes,t.reducerResults=me.reducerResults;let tt=G?rm({deepMap:me.topLevelPivotColumns,pivotBy:G,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=tt?.columns,t.pivotColumnGroups=tt?.columnGroups,t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-J)}else k=t.lastGroupDataArray;t.lastGroupDataArray=k,t.groupedAt=pe}else if(F){if(de){let J=pe;t.devToolsDetected&&(J=Date.now());let fe=t.aggregationReducers,me={marker:r?nt(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m,reducers:fe},Me=Bs(me,q);t.treeDeepMap=Me.deepMap,t.treePaths=Me.treePaths;let Ae=t.selectionMode==="multi-row"?um(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=Ae;let Ge=Object.keys(N||{}),Ne=Aa(N),Le={reducers:N,results:Ne,reducerKeys:Ge,rowInfo:{}},We=Ne?ue=>{Le.rowInfo=ue,Ea(Le)}:void 0,et=Z?ue=>{ue.isCellSelected=Se=>Z.isCellSelected(ue.id,Se)}:void 0,tt=We||et?js(We,et):void 0,ot=t.selectionMode==="single-row"?ue=>ue.id===t.treeSelection:t.selectionMode==="multi-row"?ue=>Ae.isNodeSelected(ue.nodePath):void 0,$=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;k=Wp({marker:r?nt(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:Me,treeParams:me,dataArray:q,reducers:fe,toPrimaryKey:m,isNodeSelected:ot,isNodeExpanded:ce,treeSelectionState:Ae,withRowInfo:tt,repeatWrappedGroupRows:$,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=_a({reducers:N,results:Ne,array:k}),t.reducerResults=Me.reducerResults,t.totalLeafNodesCount=Me.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=pe,t.devToolsDetected&&t.debugTimings.set("tree",Date.now()-J)}else k=t.lastTreeDataArray;t.lastTreeDataArray=k}else if(t.groupDeepMap=void 0,t.pivotColumns=void 0,t.groupRowsIndexesInDataArray=void 0,o.postSortDataArray!=t.postSortDataArray||ie||B||X||be){let fe=Object.keys(N||{}),me=Aa(N),Me={reducers:N,results:me,reducerKeys:fe,rowInfo:{}};k=q.map((Ae,Ge)=>{let Ne=TT(Ae,Ae?m(Ae):Ge,Ge,ne,H,Z);return me&&(Me.rowInfo=Ne,Ea(Me)),Ne}),t.rowInfoReducerResults=_a({reducers:N,results:me,array:k})}if(t.postGroupDataArray=k,k!==t.dataArray&&(t.updatedAt=pe),t.dataArray=k,t.reducedAt=pe,t.selectionMode==="multi-row")if(E&&t.lazyLoad){r&&(e=nt(r).track.DataSource.label.ComputeSelectionCountLazy.start());let J=!0,fe=!1;t.dataArray.forEach(me=>{if(!me.isTreeNode&&me.isGroupRow&&me.groupKeys.length===1){let{rowSelected:Me}=me;Me!==!0&&(J=!1),(Me===!0||Me===null)&&(fe=!0)}}),t.allRowsSelected=J,t.someRowsSelected=fe,r&&(e?.end(),e=void 0)}else{r&&(e=nt(r).track.DataSource.label.ComputeSelectionCount.start());let J=t.isTree?t.totalLeafNodesCount:t.filteredCount,fe=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=J===fe,t.someRowsSelected=fe>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:pe,mutations:S?.size?S:void 0,treeMutations:T?.size?T:void 0}),t.rowInfoStore.notifyDataArray(k,{marker:r?nt(r).track.DataSource.label.DiffRowInfoInStore:void 0}),i&&i?.track.DataSource.label.PrepareData.end({details:[L||V||ae||de?{name:"Performed operations",value:[L?"filter":null,V?"sort":null,ae?"group":null,de?"tree":null].filter(Po).join(", ")}:null,u?{name:"Refetch key",value:`Old ${o.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(Po)}),t}function Bt(){let n=De().performance?.now();return`${Date.now()}:${n}`}function IT(n,e,t){return e=e.replaceAll("$ERR_CODE",n),e=`${e}
|
|
14
14
|
|
|
15
15
|
ERROR_CODE = ${n}
|
|
16
16
|
|
|
17
|
-
See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function
|
|
18
|
-
Make sure you don't pass a new reference on every render.`}),
|
|
17
|
+
See http://infinite-table.com/docs/reference/error-codes#${n} for more info.`,{code:n,message:e,type:t??"error"}}function dm(n){return Object.entries(n).reduce((e,[t,o])=>{let r=t,i=IT(r,typeof o=="string"?o:o.message,typeof o=="string"?void 0:o.type);return e[r]=i,e},{})}function wT(n){return{message:n.join(""),type:"warning"}}function RT(n){return{message:n.join(""),type:"error"}}var vT=dm({DS001:wT`The "data" prop of your DataSource seems to be updating too frequently.
|
|
18
|
+
Make sure you don't pass a new reference on every render.`}),DT=dm({CSS001_CSS:RT`It appears you have not loaded the CSS file for InfiniteTable.
|
|
19
19
|
In most environments, you should be able to fix this by adding the following line:
|
|
20
20
|
|
|
21
21
|
import '@infinite-table/infinite-react/index.css'
|
|
22
|
-
`}),
|
|
22
|
+
`}),fm={...vT,...DT};var yo=new Map,So=new Map,$o=new Map,To=new Map;var kt=new Map,pm=n=>{kt.delete(n),$o.delete(n),yo.delete(n),To.delete(n),So.delete(n)};function Js(n,e,t){let o=kt.get(n);if(!o)return;let r=$o.get(n);(!r||!Object.hasOwn(r,e))&&$o.set(n,{...r||{},[e]:o.getState()[e]}),yo.set(n,{...yo.get(n)||{},[e]:t}),o.actions[e]=t}function Oa(n,e,t){let o=kt.get(n);if(!o)return;let r=To.get(n);(!r||!Object.hasOwn(r,e))&&To.set(n,{...r||{},[e]:o.getDataSourceState()[e]}),So.set(n,{...So.get(n)||{},[e]:t}),o.dataSourceActions[e]=t}var xT=n=>{let e=n.type==="error"?Ro(n.debugId):Ot(n.debugId),t=n.type==="error"?tm:er,o=n.debugId?`${n.code}-${n.debugId}`:n.code,r=n.message;n.debugId&&(r=`${r}
|
|
23
23
|
|
|
24
|
-
Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},ti=n=>{let{debugId:e,key:t}=n,o=um[t];if(o&&(wT({...o,debugId:e}),e&&t)){let r=kt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),oi(e))}};globalThis.logDevToolsWarning=ti;var oi=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=kt.get(n);t&&e(n,t)};var fm=!0,IT=()=>new Promise(n=>{Ve(n)}),RT={originalDataArray:!0,changes:!0},vT={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function Co(n,e,t){let o=n.multiSort?n.sortInfo:n.sortInfo?.[0]??null,r={append:!1,originalDataArray:n.originalDataArray,sortInfo:o,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(r.livePaginationCursor=n.livePaginationCursor,r.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=n.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=mm(r.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=n.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!RT[l]){let s=l,c=vT[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function Tn(n,e,t,o,r){let i=Co(e,o,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[Wo,...i.groupKeys||[]],u=s.get(c);if(!u){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(u&&u.cache&&c.length>1){let d=u.children,f=d.length,p=!0;for(let m=0;m<f;m++)if(d[m]==null){p=!1;break}if(p)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:fm,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Bt()}typeof n=="function"&&(n=n(i));let l=typeof n=="object"&&typeof n.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(n).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let f=s;if(c=f.data,f.livePaginationCursor!==void 0&&(t.livePaginationCursor=f.livePaginationCursor),f.mappings&&(t.pivotMappings=f.mappings),f.totalCountUnfiltered&&(t.unfilteredCount=f.totalCountUnfiltered),e.lazyLoad){let m=function(g,b,h){let y=[Wo,...g],S=b.data,T={cache:b.cache??fm,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??S.length,totalCountUnfiltered:b.totalCount??S.length,children:S,error:b.error},C=[];if(i.lazyLoadBatchSize&&!h){let I=p.get(y),v=!I,x=Ju({children:!0},I||{},T);v&&(x.chidren=[]),x.children.length=x.totalCount;let R=i.lazyLoadStartIndex??0,P=Math.min(b.totalCount??S.length,R+i.lazyLoadBatchSize);for(let A=R;A<P;A++){let M=T.children[A-R];if(!M)throw`lazily loaded item not found at index ${A-R}`;x.children[A]=M,M.dataset&&C.push({keys:M.keys,dataset:M.dataset})}v&&p.set(y,x)}else T.children.forEach(I=>{I&&I.dataset&&C.push({keys:I.keys,dataset:I.dataset})}),T.children.length=T.totalCount,p.set(y,T);let w=!1;if(!g||!g.length){let I=p.get([Wo]);t.originalDataArray=[...I.children],w=!0}if(w||(t.originalLazyGroupDataChangeDetect=Bt()),C.length){let I=g;C.forEach(({keys:v,dataset:x})=>{m(v,x,I)})}};var d=m;let p=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],f)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function mm(n,{filterTypes:e,filterMode:t}){return t==="local"?n:(Xs(n,e)||[]).map(o=>{let r={...o};return delete r.valueGetter,r})}function pm(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function gm(n){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:f,filterMode:p,livePagination:m,livePaginationCursor:g,filterTypes:b,cursorId:h}=o,[y,S]=(0,rt.useState)({vertical:!1,horizontal:!1}),T=(0,rt.useRef)(y);(0,rt.useEffect)(()=>(a.onChange(R=>{R&&(T.current=R,S(R))}),()=>a.destroy()),[a]),(0,rt.useEffect)(()=>{if(!m)return;let R=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(R)},[g]),(0,rt.useEffect)(()=>{if(!m||g!==void 0)return;let R=requestAnimationFrame(()=>{T.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(R)},[i.length,g]),(0,rt.useEffect)(()=>{let R=e(),{livePaginationCursor:P,livePagination:A,dataArray:M}=R;!y.vertical&&A&&(P?t.cursorId=P:P===void 0&&M.length&&(t.cursorId=M.length))},[y.vertical]);let C=(0,rt.useMemo)(()=>mm(f,{filterTypes:b,filterMode:p}),[f,p,b]),w={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?C:null,cursorId:m?h:null},I=(0,rt.useRef)(!0);DT(n,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:f,refetchKey:l,cursorId:m?h:null});let v=Si(),x=(0,rt.useRef)([]);yn(()=>{let R=e(),P=v(),{isDetail:A,isDetailReady:M}=pm(P,e);if(A&&!M)return;let D=Date.now(),_=x.current;_.length>=10&&_.splice(0,1),_.push(D),D-_[0]<200&&_.length>=10&&ti({debugId:R.debugId,key:"DS001"}),typeof R.data!="function"&&Tn(R.data,R,t,void 0,P)},{data:r}),yn(R=>{let P=Object.keys(R),A=!1;if(P.length===1){if(A=!!R.cursorId,R.filterValue&&e().filterMode==="local")return;let L=e().data;if(Array.isArray(L)&&R.refetchKey){t.originalDataArray=L;return}}let M=v(),{isDetail:D,isDetailReady:_}=pm(M,e);if(D&&!_)return;let O=e();if(typeof O.data=="function"){let L;O.debugId&&(L=nt(O.debugId).track.DataSource.label.RemoteDataLoad.start()),Tn(O.data,O,t,{append:A},M).then(()=>{L?.end()})}},{...w,data:r}),yn(()=>{let R=e();if(I.current){I.current=!1;let P=Co(R,void 0,v());t.dataParams=P}},w)}function DT(n,e){let{getDataSourceState:t,dataSourceActions:o,dataSourceState:r}=n;(0,rt.useEffect)(()=>{o.lazyLoadCacheOfLoadedBatches=new oe},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,f=(0,rt.useRef)(null),p=(g,b,h=t().lazyLoadCacheOfLoadedBatches)=>{let y=t();if(g=g||f.current,!g)return;let{renderStartIndex:S,renderEndIndex:T}=g,{lazyLoadBatchSize:C,lazyLoad:w}=y;w&&((!C||C<=0)&&(!y.groupBy||y.groupBy.length===0)||xT({startIndex:S,endIndex:T,lazyLoadBatchSize:C,componentState:y,componentActions:o,dismissLoadedRows:b?.dismissLoadedRows??!1},h))},m=(0,rt.useMemo)(()=>_t(p,{wait:d}),[d]);yn(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),p(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&p(s.get()),s.onChange(b=>{f.current=b,p(b)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:u}),(0,rt.useEffect)(()=>{i&&i>0&&m()},[c])}function xT(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new oe,f=["_______xxx______"];for(let g=t;g<=o;g++){let b=s[g];if(!b)continue;let h=c(g),y=b.dataSourceHasGrouping&&b.groupKeys?[...b.groupKeys]:[];b.isGroupRow&&b.dataSourceHasGrouping&&b.groupKeys&&y.pop();let S=y.length?y:f,T=b.dataSourceHasGrouping?b.indexInGroup:b.indexInAll;if(b.isGroupRow&&!b.collapsed&&!b.childrenAvailable){let C={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:b.groupKeys,append:u},w=b.groupKeys,I=d.get(w);if(!I?.[b.id]){let v=!I;I=I||{},I[b.id]||(I[b.id]=C),v&&d.set(w,I)}}if(!h&&r!=null){let C=d.get(S),w=Math.floor(T/r)*r,I=T-w,v=s[b.indexInAll-I].indexInAll,x=c(v),R=s[v].id;if(x||C?.[R])continue;let P=!C;C=C||{};let A={lazyLoadStartIndex:w,lazyLoadBatchSize:r,groupKeys:y,append:u};C[R]||(C[R]=A),P&&d.set(S,C)}}let p=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,b)=>{let h=[...b.groupKeys,b.lazyLoadStartIndex];if(e&&e.has(h))return g;e?.set(h,!0);let y=[i.data,i,a,b];return g.then(()=>IT()).then(()=>Tn(...y))},p)}var PT=Object.freeze([]),hm=(n,e)=>{let t=n??PT,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};function Fa(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0,o=n.length;t<o;t++)if(!Fa(n[t],e[t]))return!1;return!0}if(typeof n=="object"){let t=Object.keys(n),o=Object.keys(e);if(t.length!==o.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Fa(n[r],e[r]))return!1;return!0}return!1}function MT(n,e){return!(n===void 0||e===void 0||n.isGroupRow!==e.isGroupRow||n.dataSourceHasGrouping!==e.dataSourceHasGrouping||n.isTreeNode!==e.isTreeNode||n.isTreeNode&&n.isParentNode!==e.isParentNode)}var Na={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},bm={...Na,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},AT={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},ET={...Na,...AT,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},ym={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},_T={...Na,...ym,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},OT={...Na,...ym,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},FT=Object.entries(bm).map(([n,e])=>e?n:void 0).filter(Boolean),NT=Object.entries(bm).map(([n,e])=>e?n:void 0),LT=Object.entries(ET).map(([n,e])=>e?n:void 0),kT=Object.entries(_T).map(([n,e])=>e?n:void 0),zT=Object.entries(OT).map(([n,e])=>e?n:void 0);function VT(n,e){if(n===e)return!0;if(!n||!e||!MT(n,e)||n.id!==e.id||n.data!==e.data&&!Fa(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?LT:NT:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?zT:kT:t=FT;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!Fa(r,i))return!1}return!0}function Sm(){let n=[],e=new Map,t=(s,c)=>{let u=n,d=c?.marker;d&&d.start({details:[{name:"new dataArray length",value:s.length},{name:"old dataArray length",value:u.length}]});let f=[],p=i();for(let m of p){let g=u[m],b=s[m];if(b===void 0){f.push(m);continue}VT(g,b)||f.push(m)}n=s,f.length>0&&queueMicrotask(()=>{for(let m=0,g=f.length;m<g;m++){let b=f[m],h=e.get(b);if(h)for(let y of h)y()}}),d&&d.end({details:[{name:"updated row infos",value:f.length}]})},o=s=>n[s],r=(s,c)=>{let u=e.get(s);return u||(u=new Set,e.set(s,u)),u.add(c),()=>{let d=e.get(s);d&&(d.delete(c),d.size===0&&e.delete(s))}},i=()=>Array.from(e.keys());return{notifyDataArray:t,getRowInfoAtIndex:o,subscribeToRowIndex:r,getDataArray:()=>n,clear:()=>{n=[],e.clear()}}}var GT=Symbol("cursorId"),Tm=n=>n.totalLeafNodesCount===0,HT=n=>n.isParentNode?!Tm(n):!0;function Cm(n){let e=Date.now(),t=[],o=[],r=new oe;return{logger:Ot(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Sm(),indexer:new Da,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new oe,waitForNodePathPromises:new oe,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new oe,dataParams:void 0,onCleanup:Te(),notifyScrollbarsChange:Te(),notifyScrollStop:Te(),notifyRenderRangeChange:Te(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:GT,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function KT(n){let e={...n};return delete e.originalDataArray,e}var BT=[],wm=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.unfilteredTreePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear(),n.rowInfoStore.clear()},Im=(n,e)=>({onDataParamsChange:t=>t?tm(t,100,KT):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Tm,isNodeSelectable:t=>t??HT,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({...Oo,...t}),sortTypes:t=>({...ei,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof It)return t;let o=n.propsCache.get("rowDisabledState")??Wt,r=o.get(t);return r||(r=new It(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>hm(t,n.propsCache.get("sortInfo")),groupBy:t=>t??BT});function WT(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}var Wt=new WeakMap;function jT(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var $T={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function sm(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
24
|
+
Component DEBUG_ID = "${n.debugId}"`),t(r,o,e)},oi=n=>{let{debugId:e,key:t}=n,o=fm[t];if(o&&(xT({...o,debugId:e}),e&&t)){let r=kt.get(e);r&&r.getState().devToolsDetected&&o&&(r.getState().debugWarnings.set(t,{...o,debugId:e,status:"new"}),ni(e))}};globalThis.logDevToolsWarning=oi;var ni=n=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=kt.get(n);t&&e(n,t)};var mm=!0,PT=()=>new Promise(n=>{Ve(n)}),MT={originalDataArray:!0,changes:!0},AT={filterValue:(n,e)=>JSON.stringify(n)===JSON.stringify(e),groupRowsState:(n,e)=>JSON.stringify(n)===JSON.stringify(e)};function Co(n,e,t){let o=n.multiSort?n.sortInfo:n.sortInfo?.[0]??null,r={append:!1,originalDataArray:n.originalDataArray,sortInfo:o,refetchKey:n.refetchKey,groupBy:n.groupBy,pivotBy:n.pivotBy,filterValue:n.filterValue,aggregationReducers:n.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=n.groupRowsState.getState()),n.livePagination!==void 0&&(r.livePaginationCursor=n.livePaginationCursor,r.__cursorId=n.cursorId),n.lazyLoad&&(n.lazyLoadBatchSize!=null&&n.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=n.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=hm(r.filterValue,{filterMode:n.filterMode,filterTypes:n.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=n.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!MT[l]){let s=l,c=AT[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function Tn(n,e,t,o,r){let i=Co(e,o,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[Wo,...i.groupKeys||[]],u=s.get(c);if(!u){let d=[...i.groupKeys||[],i.lazyLoadStartIndex];e.lazyLoadCacheOfLoadedBatches.set(d,!0)}if(u&&u.cache&&c.length>1){let d=u.children,f=d.length,p=!0;for(let m=0;m<f;m++)if(d[m]==null){p=!1;break}if(p)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:mm,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Bt()}typeof n=="function"&&(n=n(i));let l=typeof n=="object"&&typeof n.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(n).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let f=s;if(c=f.data,f.livePaginationCursor!==void 0&&(t.livePaginationCursor=f.livePaginationCursor),f.mappings&&(t.pivotMappings=f.mappings),f.totalCountUnfiltered&&(t.unfilteredCount=f.totalCountUnfiltered),e.lazyLoad){let m=function(g,b,h){let y=[Wo,...g],S=b.data,T={cache:b.cache??mm,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??S.length,totalCountUnfiltered:b.totalCount??S.length,children:S,error:b.error},C=[];if(i.lazyLoadBatchSize&&!h){let w=p.get(y),v=!w,x=ed({children:!0},w||{},T);v&&(x.chidren=[]),x.children.length=x.totalCount;let R=i.lazyLoadStartIndex??0,P=Math.min(b.totalCount??S.length,R+i.lazyLoadBatchSize);for(let A=R;A<P;A++){let M=T.children[A-R];if(!M)throw`lazily loaded item not found at index ${A-R}`;x.children[A]=M,M.dataset&&C.push({keys:M.keys,dataset:M.dataset})}v&&p.set(y,x)}else T.children.forEach(w=>{w&&w.dataset&&C.push({keys:w.keys,dataset:w.dataset})}),T.children.length=T.totalCount,p.set(y,T);let I=!1;if(!g||!g.length){let w=p.get([Wo]);t.originalDataArray=[...w.children],I=!0}if(I||(t.originalLazyGroupDataChangeDetect=Bt()),C.length){let w=g;C.forEach(({keys:v,dataset:x})=>{m(v,x,w)})}};var d=m;let p=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],f)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function hm(n,{filterTypes:e,filterMode:t}){return t==="local"?n:(Zs(n,e)||[]).map(o=>{let r={...o};return delete r.valueGetter,r})}function gm(n,e){let t=!!n,{stateReadyAsDetails:o}=e(),r=t&&n.shouldRestoreState?o:!0;return{isDetail:t,isDetailReady:r}}function bm(n){let{getDataSourceState:e,dataSourceActions:t,dataSourceState:o}=n,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:f,filterMode:p,livePagination:m,livePaginationCursor:g,filterTypes:b,cursorId:h}=o,[y,S]=(0,rt.useState)({vertical:!1,horizontal:!1}),T=(0,rt.useRef)(y);(0,rt.useEffect)(()=>(a.onChange(R=>{R&&(T.current=R,S(R))}),()=>a.destroy()),[a]),(0,rt.useEffect)(()=>{if(!m)return;let R=requestAnimationFrame(()=>{T.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(R)},[g]),(0,rt.useEffect)(()=>{if(!m||g!==void 0)return;let R=requestAnimationFrame(()=>{T.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(R)},[i.length,g]),(0,rt.useEffect)(()=>{let R=e(),{livePaginationCursor:P,livePagination:A,dataArray:M}=R;!y.vertical&&A&&(P?t.cursorId=P:P===void 0&&M.length&&(t.cursorId=M.length))},[y.vertical]);let C=(0,rt.useMemo)(()=>hm(f,{filterTypes:b,filterMode:p}),[f,p,b]),I={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?C:null,cursorId:m?h:null},w=(0,rt.useRef)(!0);ET(n,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:f,refetchKey:l,cursorId:m?h:null});let v=Ti(),x=(0,rt.useRef)([]);yn(()=>{let R=e(),P=v(),{isDetail:A,isDetailReady:M}=gm(P,e);if(A&&!M)return;let D=Date.now(),_=x.current;_.length>=10&&_.splice(0,1),_.push(D),D-_[0]<200&&_.length>=10&&oi({debugId:R.debugId,key:"DS001"}),typeof R.data!="function"&&Tn(R.data,R,t,void 0,P)},{data:r}),yn(R=>{let P=Object.keys(R),A=!1;if(P.length===1){if(A=!!R.cursorId,R.filterValue&&e().filterMode==="local")return;let L=e().data;if(Array.isArray(L)&&R.refetchKey){t.originalDataArray=L;return}}let M=v(),{isDetail:D,isDetailReady:_}=gm(M,e);if(D&&!_)return;let O=e();if(typeof O.data=="function"){let L;O.debugId&&(L=nt(O.debugId).track.DataSource.label.RemoteDataLoad.start()),Tn(O.data,O,t,{append:A},M).then(()=>{L?.end()})}},{...I,data:r}),yn(()=>{let R=e();if(w.current){w.current=!1;let P=Co(R,void 0,v());t.dataParams=P}},I)}function ET(n,e){let{getDataSourceState:t,dataSourceActions:o,dataSourceState:r}=n;(0,rt.useEffect)(()=>{o.lazyLoadCacheOfLoadedBatches=new oe},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,f=(0,rt.useRef)(null),p=(g,b,h=t().lazyLoadCacheOfLoadedBatches)=>{let y=t();if(g=g||f.current,!g)return;let{renderStartIndex:S,renderEndIndex:T}=g,{lazyLoadBatchSize:C,lazyLoad:I}=y;I&&((!C||C<=0)&&(!y.groupBy||y.groupBy.length===0)||_T({startIndex:S,endIndex:T,lazyLoadBatchSize:C,componentState:y,componentActions:o,dismissLoadedRows:b?.dismissLoadedRows??!1},h))},m=(0,rt.useMemo)(()=>_t(p,{wait:d}),[d]);yn(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),p(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&p(s.get()),s.onChange(b=>{f.current=b,p(b)})},{sortInfo:e.sortInfo,filterValue:e.filterValue,groupBy:e.groupBy,pivotBy:e.pivotBy,refetchKey:e.refetchKey,cursorId:e.cursorId,lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,groupRowsState:u}),(0,rt.useEffect)(()=>{i&&i>0&&m()},[c])}function _T(n,e){let{startIndex:t,endIndex:o,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=n,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new oe,f=["_______xxx______"];for(let g=t;g<=o;g++){let b=s[g];if(!b)continue;let h=c(g),y=b.dataSourceHasGrouping&&b.groupKeys?[...b.groupKeys]:[];b.isGroupRow&&b.dataSourceHasGrouping&&b.groupKeys&&y.pop();let S=y.length?y:f,T=b.dataSourceHasGrouping?b.indexInGroup:b.indexInAll;if(b.isGroupRow&&!b.collapsed&&!b.childrenAvailable){let C={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:b.groupKeys,append:u},I=b.groupKeys,w=d.get(I);if(!w?.[b.id]){let v=!w;w=w||{},w[b.id]||(w[b.id]=C),v&&d.set(I,w)}}if(!h&&r!=null){let C=d.get(S),I=Math.floor(T/r)*r,w=T-I,v=s[b.indexInAll-w].indexInAll,x=c(v),R=s[v].id;if(x||C?.[R])continue;let P=!C;C=C||{};let A={lazyLoadStartIndex:I,lazyLoadBatchSize:r,groupKeys:y,append:u};C[R]||(C[R]=A),P&&d.set(S,C)}}let p=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,b)=>{let h=[...b.groupKeys,b.lazyLoadStartIndex];if(e&&e.has(h))return g;e?.set(h,!0);let y=[i.data,i,a,b];return g.then(()=>PT()).then(()=>Tn(...y))},p)}var OT=Object.freeze([]),ym=(n,e)=>{let t=n??OT,o=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===o.length)return r}return e&&t&&e.set(t,o),o};function Fa(n,e){if(n===e)return!0;if(n==null||e==null)return n===e;if(typeof n!=typeof e)return!1;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0,o=n.length;t<o;t++)if(!Fa(n[t],e[t]))return!1;return!0}if(typeof n=="object"){let t=Object.keys(n),o=Object.keys(e);if(t.length!==o.length)return!1;for(let r of t)if(!Object.prototype.hasOwnProperty.call(e,r)||!Fa(n[r],e[r]))return!1;return!0}return!1}function FT(n,e){return!(n===void 0||e===void 0||n.isGroupRow!==e.isGroupRow||n.dataSourceHasGrouping!==e.dataSourceHasGrouping||n.isTreeNode!==e.isTreeNode||n.isTreeNode&&n.isParentNode!==e.isParentNode)}var Na={id:!0,value:!0,indexInAll:!0,rowSelected:!0,rowDisabled:!0,isCellSelected:!1,hasSelectedCells:!1},Sm={...Na,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,isGroupRow:!0,selfLoaded:!0},NT={indexInGroup:!0,groupKeys:!0,groupBy:!0,rootGroupBy:!0,parents:!1,indexInParentGroups:!0,groupCount:!0,groupNesting:!0,collapsed:!0,selfLoaded:!0},LT={...Na,...NT,dataSourceHasGrouping:!0,isTreeNode:!0,data:!1,reducerData:!0,isGroupRow:!0,duplicateOf:!1,deepRowInfoArray:!1,error:!0,reducerResults:!0,groupCount:!0,groupData:!0,selectedChildredCount:!0,deselectedChildredCount:!0,totalChildrenCount:!0,collapsedChildrenCount:!0,collapsedGroupsCount:!0,directChildrenCount:!0,directChildrenLoadedCount:!0,pivotValuesMap:!0,childrenAvailable:!0,childrenLoading:!0},Tm={isTreeNode:!0,isParentNode:!0,indexInParent:!0,nodePath:!0,parentNodes:!1,indexInParentNodes:!0,totalLeafNodesCount:!0,collapsedLeafNodesCount:!0,treeNesting:!0,selfLoaded:!0},kT={...Na,...Tm,dataSourceHasGrouping:!0,isTreeNode:!0,isGroupRow:!0,isParentNode:!0,data:!1},zT={...Na,...Tm,dataSourceHasGrouping:!0,isParentNode:!0,isGroupRow:!0,nodeExpanded:!0,selfExpanded:!0,data:!1,selectedLeafNodesCount:!0,deepRowInfoArray:!1,deselectedLeafNodesCount:!0,duplicateOf:!1},VT=Object.entries(Sm).map(([n,e])=>e?n:void 0).filter(Boolean),GT=Object.entries(Sm).map(([n,e])=>e?n:void 0),HT=Object.entries(LT).map(([n,e])=>e?n:void 0),KT=Object.entries(kT).map(([n,e])=>e?n:void 0),BT=Object.entries(zT).map(([n,e])=>e?n:void 0);function WT(n,e){if(n===e)return!0;if(!n||!e||!FT(n,e)||n.id!==e.id||n.data!==e.data&&!Fa(n.data,e.data))return!1;let t=[];n.dataSourceHasGrouping?t=n.isGroupRow?HT:GT:n.isTreeNode?t=n.isTreeNode&&n.isParentNode?BT:KT:t=VT;for(let o of t){let r=n[o],i=e[o];if(!(typeof r=="function"||typeof i=="function")&&!Fa(r,i))return!1}return!0}function Cm(){let n=[],e=new Map,t=(s,c)=>{let u=n,d=c?.marker;d&&d.start({details:[{name:"new dataArray length",value:s.length},{name:"old dataArray length",value:u.length}]});let f=[],p=i();for(let m of p){let g=u[m],b=s[m];if(b===void 0){f.push(m);continue}WT(g,b)||f.push(m)}n=s,f.length>0&&queueMicrotask(()=>{for(let m=0,g=f.length;m<g;m++){let b=f[m],h=e.get(b);if(h)for(let y of h)y()}}),d&&d.end({details:[{name:"updated row infos",value:f.length}]})},o=s=>n[s],r=(s,c)=>{let u=e.get(s);return u||(u=new Set,e.set(s,u)),u.add(c),()=>{let d=e.get(s);d&&(d.delete(c),d.size===0&&e.delete(s))}},i=()=>Array.from(e.keys());return{notifyDataArray:t,getRowInfoAtIndex:o,subscribeToRowIndex:r,getDataArray:()=>n,clear:()=>{n=[],e.clear()}}}var jT=Symbol("cursorId"),Im=n=>n.totalLeafNodesCount===0,$T=n=>n.isParentNode?!Im(n):!0;function wm(n){let e=Date.now(),t=[],o=[],r=new oe;return{logger:Ot(`${n.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,rowInfoStore:Cm(),indexer:new Da,totalLeafNodesCount:0,__apiRef:{current:null},repeatWrappedGroupRows:!1,destroyedRef:{current:!1},lastSelectionUpdatedNodePathRef:{current:null},lastExpandStateInfoRef:{current:{state:"collapsed",nodePath:null}},idToIndexMap:new Map,idToPathMap:new Map,pathToIndexMap:new oe,waitForNodePathPromises:new oe,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new oe,dataParams:void 0,onCleanup:Te(),notifyScrollbarsChange:Te(),notifyScrollStop:Te(),notifyRenderRangeChange:Te(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:jT,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:o,unfilteredCount:o.length,filteredCount:o.length,updatedAt:e,groupedAt:0,sortedAt:0,treeAt:0,filteredAt:0,reducedAt:e,generateGroupRows:!0,groupDeepMap:void 0,reducerResults:void 0,allRowsSelected:!1,someRowsSelected:!1,postSortDataArray:void 0,postGroupDataArray:void 0,lastSortDataArray:void 0,lastGroupDataArray:void 0,forceRerenderTimestamp:0}}function UT(n){let e={...n};return delete e.originalDataArray,e}var YT=[],Rm=n=>{n.destroyedRef.current=!0,n.__apiRef.current=null,n.lastSelectionUpdatedNodePathRef.current=null,n.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},n.treeExpandState?.destroy(),n.treePaths?.clear(),n.unfilteredTreePaths?.clear(),n.waitForNodePathPromises.clear(),n.pathToIndexMap?.clear(),n.rowDisabledState?.destroy(),n.groupRowsState?.destroy(),n.treeSelectionState?.destroy(),n.idToPathMap.clear(),n.idToIndexMap.clear(),n.rowInfoStore.clear()},vm=(n,e)=>({onDataParamsChange:t=>t?nm(t,100,UT):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Im,isNodeSelectable:t=>t??$T,data:1,nodesKey:1,isNodeExpanded:1,isNodeCollapsed:1,pivotBy:1,primaryKey:1,livePagination:1,treeSelection:1,refetchKey:t=>t??"",filterFunction:1,treeFilterFunction:1,filterValue:1,useGroupKeysForMultiRowSelection:t=>t??!1,filterDelay:t=>t??200,filterTypes:t=>({...Oo,...t}),sortTypes:t=>({...ti,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,o)=>{let r={initialValue:()=>{o.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&o.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),o.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{o.idToPathMap.clear(),o.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(o.idToPathMap.set(s.id,s.nodePath),e.debugId&&o.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),o.pathToIndexMap.set(s.nodePath,s.indexInAll))}};i.__pathToIndex=a}return i},onNodeCollapse:1,onNodeExpand:1,batchOperationDelay:1,isRowSelected:1,isNodeSelected:1,isRowDisabled:1,rowDisabledState:t=>{if(!t)return null;if(t instanceof Rt)return t;let o=n.propsCache.get("rowDisabledState")??Wt,r=o.get(t);return r||(r=new Rt(t),o.set(t,r)),t=r,t??null},onDataArrayChange:1,onDataMutations:1,onTreeDataMutations:1,aggregationReducers:1,collapseGroupRowsOnDataFunctionChange:t=>t??!0,loading:t=>t??!1,sortInfo:t=>ym(t,n.propsCache.get("sortInfo")),groupBy:t=>t??YT});function qT(n,e){return typeof n=="function"?n({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):n}var Wt=new WeakMap;function XT(n){if(typeof n=="boolean")return{filterValue:n,sortInfo:n,groupBy:n,pivotBy:n};let e={};return n.filterValue!=null&&(e.filterValue=n.filterValue),n.sortInfo!=null&&(e.sortInfo=n.sortInfo),n.groupBy!=null&&(e.groupBy=n.groupBy),n.pivotBy!=null&&(e.pivotBy=n.pivotBy),e}var ZT={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function um(n,e,t){if(e!="multi-row")throw new Error(`TreeSelectionState is only supported for multi-row selection. Your current selection mode is "${e}". See https://infinite-table.com/docs/reference/datasource-props#selectionMode for details.
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
`);let o=tr(t);if(n instanceof Je)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??$T,i=Wt.get(r);return i&&i.setConfig(o),i=i??new Je(r,o),Wt.set(r,i),i}function Rm(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=Dr(e.sortInfo),a=Dr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,_)=>{let O=l[_].operators;D[_]=D[_]||{};let L=D[_];return O.forEach(V=>{L[V.name]=V}),D},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let D=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(D!==void 0&&(D&&typeof D=="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,f=null,p=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")&&(p===null?d=u==="single-row"?null:new _e({selectedRows:[],deselectedRows:[],defaultSelection:!1},ht(t)):u==="single-row"||p instanceof _e?d=p:d=new _e(p,ht(t))),u==="single-cell"||u==="multi-cell"))if(m===null)f=u==="single-cell"?null:new $e;else if(m instanceof $e)f=m;else{let D=Wt.get(m)??new $e(m);Wt.set(m,D),f=D}let g=t.primaryKey,b=typeof g=="function"?D=>g(D):D=>D[g],h=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(h&&!(h instanceof st)){let D=Wt.get(h)??new st(h);Wt.set(h,D),h=D}h=h||new st({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof wt)){let D=Wt.get(y)??new wt(y);Wt.set(y,D),y=D}y=y||new wt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=jT(e.shouldReloadData||{}),T=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),C=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,w=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&er('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&er('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&er('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let I=typeof e.data=="function"?T??"local":"local",v=e.sortFunction?"local":C??(i?"remote":"local"),x=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":w??(typeof e.data=="function"?"remote":"local"),R=S.pivotBy?"remote":"local",P=t.rowDisabledState,A=e.isRowDisabled;if(!A&&P){let D=Wt.get(P);D?A=D:(A=_=>P.isRowDisabled(_.id),Wt.set(P,A))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:h,treeExpandMode:h.mode,shouldReloadData:{filterValue:S?.filterValue??x==="remote",sortInfo:S?.sortInfo??v==="remote",groupBy:S?.groupBy??I==="remote",pivotBy:S?.pivotBy??R==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:f,groupMode:I,sortMode:v,filterMode:x,pivotMode:R,toPrimaryKey:b,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 D=!o||o.originalDataArray!==t.originalDataArray,_=typeof e.livePaginationCursor=="function"?D?WT(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=_}if(t.devToolsDetected&&t.debugId){let D=So.get(t.debugId);D&&(M={...M,...D})}return M}var UT=Ot("DataSource:fullLazyLoad");function vm(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&UT('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new wt({collapsedRows:!0,expandedRows:[]})))}function Dm(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[n,{selectionMode:"single-row"}]};let t=e.__apiRef.current,o=t.treeApi;return{callbackParams:[n.getState(),{treeSelectionState:n,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:o}]}},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof $e?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function xm(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>yt(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Ot(Ho(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function Pm(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}var ct=j(require("react"));function Mm(){return Do()}function nr(n){let e=xo(),t=Si(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=Js(n),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Oe(s),[d]=(0,ct.useState)(()=>rm({getState:u,actions:l})),f={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},p=Oe(i),m=Oe(f),g=ks(),b=(0,ct.useCallback)(({children:h})=>{let y=ba(),[S]=(0,ct.useState)(()=>Mm());typeof h=="function"&&(h=h(u()));let T=m();return S.setSnapshot(T),(0,ct.useLayoutEffect)(()=>{S.notify()}),ct.default.createElement(a.Provider,{key:r,value:p()},ct.default.createElement(g.Provider,{value:T},ct.default.createElement(y.Provider,{value:S},h)))},[a,o,r]);return(0,ct.useLayoutEffect)(()=>{let h=t();h&&h.registerDetail(f)},[]),(0,ct.useLayoutEffect)(()=>()=>{let h=u();h.onCleanup(h)},[]),gm({dataSourceState:s,dataSourceActions:l,getDataSourceState:u}),(0,ct.useEffect)(()=>{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]),(0,ct.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:b,state:f.dataSourceState}}var Pt=class extends or{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}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,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var ka=class ka{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??ka.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.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}};ka.DEFAULT_SIZE=10;var La=ka;var ec=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},za=class{constructor(e){this.storage=new La(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)}},tc=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 ec:e===!0?new tc:typeof e=="number"?new za(e):new za(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 Am=(e=>(e.INIT="INIT",e))(Am||{});var{useManagedComponent:Js}=Ft({debugName:"DataSource",initSetupState:Cm,forwardProps:Im,concludeReducer:lm,mapPropsToState:Rm,onPropChange:vm,cleanup:wm,interceptActions:xm(),mappedCallbacks:Dm()});function YT(n){let{DataSource:e}=nr(n);return Em.createElement(e,null,n.children??null)}function qT(){let{rowInfoReducerResults:n}=Fe(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function oc(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(p,m){let g=l[c+p*m],b=a.get(g);if(b&&b.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,f;for(;!f&&u<l.length&&(u++,f=s(u,d),f||(d*=-1,f=s(u,d)),!f););return f&&(o.columnMenuVisibleForColumnId=f),f}function Va(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function nc(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function _m(n,e,t){if(nc(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/o),f=Math.floor(c/o),p=l%o,m=c%o,g=Math.min(p,m),b=Math.max(p,m),h=[];for(let y=d;y<=f;y++)for(let S=g;S<=b;S++){let T=y*o+S;if(y===d)for(let C=s;C<r;C++)h.push({rowIndex:T,colIndex:C});else if(y===f)for(let C=0;C<=u;C++)h.push({rowIndex:T,colIndex:C});else for(let C=0;C<r;C++)h.push({rowIndex:T,colIndex:C})}return h}function XT(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var rc=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??jo(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new $e(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),f=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!f)return;let p=d.computedVisibleIndex,m=f.computedVisibleIndex,g=jo(l,this.getDataSourceState),b=jo(c,this.getDataSourceState);if(!g||!b)return;let h=g.indexInAll,y=b.indexInAll,[S,T]=Va({rowIndex:h,colIndex:p},{rowIndex:y,colIndex:m});for(let C=S.rowIndex;C<=T.rowIndex;C++)for(let w=S.colIndex;w<=T.colIndex;w++){let I={rowIndex:C,colIndex:w},[v,x]=this.getCellSelectionPosition(I);o?a.selectCell(v,x):a.deselectCell(v,x)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=xa(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(f=>{this.isCellSelected({rowId:d.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=XT(Array.from(a),i),u=l.map(d=>c.map(f=>this.isCellSelected({rowId:d.id,colId:f})?e(d,f):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 o=new $e(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new $e(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new $e:new $e(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new $e(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new $e(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new $e(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Om(n){return new rc(n)}function Fm(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new Pt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new Pt({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 Pt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.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 Pt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Uo(n,e,t){return Math.min(Math.max(n,e),t)}function Ga(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Uo(a,r,i)}function ZT(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:f}=u;if(f==null)return!1;let{start:[p],end:[m]}=d.getRenderRange(),g=f,b=m-p-1,h=0,y=c-1,S={ArrowDown:()=>{f=Ga(o,f,1)},ArrowUp:()=>{f=Ga(o,f,-1)},ArrowLeft:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;f-w>=h?f=f-w:S.ArrowUp();return}return C&&C.isGroupRow?i.collapseGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.collapseRowDetail(C.id):!1},ArrowRight:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let w=d.rowsPerPage;f+w<=y?f=f+w:S.ArrowDown();return}return C&&C.isGroupRow?i.expandGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.expandRowDetail(C.id):!1},Enter:()=>{let C=s[f];return C&&C.isGroupRow?i.toggleGroupRow(C.groupKeys):C&&C.isTreeNode&&C.isParentNode?a.treeApi.toggleNode(C.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.toggleRowDetail(C.id):!1},PageDown:()=>{f=Math.min(f+b,c-1)},PageUp:()=>{f=Math.max(f-b,h)},End:()=>{f=y},Home:()=>{f=h}},T=S[l];return T?(T(),g!==f?(r.activeRowIndex=f,!0):!1):!1}function ic(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,c=i().dataArray,u=o(),{activeCellIndex:d,brain:f}=u;if(!d)return!1;let[p,m]=d,{start:[g,b],end:[h,y]}=f.getRenderRange(),S=h-g-1,T=y-b-1,C=i().dataArray.length-1,w=r().computedVisibleColumns.length-1,I=0,v=0;p=Uo(p,0,C),m=Uo(m,0,w);let x={ArrowDown:()=>{p=Uo(p+1,I,C)},ArrowUp:()=>{p=Uo(p-1,I,C)},ArrowLeft:()=>{if(m===v)if(p!==I&&(m=w),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p-P>=I?p=p-P:x.ArrowUp()}else x.ArrowUp();else m=Uo(m-1,v,w)},ArrowRight:()=>{if(m===w)if(p!==C&&(m=v),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p+P<=C?p=p+P:x.ArrowDown()}else x.ArrowDown();else m=Uo(m+1,v,w)},Enter:()=>{let P=c[p];return P&&P.isGroupRow?t.toggleGroupRow(P.groupKeys):P&&P.isTreeNode&&P.isParentNode?a.treeApi.toggleNode(P.nodePath):P&&t.rowDetailApi.isRowDetailEnabledForRow(P.id)?t.rowDetailApi.toggleRowDetail(P.id):!1},PageDown:()=>{s?m=Math.min(m+T,w):p=Math.min(p+S,C)},PageUp:()=>{s?m=Math.max(m-T,v):p=Math.max(p-S,I)},End:()=>{s?m=w:p=C},Home:()=>{s?m=v:p=I}},R=x[l];return R?(R(),[p,m]):!1}function QT(n,e){let t=ic(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var JT={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function Nm(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!JT[t]?!1:i!=null&&l==="row"?ZT(n,e):a!=null&&l==="cell"?QT(n,e):!1}var ac=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:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Ga(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,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=ic(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Lm(n){return new ac(n)}function km(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var lc=class{constructor(e){this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();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(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=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={...Dt({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;o.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,f=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(f)}),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:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;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({...Dt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(d).then(f=>{if(f===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,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:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{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(Dt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>gt(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:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),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 f=this,{isRowDetailEnabled:p}=a(),m=!p||typeof p=="function"&&!p(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=Bn({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:f},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 o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new wt(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(),o=new wt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[Wo,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||Tn(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=oe.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Bt())}};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,o={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){o=o||{};let g=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,f=r.brain.scrollTopMax;if(d<0&&f<0)return!0;let p=c.scrollLeft>d+(o.offset||0),m=c.scrollTop>f+(o.offset||0);return p&&m?!1:(c.scrollLeft!==u.scrollLeft&&!p&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=em({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Lm({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Fm({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Om({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},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(oc(t),e?.()),setTimeout(()=>{this.isDestroyed()||(oc(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??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],f=i??ff({column:u,rowInfo:d}),p=f;u.getValueToEdit&&(f=await u.getValueToEdit(Dt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:f,initialValue:p,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){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,o);return}let l=i.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(p=>p.valueGetter?m=>p.valueGetter({data:m,field:p.field}):p.field?p.field:p.groupField??void 0).filter(Po);u.length&&(s=u);let d=i.computedSortType;c.length&&d===Nn&&(d=c.flatMap(m=>{let g=m.field??m.groupField,b=g?r.get(g):null;return b?b.computedSortType:Nn}));let f={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(f.valueGetter=p=>i.valueGetter({data:p,field:i.field})),this.setSortInfoForColumn(e,f,o)}setSortInfoForColumn(e,t,o){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=>!km(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:km(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 o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;o.computedFilterValue?(u={...o.computedFilterValue,filter:{...o.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:o.valueGetter},o.field&&(u.field=o.field)),u.id=o.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.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 o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],c=o.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,f=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:f}}}return a}).filter(Po),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}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&&(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&&(t.scrollerDOMRef.current.scrollTop=Math.max(e,0))}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=o.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&(o.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(o.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),c=o.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(o.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function zm(n){return new lc(n)}var Cn=require("react");var eC=10;function tC(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${cn} > .${ds}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${an}`);if(t===!1&&d)return;let f=u.getAttribute("data-column-id"),p=c.cloneNode(!0);p.style.visibility="hidden",p.style.pointerEvents="none",p.classList.remove(...qt.split(" ")),p.style.position="absolute",p.style.width="auto",u.appendChild(p);let m=p.offsetWidth;if(u.removeChild(p),!s[f]){let g=De().getComputedStyle(u);s[f]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+eC}if(m+=s[f],d){let g=0;u.childNodes.forEach(b=>{if(b!==c){let h=b,y=Math.max(h.offsetWidth,parseInt(h.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let S=De().getComputedStyle(h);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(f)||o&&!o.has(f)||(l[f]=Math.max(m,l[f]||0))}),l}function Vm(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=Nt(),[a,l]=(0,Cn.useState)(0),s=typeof r=="object"?r.key:r,c=Oe(s),u=(0,Cn.useRef)(null);(0,Cn.useEffect)(()=>{if(c()==null)return;let{current:f}=u,p=()=>{r!==f&&l(a+1)};return i.onRenderRangeChange(p)},[i]),(0,Cn.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),f,p,m=!0;typeof d=="object"&&(d.columnsToResize&&(f=new Set(d.columnsToResize)),d.columnsToSkip&&(p=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=tC(t,{includeHeader:m,columnsToResize:f,columnsToSkip:p}),b=Object.keys(g);if(!b.length)return;let h=n().columnSizing,y={...h},S=!1;b.forEach(T=>{y[T]={width:g[T]},S=S||y[T].width!==h[T]?.width}),S&&(e.columnSizing=y)},[s,o,a])}var qo=require("react");var Ha=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);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 o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}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,o,r){if(r.horizontalLayout&&!nc(e,t,r)){_m(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Va(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&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function Gm(n,e){return n<e?[n,e]:[e,n]}var Ka=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[o,r]=Gm(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[o,r]=Gm(e,t),i=this.rowSelectionState;for(let a=o;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 o;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))o=r;else break}this.multiSelectEndIndex=o}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};var Hm=require("react");function Km(n){let{getDataSourceState:e}=Fe(o=>({getDataSourceState:o.getDataSourceState}));return(0,Hm.useMemo)(()=>n.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=n[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}var Bm=require("react");var w0=Ot("useColumnSizeFn");function Wm(n){return(0,Bm.useCallback)(t=>{let o=n[t];return o?o.computedWidth:0},[n])}var jt=require("react");var Yo=require("react");var oC={scrollLeft:0,scrollTop:0},ni=class{constructor(){this.scrollPosition=oC;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 o=0,r=t.length;o<r;o++)t[o](e)}};function jm(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var $m=j(require("react"));function Um(n){return(e,t)=>$m.createElement(n,{key:e.id,rowInfo:e,cache:t})}var ri=class extends mn{constructor(t,o){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=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,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+=ra(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 o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=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,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,f=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=s,this.availableRenderHeight=s),(d||f)&&this.notifyAvailableSizeChange();let p=typeof o=="number",m=typeof r=="number",g=p&&o!==this.initialRows,b=m&&r!==this.initialCols;p&&g&&(this.initialRows=o,this.rows=o),m&&b&&(this.initialCols=r,this.cols=r);let h=i!=null,y=a!=null,S=h&&i!==this.rowHeight,T=y&&a!==this.initialColWidth;h&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=g||S||f,w=b||T||d||C;(w||C)&&this.updateRenderCount({horizontal:w,vertical:C})}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=mo){let o=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/o);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*o,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(o=>{Ve(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.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 Ym={};function sc(n){return`.${Qt}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function cc(n,e){let t=Ho(n),o=e?new ri(t,{isHeader:!1}):new mn(t),r=`${t}:header`,i=e?new ri(r,{isHeader:!0,masterBrain:o}):new mn(r);o.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=$r(o),{renderer:s,onRenderUpdater:c}=$r(i);return o.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function qm({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=cc(n,!!e),c=(0,Yo.createRef)(),u=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:u,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:d=>{if(!c.current)return null;let f=sc(d);return c.current.querySelector(f)||null},brain:o,headerBrain:r,domRef:c,columnMenuTargetRef:(0,Yo.createRef)(),editingValueRef:(0,Yo.createRef)(),scrollerDOMRef:(0,Yo.createRef)(),portalDOMRef:(0,Yo.createRef)(),focusDetectDOMRef:(0,Yo.createRef)(),activeCellIndicatorDOMRef:(0,Yo.createRef)(),onColumnMenuClick:Te(),cellContextMenu:Te(),contextMenu:Te(),onFilterOperatorMenuClick:Te(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Te(),onRowHeightCSSVarChange:Te(),onRowDetailHeightCSSVarChange:Te(),onColumnHeaderHeightCSSVarChange:Te(),cellClick:Te(),cellMouseDown:Te(),keyDown:Te(),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 ni,pinnedEndScrollListener:new ni,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Xm=n=>({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,rowHoverClassName: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??Ym,columnGroupVisibility:e=>e??Ym,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 nC(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Zm=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.headerRenderer.destroy(),n.onRenderUpdater.destroy(),n.headerOnRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function Qm(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var Ba=new WeakMap;function Jm(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var eg=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=o?.pivotColumnGroups?jm(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=nC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let b=Ba.get(d);b||(b=Um(d),Ba.set(d,b)),u=b}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof Pt)&&(c=new Pt(c)),c=c||new Pt({expandedRows:[],collapsedRows:!0}));let f=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,p=c?e.isRowDetailExpanded:void 0;!p&&c&&(p=Ba.get(c),p||(p=b=>c.isRowDetailsExpanded(b.id),typeof c=="object"&&Ba.set(c,p)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:p,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:f,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||he.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let b=yo.get(t.debugId);b&&(g={...g,...b})}return g};function tg(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function og(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).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 f=r[d],p=i[f];if(!p.isTreeNode&&p.isGroupRow&&(c=Math.max(c,p.groupNesting-1),c===s-1))break}return Object.keys(o).forEach(d=>{let f=o[d],{groupByForColumn:p}=f;if(Array.isArray(p))return;let m=p.field||p.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var ng=require("react");function uc(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=Fe(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,ng.useCallback)(r=>{let i=n(),a=new wt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Wo,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Tn(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=oe.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Bt())}},[])}function rC(n){return(0,jt.useMemo)(()=>Qm(n),[n])}function rg(n,e){let{groupBy:t,dataSourceActions:o}=Fe(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;(0,jt.useEffect)(()=>{o.generateGroupRows=r!=="inline"},[r]),(0,jt.useEffect)(()=>{o.pivotTotalColumnPosition=i},[i]),(0,jt.useEffect)(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=rC(t);iC(l,n,e);let{toggleGroupRow:s}=aC();return lC(l,n,e),{toggleGroupRow:s}}function iC(n,e,t){let o=uc(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,f){let p={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],b={},h=u.get(g.field);if(h&&d==="inline"){let{groupIndex:S}=h;b={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[S]:T.value,rowspan:({rowInfo:T,dataArray:C})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let w=C[T.indexInAll-1]||{indexInParentGroups:[]};if(!w||!w.dataSourceHasGrouping)return 1;let I=w.indexInParentGroups||[],v=T.indexInParentGroups||[],x=!1;for(let A=0;A<=S;A++){let M=I[A];if(v[A]!==M){x=!0;break}}if(!x)return 1;let R=T.parents[S];return R?R.groupCount-(R.collapsedChildrenCount||0)+(R.collapsedGroupsCount||0):1},renderGroupIcon:Bi({groupIndexForColumn:S,groupRenderStrategy:d,toggleGroupRow:f,initialRenderGroupIcon:g.renderGroupIcon}),render:Ki({groupIndexForColumn:S,groupRenderStrategy:d})}}let y={...b,...g};p[m]=y}),Object.keys(p).length===0?void 0:p}(0,jt.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,n,i,o)})()},[r,n,i,o])}function aC(){let{groupBy:n,pivotBy:e,selectionMode:t}=Fe(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:f}=Nt(),p=uc();return(0,jt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:b}=sC({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:p,selectionMode:t});o.columnsWhenGrouping=g;let h=f().columnOrder;if(b.length&&Array.isArray(h)){let y=new Set(h),S=!1;b.forEach(T=>{y.has(T)||(S=!0,h=[T,...h])}),S&&(o.columnOrder=h)}})()},[r,n,e,t,a,i,l,s,u,c]),{toggleGroupRow:p}}function lC(n,e,t){let{dataArray:o,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=Fe(b=>({getDataSourceState:b.getDataSourceState,dataArray:b.dataSourceState.dataArray,groupRowsIndexesInDataArray:b.dataSourceState.groupRowsIndexesInDataArray,groupBy:b.dataSourceState.groupBy,groupRowsState:b.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:b.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:f,groupRenderStrategy:p}=e,m=t,g=Oe(e);(0,jt.useLayoutEffect)(()=>{if(p!=="multi-column")return;let b=g(),h=tg(u,n),y=og({computedGroupColumns:h,columnVisibility:b.columnVisibility,hideEmptyGroupColumns:f,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});yt(b.columnVisibility,y)||(m.columnVisibility=y)},[s,p,l,i,n,u,f?o:null,f?a:null,f?r:null,f]),(0,jt.useEffect)(()=>{let b=i.length>0,h=g(),{columnVisibility:y,columnVisibilityForGrouping:S,hideColumnWhenGrouped:T}=h,C={...y},w={...S},I=!1,v=new Set,x=new Set;Object.keys(u).forEach(R=>{let P=u[R];if(P.defaultHiddenWhenGroupedBy||T!=null)if(P.defaultHiddenWhenGroupedBy==="*"&&b||(P.defaultHiddenWhenGroupedBy===!0||T)&&P.field&&n.get(P.field)||typeof P.defaultHiddenWhenGroupedBy=="string"&&n.get(P.defaultHiddenWhenGroupedBy)||typeof P.defaultHiddenWhenGroupedBy=="object"&&Object.keys(P.defaultHiddenWhenGroupedBy).reduce((M,D)=>M||n.has(D),!1)){if(w[R]!==!1){if(y[R]===!1)return;w[R]=!1,I=!0,v.add(R)}}else w[R]===!1&&(delete w[R],I=!0,x.add(R))}),I&&(m.columnVisibilityForGrouping=w,x.forEach(R=>{delete C[R]}),v.forEach(R=>{C[R]=!1}),m.columnVisibility=C)},[u,c,i,n,d])}function sC(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=n;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let f={},p=[];if(c==="multi-column")t.forEach((m,g,b)=>{let h=nf({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:b.length,groupRenderStrategy:c,selectionMode:r},u,i),y=h.id||`group-by-${m.field||m.groupField}`;p.push(y),f[y]=h});else if(c==="single-column"&&t.length){let m=rf({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";p.push(g),f[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let b=d[g];b.field&&(m[b.field]=b)}),Object.keys(e).forEach(g=>{let b=e[g],h=b.pivotTotalColumn&&b.columnGroup,y=b.pivotTotalColumn&&!b.columnGroup;if(h&&a===!1||y&&l===!1)return;let S={...b};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:o,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=T=>S.renderValue(T)),f[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];f[m]=g});return{columns:Object.keys(f).length?f:void 0,groupColumnIds:p}}var ig=require("react");var ag=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:f,filterValue:p,filterTypes:m,columnOrder:g,columnPinning:b,editable:h,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,scrollbarWidth:w,columnTypes:I,pinnedEndMaxWidth:v,pinnedStartMaxWidth:x,viewportReservedWidth:R,resizableColumns:P,columnVisibility:A,columnVisibilityAssumeVisible:M,columnSizing:D,groupBy:_})=>{let{computedRemainingSpace:L,computedColumnOrder:V,computedVisibleColumns:z,computedVisibleColumnsMap:G,computedPinnedStartColumns:E,computedPinnedEndColumns:F,computedUnpinnedColumns:X,computedPinnedStartColumnsWidth:B,computedPinnedEndColumnsWidth:Y,computedUnpinnedColumnsWidth:re,computedUnpinnedOffset:ge,computedPinnedEndOffset:be,computedPinnedEndWidth:ae,computedPinnedStartWidth:de,renderSelectionCheckBox:pe,computedColumnsMap:q,computedColumnsMapInInitialOrder:k,fieldsToColumn:U}=(0,ig.useMemo)(()=>ed({columns:n,scrollbarWidth:w,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:R,resizableColumns:P,filterValue:p,filterTypes:m,sortable:a,sortInfo:d,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:x,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:b,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,editable:h,columnSizing:D,columnTypes:I,columnVisibility:A,columnVisibilityAssumeVisible:M??!0,groupBy:_}),[n,e.width,t,o,r,R,w,a,d,f,p,m,g,A,M,u,c,P,v,x,D,I,b,y,S,T,h,_,1]);return{renderSelectionCheckBox:pe,columns:n,computedColumnsMap:q,computedPinnedEndWidth:ae,computedPinnedStartWidth:de,computedRemainingSpace:L,computedUnpinnedOffset:ge,computedPinnedEndOffset:be,computedPinnedStartColumnsWidth:B,computedPinnedEndColumnsWidth:Y,computedUnpinnedColumnsWidth:re,computedPinnedStartColumns:E,computedPinnedEndColumns:F,computedUnpinnedColumns:X,computedVisibleColumns:z,computedVisibleColumnsMap:G,computedColumnOrder:V,computedColumnsMapInInitialOrder:k,fieldsToColumn:U}};var lg=require("react"),dc=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),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function cC(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],f=d?o(d):0;return e&&e.rowHeight.set(u,f),f}:o;let l=typeof o=="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 f=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,0)),f;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,m)),f+m}}function sg(n){return(0,lg.useMemo)(()=>{let e=new dc;return{computedRowHeight:cC(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}},[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}var ir=require("react");var uC={vertical:!1,horizontal:!1};function cg(n){let e=n().brain,{getDataSourceState:t}=eo(),[o,r]=(0,ir.useState)(uC);return(0,ir.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(c=>c.vertical===l&&c.horizontal===s?c:{vertical:l,horizontal:s})}),[e]),(0,ir.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function ug(n){let{state:e,actions:t,getState:o}=n,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:b,columnSizing:h,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,columnTypes:w,rowHeight:I,rowDetailHeight:v,isRowDetailExpanded:x,isRowDetailEnabled:R,bodySize:P,showSeparatePivotColumnForSingleAggregation:A,onRowHeightCSSVarChange:M,onFlashingDurationCSSVarChange:D,onRowDetailHeightCSSVarChange:_,onColumnHeaderHeightCSSVarChange:O,computedColumns:L,viewportReservedWidth:V,resizableColumns:z,sortable:G,draggableColumns:E}=e,F=t,{multiSort:X,filterValue:B,filterTypes:Y,groupBy:re,sortInfo:ge,dataSourceActions:be,getDataSourceState:ae,dataSourceApi:de}=Fe(we=>({dataSourceActions:we.dataSourceActions,getDataSourceState:we.getDataSourceState,dataSourceApi:we.dataSourceApi,sortInfo:we.dataSourceState.sortInfo,multiSort:we.dataSourceState.multiSort,filterValue:we.dataSourceState.filterValue,filterTypes:we.dataSourceState.filterTypes,groupBy:we.dataSourceState.groupBy}));(0,qo.useState)(()=>{M.onChange(we=>{we&&(F.rowHeight=we)}),D.onChange(we=>{let at=we?we*1:null;at!=null&&!isNaN(at)&&(F.flashingDurationCSSVarValue=at)}),_.onChange(we=>{we&&(F.rowDetailHeight=we)}),O.onChange(we=>{we&&(F.columnHeaderHeight=we)})}),(0,qo.useEffect)(()=>{be.showSeparatePivotColumnForSingleAggregation=A},[A]);let{toggleGroupRow:pe}=rg(e,t),q=L,{computedColumnOrder:k,computedVisibleColumns:U,computedVisibleColumnsMap:K,computedPinnedStartColumns:Z,computedPinnedEndColumns:ne,computedUnpinnedColumns:H,computedPinnedStartColumnsWidth:ce,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:J,computedUnpinnedOffset:fe,computedPinnedEndOffset:me,computedRemainingSpace:Me,computedPinnedStartWidth:Ae,computedPinnedEndWidth:Ge,renderSelectionCheckBox:Ne,computedColumnsMap:Le,computedColumnsMapInInitialOrder:We,fieldsToColumn:et}=ag({columns:q,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,bodySize:P,viewportReservedWidth:V,resizableColumns:z,sortable:G,draggableColumns:E,sortInfo:ge??void 0,multiSort:X,groupBy:re,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:b,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,filterValue:B,filterTypes:Y,columnSizing:h,columnTypes:w}),tt=Km(U),ot=Wm(U),$=cg(o),se=Ae?ce>Ae:!1,ue=Ge?N>Ge:!1,[Se]=(0,qo.useState)(()=>new Ka({isRowDisabledAt:at=>ae().dataArray[at]?.rowDisabled??!1,getIdForIndex:at=>ae().dataArray[at]?.id??-1})),qe=Oe(U),[le]=(0,qo.useState)(()=>new Ha({getPrimaryKeyByIndex:de.getPrimaryKeyByIndex,getColumnIdByIndex:we=>qe()[we]?.id||""})),{computedRowHeight:W,computedRowSizeCacheForDetails:it}=sg({rowDetailHeight:v,rowHeight:I,isRowDetailsExpanded:x,isRowDetailsEnabled:R,getDataSourceState:ae});return(0,qo.useMemo)(()=>({multiRowSelector:Se,multiCellSelector:le,computedRowSizeCacheForDetails:it,computedRowHeight:W,scrollbars:$,columnSize:ot,rowspan:tt,toggleGroupRow:pe,computedColumnsMap:Le,computedColumnsMapInInitialOrder:We,renderSelectionCheckBox:Ne,computedPinnedStartOverflow:se,computedPinnedEndOverflow:ue,computedPinnedStartWidth:Ae,computedPinnedEndWidth:Ge,computedVisibleColumns:U,computedColumnOrder:k,computedRemainingSpace:Me,computedVisibleColumnsMap:K,computedPinnedStartColumns:Z,computedPinnedEndColumns:ne,computedUnpinnedColumns:H,computedPinnedStartColumnsWidth:ce,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:J,computedUnpinnedOffset:fe,computedPinnedEndOffset:me,fieldsToColumn:et}),[Se,le,it,W,$,ot,tt,pe,Le,We,Ne,se,ue,Ae,Ge,U,k,Me,K,Z,ne,H,ce,N,J,fe,me,et])}var pg=require("react");function dC(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function fC(){return 4294967295}function pC(n,e,t){return e=e>>>8^n[t^e&255],e}function mC(n){return n=~n,n=n<0?4294967295+n+1:n,n}function fc(n,e=3988292384){var t=dC(e),o=0,r;for(o=fC(),r=0;r<n.length;r++)o=pC(t,o,n.charCodeAt(r));return o=mC(o),`${o}`}var gC=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),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")??""}},dg=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+8,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},fg=(n="",e,t)=>{let o;try{o=hC(n)}catch{return dg(["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(o.end);return i<r?(dg([`
|
|
27
|
+
`);let o=tr(t);if(n instanceof Je)return n.setConfig(o),n;(n==null||typeof n!="object")&&(n=void 0);let r=n??ZT,i=Wt.get(r);return i&&i.setConfig(o),i=i??new Je(r,o),Wt.set(r,i),i}function Dm(n){let{props:e,state:t,oldState:o}=n,r=!!t.nodesKey,i=Dr(e.sortInfo),a=Dr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((D,_)=>{let O=l[_].operators;D[_]=D[_]||{};let L=D[_];return O.forEach(V=>{L[V.name]=V}),D},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let D=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(D!==void 0&&(D&&typeof D=="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,f=null,p=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")&&(p===null?d=u==="single-row"?null:new Oe({selectedRows:[],deselectedRows:[],defaultSelection:!1},ht(t)):u==="single-row"||p instanceof Oe?d=p:d=new Oe(p,ht(t))),u==="single-cell"||u==="multi-cell"))if(m===null)f=u==="single-cell"?null:new $e;else if(m instanceof $e)f=m;else{let D=Wt.get(m)??new $e(m);Wt.set(m,D),f=D}let g=t.primaryKey,b=typeof g=="function"?D=>g(D):D=>D[g],h=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(h&&!(h instanceof st)){let D=Wt.get(h)??new st(h);Wt.set(h,D),h=D}h=h||new st({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof wt)){let D=Wt.get(y)??new wt(y);Wt.set(y,D),y=D}y=y||new wt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=XT(e.shouldReloadData||{}),T=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),C=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,I=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&er('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&er('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&er('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let w=typeof e.data=="function"?T??"local":"local",v=e.sortFunction?"local":C??(i?"remote":"local"),x=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":I??(typeof e.data=="function"?"remote":"local"),R=S.pivotBy?"remote":"local",P=t.rowDisabledState,A=e.isRowDisabled;if(!A&&P){let D=Wt.get(P);D?A=D:(A=_=>P.isRowDisabled(_.id),Wt.set(P,A))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:h,treeExpandMode:h.mode,shouldReloadData:{filterValue:S?.filterValue??x==="remote",sortInfo:S?.sortInfo??v==="remote",groupBy:S?.groupBy??w==="remote",pivotBy:S?.pivotBy??R==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:f,groupMode:w,sortMode:v,filterMode:x,pivotMode:R,toPrimaryKey:b,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 D=!o||o.originalDataArray!==t.originalDataArray,_=typeof e.livePaginationCursor=="function"?D?qT(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=_}if(t.devToolsDetected&&t.debugId){let D=So.get(t.debugId);D&&(M={...M,...D})}return M}var QT=Ot("DataSource:fullLazyLoad");function xm(n,e,t){let{name:o,newValue:r}=n;o==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&QT('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new wt({collapsedRows:!0,expandedRows:[]})))}function Pm(){return{rowSelection:(n,e)=>e.selectionMode==="single-row"?{callbackParams:[n,"single-row"]}:{callbackParams:[n.getState(),"multi-row"]},treeSelection:(n,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[n,{selectionMode:"single-row"}]};let t=e.__apiRef.current,o=t.treeApi;return{callbackParams:[n.getState(),{treeSelectionState:n,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:o}]}},treeExpandState:(n,e)=>({callbackParams:[n.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(n,e)=>e.selectionMode==="single-cell"?{callbackParams:[n instanceof $e?n.getState().selectedCells:null,"single-cell"]}:{callbackParams:[n.getState(),"multi-cell"]}}}function Mm(){return{sortInfo:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{sortInfo:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},groupBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{groupBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},pivotBy:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{pivotBy:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},filterValue:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{filterValue:n,livePaginationCursor:null},o());e.dataParams=r,t.livePagination&&Ve(()=>{e.livePaginationCursor=null})},cursorId:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{__cursorId:n},o());e.dataParams=r},livePaginationCursor:(n,{actions:e,state:t})=>{let o=t.getDataSourceMasterContextRef.current,r=Co(t,{livePaginationCursor:n},o());e.dataParams=r},dataParams:(n,{state:e})=>yt(n,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(Ot(Ho(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",n?.changes),!0)}}function Am(n){return{originalDataArray:n.originalDataArray,groupRowsState:n.groupRowsState,groupBy:n.groupBy,pivotBy:n.pivotBy,sortInfo:n.sortInfo,filterValue:n.filterValue,livePaginationCursor:n.livePaginationCursor}}var ct=j(require("react"));function Em(){return Do()}function nr(n){let e=xo(),t=Ti(),o=!!e,r=o?e.id:"master",{contextValue:i,ContextComponent:a}=ec(n),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Fe(s),[d]=(0,ct.useState)(()=>am({getState:u,actions:l})),f={dataSourceState:s,dataSourceActions:l,getDataSourceMasterContext:t,getDataSourceState:u,assignState:c,dataSourceApi:d},p=Fe(i),m=Fe(f),g=zs(),b=(0,ct.useCallback)(({children:h})=>{let y=ba(),[S]=(0,ct.useState)(()=>Em());typeof h=="function"&&(h=h(u()));let T=m();return S.setSnapshot(T),(0,ct.useLayoutEffect)(()=>{S.notify()}),ct.default.createElement(a.Provider,{key:r,value:p()},ct.default.createElement(g.Provider,{value:T},ct.default.createElement(y.Provider,{value:S},h)))},[a,o,r]);return(0,ct.useLayoutEffect)(()=>{let h=t();h&&h.registerDetail(f)},[]),(0,ct.useLayoutEffect)(()=>()=>{let h=u();h.onCleanup(h)},[]),bm({dataSourceState:s,dataSourceActions:l,getDataSourceState:u}),(0,ct.useEffect)(()=>{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]),(0,ct.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:b,state:f.dataSourceState}}function _m(){return _e(n=>n.dataSourceApi)}var Pt=class extends or{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],o=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:o}}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,o){return this.setItemValue(t,o)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var ka=class ka{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??ka.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentMap=new Map,o.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}};ka.DEFAULT_SIZE=10;var La=ka;var tc=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},za=class{constructor(e){this.storage=new La(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)}},oc=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 tc:e===!0?new oc:typeof e=="number"?new za(e):new za(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 Om=(e=>(e.INIT="INIT",e))(Om||{});var{useManagedComponent:ec}=Ft({debugName:"DataSource",initSetupState:wm,forwardProps:vm,concludeReducer:cm,mapPropsToState:Dm,onPropChange:xm,cleanup:Rm,interceptActions:Mm(),mappedCallbacks:Pm()});function JT(n){let{DataSource:e}=nr(n);return Fm.createElement(e,null,n.children??null)}function eC(){let{rowInfoReducerResults:n}=_e(e=>({rowInfoReducerResults:e.dataSourceState.rowInfoReducerResults}));return n}function nc(n){let{getComputed:e,getState:t,actions:o}=n,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){o.columnMenuVisibleKey=Date.now();return}function s(p,m){let g=l[c+p*m],b=a.get(g);if(b&&b.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,f;for(;!f&&u<l.length&&(u++,f=s(u,d),f||(d*=-1,f=s(u,d)),!f););return f&&(o.columnMenuVisibleForColumnId=f),f}function Va(n,e){let{rowIndex:t,colIndex:o}=n,{rowIndex:r,colIndex:i}=e,[a,l]=o>i?[i,o]:[o,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function rc(n,e,t){let{rowsPerPage:o}=t;return o?Math.floor(n.rowIndex/o)===Math.floor(e.rowIndex/o):!0}function Nm(n,e,t){if(rc(n,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:o,columnsPerSet:r}=t;if(o===0)throw"rowsPerPage cannot be 0";let i=n,a=e;Math.floor(n.rowIndex/o)>Math.floor(e.rowIndex/o)&&(i=e,a=n);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/o),f=Math.floor(c/o),p=l%o,m=c%o,g=Math.min(p,m),b=Math.max(p,m),h=[];for(let y=d;y<=f;y++)for(let S=g;S<=b;S++){let T=y*o+S;if(y===d)for(let C=s;C<r;C++)h.push({rowIndex:T,colIndex:C});else if(y===f)for(let C=0;C<=u;C++)h.push({rowIndex:T,colIndex:C});else for(let C=0;C<r;C++)h.push({rowIndex:T,colIndex:C})}return h}function tC(n,e){let t=new Set(n);return e.map(o=>t.has(o)?o:null).filter(o=>o!=null)}var ic=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??jo(e.rowIndex,this.getDataSourceState)?.id,o=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,o]};this.setRangeSelected=(e,t,o)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new $e(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),f=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!f)return;let p=d.computedVisibleIndex,m=f.computedVisibleIndex,g=jo(l,this.getDataSourceState),b=jo(c,this.getDataSourceState);if(!g||!b)return;let h=g.indexInAll,y=b.indexInAll,[S,T]=Va({rowIndex:h,colIndex:p},{rowIndex:y,colIndex:m});for(let C=S.rowIndex;C<=T.rowIndex;C++)for(let I=S.colIndex;I<=T.colIndex;I++){let w={rowIndex:C,colIndex:I},[v,x]=this.getCellSelectionPosition(w);o?a.selectCell(v,x):a.deselectCell(v,x)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let o=xa(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;o.filter(d=>{r.forEach(f=>{this.isCellSelected({rowId:d.id,colId:f.id})&&(a.has(f.id)||a.add(f.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=tC(Array.from(a),i),u=l.map(d=>c.map(f=>this.isCellSelected({rowId:d.id,colId:f})?e(d,f):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 o=new $e(t);o.debugId=e.debugId??"",o.deselectAll(),this.dataSourceActions.cellSelection=o};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let o=new $e(t);o.debugId=e.debugId??"",o.selectAll(),this.dataSourceActions.cellSelection=o};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,o]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,o)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new $e:new $e(o);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let[r,i]=this.getCellSelectionPosition(e),a=new $e(o);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let o=this.getDataSourceState(),r=o.cellSelection;if(!r)return;let i=new $e(r);i.debugId=o.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),o=t.cellSelection;if(!o)return;let r=new $e(o);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Lm(n){return new ic(n)}function km(n){let{dataSourceApi:e,getState:t,actions:o}=n,r={collapseAllDetails(){o.rowDetailState=new Pt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){o.rowDetailState=new Pt({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 Pt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,o.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 Pt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,o.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Uo(n,e,t){return Math.min(Math.max(n,e),t)}function Ga(n,e,t){let o=n().dataArray,r=0,i=o.length-1,a=e;do{a+=t;let l=o[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Uo(a,r,i)}function oC(n,e){let{getState:t,getDataSourceState:o,actions:r,api:i,dataSourceApi:a}=n,{key:l}=e,s=o().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:f}=u;if(f==null)return!1;let{start:[p],end:[m]}=d.getRenderRange(),g=f,b=m-p-1,h=0,y=c-1,S={ArrowDown:()=>{f=Ga(o,f,1)},ArrowUp:()=>{f=Ga(o,f,-1)},ArrowLeft:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;f-I>=h?f=f-I:S.ArrowUp();return}return C&&C.isGroupRow?i.collapseGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.collapseRowDetail(C.id):!1},ArrowRight:()=>{let C=s[f];if(d.isHorizontalLayoutBrain){let I=d.rowsPerPage;f+I<=y?f=f+I:S.ArrowDown();return}return C&&C.isGroupRow?i.expandGroupRow(C.groupKeys):C&&i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.expandRowDetail(C.id):!1},Enter:()=>{let C=s[f];return C&&C.isGroupRow?i.toggleGroupRow(C.groupKeys):C&&C.isTreeNode&&C.isParentNode?a.treeApi.toggleNode(C.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(C.id)?i.rowDetailApi.toggleRowDetail(C.id):!1},PageDown:()=>{f=Math.min(f+b,c-1)},PageUp:()=>{f=Math.max(f-b,h)},End:()=>{f=y},Home:()=>{f=h}},T=S[l];return T?(T(),g!==f?(r.activeRowIndex=f,!0):!1):!1}function ac(n,e){let{api:t,getState:o,getComputed:r,getDataSourceState:i,dataSourceApi:a}=n,{key:l,shiftKey:s}=e,c=i().dataArray,u=o(),{activeCellIndex:d,brain:f}=u;if(!d)return!1;let[p,m]=d,{start:[g,b],end:[h,y]}=f.getRenderRange(),S=h-g-1,T=y-b-1,C=i().dataArray.length-1,I=r().computedVisibleColumns.length-1,w=0,v=0;p=Uo(p,0,C),m=Uo(m,0,I);let x={ArrowDown:()=>{p=Uo(p+1,w,C)},ArrowUp:()=>{p=Uo(p-1,w,C)},ArrowLeft:()=>{if(m===v)if(p!==w&&(m=I),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p-P>=w?p=p-P:x.ArrowUp()}else x.ArrowUp();else m=Uo(m-1,v,I)},ArrowRight:()=>{if(m===I)if(p!==C&&(m=v),f.isHorizontalLayoutBrain){let P=f.rowsPerPage;p+P<=C?p=p+P:x.ArrowDown()}else x.ArrowDown();else m=Uo(m+1,v,I)},Enter:()=>{let P=c[p];return P&&P.isGroupRow?t.toggleGroupRow(P.groupKeys):P&&P.isTreeNode&&P.isParentNode?a.treeApi.toggleNode(P.nodePath):P&&t.rowDetailApi.isRowDetailEnabledForRow(P.id)?t.rowDetailApi.toggleRowDetail(P.id):!1},PageDown:()=>{s?m=Math.min(m+T,I):p=Math.min(p+S,C)},PageUp:()=>{s?m=Math.max(m-T,v):p=Math.max(p-S,w)},End:()=>{s?m=I:p=C},Home:()=>{s?m=v:p=w}},R=x[l];return R?(R(),[p,m]):!1}function nC(n,e){let t=ac(n,e);return t?(n.actions.activeCellIndex=t,!0):!1}var rC={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function zm(n,e){let{key:t}=e,{getState:o}=n,r=o(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!rC[t]?!1:i!=null&&l==="row"?oC(n,e):a!=null&&l==="cell"?nC(n,e):!1}var lc=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:o}=this.param,{activeRowIndex:r,keyboardNavigation:i}=o();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Ga(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,o=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=ac(this.param,{key:o,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function Vm(n){return new lc(n)}function Gm(n,e){return n.id?n.id===e.id:!!(n.field&&n.field===e.field)}var sc=class{constructor(e){this.columnApiById=new Map;this.getVisibleRenderRange=()=>this.getState().brain.getRenderRange();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(o=>t.has(o))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:o}=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={...xt({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;o.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,f=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(f)}),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:o}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===o&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:o,editingValueRef:r}=t;if(!o)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=o;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({...xt({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:o.initialValue}):!0;return await new Promise(f=>requestAnimationFrame(f)),Promise.resolve(d).then(f=>{if(f===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw f}).catch(f=>(f instanceof Error||(f=new Error(`Edit rejected: ${f}`)),this.actions.editingCell={...o,value:i,persisted:!1,active:!1,waiting:!1,accepted:f},{reject:f,value:i}))}return e.cancel&&o?.active?(this.actions.editingCell={...o,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&o?.active?(this.actions.editingCell={...o,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:o,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(o),{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(xt({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>{let t=typeof e=="string"?e:this.getComputed().computedVisibleColumns[e]?.id,o=this.columnApiById.get(t);if(o)return o;let r=gt(e,{...this.context,api:this});return r&&this.columnApiById.set(r.getColumnId(),r),r};this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:o,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(o),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 f=this,{isRowDetailEnabled:p}=a(),m=!p||typeof p=="function"&&!p(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=Bn({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:f},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 o={...this.getState().columnGroupVisibility};t?delete o[e]:o[e]=!1,this.actions.columnGroupVisibility=o};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new wt(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(),o=new wt(t.groupRowsState);if(o.toggleGroupRow(e),this.dataSourceActions.groupRowsState=o,t.lazyLoad){let r=[Wo,...e],i=t.originalLazyGroupData.get(r);o.isGroupRowExpanded(e)?i?.cache||Tn(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=oe.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Bt())}};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,o={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){o=o||{};let g=r.brain.getPageIndexForRow(e);o.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,o),s=r.renderer.getScrollPositionForScrollRowIntoView(e,o);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,f=r.brain.scrollTopMax;if(d<0&&f<0)return!0;let p=c.scrollLeft>d+(o.offset||0),m=c.scrollTop>f+(o.offset||0);return p&&m?!1:(c.scrollLeft!==u.scrollLeft&&!p&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=om({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=Vm({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=km({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Lm({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},o=this.getState().columnMenuRealignDelay;(!o||o<0)&&(nc(t),e?.()),setTimeout(()=>{this.isDestroyed()||(nc(t),e?.())},o)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:o,primaryKey:r,value:i}=e,a=o??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],f=i??pf({column:u,rowInfo:d}),p=f;u.getValueToEdit&&(f=await u.getValueToEdit(xt({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:f,initialValue:p,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,o){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,o);return}let l=i.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(p=>p.valueGetter?m=>p.valueGetter({data:m,field:p.field}):p.field?p.field:p.groupField??void 0).filter(Po);u.length&&(s=u);let d=i.computedSortType;c.length&&d===Nn&&(d=c.flatMap(m=>{let g=m.field??m.groupField,b=g?r.get(g):null;return b?b.computedSortType:Nn}));let f={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(f.valueGetter=p=>i.valueGetter({data:p,field:i.field})),this.setSortInfoForColumn(e,f,o)}setSortInfoForColumn(e,t,o){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=>!Gm(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((o?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:Gm(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 o={...this.getState().columnPinning};t===!1?delete o[e]:o[e]=t,this.actions.columnPinning=o}setColumnFilter(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(o.computedFilterValue)a={...o.computedFilterValue,filter:{...o.computedFilterValue.filter}};else{let l=o.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:o.valueGetter};(o.field||typeof o.groupByForColumn=="string")&&(s.field=o.field||o.groupByForColumn),a=s}a.id=o.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=o.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;o.computedFilterValue?(u={...o.computedFilterValue,filter:{...o.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:o.valueGetter},o.field&&(u.field=o.field)),u.id=o.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let o=this.getComputed().computedColumnsMap.get(e);if(!o)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===o.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 o=this.getDataSourceState(),r=o.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=o.operatorsByFilterType[l],c=o.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,f=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:f}}}return a}).filter(Po),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let o={...this.getState().columnVisibility};t?delete o[e]:o[e]=!1,this.actions.columnVisibility=o}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&&(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&&(t.scrollerDOMRef.current.scrollTop=Math.max(e,0))}scrollRowIntoView(e,t={offset:0}){let o=this.getState(),r=this.getComputed(),i=o.brain.getScrollPosition(),a=t.columnId,l;!a&&o.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=o.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=o.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&(o.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(o.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let o=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=o.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=o.brain.getScrollPosition(),c=o.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(o.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function Hm(n){return new sc(n)}var Cn=require("react");var iC=10;function aC(n,e){let{includeHeader:t,columnsToResize:o,columnsToSkip:r}=e,i=`.${cn} > .${ds}`,a=n.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${an}`);if(t===!1&&d)return;let f=u.getAttribute("data-column-id"),p=c.cloneNode(!0);p.style.visibility="hidden",p.style.pointerEvents="none",p.classList.remove(...qt.split(" ")),p.style.position="absolute",p.style.width="auto",u.appendChild(p);let m=p.offsetWidth;if(u.removeChild(p),!s[f]){let g=De().getComputedStyle(u);s[f]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+iC}if(m+=s[f],d){let g=0;u.childNodes.forEach(b=>{if(b!==c){let h=b,y=Math.max(h.offsetWidth,parseInt(h.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let S=De().getComputedStyle(h);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(f)||o&&!o.has(f)||(l[f]=Math.max(m,l[f]||0))}),l}function Km(){let{getComponentState:n,componentActions:e,componentState:{domRef:t,ready:o,autoSizeColumnsKey:r,brain:i}}=Nt(),[a,l]=(0,Cn.useState)(0),s=typeof r=="object"?r.key:r,c=Fe(s),u=(0,Cn.useRef)(null);(0,Cn.useEffect)(()=>{if(c()==null)return;let{current:f}=u,p=()=>{r!==f&&l(a+1)};return i.onRenderRangeChange(p)},[i]),(0,Cn.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=n(),f,p,m=!0;typeof d=="object"&&(d.columnsToResize&&(f=new Set(d.columnsToResize)),d.columnsToSkip&&(p=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=aC(t,{includeHeader:m,columnsToResize:f,columnsToSkip:p}),b=Object.keys(g);if(!b.length)return;let h=n().columnSizing,y={...h},S=!1;b.forEach(T=>{y[T]={width:g[T]},S=S||y[T].width!==h[T]?.width}),S&&(e.columnSizing=y)},[s,o,a])}var qo=require("react");var Ha=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:o}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(o);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 o={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(o)&&(this.multiSelectStartPosition=o)}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,o,r){if(r.horizontalLayout&&!rc(e,t,r)){Nm(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Va(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&&(o?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,o){this.setRangeSelected(e,t,!1,o)}selectRange(e,t,o){this.setRangeSelected(e,t,!0,o)}};function Bm(n,e){return n<e?[n,e]:[e,n]}var Ka=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[o,r]=Bm(e,t),i=this.rowSelectionState;for(let a=o;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[o,r]=Bm(e,t),i=this.rowSelectionState;for(let a=o;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 o;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))o=r;else break}this.multiSelectEndIndex=o}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};var Wm=require("react");function jm(n){let{getDataSourceState:e}=_e(o=>({getDataSourceState:o.getDataSourceState}));return(0,Wm.useMemo)(()=>n.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=n[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[n])}var $m=require("react");var E0=Ot("useColumnSizeFn");function Um(n){return(0,$m.useCallback)(t=>{let o=n[t];return o?o.computedWidth:0},[n])}var jt=require("react");var Yo=require("react");var lC={scrollLeft:0,scrollTop:0},ri=class{constructor(){this.scrollPosition=lC;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 o=0,r=t.length;o<r;o++)t[o](e)}};function Ym(n,e){let t=new Map;function o(r){return e[r]!==!1}return Object.keys(n).forEach(r=>{let a=n[r].columnGroup,l=0;for(o(r)||(l=-1);a;){let s=n[a];if(!s)break;o(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var qm=j(require("react"));function Xm(n){return(e,t)=>qm.createElement(n,{key:e.id,rowInfo:e,cache:t})}var ii=class extends mn{constructor(t,o){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=o,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,o,r,i){if(t==="vertical"||typeof o=="number")return super.computeDirectionalRenderCount(t,o,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+=ra(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 o=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(o=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:o,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let o=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,o=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?o:Math.min(o,this.initialRows)}}update(t){let{rows:o,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,f=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),f&&(this.availableHeight=s,this.availableRenderHeight=s),(d||f)&&this.notifyAvailableSizeChange();let p=typeof o=="number",m=typeof r=="number",g=p&&o!==this.initialRows,b=m&&r!==this.initialCols;p&&g&&(this.initialRows=o,this.rows=o),m&&b&&(this.initialCols=r,this.cols=r);let h=i!=null,y=a!=null,S=h&&i!==this.rowHeight,T=y&&a!==this.initialColWidth;h&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let C=g||S||f,I=b||T||d||C;(I||C)&&this.updateRenderCount({horizontal:I,vertical:C})}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=mo){let o=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/o);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*o,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(o=>{Ve(()=>{this.destroyed||t.has(o)&&o(this.totalPageCount)})})}getVirtualColIndex(t,o){return this.initialCols*(o?.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 Zm={};function cc(n){return`.${Qt}[data-row-index${n?`="${n.rowIndex}"`:""}][data-col-index${n?`="${n.colIndex}"`:""}]`}function uc(n,e){let t=Ho(n),o=e?new ii(t,{isHeader:!1}):new mn(t),r=`${t}:header`,i=e?new ii(r,{isHeader:!0,masterBrain:o}):new mn(r);o.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Ur(o),{renderer:s,onRenderUpdater:c}=Ur(i);return o.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:o,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function Qm({debugId:n,wrapRowsHorizontally:e}){let t={},{brain:o,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=uc(n,!!e),c=(0,Yo.createRef)(),u=Date.now();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,updatedAt:u,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:d=>{if(!c.current)return null;let f=cc(d);return c.current.querySelector(f)||null},brain:o,headerBrain:r,domRef:c,columnMenuTargetRef:(0,Yo.createRef)(),editingValueRef:(0,Yo.createRef)(),scrollerDOMRef:(0,Yo.createRef)(),portalDOMRef:(0,Yo.createRef)(),focusDetectDOMRef:(0,Yo.createRef)(),activeCellIndicatorDOMRef:(0,Yo.createRef)(),onColumnMenuClick:Te(),cellContextMenu:Te(),contextMenu:Te(),onFilterOperatorMenuClick:Te(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:Te(),onRowHeightCSSVarChange:Te(),onRowDetailHeightCSSVarChange:Te(),onColumnHeaderHeightCSSVarChange:Te(),cellClick:Te(),cellMouseDown:Te(),keyDown:Te(),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 ri,pinnedEndScrollListener:new ri,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var Jm=n=>({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,rowHoverClassName: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??Zm,columnGroupVisibility:e=>e??Zm,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 sC(n){let{groupBy:e,groupColumn:t,groupRenderStrategy:o}=n;return o||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var eg=n=>{n.brain.destroy(),n.headerBrain.destroy(),n.renderer.destroy(),n.headerRenderer.destroy(),n.onRenderUpdater.destroy(),n.headerOnRenderUpdater.destroy(),n.onFlashingDurationCSSVarChange.destroy(),n.onRowHeightCSSVarChange.destroy(),n.onColumnHeaderHeightCSSVarChange.destroy(),n.onColumnMenuClick.destroy(),n.onFilterOperatorMenuClick.destroy(),n.domRef.current=null,n.columnMenuTargetRef.current=null,n.scrollerDOMRef.current=null,n.portalDOMRef.current=null,n.onRowDetailHeightCSSVarChange.destroy(),n.pinnedEndScrollListener.destroy(),n.pinnedStartScrollListener.destroy()};function tg(n){return n.reduce((e,t,o)=>{let r={groupBy:t,groupIndex:o};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var Ba=new WeakMap;function og(){return{rowDetailState:(n,e)=>({callbackParams:[n,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var ng=n=>{let{props:e,state:t,oldState:o,parentState:r}=n,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=o?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=o?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=o?.pivotColumnGroups?Ym(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=sC({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let b=Ba.get(d);b||(b=Xm(d),Ba.set(d,b)),u=b}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof Pt)&&(c=new Pt(c)),c=c||new Pt({expandedRows:[],collapsedRows:!0}));let f=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,p=c?e.isRowDetailExpanded:void 0;!p&&c&&(p=Ba.get(c),p||(p=b=>c.isRowDetailsExpanded(b.id),typeof c=="object"&&Ba.set(c,p)));let m=u?e.isRowDetailEnabled||!0:!1,g={updatedAt:Date.now(),isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:p,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:f,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||he.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let b=yo.get(t.debugId);b&&(g={...g,...b})}return g};function rg(n,e){let t={};return Object.keys(n).forEach(o=>{let r=n[o],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[o]=r)}),t}function ig(n){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:o,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=n,l={...n.columnVisibility};if(!e)return Object.keys(o).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 f=r[d],p=i[f];if(!p.isTreeNode&&p.isGroupRow&&(c=Math.max(c,p.groupNesting-1),c===s-1))break}return Object.keys(o).forEach(d=>{let f=o[d],{groupByForColumn:p}=f;if(Array.isArray(p))return;let m=p.field||p.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var ag=require("react");function dc(){let{getDataSourceState:n,dataSourceActions:e,getDataSourceMasterContext:t}=_e(r=>({getDataSourceState:r.getDataSourceState,dataSourceActions:r.dataSourceActions,getDataSourceMasterContext:r.getDataSourceMasterContext}));return(0,ag.useCallback)(r=>{let i=n(),a=new wt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Wo,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||Tn(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=oe.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Bt())}},[])}function cC(n){return(0,jt.useMemo)(()=>tg(n),[n])}function lg(n,e){let{groupBy:t,dataSourceActions:o}=_e(c=>({groupBy:c.dataSourceState.groupBy,dataSourceActions:c.dataSourceActions})),{groupRenderStrategy:r,pivotTotalColumnPosition:i,pivotGrandTotalColumnPosition:a}=n;(0,jt.useEffect)(()=>{o.generateGroupRows=r!=="inline"},[r]),(0,jt.useEffect)(()=>{o.pivotTotalColumnPosition=i},[i]),(0,jt.useEffect)(()=>{a!=null&&(o.pivotGrandTotalColumnPosition=a)},[a]);let l=cC(t);uC(l,n,e);let{toggleGroupRow:s}=dC();return fC(l,n,e),{toggleGroupRow:s}}function uC(n,e,t){let o=dc(),{columns:r,groupRenderStrategy:i,isTree:a}=e,l=t;function s(c,u,d,f){let p={};if(d==="inline")return Object.keys(c).forEach(m=>{let g=c[m],b={},h=u.get(g.field);if(h&&d==="inline"){let{groupIndex:S}=h;b={groupByForColumn:h.groupBy,field:h.groupBy?.field,valueGetter:h.groupBy?.valueGetter,valueFormatter:({rowInfo:T})=>T.isGroupRow?T.groupKeys?.[S]:T.value,rowspan:({rowInfo:T,dataArray:C})=>{if(T.isTreeNode||!T.isGroupRow)return 1;let I=C[T.indexInAll-1]||{indexInParentGroups:[]};if(!I||!I.dataSourceHasGrouping)return 1;let w=I.indexInParentGroups||[],v=T.indexInParentGroups||[],x=!1;for(let A=0;A<=S;A++){let M=w[A];if(v[A]!==M){x=!0;break}}if(!x)return 1;let R=T.parents[S];return R?R.groupCount-(R.collapsedChildrenCount||0)+(R.collapsedGroupsCount||0):1},renderGroupIcon:Wi({groupIndexForColumn:S,groupRenderStrategy:d,toggleGroupRow:f,initialRenderGroupIcon:g.renderGroupIcon}),render:Bi({groupIndexForColumn:S,groupRenderStrategy:d})}}let y={...b,...g};p[m]=y}),Object.keys(p).length===0?void 0:p}(0,jt.useEffect)(()=>{(()=>{l.columnsWhenInlineGroupRenderStrategy=a?void 0:s(r,n,i,o)})()},[r,n,i,o])}function dC(){let{groupBy:n,pivotBy:e,selectionMode:t}=_e(m=>({groupBy:m.dataSourceState.groupBy,pivotBy:m.dataSourceState.pivotBy,selectionMode:m.dataSourceState.selectionMode})),{componentActions:o,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:f}=Nt(),p=dc();return(0,jt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:b}=pC({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:n,pivotBy:e,pivotColumns:s,toggleGroupRow:p,selectionMode:t});o.columnsWhenGrouping=g;let h=f().columnOrder;if(b.length&&Array.isArray(h)){let y=new Set(h),S=!1;b.forEach(T=>{y.has(T)||(S=!0,h=[T,...h])}),S&&(o.columnOrder=h)}})()},[r,n,e,t,a,i,l,s,u,c]),{toggleGroupRow:p}}function fC(n,e,t){let{dataArray:o,groupRowsIndexesInDataArray:r,groupBy:i,groupRowsState:a,originalLazyGroupDataChangeDetect:l,getDataSourceState:s}=_e(b=>({getDataSourceState:b.getDataSourceState,dataArray:b.dataSourceState.dataArray,groupRowsIndexesInDataArray:b.dataSourceState.groupRowsIndexesInDataArray,groupBy:b.dataSourceState.groupBy,groupRowsState:b.dataSourceState.groupRowsState,originalLazyGroupDataChangeDetect:b.dataSourceState.originalLazyGroupDataChangeDetect})),{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:f,groupRenderStrategy:p}=e,m=t,g=Fe(e);(0,jt.useLayoutEffect)(()=>{if(p!=="multi-column")return;let b=g(),h=rg(u,n),y=ig({computedGroupColumns:h,columnVisibility:b.columnVisibility,hideEmptyGroupColumns:f,groupRowsIndexesInDataArray:r,dataArray:o,groupBy:i,groupByMap:n});yt(b.columnVisibility,y)||(m.columnVisibility=y)},[s,p,l,i,n,u,f?o:null,f?a:null,f?r:null,f]),(0,jt.useEffect)(()=>{let b=i.length>0,h=g(),{columnVisibility:y,columnVisibilityForGrouping:S,hideColumnWhenGrouped:T}=h,C={...y},I={...S},w=!1,v=new Set,x=new Set;Object.keys(u).forEach(R=>{let P=u[R];if(P.defaultHiddenWhenGroupedBy||T!=null)if(P.defaultHiddenWhenGroupedBy==="*"&&b||(P.defaultHiddenWhenGroupedBy===!0||T)&&P.field&&n.get(P.field)||typeof P.defaultHiddenWhenGroupedBy=="string"&&n.get(P.defaultHiddenWhenGroupedBy)||typeof P.defaultHiddenWhenGroupedBy=="object"&&Object.keys(P.defaultHiddenWhenGroupedBy).reduce((M,D)=>M||n.has(D),!1)){if(I[R]!==!1){if(y[R]===!1)return;I[R]=!1,w=!0,v.add(R)}}else I[R]===!1&&(delete I[R],w=!0,x.add(R))}),w&&(m.columnVisibilityForGrouping=I,x.forEach(R=>{delete C[R]}),v.forEach(R=>{C[R]=!1}),m.columnVisibility=C)},[u,c,i,n,d])}function pC(n){let{pivotColumns:e,groupBy:t,pivotBy:o,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=n;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let f={},p=[];if(c==="multi-column")t.forEach((m,g,b)=>{let h=rf({groupByForColumn:m,groupBy:t,pivotBy:o,groupIndexForColumn:g,groupCount:b.length,groupRenderStrategy:c,selectionMode:r},u,i),y=h.id||`group-by-${m.field||m.groupField}`;p.push(y),f[y]=h});else if(c==="single-column"&&t.length){let m=af({groupCount:t.length,groupBy:t,pivotBy:o,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";p.push(g),f[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let b=d[g];b.field&&(m[b.field]=b)}),Object.keys(e).forEach(g=>{let b=e[g],h=b.pivotTotalColumn&&b.columnGroup,y=b.pivotTotalColumn&&!b.columnGroup;if(h&&a===!1||y&&l===!1)return;let S={...b};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:o,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=T=>S.renderValue(T)),f[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];f[m]=g});return{columns:Object.keys(f).length?f:void 0,groupColumnIds:p}}var sg=require("react");var cg=({columns:n,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:f,filterValue:p,filterTypes:m,columnOrder:g,columnPinning:b,editable:h,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,scrollbarWidth:I,columnTypes:w,pinnedEndMaxWidth:v,pinnedStartMaxWidth:x,viewportReservedWidth:R,resizableColumns:P,columnVisibility:A,columnVisibilityAssumeVisible:M,columnSizing:D,groupBy:_})=>{let{computedRemainingSpace:L,computedColumnOrder:V,computedVisibleColumns:z,computedVisibleColumnsMap:G,computedPinnedStartColumns:E,computedPinnedEndColumns:F,computedUnpinnedColumns:X,computedPinnedStartColumnsWidth:B,computedPinnedEndColumnsWidth:Y,computedUnpinnedColumnsWidth:ie,computedUnpinnedOffset:ge,computedPinnedEndOffset:be,computedPinnedEndWidth:ae,computedPinnedStartWidth:de,renderSelectionCheckBox:pe,computedColumnsMap:q,computedColumnsMapInInitialOrder:k,fieldsToColumn:U}=(0,sg.useMemo)(()=>td({columns:n,scrollbarWidth:I,bodySize:e,columnMinWidth:t,columnMaxWidth:o,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:R,resizableColumns:P,filterValue:p,filterTypes:m,sortable:a,sortInfo:d,multiSort:f,pinnedEndMaxWidth:v,pinnedStartMaxWidth:x,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:b,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:T,columnDefaultSortable:C,editable:h,columnSizing:D,columnTypes:w,columnVisibility:A,columnVisibilityAssumeVisible:M??!0,groupBy:_}),[n,e.width,t,o,r,R,I,a,d,f,p,m,g,A,M,u,c,P,v,x,D,w,b,y,S,T,h,_,1]);return{renderSelectionCheckBox:pe,columns:n,computedColumnsMap:q,computedPinnedEndWidth:ae,computedPinnedStartWidth:de,computedRemainingSpace:L,computedUnpinnedOffset:ge,computedPinnedEndOffset:be,computedPinnedStartColumnsWidth:B,computedPinnedEndColumnsWidth:Y,computedUnpinnedColumnsWidth:ie,computedPinnedStartColumns:E,computedPinnedEndColumns:F,computedUnpinnedColumns:X,computedVisibleColumns:z,computedVisibleColumnsMap:G,computedColumnOrder:V,computedColumnsMapInInitialOrder:k,fieldsToColumn:U}};var ug=require("react"),fc=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),o=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:o,totalRowHeight:t+o}}};function mC(n,e){let t=n.rowDetailHeight,o=n.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=n;if(!r)return typeof o=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],f=d?o(d):0;return e&&e.rowHeight.set(u,f),f}:o;let l=typeof o=="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 f=l?o(d):o;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,0)),f;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,f),e.rowDetailHeight.set(u,m)),f+m}}function dg(n){return(0,ug.useMemo)(()=>{let e=new fc;return{computedRowHeight:mC(n,e),computedRowSizeCacheForDetails:n.isRowDetailsExpanded?e:void 0}},[n.rowHeight,n.rowDetailHeight,n.isRowDetailsExpanded,n.isRowDetailsEnabled,n.getDataSourceState])}var ir=require("react");var gC={vertical:!1,horizontal:!1};function fg(n){let e=n().brain,{getDataSourceState:t}=eo(),[o,r]=(0,ir.useState)(gC);return(0,ir.useEffect)(()=>e.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=e,l=i>0,s=a>0;r(c=>c.vertical===l&&c.horizontal===s?c:{vertical:l,horizontal:s})}),[e]),(0,ir.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=n(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(o),l(o)},[o]),o}function pg(n){let{state:e,actions:t,getState:o}=n,{columnOrder:r,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,columnVisibility:g,columnPinning:b,columnSizing:h,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,columnTypes:I,rowHeight:w,rowDetailHeight:v,isRowDetailExpanded:x,isRowDetailEnabled:R,bodySize:P,showSeparatePivotColumnForSingleAggregation:A,onRowHeightCSSVarChange:M,onFlashingDurationCSSVarChange:D,onRowDetailHeightCSSVarChange:_,onColumnHeaderHeightCSSVarChange:O,computedColumns:L,viewportReservedWidth:V,resizableColumns:z,sortable:G,draggableColumns:E}=e,F=t,{multiSort:X,filterValue:B,filterTypes:Y,groupBy:ie,sortInfo:ge,dataSourceActions:be,getDataSourceState:ae,dataSourceApi:de}=_e(Ie=>({dataSourceActions:Ie.dataSourceActions,getDataSourceState:Ie.getDataSourceState,dataSourceApi:Ie.dataSourceApi,sortInfo:Ie.dataSourceState.sortInfo,multiSort:Ie.dataSourceState.multiSort,filterValue:Ie.dataSourceState.filterValue,filterTypes:Ie.dataSourceState.filterTypes,groupBy:Ie.dataSourceState.groupBy}));(0,qo.useState)(()=>{M.onChange(Ie=>{Ie&&(F.rowHeight=Ie)}),D.onChange(Ie=>{let at=Ie?Ie*1:null;at!=null&&!isNaN(at)&&(F.flashingDurationCSSVarValue=at)}),_.onChange(Ie=>{Ie&&(F.rowDetailHeight=Ie)}),O.onChange(Ie=>{Ie&&(F.columnHeaderHeight=Ie)})}),(0,qo.useEffect)(()=>{be.showSeparatePivotColumnForSingleAggregation=A},[A]);let{toggleGroupRow:pe}=lg(e,t),q=L,{computedColumnOrder:k,computedVisibleColumns:U,computedVisibleColumnsMap:K,computedPinnedStartColumns:Z,computedPinnedEndColumns:ne,computedUnpinnedColumns:H,computedPinnedStartColumnsWidth:ce,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:J,computedUnpinnedOffset:fe,computedPinnedEndOffset:me,computedRemainingSpace:Me,computedPinnedStartWidth:Ae,computedPinnedEndWidth:Ge,renderSelectionCheckBox:Ne,computedColumnsMap:Le,computedColumnsMapInInitialOrder:We,fieldsToColumn:et}=cg({columns:q,scrollbarWidth:void 0,columnCssEllipsis:i,columnHeaderCssEllipsis:a,columnMinWidth:l,columnMaxWidth:s,columnDefaultWidth:c,columnDefaultFlex:u,columnDefaultSortable:d,columnDefaultDraggable:f,pinnedStartMaxWidth:p,pinnedEndMaxWidth:m,bodySize:P,viewportReservedWidth:V,resizableColumns:z,sortable:G,draggableColumns:E,sortInfo:ge??void 0,multiSort:X,groupBy:ie,columnOrder:r,columnVisibility:g,columnVisibilityAssumeVisible:!0,columnPinning:b,editable:y,columnDefaultEditable:S,columnDefaultFilterable:T,columnDefaultGroupable:C,filterValue:B,filterTypes:Y,columnSizing:h,columnTypes:I}),tt=jm(U),ot=Um(U),$=fg(o),se=Ae?ce>Ae:!1,ue=Ge?N>Ge:!1,[Se]=(0,qo.useState)(()=>new Ka({isRowDisabledAt:at=>ae().dataArray[at]?.rowDisabled??!1,getIdForIndex:at=>ae().dataArray[at]?.id??-1})),qe=Fe(U),[le]=(0,qo.useState)(()=>new Ha({getPrimaryKeyByIndex:de.getPrimaryKeyByIndex,getColumnIdByIndex:Ie=>qe()[Ie]?.id||""})),{computedRowHeight:W,computedRowSizeCacheForDetails:it}=dg({rowDetailHeight:v,rowHeight:w,isRowDetailsExpanded:x,isRowDetailsEnabled:R,getDataSourceState:ae});return(0,qo.useMemo)(()=>({multiRowSelector:Se,multiCellSelector:le,computedRowSizeCacheForDetails:it,computedRowHeight:W,scrollbars:$,columnSize:ot,rowspan:tt,toggleGroupRow:pe,computedColumnsMap:Le,computedColumnsMapInInitialOrder:We,renderSelectionCheckBox:Ne,computedPinnedStartOverflow:se,computedPinnedEndOverflow:ue,computedPinnedStartWidth:Ae,computedPinnedEndWidth:Ge,computedVisibleColumns:U,computedColumnOrder:k,computedRemainingSpace:Me,computedVisibleColumnsMap:K,computedPinnedStartColumns:Z,computedPinnedEndColumns:ne,computedUnpinnedColumns:H,computedPinnedStartColumnsWidth:ce,computedPinnedEndColumnsWidth:N,computedUnpinnedColumnsWidth:J,computedUnpinnedOffset:fe,computedPinnedEndOffset:me,fieldsToColumn:et}),[Se,le,it,W,$,ot,tt,pe,Le,We,Ne,se,ue,Ae,Ge,U,k,Me,K,Z,ne,H,ce,N,J,fe,me,et])}var hg=require("react");function hC(n=3988292384){var e=new Array,t,o,r;for(t=0;t<256;t++){for(r=t,o=8;o>0;o--)(r&1)==1?r=r>>>1^n:r=r>>>1;e[t]=r}return e}function bC(){return 4294967295}function yC(n,e,t){return e=e>>>8^n[t^e&255],e}function SC(n){return n=~n,n=n<0?4294967295+n+1:n,n}function pc(n,e=3988292384){var t=hC(e),o=0,r;for(o=bC(),r=0;r<n.length;r++)o=yC(t,o,n.charCodeAt(r));return o=SC(o),`${o}`}var TC=n=>{let e=n.reduce((o,r)=>(o.set(r.name,r.value),o),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")??""}},mg=(n,e=console.error.bind(console))=>{n=["* * * infinite-table.com * * *",...n];let t=Math.max(Math.max(...n.map(o=>o.length))+8,60);n.forEach(o=>{let r=(t-o.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+o+" "+"*".repeat(l))}),e("*".repeat(t))},gg=(n="",e,t)=>{let o;try{o=CC(n)}catch{return mg(["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(o.end);return i<r?(mg([`
|
|
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},hC=n=>{let e="",t=n.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let c=t[s];if(fc(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(fc(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),gC(t)};var bC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,yC=/(https):\/\/\S+(\.csb\.app)/g,mg=typeof window<"u"?window.location.origin:"",SC=()=>{let[n,e,t]=Array.from(bC.exec(mg)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},TC=()=>{let[n,e,t]=Array.from(yC.exec(mg)||[]);return e==="https"&&t===".csb.app"},CC=TC()||SC(),gg=(n="")=>{let t=!!xo();return(0,pg.useMemo)(()=>{if(t)return!0;let r=fg(n,{publishedAt:1624970570587,version:"8.0.2"});return!n&&!r&&CC?!0:r},[n,t])};var ar=require("react");var wC=10;function hg(n,e,t){let o=(0,ar.useRef)(!1),r=(0,ar.useRef)(null);(0,ar.useEffect)(()=>{n!=null&&(o.current=!1,Gt(r.current))},[n]),(0,ar.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Gt(r.current),r.current=Ve(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<wC&&a(l)})};var i=a;a()}return()=>{Gt(r.current)}},[n,e])}var lr=require("react"),IC=10;function bg(n,e,t){let o=(0,lr.useRef)(!1),r=(0,lr.useRef)(null);(0,lr.useEffect)(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),(0,lr.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<IC&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function yg(){return Do()}var Sg=n=>`--infinite-${n}`;var sr=require("react");function Tg(n,e){pc(n,e),vC(n,e),e.detail===2&&RC(n,e),n.getState().onCellClick?.(n,e)}function RC(n,e){if(Vi(e.target))return;let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function vC(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:f}=r(),{brain:p,debugId:m}=o(),{rowsPerPage:g}=p,b=f.length,h=new $e(u);h.debugId=m??"",d.cellSelectionState=h;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let S=!!o().wrapRowsHorizontally;d.multiSelectClick(y,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:b}:{horizontalLayout:S})}else d.resetClick(y);l.cellSelection=h}function pc(n,e){let{rowIndex:t,getDataSourceState:o,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=n,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=o(),{selectionMode:d,groupBy:f,dataArray:p,isTree:m}=u;if(f.length||m||p[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:b}=u;if(b=l(b),s.rowSelectionState=b,b&&typeof b=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=b,!0}else if(d==="single-row"){let h=p[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(h):a.rowSelectionApi.selectRow(h)}return!1}function Cg(n,e){e.detail!==2&&void 0}var DC={Enter:!0," ":!0,a:!0};function wg(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=n,{key:c,ctrlKey:u,metaKey:d}=e;if(!DC[c])return!1;let f=t(),p=o(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:b,keyboardSelection:h}=f,{selectionMode:y,groupBy:S,rowSelection:T,treeSelectionState:C,isTree:w}=p;if(h===!1)return!1;let I=b==="row"&&m!=null?m:b==="cell"&&g!=null?g[0]:null,v=I!=null?p.dataArray[I]:null;if(!v||I==null)return!1;if(y==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(y!=="multi-row")return!1;if(c==="a"&&(u||d)){if(w&&C){let R=s(C);return R.selectAll(),r.treeSelection=R,!0}let x=l(T);return x.selectAll(),r.rowSelection=x,!0}if(c===" "){if(S.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(w){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let x={...e},{renderSelectionCheckBox:R}=n.getComputed();return R&&(x.metaKey=!1,x.ctrlKey=!0),pc({...n,rowIndex:I},x)}}return!1}var Ig=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Rg=n=>Array.from(n.querySelectorAll(Ig)).filter(t=>!!t.offsetParent),Wa=n=>n.querySelector(Ig);var Dg=j(on());async function vg(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var xC=10,PC=(n,e)=>n-e;function ja(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=o(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),f=u[n.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===n.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let p=c[n.rowIndex],m=!s||typeof s=="function"&&!s(p)?!1:i.rowDetailApi.isRowDetailExpanded(p.id)?"expanded":"collapsed",g=gt(f.id,e);return f.contentFocusable({column:f,...Bn({column:f,rowInfo:p,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function mc(n,e,t){let o=t.getState().editingCell;return MC(n,e,t,{isCellFocusable:ja,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function xg(n,e,t){let o=(0,Dg.default)(t,n+e,PC);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=xg;function MC(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,f)=>(d.push(f.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=n.rowIndex,u=n.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:xg(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 Pg(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=ja(e,n)?e:mc(e,-1,n);if(t){await gc([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;Wa(o)?.focus()}}async function gc([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=xC,l=null,s=!1;function c(u=0){u++,Gt(l),l=Ve(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&u<a&&c(u),s){try{await vg(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var AC=`.${Qt}`;function Mg(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:Fo(o,AC),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}=n.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&ja({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:mc({rowIndex:l,colIndex:s},t,n);if(!c){if(t===-1)r.focus();else{let u=Rg(document.body),d=n.getState().focusDetectDOMRef.current,f=u.findIndex(m=>m===d);u[f+1]?.focus()}return!0}return gc([c.rowIndex,c.colIndex],n).then(()=>{let u=n.getState().getDOMNodeForCell(c);if(!u)return;Wa(u)?.focus()}),!0}var Ag={control:"ctrl"},Eg={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},EC={esc:"escape"},Og={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},Fg=Object.keys(Og),hc=new Set(Fg),_C=new Set(["shift","alt"]);function $a(n,e){return Array.isArray(e)?e.some(t=>_g(n,t)):_g(n,e)}function _g(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(f=>f.toLowerCase().trim()),r=o.find(f=>Eg[f]),i=o.map(f=>Ag[f]||Eg[f]||EC[f]||f),a=i.filter(f=>hc.has(f)),l=i.filter(f=>!hc.has(f)),s=Fg.reduce((f,p)=>(f[p]=Og[p](n),f),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(f=>s[f]);if(!a.every(f=>s[f]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(p=>!_C.has(p)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||hc.has(t)||t==="meta"||Ag[t]?!1:l.reduce((f,p)=>f?p==="*"||t===p:!1,!0)}async function Ng(n,e){let t={...n,cloneRowSelection:a=>va(a,n.getDataSourceState),cloneTreeSelection:a=>Ma(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&wg(t,e)&&e.preventDefault(),(Mg(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&Nm(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,c=n.getComputed().computedVisibleColumns[s];c.computedEditable&&n.api.startEdit({rowIndex:l,columnId:c.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!$a(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function OC(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=He(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=eo();return(0,sr.useMemo)(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>Ma(u,i),cloneRowSelection:u=>va(u,i)}),[n,e,i,a,t,l,o])}function FC(){let n=OC();(0,sr.useEffect)(()=>{let e=n.getState().keyDown.onChange(a=>{Ng(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],c=gt(s.id,n);Tg({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=n.getComputed().computedVisibleColumns[c],d=gt(u.id,n);Cg({...n,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function NC(){let{getState:n}=ie(t=>({getState:t.getState}));return{onKeyDown:(0,sr.useCallback)(t=>{n().keyDown(t)},[])}}function Lg(){return FC(),NC()}var wc=require("react");var Be=j(require("react")),Mt=require("react"),Hg=require("react-dom");function bc(n){return!!n.tagName}function Vg(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=xe.from(bc(e)?e.getBoundingClientRect():e),a=xe.from(bc(t)?t.getBoundingClientRect():t),l=o?xe.from(bc(o)?o.getBoundingClientRect():o):null;if(!l)return{...kg({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=kg({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 kg(n){let e=xe.from(n.targetRect),t=xe.from(n.anchorRect),o=n.constrainRect?xe.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=zg(e,i),s=zg(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function zg(n,e){return e==="TopLeft"?je.from({top:n.top,left:n.left}):e==="TopCenter"?je.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?je.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?je.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?je.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?je.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?je.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}var Ua="__is_infinite_menu_component";function LC(n){return n&&typeof n.then=="function"||n instanceof Promise}function Kg(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function Gg(n){return typeof n=="function"&&(n=n()),LC(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&Kg(n)&&(n=n.getBoundingClientRect()),n?xe.from(n):null}async function kC(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),Kg(o)&&(r=o),r||null}return t(await e)}function zC(n){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function VC(n){let e=Be.useRef(null);return(0,Mt.useEffect)(()=>n.realign.onChange(t=>{e.current&&t&&yc(e.current,t)}),[n.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,Mt.useCallback)(t=>{t&&yc(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}async function yc(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Gg(t)||void 0,a=o?await Gg(o):void 0,l=xe.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Vg({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=n.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=n.offsetParent;if(u){let d=u.getBoundingClientRect(),f=d.left,p=d.top,m=s.left-f,g=s.top-p;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function Bg(n,e){let[t,o]=(0,Mt.useState)(null);return(0,Mt.useLayoutEffect)(()=>{async function r(){let i=e?await kC(e):null;i!=null&&o(i)}e&&r()},[e]),e?t?(0,Hg.createPortal)(n,t):Be.createElement(Be.Fragment,null):e===null||e===!1?n:Be.createElement(zC,null,n)}function GC(n){if(Be.Children.count(n)===1){let e=Be.Children.only(n);if(Be.isValidElement(e))return e.props.id||e.key}return null}function HC(n,e,t){if(Be.Children.count(n)===1){let o=Be.Children.only(n);if(Be.isValidElement(o)&&o.type[Ua]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),Be.cloneElement(o,r)}}return n}function ro(n){let e=n,[t]=(0,Mt.useState)(()=>new Map),[o,r]=(0,Mt.useState)(null),[i,a]=(0,Mt.useState)(0),l=(0,Mt.useCallback)(()=>{let m=[];for(let[g,b]of t)m.push(Be.createElement(VC,{...b,key:b.key}));return m},[]),[s,c]=Yt(),u=Bg(l(),n.portalContainer),d=(0,Mt.useCallback)((m,g)=>{let h=`${g.id||GC(m)||Bt()}`,y=t.get(h),S=w=>()=>{let I=typeof w=="function"?w():w;return HC(I,e.portalContainer,g.constrainTo??e.constrainTo)},T=S(m),C=(w,I)=>{if(!y)return;let v=S(w);Object.assign(y,{children:v}),c(),!!!I?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),C(m),C):(y={key:h,children:T,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Te()},t.set(y.key,y),c(),C)},[t,e.portalContainer,c]);Be.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let f=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},p=()=>{t.clear(),c()};return Be.useEffect(()=>{},[]),{portal:u,hideOverlay:f,clearAll:p,rerenderOverlays:c,showOverlay:d}}var nh=j(require("react"));var dr=j(require("react"));var cr=j(require("react"));var ii=j(require("react"));function Ya(n){return null}Ya.defaultProps={__is_menu_item:!0};var Wg="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",jg=ye({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"]]}),$g="db3arf1",Ug="db3arfd";var KC="-";function BC(){return ii.createElement("hr",{className:Ug})}var qa=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===KC?ii.createElement(BC,null):r:null;return i!=null?{type:"item",parentMenuId:o,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:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}};function Yg(n,e){return ii.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Ya)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),qa(n,o)}return qa(n,t)})||[]}var qg="submenu";function Xg(){let n=cr.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Bt(),focused:!1,destroyed:!1,domRef:n}}var Zg=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),WC=[{name:"label"}],Qg=n=>{let{props:e,state:t}=n,{activeItemKey:o,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||WC],d={columns:u,keyboardActiveItemKey:r,activeItemKey:o,menuId:c},f=[];i?f=i.map(qa.bind(null,d)):!i&&typeof a!="function"&&(f=Yg(d,a)),l&&f.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==qg)&&u.push({name:qg,render:({domProps:g,item:b})=>b.menu?cr.createElement("div",{...g},cr.createElement(ln,{expanded:!1})):cr.createElement("div",{...g})});let p=f.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:f,runtimeSelectableItems:p,columns:u,menuId:c}};var $t=j(require("react")),ut=require("react");var ai=class extends Gn{constructor(e){super(e.slice(0,3))}};var jC=250;function $C(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}Ve(i)};Ve(()=>{i()})})}var UC=De(),Xa=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||jC;this.getPointerMoveTarget=()=>document.documentElement||UC;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 je({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 ai([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new ai([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,$C(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new je({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.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}};var Za=require("react"),Sc=(0,Za.createContext)(null);function Tc(){return(0,Za.useContext)(Sc)}var ur=require("react");function Jg(){let n=(0,ur.useRef)(!0);return(0,ur.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,ur.useCallback)(()=>n.current,[])}function YC(n,e){let{parentMenuId:t,setSubmenuApi:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=n.menu;return u?(typeof u=="function"&&(u=u()),$t.createElement(Ut,{key:c,parentMenuItemKey:n.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,f)=>{u?.onShow?.(d,f),o(f)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(n.key),s.focus())}})):null}function qC(n,e){let t=eh(n,e);if(!t.length)return null;let o=xe.from(t[0]?.getBoundingClientRect()),r=xe.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function eh(n,e){let t=Fo(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function XC(n,e){let t=eh(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function ZC({onItemActivate:n}){let{getState:e}=Tc(),[{onItemEnter:t,onItemLeave:o}]=(0,ut.useState)(()=>new Xa({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(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?xe.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,ut.useCallback)(t,[]),onItemLeave:(0,ut.useCallback)(o,[])}}function th(n){let{domProps:e}=n,{componentState:{columns:t,runtimeItems:o,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:f,autoFocus:p,parentMenuItemKey:m,domRef:g},componentActions:b,getState:h}=Tc(),y=(0,ut.useCallback)(B=>{b.keyboardActiveItemKey=B},[]),S=(0,ut.useCallback)(B=>{b.activeItemKey=B},[]),T=Jg(),[C,w]=(0,ut.useState)(null),I=null;(0,ut.useLayoutEffect)(()=>{let{runtimeItems:B}=h(),Y=B.filter(re=>re.type==="item"&&i===re.key)[0];if(!Y||!Y.menu){w(null),P();return}if(Y){let re=qC(r,Y.key);re&&x(()=>YC(Y,{constrainTo:l,setSubmenuApi:w,setActiveItemKey:S,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:G,api:E}),{id:`${r}-submenu`,alignTo:re,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(B,Y)=>{y(Y.key),S(Y.key),Y.originalMenuItem.onClick&&Y.originalMenuItem.onClick(B);let re={key:Y.key,item:Y.originalMenuItem,hideMenu:G};Y.originalMenuItem.onAction&&Y.originalMenuItem.onAction(re),c&&c(re),Y.originalMenuItem.hideMenuOnAction&&G()},{showOverlay:x,portal:R,clearAll:P}=ro({portalContainer:!1}),{onItemEnter:A,onItemLeave:M}=ZC({onItemActivate:B=>{if(!T())return;let Y=B?B.key:null;S(Y)}});I=o.map((B,Y)=>$t.createElement(QC,{key:B.type==="item"?B.key:Y,onItemEnter:(re,ge)=>{A(re.key,ge)},onItemLeave:(re,ge)=>{M(re.key,ge)},columns:t,active:B.type==="item"&&B.key===i,keyboardActive:B.type==="item"&&B.key===a,item:B,index:Y,onClick:v}));let D=t.map(B=>B.width||(typeof B.flex=="number"?`${B.flex}fr`:B.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:D,gridTemplateRows:o.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function O(B){let{runtimeItems:Y,runtimeSelectableItems:re}=h(),ge=Y.findIndex(q=>q.type==="item"&&q.key===a),be=a,ae=Y[ge],de={ArrowUp:()=>{let q=Y.slice(0,ge).filter(k=>k.type==="item"&&!k.disabled).pop();q&&q.type==="item"&&q.key&&(be=q.key)},ArrowDown:()=>{let q=Y.slice(ge+1).filter(k=>k.type==="item"&&!k.disabled)[0];q&&q.type==="item"&&q.key&&(be=q.key)},Home:()=>{de.PageUp()},End:()=>{de.PageDown()},PageUp:()=>{be=re[0].key},PageDown:()=>{be=re[re.length-1].key},ArrowLeft:()=>{S(null),h().parentMenuId&&(b.destroyed=!0)},ArrowRight:()=>{ae&&(S(ae.key),Ve(()=>{T()&&C&&C.getParentMenuId()===h().menuId&&C.focus()}))},Enter:()=>{if(ae)if(ae.originalMenuItem?.menu){if(ae&&ae.originalMenuItem.menu&&C){de.ArrowLeft();return}ae&&S(ae.key)}else v(B,ae)}," ":()=>{if(!ae)return;ae.originalMenuItem.menu||v(B,ae);let q=XC(r,ae.key);q&&q.click()},Escape:()=>{de.ArrowLeft();let q=h();q.parentMenuId||q.onHideIntent?.(q)}},pe=de[B.key];pe&&(pe(),B.preventDefault()),be!=a&&y(be)}function L(){b.focused=!1}let V=(0,ut.useCallback)(function(){b.focused=!0,setTimeout(()=>{z.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&y(h().runtimeSelectableItems[0]?.key??null)})},[]),z=(0,ut.useRef)(!0),G=(0,ut.useCallback)(()=>{let B=h();B.onHideIntent?.(B)},[h]),[E]=(0,ut.useState)(()=>({hideMenu:G,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),V())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),F=(0,ut.useCallback)(B=>{B?(g.current=B,d?.(h(),E),p&&E.focus()):(f?.(h()),g.current=B)},[]),X=$t.createElement("div",{className:_n.contents},$t.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:F,onKeyDown:B=>{e.onKeyDown?.(B),O(B)},onMouseDown:B=>{z.current=!1,e.onMouseDown?.(B)},onMouseUp:B=>{z.current=!0,e.onMouseUp?.(B)},onFocus:V,onBlur:L,className:te(Wg,e.className,"InfiniteMenu"),style:_},I),R);return s?null:X}function QC(n){let[e,t]=$t.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=$t.createElement("div",{style:r.style},r.value);else{let u=0;c=o.map((d,f)=>{let p=r.value,m=d.field||d.name,g=f+1,b=g+r.span;if(g<u)return null;u=b;let y={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:b},"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:te(jg({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||n.active}),r.className),onPointerEnter:S=>{r.disabled||n.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||n.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||n.onClick(S,r)}};return d.render?$t.createElement(Vr,{key:`${s}-${m}`,render:d.render,renderParam:{item:p,column:d,value:p[m],domProps:y}}):$t.createElement("div",{key:`${s}-${m}`,...y},p[m])}).filter(Boolean)}return $t.createElement("div",{className:$g},c)}var{ManagedComponentContextProvider:JC}=Ft({initSetupState:Xg,forwardProps:Zg,mapPropsToState:Qg,layoutEffect:!0});function ew(n){let{componentActions:e,componentState:t}=Nt(),o=Oe(t);return dr.createElement(Sc.Provider,{value:{componentActions:e,componentState:t,getState:o}},dr.createElement(th,{domProps:n.domProps}))}function Ut(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:f,parentMenuItemKey:p,autoFocus:m,id:g,onHideIntent:b,__is_infinite_menu_component:h,...y}=n;return dr.createElement(JC,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...n},dr.createElement(ew,{domProps:y}))}Ut[Ua]=!0;var Cc=j(require("react"));function oh(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=e,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{let m=tn(f,e,"column-menu");u.push({key:p,label:m,check:Cc.createElement(fo,{key:f.id,disabled:f.computedVisible&&i.getVisibleColumnsCount()===1,checked:f.computedVisible,onChange:g=>{let b=!!g;i.setVisibilityForColumn(f.id,b),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{if(f.groupByForColumn)return;let m=tn(f,e,"column-menu");u.push({key:p,label:m,check:Cc.createElement(fo,{key:f.id,disabled:!f.computedGroupable,checked:f.computedGroupedBy,onChange:()=>{a.toggleGroupByField(f.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function rh(n,e,t){if(n==null)return null;let{getComputed:o,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Ut,s=o().computedColumnsMap.get(n);if(!s)return null;let c={column:s,columnApi:gt(s.id,e),...e},u=oh([],c),d=a?a(u,c):u,f=m=>{m.__insideMenu=!0},p=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!d||!d.length?null:nh.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:p,onHideIntent:m=>{p(m),t?.()}})}var tw=`[${hs["data-name"]}="${bs["data-name"]}"]`;function ow(n){let{columnId:e,context:t,clearAll:o,showOverlay:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){o(),a.columnMenuVisibleForColumnId=null}let u=n.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${Ap["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(()=>rh(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function ih(){let n=He(),{getState:e,actions:t,columnMenuVisibleForColumnId:o,columnMenuVisibleKey:r}=ie(c=>({getState:c.getState,actions:c.actions,columnMenuVisibleForColumnId:c.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:c.state.columnMenuVisibleKey})),{portalDOMRef:i}=co(c=>({portalDOMRef:c.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=ro({portalContainer:i?.current??!1});return(0,wc.useEffect)(()=>{let c=e();return c.onColumnMenuClick.onChange(u=>{u&&(c.columnMenuTargetRef.current=u.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=u.column.id)})},[]),(0,wc.useEffect)(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=e();if(c){let f=function(p){p.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=f;return document.documentElement.addEventListener("mousedown",f),ow({columnId:c,context:n,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",f)}}else u.current=null,s();return()=>{}},[o,r]),{menuPortal:l}}var ah=j(require("react")),lh=require("react");var nw={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function sh(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=He(),{getDataSourceState:a,getDataSourceMasterContext:l}=eo(),{focusDetectDOMRef:s}=n(),c=(0,lh.useCallback)(async()=>{Pg({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return ah.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:nw})}var fr=require("react");function rw(){let n=He(),{getState:e,editingCell:t}=ie(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;(0,fr.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...Dt({rowIndex:r,columnId:i,...n}),initialValue:a})}},[o])}function iw(){let n=He(),{getState:e,editingCell:t}=ie(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,fr.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...Dt({rowIndex:r,columnId:i,...n}),value:a,error:o,initialValue:l})}},[o])}function aw(){let n=He(),{editingCell:e}=ie(r=>({editingCell:r.state.editingCell})),t=e?.active,o=Eo(t);(0,fr.useEffect)(()=>{!t&&o&&n.api.focus()},[t,o])}function lw(){let n=He(),{editingCell:e,getState:t}=ie(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,fr.useEffect)(()=>{if(o){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...Dt({rowIndex:a,columnId:l,...n}),value:i,initialValue:s};t().onEditAccepted?.(c),n.api.persistEdit({value:i})}},[o])}function sw(){let n=He(),{editingCell:e,getState:t}=ie(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;(0,fr.useEffect)(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...Dt({rowIndex:l,columnId:s,...n}),value:c,initialValue:u};o instanceof Error?i?.({...d,error:o}):a?.(d)}},[o])}function ch(){rw(),iw(),lw(),sw(),aw()}var vc=require("react");var Xo=j(require("react"));var Ic=j(require("react")),Qa=n=>Ic.createElement(ze,{...n},Ic.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"}));var Rc=j(require("react")),uh=n=>Rc.createElement(ze,{...n},Rc.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 dh(n,e,t){if(n==null)return null;let{getComputed:o,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),f=u?.Menu??Ut,p=o().computedColumnsMap.get(n);if(!p)return null;let m=I=>{I.__insideMenu=!0},g=I=>{I.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:b}=i(),h=b[p.computedFilterType];if(!h)return null;let y=h.operators.map(I=>{let v=I.name,x=p.computedFilterValue?p.computedFilterValue.filter.operator===v:v===h.defaultOperator,R=I.components?.Icon??Fn;return{key:v,icon:Xo.createElement(R,null),label:Xo.createElement(Xo.Fragment,null,I.label??I.name),onAction:()=>{c.setColumnFilterOperator(n,v)},checked:x?Xo.createElement(uh,{size:16}):null}}),T=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Xo.createElement(Qa,null),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(n)}},"-"],...y],C={column:p,api:c,getState:r,getDataSourceState:i,getComputed:o,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:p.computedFilterValue,filterTypes:b},w=d?d(T,C):T;return Xo.createElement(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:w,onShow:I=>{I.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:I=>{g(I),t?.()}})}var Ja=10;function fh(){let{portalDOMRef:n}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=He(),{getState:t,actions:o}=e,{showOverlay:r,portal:i,clearAll:a}=ro({portalContainer:n?.current??!1});return(0,vc.useEffect)(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:c,column:u}=s;function d(){a(),o.filterOperatorMenuVisibleForColumnId=null}let f=c?.parentElement||c,p=xe.from(f.getBoundingClientRect());p.top-=Ja,p.left-=Ja,p.width+=2*Ja,p.height+=2*Ja,r(()=>dh(u.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=u.id}),[]),(0,vc.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var li=require("react");var Mc=j(require("react"));var Dc=j(require("react"));function el(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function xc(n){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),n.onHideIntent?.()}}}function Pc(n,e,t){if(!n)return null;let o=Te();return n.then(r=>{let{items:i,columns:a}=el(r);i&&i.length&&o(Dc.createElement(t,{...e,items:i||[],columns:a}))}),Dc.createElement(Go,{updater:o})}function ph(n,e,t){let{columnId:o,rowIndex:r,event:i}=n,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Ut,{computedColumnsMap:d}=a(),f=d.get(o),p={...Dt({...e,rowIndex:r,columnId:f.id}),event:i};if(!f||!c)return{cellContext:p,menu:null,preventDefault:!1};let m=xc({onHideIntent:t}),g=c(p,e),b=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:p,menu:Pc(g,m,u),preventDefault:b};let{items:h,columns:y}=el(g);return!h||!h.length?{cellContext:p,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:b,menu:Mc.createElement(u,{...m,columns:y,items:h}),cellContext:p}}function mh(n,e,t){let{getState:o,getComputed:r}=e,{components:i,getContextMenuItems:a}=o(),l=i?.Menu??Ut,{computedColumnsMap:s}=r(),c=n.columnId?s.get(n.columnId):void 0,u=c?{...n,...Dt({...e,rowIndex:n.rowIndex,columnId:c.id})}:n;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=xc({onHideIntent:t}),f=a(u,e),p=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:u,menu:Pc(f,d,l),preventDefault:p};let{items:m,columns:g}=el(f);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:p,menu:Mc.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var tl=5,gh=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function hh(){let n=He(),{portalDOMRef:e}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=ro({portalContainer:e?.current??!1});return(0,li.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:c}=n;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:f}=d;function p(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:b}=ph(d,n,p),h=xe.fromPoint({top:f.clientY,left:f.clientX});h.width+=tl,h.height+=tl,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:gh}),b&&f.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:y}=s();y&&y({...g,getState:s,getDataSourceState:c},f)})},[]),(0,li.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function bh(){let n=He(),{portalDOMRef:e}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=ro({portalContainer:e?.current??!1});return(0,li.useEffect)(()=>{let{actions:l,getState:s}=n;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function f(){a(),l.contextMenuVisibleFor=null}let{menu:p,cellContext:m,preventDefault:g}=mh(u,n,f),b={top:d.clientY,left:d.clientX},h=xe.fromPoint(b);h.width+=tl,h.height+=tl,r(p,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:gh}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:b,...u};let{onContextMenu:y}=s();y&&y({...n,...m},d)})},[]),(0,li.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var yh=require("react"),Sh=j(require("react"));var ol=require("react");function nl(n,e){let{brain:t}=ie(r=>({brain:r.state.brain})),o=(0,ol.useCallback)(n,e);(0,ol.useEffect)(()=>t.onScroll(o),[t,o])}var Ac="yzx0vj0";function Th(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=(0,yh.useRef)(null);nl(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=he.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=he.runtime.bodyWidth),o==="column"?l.minWidth=he.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=he.runtime.bodyWidth),t==="column"?l.maxWidth=he.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=he.runtime.bodyWidth),Sh.createElement("div",{ref:a,...i,className:i.className?te(i.className,Ac):Ac,style:l},i.children)}var cw=ee(Q.columnWidthAtIndex),uw=ee(Q.columnOffsetAtIndex);function Ch(){let{computedVisibleColumns:n}=ie(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${cw}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${uw}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var rl="InfiniteTable";var wh=require("react");function Ih(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=ie(u=>({getState:u.getState,actions:u.actions,dataSourceActions:u.dataSourceActions,getDataSourceState:u.getDataSourceState})),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,wh.useEffect)(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:p,repeatWrappedGroupRows:m}=o(),g=!1,b=l.rowsPerPage,h=(r&&r.length>0||i)&&b>0?b:null;return p!=h&&(t.rowsPerPage=h,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,f=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),f()}},[l,s,r,i,c])}var wn=require("react");var si=ye({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Rh="_143ofgf5",vh="_143ofgf3";var dw=ee(he.loaded),Ec={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Dh(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{...Ec,url:_c(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...Ec,url:_c(),type:t,payload:{debugId:o,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 _c=pt(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function fw(n){window.postMessage(n)}var pw=pt(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){kt.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(Dh({type:"update",debugId:e},t))}else dm(e),window.postMessage(Dh({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Ue.onLogIntent("IT:*",e=>{fw({...Ec,url:_c(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let o="";try{o=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return o}return String(t)}),timestamp:e.timestamp}})}),n});function xh(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=ie(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),o=n(),{domRef:r,debugId:i}=o;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(dw)!==`${cd}`&&ti({debugId:i,key:"CSS001_CSS"}),(0,wn.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),hw()}var il=Te(),mw={revertAll:n=>{let e=kt.get(n.debugId);if(e){let t=$o.get(n.debugId);$o.delete(n.debugId),yo.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=To.get(n.debugId);To.delete(n.debugId),So.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=kt.get(n.debugId);if(e){let t=n.property,o=yo.get(n.debugId),r=$o.get(n.debugId),i=So.get(n.debugId),a=To.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=To.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:n=>{let e=kt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),oi(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),oi(n.debugId))}}},discardAllWarnings:n=>{let e=kt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),oi(n.debugId))},setColumnVisibility:n=>{Qs(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{Oa(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{Qs(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{Oa(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{Oa(n.debugId,"multiSort",n.multiSort)},highlight:n=>{let e=kt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${si.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(si.classNames.base),r.innerHTML=[`<div class="${vh}"></div>`,`<div class="${Rh}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(si.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(si.classNames.variants.active.true)}}}}};function gw(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&typeof n.data.target=="string"&&n.data.target==="infinite-table-page"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(pw(),il(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=mw[e];t&&t(n.data.payload)}})}gw();function hw(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=ie(u=>({getState:u.getState,getComputed:u.getComputed,getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions,actions:u.actions,dataSourceApi:u.dataSourceApi,api:u.api})),s=n().debugId,c=(0,wn.useRef)(s);return c.current=s,(0,wn.useEffect)(()=>{let u=c.current;if(!u)return;let d=p=>{p(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},f=il.get();if(f){d(f);return}return il.onChange(p=>{p&&d(p)})},[]),(0,wn.useEffect)(()=>{let u=c.current;if(!u)return;let d=il.get();d&&d(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),(0,wn.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function Ph(){let{masterPortalDOMRef:n}=co(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=ie(o=>o.state.portalDOMRef);return n?.current??e?.current}var At=j(require("react")),Lh=require("react");var Mh="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Ah=ye({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),Eh="hs68h81",_h=ye({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"]]});var In=j(require("react"));function Oh(n){return In.createElement("div",{...n.domProps})}function Fh(n){let{active:e}=n;return In.createElement("div",{className:Eh},e?"Drop to group":"Drag columns to group")}function Nh(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return In.createElement("div",{...n.domProps},n.label,In.createElement("div",{className:Ri[1]}),In.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:Mh,onKeyDown:e,onMouseDown:n.onClear},In.createElement(Qa,{size:20})))}var bw=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};De().addEventListener("mousemove",i,{once:!0}),De().addEventListener("mouseup",()=>{r||(De().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function yw(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s}=pn(),c=l===pr,u=He(),d=(e?tn(e.id,u,"grouping-toolbar"):r)??i,f=e?At.createElement(Zi,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,p=At.createElement(At.Fragment,null,d,f),m=s===i&&l===pr,g=te(Ah({draggingInProgress:c,active:m}),n.domProps?.className),b=bw(a,n.domProps?.onMouseDown),h={...n.domProps,className:g,onMouseDown:b},y=o?.ToolbarItem??Nh;return At.createElement(y,{active:m,domProps:h,column:e,field:r,label:p,onClear:t})}var pr="grouping-toolbar";function kh(n){let{groupBy:e}=Fe(S=>({groupBy:S.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=ie(S=>({getComputed:S.getComputed,dataSourceApi:S.dataSourceApi,api:S.api})),{dropTargetListId:i,dragSourceListId:a}=uo(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===pr,u=a===pr,d=n.components?.Placeholder??Fh,f=n.components?.Host??Oh,p=e.length?At.createElement(At.Fragment,null,e.map((S,T)=>{let C=S.field?l.get(S.field):void 0,w=`${S.field??`idx-${T}`}`;return At.createElement(zo.DraggableItem,{key:w,id:w},I=>At.createElement(yw,{id:w,components:n.components,domProps:I,field:S.field,column:C,toggleSorting:()=>{C&&r.toggleSortingForColumn(C.id)},onClear:()=>{let v=e.filter(x=>x!==S).filter(Boolean);o.setGroupBy(v)}}))})):At.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let T=S.map(C=>e[C]);o.setGroupBy(T)},g=S=>{let{dragItemId:T}=S,C=T,w=s.get(C);if(!w||!w.field||!w.computedGroupable)return;let I=[...e];I.splice(S.dropIndex,0,{field:w.field}),o.setGroupBy(I)},b=(0,Lh.useCallback)(S=>{let{computedColumnsMap:T}=t(),C=S.dragItem.id,w=T.get(C);return!(!w||!w.computedGroupable||e.some(I=>I.field===w.field))},[e]),h=n.orientation??"horizontal",{domProps:y}=n;return At.createElement(zo,{orientation:h,dragListId:pr,acceptDropsFrom:["header",pr],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:b},(S,{draggingInProgress:T,status:C})=>{let w=te(_h({active:c,orientation:h,draggingInProgress:T,dropRejected:C==="rejected"}),S.className,y?.className),I={...S,...y,className:w,children:p};return At.createElement(f,{active:c,rejectDrop:C==="rejected",domProps:I,orientation:h})})}var gr=j(require("react"));var Oc=require("react"),io=require("react"),al=j(require("react"));function zh(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return ha(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}var wo=j(require("react"));var Vh=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var ci=require("react");function Sw(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function Tw(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=Pm(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(n,l),r.detailDataSourcesStateToRestore=a}function Cw(n,e){let t=(0,ci.useRef)(!1);return{currentRowCache:(0,ci.useMemo)(()=>({getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)}),[e,n]),cacheCalledByRowDetailRenderer:t}}function Gh(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=Fe(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=ie(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=Cw(t.id,e),s=(0,ci.useMemo)(()=>{let c=o().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:pt(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)});return}Sw(t.id,{masterState:o(),detailContext:d}),requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)}),d.dataSourceState.onCleanup.onChange(()=>{let f=a.get();f&&Tw(t.id,{detailState:d.getDataSourceState(),masterActions:r,masterState:o(),cacheEntryForRow:f})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Hh(){return Do()}var{rootClassName:ww}=ke,Iw=`${ww}RowDetail`;function Rw(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=Gh({rowDetailsCache:a,rowInfo:r}),c=Mn(),[u]=wo.useState(()=>Hh());return u.setSnapshot(l),wo.useLayoutEffect(()=>{u.notify()},[l]),wo.createElement(c.Provider,{value:u},wo.createElement("div",{ref:e,className:te(Iw,Vh({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${Q.bodyWidth} - ${Q.scrollbarWidthVertical})`,height:o}},t(r,s)))}var Kh=wo.memo(Rw);var vw=1;function Bh(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:c,onRowMouseEnter:u,onRowMouseLeave:d,groupRenderStrategy:f,brain:p,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:b,isRowDetailsEnabled:h,cellClassName:y,cellStyle:S,rowStyle:T,rowDetailCache:C,rowClassName:w,onScrollToTop:I,onScrollToBottom:v,onScrollStop:x,scrollToBottomOffset:R,wrapRowsHorizontally:P,updatedAt:A,ready:M,editingCell:D}=ie(H=>({actions:H.actions,getState:H.getState,getComputed:H.getComputed,getDataSourceMasterContext:H.getDataSourceMasterContext,rowHeight:H.state.rowHeight,rowDetailHeight:H.state.rowDetailHeight,onRowMouseEnter:H.state.onRowMouseEnter,onRowMouseLeave:H.state.onRowMouseLeave,groupRenderStrategy:H.state.groupRenderStrategy,brain:H.state.brain,showZebraRows:H.state.showZebraRows,rowDetailRenderer:H.state.rowDetailRenderer,isRowDetailsExpanded:H.state.isRowDetailExpanded,isRowDetailsEnabled:H.state.isRowDetailEnabled,cellClassName:H.state.cellClassName,cellStyle:H.state.cellStyle,rowStyle:H.state.rowStyle,rowDetailCache:H.state.rowDetailCache,rowClassName:H.state.rowClassName,onScrollToTop:H.state.onScrollToTop,onScrollToBottom:H.state.onScrollToBottom,onScrollStop:H.state.onScrollStop,scrollToBottomOffset:H.state.scrollToBottomOffset,wrapRowsHorizontally:H.state.wrapRowsHorizontally,updatedAt:H.state.updatedAt,ready:H.state.ready,editingCell:H.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:O,computedVisibleColumns:L,computedColumnsMap:V,computedRowHeight:z,computedRowSizeCacheForDetails:G,fieldsToColumn:E,rowspan:F,toggleGroupRow:X,columnSize:B}=e,{dataArray:Y,rowInfoStore:re,selectionMode:ge,cellSelection:be,isNodeReadOnly:ae,getDataSourceState:de,dataSourceApi:pe,dataSourceActions:q}=Fe(H=>({dataSourceApi:H.dataSourceApi,dataSourceActions:H.dataSourceActions,getDataSourceState:H.getDataSourceState,dataArray:H.dataSourceState.dataArray,rowInfoStore:H.dataSourceState.rowInfoStore,selectionMode:H.dataSourceState.selectionMode,cellSelection:H.dataSourceState.cellSelection,isNodeReadOnly:H.dataSourceState.isNodeReadOnly})),k=Oe(Y);zh({columnSize:B,brain:p,computedPinnedStartColumns:_,computedPinnedEndColumns:O,computedVisibleColumns:L,computedRowHeight:z,dataArray:Y,bodySize:t,rowspan:F});let U=(0,io.useRef)(0);(0,io.useEffect)(()=>p.onRenderCountChange(()=>{U.current=p.scrollTopMax}),[p]),(0,io.useEffect)(()=>p.onRenderRangeChange(H=>{i().onRenderRangeChange?.(H)}),[p]),(0,io.useEffect)(()=>p.onScrollStop(H=>{let{scrollTop:ce,scrollLeft:N}=H;if(ce===0&&I?.(),ce+(R??vw)>=U.current){v?.();let{livePagination:me,livePaginationCursor:Me,dataArray:Ae}=de();me&&(q.cursorId=Me!==void 0?Date.now():Ae.length)}if(x){let me=p.getRenderRange();x({scrollTop:ce,scrollLeft:N,renderRange:me,viewportSize:i().bodySize,firstVisibleRowIndex:me.start[0],lastVisibleRowIndex:me.end[0],firstVisibleColIndex:me.start[1],lastVisibleColIndex:me.end[1]})}}),[p,I,v,x]),(0,io.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,io.useEffect)(()=>{let{onReady:H}=i();H&&H({api:o,dataSourceApi:pe})},[M]);let K=(0,Oc.useMemo)(()=>({isNodeReadOnly:ae,selectionMode:ge,cellSelection:be}),[ae,ge,be]),Z=(0,io.useCallback)(H=>{let{rowIndex:ce,colIndex:N,heightWithRowspan:J,domRef:fe,hidden:me,width:Me,onMouseLeave:Ae,onMouseEnter:Ge}=H,Le=k()[ce],We=L[N];if(!Le||!We)return null;let et=G?G.getRowHeight(ce):J,tt=!1;!h||typeof h=="function"&&!h(Le)?tt=!1:b&&(tt=b(Le)?"expanded":"collapsed");let ot=P?p.getRowIndexInPage(ce):null,$=P?p.getPageIndexForRow(ce):null,se=o.isEditorVisibleForCell({rowIndex:ce,columnId:We.id});return al.createElement(yf,{...{getData:k,virtualized:!0,showZebraRows:m,groupRenderStrategy:f,rowIndexInHorizontalLayoutPage:ot,horizontalLayoutPageIndex:$,rowIndex:ce,rowInfoStore:re,hidden:me,toggleGroupRow:X,rowHeight:et,rowDetailState:tt,onMouseEnter:Ge,onMouseLeave:Ae,onRowMouseEnter:u,onRowMouseLeave:d,domRef:fe,width:Me,column:We,columnsMap:V,fieldsToColumn:E,rowStyle:T,rowClassName:w,cellStyle:S,cellClassName:y,inEditMode:se,getDataSourceState:de,dataSourceApi:pe,dataSourceActions:q,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:K}})},[s,c,u,d,G,z,b,k,L,V,E,f,P,X,m,p,re,T,w,y,S,de,pe,q,i,o,r,a,l,A,D,K]),ne=(0,Oc.useMemo)(()=>{if(b)return H=>{let{rowIndex:ce,domRef:N}=H,fe=k()[ce];if(!fe||!b(fe)||!G)return al.createElement("div",{ref:N,className:mu.hidden});let{rowDetailHeight:me,rowHeight:Me}=G.getSize(ce);return al.createElement(Kh,{rowInfo:fe,rowDetailsCache:C,rowIndex:ce,domRef:N,detailOffset:Me,rowDetailHeight:me,rowDetailRenderer:g})}},[M,Z,g,c,b,C]);return{renderCell:Z,renderDetailRow:ne}}var Wh=require("react");function jh(){let{state:n,getState:e,actions:t}=ie(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=Eo(o);(0,Wh.useEffect)(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=cc(rl,!!o);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,o])}var Yh=j(require("react"));var $h="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Uh=te($h,cs);function qh(n){return Yh.createElement("div",{...n,className:n.className?te(Uh,n.className):Uh})}var mr=j(require("react"));var Xh={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},Zh="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Qh="qy58ya4";var{rootClassName:Dw}=ke,Fc=`${Dw}-LoadMask`;function xw(n){let{visible:e,children:t="Loading"}=n;return mr.createElement("div",{className:`${Xh[e?"visible":"hidden"]} ${Fc}`},mr.createElement("div",{className:`${Zh} ${Fc}-Overlay`}),mr.createElement("div",{className:`${Qh} ${Fc}-Text`},t))}var ll=mr.memo(xw);var Jh=require("react");var Pw=[ef,`${Qt}--hovered`];function Mw(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function Rn(n){let e=He(),t=xo(),{getComputed:o,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:f,brain:p,scrollerDOMRef:m,components:g,bodySize:b,activeCellIndex:h,rowDetailRenderer:y,showHoverRows:S,wrapRowsHorizontally:T,domProps:C,domRef:w,forceBodyRerenderTimestamp:I,rowHoverClassName:v,ready:x}=ie(F=>({ready:F.state.ready,columnReorderDragColumnId:F.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:F.state.forceBodyRerenderTimestamp,renderer:F.state.renderer,onRenderUpdater:F.state.onRenderUpdater,debugId:F.state.debugId,keyboardNavigation:F.state.keyboardNavigation,activeRowIndex:F.state.activeRowIndex,loadingText:F.state.loadingText,scrollStopDelay:F.state.scrollStopDelay,brain:F.state.brain,scrollerDOMRef:F.state.scrollerDOMRef,components:F.state.components,bodySize:F.state.bodySize,activeCellIndex:F.state.activeCellIndex,rowDetailRenderer:F.state.rowDetailRenderer,showHoverRows:F.state.showHoverRows,wrapRowsHorizontally:F.state.wrapRowsHorizontally,domProps:F.state.domProps,domRef:F.state.domRef,rowHoverClassName:F.state.rowHoverClassName})),R=g?.LoadMask??ll,P=o(),{computedRowHeight:A,computedRowSizeCacheForDetails:M}=P,D=M?.getRowHeight||A,{loading:_}=Fe(F=>({loading:F.dataSourceState.loading})),O=gr.useCallback(F=>{let X=e.getState(),B=F.target;if(!t&&F._from_row_detail)return;t&&(F._from_row_detail=!0);let Y=sd(B,sc(),X.domRef.current),re,ge,be,ae;Y&&(ge=Number(Y.dataset.colIndex),ae=Number(Y.dataset.rowIndex),re=e.getComputed().computedVisibleColumns[ge].id,be=e.dataSourceApi.getRowInfoArray()[ae].id);let de={columnId:re,colIndex:ge,rowId:be,rowIndex:ae,event:F,target:Y??F.target};Y&&X.cellContextMenu(de),X.contextMenu(de)},[]),{renderCell:L,renderDetailRow:V}=Bh({imperativeApi:r,getComputed:o,domRef:w,bodySize:b,computed:P}),{autoFocus:z,tabIndex:G}=C??{};jh();let E=(0,Jh.useMemo)(()=>{if(!S)return;let F=[];return v&&(F=F.concat(v)),n.rowHoverClassName&&(F=F.concat(n.rowHoverClassName)),Rn.rowHoverClassName&&(F=F.concat(Rn.rowHoverClassName)),Mw(F)},[S,v,n.rowHoverClassName,Rn.rowHoverClassName]);return gr.createElement(qh,{onContextMenu:O},gr.createElement(pp,{forceRerenderTimestamp:I,debugId:l,tabIndex:G??0,autoFocus:z??void 0,activeRowIndex:x&&s==="row"?c:null,activeCellIndex:x&&s==="cell"&&!d?h:null,scrollStopDelay:f,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:p,activeCellRowHeight:D,renderCell:L,renderDetailRow:y?V:void 0,cellHoverClassNames:E,scrollerDOMRef:m,scrollVarHostRef:w}),gr.createElement(R,{visible:_},u))}Rn.rowHoverClassName=Pw;var Zt=ke.rootClassName,{ManagedComponentContextProvider:Aw}=Ft({initSetupState:qm,forwardProps:Xm,mapPropsToState:eg,cleanup:Zm,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Jm(),getParentState:()=>Ia(n=>n),debugName:n=>Ho(n.debugId,rl)}),eb=ve.memo(function(){let e=yi(),{componentState:t,api:o,initialChildren:r}=ie(z=>({componentState:z.state,api:z.api,initialChildren:z.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=Fe(z=>({dataArrayLength:z.dataSourceState.dataArray.length,getDataSourceState:z.getDataSourceState,dataSourceActions:z.dataSourceActions,dataSourceApi:z.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:f,onRowDetailHeightCSSVarChange:p,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:b,columnHeaderHeightCSSVar:h,scrollStopDelay:y,brain:S,activeRowIndex:T,activeCellIndex:C}=t,{licenseKey:w}=t;!w&&ao.licenseKey&&(w=ao.licenseKey),bg(T,i,o),hg(C,i,o);let{onKeyDown:I}=Lg();ve.useEffect(()=>{let z=a(),G=_t(E=>{z.notifyRenderRangeChange({renderStartIndex:E[0],renderEndIndex:E[1]})},{wait:y});return S.onVerticalRenderRangeChange(G)},[S,y]);let v=gg(w),{autoFocus:x,tabIndex:R,...P}=t.domProps??{},A=xd(P);ve.useEffect(()=>{S.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),Vm(),Ih(),ch();let{menuPortal:M}=ih(),{menuPortal:D}=hh(),{menuPortal:_}=bh(),{menuPortal:O}=fh();ve.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(t.id,t.ready,o,{dataSourceApi:s})},[t.ready,o,s]);let L=xh();ve.useEffect(()=>{if(e){let z=e.getSnapshot();u.current=z.getMasterState().portalDOMRef.current}},[]);let V=r??ve.createElement(ve.Fragment,null,ve.createElement(zs,null),ve.createElement(Rn,null));return ve.createElement("div",{"data-debug-id":L,onKeyDown:I,ref:c,...A},V,ve.createElement("div",{ref:u,className:te(`${mt}Portal`,gu[1e7],vi.absolute,fu[0],cu[0])},M,D,_,O),g?ve.createElement(vr,{key:"row-height",varName:g,onChange:d}):null,ve.createElement(vr,{key:"flashing-duration",allowInts:!0,varName:he.components.Cell.flashingDuration,onChange:f}),b?ve.createElement(vr,{key:"row-detail-height",varName:b,onChange:p}):null,h?ve.createElement(vr,{key:"column-header-height",varName:h,onChange:m}):null,v?null:ve.createElement(Np,null),ve.createElement(sh,null))});function Ew({children:n,store:e}){let{componentActions:t,componentState:o}=Nt(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=Oe(o),l=ug({state:o,actions:t,getState:a}),s=Oe(l),c=yi(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:f,dataSourceApi:p}=eo(),[m]=ve.useState(()=>zm({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:f,dataSourceApi:p,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:f,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:p,children:n};return e.setSnapshot(g),ve.useLayoutEffect(()=>{e.notify()}),hi(r,b=>{let h={width:b.width,height:b.height};t.bodySize=h},{earlyAttach:!0,debounce:50}),ve.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),ve.createElement(eb,null)}var _w=40,Ow=Sg(ud),ao=function(n){let[e]=ve.useState(()=>yg()),t=_i();return ve.createElement(Aw,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:_w,columnHeaderHeight:Ow,...n},ve.createElement(zi,null,ve.createElement(t.Provider,{value:e},ve.createElement(Ew,{children:n.children,store:e}))))};ao.Header=zs;ao.Body=Rn;ao.HScrollSyncContent=Th;ao.Footer=()=>ve.createElement(bu,null);ao.GroupingToolbar=kh;var tb=j(require("react"));function Fw(n){let{DataSource:e}=nr({nodesKey:"children",...n});return tb.createElement(e,null,n.children??null)}var ob=j(require("react"));function nb(n){return ob.createElement(ao,{...n})}var rb=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Je(i,{treePaths:o});r.forEachLeafNodePath((u,{selected:d})=>{l.setNodeSelection(u,d)}),a&&r.forEachLeafNodePath(u=>{l.setNodeSelection(u,a.selected)},a.nodePath);let c={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};n(c)};var sl=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 o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=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,o(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=Ue(`IT:${e}:DataQuery`)}};function vn(n){if(Array.isArray(n))return n.map(vn);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=vn(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var Io=class Io{constructor(e){this.queryCache=new oe;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=vn(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new sl(`${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:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=vn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=vn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=vn(e);this.queryCache.delete(t)};if(this.options=e,Io.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)}Io.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=Io.clients.get(e);t&&t.destroy()}static destroyAll(){Io.clients.forEach(e=>{Io.destroy(e.name)})}destroy(){Io.clients.delete(this.options.name)}};Io.clients=new Map;var Nc=Io;var Nw={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},ib={instantEdit:Nw};var Lw=require("react");function ab(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var ul=class ul{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ul.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.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[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}};ul.DEFAULT_SIZE=10;var cl=ul;var fl=class fl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??fl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.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[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};fl.DEFAULT_SIZE=10;var dl=fl;var Dn=require("react"),kw=(n,e)=>n.every((t,o)=>t===e[o]),lb=(n,e)=>{let t=(0,Dn.useRef)(e),o=kw(e,t.current),r=(0,Dn.useRef)(!0);t.current=e;let i=(0,Dn.useRef)(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=(0,Dn.useRef)(n);l.current=n,(0,Dn.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var Zo=require("react"),sb=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),pl=(n,e)=>{let{same:t,different:o,compare:r}=e,i=(0,Zo.useRef)(t),a=(0,Zo.useRef)(o),l=sb(t,i.current,r),s=!sb(o,a.current,r),c=(0,Zo.useRef)(!0);i.current=t,a.current=o;let u=(0,Zo.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let f=(0,Zo.useRef)(n);f.current=n,l&&s&&(c.current=!1),(0,Zo.useEffect)(()=>{if(!c.current)return f.current()},d)};var Et=j(require("react"));var cb=ee(Q.currentFlashingDuration),zw=({children:n})=>Et.createElement(Et.Fragment,null,n),ub=1e3,db={up:Wi({direction:"up"}).split(" "),down:Wi({direction:"down"}).split(" "),neutral:Wi({direction:"neutral"}).split(" ")},Lc=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=zw}=n;return Et.forwardRef((i,a)=>{let l=zr(),{flashingDurationCSSVarValue:s}=ie(I=>({flashingDurationCSSVarValue:I.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??ub:e??ub,{domRef:u,value:d,column:f,rowInfo:p,htmlElementRef:m}=l,g=p.id,b=f.id,h=Et.useRef(!0),y=Et.useRef(d),S=h.current?null:y.current;h.current=!1;let T=Et.useRef(void 0),C=Et.useRef(void 0),w=Et.useRef(void 0);return pl(()=>{if(d===y.current)return;let I=()=>{let P=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),w.current&&(clearTimeout(w.current),w.current=void 0),C.current&&P){let A=C.current,M=db[A];P.classList.remove(...t?[t,...M]:M),P.style.removeProperty(cb),C.current=void 0}};y.current=d;let v=m.current;if(!v)return;I();let x=typeof d=="number"?d>S?"up":"down":"neutral",R=db[x];return v.style.setProperty(cb,`${c}`),v.classList.add(...t?[t,...R]:R),C.current=x,T.current=setTimeout(I,c),I},{same:[b,g],different:[d]}),Et.createElement("div",{ref:u,...i,className:te(i.className)},o({children:i.children,oldValue:S}))})},fb=Lc();var Ze=j(require("react")),hr=require("react");var pb=require("react-dom");function mb(n){let[e,t]=Ze.useState(null);return(0,hr.useEffect)(()=>{let{debugTarget:o}=n,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[o]){let i=globalThis.INFINITE[o].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[n.debugTarget]),typeof e=="function"?Ze.createElement(gb.Provider,{value:{getState:e}},Ze.createElement(Vw,null)):null}var gb=Ze.createContext({getState:()=>null});function Vw(){let n=Ze.useContext(gb),{getState:e}=n,[,t]=Yt(),o=e().renderer.cellManager;(0,hr.useEffect)(()=>{let s=_t(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=(0,hr.useRef)(null),l=(0,hr.useRef)(null);return Ze.createElement("div",{style:{overflow:"auto"}},(0,pb.createPortal)(Ze.createElement("div",{ref:a,style:{position:"absolute",top:0,left:0,width:"0px",height:"0px",pointerEvents:"none",background:"rgba(255, 0, 0, 0.5)",opacity:"0"}}),document.body),Ze.createElement("table",{style:{borderCollapse:"collapse"}},Ze.createElement("thead",null,Ze.createElement("tr",null,i.map(s=>Ze.createElement("th",{key:s,"data-col-index":s},s)))),Ze.createElement("tbody",null,r.map(s=>Ze.createElement("tr",{key:s,"data-row-index":s},i.map(c=>Ze.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:o.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},Ze.createElement("button",{onClick:()=>{let u=o.getCellAt([s,c])?.getElement();if(!u)return;let d=u.getBoundingClientRect();a.current.style.top=`${d.top}px`,a.current.style.left=`${d.left}px`,a.current.style.width=`${d.width}px`,a.current.style.height=`${d.height}px`,a.current.style.opacity="0.5",a.current.style.transition="opacity 0.5s",l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a.current.style.opacity="0",l.current=null},2e3),console.log(u)},style:{cursor:"pointer"}},"(",s,",",c,")"))))))))}var Gw={CheckBox:fo,LoadMask:ll,MenuIcon:Gr,StringFilterEditor:kn,NumberFilterEditor:Fi};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
|
|
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},CC=n=>{let e="",t=n.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let o=e.split(",").reverse(),r=o.pop();o.forEach((l,s)=>{let c=t[s];if(pc(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(pc(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),TC(t)};var IC=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,wC=/(https):\/\/\S+(\.csb\.app)/g,bg=typeof window<"u"?window.location.origin:"",RC=()=>{let[n,e,t]=Array.from(IC.exec(bg)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},vC=()=>{let[n,e,t]=Array.from(wC.exec(bg)||[]);return e==="https"&&t===".csb.app"},DC=vC()||RC(),yg=(n="")=>{let t=!!xo();return(0,hg.useMemo)(()=>{if(t)return!0;let r=gg(n,{publishedAt:1624970570587,version:"8.0.4"});return!n&&!r&&DC?!0:r},[n,t])};var ar=require("react");var xC=10;function Sg(n,e,t){let o=(0,ar.useRef)(!1),r=(0,ar.useRef)(null);(0,ar.useEffect)(()=>{n!=null&&(o.current=!1,Gt(r.current))},[n]),(0,ar.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,Gt(r.current),r.current=Ve(()=>{o.current=t.scrollCellIntoView(n[0],n[1],{offset:30}),!o.current&&l<xC&&a(l)})};var i=a;a()}return()=>{Gt(r.current)}},[n,e])}var lr=require("react"),PC=10;function Tg(n,e,t){let o=(0,lr.useRef)(!1),r=(0,lr.useRef)(null);(0,lr.useEffect)(()=>{n!=null&&(o.current=!1,cancelAnimationFrame(r.current))},[n]),(0,lr.useEffect)(()=>{if(n!=null&&!o.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{o.current=t.scrollRowIntoView(n,{offset:0}),!o.current&&l<PC&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[n,e])}function Cg(){return Do()}var Ig=n=>`--infinite-${n}`;var sr=require("react");function wg(n,e){mc(n,e),AC(n,e),e.detail===2&&MC(n,e),n.getState().onCellClick?.(n,e)}function MC(n,e){if(Gi(e.target))return;let{onCellDoubleClick:t}=n.getState(),o={preventEdit:!1};if(t){let a=t(n,e);a&&typeof a=="object"&&(o={...o,...a})}if(o.preventEdit)return;let i=n.getComputed().computedVisibleColumns[n.colIndex];n.api.startEdit({rowIndex:n.rowIndex,columnId:i.id})}function AC(n,e){let{getDataSourceState:t,getState:o,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=n,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:f}=r(),{brain:p,debugId:m}=o(),{rowsPerPage:g}=p,b=f.length,h=new $e(u);h.debugId=m??"",d.cellSelectionState=h;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let S=!!o().wrapRowsHorizontally;d.multiSelectClick(y,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:b}:{horizontalLayout:S})}else d.resetClick(y);l.cellSelection=h}function mc(n,e){let{rowIndex:t,getDataSourceState:o,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=n,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=o(),{selectionMode:d,groupBy:f,dataArray:p,isTree:m}=u;if(f.length||m||p[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:b}=u;if(b=l(b),s.rowSelectionState=b,b&&typeof b=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=b,!0}else if(d==="single-row"){let h=p[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(h):a.rowSelectionApi.selectRow(h)}return!1}function Rg(n,e){e.detail!==2&&void 0}var EC={Enter:!0," ":!0,a:!0};function vg(n,e){let{getState:t,getDataSourceState:o,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=n,{key:c,ctrlKey:u,metaKey:d}=e;if(!EC[c])return!1;let f=t(),p=o(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:b,keyboardSelection:h}=f,{selectionMode:y,groupBy:S,rowSelection:T,treeSelectionState:C,isTree:I}=p;if(h===!1)return!1;let w=b==="row"&&m!=null?m:b==="cell"&&g!=null?g[0]:null,v=w!=null?p.dataArray[w]:null;if(!v||w==null)return!1;if(y==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(v.id),!0;if(y!=="multi-row")return!1;if(c==="a"&&(u||d)){if(I&&C){let R=s(C);return R.selectAll(),r.treeSelection=R,!0}let x=l(T);return x.selectAll(),r.rowSelection=x,!0}if(c===" "){if(S.length)return v.isGroupRow&&v.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(v.groupKeys):i.rowSelectionApi.toggleRowSelection(v.id),!0;if(I){if(v.isTreeNode&&v.nodePath)return a.treeApi.toggleNodeSelection(v.nodePath),!0}else{let x={...e},{renderSelectionCheckBox:R}=n.getComputed();return R&&(x.metaKey=!1,x.ctrlKey=!0),mc({...n,rowIndex:w},x)}}return!1}var Dg=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),xg=n=>Array.from(n.querySelectorAll(Dg)).filter(t=>!!t.offsetParent),Wa=n=>n.querySelector(Dg);var Mg=j(on());async function Pg(n,e=10,t=300){return new Promise((o,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!n()){setTimeout(a,e);return}o(!0)}a()})}var _C=10,OC=(n,e)=>n-e;function ja(n,e){let{getComputed:t,getDataSourceState:o,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=o(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),f=u[n.colIndex];if(!f)return!1;if(l&&l.columnId===f.id&&l.rowIndex===n.rowIndex)return!0;if(!f.contentFocusable)return!1;if(f.contentFocusable===!0)return!0;let p=c[n.rowIndex],m=!s||typeof s=="function"&&!s(p)?!1:i.rowDetailApi.isRowDetailExpanded(p.id)?"expanded":"collapsed",g=gt(f.id,e);return f.contentFocusable({column:f,...Bn({column:f,rowInfo:p,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function gc(n,e,t){let o=t.getState().editingCell;return FC(n,e,t,{isCellFocusable:ja,isColumnElligible:i=>o&&o.columnId===i.id?!0:!!i.contentFocusable})}function Ag(n,e,t){let o=(0,Mg.default)(t,n+e,OC);return o<0&&(o=~o,e>0&&o>=t.length||e<0&&o===0)?null:t[o]??null}globalThis.getNextCol=Ag;function FC(n,e,t,o){let{isColumnElligible:r,isCellFocusable:i}=o,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,f)=>(d.push(f.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=n.rowIndex,u=n.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:Ag(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 Eg(n){let e={rowIndex:n.getDataSourceState().dataArray.length-1,colIndex:n.getComputed().computedVisibleColumns.length-1},t=ja(e,n)?e:gc(e,-1,n);if(t){await hc([t.rowIndex,t.colIndex],n);let o=n.getState().getDOMNodeForCell(t);if(!o)return;Wa(o)?.focus()}}async function hc([n,e],t){let{api:o}=t;return new Promise((r,i)=>{let a=_C,l=null,s=!1;function c(u=0){u++,Gt(l),l=Ve(async()=>{if(s=o.scrollCellIntoView(n,e,{offset:30}),!s&&u<a&&c(u),s){try{await Pg(()=>!!t.getState().getDOMNodeForCell({rowIndex:n,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var NC=`.${Qt}`;function _g(n,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,o=e.target,r=n.getState().scrollerDOMRef.current,i=document.activeElement===r||o===r;if(!r||i&&t===-1)return!1;let a=i?null:Fo(o,NC),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}=n.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&ja({colIndex:s,rowIndex:l},n)?{rowIndex:l,colIndex:s}:gc({rowIndex:l,colIndex:s},t,n);if(!c){if(t===-1)r.focus();else{let u=xg(document.body),d=n.getState().focusDetectDOMRef.current,f=u.findIndex(m=>m===d);u[f+1]?.focus()}return!0}return hc([c.rowIndex,c.colIndex],n).then(()=>{let u=n.getState().getDOMNodeForCell(c);if(!u)return;Wa(u)?.focus()}),!0}var Og={control:"ctrl"},Fg={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},LC={esc:"escape"},Lg={cmd:n=>n.metaKey,alt:n=>n.altKey,ctrl:n=>n.ctrlKey,shift:n=>n.shiftKey},kg=Object.keys(Lg),bc=new Set(kg),kC=new Set(["shift","alt"]);function $a(n,e){return Array.isArray(e)?e.some(t=>Ng(n,t)):Ng(n,e)}function Ng(n,e){let t=n.key.toLowerCase(),o=e.split("+").map(f=>f.toLowerCase().trim()),r=o.find(f=>Fg[f]),i=o.map(f=>Og[f]||Fg[f]||LC[f]||f),a=i.filter(f=>bc.has(f)),l=i.filter(f=>!bc.has(f)),s=kg.reduce((f,p)=>(f[p]=Lg[p](n),f),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(f=>s[f]);if(!a.every(f=>s[f]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(p=>!kC.has(p)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||bc.has(t)||t==="meta"||Og[t]?!1:l.reduce((f,p)=>f?p==="*"||t===p:!1,!0)}async function zg(n,e){let t={...n,cloneRowSelection:a=>va(a,n.getDataSourceState),cloneTreeSelection:a=>Ma(a,n.getDataSourceState)},{onKeyDown:o}=n.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(o){let a=o(n,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&vg(t,e)&&e.preventDefault(),(_g(t,e)||!n.getState().focusedWithin&&!r.preventNavigation&&zm(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!n.api.isEditInProgress()){let{activeCellIndex:a}=n.getState();if(a){let[l,s]=a,c=n.getComputed().computedVisibleColumns[s];c.computedEditable&&n.api.startEdit({rowIndex:l,columnId:c.id})}}n.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&n.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=n.getState();if(i)for await(let a of i){if(!$a(e,a.key)||a.when&&!await a.when(n))continue;let l=await a.handler(n,e);if(l&&l.stopNext)break}}function zC(){let{getState:n,actions:e,api:t,getComputed:o,getDataSourceMasterContext:r}=He(),{getDataSourceState:i,dataSourceActions:a,dataSourceApi:l}=eo();return(0,sr.useMemo)(()=>({getComputed:o,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:n,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>Ma(u,i),cloneRowSelection:u=>va(u,i)}),[n,e,i,a,t,l,o])}function VC(){let n=zC();(0,sr.useEffect)(()=>{let e=n.getState().keyDown.onChange(a=>{zg(n,a)});function t(a){if(!a)return;let l=a.event,s=n.getComputed().computedVisibleColumns[a.colIndex],c=gt(s.id,n);wg({...n,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let o=n.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=n.getComputed().computedVisibleColumns[c],d=gt(u.id,n);Rg({...n,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=n.getState().cellMouseDown.onChange(r);return()=>{e(),o(),i()}},[])}function GC(){let{getState:n}=re(t=>({getState:t.getState}));return{onKeyDown:(0,sr.useCallback)(t=>{n().keyDown(t)},[])}}function Vg(){return VC(),GC()}var wc=require("react");var Be=j(require("react")),Mt=require("react"),Wg=require("react-dom");function yc(n){return!!n.tagName}function Kg(n){let{alignTarget:e,alignAnchor:t,constrainTo:o,alignPosition:r}=n,i=xe.from(yc(e)?e.getBoundingClientRect():e),a=xe.from(yc(t)?t.getBoundingClientRect():t),l=o?xe.from(yc(o)?o.getBoundingClientRect():o):null;if(!l)return{...Gg({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=Gg({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 Gg(n){let e=xe.from(n.targetRect),t=xe.from(n.anchorRect),o=n.constrainRect?xe.from(n.constrainRect):null,{position:r}=n,[i,a]=r,l=Hg(e,i),s=Hg(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=o?o.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function Hg(n,e){return e==="TopLeft"?je.from({top:n.top,left:n.left}):e==="TopCenter"?je.from({top:n.top,left:n.left+(n.width>0?Math.round(n.width/2):0)}):e==="TopRight"?je.from({top:n.top,left:n.left+n.width}):e==="BottomLeft"?je.from({left:n.left,top:n.top+n.height}):e==="BottomCenter"?je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+n.height}):e==="BottomRight"?je.from({left:n.left+n.width,top:n.top+n.height}):e==="CenterLeft"?je.from({left:n.left,top:n.top+(n.height>0?Math.round(n.height/2):0)}):e==="CenterRight"?je.from({left:n.left+n.width,top:n.top+(n.height>0?Math.round(n.height/2):0)}):je.from({left:n.left+(n.width>0?Math.round(n.width/2):0),top:n.top+(n.height>0?Math.round(n.height/2):0)})}var Ua="__is_infinite_menu_component";function HC(n){return n&&typeof n.then=="function"||n instanceof Promise}function jg(n){return n==null||typeof n=="string"?!1:typeof n.tagName=="string"}async function Bg(n){return typeof n=="function"&&(n=n()),HC(n)&&(n=await n),typeof n=="string"&&(n=document.querySelector(n)),n&&jg(n)&&(n=n.getBoundingClientRect()),n?xe.from(n):null}async function KC(n){let e=null;typeof n=="function"?e=n():e=n;function t(o){let r=null;return typeof o=="string"&&(r=document.querySelector(o)),jg(o)&&(r=o),r||null}return t(await e)}function BC(n){return Be.createElement("div",{style:{position:"fixed",top:0,left:0}},n.children)}function WC(n){let e=Be.useRef(null);return(0,Mt.useEffect)(()=>n.realign.onChange(t=>{e.current&&t&&Sc(e.current,t)}),[n.realign]),Be.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,Mt.useCallback)(t=>{t&&Sc(t,n),e.current=t},[])},typeof n.children=="function"?n.children():n.children)}async function Sc(n,e){let{constrainTo:t,alignTo:o,alignPosition:r}=e;Object.keys(o).length===2&&o.top!==void 0&&o.left!==void 0&&(o={...o,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await Bg(t)||void 0,a=o?await Bg(o):void 0,l=xe.from(n.getBoundingClientRect());if(!a)return;let{alignedRect:s}=Kg({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});n.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=n.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=n.offsetParent;if(u){let d=u.getBoundingClientRect(),f=d.left,p=d.top,m=s.left-f,g=s.top-p;n.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function $g(n,e){let[t,o]=(0,Mt.useState)(null);return(0,Mt.useLayoutEffect)(()=>{async function r(){let i=e?await KC(e):null;i!=null&&o(i)}e&&r()},[e]),e?t?(0,Wg.createPortal)(n,t):Be.createElement(Be.Fragment,null):e===null||e===!1?n:Be.createElement(BC,null,n)}function jC(n){if(Be.Children.count(n)===1){let e=Be.Children.only(n);if(Be.isValidElement(e))return e.props.id||e.key}return null}function $C(n,e,t){if(Be.Children.count(n)===1){let o=Be.Children.only(n);if(Be.isValidElement(o)&&o.type[Ua]){let r={};return o.props.portalContainer===void 0&&(r.portalContainer=e),o.props.constrainTo===void 0&&(r.constrainTo=t),Be.cloneElement(o,r)}}return n}function ro(n){let e=n,[t]=(0,Mt.useState)(()=>new Map),[o,r]=(0,Mt.useState)(null),[i,a]=(0,Mt.useState)(0),l=(0,Mt.useCallback)(()=>{let m=[];for(let[g,b]of t)m.push(Be.createElement(WC,{...b,key:b.key}));return m},[]),[s,c]=Yt(),u=$g(l(),n.portalContainer),d=(0,Mt.useCallback)((m,g)=>{let h=`${g.id||jC(m)||Bt()}`,y=t.get(h),S=I=>()=>{let w=typeof I=="function"?I():I;return $C(w,e.portalContainer,g.constrainTo??e.constrainTo)},T=S(m),C=(I,w)=>{if(!y)return;let v=S(I);Object.assign(y,{children:v}),c(),!!!w?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),C(m),C):(y={key:h,children:T,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:Te()},t.set(y.key,y),c(),C)},[t,e.portalContainer,c]);Be.useEffect(()=>{if(o){let m=t.get(o);m&&m.realign(m)}},[o,i]);let f=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},p=()=>{t.clear(),c()};return Be.useEffect(()=>{},[]),{portal:u,hideOverlay:f,clearAll:p,rerenderOverlays:c,showOverlay:d}}var ah=j(require("react"));var dr=j(require("react"));var cr=j(require("react"));var ai=j(require("react"));function Ya(n){return null}Ya.defaultProps={__is_menu_item:!0};var Ug="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",Yg=ye({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"]]}),qg="db3arf1",Xg="db3arfd";var UC="-";function YC(){return ai.createElement("hr",{className:Xg})}var qa=({columns:n,keyboardActiveItemKey:e,activeItemKey:t,menuId:o},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===UC?ai.createElement(YC,null):r:null;return i!=null?{type:"item",parentMenuId:o,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:n.length,style:{gridColumnStart:1,gridColumnEnd:n.length+10}}};function Zg(n,e){return ai.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Ya)){let o={...t.props};return o.key||(o.key=t.key),o.description||(o.description=t.props.children),o.label||(o.label=o.children),qa(n,o)}return qa(n,t)})||[]}var Qg="submenu";function Jg(){let n=cr.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Bt(),focused:!1,destroyed:!1,domRef:n}}var eh=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),qC=[{name:"label"}],th=n=>{let{props:e,state:t}=n,{activeItemKey:o,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||qC],d={columns:u,keyboardActiveItemKey:r,activeItemKey:o,menuId:c},f=[];i?f=i.map(qa.bind(null,d)):!i&&typeof a!="function"&&(f=Zg(d,a)),l&&f.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==Qg)&&u.push({name:Qg,render:({domProps:g,item:b})=>b.menu?cr.createElement("div",{...g},cr.createElement(ln,{expanded:!1})):cr.createElement("div",{...g})});let p=f.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:f,runtimeSelectableItems:p,columns:u,menuId:c}};var $t=j(require("react")),ut=require("react");var li=class extends Gn{constructor(e){super(e.slice(0,3))}};var XC=250;function ZC(n,e=100){let t=Date.now();return new Promise(o=>{let r,i=()=>{if(r=n(),r!==void 0){o(r);return}if(Date.now()-t>e){o(void 0);return}Ve(i)};Ve(()=>{i()})})}var QC=De(),Xa=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||XC;this.getPointerMoveTarget=()=>document.documentElement||QC;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 je({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 li([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new li([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,ZC(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(o=>{this.activeItem==e&&o&&(this.activeItemMenuRect=o)})}};this.onItemChange=(e,t,o)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new je({left:o.clientX,top:o.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,o.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}};var Za=require("react"),Tc=(0,Za.createContext)(null);function Cc(){return(0,Za.useContext)(Tc)}var ur=require("react");function oh(){let n=(0,ur.useRef)(!0);return(0,ur.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,ur.useCallback)(()=>n.current,[])}function JC(n,e){let{parentMenuId:t,setSubmenuApi:o,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=n.menu;return u?(typeof u=="function"&&(u=u()),$t.createElement(Ut,{key:c,parentMenuItemKey:n.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,f)=>{u?.onShow?.(d,f),o(f)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(n.key),s.focus())}})):null}function eI(n,e){let t=nh(n,e);if(!t.length)return null;let o=xe.from(t[0]?.getBoundingClientRect()),r=xe.from(t[t.length-1].getBoundingClientRect()),i=o;return i.width=r.left+r.width-o.left,i}function nh(n,e){let t=Fo(document.querySelector(`[data-menu-id="${n}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${n}"]`);if(!t)return[];let o=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(o)}function tI(n,e){let t=nh(n,e);if(!t.length)return null;for(let o of t){let r=o.querySelector('input[type="checkbox"]');if(r)return r}return null}function oI({onItemActivate:n}){let{getState:e}=Cc(),[{onItemEnter:t,onItemLeave:o}]=(0,ut.useState)(()=>new Xa({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){n(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];n(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?xe.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,ut.useCallback)(t,[]),onItemLeave:(0,ut.useCallback)(o,[])}}function rh(n){let{domProps:e}=n,{componentState:{columns:t,runtimeItems:o,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:f,autoFocus:p,parentMenuItemKey:m,domRef:g},componentActions:b,getState:h}=Cc(),y=(0,ut.useCallback)(B=>{b.keyboardActiveItemKey=B},[]),S=(0,ut.useCallback)(B=>{b.activeItemKey=B},[]),T=oh(),[C,I]=(0,ut.useState)(null),w=null;(0,ut.useLayoutEffect)(()=>{let{runtimeItems:B}=h(),Y=B.filter(ie=>ie.type==="item"&&i===ie.key)[0];if(!Y||!Y.menu){I(null),P();return}if(Y){let ie=eI(r,Y.key);ie&&x(()=>JC(Y,{constrainTo:l,setSubmenuApi:I,setActiveItemKey:S,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:G,api:E}),{id:`${r}-submenu`,alignTo:ie,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let v=(B,Y)=>{y(Y.key),S(Y.key),Y.originalMenuItem.onClick&&Y.originalMenuItem.onClick(B);let ie={key:Y.key,item:Y.originalMenuItem,hideMenu:G};Y.originalMenuItem.onAction&&Y.originalMenuItem.onAction(ie),c&&c(ie),Y.originalMenuItem.hideMenuOnAction&&G()},{showOverlay:x,portal:R,clearAll:P}=ro({portalContainer:!1}),{onItemEnter:A,onItemLeave:M}=oI({onItemActivate:B=>{if(!T())return;let Y=B?B.key:null;S(Y)}});w=o.map((B,Y)=>$t.createElement(nI,{key:B.type==="item"?B.key:Y,onItemEnter:(ie,ge)=>{A(ie.key,ge)},onItemLeave:(ie,ge)=>{M(ie.key,ge)},columns:t,active:B.type==="item"&&B.key===i,keyboardActive:B.type==="item"&&B.key===a,item:B,index:Y,onClick:v}));let D=t.map(B=>B.width||(typeof B.flex=="number"?`${B.flex}fr`:B.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:D,gridTemplateRows:o.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function O(B){let{runtimeItems:Y,runtimeSelectableItems:ie}=h(),ge=Y.findIndex(q=>q.type==="item"&&q.key===a),be=a,ae=Y[ge],de={ArrowUp:()=>{let q=Y.slice(0,ge).filter(k=>k.type==="item"&&!k.disabled).pop();q&&q.type==="item"&&q.key&&(be=q.key)},ArrowDown:()=>{let q=Y.slice(ge+1).filter(k=>k.type==="item"&&!k.disabled)[0];q&&q.type==="item"&&q.key&&(be=q.key)},Home:()=>{de.PageUp()},End:()=>{de.PageDown()},PageUp:()=>{be=ie[0].key},PageDown:()=>{be=ie[ie.length-1].key},ArrowLeft:()=>{S(null),h().parentMenuId&&(b.destroyed=!0)},ArrowRight:()=>{ae&&(S(ae.key),Ve(()=>{T()&&C&&C.getParentMenuId()===h().menuId&&C.focus()}))},Enter:()=>{if(ae)if(ae.originalMenuItem?.menu){if(ae&&ae.originalMenuItem.menu&&C){de.ArrowLeft();return}ae&&S(ae.key)}else v(B,ae)}," ":()=>{if(!ae)return;ae.originalMenuItem.menu||v(B,ae);let q=tI(r,ae.key);q&&q.click()},Escape:()=>{de.ArrowLeft();let q=h();q.parentMenuId||q.onHideIntent?.(q)}},pe=de[B.key];pe&&(pe(),B.preventDefault()),be!=a&&y(be)}function L(){b.focused=!1}let V=(0,ut.useCallback)(function(){b.focused=!0,setTimeout(()=>{z.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&y(h().runtimeSelectableItems[0]?.key??null)})},[]),z=(0,ut.useRef)(!0),G=(0,ut.useCallback)(()=>{let B=h();B.onHideIntent?.(B)},[h]),[E]=(0,ut.useState)(()=>({hideMenu:G,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),V())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),F=(0,ut.useCallback)(B=>{B?(g.current=B,d?.(h(),E),p&&E.focus()):(f?.(h()),g.current=B)},[]),X=$t.createElement("div",{className:_n.contents},$t.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:F,onKeyDown:B=>{e.onKeyDown?.(B),O(B)},onMouseDown:B=>{z.current=!1,e.onMouseDown?.(B)},onMouseUp:B=>{z.current=!0,e.onMouseUp?.(B)},onFocus:V,onBlur:L,className:te(Ug,e.className,"InfiniteMenu"),style:_},w),R);return s?null:X}function nI(n){let[e,t]=$t.useState(!1),{columns:o,item:r,index:i,active:a,keyboardActive:l}=n,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=$t.createElement("div",{style:r.style},r.value);else{let u=0;c=o.map((d,f)=>{let p=r.value,m=d.field||d.name,g=f+1,b=g+r.span;if(g<u)return null;u=b;let y={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:b},"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:te(Yg({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||n.active}),r.className),onPointerEnter:S=>{r.disabled||n.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||n.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||n.onClick(S,r)}};return d.render?$t.createElement(Vr,{key:`${s}-${m}`,render:d.render,renderParam:{item:p,column:d,value:p[m],domProps:y}}):$t.createElement("div",{key:`${s}-${m}`,...y},p[m])}).filter(Boolean)}return $t.createElement("div",{className:qg},c)}var{ManagedComponentContextProvider:rI}=Ft({initSetupState:Jg,forwardProps:eh,mapPropsToState:th,layoutEffect:!0});function iI(n){let{componentActions:e,componentState:t}=Nt(),o=Fe(t);return dr.createElement(Tc.Provider,{value:{componentActions:e,componentState:t,getState:o}},dr.createElement(rh,{domProps:n.domProps}))}function Ut(n){let{children:e,portalContainer:t,items:o,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:f,parentMenuItemKey:p,autoFocus:m,id:g,onHideIntent:b,__is_infinite_menu_component:h,...y}=n;return dr.createElement(rI,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...n},dr.createElement(iI,{domProps:y}))}Ut[Ua]=!0;var Ic=j(require("react"));function ih(n,e){let{columnApi:t,column:o,getComputed:r,api:i,dataSourceApi:a}=e,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:o.computedSortedAsc,onAction:()=>{i.setSortingForColumn(o.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:o.computedSortedDesc,onAction:()=>{i.setSortingForColumn(o.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!o.computedSorted,onAction:()=>{i.setSortingForColumn(o.id,null)}},"-"]:[];return[...o.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,o.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!o.computedFiltered,onAction:()=>{i.clearColumnFilter(o.id)}}:null,o.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:o.computedPinned==="start",onAction:()=>{i.setPinningForColumn(o.id,"start")}},{key:"unpin",label:"Unpin",disabled:!o.computedPinned,onAction:()=>{i.setPinningForColumn(o.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{let m=tn(f,e,"column-menu");u.push({key:p,label:m,check:Ic.createElement(fo,{key:f.id,disabled:f.computedVisible&&i.getVisibleColumnsCount()===1,checked:f.computedVisible,onChange:g=>{let b=!!g;i.setVisibilityForColumn(f.id,b),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((f,p)=>{if(f.groupByForColumn)return;let m=tn(f,e,"column-menu");u.push({key:p,label:m,check:Ic.createElement(fo,{key:f.id,disabled:!f.computedGroupable,checked:f.computedGroupedBy,onChange:()=>{a.toggleGroupByField(f.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function lh(n,e,t){if(n==null)return null;let{getComputed:o,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Ut,s=o().computedColumnsMap.get(n);if(!s)return null;let c={column:s,columnApi:gt(s.id,e),...e},u=ih([],c),d=a?a(u,c):u,f=m=>{m.__insideMenu=!0},p=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",f)};return!d||!d.length?null:ah.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",f)},onHide:p,onHideIntent:m=>{p(m),t?.()}})}var aI=`[${hs["data-name"]}="${bs["data-name"]}"]`;function lI(n){let{columnId:e,context:t,clearAll:o,showOverlay:r}=n,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){o(),a.columnMenuVisibleForColumnId=null}let u=n.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${_p["data-column-id"]}="${e}"] ${aI}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>lh(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function sh(){let n=He(),{getState:e,actions:t,columnMenuVisibleForColumnId:o,columnMenuVisibleKey:r}=re(c=>({getState:c.getState,actions:c.actions,columnMenuVisibleForColumnId:c.state.columnMenuVisibleForColumnId,columnMenuVisibleKey:c.state.columnMenuVisibleKey})),{portalDOMRef:i}=co(c=>({portalDOMRef:c.getMasterState().portalDOMRef}))||{},{showOverlay:a,portal:l,clearAll:s}=ro({portalContainer:i?.current??!1});return(0,wc.useEffect)(()=>{let c=e();return c.onColumnMenuClick.onChange(u=>{u&&(c.columnMenuTargetRef.current=u.target,t.contextMenuVisibleFor=null,t.cellContextMenuVisibleFor=null,t.filterOperatorMenuVisibleForColumnId=null,t.columnMenuVisibleForColumnId=u.column.id)})},[]),(0,wc.useEffect)(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=e();if(c){let f=function(p){p.__insideMenu!==!0&&(s(),t.columnMenuVisibleForColumnId=null)};var d=f;return document.documentElement.addEventListener("mousedown",f),lI({columnId:c,context:n,clearAll:s,showOverlay:a}),()=>{document.documentElement.removeEventListener("mousedown",f)}}else u.current=null,s();return()=>{}},[o,r]),{menuPortal:l}}var ch=j(require("react")),uh=require("react");var sI={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function dh(){let{getState:n,api:e,actions:t,getComputed:o,dataSourceApi:r,dataSourceActions:i}=He(),{getDataSourceState:a,getDataSourceMasterContext:l}=eo(),{focusDetectDOMRef:s}=n(),c=(0,uh.useCallback)(async()=>{Eg({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:o,actions:t,dataSourceActions:i,api:e,getState:n,dataSourceApi:r})},[]);return ch.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:sI})}var fr=require("react");function cI(){let n=He(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active?t.cancelled:void 0;(0,fr.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...xt({rowIndex:r,columnId:i,...n}),initialValue:a})}},[o])}function uI(){let n=He(),{getState:e,editingCell:t}=re(r=>({getState:r.getState,editingCell:r.state.editingCell})),o=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,fr.useEffect)(()=>{if(o){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...xt({rowIndex:r,columnId:i,...n}),value:a,error:o,initialValue:l})}},[o])}function dI(){let n=He(),{editingCell:e}=re(r=>({editingCell:r.state.editingCell})),t=e?.active,o=Eo(t);(0,fr.useEffect)(()=>{!t&&o&&n.api.focus()},[t,o])}function fI(){let n=He(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,fr.useEffect)(()=>{if(o){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...xt({rowIndex:a,columnId:l,...n}),value:i,initialValue:s};t().onEditAccepted?.(c),n.api.persistEdit({value:i})}},[o])}function pI(){let n=He(),{editingCell:e,getState:t}=re(r=>({editingCell:r.state.editingCell,getState:r.getState})),o=e?e.persisted:void 0;(0,fr.useEffect)(()=>{if(o){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...xt({rowIndex:l,columnId:s,...n}),value:c,initialValue:u};o instanceof Error?i?.({...d,error:o}):a?.(d)}},[o])}function fh(){cI(),uI(),fI(),pI(),dI()}var Dc=require("react");var Xo=j(require("react"));var Rc=j(require("react")),Qa=n=>Rc.createElement(ze,{...n},Rc.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"}));var vc=j(require("react")),ph=n=>vc.createElement(ze,{...n},vc.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 mh(n,e,t){if(n==null)return null;let{getComputed:o,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),f=u?.Menu??Ut,p=o().computedColumnsMap.get(n);if(!p)return null;let m=w=>{w.__insideMenu=!0},g=w=>{w.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:b}=i(),h=b[p.computedFilterType];if(!h)return null;let y=h.operators.map(w=>{let v=w.name,x=p.computedFilterValue?p.computedFilterValue.filter.operator===v:v===h.defaultOperator,R=w.components?.Icon??Fn;return{key:v,icon:Xo.createElement(R,null),label:Xo.createElement(Xo.Fragment,null,w.label??w.name),onAction:()=>{c.setColumnFilterOperator(n,v)},checked:x?Xo.createElement(ph,{size:16}):null}}),T=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Xo.createElement(Qa,null),disabled:!p.computedFiltered,onAction:()=>{c.clearColumnFilter(n)}},"-"],...y],C={column:p,api:c,getState:r,getDataSourceState:i,getComputed:o,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:p.computedFilterValue,filterTypes:b},I=d?d(T,C):T;return Xo.createElement(f,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:I,onShow:w=>{w.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:w=>{g(w),t?.()}})}var Ja=10;function gh(){let{portalDOMRef:n}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},e=He(),{getState:t,actions:o}=e,{showOverlay:r,portal:i,clearAll:a}=ro({portalContainer:n?.current??!1});return(0,Dc.useEffect)(()=>t().onFilterOperatorMenuClick.onChange(s=>{if(!s)return;let{target:c,column:u}=s;function d(){a(),o.filterOperatorMenuVisibleForColumnId=null}let f=c?.parentElement||c,p=xe.from(f.getBoundingClientRect());p.top-=Ja,p.left-=Ja,p.width+=2*Ja,p.height+=2*Ja,r(()=>mh(u.id,e,d),{constrainTo:t().domRef.current,id:"filter-operator-menu",alignTo:p,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),o.contextMenuVisibleFor=null,o.cellContextMenuVisibleFor=null,o.columnMenuVisibleForColumnId=null,o.filterOperatorMenuVisibleForColumnId=u.id}),[]),(0,Dc.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var si=require("react");var Ac=j(require("react"));var xc=j(require("react"));function el(n){let e=n?Array.isArray(n)?n:n.items:null,t=n&&!Array.isArray(n)?n.columns:void 0;return{items:e,columns:t}}function Pc(n){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),n.onHideIntent?.()}}}function Mc(n,e,t){if(!n)return null;let o=Te();return n.then(r=>{let{items:i,columns:a}=el(r);i&&i.length&&o(xc.createElement(t,{...e,items:i||[],columns:a}))}),xc.createElement(Go,{updater:o})}function hh(n,e,t){let{columnId:o,rowIndex:r,event:i}=n,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Ut,{computedColumnsMap:d}=a(),f=d.get(o),p={...xt({...e,rowIndex:r,columnId:f.id}),event:i};if(!f||!c)return{cellContext:p,menu:null,preventDefault:!1};let m=Pc({onHideIntent:t}),g=c(p,e),b=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:p,menu:Mc(g,m,u),preventDefault:b};let{items:h,columns:y}=el(g);return!h||!h.length?{cellContext:p,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:b,menu:Ac.createElement(u,{...m,columns:y,items:h}),cellContext:p}}function bh(n,e,t){let{getState:o,getComputed:r}=e,{components:i,getContextMenuItems:a}=o(),l=i?.Menu??Ut,{computedColumnsMap:s}=r(),c=n.columnId?s.get(n.columnId):void 0,u=c?{...n,...xt({...e,rowIndex:n.rowIndex,columnId:c.id})}:n;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=Pc({onHideIntent:t}),f=a(u,e),p=f instanceof Promise||Array.isArray(f)?!0:!!(f&&Array.isArray(f.items));if(f instanceof Promise)return{cellContext:u,menu:Mc(f,d,l),preventDefault:p};let{items:m,columns:g}=el(f);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:p,menu:Ac.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var tl=5,yh=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Sh(){let n=He(),{portalDOMRef:e}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=ro({portalContainer:e?.current??!1});return(0,si.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:c}=n;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:f}=d;function p(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:b}=hh(d,n,p),h=xe.fromPoint({top:f.clientY,left:f.clientX});h.width+=tl,h.height+=tl,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:yh}),b&&f.preventDefault(),l.cellContextMenuVisibleFor={columnId:d.columnId,rowId:d.rowId,rowIndex:d.rowIndex,colIndex:d.colIndex};let{onCellContextMenu:y}=s();y&&y({...g,getState:s,getDataSourceState:c},f)})},[]),(0,si.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Th(){let n=He(),{portalDOMRef:e}=co(l=>({portalDOMRef:l.getMasterState().portalDOMRef}))||{},{getState:t,actions:o}=n,{showOverlay:r,portal:i,clearAll:a}=ro({portalContainer:e?.current??!1});return(0,si.useEffect)(()=>{let{actions:l,getState:s}=n;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function f(){a(),l.contextMenuVisibleFor=null}let{menu:p,cellContext:m,preventDefault:g}=bh(u,n,f),b={top:d.clientY,left:d.clientX},h=xe.fromPoint(b);h.width+=tl,h.height+=tl,r(p,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:yh}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:b,...u};let{onContextMenu:y}=s();y&&y({...n,...m},d)})},[]),(0,si.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),o.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var Ch=require("react"),Ih=j(require("react"));var ol=require("react");function nl(n,e){let{brain:t}=re(r=>({brain:r.state.brain})),o=(0,ol.useCallback)(n,e);(0,ol.useEffect)(()=>t.onScroll(o),[t,o])}var Ec="yzx0vj0";function wh(n){let{width:e,maxWidth:t,minWidth:o,scrollable:r,...i}=n,a=(0,Ch.useRef)(null);nl(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=he.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=he.runtime.bodyWidth),o==="column"?l.minWidth=he.runtime.totalVisibleColumnsWidthValue:o==="viewport"&&(l.minWidth=he.runtime.bodyWidth),t==="column"?l.maxWidth=he.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=he.runtime.bodyWidth),Ih.createElement("div",{ref:a,...i,className:i.className?te(i.className,Ec):Ec,style:l},i.children)}var mI=ee(Q.columnWidthAtIndex),gI=ee(Q.columnOffsetAtIndex);function Rh(){let{computedVisibleColumns:n}=re(e=>({computedVisibleColumns:e.computed.computedVisibleColumns}));return n.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${mI}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${gI}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var rl="InfiniteTable";var vh=require("react");function Dh(){let{getState:n,actions:e,dataSourceActions:t,getDataSourceState:o}=re(u=>({getState:u.getState,actions:u.actions,dataSourceActions:u.dataSourceActions,getDataSourceState:u.getDataSourceState})),{groupBy:r,isTree:i}=o(),a=n(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,vh.useEffect)(()=>{if(!s){o().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:p,repeatWrappedGroupRows:m}=o(),g=!1,b=l.rowsPerPage,h=(r&&r.length>0||i)&&b>0?b:null;return p!=h&&(t.rowsPerPage=h,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,f=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),f()}},[l,s,r,i,c])}var In=require("react");var ci=ye({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),xh="_143ofgf5",Ph="_143ofgf3";var hI=ee(he.loaded),_c={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Mh(n,e){let{type:t,debugId:o}=n;if(t==="unmount")return{..._c,url:Oc(),type:t,payload:{debugId:o}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{..._c,url:Oc(),type:t,payload:{debugId:o,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 Oc=pt(function(){let n=new URL(window.location.href);return n.origin+n.pathname});function bI(n){window.postMessage(n)}var yI=pt(()=>{console.log("Infinite Table DevTools detected!");let n=(e,t)=>{if(t){kt.set(e,t);let{devToolsDetected:o}=t.getState();o||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(Mh({type:"update",debugId:e},t))}else pm(e),window.postMessage(Mh({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=n,Ue.onLogIntent("IT:*",e=>{bI({..._c,url:Oc(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let o="";try{o=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return o}return String(t)}),timestamp:e.timestamp}})}),n});function Ah(){let{getState:n,getDataSourceState:e,dataSourceActions:t}=re(a=>({getState:a.getState,getDataSourceState:a.getDataSourceState,dataSourceActions:a.dataSourceActions})),o=n(),{domRef:r,debugId:i}=o;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(hI)!==`${ud}`&&oi({debugId:i,key:"CSS001_CSS"}),(0,In.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),CI()}var il=Te(),SI={revertAll:n=>{let e=kt.get(n.debugId);if(e){let t=$o.get(n.debugId);$o.delete(n.debugId),yo.delete(n.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let o=To.get(n.debugId);To.delete(n.debugId),So.delete(n.debugId),o&&Object.keys(o).forEach(r=>{e.dataSourceActions[r]=o[r],delete o[r]})}},revertProperty:n=>{let e=kt.get(n.debugId);if(e){let t=n.property,o=yo.get(n.debugId),r=$o.get(n.debugId),i=So.get(n.debugId),a=To.get(n.debugId),l=t;r&&o&&o[l]!==void 0&&(delete o[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=To.get(n.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:n=>{let e=kt.get(n.debugId);if(e){let t=n.warning,o=e.getDataSourceState().debugWarnings;if(o.get(t))o.delete(t),ni(n.debugId);else{let i=n.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),ni(n.debugId))}}},discardAllWarnings:n=>{let e=kt.get(n.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),ni(n.debugId))},setColumnVisibility:n=>{Js(n.debugId,"columnVisibility",n.columnVisibility)},setGroupBy:n=>{Oa(n.debugId,"groupBy",n.groupBy)},setGroupRenderStrategy:n=>{Js(n.debugId,"groupRenderStrategy",n.groupRenderStrategy)},setSortInfo:n=>{Oa(n.debugId,"sortInfo",n.sortInfo)},setMultiSort:n=>{Oa(n.debugId,"multiSort",n.multiSort)},highlight:n=>{let e=kt.get(n.debugId);if(e){let t=e.getState().domRef.current;if(t){let o=t.getBoundingClientRect(),r=document.querySelector(`.${ci.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(ci.classNames.base),r.innerHTML=[`<div class="${Ph}"></div>`,`<div class="${xh}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${o.left}px`,r.style.top=`${o.top}px`,r.style.width=`${o.width}px`,r.style.height=`${o.height}px`,i.innerHTML=n.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(ci.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(ci.classNames.variants.active.true)}}}}};function TI(){typeof window<"u"&&window.addEventListener("message",n=>{if(n&&n.data&&typeof n.data.source=="string"&&typeof n.data.target=="string"&&n.data.target==="infinite-table-page"&&n.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(yI(),il(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof n.data.type=="string")){let e=n.data.type,t=SI[e];t&&t(n.data.payload)}})}TI();function CI(){let{getState:n,getComputed:e,getDataSourceState:t,dataSourceActions:o,actions:r,dataSourceApi:i,api:a}=re(u=>({getState:u.getState,getComputed:u.getComputed,getDataSourceState:u.getDataSourceState,dataSourceActions:u.dataSourceActions,actions:u.actions,dataSourceApi:u.dataSourceApi,api:u.api})),s=n().debugId,c=(0,In.useRef)(s);return c.current=s,(0,In.useEffect)(()=>{let u=c.current;if(!u)return;let d=p=>{p(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})},f=il.get();if(f){d(f);return}return il.onChange(p=>{p&&d(p)})},[]),(0,In.useEffect)(()=>{let u=c.current;if(!u)return;let d=il.get();d&&d(u,{getState:n,getDataSourceState:t,getComputed:e,dataSourceActions:o,actions:r,api:a,dataSourceApi:i})}),(0,In.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function Eh(){let{masterPortalDOMRef:n}=co(o=>({masterPortalDOMRef:o.getMasterState().portalDOMRef}))??{},e=re(o=>o.state.portalDOMRef);return n?.current??e?.current}var At=j(require("react")),Vh=require("react");var _h="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Oh=ye({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),Fh="hs68h81",Nh=ye({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"]]});var wn=j(require("react"));function Lh(n){return wn.createElement("div",{...n.domProps})}function kh(n){let{active:e}=n;return wn.createElement("div",{className:Fh},e?"Drop to group":"Drag columns to group")}function zh(n){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),n.onClear?.())};return wn.createElement("div",{...n.domProps},n.label,wn.createElement("div",{className:vi[1]}),wn.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${n.field}`,className:_h,onKeyDown:e,onMouseDown:n.onClear},wn.createElement(Qa,{size:20})))}var II=(n,e)=>t=>{e&&e(t);let o=Date.now(),r=!1,i=()=>{r=!0};De().addEventListener("mousemove",i,{once:!0}),De().addEventListener("mouseup",()=>{r||(De().removeEventListener("mousemove",i),Date.now()-o<200&&requestAnimationFrame(()=>{n()}))},{once:!0})};function wI(n){let{column:e,onClear:t,components:o,field:r,id:i,toggleSorting:a}=n,{dragSourceListId:l,dragItemId:s}=pn(),c=l===pr,u=He(),d=(e?tn(e.id,u,"grouping-toolbar"):r)??i,f=e?At.createElement(Qi,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,p=At.createElement(At.Fragment,null,d,f),m=s===i&&l===pr,g=te(Oh({draggingInProgress:c,active:m}),n.domProps?.className),b=II(a,n.domProps?.onMouseDown),h={...n.domProps,className:g,onMouseDown:b},y=o?.ToolbarItem??zh;return At.createElement(y,{active:m,domProps:h,column:e,field:r,label:p,onClear:t})}var pr="grouping-toolbar";function Gh(n){let{groupBy:e}=_e(S=>({groupBy:S.dataSourceState.groupBy})),{getComputed:t,dataSourceApi:o,api:r}=re(S=>({getComputed:S.getComputed,dataSourceApi:S.dataSourceApi,api:S.api})),{dropTargetListId:i,dragSourceListId:a}=uo(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===pr,u=a===pr,d=n.components?.Placeholder??kh,f=n.components?.Host??Lh,p=e.length?At.createElement(At.Fragment,null,e.map((S,T)=>{let C=S.field?l.get(S.field):void 0,I=`${S.field??`idx-${T}`}`;return At.createElement(zo.DraggableItem,{key:I,id:I},w=>At.createElement(wI,{id:I,components:n.components,domProps:w,field:S.field,column:C,toggleSorting:()=>{C&&r.toggleSortingForColumn(C.id)},onClear:()=>{let v=e.filter(x=>x!==S).filter(Boolean);o.setGroupBy(v)}}))})):At.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let T=S.map(C=>e[C]);o.setGroupBy(T)},g=S=>{let{dragItemId:T}=S,C=T,I=s.get(C);if(!I||!I.field||!I.computedGroupable)return;let w=[...e];w.splice(S.dropIndex,0,{field:I.field}),o.setGroupBy(w)},b=(0,Vh.useCallback)(S=>{let{computedColumnsMap:T}=t(),C=S.dragItem.id,I=T.get(C);return!(!I||!I.computedGroupable||e.some(w=>w.field===I.field))},[e]),h=n.orientation??"horizontal",{domProps:y}=n;return At.createElement(zo,{orientation:h,dragListId:pr,acceptDropsFrom:["header",pr],onDrop:m,dragStrategy:"inline",onAcceptDrop:g,shouldAcceptDrop:b},(S,{draggingInProgress:T,status:C})=>{let I=te(Nh({active:c,orientation:h,draggingInProgress:T,dropRejected:C==="rejected"}),S.className,y?.className),w={...S,...y,className:I,children:p};return At.createElement(f,{active:c,rejectDrop:C==="rejected",domProps:w,orientation:h})})}var gr=j(require("react"));var Fc=require("react"),io=require("react"),al=j(require("react"));function Hh(n){let{dataArray:e,brain:t,computedPinnedEndColumns:o,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=n;return ha(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:o.length,fixedColsStart:r.length}),t}var Io=j(require("react"));var Kh=ye({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var ui=require("react");function RI(n,e){let{masterState:t,detailContext:o}=e,r=t.detailDataSourcesStateToRestore;if(r.has(n)){let i=r.get(n);return o.assignState(i),!0}return!1}function vI(n,e){let{detailState:t,masterState:o,masterActions:r,cacheEntryForRow:i}=e,a=new Map(o.detailDataSourcesStateToRestore),l=Am(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(n,l),r.detailDataSourcesStateToRestore=a}function DI(n,e){let t=(0,ui.useRef)(!1);return{currentRowCache:(0,ui.useMemo)(()=>({getRowId:()=>n,add:r=>{t.current=!0,e.add(n,r)},get:()=>e.get(n),delete:()=>(t.current=!0,e.delete(n)),has:()=>e.has(n)}),[e,n]),cacheCalledByRowDetailRenderer:t}}function Bh(n){let{rowDetailsCache:e,rowInfo:t}=n,{getDataSourceState:o,dataSourceActions:r}=_e(c=>({getDataSourceState:c.getDataSourceState,dataSourceActions:c.dataSourceActions})),{getMasterState:i}=re(c=>({getMasterState:c.getState})),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=DI(t.id,e),s=(0,ui.useMemo)(()=>{let c=o().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:pt(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)});return}RI(t.id,{masterState:o(),detailContext:d}),requestAnimationFrame(()=>{d.dataSourceState.destroyedRef.current||(d.dataSourceActions.stateReadyAsDetails=!0)}),d.dataSourceState.onCleanup.onChange(()=>{let f=a.get();f&&vI(t.id,{detailState:d.getDataSourceState(),masterActions:r,masterState:o(),cacheEntryForRow:f})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=o,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}function Wh(){return Do()}var{rootClassName:xI}=ke,PI=`${xI}RowDetail`;function MI(n){let{domRef:e,rowDetailRenderer:t,rowDetailHeight:o,rowInfo:r,detailOffset:i,rowDetailsCache:a}=n,{masterDetailContextValue:l,currentRowCache:s}=Bh({rowDetailsCache:a,rowInfo:r}),c=Mn(),[u]=Io.useState(()=>Wh());return u.setSnapshot(l),Io.useLayoutEffect(()=>{u.notify()},[l]),Io.createElement(c.Provider,{value:u},Io.createElement("div",{ref:e,className:te(PI,Kh({})),style:{position:"absolute",top:`${i}px`,left:0,width:`calc(${Q.bodyWidth} - ${Q.scrollbarWidthVertical})`,height:o}},t(r,s)))}var jh=Io.memo(MI);var AI=1;function $h(n){let{computed:e,bodySize:t,imperativeApi:o}=n,{actions:r,getState:i,getComputed:a,getDataSourceMasterContext:l,rowHeight:s,rowDetailHeight:c,onRowMouseEnter:u,onRowMouseLeave:d,groupRenderStrategy:f,brain:p,showZebraRows:m,rowDetailRenderer:g,isRowDetailsExpanded:b,isRowDetailsEnabled:h,cellClassName:y,cellStyle:S,rowStyle:T,rowDetailCache:C,rowClassName:I,onScrollToTop:w,onScrollToBottom:v,onScrollStop:x,scrollToBottomOffset:R,wrapRowsHorizontally:P,updatedAt:A,ready:M,editingCell:D}=re(H=>({actions:H.actions,getState:H.getState,getComputed:H.getComputed,getDataSourceMasterContext:H.getDataSourceMasterContext,rowHeight:H.state.rowHeight,rowDetailHeight:H.state.rowDetailHeight,onRowMouseEnter:H.state.onRowMouseEnter,onRowMouseLeave:H.state.onRowMouseLeave,groupRenderStrategy:H.state.groupRenderStrategy,brain:H.state.brain,showZebraRows:H.state.showZebraRows,rowDetailRenderer:H.state.rowDetailRenderer,isRowDetailsExpanded:H.state.isRowDetailExpanded,isRowDetailsEnabled:H.state.isRowDetailEnabled,cellClassName:H.state.cellClassName,cellStyle:H.state.cellStyle,rowStyle:H.state.rowStyle,rowDetailCache:H.state.rowDetailCache,rowClassName:H.state.rowClassName,onScrollToTop:H.state.onScrollToTop,onScrollToBottom:H.state.onScrollToBottom,onScrollStop:H.state.onScrollStop,scrollToBottomOffset:H.state.scrollToBottomOffset,wrapRowsHorizontally:H.state.wrapRowsHorizontally,updatedAt:H.state.updatedAt,ready:H.state.ready,editingCell:H.state.editingCell})),{computedPinnedStartColumns:_,computedPinnedEndColumns:O,computedVisibleColumns:L,computedColumnsMap:V,computedRowHeight:z,computedRowSizeCacheForDetails:G,fieldsToColumn:E,rowspan:F,toggleGroupRow:X,columnSize:B}=e,{dataArray:Y,rowInfoStore:ie,selectionMode:ge,cellSelection:be,isNodeReadOnly:ae,getDataSourceState:de,dataSourceApi:pe,dataSourceActions:q}=_e(H=>({dataSourceApi:H.dataSourceApi,dataSourceActions:H.dataSourceActions,getDataSourceState:H.getDataSourceState,dataArray:H.dataSourceState.dataArray,rowInfoStore:H.dataSourceState.rowInfoStore,selectionMode:H.dataSourceState.selectionMode,cellSelection:H.dataSourceState.cellSelection,isNodeReadOnly:H.dataSourceState.isNodeReadOnly})),k=Fe(Y);Hh({columnSize:B,brain:p,computedPinnedStartColumns:_,computedPinnedEndColumns:O,computedVisibleColumns:L,computedRowHeight:z,dataArray:Y,bodySize:t,rowspan:F});let U=(0,io.useRef)(0);(0,io.useEffect)(()=>p.onRenderCountChange(()=>{U.current=p.scrollTopMax}),[p]),(0,io.useEffect)(()=>p.onRenderRangeChange(H=>{i().onRenderRangeChange?.(H)}),[p]),(0,io.useEffect)(()=>p.onScrollStop(H=>{let{scrollTop:ce,scrollLeft:N}=H;if(ce===0&&w?.(),ce+(R??AI)>=U.current){v?.();let{livePagination:me,livePaginationCursor:Me,dataArray:Ae}=de();me&&(q.cursorId=Me!==void 0?Date.now():Ae.length)}if(x){let me=p.getRenderRange();x({scrollTop:ce,scrollLeft:N,renderRange:me,viewportSize:i().bodySize,firstVisibleRowIndex:me.start[0],lastVisibleRowIndex:me.end[0],firstVisibleColIndex:me.start[1],lastVisibleColIndex:me.end[1]})}}),[p,w,v,x]),(0,io.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,io.useEffect)(()=>{let{onReady:H}=i();H&&H({api:o,dataSourceApi:pe})},[M]);let K=(0,Fc.useMemo)(()=>({isNodeReadOnly:ae,selectionMode:ge,cellSelection:be}),[ae,ge,be]),Z=(0,io.useCallback)(H=>{let{rowIndex:ce,colIndex:N,heightWithRowspan:J,domRef:fe,hidden:me,width:Me,onMouseLeave:Ae,onMouseEnter:Ge}=H,Le=k()[ce],We=L[N];if(!Le||!We)return null;let et=G?G.getRowHeight(ce):J,tt=!1;!h||typeof h=="function"&&!h(Le)?tt=!1:b&&(tt=b(Le)?"expanded":"collapsed");let ot=P?p.getRowIndexInPage(ce):null,$=P?p.getPageIndexForRow(ce):null,se=o.isEditorVisibleForCell({rowIndex:ce,columnId:We.id});return al.createElement(Sf,{...{getData:k,virtualized:!0,showZebraRows:m,groupRenderStrategy:f,rowIndexInHorizontalLayoutPage:ot,horizontalLayoutPageIndex:$,rowIndex:ce,rowInfoStore:ie,hidden:me,toggleGroupRow:X,rowHeight:et,rowDetailState:tt,onMouseEnter:Ge,onMouseLeave:Ae,onRowMouseEnter:u,onRowMouseLeave:d,domRef:fe,width:Me,column:We,columnsMap:V,fieldsToColumn:E,rowStyle:T,rowClassName:I,cellStyle:S,cellClassName:y,inEditMode:se,getDataSourceState:de,dataSourceApi:pe,dataSourceActions:q,getState:i,imperativeApi:o,componentActions:r,getComputed:a,getDataSourceMasterContext:l,dataSourceStatePartialForCell:K}})},[s,c,u,d,G,z,b,k,L,V,E,f,P,X,m,p,ie,T,I,y,S,de,pe,q,i,o,r,a,l,A,D,K]),ne=(0,Fc.useMemo)(()=>{if(b)return H=>{let{rowIndex:ce,domRef:N}=H,fe=k()[ce];if(!fe||!b(fe)||!G)return al.createElement("div",{ref:N,className:gu.hidden});let{rowDetailHeight:me,rowHeight:Me}=G.getSize(ce);return al.createElement(jh,{rowInfo:fe,rowDetailsCache:C,rowIndex:ce,domRef:N,detailOffset:Me,rowDetailHeight:me,rowDetailRenderer:g})}},[M,Z,g,c,b,C]);return{renderCell:Z,renderDetailRow:ne}}var Uh=require("react");function Yh(){let{state:n,getState:e,actions:t}=re(i=>({state:i.state,getState:i.getState,actions:i.actions})),{wrapRowsHorizontally:o}=n,r=Eo(o);(0,Uh.useEffect)(()=>{if(r!==o){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=uc(rl,!!o);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,o])}var Zh=j(require("react"));var qh="_16lm1iw1 _16lm1iw1c _16lm1iwe";var Xh=te(qh,cs);function Qh(n){return Zh.createElement("div",{...n,className:n.className?te(Xh,n.className):Xh})}var mr=j(require("react"));var Jh={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},eb="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",tb="qy58ya4";var{rootClassName:EI}=ke,Nc=`${EI}-LoadMask`;function _I(n){let{visible:e,children:t="Loading"}=n;return mr.createElement("div",{className:`${Jh[e?"visible":"hidden"]} ${Nc}`},mr.createElement("div",{className:`${eb} ${Nc}-Overlay`}),mr.createElement("div",{className:`${tb} ${Nc}-Text`},t))}var ll=mr.memo(_I);var ob=require("react");var OI=[tf,`${Qt}--hovered`];function FI(n){return Array.isArray(n)&&(n=n.join(" ")),n.split(" ").map(e=>e.trim()).filter(Boolean)}function Rn(n){let e=He(),t=xo(),{getComputed:o,api:r}=e,{renderer:i,onRenderUpdater:a,debugId:l,keyboardNavigation:s,activeRowIndex:c,loadingText:u,columnReorderDragColumnId:d,scrollStopDelay:f,brain:p,scrollerDOMRef:m,components:g,bodySize:b,activeCellIndex:h,rowDetailRenderer:y,showHoverRows:S,wrapRowsHorizontally:T,domProps:C,domRef:I,forceBodyRerenderTimestamp:w,rowHoverClassName:v,ready:x}=re(F=>({ready:F.state.ready,columnReorderDragColumnId:F.state.columnReorderDragColumnId,forceBodyRerenderTimestamp:F.state.forceBodyRerenderTimestamp,renderer:F.state.renderer,onRenderUpdater:F.state.onRenderUpdater,debugId:F.state.debugId,keyboardNavigation:F.state.keyboardNavigation,activeRowIndex:F.state.activeRowIndex,loadingText:F.state.loadingText,scrollStopDelay:F.state.scrollStopDelay,brain:F.state.brain,scrollerDOMRef:F.state.scrollerDOMRef,components:F.state.components,bodySize:F.state.bodySize,activeCellIndex:F.state.activeCellIndex,rowDetailRenderer:F.state.rowDetailRenderer,showHoverRows:F.state.showHoverRows,wrapRowsHorizontally:F.state.wrapRowsHorizontally,domProps:F.state.domProps,domRef:F.state.domRef,rowHoverClassName:F.state.rowHoverClassName})),R=g?.LoadMask??ll,P=o(),{computedRowHeight:A,computedRowSizeCacheForDetails:M}=P,D=M?.getRowHeight||A,{loading:_}=_e(F=>({loading:F.dataSourceState.loading})),O=gr.useCallback(F=>{let X=e.getState(),B=F.target;if(!t&&F._from_row_detail)return;t&&(F._from_row_detail=!0);let Y=cd(B,cc(),X.domRef.current),ie,ge,be,ae;Y&&(ge=Number(Y.dataset.colIndex),ae=Number(Y.dataset.rowIndex),ie=e.getComputed().computedVisibleColumns[ge].id,be=e.dataSourceApi.getRowInfoArray()[ae].id);let de={columnId:ie,colIndex:ge,rowId:be,rowIndex:ae,event:F,target:Y??F.target};Y&&X.cellContextMenu(de),X.contextMenu(de)},[]),{renderCell:L,renderDetailRow:V}=$h({imperativeApi:r,getComputed:o,domRef:I,bodySize:b,computed:P}),{autoFocus:z,tabIndex:G}=C??{};Yh();let E=(0,ob.useMemo)(()=>{if(!S)return;let F=[];return v&&(F=F.concat(v)),n.rowHoverClassName&&(F=F.concat(n.rowHoverClassName)),Rn.rowHoverClassName&&(F=F.concat(Rn.rowHoverClassName)),FI(F)},[S,v,n.rowHoverClassName,Rn.rowHoverClassName]);return gr.createElement(Qh,{onContextMenu:O},gr.createElement(gp,{forceRerenderTimestamp:w,debugId:l,tabIndex:G??0,autoFocus:z??void 0,activeRowIndex:x&&s==="row"?c:null,activeCellIndex:x&&s==="cell"&&!d?h:null,scrollStopDelay:f,renderer:i,wrapRowsHorizontally:T,onRenderUpdater:a,brain:p,activeCellRowHeight:D,renderCell:L,renderDetailRow:y?V:void 0,cellHoverClassNames:E,scrollerDOMRef:m,scrollVarHostRef:I}),gr.createElement(R,{visible:_},u))}Rn.rowHoverClassName=OI;function nb(){return re(n=>n.api)}function rb(n){return re(e=>e.api.getColumnApi(n))}var Zt=ke.rootClassName,{ManagedComponentContextProvider:NI}=Ft({initSetupState:Qm,forwardProps:Jm,mapPropsToState:ng,cleanup:eg,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:og(),getParentState:()=>wa(n=>n),debugName:n=>Ho(n.debugId,rl)}),ib=ve.memo(function(){let e=Si(),{componentState:t,api:o,initialChildren:r}=re(z=>({componentState:z.state,api:z.api,initialChildren:z.children})),{dataArrayLength:i,getDataSourceState:a,dataSourceActions:l,dataSourceApi:s}=_e(z=>({dataArrayLength:z.dataSourceState.dataArray.length,getDataSourceState:z.getDataSourceState,dataSourceActions:z.dataSourceActions,dataSourceApi:z.dataSourceApi})),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:f,onRowDetailHeightCSSVarChange:p,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:b,columnHeaderHeightCSSVar:h,scrollStopDelay:y,brain:S,activeRowIndex:T,activeCellIndex:C}=t,{licenseKey:I}=t;!I&&ao.licenseKey&&(I=ao.licenseKey),Tg(T,i,o),Sg(C,i,o);let{onKeyDown:w}=Vg();ve.useEffect(()=>{let z=a(),G=_t(E=>{z.notifyRenderRangeChange({renderStartIndex:E[0],renderEndIndex:E[1]})},{wait:y});return S.onVerticalRenderRangeChange(G)},[S,y]);let v=yg(I),{autoFocus:x,tabIndex:R,...P}=t.domProps??{},A=Pd(P);ve.useEffect(()=>{S.setScrollStopDelay(y),l.scrollStopDelayUpdatedByTable=y},[y]),Km(),Dh(),fh();let{menuPortal:M}=sh(),{menuPortal:D}=Sh(),{menuPortal:_}=Th(),{menuPortal:O}=gh();ve.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(t.id,t.ready,o,{dataSourceApi:s})},[t.ready,o,s]);let L=Ah();ve.useEffect(()=>{if(e){let z=e.getSnapshot();u.current=z.getMasterState().portalDOMRef.current}},[]);let V=r??ve.createElement(ve.Fragment,null,ve.createElement(Vs,null),ve.createElement(Rn,null));return ve.createElement("div",{"data-debug-id":L,onKeyDown:w,ref:c,...A},V,ve.createElement("div",{ref:u,className:te(`${mt}Portal`,hu[1e7],Di.absolute,pu[0],uu[0])},M,D,_,O),g?ve.createElement(vr,{key:"row-height",varName:g,onChange:d}):null,ve.createElement(vr,{key:"flashing-duration",allowInts:!0,varName:he.components.Cell.flashingDuration,onChange:f}),b?ve.createElement(vr,{key:"row-detail-height",varName:b,onChange:p}):null,h?ve.createElement(vr,{key:"column-header-height",varName:h,onChange:m}):null,v?null:ve.createElement(kp,null),ve.createElement(dh,null))});function LI({children:n,store:e}){let{componentActions:t,componentState:o}=Nt(),{scrollerDOMRef:r,scrollTopKey:i}=o,a=Fe(o),l=pg({state:o,actions:t,getState:a}),s=Fe(l),c=Si(),{getDataSourceState:u,dataSourceActions:d,getDataSourceMasterContext:f,dataSourceApi:p}=eo(),[m]=ve.useState(()=>Hm({getComputed:s,getState:a,getDataSourceState:u,getDataSourceMasterContext:f,dataSourceApi:p,actions:t,dataSourceActions:d})),g={actions:t,state:o,computed:l,dataSourceActions:d,getDataSourceMasterContext:f,getDataSourceState:u,getComputed:s,getState:a,api:m,dataSourceApi:p,children:n};return e.setSnapshot(g),ve.useLayoutEffect(()=>{e.notify()}),bi(r,b=>{let h={width:b.width,height:b.height};t.bodySize=h},{earlyAttach:!0,debounce:50}),ve.useEffect(()=>{r.current&&(r.current.scrollTop=0)},[i,r]),ve.createElement(ib,null)}var kI=40,zI=Ig(dd),ao=function(n){let[e]=ve.useState(()=>Cg()),t=Oi();return ve.createElement(NI,{repeatWrappedGroupRows:!!n.wrapRowsHorizontally,rowHeight:kI,columnHeaderHeight:zI,...n},ve.createElement(Vi,null,ve.createElement(t.Provider,{value:e},ve.createElement(LI,{children:n.children,store:e}))))};ao.Header=Vs;ao.Body=Rn;ao.HScrollSyncContent=wh;ao.Footer=()=>ve.createElement(yu,null);ao.GroupingToolbar=Gh;var ab=j(require("react"));function VI(n){let{DataSource:e}=nr({nodesKey:"children",...n});return ab.createElement(e,null,n.children??null)}var lb=j(require("react"));function sb(n){return lb.createElement(ao,{...n})}var cb=n=>(t,{unfilteredTreePaths:o,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Je(i,{treePaths:o});r.forEachLeafNodePath((u,{selected:d})=>{l.setNodeSelection(u,d)}),a&&r.forEachLeafNodePath(u=>{l.setNodeSelection(u,a.selected)},a.nodePath);let c={defaultSelection:!1,selectedPaths:l.getSelectedLeafNodePaths()};n(c)};var sl=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 o=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{o=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,o(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=Ue(`IT:${e}:DataQuery`)}};function vn(n){if(Array.isArray(n))return n.map(vn);if(typeof n=="object"){if(n===null)return n;let e=n,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),o={};return t.forEach(r=>{let i=e[r];i!==void 0&&(o[r]=vn(i))}),JSON.stringify(o)}return n instanceof Date?n.toISOString():n}var wo=class wo{constructor(e){this.queryCache=new oe;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let o=this.queryCache.get(t);if(e===o)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=vn(e.key),o=this.options.cache?this.queryCache.get(t):null;if(o!=null){let i=o.getCurrentSnapshot();if(i.state==="success")return{query:o,fromCache:!0};if(i.state==="loading")return{query:o,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(o,t)}let r=new sl(`${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:o}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&o)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=vn(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=vn(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=vn(e);this.queryCache.delete(t)};if(this.options=e,wo.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)}wo.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=wo.clients.get(e);t&&t.destroy()}static destroyAll(){wo.clients.forEach(e=>{wo.destroy(e.name)})}destroy(){wo.clients.delete(this.options.name)}};wo.clients=new Map;var Lc=wo;var GI={key:"*",when:n=>{let{activeCellIndex:e}=n.getState();if(e){let[t,o]=e,r=n.api.getColumnAtIndex(o);return r?n.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(n,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:o}=n.getState();if(o){let[r,i]=o,a=n.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{n.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},ub={instantEdit:GI};var HI=require("react");function db(n,e){let{set:t,delete:o,clear:r}=n;return e.set&&(n.set=(i,a)=>(t.call(n,i,a),e.set(i,a),n)),e.delete&&(n.delete=i=>{let a=o.call(n,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(n.clear=()=>{e.beforeClear&&e.beforeClear(n);let i=r.call(n);return e.clear&&e.clear(),i}),()=>{t&&(n.set=t),o&&(n.delete=o),r&&(n.clear=r)}}var ul=class ul{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ul.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.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[o]=this.orderRefs.splice(0,1);o&&this.currentSet.delete(o)}return this.orderRefs.push(e),this.currentSet.add(e),this}};ul.DEFAULT_SIZE=10;var cl=ul;var fl=class fl{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??fl.DEFAULT_SIZE,e){let o=Array.from(e);this.maxSize<o.length&&o.slice(o.length-this.maxSize),this.currentSet=new Set,o.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[o]=this.orderRefs.splice(0,1),r=o.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};fl.DEFAULT_SIZE=10;var dl=fl;var Dn=require("react"),KI=(n,e)=>n.every((t,o)=>t===e[o]),fb=(n,e)=>{let t=(0,Dn.useRef)(e),o=KI(e,t.current),r=(0,Dn.useRef)(!0);t.current=e;let i=(0,Dn.useRef)(["same"]),a=o?[Date.now()]:i.current;i.current=a;let l=(0,Dn.useRef)(n);l.current=n,(0,Dn.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var Zo=require("react"),pb=(n,e,t)=>n.every((o,r)=>t?t(o,e[r]):o===e[r]),pl=(n,e)=>{let{same:t,different:o,compare:r}=e,i=(0,Zo.useRef)(t),a=(0,Zo.useRef)(o),l=pb(t,i.current,r),s=!pb(o,a.current,r),c=(0,Zo.useRef)(!0);i.current=t,a.current=o;let u=(0,Zo.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let f=(0,Zo.useRef)(n);f.current=n,l&&s&&(c.current=!1),(0,Zo.useEffect)(()=>{if(!c.current)return f.current()},d)};var Et=j(require("react"));var mb=ee(Q.currentFlashingDuration),BI=({children:n})=>Et.createElement(Et.Fragment,null,n),gb=1e3,hb={up:ji({direction:"up"}).split(" "),down:ji({direction:"down"}).split(" "),neutral:ji({direction:"neutral"}).split(" ")},kc=(n={})=>{let{flashDuration:e,flashClassName:t,render:o=BI}=n;return Et.forwardRef((i,a)=>{let l=zr(),{flashingDurationCSSVarValue:s}=re(w=>({flashingDurationCSSVarValue:w.state.flashingDurationCSSVarValue})),c=typeof s=="number"?s??e??gb:e??gb,{domRef:u,value:d,column:f,rowInfo:p,htmlElementRef:m}=l,g=p.id,b=f.id,h=Et.useRef(!0),y=Et.useRef(d),S=h.current?null:y.current;h.current=!1;let T=Et.useRef(void 0),C=Et.useRef(void 0),I=Et.useRef(void 0);return pl(()=>{if(d===y.current)return;let w=()=>{let P=m.current;if(T.current&&(clearTimeout(T.current),T.current=void 0),I.current&&(clearTimeout(I.current),I.current=void 0),C.current&&P){let A=C.current,M=hb[A];P.classList.remove(...t?[t,...M]:M),P.style.removeProperty(mb),C.current=void 0}};y.current=d;let v=m.current;if(!v)return;w();let x=typeof d=="number"?d>S?"up":"down":"neutral",R=hb[x];return v.style.setProperty(mb,`${c}`),v.classList.add(...t?[t,...R]:R),C.current=x,T.current=setTimeout(w,c),w},{same:[b,g],different:[d]}),Et.createElement("div",{ref:u,...i,className:te(i.className)},o({children:i.children,oldValue:S}))})},bb=kc();var Ze=j(require("react")),hr=require("react");var yb=require("react-dom");function Sb(n){let[e,t]=Ze.useState(null);return(0,hr.useEffect)(()=>{let{debugTarget:o}=n,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[o]){let i=globalThis.INFINITE[o].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[n.debugTarget]),typeof e=="function"?Ze.createElement(Tb.Provider,{value:{getState:e}},Ze.createElement(WI,null)):null}var Tb=Ze.createContext({getState:()=>null});function WI(){let n=Ze.useContext(Tb),{getState:e}=n,[,t]=Yt(),o=e().renderer.cellManager;(0,hr.useEffect)(()=>{let s=_t(()=>{console.log("rerender"),t()},{wait:500});return o.onCellAttachmentChange(s)},[o,t]);let r=o.getRowsWithCells(),i=o.getColumnsWithCells(),a=(0,hr.useRef)(null),l=(0,hr.useRef)(null);return Ze.createElement("div",{style:{overflow:"auto"}},(0,yb.createPortal)(Ze.createElement("div",{ref:a,style:{position:"absolute",top:0,left:0,width:"0px",height:"0px",pointerEvents:"none",background:"rgba(255, 0, 0, 0.5)",opacity:"0"}}),document.body),Ze.createElement("table",{style:{borderCollapse:"collapse"}},Ze.createElement("thead",null,Ze.createElement("tr",null,i.map(s=>Ze.createElement("th",{key:s,"data-col-index":s},s)))),Ze.createElement("tbody",null,r.map(s=>Ze.createElement("tr",{key:s,"data-row-index":s},i.map(c=>Ze.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:o.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},Ze.createElement("button",{onClick:()=>{let u=o.getCellAt([s,c])?.getElement();if(!u)return;let d=u.getBoundingClientRect();a.current.style.top=`${d.top}px`,a.current.style.left=`${d.left}px`,a.current.style.width=`${d.width}px`,a.current.style.height=`${d.height}px`,a.current.style.opacity="0.5",a.current.style.transition="opacity 0.5s",l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a.current.style.opacity="0",l.current=null},2e3),console.log(u)},style:{cursor:"pointer"}},"(",s,",",c,")"))))))))}var jI={CheckBox:fo,LoadMask:ll,MenuIcon:Gr,StringFilterEditor:kn,NumberFilterEditor:Ni};0&&(module.exports={AutoScroller,CellSelectionState,DRAG_ITEM_ATTRIBUTE,DataClient,DataSource,DataSourceActionType,DeepMap,DragDropProvider,DragInteractionTarget,DragList,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createDefaultProxy,createFlashingColumnCellComponent,debounce,debug,defaultDragProxyMove,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceApi,useDataSourceInternal,useDataSourceSelector,useDataSourceState,useDragDropProvider,useDragListContext,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnApi,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useInfiniteTableApi,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
|
|
30
30
|
//!collapsed || lazyLoad;
|