@infinite-table/infinite-react 7.3.5 → 7.4.0

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.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var jh=Object.create;var Jr=Object.defineProperty;var $h=Object.getOwnPropertyDescriptor;var Uh=Object.getOwnPropertyNames;var Yh=Object.getPrototypeOf,qh=Object.prototype.hasOwnProperty;var Xh=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),Zh=(o,e)=>{for(var t in e)Jr(o,t,{get:e[t],enumerable:!0})},yc=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Uh(e))!qh.call(o,r)&&r!==t&&Jr(o,r,{get:()=>e[r],enumerable:!(n=$h(e,r))||n.enumerable});return o};var z=(o,e,t)=>(t=o!=null?jh(Yh(o)):{},yc(e||!o||!o.__esModule?Jr(t,"default",{value:o,enumerable:!0}):t,o)),Qh=o=>yc(Jr({},"__esModule",{value:!0}),o);var Bn=Xh((MR,od)=>{"use strict";od.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});var $C={};Zh($C,{CellSelectionState:()=>ze,DataClient:()=>dc,DataSource:()=>JT,DataSourceActionType:()=>qf,DeepMap:()=>ee,FixedSizeSet:()=>Wa,FlashingColumnCell:()=>Mh,GroupRowsState:()=>ft,INTERNAL_MatrixDebugger:()=>_h,InfiniteTable:()=>Jt,InfiniteTableClassName:()=>Ut,InfiniteTableComponent:()=>yh,Menu:()=>Ht,RowDetailCache:()=>Bo,RowDetailState:()=>wt,RowDisabledState:()=>mt,RowSelectionState:()=>Re,TreeDataSource:()=>VC,TreeExpandState:()=>ot,TreeGrid:()=>Ch,TreeSelectionState:()=>Xe,WeakFixedSizeSet:()=>$a,alignNode:()=>qs,components:()=>jC,createFlashingColumnCellComponent:()=>pc,debounce:()=>Dt,debug:()=>Ge,defaultFilterTypes:()=>Tn,eventMatchesKeyboardShortcut:()=>Pa,filterDataArray:()=>Ps,filterTypes:()=>Tn,flatten:()=>cf,getComponentStateRoot:()=>Mt,group:()=>ra,interceptMap:()=>Ih,keyboardShortcuts:()=>vh,multisort:()=>Xt,multisortNested:()=>ia,queryKeyToCacheKey:()=>uo,toTreeDataArray:()=>ff,useComponentState:()=>je,useDataSourceInternal:()=>Ko,useDataSourceState:()=>tn,useEffectWhen:()=>Ya,useEffectWhenSameDeps:()=>Rh,useEffectWithChanges:()=>ro,useEffectWithObject:()=>ET,useGridScroll:()=>za,useInfiniteColumnCell:()=>wr,useInfiniteColumnEditor:()=>Oi,useInfiniteColumnFilterEditor:()=>So,useInfiniteHeaderCell:()=>gr,useInfinitePortalContainer:()=>$g,useLayoutEffectWithChanges:()=>DT,useManagedDataSource:()=>Es,useMasterRowInfo:()=>tS,useOverlay:()=>Qt,useOverlayPortal:()=>lg,usePrevious:()=>bn,useRowInfoReducers:()=>eS,useVisibleColumnSizes:()=>Vg,withSelectedLeafNodesOnly:()=>wh});module.exports=Qh($C);function Dt(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}var Ie=z(require("react"));var J=(...o)=>o.filter(e=>!!`${e}`).join(" ");var Gn=z(require("react")),sl=require("react");function ge(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function at(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var Tc=(o,e)=>o-e;var ei=(o,e)=>Tc(o.revision,e.revision),ee=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let h=g?[]:[...e,p],b=m?()=>this.visitWithNext(h,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,h,l,b,f);if(n&&y===!0)return!0;l++}else b?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(n&&f===!0)return f}};this.fill(e)}static clone(e){let t=new o;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push(i)},t),n}getEntriesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push([r,i])},t),n}getLeafNodesStartingWith(e,t,n){let{respectOrder:r=!1}=n||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},n),r?i.sort(ei).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},c=this.map,u,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(u=c.get(m),!u||!u.map)if(d=!0,p===f-1){d=!0;break}else return[];c=u.map}else if(!n&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(n||(s({...u,keys:e}),d=!0)),d?i?a.sort(ei).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,h)=>{s({...h,keys:f})},!1,c,r,n),i?a.sort(ei).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,p,f)=>{t(u,c,{...f,keys:u}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let n=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((n,r)=>{let{map:i}=n;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],c=at(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e({...n,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(ei);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=ee;function we(){return globalThis}var ni=["#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"],Sc=Symbol("color"),ti=new WeakMap,tl=ge();function nl(o=ni){ti.set(o,o.map(e=>0))}nl();var Jh=(o=ni)=>{let e=[];ti.has(o)?e=ti.get(o):(e=o.map(n=>0),ti.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??ni[0]},ir=":",ol="*",Cc="-",eb=",",tb="debug",nb="diffdebug",vc=!1,rr=new ee,ar=new Map;function rl(o,e){let t=o.split(ir),n=new ee;n.set(t,!0);let r=e.split(ir),i=new Set(r).has(ol),a=r.indexOf(ol),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(ir)):!0}}function ob(o,e){let t=`channel=${o}_permissions=${e}`;if(ar.has(t))return ar.get(t);let n=e.split(eb);function r(l){return ar.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(ol)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Cc);if(c&&(s=s.substring(Cc.length)),rl(o,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),rl(o,s))return r(!c)}return r(!1)}var il=()=>Ge.enable??(we()&&we().localStorage?.getItem(tb))??"",rb=()=>Ge.diffenable??(we()&&we().localStorage?.getItem(nb))??`${vc}`,al="",Ic=vc;function ll(o){Ic=`${rb()}`=="true",al!==o&&(al=o,ar.clear())}function Rc(o){ll(il()),typeof we()<"u"&&we().addEventListener&&we().addEventListener("storage",function(){ll(il())});function e(t,n){let r=n?`${n}${ir}${t}`:t,i=r.split(ir),a=rr.get(i);if(a)return a;let l=rr.get(i.slice(0,-1)),s=(l?l.logFn:Ge.logFn)??xc,c=s,u,d=0,p=()=>u??ob(r,al),f=Jh(Ge.colors),m=Object.defineProperties((...g)=>{let h=tl.getListenersCount(),b;if(h>0&&(b=b??Date.now(),tl({color:f,channel:r,args:g,timestamp:b})),p()){if(b=b??Date.now(),d&&Ic){let C=b-d;c(`%c[${r}]`,`color: ${f}`,`+${C}ms:`)}d=b;let y=[],S;if(g.forEach(C=>{if(C[Sc])S===void 0&&(S=!0),y.push(...C);else{if(typeof C!="string"&&typeof C!="number"){S=!1;return}y.push(`${C}%s`)}}),S){let C=[`%c[${r}]%c %s`,`color: ${f}`,"",...y,""];c(...C)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...h)=>{let b=[`%c${h.join(" ")}%c%s`,`color: ${g}`,""];return b.toString=()=>h.join(" "),b[Sc]=!0,b}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{rr.delete(i)}}});return rr.set(i,m),m}return e(o)}var xc=console.log.bind(console),wc;Object.defineProperty(Rc,"enable",{get:()=>wc,set:o=>{wc=o,ll(il())}});var Ge=Rc;Ge.colors=ni;Ge.logFn=xc;var ib=(o,e)=>tl.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;rl(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Ge.onLogIntent=ib;Ge.destroyAll=()=>{nl(),nl(Ge.colors),rr.clear(),ar.clear()};var bt=o=>{let e=Ge(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},fn=o=>{let e=Ge(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},lr=()=>lr;lr.extend=()=>lr;var ut=class{constructor(e){this.debug=lr,this.error=lr}};var ab=z(require("react")),mn=require("react");var sr=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Dt(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}},oi=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,mn.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=sr(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,mn.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,mn.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};var lb=fn("CSSVariableWatch"),sb=bt("CSSVariableWatch"),cb={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},ub=o=>{let e=(0,sl.useRef)(0),t=Gn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);oi(o.ref,t,{earlyAttach:!0}),Gn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,sb(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);lb(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},cr=o=>{let e=(0,sl.useRef)(null);ub({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return Gn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:cb},Gn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var ii=z(require("react"));var Pc=z(require("react")),cl;function ur(){return cl||(cl=Pc.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}var Dc=z(require("react")),ul;function ri(){return ul||(ul=Dc.createContext(void 0))}function tn(){let o=ur();return ii.useContext(o).componentState}function xe(){let o=ur();return ii.useContext(o)}function Le(){let o=ri();return ii.useContext(o)}var mo=z(require("react")),qe=require("react");function dl(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var pl=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function dr(o){return o!==void 0}function gn(o,e){let t=e[o];return dr(t)}var hn=require("react");var ai=require("react"),Et=()=>{let[o,e]=(0,ai.useState)(0);return[o,(0,ai.useCallback)(()=>{e(t=>t+1)},[e])]};var Ec=o=>{let e=(0,hn.useCallback)(o,[]),t=(0,hn.useRef)(!1),n=(0,hn.useRef)(!1),r=(0,hn.useRef)(void 0),[i,a]=Et();t.current&&(n.current=!0),(0,hn.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var li=require("react");function Pe(o){let e=(0,li.useRef)(o);return e.current=o,(0,li.useCallback)(()=>e.current,[])}var si=require("react"),bn=(o,e)=>{let t=(0,si.useRef)(e===void 0?o:e);return(0,si.useLayoutEffect)(()=>{t.current=o}),t.current};var db=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)},fl;function Mc(){return fl||(fl=(0,qe.createContext)(null))}function pb(o,e,t,n,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:p=>{let f=t(),m=e(),g=m[u],h=!0;if(i&&typeof i[u]=="function"&&i[u](p,{actions:s,state:m})===!1&&(h=!1),h){let S=[p],C=`on${pl(c)}Change`;if(a&&a[u]){let T=a[u](p,m);C=T.callbackName||C,S=T.callbackParams}db(f,C,S)}let b=n[u];typeof b=="function"&&(p=b(p));let y=!!r?.[u];gn(c,f)&&!y||o({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function fb(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=gn(r,e)?e[r]:e[`default${pl(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function Mt(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,qe.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,qe.useRef)(new Set),l=(0,qe.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=Pe(s);function u(){let I={};l&&(I=fb(l,r,i));let R={...i,...I};if(o.mapPropsToState){let{fn:x,propertyReads:D}=dl(o.mapPropsToState,{getProxyTargetFromArgs:A=>A.props,putProxyToArgs:(A,P)=>[{...P,props:A}]}),M=x({props:r,state:R,oldState:null,parentState:s});return a.current=new Set([...a.current,...D]),{...R,...M}}return R}let[d]=(0,qe.useState)(u),p=Pe(r),f=(I,R)=>{if(R.type==="REPLACE_STATE")return R.payload;let x=c?.()??null,D=R.payload.mappedState,M=R.payload.updatedPropsToState,A={...I};if(D&&Object.assign(A,D),o.mapPropsToState){let{fn:O,propertyReads:E}=dl(o.mapPropsToState,{getProxyTargetFromArgs:N=>N.props,putProxyToArgs:(N,H)=>[{...H,props:N}]}),_=O({props:p(),state:A,oldState:I,parentState:x});a.current=new Set([...a.current,...E]),Object.assign(A,_)}return R.type==="ASSIGN_STATE"&&Object.assign(A,R.payload),o.concludeReducer?o.concludeReducer({previousState:I,state:A,updatedProps:M,parentState:x}):A},[m,g]=(0,qe.useReducer)(f,d),h=Pe(m),{allowedControlledPropOverrides:b}=o,y=(0,qe.useMemo)(()=>pb(g,h,p,l,b,o.interceptActions,o.mappedCallbacks),[g,l,b]),S=o.Context??Mc(),C=(0,qe.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:h,replaceState:I=>{g({type:"REPLACE_STATE",payload:I})},assignState:I=>{g({type:"ASSIGN_STATE",payload:I})}}),[m,y,h]),T=bn(r),v=(0,qe.useRef)(!1);v.current=!1;let w=o.layoutEffect?qe.useLayoutEffect:qe.useEffect;return w(()=>{let I=r,R={},x=0,D={},M=0,A={},P=0;if(new Set([...Object.keys(I),...Object.keys(T)]).forEach(_=>{let N=_,H=T[N],B=I[N];if(N!=="children"&&H!==B&&(A[N]={newValue:B,oldValue:H},P++,gn(N,r)||gn(N,T)))if(l.hasOwnProperty(_)){let U=B,de=l[_];typeof de=="function"&&(U=de(B)),m[N]!==U&&(R[N]=U,x++)}else a.current.has(_)&&(D[N]=I[N],M++)}),M>0||x>0){(o.debugName?bt(typeof o.debugName=="function"?`${o.debugName(I)}:rerender`:`${o.debugName}:rerender`):bt("rerender"))("Triggered by new values for the following props",...Object.keys(R??{}),...Object.keys(D??{}));let N={payload:{mappedState:x?R:null,updatedPropsToState:M?D:null}};if(v.current=!0,g(N),o.onPropChange){for(var E in A)if(A.hasOwnProperty(E)){let{newValue:H,oldValue:B}=A[E];o.onPropChange({name:E,newValue:H,oldValue:B},r,y,m)}}o.onPropsChange&&P&&o.onPropsChange(A,r,y,m)}}),w(()=>{s!=null&&!v.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),Ec(()=>()=>{o.cleanup?.(h())}),{contextValue:C,ContextComponent:S}}return{ManagedComponentContextProvider:mo.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return mo.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function je(o){return o=o??Mc(),mo.useContext(o)}var Bc=z(require("react"));var lt="Infinite",Ae={rootClassName:lt};var ci=()=>Ae;var Ac="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",_c={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var jt="_16lm1iw3b _16lm1iw3c _16lm1iw35",Oc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},go={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var ui={1:"_16lm1iw1c",none:"_16lm1iw1d"},pr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var Fc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},Nc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Lc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var kc={none:"_16lm1iwd"},zc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var di={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Vc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Gc={none:"_16lm1iw1x"};var Hc={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var Kc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function Wc(o){let{rootClassName:e}=ci();return Bc.createElement("div",{...o,className:J(`${e}Footer`,di.relative,go.flex,pr.row,o.className)})}var ve=z(require("react")),an=require("react"),Zp=require("react-dom");function pi(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function X(o){return o.slice(4,-1)}var jc=z(require("react")),_e=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return jc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};var fr=z(require("react")),$c=o=>fr.createElement(_e,{...o},fr.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"}),fr.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),fr.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));var ml=z(require("react")),Uc=o=>ml.createElement(_e,{...o},ml.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 gl=z(require("react")),hl=o=>gl.createElement(_e,{...o},gl.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));var bl=z(require("react")),Yc=o=>bl.createElement(_e,{...o},bl.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));var yl=z(require("react")),qc=o=>yl.createElement(_e,{...o},yl.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));var Tl=z(require("react")),Xc=o=>Tl.createElement(_e,{...o},Tl.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));var Sl=z(require("react")),Zc=o=>Sl.createElement(_e,{...o},Sl.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));var Cl=z(require("react")),Qc=o=>Cl.createElement(_e,{...o},Cl.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));var wl=z(require("react")),Jc=o=>wl.createElement(_e,{...o},wl.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 _l=z(require("react"));var tt=z(require("react")),mr=require("react");var tu=require("react");var eu=require("react"),vl;function ho(){return vl||(vl=(0,eu.createContext)(null))}var te=()=>{let o=ho();return(0,tu.useContext)(o)};var nu=require("react");var ou=()=>{let o=ho(),{state:e}=(0,nu.useContext)(o);return e};var bo=z(require("react")),Hn=require("react");function mb(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function gb(o){var e=mb(o,"string");return typeof e=="symbol"?e:String(e)}function hb(o,e,t){return e=gb(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function ru(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function iu(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ru(Object(t),!0).forEach(function(n){hb(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):ru(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function au(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var bb=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},fe=o=>{var e=t=>{var n=o.defaultClassName,r=iu(iu({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=o.variantClassNames[i][s];c&&(n+=" "+c)}}for(var[u,d]of o.compoundVariants)bb(u,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return au(o.variantClassNames,t=>au(t,n=>n.split(" ")[0]))}},e};var lu="_1eexc2a6";var su=fe({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:[]}),cu="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",uu=fe({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),du=fe({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"]]}),pu=fe({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"]]}),fu="_12zfob12u _16lm1iw22 _16lm1iw1z";var mu="_12zfob17",gu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",hu=fe({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Il=fe({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),bu="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",yu=fe({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),Tu="_12zfob1b _16lm1iw2",Su="_16lm1iw1",Cu="_12zfob16",wu=fe({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),vu="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var yt="InfiniteIcon";var Iu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var yb={transition:"width 0.25s, opacity 0.25s"};function yo(o){let[e,t]=(0,Hn.useState)(!0),[n,r]=(0,Hn.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...yb,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,Hn.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,Hn.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return bo.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:J(l,yt,Iu,`${yt}-filter`)},c?bo.createElement("div",{"data-name":"index",style:m,className:mu},s):null,bo.createElement("div",{style:{width:p[0],...f}}),bo.createElement("div",{style:{width:p[1],...f}}),bo.createElement("div",{style:{width:p[2],...f}}))}var Rl=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((w,I)=>{let R=w.maxSize??r??void 0,x=w.minSize??n??void 0;s.push(x),c.push(R),w.size!=null&&(R!=null&&w.size>R&&(w.size=R),x!=null&&w.size<x&&(w.size=x));let D=w.flex==0?null:w.flex;if(w.size==null&&D==null)throw`Items must specify either a size or a flex property. Item at index ${I} doesn't have either of those.`;D!=null&&(l+=1),a+=D??0,i+=w.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((w,I)=>{if(w.flex!=null){let R=d*w.flex,x=w.maxSize??r??void 0,D=w.minSize??n??void 0,M=!1,A=0;x!=null&&R>x&&(p[I]=!0,M=!0,A=x),D!=null&&R<D&&(f[I]=!0,M=!0,A=D),M&&(m+=1,l-=1,a-=w.flex,u-=A)}}),m&&(d=u/a);let g=[],h=0,b=u,y=a,S=0,C=0,T=[];return{items:t.map((w,I)=>{let R={...w},x=w.maxSize??r??void 0,D=w.minSize??n??void 0,M=0,A=p[I],P=f[I],O=A||P,E=w.size??0;if(w.flex!=null){if(O)P&&(M=D),A&&(M=x);else{h+=1;let _=N=>(x!=null&&N>x&&(N=x),D!=null&&N<D&&(N=D),N);h===l?M=_(b):(M=_(Math.round(w.flex*d)),C+=M,b=u-C,y-=w.flex,d=b/y)}E=M,R.flexSize=M}return g.push(M),T.push(E),R.computedSize=E,S+=E,R}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:T,remainingSize:Math.round(e-S)}};function fi(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}var xl=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((x,D)=>(x[D]={...o.columnSizing[D]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],c=l.id,u=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,h=s?.computedMinWidth,b=s?.computedMaxWidth,y=s?.computedFlex?"flex":"width",S=!1,C=!1,T=r>0?1:-1,{value:v,clamped:w,diff:I}=fi(d+r,p,f,T);if(o.shareSpaceOnResize){if(s==null)return n[c]={...n[c],[m]:v},C=w==="min",S=w==="max",{adjustedDiff:v-d,reservedWidth:t,columnSizing:n,minReached:C,maxReached:S,constrained:C||S};let{value:x,clamped:D,diff:M}=fi(g-r,h,b,T);if(w&&D&&(Math.abs(I)>Math.abs(M)?D=!1:w=!1),!(!w&&!D)){if(w){let A=fi(g-r-I,h,b,T);x=A.value,D=A.clamped,M=A.diff}else if(D){let A=fi(d+r+M,p,f,T);v=A.value,w=A.clamped,I=A.diff}}n[c]={...n[c],[m]:v},n[u]={...n[u],[y]:x},C=w==="min"||D==="min",S=w==="max"||D==="max"}else n[c]={...n[c],[m]:v},C=w==="min",S=w==="max";let R=v-d;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?t:t-R,columnSizing:n,minReached:C,maxReached:S,constrained:C||S}};function Ru(o,e){return o+e}function Tb(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var xu=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((b,y)=>(b[y]={...o.columnSizing[y]},b),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((b,y)=>o.dragHandlePositionAfter-y).reverse(),a=i.map(b=>o.items[b]),l=a.map(b=>b.computedWidth),s=a.map(b=>b.computedFlex?"flex":"width"),c=0,{computedSizes:u}=Rl({items:a.map(b=>(b.resizable===!1&&(c+=b.computedWidth),{maxSize:b.computedMaxWidth,minSize:b.computedMinWidth,flex:b.resizable?b.computedWidth:null,size:0})),computeSpecialSpaceDistribution:!0,availableSize:Math.max(l.reduce(Ru,0)+r-c,0)}),d=a.map((b,y)=>u[y]-b.computedWidth),p=!0,f=!0,m=!0,g=[];d.forEach((b,y)=>{let S=a[y];if(!S.resizable){g.push(0);return}let C=s[y],T=l[y],v=Tb(n),{maxReached:w,minReached:I,constrained:R,adjustedDiff:x}=xl({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:b,dragHandlePositionAfter:i[y],shareSpaceOnResize:!1,items:o.items,columnSizing:v});n[S.id]={...v[S.id],[C]:T+x},g.push(x),w||(f=!1),I||(p=!1),R||(m=!1)});let h=g.reduce(Ru,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:g,adjustedDiff:h,columnSizing:n,reservedWidth:t-h}};var mi;function yn(){if(mi!=null)return mi;let o=we().document??null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),mi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),mi}var Pu=["start",void 0,"end"],Du=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Pu.indexOf(r)-Pu.indexOf(i)}),o);function Eu(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function Pl(o,...e){return Eu(t=>t!=null,o,...e)}function Mu(o,e,...t){return Eu((n,r)=>!(r in o),e,...t)}var gi=Object.freeze({}),Sb={string:gi,number:{}};function Dl(o,e){let t=e.default||gi;return o.type===void 0?t:o.type===null?gi:typeof o.type=="string"?e[o.type]||Sb[o.type]||gi:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var hi=!0,Cb=!0,wb=!0,vb="string",To="unknown",Ib=fn("getComputedVisibleColumns"),Rb=(o,e,t)=>o[t]!==!1,El=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},Au=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:g=Tn,viewportReservedWidth:h,resizableColumns:b,draggableColumns:y,columnDefaultDraggable:S,columnOrder:C,columnPinning:T,editable:v,columnDefaultEditable:w,columnDefaultFilterable:I,columnDefaultGroupable:R,columnDefaultSortable:x,columnSizing:D,columnTypes:M,columnVisibility:A,columnVisibilityAssumeVisible:P,groupBy:O})=>{let E=0,_={};O.forEach((V,Q)=>{V.field&&(_[V.field]=Q)});let N=(d||[]).reduce((V,Q)=>{let{id:ye,field:Ce}=Q;return Ce&&(V[Ce]=Q),ye&&(V[ye]=Q),V},{}),H=Du(C===!0?Object.keys(o):C,T),B=H.filter(V=>o[V]?Rb(A,P,V):(Ib(`Column with id "${V}" specified in columnOrder array cannot be found in the columns map.`),!1)),U=new Map,de=B.map((V,Q)=>{let ye=o[V];return U.set(V,Q),ye}),pe=(f??[]).reduce((V,Q,ye)=>(Q.id?V[Q.id]={sortInfo:Q,index:ye}:Q.field&&(V[Q.field]={sortInfo:Q,index:ye}),V),{});function k(V){let Q=o[V],ye=Dl(Q,M),Ce={minWidth:ye?.minWidth,maxWidth:ye?.maxWidth,width:ye?.defaultWidth,flex:ye?.defaultFlex},Ze=Pl({width:Q?.defaultWidth,flex:Q?.defaultFlex,minWidth:Q?.minWidth,maxWidth:Q?.maxWidth},D[V]);Ze.width!=null&&delete Ce.flex,Ze.flex!=null&&delete Ce.width,Ze=Pl(Ce,Ze);let L=Ze.flex??void 0,Be=Ze.minWidth??Q?.minWidth??t,Bt=Ze.maxWidth??Q?.maxWidth??n,ht=L!=null?void 0:Ze.width??(i?void 0:r);return!ht&&L==null&&(i?L=i:ht=Be),{size:ht,flex:L,minSize:Be,maxSize:Bt}}let Y=Rl({availableSize:Math.max(e.width-(h??0)-(a??yn()),0),maxSize:n,minSize:t,items:B.map(k)}),{computedSizes:ae,flexSizes:se,minSizes:le,maxSizes:re}=Y,Z=[],be=[],oe=[],G=[];G.length=B.length;let W=new Map,F=new Map,ie=0,j=0,K=0,ne=null,q=[],ue=0,me=0,He=0;de.forEach((V,Q)=>{let ye=B[Q],Ce=ae[Q],Ze=q[Q]=El(ye,T);Ze==="start"?ue+=Ce:Ze==="end"?He+=Ce:me+=Ce});let Me=e.width-He,Ke=[],Je=new Map;B.forEach((V,Q)=>{let ye=de[Q];Je.set(V,ye)});let Ve=[];Object.keys(o).forEach(V=>{let Q=o[V];Ve.push(V),Je.has(V)||Je.set(V,Q)});let et=new Map;Je.forEach((V,Q)=>{let ye=U.get(Q);ye==null&&(ye=-1);let Ce=ye!=-1,Ze=B[ye+1],L=Dl(V,M),Be=ye,Bt=pe[Q]?pe[Q]:V.field?pe[V.field]??null:null,ht=Bt?.sortInfo??null,Pt=!!ht,Wt=Pt&&ht.dir===1,qa=Pt&&!Wt,Xa=Bt?.index??-1,or=Ce?{}:k(Q),Xr=Ce?ae[ye]:or.size||0,Ee=Ce&&se[ye]||null,it=Ce?le[ye]||0:or.minSize||0,en=Ce?re[ye]||1e4:or.maxSize||1e4,Fe=Ce?El(Q,T):!1,fo=Ce?ye===B.length-1:!1,Zr=Be,Fh=Ce?Fe==="start"?j:Fe==="end"?K:E-j:0;Fe=="start"?Zr=Ce?Be:-1:Fe==="end"?Zr=Ce?Be-(Z.length+oe.length):-1:Zr=Ce?Be-Z.length:-1;let Nh=Ce?Fe==="start"||Fe===!1?E:Me+K:-1,Lh=Ce?Fe!==ne:!1,kh=Ce?fo||Fe!==El(Ze,T):!1,fc=V.cssEllipsis??L.cssEllipsis??l,zh=V.headerCssEllipsis??L.cssEllipsis??V.cssEllipsis??L.headerCssEllipsis??s??fc,Qr=Ce&&(N[Q]||V.field||V.groupByForColumn)&&(N[Q]||N[V.field||V.groupByForColumn])||null,Vh=V.defaultFilterable??L.defaultFilterable??I??!0,Gh=v??V.defaultEditable??L.defaultEditable??w??!1,Za=V.dataType||L.dataType||(Array.isArray(V.type)?V.type[0]:V.type)||vb,Hh=V.sortType||L.sortType||Za,mc=V.filterType||L.filterType||Za,gc=!1;if(Qr!=null&&!Qr.disabled){let el=g[mc];el&&(!el.emptyValues||!el.emptyValues.includes(Qr.filter.value))&&(gc=!0)}let Vn=V.field??L.field,hc=V.valueGetter??L.valueGetter,Qa=V.defaultGroupable??L.defaultGroupable??R??!!Vn;Vn||(Qa=!1),V.groupByForColumn&&(Qa=!1);let Ja=V.defaultSortable??L.defaultSortable;Ja==null&&!V.groupByForColumn&&Vn==null&&hc==null&&(Ja=!1);let bc=Vn?_[Vn]!==void 0:!1,Kh=bc?_[Vn]:void 0,Bh=p??Ja??x??hi,Wh=V.resizable??L.resizable??b??Cb,We={colType:L,align:L.align,headerAlign:L.headerAlign,computedVisible:Ce,verticalAlign:L.verticalAlign,defaultHiddenWhenGroupedBy:L.defaultHiddenWhenGroupedBy,valueGetter:hc,valueFormatter:L.valueFormatter,renderValue:L.renderValue,render:L.render,style:L.style,className:L.className,contentFocusable:L.contentFocusable,renderMenuIcon:L.renderMenuIcon,renderSortIcon:L.renderSortIcon,renderRowDetailIcon:L.renderRowDetailIcon,renderSelectionCheckBox:L.renderSelectionCheckBox,renderHeaderSelectionCheckBox:L.renderHeaderSelectionCheckBox,headerStyle:L.headerStyle,headerClassName:L.headerClassName,columnGroup:L.columnGroup,getValueToEdit:L.getValueToEdit,getValueToPersist:L.getValueToPersist,shouldAcceptEdit:L.shouldAcceptEdit,field:Vn,...V,components:{...L.components,...V.components},computedResizable:Wh,computedMinWidth:it,computedMaxWidth:en,computedFlex:Ee,computedDataType:Za,computedEditable:Gh,computedSortType:Hh,computedFilterType:mc,cssEllipsis:fc,headerCssEllipsis:zh,computedFilterValue:Qr,computedFiltered:gc,computedFilterable:Vh,computedGroupable:Qa,computedGroupedBy:bc,computedGroupedByIndex:Kh,computedWidth:Xr,computedAbsoluteOffset:Nh,computedPinningOffset:Fh,computedVisibleIndexInCategory:Zr,computedOffset:E,computedSortable:Bh,computedSortInfo:ht,computedSortIndex:Xa,computedMultiSort:m,computedSorted:Pt,computedSortedAsc:Wt,computedSortedDesc:qa,computedVisibleIndex:Be,computedPinned:Fe,computedDraggable:y??V.defaultDraggable??S??wb,computedFirstInCategory:Lh,computedLastInCategory:kh,computedFirst:ye===0,computedLast:fo,id:Q,header:V.header??L.header??V.name??V.field};Ce&&(E+=Xr,W.set(We.id,We),G[ye]=We,Fe==="start"&&(Z.push(We),j+=We.computedWidth),Fe==="end"&&(be.push(We),K+=We.computedWidth),Fe||(oe.push(We),ie+=We.computedWidth),ne=Fe),We.groupByForColumn&&(We.computedSortType=V.sortType||L.sortType||To,Ke.push(We)),F.set(We.id,We),We.field&&!We.groupByForColumn&&!et.has(We.field)&&et.set(We.field,We)}),Ke.forEach(V=>{V.computedSortable=_u(V,{fieldsToColumn:et,sortable:p,columnDefaultSortable:x})});let Ye=new Map;Ve.forEach(V=>{let Q=F.get(V);Q&&Ye.set(V,Q)}),F.forEach(V=>{Ye.has(V.id)||Ye.set(V.id,V)});let xt=c!=null?Math.min(c,j):j,zn=u!=null?Math.min(u,K):K;return{computedRemainingSpace:e.width-(ue+He+me),computedPinnedStartColumnsWidth:j,computedPinnedEndColumnsWidth:K,computedUnpinnedColumnsWidth:ie,computedColumnOrder:H,computedPinnedStartColumns:Z,computedPinnedEndColumns:be,computedUnpinnedOffset:j,computedPinnedEndOffset:j+ie,computedUnpinnedColumns:oe,computedVisibleColumns:G,computedColumnsMap:F,computedColumnsMapInInitialOrder:Ye,computedVisibleColumnsMap:W,computedPinnedEndWidth:zn,computedPinnedStartWidth:xt,renderSelectionCheckBox:G.reduce((V,Q)=>V||!!Q.renderSelectionCheckBox,!1),fieldsToColumn:et}};function _u(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r}=e;if(t)return t;let i=o.defaultSortable??o.colType.defaultSortable;if(i!=null)return i;let a=r??hi;return o.computedSortType!==To&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.groupField,g;if(m){let h=n.get(m),b=h?u.getColumnApi(h.id):void 0;h&&b?g=b.isSortable():g=!1}return g===void 0&&f.valueGetter&&(g=!0),g??r??hi},!0)}}function st(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function Kn(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let h=st(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:h,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}var Ou=z(require("react"));var bi=`${lt}HeaderCell__filter`,Ml=`${lt}HeaderCell__filterOperator`,Al=Ou.createContext(null);var xb=`${bi}__input`,yi=o=>o.stopPropagation();function Fu(o){let{filterOperatorMenuVisibleForColumnId:e}=ou(),{column:t}=gr(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,mr.useState)(!1),l=tt.useCallback(()=>{a(!0)},[]),s=tt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return tt.createElement("div",{onPointerUp:yi,onPointerDown:yi,onFocus:l,onBlur:s,className:`${bi} ${Il({active:c})}`,style:{height:o.columnHeaderHeight}},tt.createElement(Al.Provider,{value:o},tt.createElement(r,null),tt.createElement(n,null)))}function Nu(){let{columnApi:o,disabled:e,operator:t}=So(),n=t?.components?.Icon??yo;return tt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:J(Ml,gu,e?`${Ml}--disabled`:"")},tt.createElement(n,{size:20,className:`${hu({disabled:e})}`}))}function Lu(){return tt.createElement("div",{onPointerUp:yi,onPointerDown:yi,className:`${bi} ${Il({active:!1})} ${Fc["50%"]}`})}function So(){let o=te(),{column:e,columnApi:t}=gr(),n=Kn(e,o,"column-filter"),r=tt.useContext(Al),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,mr.useState)(l?.filter.value??""),d=tt.useCallback(h=>{u(h),r.onChange(h)},[r.onChange]),p=tt.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=tt.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,mr.useEffect)(()=>{if(l)c!==l.filter.value&&u(l.filter.value);else if(s){let h=[...s.emptyValues][0];h!==c&&u(h)}},[l?.filter.value]);let m=r.operator,g=m?.name;return{api:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${fu} ${xb}`}}function Co(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=So();return _l.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function Ti(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=So();return _l.createElement("input",{"aria-label":o,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:n})}function Pb(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:Co},operators:[{name:"includes",components:{Icon:$c},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:hl},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:Jc},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Uc},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Ti},operators:[{label:"Equals",components:{Icon:hl},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:Qc},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:qc},fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>t},{name:"gte",components:{Icon:Yc},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>=t},{name:"lt",components:{Icon:Zc},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<t},{name:"lte",components:{Icon:Xc},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<=t}]}}}var Tn=Pb();function Si(o,e,t,n){let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Po=require("react");function Sn(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function ku(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var $={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var zu="true",ce={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)"}}},Vu="column-header-height";var Gu=`.${Ae.rootClassName}`;function Ol(o){return Sn(o,Gu)}var Hu=X($.scrollLeft),Db=X($.scrollTop),Eb=X($.columnWidthAtIndex),Fl=X($.columnOffsetAtIndex),Ku=X($.columnReorderEffectDurationAtIndex),Mb=X($.columnOffsetAtIndexWhileReordering),Ab=X($.columnVisibilityAtIndex),_b=X($.columnZIndexAtIndex);function $t(o,e,t){let n=t?Ol(t):document.querySelector(Gu);Ob(o,e,n)}function Ob(o,e,t){if(t){let n=o,r=$[n]?X($[n]):o;t.style.setProperty(r,`${e}`)}}function wo(o,e){if(e)for(var t in o){let n=$[t]?X($[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function Nl(o,e,t){$t(`${Fl}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${Hu}))`:`${o.computedAbsoluteOffset+e}px`,t)}function Ll(o,e,t){$t(`${_b}-${o}`,`${e}`,t)}function vo(o,e,t){$t(`${Mb}-${o}`,typeof e=="number"?`calc( var(${Fl}-${o}) + ${e}px )`:e,t)}function hr(o,e,t){$t(`${Ab}-${o}`,e,t)}function Ci(o,e,t){$t(`${Ku}-${o}`,t??"",e)}function kl(o,e){let t=`${Ku}-${o}`;$t(t,ce.components.Cell.reorderEffectDuration,e)}var Te={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Eb}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,$t(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${Fl}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,$t(this.varName.get(o),e,t)}}};function Bu(o,e){wo({[Hu]:`${o.scrollLeft}px`,[Db]:`${o.scrollTop}px`},e)}var Wu="_16lm1iw1",ju="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",$u="_1yeub2vs",Uu="_1yeub2vr",Yu=fe({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 zl="_1yeub2vp";var hR=fe({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Vl=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};var br={bodyWidth:{name:X(ce.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:X(ce.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:X(ce.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:X(ce.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:X(ce.runtime.browserScrollbarWidth),value:""}},Fb=X($.scrollbarWidthHorizontal),qu=X($.scrollbarWidthVertical),Nb=X($.columnWidthAtIndex),Lb=X($.columnZIndexAtIndex),Xu=X($.scrollLeft),kb=X($.activeCellColWidth),Zu=X($.activeCellColOffset),td=X($.baseZIndexForCells),zb=X($.pinnedStartWidth),Qu=X($.bodyWidth),Vb=X($.bodyHeight),Ju=X($.pinnedEndOffset),ed=X($.pinnedEndWidth),Gb=X($.computedVisibleColumnsCount);function Gl(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${td}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function nd(o){let e=yn(),{computed:t,state:n,actions:r,getState:i}=te(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:c,onBlurWithin:u,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:g,wrapRowsHorizontally:h}=n,{computedPinnedStartColumnsWidth:b,computedPinnedEndColumnsWidth:y,computedPinnedStartColumns:S,computedPinnedEndColumns:C,computedVisibleColumns:T,computedUnpinnedColumnsWidth:v,scrollbars:w}=t,I=[],R=T.reduce((E,_)=>{let N=_.computedVisibleIndex;E[Te.columnWidths.varName.get(N)]=_.computedWidth+"px",E[Te.columnOffsets.varName.get(N)]=_.computedPinned==="start"?`calc( ${_.computedOffset}px + var(${Xu}) )`:_.computedPinned==="end"?`calc( var(${Ju}) ${I.length?"+":""} ${I.map(B=>Te.columnWidths.get(B.computedVisibleIndex)).join(" + ")} + var(${Xu}) )`:`${_.computedOffset}px`;let H=Gl(_,{pinnedStartColsCount:S.length,visibleColsCount:T.length});return E[`${Lb}-${N}`]=`${H}`,_.computedPinned==="end"&&I.push(_),E},{});if(m.width&&(R[br.browserScrollbarWidth.name]=`${yn()}px`),R[br.bodyWidth.name]=`calc(${$.bodyWidth} - ${$.scrollbarWidthVertical})`,R[br.totalVisibleColumnsWidthValue.name]=`${b+y+v}px`,R[br.totalVisibleColumnsWidthVar.name]=`calc(${T.map((E,_)=>`var(${Nb}-${_})`).join(" + ")})`,R[br.visibleColumnsCount.name]=T.length,g!=null){R[kb]=Te.columnWidths.get(g[1]);let E=Te.columnOffsets.get(g[1]);if(n.brain.isHorizontalLayoutBrain){let _=n.brain.getPageIndexForRow(g[0]);R[Zu]=_?`calc( ${ce.runtime.totalVisibleColumnsWidthVar} * ${_} + ${E})`:E}else R[Zu]=E}R[Gb]=T.length,R[Fb]=w.horizontal?`${e}px`:"0px",R[qu]=w.vertical?`${e}px`:"0px",R[zb]="calc( "+S.map(E=>Te.columnWidths.get(E.computedVisibleIndex)).join(" + ")+")",R[ed]="calc( "+C.map(E=>Te.columnWidths.get(E.computedVisibleIndex)).join(" + ")+")",R[td]=T.length*10,R[Ju]=`calc( var(${Qu}) - var(${ed}) - var(${qu}) )`,R[Qu]=`${m.width}px`,R[Vb]=`${m.height}px`;let x=Vl(E=>{r.focused=E}),D=Vl(E=>{r.focusedWithin=E}),P={...o,onFocus:E=>{if(o?.onFocus?.(E),E.target===s.current||E.target===c.current){if(i().focused)return;x(!0),p?.(E),l&&(D(!1),u?.(E));return}l||(D(!0),d?.(E))},onBlur:E=>{if(o?.onBlur?.(E),E.target===s.current||E.target===c.current){if(!i().focused)return;x(!1),f?.(E),l&&(D(!1),u?.(E));return}s.current?.contains(E.relatedTarget)||(D(!1),u?.(E))}},O=J(Ut,ju,h?`${Ut}--horizontal-layout`:null,P?.className,b?`${Ut}--has-pinned-start ${Uu}`:null,y?`${Ut}--has-pinned-end ${$u}`:null,a?`${Ut}--focused`:null,l?`${Ut}--focused-within`:null,a&&n.focusedClassName?n.focusedClassName:null,l&&n.focusedWithinClassName?n.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${Ut}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${Ut}--has-pinned-end-overflow`:null,Yu({horizontalLayout:!!h,hasPinnedStart:!!b,hasPinnedEnd:!!y,focused:a,focusedWithin:l}));return P.className=O,P.style={...o?.style,...R},a&&n.focusedStyle&&Object.assign(P.style,n.focusedStyle),l&&n.focusedWithinStyle&&Object.assign(P.style,n.focusedWithinStyle),P}var dd=z(Bn());function wi(o){return o.map(e=>e instanceof Cn?e:new Cn(null,[e]))}var Cn=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>Hb(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function Hb(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var Kb=(...o)=>new Cn("+",wi(o)),rd=(...o)=>new Cn("-",wi(o)),Bb=(...o)=>new Cn("*",wi(o)),Wb=(...o)=>new Cn("/",wi(o)),yr={add:Kb,subtract:rd,minus:rd,multiply:Bb,divide:Wb};var Wn=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var Oe=we().requestAnimationFrame||(o=>setTimeout(o,16)),Ft=we().cancelAnimationFrame||(o=>clearTimeout(o));var id=o=>{let e=null,t=null;return{stop(){e!==null&&Ft(e),t!=null&&Ft(t)},scroll(n){e!==null&&Ft(e),t!=null&&Ft(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=Oe(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=Oe(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var ke=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,n=e.left-this.left;return{top:t,left:n}}};function ad(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function ld(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function jb(o,e,t){let n=ad(o,t),r=ad(e,t);return n===r?ld(t,e)-ld(t,o):n-r}function sd(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>jb(n,r,t)),e}function $b(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function Ub(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=sd(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function cd(o,e){if($b(o))return Ub(o,e);o=sd(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(Yb([t,i,a],e))return!0}return!1}function Yb(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var Io=class{containsPoint(e){return cd(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var Ro=class o extends Io{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(ke.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function qb(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,c=Math.max(l,s);return new Se({top:n,left:t,width:a-t,height:c-n})}var Se=class o extends Io{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=qb(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new Ro(this.getPoints()).containsPoint(t)}getTopLeft(){return{left:this.left,top:this.top}}getTopRight(){return{left:this.left+this.width,top:this.top}}getBottomLeft(){return{left:this.left,top:this.top+this.height}}getBottomRight(){return{left:this.left+this.width,top:this.top+this.height}}getCenter(){return{left:this.left+this.width/2,top:this.top+this.height/2}}getPoints(){return[this.getTopLeft(),this.getTopRight(),this.getBottomLeft(),this.getBottomRight()].map(ke.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var ud=10,Xb=X($.pinnedStartWidth);function pd(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:h,horizontalLayoutPageIndex:b,pageWidth:y}=o;function S(G){let W=G==="start"?N:H;return O===_?W:_===G?W+A.computedWidth:O===G?W-A.computedWidth:W}function C(G){if(G.columnIndex===P||b!=null)return!0;let W=e[G.columnIndex];if(W.computedPinned)return!0;let F=l.getScrollPosition().scrollLeft,ie=W.computedOffset+(b!=null&&y!=null?y*b:0);return ie>=F+S("start")&&ie+W.computedWidth<=F+u.width-S("end")}let T=(G,W)=>{let{restrictToParentGroup:F,dragColumn:ie}=W,j=[];if(G.forEach(ne=>{if(ne.computedVisibleIndex===P)return;let q={columnId:ne.id,columnIndex:ne.computedVisibleIndex,offsetX:ne.computedOffset+Math.round(ne.computedWidth/2)};C(q)&&j.push(q)}),F){let q=function(me,He,Me){let Ke=G[me];Ke&&(Ke.columnGroup!==ie.columnGroup&&Me.add(Ke.id),q(me+He,He,Me))};var K=q;let ne=ie.computedVisibleIndex,ue=new Set;q(ne-1,-1,ue),q(ne+1,1,ue),j=j.filter(me=>!ue.has(me.columnId))}return j},w=r.length,I={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},R={left:I.clientX-u.left-(I.clientX-s.left)+ud,top:I.clientY-u.top-(I.clientY-s.top)+ud},x=l.getScrollPosition(),D=e.map(G=>G.computedVisibleIndex),M=D,A=t.get(i),P=A.computedVisibleIndex,O=A?.computedPinned,E=P,_=O,N=l.getFixedStartColsWidth(),H=l.getFixedEndColsWidth(),B=I,U={x:0,y:0},de=1,pe=0;function k(G){let W=Math.round(G.clientX),F=Math.round(G.clientY);if(W===B.clientX&&F===B.clientY)return Se.from(s).shift({left:U.x,top:U.y});B={clientX:W,clientY:F};let j=l.getScrollPosition().scrollLeft-x.scrollLeft;return U.x=B.clientX-I.clientX,U.y=B.clientY-I.clientY,pe=U.x+j,de=pe<0?-1:1,f({left:R.left+U.x,top:R.top+U.y}),Se.from(s).shift({left:U.x,top:U.y})}function Y(G){let W=0;O?O==="start"&&G.forEach((F,ie)=>{W||e[F]?.computedPinned!=="start"&&(W=ie)}):G.forEach((F,ie)=>{e[F]?.computedPinned==="start"&&(W=ie+1)}),w=W,ae("start",G,W)}function ae(G,W,F){if(G==="start"){let ie=0;for(let j=0;j<F;j++){let K=W[j],ne=e[K];ie+=ne.computedWidth}$t(Xb,`${ie}px`,a)}}function se(G){if(G==null||G===E)return;if(E===-1&&G!==-1&&(hr(P,"",a),m(!1)),E=G,G===-1){le(P);return}let W=Wn(D,P,E>P?E-1:E);w=0;let ie=new Set;return W.forEach((j,K)=>{let ne=M[K];j!==ne&&ie.add(j),Y(W)}),M=W,re(ie),{newColumnIndexes:W,indexesWithTransition:ie,pinnedStartCount:w}}function le(G){M=M.filter(F=>F!==G),e.forEach(F=>{let ie=F.computedVisibleIndex,j=ie>G;kl(ie,a);let K="";j&&(K=yr.minus(Te.columnOffsets.get(ie),Te.columnWidths.get(G)).done()),vo(ie,K,a)}),hr(G,"hidden",a),m(!0)}function re(G){e.forEach(W=>{let F=W.computedVisibleIndex;G.has(F)?kl(F,a):Ci(F,a);let ie=F===P,j=de===-1?F<E||F>P:F<P||F>=E,K="";de===-1?K=ie?Te.columnOffsets.get(E):j?Te.columnOffsets.get(F):yr.add(Te.columnOffsets.get(F),Te.columnWidths.get(P)).done():K=j?Te.columnOffsets.get(F):ie?yr.add(Te.columnOffsets.get(E-1),Te.columnWidths.get(E-1)).minus(Te.columnWidths.get(P)).done():yr.minus(Te.columnOffsets.get(F),Te.columnWidths.get(P)).done(),vo(F,K,a)})}let Z=u.left+S("start"),be=u.right-S("end"),oe=id({scrollOffsetStart:Z,scrollOffsetEnd:be});return k(I),{speedScroller:oe,stop(){oe.stop()},onMove(G){let W=k(G);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(W.getCenter()))return p&&se(-1),null;oe.scroll({mousePosition:B,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(q){h.scrollLeft=q}});let F=T(e,{dragColumn:A,restrictToParentGroup:c==="group"}),ie=de===-1?A.computedOffset+pe:A.computedOffset+A.computedWidth+pe,j=(0,dd.default)(F,ie,({offsetX:q},ue)=>q<ue?-1:q>ue?1:0);j<0&&(j=~j),F.length?j=F[j]?F[j].columnIndex:F[F.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),j=0),j===P+1&&(j=P),se(j);let K={};n.forEach(q=>{K[q.id]="end"});for(let q=0;q<w;q++){let ue=M[q],me=e[ue];K[me.id]="start"}let ne=M.map(q=>e[q].id);return{columnPinning:K,columnOrder:ne}}}}function At(o,e,t){if(o===e)return!0;if(!o||!e)return!1;var n=Object.keys(o),r=Object.keys(e);t&&(n=n.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=n[a];if(!(t&&t.has(l))&&(o[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function Hl(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return n;if(a>i){let l=e.indexOf(r),s=e[l-1],c=n.indexOf(s),u=n.indexOf(r);return Wn(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return Wn(n,u,c)}return e}var dt=z(require("react"));var jn=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var fd=z(Bn());var md=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=n,p=c===a,f=ke.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),h=e.breakpoints,b=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),y=(0,fd.default)(h,b,(w,I)=>w-I);y<0&&(y=~y),m===1&&y===u+1&&p&&y--;let S=Math.min(u,y),C=Math.max(u,y),T=p?i.map((w,I)=>{if(I===u&&p)return t;if(I<S||I>=C)return{left:0,top:0};let R=y<=I?1:-1;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}):i.map((w,I)=>{let R=y<=I?1:0;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}),v={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:T,dragRect:g,status:"accepted"};return e.acceptsDrop(v)?{event:v,error:null,success:!0}:(v.status="rejected",{event:v,error:"rejected by interaction target",success:!1})},gd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=n,d=ke.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),h={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((b,y)=>b.id===c.id?t:f?{left:0,top:0}:y>m?r==="horizontal"?{left:-c.rect.width,top:0}:{left:0,top:-c.rect.height}:{left:0,top:0}):l.map(b=>({left:0,top:0})),dragRect:g,status:"accepted"};return e.acceptsDrop(h)?{event:h,error:null,success:!0}:(h.status="rejected",{event:h,error:"rejected by interaction target",success:!1})};var De=class De{static startDrag(e,t){let n=e instanceof xo?e:new xo(e),r=new Kl({activeDragSource:n,startPoint:t});return r.on("start",De.onDragStart),r.on("move",De.onDragMove),r.on("drop",De.onDragDrop),r.start(),r}static emit(e,...t){De.emitter.emit(e,...t)}static on(e,t){return De.emitter.on(e,t)}static registerDragInteractionTarget(e){if(De.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return De.dragInteractionTargetsMap.set(e.listId,e),De.emit("register",e),()=>{De.unregisterDragInteractionTarget(e)}}static unregisterAll(){De.dragInteractionTargetsMap.forEach(e=>{De.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!De.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}De.dragInteractionTargetsMap.delete(e.listId),e.unregister(),De.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=De.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;De.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),De.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=De.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(De.dragInteractionTargetsMap.get(r))),De.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=md(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:n,dragItem:r}=t,i=null,a=[];De.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;De.emit("drag-move",{dragSourceListId:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];De.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;De.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),De.unregisterAll()}};De.dragInteractionTargetsMap=new Map,De.emitter=new jn;var Tt=De,xo=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){At(this.data,e)||(this.data=e,this.dragRectangle=new Se(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=Se.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},Kl=class extends jn{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=xo.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=xo.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=Tt;var hd=require("react"),bd=dt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),$n=()=>dt.useContext(bd),Bl=o=>{let[e,t]=dt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=dt.useRef(e);n.current=e;let r=dt.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=dt.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=Tt.on("drag-start",c=>{t({dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:"accepted"})}),l=Tt.on("drag-move",c=>{let u=n.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=Tt.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[Tt,t]),dt.createElement(bd.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var Wl=`${lt}Body`,yd=o=>o.querySelector(`.${Wl}`);var Un=`${lt}HeaderCell`,jl=`${lt}HeaderWrapper`,Td=o=>Array.from(o.querySelectorAll(`.${jl}`));function vi(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var Zb=X($.baseZIndexForCells),Qb=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:At(o,e)},Sd=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,Po.useState)(null),[a,l]=(0,Po.useState)(!1),{getCurrentDragSourceAndTarget:s}=$n(),{actions:c,computed:u,getComputed:d,getState:p,api:f,state:{domRef:m}}=te(),g=(0,Po.useCallback)(b=>{let y=d().computedVisibleColumnsMap.get(o);if(!y||!y.computedSortable)return;let{multiSortBehavior:S}=p();f.toggleSortingForColumn(o,{multiSortBehavior:S==="replace"&&(b.ctrlKey||b.metaKey)?"append":S})},[]),h=(0,Po.useCallback)(b=>{if(vi(b.target))return;let{brain:y,draggableColumnsRestrictTo:S}=p(),{computedVisibleColumns:C,computedVisibleColumnsMap:T,computedPinnedStartColumns:v,computedUnpinnedColumns:w,computedPinnedEndColumns:I}=d(),R=T.get(o);if(!R.computedDraggable){g(b);return}let x=e.current,D=x.getBoundingClientRect(),M=m.current.getBoundingClientRect(),A=y.getAvailableSize(),P=R.computedVisibleIndex,O=y.getVirtualColIndex(R.computedVisibleIndex,{pageIndex:t||0}),E=y.isHorizontalLayoutBrain?y.getPageWidth():null,_=x.style.cursor??"auto",N=!1,H=m.current,B=Se.from(yd(H).getBoundingClientRect()),U=Td(H).map(Z=>Se.from(Z.getBoundingClientRect())),de=B.getMinimumBoundingRectangle(...U),pe=pd({brain:y,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:E,draggableColumnsRestrictTo:S,computedPinnedEndColumns:I,computedPinnedStartColumns:v,computedUnpinnedColumns:w,computedVisibleColumns:C,computedVisibleColumnsMap:T,dragColumnHeaderTargetRect:D,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:f,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:M,acceptDropToReorderRect:de,initialMousePosition:{clientX:b.clientX,clientY:b.clientY}}),k=null,Y,ae;function se(Z){let{columnPinning:be,columnOrder:oe}=Z;Qb(p().columnPinning,be)||(c.columnPinning=be);let G=d().computedColumnOrder;JSON.stringify(oe,G)&&(C.forEach(W=>{vo(W.computedVisibleIndex,"",m.current)}),c.columnOrder=Hl({newColumnOrder:oe,visibleColumnOrder:d().computedVisibleColumns.map(W=>W.id),existingColumnOrder:G,dragColumnId:o}))}let le=Z=>{let{headerBrain:be,brain:oe}=p();if(!N){N=!0;let G=oe.keepColumnRendered(O),W=be.keepColumnRendered(O);if(oe.isHorizontalLayoutBrain){let ie=oe.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),j=be.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ae=()=>{ie(),j()}}Y=()=>{G(),W()},c.columnReorderDragColumnId=R.id,t!=null&&(c.columnReorderInPageIndex=t),Ll(P,`calc( var(${Zb}) + 10000 )`,m.current),m.current?.classList.add(zl),x.style.cursor="grabbing"}k=pe.onMove(Z)},re=Z=>{let{multiSortBehavior:be}=p(),oe=e.current;m.current?.classList.remove(zl),pe.stop(),y.update({...A}),Y?.(),ae?.(),C.forEach(W=>{Ci(W.computedVisibleIndex,m.current),hr(W.computedVisibleIndex,"",m.current),vo(W.computedVisibleIndex,"",m.current)}),Ll(P,Gl(R,{pinnedStartColsCount:v.length,visibleColsCount:C.length}),m.current),oe.style.cursor=_,oe.releasePointerCapture(Z.pointerId),oe.removeEventListener("pointermove",le),oe.removeEventListener("pointerup",re),i(null);let G=f.getColumnApi(R.id)?.isSortable()??!1;!N&&G&&f.toggleSortingForColumn(R.id,{multiSortBehavior:be==="replace"&&(Z.ctrlKey||Z.metaKey)?"append":be}),k?se(k):N&&n&&f.setVisibilityForColumn(R.id,!1),c.columnReorderDragColumnId=!1,t!=null&&(c.columnReorderInPageIndex=null)};x.addEventListener("pointermove",le),x.addEventListener("pointerup",re),x.setPointerCapture(b.pointerId)},[o,t]);return{onPointerDown:u.computedVisibleColumnsMap.get(o)?.computedDraggable?h:g,dragColumnOutside:a,proxyPosition:r}};var Eo=z(require("react"));var he=z(require("react")),$e=require("react");var qn=z(require("react"));var Cd=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var Tr=z(require("react")),Id=require("react");var wd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",vd=fe({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 Ii=`${yt}-expand-collapse`;function Yn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,Id.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),gn("expanded",o)||i(!r)};Tr.useEffect(()=>{gn("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Tr.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:J(o.className,wd,vd({direction:t||"start",expanded:r,disabled:n}),`${yt}`,`${Ii}`,`${Ii}--${l}`,`${Ii}--${t==="end"?"end":"start"}`,n?`${Ii}--disabled`:"")},Tr.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}var Ri=z(require("react"));var Rd="_16lm1iwb _16lm1iw1d _16lm1iwk";var xd=o=>Ri.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:J(o.className,Rd,"InfiniteIcon","InfiniteIcon-loading")},Ri.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},Ri.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var{rootClassName:Jb}=Ae,Yt=`${Jb}ColumnCell`;var Pd=fe({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Dd="_7pupv00",Ed=fe({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Md({rowInfo:o}){return{[X(ce.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function xi({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=n,d=J(go.flex,i.align==="end"?pr.rowReverse:pr.row,_c.center,`${Yt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c)?Pd({align:a}):null);if(e==="multi-column"){if(o+1!==u.groupNesting&&u.isGroupRow)return c?qn.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return qn.createElement("div",{className:d},s,c,qn.createElement("div",{className:jt},l??null))}}function Pi({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return Cd(u)?f=qn.createElement(xd,null):m&&(f=qn.createElement(Yn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=qn.createElement(pt,{render:n,renderParam:r})),f}}function Ad(o,e,t){let{groupByForColumn:n,groupIndexForColumn:r,groupRenderStrategy:i}=o,a=n.column?{...n.column}:{},l={header:`Group by ${n.field||n.groupField}`,groupByForColumn:n,render:xi({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:Pi({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(o,e)}:l={...l,...t}),l}function _d(o,e,t){let n=typeof t=="function"?t(o,e):t,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:xi({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...n,renderGroupIcon:Pi({initialRenderGroupIcon:n?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Od(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var Fd="_1eexc2a7 _1eexc2a6",Nd=fe({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"]]}),Ld=fe({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 kd="_1eexc2a5",Di=fe({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Ei="_1eexc2a8";var Mi=z(require("react")),Ai=require("react");var zd="qz8ht90 _16lm1iwk";function ey(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:ty}=Mt({forwardProps:ey,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function ny(){let{componentState:o,componentActions:e}=je(),{checked:t,domProps:n,disabled:r}=o,i=(0,Ai.useRef)(null);return(0,Ai.useEffect)(()=>{i.current.indeterminate=t==null},[t]),Mi.createElement("input",{...n,className:J("InfiniteCheckBox",zd,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function nn(o){return Mi.createElement(ty,{...o},Mi.createElement(ny,null))}function oy(o){return typeof o.field=="string"}function Vd(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?n.get(i.field||i.groupField):void 0}!r&&e.field&&(r=n.get(e.field))}return r}function St(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),h=r===f&&m==="row",b=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:S}}=Do({column:p,rowInfo:c,rowDetailState:b,columnsMap:e().computedColumnsMap,context:o}),C=st(p.id,o);return u?{api:a,dataSourceApi:l,column:p,columnApi:C,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:C,column:p,nodeExpanded:c.nodeExpanded,isTreeNode:!0,isGroupRow:!1,isParentNode:!0,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:C,column:p,nodeExpanded:!1,isTreeNode:!0,isGroupRow:!1,isParentNode:!1,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:{api:a,dataSourceApi:l,columnApi:C,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:b,data:c.data,rowActive:h,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}}function Gd(o){return Kd(o.column,o.rowInfo)}function Hd(o){let{column:e,context:t,rowInfo:n,visibleColumnsIds:r}=o,i=Vd({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Do(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:ry({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnsIds:o.visibleColumnsIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function ry(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:h}=n,b=p(),{selectionMode:y,cellSelection:S}=b,C=Vd({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),T=d.toggleGroupRow,v=S?.isCellSelected(n.id,e.id)??!1,w={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:v,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:C,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:h,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:b.groupBy,pivotBy:b.pivotBy};return Object.defineProperty(w,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),w}function Kd(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:oy(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function iy(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function Do(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=Kd(e,t),a=iy(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var on=z(require("react"));var{rootClassName:Bd}=Ae,Xn=`${Bd}Cell`,$l=`${Bd}Cell_content`,ay=X($.columnWidthAtIndex),ly=X($.columnReorderEffectDurationAtIndex);function sy(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...h}=o,b=typeof m=="function"?m():m,y={width:`var(${ay}-${i.computedVisibleIndex})`,transition:`transform var(${ly}-${i.computedVisibleIndex}, 0s)`,...h.style},S={...h,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:J(h.className,Xn,Fd),children:on.createElement(on.Fragment,null,d,on.createElement("div",{className:J($l,e?jt:zc.hidden,s),style:r},b),u)};c!=null&&(S["data-row-id"]=`${c}`);let C=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return C?on.createElement(C,{...S,ref:a}):on.createElement("div",{...S,ref:a})}var _i=on.memo(sy);var Zn=z(require("react")),Sr=require("react");function Wd(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=Oi(),i=(0,Sr.useRef)(null),a=Zn.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=(0,Sr.useCallback)(s=>{let{key:c}=s;c==="Enter"||c==="Tab"?t():c==="Escape"?n():s.stopPropagation()},[]);return Zn.createElement(Zn.Fragment,null,Zn.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:J(Ac,kc.none),type:"text",defaultValue:o,onChange:(0,Sr.useCallback)(s=>{e(s.target.value)},[])}))}var cy=X($.columnZIndexAtIndex),uy=X($.columnVisibilityAtIndex);function dy({rowInfo:o}){return{[X(ce.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}var Cr=he.createContext(null),py=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return he.createElement(Yn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},fy={display:"inline-block",visibility:"visible"},Ul=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return he.createElement(Yn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:fy,expanded:n,onChange:t})},my=o=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:n,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=o;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||nn;return he.createElement(u,{domProps:{className:Ei},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():n()},checked:e.rowSelected})};function Yl(o,e){return o?typeof o=="function"?o(e):o:void 0}function ql(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function gy(o){let{rowInfo:e,rowStyle:t,rowClassName:n,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:c,width:u,column:d,onMouseLeave:p,onMouseEnter:f,onRowMouseEnter:m,onRowMouseLeave:g,rowIndex:h,rowHeight:b,columnsMap:y,fieldsToColumn:S,domRef:C,hidden:T,showZebraRows:v}=o,w=he.useRef(null),I=(0,$e.useCallback)(Ee=>{w.current=Ee,C&&C(Ee)},[C]);if(!d)return he.createElement("div",{ref:I},"no column");let{rowSelected:R}=e,{getState:x,actions:D,computed:M,api:A,getDataSourceMasterContext:P}=te(),{componentState:O,getState:E,api:_,componentActions:N}=xe(),{activeRowIndex:H,keyboardNavigation:B,columnReorderInPageIndex:U}=x(),de=h===H&&B==="row",pe={getState:x,getDataSourceState:E,getDataSourceMasterContext:P,actions:D,dataSourceActions:N,api:A,dataSourceApi:_},k=e.rowDisabled,Y=M.computedVisibleColumns.map(Ee=>Ee.id),ae=Hd({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:c,columnsMap:y,visibleColumnsIds:Y,fieldsToColumn:S,context:pe}),{stylingParam:se,renderParams:le,formattedValueContext:re,renderFunctions:Z,groupByColumnReference:be,inEdit:oe}=ae,{align:G,verticalAlign:W}=le,F=le,ie=he.useRef(F),j=m&&f?Ee=>{let en={...re,rowIndex:h};m(en,Ee),f(Ee)}:f,K=g&&p?Ee=>{let it={...re,rowIndex:h,rowInfo:e};g(it,Ee),p(Ee)}:p,ne=(0,$e.useCallback)(Ee=>{let it=d.computedVisibleIndex;x().cellClick({rowIndex:h,colIndex:it,event:Ee})},[h,d.computedVisibleIndex,B]),q=(0,$e.useCallback)(Ee=>{let it=d.computedVisibleIndex;if(x().cellMouseDown({rowIndex:h,colIndex:it,event:Ee}),B==="row"){k||(D.activeRowIndex=h);return}B==="cell"&&(D.activeCellIndex=[h,it])},[h,k,d.computedVisibleIndex,B]),{selectionMode:ue,cellSelection:me,isNodeReadOnly:He}=O,Me=F.cellSelected;F.domRef=I,F.htmlElementRef=w,F.toggleCurrentTreeNode=(0,$e.useCallback)(F.toggleCurrentTreeNode,[e]),F.selectCell=(0,$e.useCallback)(F.selectCell,[e]),F.deselectCell=(0,$e.useCallback)(F.deselectCell,[e]),F.selectCurrentRow=(0,$e.useCallback)(F.selectCurrentRow,[e]),F.deselectCurrentRow=(0,$e.useCallback)(F.deselectCurrentRow,[e]),F.toggleCurrentGroupRow=(0,$e.useCallback)(F.toggleCurrentGroupRow,[e]),F.toggleCurrentRowSelection=(0,$e.useCallback)(F.toggleCurrentRowSelection,[e]),F.toggleCurrentGroupRowSelection=(0,$e.useCallback)(F.toggleCurrentGroupRowSelection,[e]),F.toggleCurrentTreeNodeSelection=(0,$e.useCallback)(F.toggleCurrentTreeNodeSelection,[e]);let Ke=d.components?.Editor??Wd,Je=oe?he.createElement($d,{contextValue:F},he.createElement(Ke,null)):null,Ve=(0,$e.useCallback)(at(()=>{if(T||oe)return null;if(ie.current=F,Z.renderGroupIcon&&(F.renderBag.groupIcon=he.createElement(pt,{render:Z.renderGroupIcon,renderParam:{...F,renderBag:{...F.renderBag}}})),Z.renderSelectionCheckBox&&ue=="multi-row"&&(F.renderBag.selectionCheckBox=he.createElement(pt,{render:my,renderParam:F}),Z.renderSelectionCheckBox!==!0&&(F.renderBag.selectionCheckBox=he.createElement(pt,{render:Z.renderSelectionCheckBox,renderParam:{...F,renderBag:{...F.renderBag}}}))),e.isTreeNode){let{isParentNode:en}=e,Fe;Fe=(en?Z.renderTreeIconForParentNode:Z.renderTreeIconForLeafNode)||typeof Z.renderTreeIcon=="function"?Z.renderTreeIcon:en&&Z.renderTreeIcon===!0?Ul:void 0,Fe===!0?Fe=Ul:Fe&&(F.renderBag.treeIcon=he.createElement(pt,{render:Ul,renderParam:F})),Fe&&(F.renderBag.treeIcon=he.createElement(pt,{render:Fe,renderParam:{...F,renderBag:{...F.renderBag}}}))}Z.renderRowDetailIcon&&(F.renderBag.rowDetailsIcon=he.createElement(pt,{render:py,renderParam:{...F,renderBag:{...F.renderBag}}}),typeof Z.renderRowDetailIcon=="function"&&(F.renderBag.rowDetailsIcon=he.createElement(pt,{render:Z.renderRowDetailIcon,renderParam:{...F,renderBag:{...F.renderBag}}}))),Z.renderValue&&(F.renderBag.value=he.createElement(pt,{render:Z.renderValue,renderParam:{...F,renderBag:{...F.renderBag}}})),e.isGroupRow&&Z.renderGroupValue&&(F.renderBag.value=he.createElement(pt,{render:Z.renderGroupValue,renderParam:{...F,renderBag:{...F.renderBag}}})),!e.isGroupRow&&Z.renderLeafValue&&(F.renderBag.value=he.createElement(pt,{render:Z.renderLeafValue,renderParam:{...F,renderBag:{...F.renderBag}}})),ie.current=F;let Ee=F.renderBag.value;Ee instanceof Date&&(Ee=Ee.toLocaleDateString());let it=he.createElement(he.Fragment,null,G!=="end"?F.renderBag.treeIcon:null,G!=="end"?F.renderBag.groupIcon:null,G!=="end"?F.renderBag.rowDetailsIcon:null,G!=="end"?F.renderBag.selectionCheckBox:null,Ee,G==="end"?F.renderBag.selectionCheckBox:null,G==="end"?F.renderBag.rowDetailsIcon:null,G==="end"?F.renderBag.groupIcon:null,G==="end"?F.renderBag.treeIcon:null);return d.render?he.createElement(pt,{render:d.render,renderParam:{...F,renderBag:{...F.renderBag,all:it}}}):it}),[d,T,oe,c,d.renderTreeIcon||d.renderTreeIconForParentNode?He:!1,...Od(F,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),et=M.computedVisibleColumns.map(Ee=>Ee.id),Ye=M.computedColumnOrder,xt={...re,visibleColumnIds:et,allColumnIds:Ye,rowIndex:h,rowHasSelectedCells:!1};Object.defineProperty(xt,"rowHasSelectedCells",{get(){return e.hasSelectedCells(et)}});let zn=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),gt=typeof n=="function"?n(xt):n,V;be?.className&&(V=Yl(be.className,se)),s&&(V=J(V,Yl(s,se))),d.className&&(V=J(V,Yl(d.className,se))),zn&&(V=J(V,Ed({align:G})));let Q;e.dataSourceHasGrouping&&d.groupByForColumn&&(Q=Md({rowInfo:e})),zn&&(Q=dy({rowInfo:e})),t&&(Q=typeof t=="function"?{...Q,...t(xt)}:{...Q,...t}),l&&(Q=ql(Q,l,se)),be?.style&&(Q=ql(Q,be.style,se)),d.style&&(Q=ql(Q,d.style,se)),Q=Q||{},Q.height=b,Q.zIndex=`var(${cy}-${d.computedVisibleIndex})`,Q.visibility=`var(${uy}-${d.computedVisibleIndex}, visible)`;let ye=(0,$e.useMemo)(()=>Q,[Q?JSON.stringify(Q):null]),Ce=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:h)%2===1,Ze=v?Ce?"odd":"even":!1,L=!1,Be=!1,Bt=!1,ht=!1;if(me&&Me){let Ee=a(),it=Ee[e.indexInAll-1],en=Ee[e.indexInAll+1],Fe=M.computedVisibleColumns[d.computedVisibleIndex+1],fo=M.computedVisibleColumns[d.computedVisibleIndex-1];L=it?!me.isCellSelected(it.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?Be=!0:Be=fo?!me.isCellSelected(e.id,fo.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?Bt=!0:Bt=Fe?!me.isCellSelected(e.id,Fe.id):!0,ht=en?!me.isCellSelected(en.id,d.id):!0}let Pt=me&&Me?{top:L,left:Be,right:Bt,bottom:ht}:null,Wt=U!=null?i!==U:!1,qa=Je,Xa=Ve(),or={domRef:I,cellType:"body",column:d,width:u,rowId:e.id,horizontalLayoutPageIndex:i,style:ye,onMouseLeave:K,onMouseEnter:j,onClick:ne,afterChildren:qa,onMouseDown:q,cssEllipsis:d.cssEllipsis??!0,className:J(Pt?Ld(Pt):"",Si(d,[Yt,Xn],Nd,{dragging:!1,insideDisabledDraggingPage:Wt,zebra:Ze,align:G,verticalAlign:W,rowDisabled:k,rowActive:de,cellSelected:Me,rowSelected:R,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),V,gt),renderChildren:(0,$e.useCallback)(()=>Xa,[Ve])},Xr=Cr.Provider;return he.createElement(Xr,{value:ie.current},he.createElement(_i,{...or}))}var jd=he.memo(gy);function wr(){return(0,$e.useContext)(Cr)}function Oi(){let{api:o,state:{editingValueRef:e,editingCell:t}}=te(),{column:n,rowInfo:r}=wr(),[i]=he.useState(()=>t?.value),[a,l]=he.useState(i),s=t?!t.active&&!!t.waiting:!1,c=he.useCallback(f=>{e.current=f,l(f)},[]);he.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function vr(o){return o.render(o.renderParam)??null}function pt(o){let e=Cr.Provider;return Eo.createElement(e,{value:o.renderParam},Eo.createElement(vr,{render:o.render,renderParam:o.renderParam}))}function $d(o){let e=Cr.Provider;return Eo.createElement(e,{value:o.contextValue},o.children)}function wn(o){let e=Fi.Provider;return Eo.createElement(e,{value:o.renderParam},Eo.createElement(vr,{render:o.render,renderParam:o.renderParam}))}var vn=z(require("react"));var hy={width:"100%",pointerEvents:"none"},Xl=`${yt}-menu`,Zl=pi({"data-name":""}),Ql={[Zl["data-name"]]:"menu-icon"};function Ir(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...hy,borderTop:`${ce.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return vn.createElement("div",{...n,style:e,...Ql,onPointerDown:s=>s.stopPropagation(),className:J(t,yu({menuVisible:i,reserveSpaceWhenHidden:r}),yt,`${yt}-menu`)},a??vn.createElement(vn.Fragment,null,vn.createElement("div",{className:Xl,style:l}),vn.createElement("div",{className:Xl,style:l}),vn.createElement("div",{className:Xl,style:l})))}var Mo=z(require("react")),Rr=require("react");var Ud="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var by={transition:"width 0.25s, opacity 0.25s"};function Ni(o){let[e,t]=(0,Rr.useState)(!0),[n,r]=(0,Rr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...by,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,Rr.useEffect)(()=>{let b=i!=0?1:0;if(!e&&b&&t(!0),b!==n){let y=requestAnimationFrame(()=>{r(b)});return()=>{cancelAnimationFrame(y)}}return()=>{}},[i,e]);let g=()=>{let y=!(n===0&&i===0);y!==e&&t(y)};if(!e&&!o.forceSize)return null;let h={};return i===-1&&(h.top="100%"),Mo.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:J(s,yt,Ud,`${yt}-sort`)},u?Mo.createElement("div",{"data-name":"index",style:h,className:Cu},c):null,Mo.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),Mo.createElement("div",{style:{width:f[1],...m}}),Mo.createElement("div",{style:{width:f[2],...m}}))}var Zd=z(require("react")),Jl=require("react");var xr=require("react"),Pr=z(require("react"));function Yd(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Te.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Te.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?Nl(l,i,n.current):Te.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){Nl(c,i,n.current);continue}c.computedPinned!=="end"&&Te.columnOffsets.set(l,c.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||Te.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function qd(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,c=i.current;if(n.forEach((u,d)=>{s+=u;let p=o[d],f=r[p],m=f.computedWidth+u;Te.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&Te.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&Te.columnOffsets.set(u,d.computedOffset+s,c)}}}}var Li="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",ki=fe({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"]]}),zi=fe({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:yy}=Ae,Ty=`${yy}HeaderCell_ResizeHandle`;function Sy(o){let{state:{brain:e,headerBrain:t}}=te(),n=(0,xr.useRef)(null),[r,i]=(0,xr.useState)(!1),a=(0,xr.useRef)(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let h=!!g.shiftKey,b=g.pointerId,y=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let I=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),R=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{I(),R()}}S.setPointerCapture(b);let C=Yd(o.columnIndex,{columns:o.columns,shareSpaceOnResize:h,domRef:n}),T=(I,{done:R}={})=>{s&&(I=I/(s+1),R&&(I=Math.round(I))),c==="end"&&(I*=-1);let{adjustedDiff:x,constrained:D}=o.computeResize({diff:I,shareSpaceOnResize:h});return a.current!==D&&i(D),C.resize(x),x},v=I=>{T(Math.round(I.clientX-y))},w=I=>{S.releasePointerCapture(b),S.removeEventListener("pointermove",v),S.removeEventListener("pointerup",w);let R=Math.round(I.clientX-y),x=T(R,{done:!0});p(),o.onResize({diff:x,shareSpaceOnResize:h})};S.addEventListener("pointermove",v),S.addEventListener("pointerup",w)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Pr.createElement("div",{ref:n,className:`${Ty} ${Li} ${zi({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},Pr.createElement("div",{style:m,className:ki({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Xd=Pr.memo(Sy);function Qd(o,e){let{computed:{computedVisibleColumns:t},getState:n,getComputed:r,actions:i}=te(),a=(0,Jl.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let d=n(),{columnSizing:p,viewportReservedWidth:f,bodySize:m}=d,g=r().computedVisibleColumns,h=!1,b=g.reduce((C,T)=>(T.computedFlex&&(C[T.id]={...p[T.id],flex:T.computedWidth},h=!0),C),{}),y=h?{...p,...b}:p;return xl({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:f||0,dragHandleOffset:c,dragHandlePositionAfter:o.computedVisibleIndex,columnSizing:y,items:g.map(C=>({id:C.id,computedFlex:C.computedFlex,computedWidth:C.computedWidth,computedMinWidth:C.computedMinWidth,computedMaxWidth:C.computedMaxWidth}))})},[o]),l=(0,Jl.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a]);return o.computedResizable?Zd.createElement(Xd,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var nt=z(require("react"));var Rn=require("react");var Jd=fe({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),ep=fe({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function tp(o,e){return At(o,e)}var Vi=class extends jn{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 tp(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return tp(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=u.filter(f=>f!==r):d=Wn(u,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var op=nt.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),Dr=()=>nt.useContext(op),Cy=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},wy=o=>`${o.getAttribute(In)}`;function vy(o){let e=o.current?.querySelectorAll(Gi)??[];return!e||e.length,Array.from(e).map(n=>{let r=wy(n),i=n.getBoundingClientRect();return{id:r,rect:i}})}function Iy(o){let{domRef:e,orientation:t,dragListId:n}=o,r=Se.from(e.current.getBoundingClientRect());return{draggableItems:vy(e),orientation:t,listId:n,listRectangle:r,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial}}function rp(o){return new Vi(Iy(o))}function Ry(o,e){let t=Pe(e),[n,r]=nt.useState(null),i=(0,Rn.useCallback)(l=>{if(l)Tt.registerDragInteractionTarget(l);else{let s=a();s&&Tt.unregisterDragInteractionTarget(s)}r(l)},[]),a=Pe(n);return(0,Rn.useEffect)(()=>Tt.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&c?.includes(p.listId)){let f=rp({domRef:o,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}var Qn=o=>{let e=nt.useRef(null),{dropTargetListId:t,dragSourceListId:n}=$n(),{updateDragOperationSourceAndTarget:r,dragItemId:i,status:a}=$n(),l=Pe(o.onDrop),s=Pe(o.onAcceptDrop),c=Pe(o.onRemove),u=Pe(o.updatePosition??Cy),{interactionTarget:d,setInteractionTarget:p}=Ry(e,o);(0,Rn.useEffect)(()=>{let T=document.querySelector(`[${np}="${o.dragListId}"]`);T?e.current=T:console.warn(`DragList with id "${o.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[o.dragListId]),(0,Rn.useEffect)(()=>{if(d){let T=o.dragListId,v=d.on("start",({dragItem:R,dragSourceListId:x,dropTargetListId:D})=>{r({dragSourceListId:x,dropTargetListId:D,dragItemId:R.id,status:"accepted"})}),w=d.on("move",({offsetsForItems:R,items:x,status:D})=>{if(D==="rejected")return;let M=m(),A=u();x.forEach((P,O)=>{let E=R[O],_=M[O];_&&A({id:P.id,node:_,offset:E})})}),I=d.on("drop",R=>{let{sortedIndexes:x,dragIndex:D,dropIndex:M,dragItem:A,items:P,dragSourceListId:O,dropTargetListId:E,outside:_,status:N}=R,H=m();f.current=[];let B=s(),U=c(),de=l(),pe=u();P.forEach((ae,se)=>{let le=H[se];le&&pe({id:ae.id,node:le,offset:null})}),T===E&&O!==T&&B&&N==="accepted"&&B({dragItemId:A.id,dragSourceListId:O,dropTargetListId:E,dragIndex:D,dropIndex:M,dropItemId:P[M]?.id});let Y=null;M===-1&&O===T&&E===T&&_&&(Y=U),M!==-1&&E===T&&O===T&&(Y=de),Y&&Y?.(x,{dragIndex:D,dropIndex:M,dragItemId:P[D].id,dropItemId:P[M]?.id})});return()=>{v(),w(),I()}}},[d,o.dragListId]);let f=nt.useRef([]),m=(0,Rn.useCallback)(()=>{let T=f.current;return(!T||T.length===0)&&(T=Array.from(e.current?.querySelectorAll(Gi)??[]),f.current=T),T},[]),g=(0,Rn.useCallback)(T=>{let v=T.currentTarget,w=v.getAttribute(In);if(w==null){let _=Sn(v,Gi);_&&(w=_.getAttribute(In))}if(w==null){console.warn("Could not find drag item id for element",v,`Make sure you have a parent element with a ${In} attribute`);return}w=`${w}`;let I=null,R=Array.from(e.current?.querySelectorAll(Gi)??[]);f.current=R;let x=rp({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0}),D=x.getData().draggableItems,M=D.findIndex(_=>_.id===w),A=D[M];p(x);let P={left:T.clientX,top:T.clientY},O=_=>{I||(I=Tt.startDrag({listId:o.dragListId,dragItem:A,dragIndex:M},P)),I.move({left:_.clientX,top:_.clientY})},E=()=>{if(we().removeEventListener("pointermove",O),!I){p(null);return}I.drop(),I=null};we().addEventListener("pointermove",O),we().addEventListener("pointerup",E,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside]),h=T=>T===void 0?i!=null:`${T}`===i,b=!!i,y=nt.useMemo(()=>({dragItemId:i,onDragItemPointerDown:g,dragSourceListId:n,dropTargetListId:t,status:a,dragListId:o.dragListId,draggingInProgress:b}),[i,g,h,b,n,t,o.dragListId]),S={className:J("DragList",b?"DragList--dragging":"",Jd({dragging:b})),[np]:o.dragListId},C=typeof o.children=="function"?o.children(S,y):o.children;return nt.createElement(op.Provider,{value:y},C)},np="data-drag-list-id",In="data-drag-item-id",Gi=`[${In}]`,xy=nt.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),Py=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=Dr(),l=i===n&&r===`${o.id}`,s=nt.useMemo(()=>({dragItemId:o.id,active:l,dragListId:n,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,l,t,i,a]),c={"data-drag-item-id":`${o.id}`,onPointerDown:e,className:J("DraggableItem",l?"DraggableItem--active":"",ep({active:l,draggingInProgress:t}))},u=typeof o.children=="function"?o.children(c,s):o.children;return nt.createElement(xy.Provider,{value:s},u)};Qn.DraggableItem=Py;var es=z(require("react")),ip=o=>es.createElement(_e,{...o,viewBox:"0 -960 960 960"},es.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 Lr=z(require("react"));function ap(){return{}}var lp=o=>({allowColumnHideWhileDragging:e=>e??!0});var sp=require("react"),Dy=(0,sp.createContext)(null);function ts(){return Dy}var Lt=z(require("react"));var to=z(require("react")),Nt=require("react");var Hi=z(require("react"));function Ey(o){let{height:e,width:t,count:n}=o;return Hi.createElement("div",{"data-count":n,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var cp=Hi.memo(Ey);var up="mlx2t3";var Ki=z(require("react")),yp=require("react");var dp=require("react"),pp=(o,e)=>{(0,dp.useEffect)(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var fp={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},mp={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},gp={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},ns="_1ueijco1",hp="_1ueijco0 _16lm1iw0";var bp=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=fp[`${o}`]:e=J(mp[`${o.horizontal}`],gp[`${o.vertical}`]),e};var My="InfiniteVirtualScrollContainer";var Tp=Ki.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,yp.useRef)(null);return pp(u,i),Ki.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:J(a,My,hp,bp(r))},n)});var Zi=z(require("react")),No=require("react");var Sp=z(require("react")),os=require("react-dom"),Ao=require("react");function Ay(o){let[e,t]=(0,Ao.useState)(o.updater.get),n=(0,Ao.useRef)(null);return(0,Ao.useLayoutEffect)(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{queueMicrotask(()=>{(0,os.flushSync)(()=>{t(a)})})})):queueMicrotask(()=>{(0,os.flushSync)(()=>{t(a)})})}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var xn=Sp.memo(Ay);var Cp=z(Bn());var rs=(o,e)=>o-e,rn={horizontal:!0,vertical:!0};function Bi(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var is="DebugID=";function Pn(o,e){return e&&e.startsWith(is)?e:e?`${is}${o}:${e}`:`${is}${o}`}var Wi={start:0,end:0},as=o=>{o()},ls=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},wp=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},Er=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function _y(o){return o.horizontalChange||o.verticalChange}var Jn=class extends ut{constructor(t){let n=Pn(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=Wi;this.verticalExtendRangeBy=Wi;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{Er(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?as:Er;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?as:Er;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=rn)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=rn)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=rn)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,Cp.default)(a,t,rs);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let h=s(g);d[f]=f,p[f]=h;let b=f;for(;h>1;)b+=1,d[b]=f,p[b]=0,h-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=ls;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=rn){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",h=m&&r!==this.rows,b=g&&i!==this.cols;m&&(this.rows=r,this.rowsPerPage=r),g&&(this.cols=i);let y=a!=null,S=l!=null,C=y&&a!==this.rowHeight,T=S&&l!==this.colWidth;y&&(this.rowHeight=a),S&&(this.colWidth=l);let v=t.rowspan!=null,w=t.colspan!=null,I=v&&t.rowspan!=this.rowspan,R=w&&t.colspan!=this.colspan;I&&(this.rowspan=t.rowspan),R&&(this.colspan=t.colspan);let x=b||T||p||R,D=h||C||f||I;(n||_y)({horizontalChange:x,verticalChange:D,colsChanged:b,colWidthChanged:T,widthChanged:p,colspanChanged:R,rowsChanged:h,rowHeightChanged:C,heightChanged:f,rowspanChanged:I})&&this.updateRenderCount({horizontal:x,vertical:D})}extendRenderRange(t){let{direction:n}=t,r=n==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(t=rn){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=rn){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(n?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?as:Er;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=Bi(l,u)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{Er(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let n=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=Wi,this.verticalExtendRangeBy=Wi,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var cs=z(Bn());function vp(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function Ip(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function Mr(o,e){for(let t of o)if(e(t))return t}var xp=z(require("react"));var Rp=new Map,Oy=()=>{},ss=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=ge();let n=Rp.get(e)??0,r=`${e}:GridCellReact:${n}`;Rp.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=ge(),this.node=xp.createElement(xn,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Oy,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}},_o=class _o extends ut{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=ge();this.cellAttachmentChangeSubscription=ge();this.attachedCells=new Set,this.detachedCells=new Set,this.allCellsOrdered=new Set}destroy(){this.reset()}onRemoveCell(t){return this.cellRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onCellAttachmentChange(t){return this.cellAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{cell:i,attached:a}=r;t(i,a)})}reset(){this.attachedCells.clear(),this.detachedCells.clear(),this.allCellsOrdered.clear(),this.cellRemoveSubscription.destroy(),this.cellAttachmentChangeSubscription.destroy()}getAttachedCells(){return this.attachedCells}getDetachedCells(){return this.detachedCells}getAllCells(){return this.allCellsOrdered}createCell(){let t=new ss(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,n=t.values().next().value;return n||(this.poolSize+=_o.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/_o.POOL_SIZE_INCREMENT)*_o.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};_o.POOL_SIZE_INCREMENT=1;var ji=_o;var $i=(o,e)=>o-e,Ui=class extends ut{constructor(t){super(`${t}:GridCellManager`);this.matrix=new ee;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,h=f<a,b=f>=s;(m||g||h||b)&&c.add(u)}),c};this.debugId=t,this.pool=new ji(t),this.offRemoveCell=this.pool.onRemoveCell(n=>this.onRemoveCell(n))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=Mr(l,s=>!this.isCellAttached(s)))}if(n==="column"){let l=this.columnsWithCellsHistory.get(a);l&&(r=Mr(l,s=>!this.isCellAttached(s)))}return r??this.getDetachedCell()}isCellAttached(t){return this.getCellPosition(t)!==null}isCellAttachedAt(t){let n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort($i)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort($i)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((n,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,cs.default)(n,t,$i);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,cs.default)(n,t,$i);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return Mr(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return Mr(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var Ep=z(Bn());var Dp=z(require("react"));var Pp=new Map,Fy=()=>{},us=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=ge();let t=Pp.get(e)??0,n=`${e}:ListRowReact:${t}`;Pp.set(e,t+1),this.debugId=n,this.updater=ge(),this.node=Dp.createElement(xn,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Fy,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Oo=class Oo extends ut{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=ge();this.rowAttachmentChangeSubscription=ge();this.attachedRows=new Set,this.detachedRows=new Set,this.allRowsOrdered=new Set}destroy(){this.reset()}onRemoveRow(t){return this.rowRemoveSubscription.onChange(r=>{r!=null&&t(r)})}onRowAttachmentChange(t){return this.rowAttachmentChangeSubscription.onChange(r=>{if(r==null)return;let{row:i,attached:a}=r;t(i,a)})}reset(){this.attachedRows.clear(),this.detachedRows.clear(),this.allRowsOrdered.clear(),this.rowRemoveSubscription.destroy(),this.rowAttachmentChangeSubscription.destroy()}getAttachedRows(){return this.attachedRows}getDetachedRows(){return this.detachedRows}getAllRows(){return this.allRowsOrdered}createRow(){let t=new us(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,n=t.values().next().value;return n||(this.poolSize+=Oo.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/Oo.POOL_SIZE_INCREMENT)*Oo.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};Oo.POOL_SIZE_INCREMENT=1;var Yi=Oo;var qi=class extends ut{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new Yi(t),this.offRemoveRow=this.pool.onRemoveRow(n=>this.onRemoveRow(n))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,Ep.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Mp=!0,eo=X($.y),Ap=X($.scrollTop),GE=X($.columnOffsetAtIndex),ds=X($.columnOffsetAtIndexWhileReordering),Fo=class extends ut{constructor(t,n){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(eo,i?`calc( ${r}px + var(${Ap}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${eo}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=Te.columnOffsets.get(r),d=`${ds}-${r}`,p=s?`calc( ${a}px + var(${Ap}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(eo,p));let f=`translate3d(var(${d}, ${u}), var(${eo}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),c!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollTop;if(l==="center"?h=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),this.brain.isHorizontalLayoutBrain){let b=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(b,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:h}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let h=i.scrollLeft;return l==="center"?h=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,h+=c-f+s-d):(s+=u,h+=c-g+s+p),{...i,scrollLeft:h}};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,p]=c,[f,m]=u,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let h={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(h)}if(r){let h={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(h)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:u?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Oe(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:c,y:u}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,Mp){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let f=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==f&&(r.__zIndex=f,r.style.zIndex=f)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,Mp&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(P=>{let O=i.getRowIndex(P);if(O!=null){let E=this.brain.getItemOffsetFor(O,"vertical");if(E==null)return;let _=P.getElement();if(!_)return;this.setDetailTransform(_,O,{y:E,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&Bu(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:h}=this.brain.getRenderRange(),[b,y]=g,[S,C]=h;function T(P,O,E){let _=r.getCellAt([P,O]);if(_==null)return;let N=n.getCellOffset(P,O),H=_.getElement();H&&N&&E(P,O,H,N)}let v=(P,O,E,{x:_,y:N})=>{this.setTransform(E,P,O,{x:_,y:N,scrollLeft:!0},s-O)},w=(P,O,E,_)=>{this.setTransform(E,P,O,{x:_.x,y:_.y,scrollTop:!0},u-P)},I=(P,O,E,{y:_})=>{let N=f[O];this.setTransform(E,P,O,{x:N,y:_,scrollLeft:!0},a-O)},R=(P,O,E,_)=>{this.setTransform(E,P,O,{x:_.x,y:m[P],scrollTop:!0},l-P)},x=(P,O,E,{x:_,y:N})=>{this.setTransform(E,P,O,{x:_,scrollLeft:!0,y:N,scrollTop:!0},1e5)},D=(P,O,E,{x:_})=>{this.setTransform(E,P,O,{x:_,scrollLeft:!0,y:m[P],scrollTop:!0},2e5)},M=(P,O,E,_)=>{this.setTransform(E,P,O,{x:f[O],y:_.y,scrollLeft:!0,scrollTop:!0},3e5)},A=(P,O,E)=>{this.setTransform(E,P,O,{x:f[O],y:m[P],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let P=b;P<S;P++){for(let O=0;O<s;O++)T(P,O,v);if(c){let O=a-c;for(let E=O;E<a;E++)T(P,E,I)}}if(u||d)for(let P=y;P<C;P++){for(let O=0;O<u;O++)T(O,P,w);if(d){let O=l-d;for(let E=O;E<l;E++)T(E,P,R)}}if(s&&u)for(let P=0;P<u;P++)for(let O=0;O<s;O++)T(P,O,x);if(s&&d){let P=l-d;for(let O=P;O<l;O++)for(let E=0;E<s;E++)T(O,E,D)}if(c&&u){let P=a-c;for(let O=0;O<u;O++)for(let E=P;E<a;E++)T(O,E,M)}if(c&&d){let P=l-d,O=a-c;for(let E=P;E<l;E++)for(let _=O;_<a;_++)T(E,_,A)}};this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.reset(),this.onDestroy(),this.hoverRowUpdatesInProgress.clear(),this.hoverRowUpdatesInProgress=null,this.brain=null)};this.brain=t,this.debugId=n,this.cellManager=new Ui(n),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new qi(n),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Oe(()=>{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=Ol(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],D=t.end[1];m.forEach(M=>{x<=M&&M<D||f.push({start:[t.start[0],M],end:[t.end[0],M+1]})})}let g=new Map,h=f.map(this.getExtraSpanCellsForRange).flat();h&&h.forEach(([x,D])=>{g.set(`${x}:${D}`,!0)});let b=f.reduce((x,D)=>x+ls(D),0),y=r?f.reduce((x,D)=>x+wp(D),0):0,S=this.brain.getRowCount(),C=this.brain.getColCount();d.detachCellsStartingAt([S,C]);let T=Math.min(S*C,b);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let v=vp(...f.map(x=>d.getCellsOutsideRenderRange(x)));v=Ip(v,x=>{let D=d.getCellPosition(x);return!(D&&g.has(`${D[0]}:${D[1]}`))}),d.detachCells(v),d.poolSize=T;let w=new Map,I=new Map;f.forEach(x=>{let{start:D,end:M}=x,[A,P]=D,[O,E]=M;for(let _=A;_<O;_++){for(let H=P;H<E;H++){let B=`${_}:${H}`;if(w.has(B))continue;w.set(B,!0);let{rendered:U,mapped:de}=this.isCellRenderedAndMappedCorrectly(_,H);if(_===A||H===P){let k=this.isCellCovered(_,H);if(k&&g.has(`${k[0]}:${k[1]}`)){let Y=d.getCellAt([_,H]);Y!=null&&d.detachCell(Y);continue}}if(U&&!i&&de)continue;let pe;U?pe=d.getCellAt([_,H]):pe=d.getCellFor([_,H],c?"row":"column"),pe==null&&(pe=d.getDetachedCell()),this.renderCellAt(_,H,pe,n)}!r||I.has(_)||(I.set(_,!0),u.isRowAttachedAt(_)&&!i)||this.renderDetailRowAtElement(_,this.rowManager.getRowFor(_),r)}}),h.forEach(([x,D])=>{let{rendered:M,mapped:A}=this.isCellRenderedAndMappedCorrectly(x,D);if(M){if(i||!A){let O=[x,D],E=d.getCellAt(O);this.renderCellAt(x,D,E,n)}return}let P=d.getCellFor([x,D],c?"row":"column");P!=null&&this.renderCellAt(x,D,P,n)});let R=d.getAllCells().map(x=>x.getNode());return r&&u.getAllRows().forEach(x=>{R.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(R),R}renderDetailRowAtElement(t,n,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),p=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:h,colIndex:b}=this.getCellRealCoordinates(t,n),y=i({rowIndex:h,colIndex:b,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:r.ref});r.isMounted()||r.onMount(C=>{let T=C.getElement();T&&(T.style.position="absolute",T.style.left="0px",T.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:h,renderColIndex:b}:void 0;if(!y){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,n],S),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Xi=class extends Fo{constructor(t,n){super(t,n);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=ce.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=Te.columnOffsets.get(l.colIndex),f=`${ds}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(eo,m));let g=`calc(var(${f}, ${p}) + ${d})`,h=`var(${eo})`,b=`translate3d(${g}, ${h}, 0px)`;t.__transformValue!==b&&(t.__transformValue=b,t.style.transform=b)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function Ar(o){let e=o.isHorizontalLayoutBrain?new Xi(o,`${o.name}:HorizontalLayoutTableRenderer`):new Fo(o,`${o.name}:ReactHeadlessTableRenderer`),t=ge();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function Ny(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,No.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:Ar(e),[e,o.onRenderUpdater,o.renderer]);return(0,No.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,No.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,No.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),Zi.createElement(xn,{updater:a})}var Qi=Zi.memo(Ny);var _r=z(require("react")),Lo=require("react");var _p=fe({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),Ji="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Op=fe({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Ly}=Ae,ky=`${Ly}-ActiveRowIndicator`,zy=`calc(${$.activeCellRowOffsetX} + var(${X($.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,Vy={[X($.activeCellOffsetY)]:$.activeCellRowOffset,transform:`translate3d(${zy}, calc( ${$.activeCellOffsetY} + var(${X($.scrollTopForActiveRow)}, 0px)), 0px)`,height:$.activeCellRowHeight,maxWidth:ce.runtime.totalVisibleColumnsWidthVar},Gy=o=>{let{brain:e}=o,t=(0,Lo.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=Et();return(0,Lo.useLayoutEffect)(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${ce.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};wo(d,u)},[o.activeRowIndex,e]),(0,Lo.useEffect)(()=>{let a=c=>{wo({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]),_r.createElement("div",{className:Ji,"data-name":"active-row"},_r.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${ky} ${Op({active:n})}`,style:n?Vy:void 0}))},Fp=_r.memo(Gy);var Or=z(require("react")),ko=require("react");var{rootClassName:Hy}=Ae,Ky=`${Hy}-ActiveCellIndicator`,By=X($.columnZIndexAtIndex),Wy=(o,e,t,n)=>{if(e==null)return;let[r]=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(r=r%o.rowsPerPage);let i=typeof t=="function"?t(r):t??o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;wo({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},jy=o=>{let{brain:e}=o,[t,n]=Et(),r=(0,ko.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return(0,ko.useLayoutEffect)(()=>{Wy(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),(0,ko.useEffect)(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),Or.createElement("div",{className:Ji,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${By}-${o.activeCellIndex[1]})`}:void 0},Or.createElement("div",{"data-name":"active-cell-indicator",className:`${Ky} ${_p({visible:i})}`}))},Np=Or.memo(jy);var ea=[kd,`${lt}DetachedCell`];function ta(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var $y=J(up,ns);function Lp(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:h}=g,b=(0,Nt.useRef)(null),[y,S]=(0,Nt.useState)({width:0,height:0});(0,Nt.useEffect)(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),(0,Nt.useEffect)(()=>{let v=b.current?.parentNode;return v?(h&&document.activeElement!==v&&v.focus(),sr(v,()=>{let R={height:v.clientHeight,width:v.clientWidth};e.update(R)},{debounce:50})):void 0},[p,e]);let C=(0,Nt.useCallback)(v=>{requestAnimationFrame(()=>{b.current&&b.current.style.setProperty("transform",`translate3d(${-v.scrollLeft}px, ${-v.scrollTop}px, 0px)`)})},[]),T=(0,Nt.useCallback)(v=>{e.setScrollPosition(v,C)},[e,C]);return(0,Nt.useEffect)(()=>{let v=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),C(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),v},[e]),to.createElement(Tp,{onContainerScroll:T,...g,ref:t},to.createElement("div",{ref:b,className:$y,"data-name":"scroll-transform-target"},to.createElement(Qi,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:ea}),u!=null?to.createElement(Np,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?to.createElement(Fp,{brain:e,activeRowIndex:c}):null,to.createElement(cp,{width:y.width,height:y.height}))}function kp(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let p=u.id,f=o[d-1],m=f?.id??"",g=new Set,h=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let b={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],b);let y=u.columnGroup,S,C=b;for(;y;){let T=e[y];if(T){g.add(y);let v=[p,...g];S=h.has(y)?i.get(y):void 0,S||(S={id:y,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:b.computedPinned,depth:t.get(y)??0},r.set(v,S),i.set(y,S)),S.columnItems.push(b),S.uniqueGroupId.push(b.id),C&&!h.has(C.id)&&S.children.push(C),C=S,y=T.columnGroup}else break}});let l=[],s=new ee,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&zp(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=n+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function zp(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&zp(t.children),e+=n})}var Dn=z(require("react")),no=require("react");var fs=z(require("react"));var Gp=z(require("react")),ps=require("react");var Fr=require("react"),Nr=z(require("react"));var{rootClassName:Uy}=Ae,Yy=`${Uy}HeaderCell_ResizeHandle`;function qy(o){let e=(0,Fr.useRef)(null),[t,n]=(0,Fr.useState)(!1),r=(0,Fr.useRef)(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,h=qd(o.groupColumns.map(C=>C.computedVisibleIndex),{columns:o.columns,domRef:e}),b=C=>{a==="end"&&(C*=-1);let{constrained:T,adjustedDiffs:v,adjustedDiff:w}=o.computeResize(C);return r.current!==T&&n(T),h.resize(v),w},y=C=>{if(g){let T=o.groupColumns.reduce((I,R)=>I+R.computedWidth-R.computedMinWidth,0),v=o.brain.getAvailableSize(),w={width:v.width+T,height:v.height};o.brain.update(w),g=!1}b(Math.round(C.clientX-f))},S=C=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",S);let T=Math.round(C.clientX-f),v=b(T);o.onResize(v)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ce.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return Nr.createElement("div",{ref:e,className:`${Yy} ${Li} ${zi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},Nr.createElement("div",{style:{...u,...o.style},className:ki({constrained:t})}))}var Vp=Nr.memo(qy);function Hp(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:c}=te(),u=o[o.length-1],d=(0,ps.useCallback)(g=>{let h=l(),{columnSizing:b,viewportReservedWidth:y,bodySize:S}=h,C=s().computedVisibleColumns,T=!1,v=C.reduce((R,x)=>(x.computedFlex&&(R[x.id]={...b[x.id],flex:x.computedWidth},T=!0),R),{}),w=T?{...b,...v}:b;return xu({availableSize:S.width,reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:w,columnGroupSize:o.length,items:C.map(R=>({id:R.id,resizable:R.computedResizable,computedFlex:R.computedFlex,computedWidth:R.computedWidth,computedMinWidth:R.computedMinWidth,computedMaxWidth:R.computedMaxWidth}))})},[u]),p=(0,ps.useCallback)(g=>{let{columnSizing:h,reservedWidth:b}=d(g);c.viewportReservedWidth=b,c.columnSizing=h},[d]);return o.some(g=>g.computedResizable)?Gp.createElement(Vp,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var Kp=`${lt}HeaderGroup`,Bp=X($.columnWidthAtIndex),Xy=X($.columnZIndexAtIndex);function Wp(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=Hp(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(f=>`var(${Bp}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${Bp}-${c.computedVisibleIndex})`,d=`calc(var(${Xy}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,fs.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:J(bu,Kp),style:p,"data-z-index":d},fs.createElement("div",{className:J(`${Kp}__header-content`,jt)},a),s)}var{rootClassName:Zy}=Ae,Qy=[],jp=`${Zy}Header`,Jy=pu({overflow:!1}),$p=()=>{};function eT(o){let{bodyBrain:e,columns:t,style:n,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=o,{computed:s,getState:c,state:{headerBrain:u,headerOptions:d,showColumnFilters:p,headerRenderer:f,headerOnRenderUpdater:m}}=te(),{computedColumnsMap:g}=s,h=(0,no.useRef)(null),b=(0,no.useCallback)(C=>{h.current&&(h.current.style.transform=`translate3d(-${C.scrollLeft}px, 0px, 0px)`)},[]);(0,no.useEffect)(()=>{let C=u.onScroll(b);return b(u.getScrollPosition()||{scrollLeft:0,scrollTop:0}),C},[u]);let y={ref:h,className:J(jp,`${jp}--virtualized`,r,Jy),style:{...n,height:i}},S=(0,no.useCallback)(C=>{let{rowIndex:T,colIndex:v,domRef:w,height:I,widthWithColspan:R,heightWithRowspan:x,hidden:D}=C,M=t[v];if(!M||D)return null;let A=u.isHorizontalLayoutBrain?u.getPageIndexForRow(T):null,P=a?a.pathsToCells.get([T,v]):null;if(P&&P.type==="group"){let O=P.columnItems.map(N=>N.ref),E={...P.ref,id:P.id,uniqueGroupId:P.uniqueGroupId,depth:P.depth,columns:O.map(N=>N.id),computedWidth:P.computedWidth,groupOffset:P.groupOffset};return c().columnGroupVisibility[P.id]!==!1?Dn.createElement(Wp,{horizontalLayoutPageIndex:A,bodyBrain:e,columnGroupsMaxDepth:l,domRef:w,columns:O,width:R,height:I,columnGroup:E}):null}return Dn.createElement(Yp,{domRef:w,column:M,horizontalLayoutPageIndex:A,headerOptions:d,width:R,height:x,columnsMap:g})},[d,t,i,a,l,p,u]);return Dn.createElement(Qn,{orientation:"horizontal",dragListId:"header",onDrop:$p,updatePosition:$p},C=>Dn.createElement("div",{...C,...y,className:J(C.className,y.className)},Dn.createElement(Qi,{name:"header",renderCell:S,brain:u,renderer:f,onRenderUpdater:m,cellHoverClassNames:Qy,cellDetachedClassNames:ea})))}var Up=Dn.memo(eT);function qp(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,r=te(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:c,columnGroupsDepthsMap:u,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,g=m*c+(f?c:0),h=Lt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return kp(l,p,u,d)},[l,p,u]),b=Lt.useCallback(({rowIndex:w,colIndex:I})=>{let R=l[I],x=1,D=1;if(!R||!h)return{rowspan:x,colspan:D};let M=h.pathsToCells.get([w,I]);if(!M)return{rowspan:x,colspan:D};if(M.type==="column")return{colspan:D,rowspan:m-M.depth};let A=M.columnItems.findIndex(P=>P.id===R.id);return{rowspan:x,colspan:A===0?M.columnItems.length:1}},[p,d,l,h,m,u]),y=Lt.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).rowspan,[b]),S=Lt.useCallback(({rowIndex:w,colIndex:I})=>b({rowIndex:w,colIndex:I}).colspan,[b]),C=Lt.useCallback(w=>f?w<m-1?c:2*c:c,[m,f,c]);ta(e,{colWidth:s,rowHeight:C,rows:m,cols:l.length,height:g,rowspan:y,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let T=Lt.createElement(Up,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:g,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:h}),v=n.vertical&&yn()?Lt.createElement("div",{className:Tu,style:{zIndex:1e3,width:yn()}}):null;return Lt.createElement("div",{className:`${jl} ${vu}`,style:{height:g}},T,v)}var{ManagedComponentContextProvider:tT}=Mt({initSetupState:ap,forwardProps:lp,Context:ts()});function ms(o){let e=te(),{state:t,getComputed:n}=e,{header:r,brain:i,headerBrain:a,wrapRowsHorizontally:l}=t,{scrollbars:s}=n();return r?Lr.createElement(tT,{...o},Lr.createElement(qp,{wrapRowsHorizontally:!!l,bodyBrain:i,headerBrain:a,scrollbars:s})):null}function Xp(){return Lr.useContext(ts()).componentState}var nT=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||nn;return ve.createElement(s,{domProps:{className:Ei},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Fi=ve.createContext(null);var oT=X($.columnZIndexAtIndex),rT=X($.columnVisibilityAtIndex),gs=ve.createElement("div",{className:ui[1]}),Qp=pi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[In]:""});function Yp(o){let e=o.column,{allowColumnHideWhileDragging:t}=Xp(),{onDragItemPointerDown:n}=Dr(),{api:r,getComputed:i,getState:a,actions:l,state:{showColumnFilters:s,components:c,portalDOMRef:u,columnHeaderHeight:d,columnReorderDragColumnId:p,columnMenuVisibleForColumnId:f,columnReorderInPageIndex:m},getDataSourceMasterContext:g}=te(),{api:h,componentActions:b,getState:y,componentState:{filterDelay:S,filterTypes:C}}=xe(),{allRowsSelected:T,someRowsSelected:v,selectionMode:w}=tn(),I=o.horizontalLayoutPageIndex,R=p===e.id,x=m!=null?I!==m:!1,{onResize:D,height:M,width:A,headerOptions:P,columnsMap:O}=o,E=e.computedSortInfo,_=e.header,N=(0,an.useCallback)(L=>{oe.current=L,o.domRef?.(L)},[o.domRef]),H=P.alwaysReserveSpaceForSortIcon,B=e.headerAlign??e.align,U=(typeof B=="function"?B({isHeader:!0,column:e}):B)??"start",de=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",pe=st(e,{actions:l,api:r,dataSourceActions:b,dataSourceApi:h,getComputed:i,getDataSourceState:y,getDataSourceMasterContext:g,getState:a}),k=pe.isSortable(),Y=k&&(e.computedSorted||H)?ve.createElement(Ni,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ce.spacing[2],marginInlineEnd:ce.spacing[2]},className:`${Un}__sort-icon ${Su} ${wu({align:U})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,se=e.computedFilterable&&e.computedFiltered?ve.createElement(yo,null):null,le=e.headerCssEllipsis??e.cssEllipsis??!0,re={reserveSpaceWhenHidden:U==="center",menuVisible:f===e.id,style:U==="end"?{marginInlineStart:`calc(${ce.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ce.spacing[2]}:{marginInlineEnd:`calc(${ce.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ce.spacing[2]},domProps:{onMouseDown:L=>{L.stopPropagation(),pe.toggleContextMenu(L.target)}}},Z=e.components?.MenuIcon||c?.MenuIcon||Ir,be=ve.createElement(Z,{...re}),oe=(0,an.useRef)(null),G={horizontalLayoutPageIndex:I,dragging:R,domRef:N,htmlElementRef:oe,renderLocation:"column-header",column:e,columnsMap:O,columnSortInfo:E,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:v,allRowsSelected:T,selectionMode:w,api:r,dataSourceApi:h,columnApi:pe,renderBag:{sortIcon:Y,filterIcon:se,menuIcon:be,menuIconProps:re,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},W=G,F=W.renderBag.header,ie=()=>{let L={...G,renderBag:{...G.renderBag}};if(e.renderSortIcon&&(L.renderBag.sortIcon=ve.createElement(wn,{render:e.renderSortIcon,renderParam:{...L,renderBag:{...L.renderBag}}})),e.renderFilterIcon&&(L.renderBag.filterIcon=ve.createElement(wn,{render:e.renderFilterIcon,renderParam:{...L,renderBag:{...L.renderBag}}})),typeof e.renderMenuIcon=="function"&&(L.renderBag.menuIcon=ve.createElement(wn,{render:Pt=>{if(typeof e.renderMenuIcon!="function")return null;let Wt=e.renderMenuIcon(Pt);return Wt?Wt.type===Z||Wt.type===Ir?Wt:ve.createElement(Z,{...re},Wt):null},renderParam:{...L,renderBag:{...L.renderBag}}})),e.renderSelectionCheckBox&&w==="multi-row"){L.renderBag.selectionCheckBox=ve.createElement(wn,{render:nT,renderParam:{...L,renderBag:{...L.renderBag}}});let Pt=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Pt&&Pt!==!0&&(L.renderBag.selectionCheckBox=ve.createElement(wn,{render:Pt,renderParam:{...L,renderBag:{...L.renderBag}}}))}_ instanceof Function&&(L.renderBag.header=F=ve.createElement(wn,{render:_,renderParam:{...L,renderBag:{...L.renderBag}}}));let Be=e.renderMenuIcon===!1?null:L.renderBag.menuIcon,Bt=le?ve.createElement("div",{className:jt},L.renderBag.header):L.renderBag.header,ht=ve.createElement(ve.Fragment,null,U==="center"?gs:null,L.renderBag.selectionCheckBox,Bt,L.renderBag.sortIcon,L.renderBag.filterIcon,U==="center"?gs:null,U!=="center"?gs:null,Be);return e.renderHeader?ve.createElement(wn,{render:e.renderHeader,renderParam:{...L,renderBag:{...L.renderBag,all:ht}}}):ht};(0,an.useEffect)(()=>{let L=null,Be=oe.current;return D&&Be&&(L=sr(Be,D)),()=>{L?.()}},[oe.current,o.onResize]);let j={height:M};e.headerStyle&&(j=typeof e.headerStyle=="function"?{...j,...e.headerStyle(W)||{}}:{...j,...e.headerStyle});let K=typeof e.headerClassName=="function"?e.headerClassName(W):e.headerClassName,{onPointerDown:ne,proxyPosition:q,dragColumnOutside:ue}=Sd({columnId:e.id,domRef:oe,horizontalLayoutPageIndex:I,allowColumnHideOnDrag:t}),me=null,He=Fi.Provider,Me={filtered:e.computedFiltered,verticalAlign:de,align:U},Ke=ve.useMemo(()=>{let L=Be=>{r.setColumnFilter(e.id,Be)};return S>0?Dt(L,{wait:S}):L},[S,e.id]),Je=e.computedFilterType,Ve=C[Je],et=e.computedFilterable?e.computedFilterValue?.filter.operator??Ve?.defaultOperator:void 0,Ye=e.computedFilterable&&Ve?Ve.operators.find(L=>L.name===et):void 0,xt=Ye?.components?.FilterEditor||Ve?.components?.FilterEditor||e.components?.FilterEditor||Co,zn=Ve?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,gt=Qd(e,{horizontalLayoutPageIndex:I}),V=`var(${oT}-${e.computedVisibleIndex})`;j.zIndex=V,j.visibility=`var(${rT}-${e.computedVisibleIndex}, visible)`;let Q={"data-field":`${e.field||""}`,"data-column-id":e.id,[In]:e.id,"data-header-align":U,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ye=e.computedFilterable?ve.createElement(Fu,{horizontalLayoutPageIndex:I,filterEditor:xt,filterOperatorSwitch:zn??Nu,operator:Ye,filterTypes:C,onChange:Ke,columnFilterType:Je,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:d}):ve.createElement(Lu,null);W.renderBag.filterEditor=ye;let Ce=(0,an.useCallback)(L=>{ne(L),n(L)},[ne,n]),Ze=ie();return R&&q&&(me=ve.createElement("div",{key:e.id,className:`${Un}Proxy ${cu}`,style:{height:M,width:A,left:q.left??0,top:q.top??0}},ve.createElement("div",{className:uu({visible:ue})},ve.createElement(ip,{size:16})),F),me=(0,Zp.createPortal)(me,u.current)),ve.createElement(He,{value:W},ve.createElement(_i,{domRef:N,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...Q,"data-z-index":V,style:j,width:A,onPointerDown:Ce,contentClassName:J(su(Me),Nc[U]),contentStyle:s?{height:M/2}:void 0,className:J(Un,Gc.none,k?Oc.pointer:"",K,Si(e,[Un,Xn],du,{dragging:R,insideDisabledDraggingPage:x,align:U,verticalAlign:de,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),lu),cssEllipsis:le,afterChildren:ve.createElement(ve.Fragment,null,s?ye:null,gt),renderChildren:Ze}),me)}function gr(){return(0,an.useContext)(Fi)}var ln=z(require("react")),nf=require("react");function Jp(o,e){let{separator:t}=e??{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var ef={padding:ce.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},iT={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},tf=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(Jp(t),n,"important")},of=ln.forwardRef(function(e,t){let{rootClassName:n}=ci(),r=ln.useRef(null),i=ln.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,nf.useEffect)(()=>{let a=()=>{setTimeout(()=>{tf(r.current,ef),tf(r.current?.firstElementChild,iT)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),ln.createElement("div",{ref:i,...e,className:J(`${n}-Footer`,Wu,e.className),style:ef},"Powered by"," ",ln.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function hs(o){return o.map(qt)}function qt(o){if(we().structuredClone)return we().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return hs(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(hs(Array.from(o)));if(o instanceof Map)return new Map(hs(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=qt(o[t]));return e}function kr(o){return o}var oo=Object.seal({data:null,field:null});var Mn="____root____",af="____not_loaded_yet____";function En(){return!1}function bs(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function na(o,e,t,n,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function lf(o,e){let{reducers:t={},pivot:n,groupBy:r,indexer:i,toPrimaryKey:a,cache:l,mappings:s}=o,c=new ee;function u(h,b,y,S=0,C=[]){let T=!y.length||S===y.length-1,v=b[s?.values||"values"]||{};for(let w in v)if(v.hasOwnProperty(w)){let I=w;C.push(I),d.set(C,!0),h.set(C,{reducerResults:v[w][s?.totals||"totals"]||{},items:[]}),T||u(h,v[w],y,S+1,C),C.pop()}}let d=n?new ee:void 0,p=[],f=bs(t),m=qt(f);e.visitDepthFirst((h,b,y,S)=>{let[C,...T]=b,v=h.children,w=c.get(T);if(w&&(w.cache=h.cache,w.childrenLoading=h.childrenLoading,w.childrenAvailable=h.childrenAvailable,w.error=h.error),T.length==r.length&&r.length){if(w){w.items=v;for(let R=0,x=T.length;R<x;R++){let D=T.slice(0,R),M=c.get(D);M&&(M.items=M.items||[],M.items=M.items.concat(v))}v=i.indexArray(v,{toPrimaryKey:a,cache:l,nodesKey:void 0})}return S?.()}for(let I=0,R=v.length;I<R;I++){if(!v[I]){let A={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};c.set([...T,`${af}${I}`],A);continue}let x=v[I].data,D=v[I].keys||[];if(D.length){let A=D[D.length-1];T.push(A)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:x,totalChildrenCount:v[I].totalChildrenCount,reducerResults:v[I].aggregations||{},isTree:!1,isGroupBy:!0};if(c.set(T,M),n){let A=M.pivotDeepMap=new ee,P=v[I].pivot;u(A,P,n,0,p)}D.length&&T.pop()}S?.()});let g={deepMap:c,groupParams:o,initialData:e,reducerResults:m};return n&&(g.topLevelPivotColumns=d,g.pivot=n),g}function rf(o,e,t,n,r,i,a,l,s,c=kr){let{items:u,reducerResults:d,pivotDeepMap:p}=o.get(e);if(u.push(n),a&&na(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:h,toKey:b}=i[f],y=g?n[g]:null;h&&(oo.data=n,oo.field=g,y=h(oo));let S=(b||c)(y,n);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:qt(s),items:[]}));let{reducerResults:C,items:T}=p.get(t);T.push(n),a&&na(n,r,a,C,e)}t.length=0}}function sf(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let b=0,y=n.length;b<=y;b++){let S=n.slice(0,b),C=e.get(S),{reducerResults:T,items:v}=C;v.push(r),C.leavesAvailableCount++,C.totalLeafNodesCount++,a&&na(r,i,a,T,S)}return}let m=qt(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let h=c(r);if(!(!h||!Array.isArray(h))){for(let b=0,y=h.length;b<y;b++){let S=h[b];sf(o,e,t,p,S,b,a,l)}a&&zr(a,m,g)}}function ys(o,e){let{reducers:t}=o,n=bs(t),r=qt(n),i=new ee,a=new ee;i.set([],{items:[],isTree:!0,isGroupBy:!1,reducerResults:r,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,node:null,treeNesting:-1});for(let s=0,c=e.length;s<c;s++)sf(o,i,a,[],e[s],s,t,n);return t&&zr(t,r,e),{deepMap:i,treeParams:o,treePaths:a,initialData:e,reducerResults:r}}function ra(o,e){let{groupBy:t,defaultToKey:n=kr,pivot:r,reducers:i}=o,a=t.length,l=r?new ee:void 0,s=new ee,c=[],u=[],d=bs(i),p=qt(d);if(!a){let m={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:qt(d)};r&&(m.pivotDeepMap=new ee),s.set(c,m)}for(let m=0,g=e.length;m<g;m++){let h=e[m],b={};for(let y=0;y<a;y++){let{field:S,groupField:C,valueGetter:T,toKey:v}=t[y],w=S?h[S]:null;T&&(oo.data=h,oo.field=S,w=T(oo));let I=(v||n)(w,h);if(b[S||C]=I,c.push(I),!s.has(c)){let R={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...b},childrenLoading:!1,childrenAvailable:!1,reducerResults:qt(d)};r&&(R.pivotDeepMap=new ee),s.set(c,R)}rf(s,c,u,h,m,r,i,l,d,n)}a||rf(s,c,u,h,m,r,i,l,d,n),i&&na(h,m,i,p,c),c.length=0}i&&(s.visitDepthFirst((m,g,h,b)=>{zr(i,m.reducerResults,m.items),r&&m.pivotDeepMap.visitDepthFirst(({items:y,reducerResults:S},C,T,v)=>{zr(i,S,y),v?.()}),b?.()}),zr(i,p,e));let f={deepMap:s,groupParams:o,initialData:e,reducerResults:p};return r&&(f.topLevelPivotColumns=l,f.pivot=r),f}function cf(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function aT(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let y in i)if(i.hasOwnProperty(y)){let C=i[y].field;C&&(f[C]=c[y]),C&&p[C]==null&&(p[C]=c[y])}}let m=!0,g=n[n.length-1],h=g;if(p!=null){let y=t[n.length-1];y&&y.field&&(h=p[y.field]),y&&y.toKey&&(h=y.toKey(h,p)),h=h??g}return typeof h=="string"&&h.startsWith(af)&&(m=!1,h=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:En,hasSelectedCells:En,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:h,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function oa(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function zr(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function uf(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:h,rowsPerPage:b}=r,{deepMap:y}=u,S=o.length,C=t[t.length-1],T=C?C.nodeExpanded:!0;for(let v=0;v<S;v++){let w=o[v],I=c(w,v),R=[...e,I];if(l(w)){let E={id:I,nodePath:R,isGroupRow:!1,data:w,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:En,hasSelectedCells:En,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,v],indexInParent:v,indexInAll:T?i.length:-1};p&&(E.rowSelected=p(E)),d&&(E.rowDisabled=d(E)),f&&f(E);let _=h&&b!=null&&b>0&&E.indexInAll%b===0?E.indexInAll/b:null;for(let N=0,H=t.length;N<H;N++){let B=t[N];if(T||(B.collapsedLeafNodesCount+=1),B.deepRowInfoArray.push(E),_!=null&&T){if(typeof h=="function"&&h(B)!==!0)continue;let U=oa(B,E.indexInAll,_);i[U.indexInAll]=U,E.indexInAll++}}T&&(i[E.indexInAll]=E);continue}let M=y.get(R)?.totalLeafNodesCount??0,A={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:R,id:I,data:w,indexInAll:i.length,indexInParent:v,indexInParentNodes:[...n,v],totalLeafNodesCount:M,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:En,hasSelectedCells:En,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(A.rowSelected=p(A),g)){let E=g.getSelectionCountFor(A.nodePath);A.selectedLeafNodesCount=E.selectedCount,A.deselectedLeafNodesCount=E.deselectedCount}d&&(A.rowDisabled=d(A)),f&&f(A);let P=!0;if(m&&(A.selfExpanded=P=m(A)),T||(P=!1),A.nodeExpanded=P,T&&h&&b!=null&&b>0){let E=A.indexInAll,_=A.parentNodes;if(_.length>0&&E%b===0){let N=E/b,H=0;_.forEach(B=>{typeof h=="function"&&h(B)!==!0||(i.push(oa(B,E+H,N)),H++,A.indexInAll++)})}}T&&(i[A.indexInAll]=A);let O=s(w);Array.isArray(O)&&uf(O,R,[...t,A],A.indexInParentNodes,r,i)}return i}function df(o){let{dataArray:e}=o,t=[];return uf(e,[],[],[],o,t),{data:t}}function pf(o){let{lazyLoad:e,groupResult:t,rowsPerPage:n,repeatWrappedGroupRows:r,withRowInfo:i,toPrimaryKey:a,groupRowsState:l,isRowDisabled:s,isRowSelected:c,rowSelectionState:u,generateGroupRows:d,reducers:p={}}=o,{groupParams:f,deepMap:m,pivot:g}=t,{groupBy:h}=f,b=[],y=[],S=[],C=[];return m.visitDepthFirst((T,v,w,I)=>{let R=T.items,x=v.length,D=l?.isGroupRowCollapsed(v)??!1;C.push(w);let M=aT({lazyLoad:e,groupBy:h,parents:Array.from(S),reducers:p,indexInGroup:w,indexInParentGroups:Array.from(C),indexInAll:b.length,groupKeys:v,error:T.error,totalChildrenCount:T.totalChildrenCount,childrenLoading:(T.childrenLoading||!D&&!T.childrenAvailable)&&e,childrenAvailable:T.childrenAvailable,directChildrenCount:v.length===h.length?T.items.length:m.getDirectChildrenSizeFor(v),directChildrenLoadedCount:0},T);if(c&&(M.rowSelected=c(M),u)){let _=u.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=_.selectedCount,M.deselectedChildredCount=_.deselectedCount}s&&(M.rowDisabled=s(M));let A=S[S.length-1],P=A?.collapsed??!1;P&&(D=!0),M.collapsed=D;let O=d||D;if(P&&(O=!1),O){if(r&&n!=null&&n>0){let _=M.indexInAll,N=M.parents;if(N.length>0&&_%n===0){let H=_/n,B=0;N.forEach(U=>{typeof r=="function"&&r(U)!==!0||(b.push(oa(U,_+B,H)),B++,M.indexInAll++)})}}b.push(M),y.push(b.length-1)}M.collapsedChildrenCount=0,S.forEach(_=>{_.deepRowInfoArray.push(M),_.collapsedGroupsCount+=D?1:0}),A&&M.selfLoaded&&e&&(A.directChildrenLoadedCount+=1),i&&i(M),S.push(M);let E=!0;if(E){if(I)I();else if(!g){let _=b.length;D||(b.length+=R.length);let N=0;for(let H=0,B=R.length;H<B;H++){let U=R[H];if(!D&&r&&n!=null&&n>0){let Y=_+H+N;if(Y%n===0){let ae=Y/n;S.forEach(se=>{if(typeof r=="function"&&r(se)!==!0)return;let le=_+H+N;b[le]=oa(se,le,ae),N++,b.length++})}}let de=_+H+N,k={id:U?a(U,de):`${v}-${H}`,data:U,isCellSelected:En,hasSelectedCells:En,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!U,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:D,groupKeys:v,parents:Array.from(S),indexInParentGroups:[...C,H],indexInGroup:H,indexInAll:de,groupBy:h,groupNesting:x+1,groupCount:M.groupCount};c&&(k.rowSelected=c(k)),s&&(k.rowDisabled=s(k)),i&&i(k),S.forEach((Y,ae)=>{ae===S.length-1&&U&&(Y.directChildrenLoadedCount+=1),D&&(Y.collapsedChildrenCount+=1),Y.deepRowInfoArray.push(k)}),D||(b[_+H+N]=k)}}}S.pop(),C.pop()}),{data:b,groupRowsIndexes:y}}var Xf=z(require("react"));var lT=()=>{};function ff(o,e){let t=new ee,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function mf(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],p=r(n),f=at(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,h=m.length;g<h;g++){let b=m[g];mf(o,e,d,b)}});p?(c?.(n),s?.(n,lT)):(l?.(n,f,i(n)),s?.(n,f))}function gf(o,e,t){for(let n=0,r=t.length;n<r;n++)mf(o,e,[],t[n])}var sT=function(o,e){return o-e},cT=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},uT=function(o,e){return o-e},dT={number:sT,string:cT,date:uT},Vr=dT;function hf(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var Xt=(o,e,t)=>{let n=typeof t=="function"?t:t?.get;return e.sort(bf(hf(o),n)),e},ia=(o,e,t)=>{let n=bf(hf(o),t.get),r=t.depthFirst??!1,i=t.inplace??!1;r||(i?e.sort(n):e=[...e].sort(n));let{nodesKey:a,toKey:l}=t,s=u=>u[a],c=u=>u[a]===void 0;return gf({isLeafNode:t.isLeafNode??c,getNodeChildren:t.getNodeChildren??s,toKey:l},{onParentNode:(u,d,p)=>{if(r&&d(),Array.isArray(p)){let f=i?p.sort(n):[...p].sort(n);u[a]=f}r||d()}},e),r&&(i?e.sort(n):e=[...e].sort(n)),e};Xt.knownTypes=Vr;var pT=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=Xt.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Xt.knownTypes).join(", ")}`)}return r||(r=Vr.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:n*c}},fT=o=>o.map(pT).filter(e=>e instanceof Function),bf=(o,e)=>{let t=fT(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var aa=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new ee(n.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new ee(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 ft=class extends aa{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function zo(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||kr)(l,o);return t.push(s),t},[])}var Re=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new ee;this.deselectedMap=new ee;this.onlyUsePrimaryKeys=!1;this.selectionCache=new ee;this.selectionCountCache=new ee;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?zo(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(e);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let n=t?.get(e);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var mT="*",ze=class{constructor(e){this.wildcard=mT;this.cache=new ee;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(n){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(n){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,n=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),n&&n.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let n=this.selectedRowsToColumns.get(e);if(n){if(n.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>n.has(r)):!1}return!1}error(e){fn(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var gT=Ge("IT:InfiniteTable"),hT="#dc3545",bT="#eb9316";var Tf="Warn",Sf="Error",yT="Info",TT="Success",ST="Logs",la=gT.extend(ST),J_=la.extend(yT),CT=la.extend(Tf),wT=la.extend(Sf),eO=la.extend(TT);var vT=bT,IT=hT;var RT=(o,e)=>{e=e?e.extend?e.extend(Tf):e:CT,e(typeof e.color=="function"?e.color(vT,o):o)},xT=(o,e)=>{e=e?e.extend?e.extend(Sf):e:wT,e(typeof e.color=="function"?e.color(IT,o):o)};var yf=new ee,Cf=(o,...e)=>{yf.has(e)||(yf.set(e,!0),o())};var Vo=(o,e=o,t)=>{Cf(()=>RT(o,t),e,"warn")},wf=(o,e=o,t)=>{Cf(()=>xT(o,t),e,"error")};function sa(o,e){return new Re(o,ct(e))}function ct(o){return()=>{let e=typeof o=="function"?o():o;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function vf(o){let{getDataSourceState:e,dataSourceActions:t}=o;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Re))throw"Invalid row selection";let a=new Re(r,ct(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 Re))throw"Invalid row selection";let a=new Re(r,ct(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 Re))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?zo(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 Re))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?zo(d,c):[]}let u=new Re(a,ct(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 Re))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?zo(d,c):[]}let u=new Re(l,ct(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 Re))throw"Invalid row selection";let s=new Re(a,ct(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 Re))throw"Invalid row selection";let s=new Re(a,ct(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 Re))throw"Invalid row selection";let s=new Re(a,ct(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Re(i,ct(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Re))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Re(r,ct(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 Ts=new WeakMap,PT=o=>o;function If(o,e=50,t){Ts.set(o,{lastCallTime:0,lastCallArg:null});let n=t??PT;return r=>{let{lastCallTime:i,lastCallArg:a}=Ts.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=At(n(a),n(r));s<e&&c||(Ts.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var ca=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new ee;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}n?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let h=r(m),b=s?[...p,h]:void 0,y=s&&!!b,S=y?n?.getMutationsForNodePath(b):n?.getMutationsForPrimaryKey(h);if(S&&S.length){for(let C=0,T=S.length;C<T;C++){let v=S[C];if(v.type==="delete"&&!g&&(y?this.removeNodePath(b,t):this.remove(h),g=!0,d.splice(f,1),f--),v.type==="update"&&!g&&(m={...m,...v.data},d[f]=m),v.type==="update-children"&&!g){let w=v.children(m[l],m);m={...m},w!==void 0?m[l]=w:delete m[l],d[f]=m}v.type==="insert"&&(v.position==="before"?(d.splice(f,0,v.data),f--):d.splice(f+1,0,v.data))}y?n?.removeNodePathInfo(b):n?.removeInfo(h)}if(!g)if(y){this.addNodePath(b,m);let C=a(m),T=C?null:i(m);!C&&Array.isArray(T)&&(p.push(h),c&&(m[l]=T=T.concat()),u(T,p),p.pop())}else this.add(h,m)}}};u(e,[])}return e}}};var Qe=require("react");var _t=require("react");function ro(o,e){let t=(0,_t.useRef)({}),n=(0,_t.useRef)({}),r=n.current,i=(0,_t.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,_t.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function DT(o,e){let t=(0,_t.useRef)({}),n=(0,_t.useRef)({}),r=n.current,i=(0,_t.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,_t.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function ET(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,_t.useEffect)(o,t)}function Ss(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Cs(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e?.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function ws(o){let{pivotByAtIndex:e}=o;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function Rf({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=at(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Cs({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,h)=>{if(m=[...m],t==="end"&&h?.(),m.length===a){let b=e[m.length-1],S=m.slice(0,-1).join("/");if(!d){let C=S;S=m.join("/");let T=m[m.length-1];c[S]=ws({header:`${T}`,columnGroup:C,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:b,pivotIndex:m.length-1,pivotGroupKey:T})}l.forEach((C,T)=>{let v=d?`${m[m.length-1]}`:C.name||C.id,w=Cs({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:C,pivotAggregatorIndex:T,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:b,defaultSortable:!1,columnGroup:S,header:v,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[C.id]:null}),I=`${C.id}:${m.join("/")}`;s[I]=w})}else{let b=m.join("/"),y=m.slice(0,-1);if(c[b]=ws({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],C=y.length?y.join("/"):void 0;if(!d){let T=C;C=`total:${m.join("/")}`,c[C]=ws({header:`${m[m.length-1]} total`,columnGroup:T,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((T,v)=>{let w=d?`${m[m.length-1]} total `:`${T.name||T.id} total`,I=Cs({columnGroup:C,header:w,pivotAggregator:T,pivotAggregatorIndex:v,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[T.id]:null});s[`total:${T.id}:${m.join("/")}`]=I})}}(t==="start"||t===!1)&&h?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var xf=Symbol("CLEAR"),io=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new ee;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=xf,n=this.primaryKeyToData.get(t)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(xf);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=()=>ee.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:ee.clone(e.nodePathToData),n}};function An(o,e){return e().dataArray[o]}function ua(o){return o().dataArray}var ot=class{constructor(e){this.collapsedPathsMap=new ee;this.expandedPathsMap=new ee;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:n,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?n.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?n.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var MT=(o,e)=>o.length-e.length,Xe=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new ee;this.cache=new ee;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?e.config:{treePaths:new ee})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Array.isArray(e)?new ee(e.map(t=>[t,!0])):e:this.config.treePaths}withTreePaths(e,t){let n=this.config.treePaths;t=this.getTreePaths(t);let r=t!==n;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=n,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],n){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},n)}getSelectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&n.push(i.keys)})},t),n}getDeselectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||n.push(i.keys)})},t),n}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 o(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Array.isArray(t.treePaths)?new ee(t.treePaths.map(n=>[n,!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:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}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 n=this.cache.get(e);if(n)return n;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 p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.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:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function pa(o,e){return new Xe(o,Go(e))}function Go(o){return()=>({treePaths:(typeof o=="function"?o():o).treePaths})}var da=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Xe))throw"Invalid tree selection";let a=new Xe(r,Go(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(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!n)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new ot({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ot({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ot(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ot(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new ot(n.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?An(n,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Xe))throw"Invalid node selection";let n=new Xe(e,Go(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Xe))throw"Invalid node selection";let n=new Xe(e,Go(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Xe))throw"Invalid tree selection";return t.isNodeSelected(e)}selectNode(e,t){this.setNodeSelection(e,!0,t)}deselectNode(e,t){this.setNodeSelection(e,!1,t)}toggleNodeSelection(e,t){this.isNodeSelected(e)?this.deselectNode(e,t):this.selectNode(e,t)}};var Ho=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var mt=class extends Ho{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var vs=1e3;function Pf(o){return new Is(o)}var Is=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=()=>ua(this.getState);this.getRowInfoByIndex=e=>An(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),n=t.getDataForNodePath(e);return n||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let n=this.getState().isTree,r=n?void 0:e.map(l=>this.toPrimaryKey(l)),i=n?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,n)=>{let r=n?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?vs:r;return isNaN(a)||(a=vs),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=n?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let n=this.getState().rowDisabledState,r=n?new mt(n):new mt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let n=this.getRowInfoByPrimaryKey(e);n&&this.setRowEnabledAt(n.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new mt({enabledRows:!0,disabledRows:[]});return}let t=new mt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new mt({disabledRows:!0,enabledRows:[]});return}let t=new mt(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 da({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:n,nodesKey:r}=this.getState(),i=t?io.clone(t,{light:!0}):new io({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??vs,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,n.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Df(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((h,b)=>h||typeof b!="function"?l.has(b):!1,!1),t))break}if(c&&c.length){if(l===!0)n=!0;else for(let m of c)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function fa(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function ma(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function ga(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}function xs(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var Zt=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function Rs(){return!1}function AT(o,e,t,n,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Rs,hasSelectedCells:Rs};return n&&(a.rowSelected=n(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var _T=at(()=>{console.warn(`Your "treeFilterFunction" should NOT MUTATE the data object. You're probably mutating the node children.
1
+ "use strict";var Yh=Object.create;var ti=Object.defineProperty;var qh=Object.getOwnPropertyDescriptor;var Xh=Object.getOwnPropertyNames;var Zh=Object.getPrototypeOf,Qh=Object.prototype.hasOwnProperty;var Jh=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),eb=(o,e)=>{for(var t in e)ti(o,t,{get:e[t],enumerable:!0})},Cc=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Xh(e))!Qh.call(o,r)&&r!==t&&ti(o,r,{get:()=>e[r],enumerable:!(n=qh(e,r))||n.enumerable});return o};var G=(o,e,t)=>(t=o!=null?Yh(Zh(o)):{},Cc(e||!o||!o.__esModule?ti(t,"default",{value:o,enumerable:!0}):t,o)),tb=o=>Cc(ti({},"__esModule",{value:!0}),o);var Bn=Jh((FR,ad)=>{"use strict";ad.exports=function(o,e,t,n,r){var i,a;if(n===void 0)n=0;else if(n=n|0,n<0||n>=o.length)throw new RangeError("invalid lower bound");if(r===void 0)r=o.length-1;else if(r=r|0,r<n||r>=o.length)throw new RangeError("invalid upper bound");for(;n<=r;)if(i=n+(r-n>>>1),a=+t(o[i],e,i,o),a<0)n=i+1;else if(a>0)r=i-1;else return i;return~n}});var XC={};eb(XC,{CellSelectionState:()=>He,DataClient:()=>mc,DataSource:()=>nS,DataSourceActionType:()=>Qf,DeepMap:()=>Q,FixedSizeSet:()=>Ua,FlashingColumnCell:()=>Oh,GroupRowsState:()=>mt,INTERNAL_MatrixDebugger:()=>Nh,InfiniteTable:()=>tn,InfiniteTableClassName:()=>qt,InfiniteTableComponent:()=>Ch,Menu:()=>Bt,RowDetailCache:()=>jo,RowDetailState:()=>vt,RowDisabledState:()=>gt,RowSelectionState:()=>Pe,TreeDataSource:()=>BC,TreeExpandState:()=>ot,TreeGrid:()=>Ih,TreeSelectionState:()=>Xe,WeakFixedSizeSet:()=>qa,alignNode:()=>Qs,components:()=>qC,createFlashingColumnCellComponent:()=>gc,debounce:()=>Dt,debug:()=>Ke,defaultFilterTypes:()=>Cn,eventMatchesKeyboardShortcut:()=>Ea,filterDataArray:()=>As,filterTypes:()=>Cn,flatten:()=>pf,getComponentStateRoot:()=>Et,group:()=>aa,interceptMap:()=>Ph,keyboardShortcuts:()=>xh,multisort:()=>Qt,multisortNested:()=>la,queryKeyToCacheKey:()=>po,toTreeDataArray:()=>hf,useComponentState:()=>$e,useDataSourceInternal:()=>Wo,useDataSourceState:()=>on,useEffectWhen:()=>Za,useEffectWhenSameDeps:()=>Dh,useEffectWithChanges:()=>ro,useEffectWithObject:()=>_T,useGridScroll:()=>Ha,useInfiniteColumnCell:()=>Ir,useInfiniteColumnEditor:()=>Ni,useInfiniteColumnFilterEditor:()=>Co,useInfiniteHeaderCell:()=>br,useInfinitePortalContainer:()=>qg,useLayoutEffectWithChanges:()=>AT,useManagedDataSource:()=>Os,useMasterRowInfo:()=>rS,useOverlay:()=>en,useOverlayPortal:()=>ug,usePrevious:()=>Tn,useRowInfoReducers:()=>oS,useVisibleColumnSizes:()=>Kg,withSelectedLeafNodesOnly:()=>Rh});module.exports=tb(XC);function Dt(o,{wait:e}){let t=null;return function(...n){let r=this;t!==null&&clearTimeout(t),t=setTimeout(()=>{o.apply(r,n)},e)}}var Ie=G(require("react"));var Z=(...o)=>o.filter(e=>!!`${e}`).join(" ");var Gn=G(require("react")),dl=require("react");function be(o=!1){let e=null,t=[],n=null,r=(i,a)=>{let l=[];if(o)n!=null&&(cancelAnimationFrame(n),n=null),requestAnimationFrame(()=>{e=i,n=null;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)});else{e=i;for(let s=0,c=t.length;s<c;s++)l.push(t[s](i));a?.(l)}};return r.get=()=>e,r.onChange=i=>(t.push(i),()=>{t=t.filter(a=>a!==i)}),r.destroy=()=>{r(null),t.length=0},r.getListenersCount=()=>t.length,r}function at(o){let e=!1,t=null;return(...r)=>(e||(e=!0,t=o(...r)),t)}var wc=(o,e)=>o-e;var ni=(o,e)=>wc(o.revision,e.revision),Q=class o{constructor(e){this.map=new Map;this.length=0;this.revision=0;this.emptyKey=Symbol("emptyKey");this.visit=e=>{this.map.forEach((t,n)=>this.visitKey(n,this.map,[],e,!1))};this.visitSome=e=>{this.visitWithNext([],e,!0)};this.visitDepthFirst=e=>{this.visitWithNext([],e,!1)};this.visitWithNext=(e,t,n,r=this.map,i,a)=>{if(!r)return;let l=0,s=r.has(this.emptyKey),c=!a;if(i!==void 0){if(i<0)return;i--}let u=(d,p)=>{let f=r.get(p);if(!f)return;let{map:m}=f,g=p===this.emptyKey;if(g&&!c)return;let b=g?[]:[...e,p],h=m?()=>this.visitWithNext(b,t,n,m,i!==void 0?i-1:void 0):void 0;if(f.hasOwnProperty("value")){let y=t(f.value,b,l,h,f);if(n&&y===!0)return!0;l++}else h?.()};s&&(u(void 0,this.emptyKey),c=!1,l=0);for(let[d,p]of r){let f=u(p,d);if(n&&f===!0)return f}};this.fill(e)}static clone(e){let t=new o;return e.visit((n,r)=>{t.set(r,n.value)}),t}fill(e){e&&e.forEach(t=>{let[n,r]=t;this.set(n,r)})}getValuesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push(i)},t),n}getEntriesStartingWith(e,t){let n=[];return this.getStartingWith(e,(r,i)=>{n.push([r,i])},t),n}getLeafNodesStartingWith(e,t,n){let{respectOrder:r=!1}=n||{},i=[],a=[];return this.getStartingWith(e,(l,s,c)=>{!c.map&&c.hasOwnProperty("value")&&(r?i.push(c):a.push(t(c)))},n),r?i.sort(ni).map(t):a}getKeysForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>n.keys,t)}getKeysAndValuesForLeafNodesStartingWith(e,t){return this.getLeafNodesStartingWith(e,n=>[n.keys,n.value],t)}getKeysOfFirstChildOnEachBranchStartingWith(e,t){let{excludeSelf:n,depthLimit:r,respectOrder:i=!0}=t||{},a=[],l=[],s=p=>{i?a.push(p):l.push(p.keys)},c=this.map,u,d=!1;if(e.length)for(let p=0,f=e.length;p<f;p++){let m=e[p];if(u=c.get(m),!u||!u.map)if(d=!0,p===f-1){d=!0;break}else return[];c=u.map}else if(!n&&c.has(this.emptyKey))return[[]];return u&&u.value!==void 0&&(n||(s({...u,keys:e}),d=!0)),d?i?a.sort(ni).map(p=>p.keys):l:(this.visitWithNext(e,(p,f,m,g,b)=>{s({...b,keys:f})},!1,c,r,n),i?a.sort(ni).map(p=>p.keys):l)}getKeysStartingWith(e,t){let n=[];return this.getStartingWith(e,r=>{n.push(r)},t),n}getStartingWith(e,t,n){let{excludeSelf:r,depthLimit:i}=n||{},a=this.map,l,s=!1;if(e.length)for(let c=0,u=e.length;c<u;c++){let d=e[c];if(l=a.get(d),!l||!l.map)if(s=!0,c===u-1){s=!0;break}else return;a=l.map}l&&l.value!==void 0&&(r||t(e,l.value,{...l,keys:e})),!s&&this.visitWithNext(e,(c,u,d,p,f)=>{t(u,c,{...f,keys:u}),p?.()},!1,a,i,r)}getMapAt(e){let t=this.map,n;if(!e.length)return this.map;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return;t=n.map}return t}getAllChildrenSizeFor(e){let t=this.map,n;if(!e.length)return this.length;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(n=t.get(a),!n||!n.map)return 0;t=n.map}return n.length}getDirectChildrenSizeFor(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(!l||!l.map)return 0;if(t=l.map,a)return t?.size??0}return 0}set(e,t){let n=this.map;e.length||(e=[this.emptyKey]);for(let r=0,i=e.length;r<i;r++){let a=e[r],l=r===i-1,s=n.get(a)||{length:0};l?(s.revision=this.revision++,s.value=t,n.set(a,s),this.length++):(s.map||(s.map=new Map,n.set(a,s)),s.length++,n=s.map)}return this}get(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.value:void 0;if(!l||!l.map)return;t=l.map}}get size(){return this.length}clear(){let e=t=>{t.forEach((n,r)=>{let{map:i}=n;i&&e(i)}),t.clear()};e(this.map),this.length=0,this.revision=0}delete(e){let t=this.map;e.length?e=[...e]:e=[this.emptyKey];let n=[t],r=[],i=!1;for(let a=0,l=e.length;a<l;a++){let s=e[a],c=a===l-1,u=t.get(s);if(c){u&&(u.hasOwnProperty("value")&&(delete u.value,delete u.revision,i=!0,r.forEach(d=>{d.length--}),this.length--),u.map&&u.map.size===0&&delete u.map,u.map||t.delete(s));break}else{if(!u||!u.map){i=!1;break}r.push(u),t=u.map,n.push(t)}}for(;n.length;){let a=n.pop(),l=e.length;if(e.pop(),l>0&&a?.size===0){let s=n[n.length-1],c=e[e.length-1],u=s?.get(c);u&&(delete u.map,u.hasOwnProperty("value")||s.delete(c))}}return i}has(e){let t=this.map;e.length||(e=[this.emptyKey]);for(let n=0,r=e.length;n<r;n++){let i=e[n],a=n===r-1,l=t.get(i);if(a)return l?l.hasOwnProperty("value"):!1;if(!l||!l.map)return!1;t=l.map}return!1}visitKey(e,t,n,r,i){let a=t.get(e);if(!a)return;let{map:l}=a,s=e===this.emptyKey?[]:[...n,e],c=at(()=>{if(l)for(let[u]of l){let d=this.visitKey(u,l,s,r,i);if(i&&d===!0)return!0}return!1});if(a.hasOwnProperty("value")){let u=r(a,s,c);if(i&&u===!0)return!0}c()}getArray(e){let t=[];return this.visit((n,r)=>{let i=e({...n,keys:r});r.length===0?t.splice(0,0,i):t.push(i)}),t}rawKeysAt(e){let t=this.getMapAt(e);return t?[...t.keys()]:[]}valuesAt(e){let t=this.getMapAt(e);if(!t)return[];let n=[];return t.forEach(r=>{r.value!==void 0&&n.push(r.value)}),n}values(){return this.sortedIterator(e=>e.value)}keys(){return this.sortedIterator(t=>t.keys)}entries(){return this.sortedIterator(e=>[e.keys,e.value])}topDownEntries(){return this.getArray(e=>[e.keys,e.value])}topDownKeys(){return this.getArray(e=>e.keys)}topDownValues(){return this.getArray(e=>e.value)}sortedIterator(e){let t=[];this.visit((r,i)=>{t.push({...r,keys:i})}),t.sort(ni);function*n(){for(let r=0,i=t.length;r<i;r++)yield e(t[r])}return n()}};globalThis.DeepMap=Q;function we(){return globalThis}var ri=["#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"],vc=Symbol("color"),oi=new WeakMap,rl=be();function il(o=ri){oi.set(o,o.map(e=>0))}il();var nb=(o=ri)=>{let e=[];oi.has(o)?e=oi.get(o):(e=o.map(n=>0),oi.set(o,e));let t=e.reduce((n,r,i,a)=>r<a[n]?i:n,0);return e[t]!=null&&e[t]++,o[t]??o[0]??ri[0]},lr=":",al="*",Ic="-",ob=",",rb="debug",ib="diffdebug",xc=!1,ar=new Q,sr=new Map;function ll(o,e){let t=o.split(lr),n=new Q;n.set(t,!0);let r=e.split(lr),i=new Set(r).has(al),a=r.indexOf(al),l=i?r.slice(0,a):r;if(n.getKeysStartingWith(l,{excludeSelf:i}).length>0){let s=r.slice(a+1);return s.length?o.endsWith(s.join(lr)):!0}}function ab(o,e){let t=`channel=${o}_permissions=${e}`;if(sr.has(t))return sr.get(t);let n=e.split(ob);function r(l){return sr.set(t,l),l}let i=[],a=[];n.forEach(l=>{l.includes(al)?a.push(l):i.push(l)});for(let l=0;l<i.length;l++){let s=i[l],c=s.startsWith(Ic);if(c&&(s=s.substring(Ic.length)),ll(o,s))return r(!c)}for(let l=0;l<a.length;l++){let s=a[l],c=s.startsWith("-");if(c&&(s=s.substring(1)),ll(o,s))return r(!c)}return r(!1)}var sl=()=>Ke.enable??(we()&&we().localStorage?.getItem(rb))??"",lb=()=>Ke.diffenable??(we()&&we().localStorage?.getItem(ib))??`${xc}`,cl="",Pc=xc;function ul(o){Pc=`${lb()}`=="true",cl!==o&&(cl=o,sr.clear())}function Dc(o){ul(sl()),typeof we()<"u"&&we().addEventListener&&we().addEventListener("storage",function(){ul(sl())});function e(t,n){let r=n?`${n}${lr}${t}`:t,i=r.split(lr),a=ar.get(i);if(a)return a;let l=ar.get(i.slice(0,-1)),s=(l?l.logFn:Ke.logFn)??Mc,c=s,u,d=0,p=()=>u??ab(r,cl),f=nb(Ke.colors),m=Object.defineProperties((...g)=>{let b=rl.getListenersCount(),h;if(b>0&&(h=h??Date.now(),rl({color:f,channel:r,args:g,timestamp:h})),p()){if(h=h??Date.now(),d&&Pc){let C=h-d;c(`%c[${r}]`,`color: ${f}`,`+${C}ms:`)}d=h;let y=[],S;if(g.forEach(C=>{if(C[vc])S===void 0&&(S=!0),y.push(...C);else{if(typeof C!="string"&&typeof C!="number"){S=!1;return}y.push(`${C}%s`)}}),S){let C=[`%c[${r}]%c %s`,`color: ${f}`,"",...y,""];c(...C)}else c(`%c[${r}]%c %s`,`color: ${f}`,"",...g)}},{channel:{value:r},color:{value:(g,...b)=>{let h=[`%c${b.join(" ")}%c%s`,`color: ${g}`,""];return h.toString=()=>b.join(" "),h[vc]=!0,h}},extend:{value:g=>e(g,r)},enabled:{get:()=>p(),set:g=>{u=g}},logFn:{configurable:!1,get:()=>c,set:g=>{c=g??s}},destroy:{value:()=>{ar.delete(i)}}});return ar.set(i,m),m}return e(o)}var Mc=console.log.bind(console),Rc;Object.defineProperty(Dc,"enable",{get:()=>Rc,set:o=>{Rc=o,ul(sl())}});var Ke=Dc;Ke.colors=ri;Ke.logFn=Mc;var sb=(o,e)=>rl.onChange(t=>{if(!t)return;let{channel:n,args:r,color:i,timestamp:a}=t;ll(n,o)&&e({channel:n,color:i,args:r,timestamp:a})});Ke.onLogIntent=sb;Ke.destroyAll=()=>{il(),il(Ke.colors),ar.clear(),sr.clear()};var yt=o=>{let e=Ke(o?`IT:${o}:TYPE=debug`:"IT:TYPE=debug");return e.logFn=console.log.bind(console),e},gn=o=>{let e=Ke(o?`IT:${o}:TYPE=error`:"IT:TYPE=error");return e.logFn=console.error.bind(console),e},cr=()=>cr;cr.extend=()=>cr;var dt=class{constructor(e){this.debug=cr,this.error=cr}};var cb=G(require("react")),hn=require("react");var ur=(o,e,t={debounce:0})=>{let n=t.debounce??0,r=window.ResizeObserver,i=n?Dt(e,{wait:n}):e,a=new r(l=>{let s=l[0],{width:c,height:u}=s.contentRect;if(s.borderBoxSize?.[0])u=s.borderBoxSize[0].blockSize,c=s.borderBoxSize[0].inlineSize;else{let d=o.getBoundingClientRect();u=d.height,c=d.width}i({width:c,height:u})});return a.observe(o),()=>{a.disconnect()}},ii=(o,e,t={earlyAttach:!1,debounce:0})=>{let n=(0,hn.useRef)({width:0,height:0}),r=i=>{let a;return o.current&&(a=ur(o.current,l=>{l={width:Math.round(l.width),height:Math.round(l.height)};let s=n.current;(s.width!==l.width||s.height!==l.height)&&(n.current=l,i(l))},{debounce:t.debounce})),()=>{a&&a()}};(0,hn.useEffect)(()=>t.earlyAttach?()=>{}:r(e),[o.current,e,t.earlyAttach,t.debounce]),(0,hn.useLayoutEffect)(()=>t.earlyAttach?r(e):()=>{},[o.current,e,t.earlyAttach])};var ub=gn("CSSVariableWatch"),db=yt("CSSVariableWatch"),pb={position:"absolute",pointerEvents:"none",width:0,height:0,lineHeight:0,fontSize:0,overflow:"hidden"},fb=o=>{let e=(0,dl.useRef)(0),t=Gn.useCallback(({height:n})=>{n!=null&&n!==e.current&&(e.current=n,o.onChange(n))},[o.onChange]);ii(o.ref,t,{earlyAttach:!0}),Gn.useLayoutEffect(()=>{let n=o.ref.current.getBoundingClientRect().height;if(n!=null)return e.current=n,db(`Variable ${o.varName} found and equals ${n}.`),o.onChange(n);ub(`Specified variable ${o.varName} not found or does not have a numeric value.`)},[])},dr=o=>{let e=(0,dl.useRef)(null);fb({...o,ref:e});let t=o.varName.startsWith("var(")?o.varName:`var(${o.varName})`,{allowInts:n=!1}=o;return Gn.createElement("div",{"data-name":"css-variable-watcher","data-var":o.varName,style:pb},Gn.createElement("div",{ref:e,style:{height:n?`calc(1px * ${t})`:t}}))};var li=G(require("react"));var Ec=G(require("react")),pl;function pr(){return pl||(pl=Ec.createContext({api:null,getState:()=>null,assignState:()=>null,getDataSourceMasterContext:()=>{},componentState:null,componentActions:null}))}var Ac=G(require("react")),fl;function ai(){return fl||(fl=Ac.createContext(void 0))}function on(){let o=pr();return li.useContext(o).componentState}function De(){let o=pr();return li.useContext(o)}function Ve(){let o=ai();return li.useContext(o)}var go=G(require("react")),qe=require("react");function ml(o,e){let t=new Set;function n(...r){let i=e?e.getProxyTargetFromArgs(...r):r[0];t.clear();let a={get:function(c,u){return t.add(u),c[u]}},l=new Proxy(i,a),s=e?e.putProxyToArgs(l,...r):[l];return o.apply(this,s)}return{fn:n,propertyReads:t}}var gl=o=>o&&o.substr(0,1).toUpperCase()+o.substr(1);function fr(o){return o!==void 0}function bn(o,e){let t=e[o];return fr(t)}var yn=require("react");var si=require("react"),Mt=()=>{let[o,e]=(0,si.useState)(0);return[o,(0,si.useCallback)(()=>{e(t=>t+1)},[e])]};var _c=o=>{let e=(0,yn.useCallback)(o,[]),t=(0,yn.useRef)(!1),n=(0,yn.useRef)(!1),r=(0,yn.useRef)(void 0),[i,a]=Mt();t.current&&(n.current=!0),(0,yn.useEffect)(()=>(t.current||(r.current=e,t.current=!0),a(),()=>{n.current&&r.current&&r.current()}),[])};var ci=require("react");function Me(o){let e=(0,ci.useRef)(o);return e.current=o,(0,ci.useCallback)(()=>e.current,[])}var ui=require("react"),Tn=(o,e)=>{let t=(0,ui.useRef)(e===void 0?o:e);return(0,ui.useLayoutEffect)(()=>{t.current=o}),t.current};var mb=(o,e,t)=>{let n=o[e];typeof n=="function"&&n(...t)},hl;function Oc(){return hl||(hl=(0,qe.createContext)(null))}function gb(o,e,t,n,r,i,a){let l=e();return Object.keys(l).reduce((s,c)=>{let u=c;return Object.defineProperty(s,c,{set:p=>{let f=t(),m=e(),g=m[u],b=!0;if(i&&typeof i[u]=="function"&&i[u](p,{actions:s,state:m})===!1&&(b=!1),b){let S=[p],C=`on${gl(c)}Change`;if(a&&a[u]){let T=a[u](p,m);C=T.callbackName||C,S=T.callbackParams}mb(f,C,S)}let h=n[u];typeof h=="function"&&(p=h(p));let y=!!r?.[u];bn(c,f)&&!y||o({payload:{updatedProps:null,mappedState:{[c]:p}}})}}),s},{})}function hb(o,e,t){let n={};for(let r in o)if(o.hasOwnProperty(r)){let i=o[r],a=bn(r,e)?e[r]:e[`default${gl(r)}`];typeof i=="function"&&(a=i(a,t)),n[r]=a}return n}function Et(o){let e=o.getParentState||(()=>null);function t(r){let[i]=(0,qe.useState)(()=>o.initSetupState?o.initSetupState(r):{}),a=(0,qe.useRef)(new Set),l=(0,qe.useMemo)(()=>o.forwardProps?o.forwardProps(i,r):{},[i]),s=e(),c=Me(s);function u(){let I={};l&&(I=hb(l,r,i));let R={...i,...I};if(o.mapPropsToState){let{fn:x,propertyReads:E}=ml(o.mapPropsToState,{getProxyTargetFromArgs:M=>M.props,putProxyToArgs:(M,P)=>[{...P,props:M}]}),A=x({props:r,state:R,oldState:null,parentState:s});return a.current=new Set([...a.current,...E]),{...R,...A}}return R}let[d]=(0,qe.useState)(u),p=Me(r),f=(I,R)=>{if(R.type==="REPLACE_STATE")return R.payload;let x=c?.()??null,E=R.payload.mappedState,A=R.payload.updatedPropsToState,M={...I};if(E&&Object.assign(M,E),o.mapPropsToState){let{fn:_,propertyReads:D}=ml(o.mapPropsToState,{getProxyTargetFromArgs:N=>N.props,putProxyToArgs:(N,W)=>[{...W,props:N}]}),F=_({props:p(),state:M,oldState:I,parentState:x});a.current=new Set([...a.current,...D]),Object.assign(M,F)}return R.type==="ASSIGN_STATE"&&Object.assign(M,R.payload),o.concludeReducer?o.concludeReducer({previousState:I,state:M,updatedProps:A,parentState:x}):M},[m,g]=(0,qe.useReducer)(f,d),b=Me(m),{allowedControlledPropOverrides:h}=o,y=(0,qe.useMemo)(()=>gb(g,b,p,l,h,o.interceptActions,o.mappedCallbacks),[g,l,h]),S=o.Context??Oc(),C=(0,qe.useMemo)(()=>({componentState:m,componentActions:y,getComponentState:b,replaceState:I=>{g({type:"REPLACE_STATE",payload:I})},assignState:I=>{g({type:"ASSIGN_STATE",payload:I})}}),[m,y,b]),T=Tn(r),v=(0,qe.useRef)(!1);v.current=!1;let w=o.layoutEffect?qe.useLayoutEffect:qe.useEffect;return w(()=>{let I=r,R={},x=0,E={},A=0,M={},P=0;if(new Set([...Object.keys(I),...Object.keys(T)]).forEach(F=>{let N=F,W=T[N],L=I[N];if(N!=="children"&&W!==L&&(M[N]={newValue:L,oldValue:W},P++,bn(N,r)||bn(N,T)))if(l.hasOwnProperty(F)){let X=L,le=l[F];typeof le=="function"&&(X=le(L)),m[N]!==X&&(R[N]=X,x++)}else a.current.has(F)&&(E[N]=I[N],A++)}),A>0||x>0){(o.debugName?yt(typeof o.debugName=="function"?`${o.debugName(I)}:rerender`:`${o.debugName}:rerender`):yt("rerender"))("Triggered by new values for the following props",...Object.keys(R??{}),...Object.keys(E??{}));let N={payload:{mappedState:x?R:null,updatedPropsToState:A?E:null}};if(v.current=!0,g(N),o.onPropChange){for(var D in M)if(M.hasOwnProperty(D)){let{newValue:W,oldValue:L}=M[D];o.onPropChange({name:D,newValue:W,oldValue:L},r,y,m)}}o.onPropsChange&&P&&o.onPropsChange(M,r,y,m)}}),w(()=>{s!=null&&!v.current&&g({type:"PARENT_STATE_CHANGE",payload:{}})},[s]),_c(()=>()=>{o.cleanup?.(b())}),{contextValue:C,ContextComponent:S}}return{ManagedComponentContextProvider:go.memo(function(i){let{contextValue:a,ContextComponent:l}=t(i);return go.createElement(l.Provider,{value:a},i.children)}),useManagedComponent:t}}function $e(o){return o=o??Oc(),go.useContext(o)}var $c=G(require("react"));var lt="Infinite",Fe={rootClassName:lt};var di=()=>Fe;var Fc="_16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Nc={center:"_16lm1iw2j",stretch:"_16lm1iw2k",start:"_16lm1iw2l",end:"_16lm1iw2m"};var Ut="_16lm1iw3b _16lm1iw3c _16lm1iw35",Lc={pointer:"_16lm1iwk",default:"_16lm1iwl",colResize:"_16lm1iwm",grabbing:"_16lm1iwn",grab:"_16lm1iwo"},ho={flex:"_16lm1iw1p",contents:"_16lm1iw1q",none:"_16lm1iw1r",block:"_16lm1iw1s",grid:"_16lm1iw1t",inlineBlock:"_16lm1iw1u",inlineFlex:"_16lm1iw1v",inlineGrid:"_16lm1iw1w"};var pi={1:"_16lm1iw1c",none:"_16lm1iw1d"},mr={column:"_16lm1iw2f",columnReverse:"_16lm1iw2g",row:"_16lm1iw2h",rowReverse:"_16lm1iw2i"};var kc={0:"_16lm1iw1y","100%":"_16lm1iw1z","50%":"_16lm1iw20"},zc={center:"_16lm1iw30",spaceBetween:"_16lm1iw31",spaceAround:"_16lm1iw32",start:"_16lm1iw33",end:"_16lm1iw34"},Vc={0:"_16lm1iw26","100%":"_16lm1iw27","50%":"_16lm1iw28",auto:"_16lm1iw29"};var Gc={none:"_16lm1iwd"},Hc={hidden:"_16lm1iw35",auto:"_16lm1iw36",visible:"_16lm1iw37"};var fi={relative:"_16lm1iw1",absolute:"_16lm1iw2",static:"_16lm1iw3",sticky:"_16lm1iw4",fixed:"_16lm1iw5"};var Kc={0:"_16lm1iw23","100%":"_16lm1iw24","50%":"_16lm1iw25"};var Bc={none:"_16lm1iw1x"};var Wc={visible:"_16lm1iw38",hidden:"_16lm1iw39"};var jc={1:"_16lm1iw1e",10:"_16lm1iw1f",100:"_16lm1iw1g",1e3:"_16lm1iw1h",1e4:"_16lm1iw1i",1e5:"_16lm1iw1j",1e6:"_16lm1iw1k",1e7:"_16lm1iw1l","1k":"_16lm1iw1m","10k":"_16lm1iw1n","100k":"_16lm1iw1o"};function Uc(o){let{rootClassName:e}=di();return $c.createElement("div",{...o,className:Z(`${e}Footer`,fi.relative,ho.flex,mr.row,o.className)})}var ve=G(require("react")),sn=require("react"),ef=require("react-dom");function mi(o){let e={};return Object.keys(o).forEach(t=>{e[t]=t}),e}function q(o){return o.slice(4,-1)}var Yc=G(require("react")),Ne=o=>{let e=o.size??"var(--infinite-icon-size)",t={flex:"none",width:e,height:e,fill:"currentColor",...o.style};return Yc.createElement("svg",{viewBox:"0 0 24 24",...o,style:t},o.children)};var gr=G(require("react")),qc=o=>gr.createElement(Ne,{...o},gr.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"}),gr.createElement("path",{d:"M4 18V15H2V20H22V18Z"}),gr.createElement("path",{d:"M20 14V18H2V20H22V14Z"}));var bl=G(require("react")),Xc=o=>bl.createElement(Ne,{...o},bl.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 yl=G(require("react")),Tl=o=>yl.createElement(Ne,{...o},yl.createElement("path",{d:"M19,10H5V8H19V10M19,16H5V14H19V16Z"}));var Sl=G(require("react")),Zc=o=>Sl.createElement(Ne,{...o},Sl.createElement("path",{d:"M6.5,2.27L20,10.14L6.5,18L5.5,16.27L16.03,10.14L5.5,4L6.5,2.27M20,20V22H5V20H20Z"}));var Cl=G(require("react")),Qc=o=>Cl.createElement(Ne,{...o},Cl.createElement("path",{d:"M5.5,4.14L4.5,5.86L15,12L4.5,18.14L5.5,19.86L19,12L5.5,4.14Z"}));var wl=G(require("react")),Jc=o=>wl.createElement(Ne,{...o},wl.createElement("path",{d:"M18.5,2.27L5,10.14L18.5,18L19.5,16.27L8.97,10.14L19.5,4L18.5,2.27M5,20V22H20V20H5Z"}));var vl=G(require("react")),eu=o=>vl.createElement(Ne,{...o},vl.createElement("path",{d:"M18.5,4.14L19.5,5.86L8.97,12L19.5,18.14L18.5,19.86L5,12L18.5,4.14Z"}));var Il=G(require("react")),tu=o=>Il.createElement(Ne,{...o},Il.createElement("path",{d:"M21,10H9V8H21V10M21,16H9V14H21V16M4,5H6V16H4V5M6,18V20H4V18H6Z"}));var Rl=G(require("react")),nu=o=>Rl.createElement(Ne,{...o},Rl.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 Nl=G(require("react"));var tt=G(require("react")),hr=require("react");var ru=require("react");var ou=require("react"),xl;function bo(){return xl||(xl=(0,ou.createContext)(null))}var J=()=>{let o=bo();return(0,ru.useContext)(o)};var iu=require("react");var au=()=>{let o=bo(),{state:e}=(0,iu.useContext)(o);return e};var yo=G(require("react")),Hn=require("react");function bb(o,e){if(typeof o!="object"||!o)return o;var t=o[Symbol.toPrimitive];if(t!==void 0){var n=t.call(o,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function yb(o){var e=bb(o,"string");return typeof e=="symbol"?e:String(e)}function Tb(o,e,t){return e=yb(e),e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}function lu(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function su(o){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lu(Object(t),!0).forEach(function(n){Tb(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):lu(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}function cu(o,e){var t={};for(var n in o)t[n]=e(o[n],n);return t}var Sb=(o,e,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=e[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},me=o=>{var e=t=>{var n=o.defaultClassName,r=su(su({},o.defaultVariants),t);for(var i in r){var a,l=(a=r[i])!==null&&a!==void 0?a:o.defaultVariants[i];if(l!=null){var s=l;typeof s=="boolean"&&(s=s===!0?"true":"false");var c=o.variantClassNames[i][s];c&&(n+=" "+c)}}for(var[u,d]of o.compoundVariants)Sb(u,r,o.defaultVariants)&&(n+=" "+d);return n};return e.variants=()=>Object.keys(o.variantClassNames),e.classNames={get base(){return o.defaultClassName.split(" ")[0]},get variants(){return cu(o.variantClassNames,t=>cu(t,n=>n.split(" ")[0]))}},e};var uu="_1eexc2a6";var du=me({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:[]}),pu="_12zfob1q _16lm1iw2 _16lm1iw1k _16lm1iw3b _16lm1iw3c _16lm1iw35",fu=me({defaultClassName:"_16lm1iw2 _16lm1iw25 _16lm1iw26 _16lm1iwh _16lm1iwf",variantClassNames:{visible:{true:"_12zfob19",false:"_12zfob1a"}},defaultVariants:{},compoundVariants:[]}),mu=me({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"]]}),gu=me({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"]]}),hu="_12zfob12u _16lm1iw22 _16lm1iw1z";var bu="_12zfob17",yu="_12zfob12q _16lm1iw1p _16lm1iw2h _16lm1iw2j _16lm1iw1",Tu=me({defaultClassName:"_12zfob12r _16lm1iw1 _16lm1iw23",variantClassNames:{disabled:{true:"_12zfob12s",false:"_12zfob12t"}},defaultVariants:{},compoundVariants:[]}),Pl=me({defaultClassName:"_12zfob12n _16lm1iw1p _16lm1iw2h _16lm1iw2k _16lm1iw1",variantClassNames:{active:{true:"_12zfob12o",false:"_12zfob12p"}},defaultVariants:{},compoundVariants:[]}),Su="_12zfob12m _16lm1iw1p _16lm1iw2h _16lm1iw2j",Cu=me({defaultClassName:"_12zfob127 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw32 _16lm1iw39",variantClassNames:{menuVisible:{true:"_12zfob128"},reserveSpaceWhenHidden:{true:"_12zfob129",false:"_12zfob12a"}},defaultVariants:{},compoundVariants:[[{menuVisible:!0,reserveSpaceWhenHidden:!1},"_12zfob12b"]]}),wu="_12zfob1b _16lm1iw2",vu="_16lm1iw1",Iu="_12zfob16",Ru=me({defaultClassName:"_12zfob12",variantClassNames:{align:{start:"_12zfob13",center:"_12zfob14",end:"_12zfob15"}},defaultVariants:{},compoundVariants:[]}),xu="_12zfob12l _16lm1iw35 _16lm1iw1 _16lm1iw1p _16lm1iw2h";var Tt="InfiniteIcon";var Pu="_6aunoi0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32 _16lm1iw2j";var Cb={transition:"width 0.25s, opacity 0.25s"};function To(o){let[e,t]=(0,Hn.useState)(!0),[n,r]=(0,Hn.useState)(0),{lineWidth:i=1,style:a,className:l,index:s}=o,c=s!=null&&s>0,u=o.size??16,d=Math.floor(u/4),p=[u-1*d,u-2*d,u-3*d],f={...Cb,borderTop:`${i}px solid currentColor`,...o.lineStyle,opacity:n};if((0,Hn.useEffect)(()=>{if(!e)return;let g=requestAnimationFrame(()=>{r(1)});return()=>{cancelAnimationFrame(g)}},[e]),(0,Hn.useLayoutEffect)(()=>{t(!0)},[]),!e)return null;let m={};return yo.createElement("div",{"data-name":"filter-icon",style:{...a,width:u},className:Z(l,Tt,Pu,`${Tt}-filter`)},c?yo.createElement("div",{"data-name":"index",style:m,className:bu},s):null,yo.createElement("div",{style:{width:p[0],...f}}),yo.createElement("div",{style:{width:p[1],...f}}),yo.createElement("div",{style:{width:p[2],...f}}))}var Dl=o=>{let{availableSize:e,items:t,minSize:n,maxSize:r}=o;if(e<0)throw"The provided availableSize cannot be negative!";let i=0,a=0,l=0,s=[],c=[];t.forEach((w,I)=>{let R=w.maxSize??r??void 0,x=w.minSize??n??void 0;s.push(x),c.push(R),w.size!=null&&(R!=null&&w.size>R&&(w.size=R),x!=null&&w.size<x&&(w.size=x));let E=w.flex==0?null:w.flex;if(w.size==null&&E==null)throw`Items must specify either a size or a flex property. Item at index ${I} doesn't have either of those.`;E!=null&&(l+=1),a+=E??0,i+=w.size??0});let u=o.computeSpecialSpaceDistribution?Math.max(e,0):Math.max(e-i,0),d=u/a,p={},f={},m=0;t.forEach((w,I)=>{if(w.flex!=null){let R=d*w.flex,x=w.maxSize??r??void 0,E=w.minSize??n??void 0,A=!1,M=0;x!=null&&R>x&&(p[I]=!0,A=!0,M=x),E!=null&&R<E&&(f[I]=!0,A=!0,M=E),A&&(m+=1,l-=1,a-=w.flex,u-=M)}}),m&&(d=u/a);let g=[],b=0,h=u,y=a,S=0,C=0,T=[];return{items:t.map((w,I)=>{let R={...w},x=w.maxSize??r??void 0,E=w.minSize??n??void 0,A=0,M=p[I],P=f[I],_=M||P,D=w.size??0;if(w.flex!=null){if(_)P&&(A=E),M&&(A=x);else{b+=1;let F=N=>(x!=null&&N>x&&(N=x),E!=null&&N<E&&(N=E),N);b===l?A=F(h):(A=F(Math.round(w.flex*d)),C+=A,h=u-C,y-=w.flex,d=h/y)}D=A,R.flexSize=A}return g.push(A),T.push(D),R.computedSize=D,S+=D,R}),flexSizes:g,minSizes:s,maxSizes:c,computedSizes:T,remainingSize:Math.round(e-S)}};function gi(o,e,t,n){return e!=null&&o<=e?{value:e,clamped:"min",diff:(o-e)*n}:t!=null&&o>=t?{value:t,clamped:"max",diff:(t-o)*n}:{value:o,clamped:!1,diff:0}}var Ml=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((x,E)=>(x[E]={...o.columnSizing[E]},x),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=o.dragHandlePositionAfter,a=o.dragHandlePositionAfter+1,l=o.items[i],s=o.items[a],c=l.id,u=s?.id,d=l.computedWidth,p=l.computedMinWidth,f=l.computedMaxWidth,m=l.computedFlex?"flex":"width",g=s?.computedWidth,b=s?.computedMinWidth,h=s?.computedMaxWidth,y=s?.computedFlex?"flex":"width",S=!1,C=!1,T=r>0?1:-1,{value:v,clamped:w,diff:I}=gi(d+r,p,f,T);if(o.shareSpaceOnResize){if(s==null)return n[c]={...n[c],[m]:v},C=w==="min",S=w==="max",{adjustedDiff:v-d,reservedWidth:t,columnSizing:n,minReached:C,maxReached:S,constrained:C||S};let{value:x,clamped:E,diff:A}=gi(g-r,b,h,T);if(w&&E&&(Math.abs(I)>Math.abs(A)?E=!1:w=!1),!(!w&&!E)){if(w){let M=gi(g-r-I,b,h,T);x=M.value,E=M.clamped,A=M.diff}else if(E){let M=gi(d+r+A,p,f,T);v=M.value,w=M.clamped,I=M.diff}}n[c]={...n[c],[m]:v},n[u]={...n[u],[y]:x},C=w==="min"||E==="min",S=w==="max"||E==="max"}else n[c]={...n[c],[m]:v},C=w==="min",S=w==="max";let R=v-d;return{adjustedDiff:R,reservedWidth:o.shareSpaceOnResize?t:t-R,columnSizing:n,minReached:C,maxReached:S,constrained:C||S}};function Du(o,e){return o+e}function wb(o){return Object.keys(o).reduce((t,n)=>(t[n]={...o[n]},t),{})}var Mu=o=>{let{availableSize:e,reservedWidth:t=0}=o,n=Object.keys(o.columnSizing).reduce((h,y)=>(h[y]={...o.columnSizing[y]},h),{});if(e<0)throw"The provided availableSize cannot be negative!";let r=o.dragHandleOffset,i=[...new Array(o.columnGroupSize)].map((h,y)=>o.dragHandlePositionAfter-y).reverse(),a=i.map(h=>o.items[h]),l=a.map(h=>h.computedWidth),s=a.map(h=>h.computedFlex?"flex":"width"),c=0,{computedSizes:u}=Dl({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(Du,0)+r-c,0)}),d=a.map((h,y)=>u[y]-h.computedWidth),p=!0,f=!0,m=!0,g=[];d.forEach((h,y)=>{let S=a[y];if(!S.resizable){g.push(0);return}let C=s[y],T=l[y],v=wb(n),{maxReached:w,minReached:I,constrained:R,adjustedDiff:x}=Ml({availableSize:o.availableSize,reservedWidth:o.reservedWidth,dragHandleOffset:h,dragHandlePositionAfter:i[y],shareSpaceOnResize:!1,items:o.items,columnSizing:v});n[S.id]={...v[S.id],[C]:T+x},g.push(x),w||(f=!1),I||(p=!1),R||(m=!1)});let b=g.reduce(Du,0);return{minReached:p,maxReached:f,constrained:m,adjustedDiffs:g,adjustedDiff:b,columnSizing:n,reservedWidth:t-b}};var hi;function Sn(){if(hi!=null)return hi;let o=we().document??null;if(!o)return 0;let e=o.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",o.body.appendChild(e);let t=o.createElement("div");return e.appendChild(t),hi=e.offsetWidth-t.offsetWidth,e.parentNode?.removeChild(e),hi}var Eu=["start",void 0,"end"],Au=(o,e)=>(e&&Object.keys(e).length>0&&o.sort((t,n)=>{let r=e[t],i=e[n];return r===!0&&(r="start"),i===!0&&(i="start"),r==i?0:Eu.indexOf(r)-Eu.indexOf(i)}),o);function _u(o,e,...t){let n=e;return t.forEach(r=>{for(let i in r)r.hasOwnProperty(i)&&o(r[i],i)&&(n[i]=r[i])}),n}function El(o,...e){return _u(t=>t!=null,o,...e)}function Ou(o,e,...t){return _u((n,r)=>!(r in o),e,...t)}var bi=Object.freeze({}),vb={string:bi,number:{}};function Al(o,e){let t=e.default||bi;return o.type===void 0?t:o.type===null?bi:typeof o.type=="string"?e[o.type]||vb[o.type]||bi:o.type.reduce((n,r)=>Object.assign(n,e[r]),{})}var yi=!0,Ib=!0,Rb=!0,xb="string",So="unknown",Pb=gn("getComputedVisibleColumns"),Db=(o,e,t)=>o[t]!==!1,_l=(o,e)=>{if(!e)return!1;let t=e[o];return t==="start"||t===!0?"start":t==="end"?"end":!1},Fu=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,scrollbarWidth:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,pinnedStartMaxWidth:c,pinnedEndMaxWidth:u,filterValue:d,sortable:p,sortInfo:f,multiSort:m,filterTypes:g=Cn,viewportReservedWidth:b,resizableColumns:h,draggableColumns:y,columnDefaultDraggable:S,columnOrder:C,columnPinning:T,editable:v,columnDefaultEditable:w,columnDefaultFilterable:I,columnDefaultGroupable:R,columnDefaultSortable:x,columnSizing:E,columnTypes:A,columnVisibility:M,columnVisibilityAssumeVisible:P,groupBy:_})=>{let D=0,F={};_.forEach((V,Y)=>{V.field&&(F[V.field]=Y)});let N=(d||[]).reduce((V,Y)=>{let{id:ce,field:Te}=Y;return Te&&(V[Te]=Y),ce&&(V[ce]=Y),V},{}),W=Au(C===!0?Object.keys(o):C,T),L=W.filter(V=>o[V]?Db(M,P,V):(Pb(`Column with id "${V}" specified in columnOrder array cannot be found in the columns map.`),!1)),X=new Map,le=L.map((V,Y)=>{let ce=o[V];return X.set(V,Y),ce}),ae=(f??[]).reduce((V,Y,ce)=>(Y.id?V[Y.id]={sortInfo:Y,index:ce}:Y.field&&(V[Y.field]={sortInfo:Y,index:ce}),V),{});function H(V){let Y=o[V],ce=Al(Y,A),Te={minWidth:ce?.minWidth,maxWidth:ce?.maxWidth,width:ce?.defaultWidth,flex:ce?.defaultFlex},Qe=El({width:Y?.defaultWidth,flex:Y?.defaultFlex,minWidth:Y?.minWidth,maxWidth:Y?.maxWidth},E[V]);Qe.width!=null&&delete Te.flex,Qe.flex!=null&&delete Te.width,Qe=El(Te,Qe);let z=Qe.flex??void 0,We=Qe.minWidth??Y?.minWidth??t,jt=Qe.maxWidth??Y?.maxWidth??n,bt=z!=null?void 0:Qe.width??(i?void 0:r);return!bt&&z==null&&(i?z=i:bt=We),{size:bt,flex:z,minSize:We,maxSize:jt}}let U=Dl({availableSize:Math.max(e.width-(b??0)-(a??Sn()),0),maxSize:n,minSize:t,items:L.map(H)}),{computedSizes:ie,flexSizes:se,minSizes:pe,maxSizes:fe}=U,ne=[],ge=[],K=[],k=[];k.length=L.length;let B=new Map,O=new Map,oe=0,te=0,he=0,de=null,ee=[],j=0,re=0,Re=0;le.forEach((V,Y)=>{let ce=L[Y],Te=ie[Y],Qe=ee[Y]=_l(ce,T);Qe==="start"?j+=Te:Qe==="end"?Re+=Te:re+=Te});let xe=e.width-Re,_e=[],Be=new Map;L.forEach((V,Y)=>{let ce=le[Y];Be.set(V,ce)});let Oe=[];Object.keys(o).forEach(V=>{let Y=o[V];Oe.push(V),Be.has(V)||Be.set(V,Y)});let Ze=new Map;Be.forEach((V,Y)=>{let ce=X.get(Y);ce==null&&(ce=-1);let Te=ce!=-1,Qe=L[ce+1],z=Al(V,A),We=ce,jt=ae[Y]?ae[Y]:V.field?ae[V.field]??null:null,bt=jt?.sortInfo??null,Pt=!!bt,$t=Pt&&bt.dir===1,Qa=Pt&&!$t,Ja=jt?.index??-1,ir=Te?{}:H(Y),Qr=Te?ie[ce]:ir.size||0,Ae=Te&&se[ce]||null,it=Te?pe[ce]||0:ir.minSize||0,nn=Te?fe[ce]||1e4:ir.maxSize||1e4,ke=Te?_l(Y,T):!1,mo=Te?ce===L.length-1:!1,Jr=We,kh=Te?ke==="start"?te:ke==="end"?he:D-te:0;ke=="start"?Jr=Te?We:-1:ke==="end"?Jr=Te?We-(ne.length+K.length):-1:Jr=Te?We-ne.length:-1;let zh=Te?ke==="start"||ke===!1?D:xe+he:-1,Vh=Te?ke!==de:!1,Gh=Te?mo||ke!==_l(Qe,T):!1,hc=V.cssEllipsis??z.cssEllipsis??l,Hh=V.headerCssEllipsis??z.cssEllipsis??V.cssEllipsis??z.headerCssEllipsis??s??hc,ei=Te&&(N[Y]||V.field||V.groupByForColumn)&&(N[Y]||N[V.field||V.groupByForColumn])||null,Kh=V.defaultFilterable??z.defaultFilterable??I??!0,Bh=v??V.defaultEditable??z.defaultEditable??w??!1,el=V.dataType||z.dataType||(Array.isArray(V.type)?V.type[0]:V.type)||xb,Wh=V.sortType||z.sortType||el,bc=V.filterType||z.filterType||el,yc=!1;if(ei!=null&&!ei.disabled){let ol=g[bc];ol&&(!ol.emptyValues||!ol.emptyValues.includes(ei.filter.value))&&(yc=!0)}let Vn=V.field??z.field,Tc=V.valueGetter??z.valueGetter,tl=V.defaultGroupable??z.defaultGroupable??R??!!Vn;Vn||(tl=!1),V.groupByForColumn&&(tl=!1);let nl=V.defaultSortable??z.defaultSortable;nl==null&&!V.groupByForColumn&&Vn==null&&Tc==null&&(nl=!1);let Sc=Vn?F[Vn]!==void 0:!1,jh=Sc?F[Vn]:void 0,$h=p??nl??x??yi,Uh=V.resizable??z.resizable??h??Ib,je={colType:z,align:z.align,headerAlign:z.headerAlign,computedVisible:Te,verticalAlign:z.verticalAlign,defaultHiddenWhenGroupedBy:z.defaultHiddenWhenGroupedBy,valueGetter:Tc,valueFormatter:z.valueFormatter,renderValue:z.renderValue,render:z.render,style:z.style,className:z.className,contentFocusable:z.contentFocusable,renderMenuIcon:z.renderMenuIcon,renderSortIcon:z.renderSortIcon,renderRowDetailIcon:z.renderRowDetailIcon,renderSelectionCheckBox:z.renderSelectionCheckBox,renderHeaderSelectionCheckBox:z.renderHeaderSelectionCheckBox,headerStyle:z.headerStyle,headerClassName:z.headerClassName,columnGroup:z.columnGroup,getValueToEdit:z.getValueToEdit,getValueToPersist:z.getValueToPersist,shouldAcceptEdit:z.shouldAcceptEdit,field:Vn,...V,components:{...z.components,...V.components},computedResizable:Uh,computedMinWidth:it,computedMaxWidth:nn,computedFlex:Ae,computedDataType:el,computedEditable:Bh,computedSortType:Wh,computedFilterType:bc,cssEllipsis:hc,headerCssEllipsis:Hh,computedFilterValue:ei,computedFiltered:yc,computedFilterable:Kh,computedGroupable:tl,computedGroupedBy:Sc,computedGroupedByIndex:jh,computedWidth:Qr,computedAbsoluteOffset:zh,computedPinningOffset:kh,computedVisibleIndexInCategory:Jr,computedOffset:D,computedSortable:$h,computedSortInfo:bt,computedSortIndex:Ja,computedMultiSort:m,computedSorted:Pt,computedSortedAsc:$t,computedSortedDesc:Qa,computedVisibleIndex:We,computedPinned:ke,computedDraggable:y??V.defaultDraggable??S??Rb,computedFirstInCategory:Vh,computedLastInCategory:Gh,computedFirst:ce===0,computedLast:mo,id:Y,header:V.header??z.header??V.name??V.field};Te&&(D+=Qr,B.set(je.id,je),k[ce]=je,ke==="start"&&(ne.push(je),te+=je.computedWidth),ke==="end"&&(ge.push(je),he+=je.computedWidth),ke||(K.push(je),oe+=je.computedWidth),de=ke),je.groupByForColumn&&(je.computedSortType=V.sortType||z.sortType||So,_e.push(je)),O.set(je.id,je),je.field&&!je.groupByForColumn&&!Ze.has(je.field)&&Ze.set(je.field,je)}),_e.forEach(V=>{V.computedSortable=Nu(V,{fieldsToColumn:Ze,sortable:p,columnDefaultSortable:x})});let et=new Map;Oe.forEach(V=>{let Y=O.get(V);Y&&et.set(V,Y)}),O.forEach(V=>{et.has(V.id)||et.set(V.id,V)});let ut=c!=null?Math.min(c,te):te,Ft=u!=null?Math.min(u,he):he;return{computedRemainingSpace:e.width-(j+Re+re),computedPinnedStartColumnsWidth:te,computedPinnedEndColumnsWidth:he,computedUnpinnedColumnsWidth:oe,computedColumnOrder:W,computedPinnedStartColumns:ne,computedPinnedEndColumns:ge,computedUnpinnedOffset:te,computedPinnedEndOffset:te+oe,computedUnpinnedColumns:K,computedVisibleColumns:k,computedColumnsMap:O,computedColumnsMapInInitialOrder:et,computedVisibleColumnsMap:B,computedPinnedEndWidth:Ft,computedPinnedStartWidth:ut,renderSelectionCheckBox:k.reduce((V,Y)=>V||!!Y.renderSelectionCheckBox,!1),fieldsToColumn:Ze}};function Nu(o,e){let{sortable:t,fieldsToColumn:n,columnDefaultSortable:r}=e;if(t)return t;let i=o.defaultSortable??o.colType.defaultSortable;if(i!=null)return i;let a=r??yi;return o.computedSortType!==So&&a?!0:s=>{let{column:c,api:u}=s,d=c.groupByForColumn||[];return d!=null&&!Array.isArray(d)&&(d=[d]),(d||[]).reduce((p,f)=>{if(!p)return!1;let m=f.field||f.groupField,g;if(m){let b=n.get(m),h=b?u.getColumnApi(b.id):void 0;b&&h?g=h.isSortable():g=!1}return g===void 0&&f.valueGetter&&(g=!0),g??r??yi},!0)}}function st(o,e){let{getComputed:t,getState:n,actions:r,api:i}=e;typeof o=="number"&&(o=t().computedVisibleColumns[o]);let a=typeof o=="string"?t().computedColumnsMap.get(o):o;if(!a)return null;let l={getCellValuesByPrimaryKey(s){return e.api.getCellValues({columnId:a.id,primaryKey:s})},getCellValueByPrimaryKey(s){return l.getCellValuesByPrimaryKey(s)?.value??null},toggleContextMenu(s){n().columnMenuVisibleForColumnId===a.id?this.hideContextMenu():this.showContextMenu(s)},toggleFilterOperatorMenu(s){n().filterOperatorMenuVisibleForColumnId===a.id?this.hideFilterOperatorMenu():this.showFilterOperatorMenu(s)},showFilterOperatorMenu(s){n().onFilterOperatorMenuClick({target:s,column:a})},hideFilterOperatorMenu(){i.hideFilterOperatorMenu()},showContextMenu(s){n().onColumnMenuClick({target:s,column:a})},hideContextMenu(){r.columnMenuVisibleForColumnId=null},isVisible(){return t().computedVisibleColumnsMap.has(a.id)},setVisible(s){i.setVisibilityForColumn(a.id,s)},toggleSort(s={multiSortBehavior:"replace"}){return i.toggleSortingForColumn(a.id,s)},isSortable(){let{computedColumnsMap:s}=t();return typeof a.computedSortable=="function"?a.computedSortable({api:i,columnApi:l,column:a,columns:s}):a.computedSortable},getSortDir(){return i.getSortingForColumn(a.id)},setFilter(s){return i.setColumnFilter(a.id,s)},clearFilter(){return i.clearColumnFilter(a.id)},getSortInfo(){return i.getSortInfoForColumn(a.id)},setSort(s){s?i.setSortingForColumn(a.id,s):i.setSortInfoForColumn(a.id,null)},clearSort(){this.setSort(null)}};return l}function Kn(o,e,t){let n=typeof o=="string"?e.getComputed().computedColumnsMap.get(o):o,{api:r,getComputed:i,getDataSourceState:a,actions:l,dataSourceActions:s,dataSourceApi:c}=e,u=a(),{allRowsSelected:d,someRowsSelected:p,selectionMode:f}=u,m=i(),g=n.header&&typeof n.header!="function"?n.header:n.name||n.id||"";if(typeof n.header=="function"){let b=st(n.id,{...e,actions:l,dataSourceActions:s,dataSourceApi:c});g=n.header({horizontalLayoutPageIndex:null,column:n,columnApi:b,dataSourceApi:c,renderLocation:t,dragging:!1,columnsMap:m.computedColumnsMap,columnSortInfo:n.computedSortInfo,columnFilterValue:n.computedFilterValue,filtered:n.computedFiltered,allRowsSelected:d,someRowsSelected:p,selectionMode:f,api:r,renderBag:{header:g}})??null}return g}var Lu=G(require("react"));var Ti=`${lt}HeaderCell__filter`,Ol=`${lt}HeaderCell__filterOperator`,Fl=Lu.createContext(null);var Mb=`${Ti}__input`,Si=o=>o.stopPropagation();function ku(o){let{filterOperatorMenuVisibleForColumnId:e}=au(),{column:t}=br(),n=o.filterEditor,r=o.filterOperatorSwitch,[i,a]=(0,hr.useState)(!1),l=tt.useCallback(()=>{a(!0)},[]),s=tt.useCallback(()=>{a(!1)},[]),c=e===t.id||i;return tt.createElement("div",{onPointerUp:Si,onPointerDown:Si,onFocus:l,onBlur:s,className:`${Ti} ${Pl({active:c})}`,style:{height:o.columnHeaderHeight}},tt.createElement(Fl.Provider,{value:o},tt.createElement(r,null),tt.createElement(n,null)))}function zu(){let{columnApi:o,disabled:e,operator:t}=Co(),n=t?.components?.Icon??To;return tt.createElement("div",{"data-name":"filter-operator","data-disabled":e,onMouseDown:r=>{r.stopPropagation(),!e&&o.toggleFilterOperatorMenu(r.target)},className:Z(Ol,yu,e?`${Ol}--disabled`:"")},tt.createElement(n,{size:20,className:`${Tu({disabled:e})}`}))}function Vu(){return tt.createElement("div",{onPointerUp:Si,onPointerDown:Si,className:`${Ti} ${Pl({active:!1})} ${kc["50%"]}`})}function Co(){let o=J(),{column:e,columnApi:t}=br(),n=Kn(e,o,"column-filter"),r=tt.useContext(Fl),{columnFilterType:i,filterTypes:a,columnFilterValue:l}=r,s=a[i],[c,u]=(0,hr.useState)(l?.filter.value??""),d=tt.useCallback(b=>{u(b),r.onChange(b)},[r.onChange]),p=tt.useCallback(()=>{o.api.clearColumnFilter(e.id)},[e.id]),f=tt.useCallback(()=>{o.api.removeColumnFilter(e.id)},[e.id]);(0,hr.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:o.api,column:e,columnFilterValue:l,columnApi:t,operatorName:g,operator:m,value:c,disabled:l?.disabled,filterType:s,filterTypes:a,filterTypeKey:i,filtered:e.computedFiltered,setValue:d,clearValue:p,removeColumnFilter:f,ariaLabel:`Filter for ${n}`,className:`${hu} ${Mb}`}}function wo(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Co();return Nl.createElement("input",{"data-xxx":!0,"aria-label":o,type:"text",disabled:r,value:e,onChange:i=>{t(i.target.value)},className:n})}function Ci(){let{ariaLabel:o,value:e,setValue:t,className:n,disabled:r}=Co();return Nl.createElement("input",{"aria-label":o,type:"number","data-yyy":!0,disabled:r,value:e??"",onChange:i=>{let a=isNaN(i.target.valueAsNumber)?i.target.value:i.target.valueAsNumber;t(a)},className:n})}function Eb(){return{string:{label:"Text",emptyValues:[""],defaultOperator:"includes",components:{FilterEditor:wo},operators:[{name:"includes",components:{Icon:qc},label:"Includes",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&typeof t=="string"&&e.toLowerCase().includes(t.toLowerCase())},{label:"Equals",components:{Icon:Tl},name:"eq",fn:({currentValue:e,filterValue:t})=>typeof e=="string"&&e===t},{name:"startsWith",components:{Icon:nu},label:"Starts With",fn:({currentValue:e,filterValue:t})=>e.startsWith(t)},{name:"endsWith",components:{Icon:Xc},label:"Ends With",fn:({currentValue:e,filterValue:t})=>e.endsWith(t)}]},number:{label:"Number",emptyValues:["",null,void 0],defaultOperator:"eq",components:{FilterEditor:Ci},operators:[{label:"Equals",components:{Icon:Tl},name:"eq",fn:({currentValue:e,filterValue:t})=>e==t},{label:"Not Equals",components:{Icon:tu},name:"neq",fn:({currentValue:e,filterValue:t})=>e!=t},{name:"gt",label:"Greater Than",components:{Icon:Qc},fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>t},{name:"gte",components:{Icon:Zc},label:"Greater Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e>=t},{name:"lt",components:{Icon:eu},label:"Less Than",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<t},{name:"lte",components:{Icon:Jc},label:"Less Than or Equal",fn:({currentValue:e,filterValue:t,emptyValues:n})=>n.includes(e)?!0:e<=t}]}}}var Cn=Eb();function wi(o,e,t,n){let r=[...e],i={filtered:o.computedFiltered,first:o.computedFirst,last:o.computedLast,groupByField:!!o.groupByForColumn,firstInCategory:o.computedFirstInCategory,lastInCategory:o.computedLastInCategory,pinned:o.computedPinned||!1,cellSelected:n.cellSelected||!1,rowSelected:n.rowSelected??"null",rowActive:n.rowActive,dragging:n.dragging,insideDisabledDraggingPage:n.insideDisabledDraggingPage,firstRow:n.firstRow??!1,firstRowInHorizontalLayoutPage:n.firstRowInHorizontalLayoutPage??!1,rowDisabled:n.rowDisabled,groupRow:n.groupRow,groupCell:n.groupCell,treeNode:n.treeNode,verticalAlign:n.verticalAlign,align:n.align,zebra:n.zebra},a=t(i);return r.push(a),o.computedFirst&&r.push(...e.map(l=>`${l}--first`)),o.groupByForColumn&&r.push(...e.map(l=>`${l}--group-column`)),o.computedLast&&r.push(...e.map(l=>`${l}--last`)),o.computedFirstInCategory&&r.push(...e.map(l=>`${l}--first-in-category`)),o.computedLastInCategory&&r.push(...e.map(l=>`${l}--last-in-category`)),n.rowSelected&&r.push(...e.map(l=>`${l}--row-selected`)),n.cellSelected&&r.push(...e.map(l=>`${l}--cell-selected`)),n.firstRow&&r.push(...e.map(l=>`${l}--first-row`)),n.firstRowInHorizontalLayoutPage&&r.push(...e.map(l=>`${l}--first-row-in-horizontal-layout-page`)),n.rowDisabled&&r.push(...e.map(l=>`${l}--disabled`)),n.treeNode&&r.push(...e.map(l=>`${l}--tree-node ${l}-tree-${n.treeNode}-node`)),n.groupRow&&(r.push(...e.map(l=>`${l}--group-row`)),r.push(...e.map(l=>`${l}--${n.rowExpanded?"group-row-expanded":"group-row-collapsed"}`))),o.computedPinned?r.push(...e.map(l=>`${l}--pinned-${o.computedPinned}`)):r.push(...e.map(l=>`${l}--unpinned`)),r.filter(Boolean).join(" ")}var Do=require("react");function wn(o,e){let t=o;if(!t)return null;if(t&&t.matches(e))return t;for(;t=t.parentElement;)if(t.matches(e))return t;return null}function Gu(o,e,t){let n=o;if(!n)return null;if(n&&n.matches(e))return n;for(;n=n.parentElement;){if(n.matches(e))return n;if(n===t)return null}return null}var $={currentColumnTransformX:"var(--_16hkbkc0)",y:"var(--_16hkbkc1)",currentFlashingBackground:"var(--_16hkbkc2)",currentFlashingDuration:"var(--_16hkbkc3)",activeCellRowOffset:"var(--_16hkbkc4)",activeCellRowOffsetX:"var(--_16hkbkc5)",activeCellRowHeight:"var(--_16hkbkc6)",activeCellOffsetX:"var(--_16hkbkc7)",activeCellOffsetY:"var(--_16hkbkc8)",scrollTopForActiveRow:"var(--_16hkbkc9)",scrollLeftForActiveRowWhenHorizontalLayout:"var(--_16hkbkca)",activeCellColWidth:"var(--_16hkbkcb)",activeCellColOffset:"var(--_16hkbkcc)",columnReorderEffectDurationAtIndex:"var(--_16hkbkcd)",columnWidthAtIndex:"var(--_16hkbkce)",columnOffsetAtIndex:"var(--_16hkbkcf)",columnOffsetAtIndexWhileReordering:"var(--_16hkbkcg)",columnVisibilityAtIndex:"var(--_16hkbkch)",columnZIndexAtIndex:"var(--_16hkbkci)",pinnedStartWidth:"var(--_16hkbkcj)",pinnedEndWidth:"var(--_16hkbkck)",pinnedEndOffset:"var(--_16hkbkcl)",computedVisibleColumnsCount:"var(--_16hkbkcm)",baseZIndexForCells:"var(--_16hkbkcn)",bodyWidth:"var(--_16hkbkco)",bodyHeight:"var(--_16hkbkcp)",scrollbarWidthHorizontal:"var(--_16hkbkcq)",scrollbarWidthVertical:"var(--_16hkbkcr)",scrollLeft:"var(--_16hkbkcs)",scrollTop:"var(--_16hkbkct)"};var Hu="true",ue={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)"}}},Ku="column-header-height";var Bu=`.${Fe.rootClassName}`;function Ll(o){return wn(o,Bu)}var Wu=q($.scrollLeft),Ab=q($.scrollTop),_b=q($.columnWidthAtIndex),kl=q($.columnOffsetAtIndex),ju=q($.columnReorderEffectDurationAtIndex),Ob=q($.columnOffsetAtIndexWhileReordering),Fb=q($.columnVisibilityAtIndex),Nb=q($.columnZIndexAtIndex);function Yt(o,e,t){let n=t?Ll(t):document.querySelector(Bu);Lb(o,e,n)}function Lb(o,e,t){if(t){let n=o,r=$[n]?q($[n]):o;t.style.setProperty(r,`${e}`)}}function vo(o,e){if(e)for(var t in o){let n=$[t]?q($[t]):t,r=`${o[t]}`;e.style.setProperty(n,r)}}function zl(o,e,t){Yt(`${kl}-${o.computedVisibleIndex}`,o.computedPinned?`calc( ${o.computedAbsoluteOffset+e}px + var(${Wu}))`:`${o.computedAbsoluteOffset+e}px`,t)}function Vl(o,e,t){Yt(`${Nb}-${o}`,`${e}`,t)}function Io(o,e,t){Yt(`${Ob}-${o}`,typeof e=="number"?`calc( var(${kl}-${o}) + ${e}px )`:e,t)}function yr(o,e,t){Yt(`${Fb}-${o}`,e,t)}function vi(o,e,t){Yt(`${ju}-${o}`,t??"",e)}function Gl(o,e){let t=`${ju}-${o}`;Yt(t,ue.components.Cell.reorderEffectDuration,e)}var Se={columnWidths:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${_b}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Yt(this.varName.get(o),e,t)}},columnOffsets:{get(o){return`var(${this.getVarName(o)})`},getVarName(o){return this.varName.get(o)},varName:{get(o){return`${kl}-${o}`}},set(o,e,t){e=typeof e=="number"?e+"px":e,Yt(this.varName.get(o),e,t)}}};function $u(o,e){vo({[Wu]:`${o.scrollLeft}px`,[Ab]:`${o.scrollTop}px`},e)}var Uu="_16lm1iw1",Yu="_1yeub2v0 _16lm1iw1 _16lm1iw1p _16lm1iw2f _16lm1iw0",qu="_1yeub2vs",Xu="_1yeub2vr",Zu=me({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 Hl="_1yeub2vp";var SR=me({defaultClassName:"_1yeub2vl",variantClassNames:{pinned:{start:"_1yeub2vm",end:"_1yeub2vn",false:"_1yeub2vo"}},defaultVariants:{},compoundVariants:[]});var Kl=o=>{let e=0;return(...t)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{e=0,o(...t)})}};var Tr={bodyWidth:{name:q(ue.runtime.bodyWidth),value:""},totalVisibleColumnsWidthValue:{name:q(ue.runtime.totalVisibleColumnsWidthValue),value:""},totalVisibleColumnsWidthVar:{name:q(ue.runtime.totalVisibleColumnsWidthVar),value:""},visibleColumnsCount:{name:q(ue.runtime.visibleColumnsCount),value:""},browserScrollbarWidth:{name:q(ue.runtime.browserScrollbarWidth),value:""}},kb=q($.scrollbarWidthHorizontal),Qu=q($.scrollbarWidthVertical),zb=q($.columnWidthAtIndex),Vb=q($.columnZIndexAtIndex),Ju=q($.scrollLeft),Gb=q($.activeCellColWidth),ed=q($.activeCellColOffset),rd=q($.baseZIndexForCells),Hb=q($.pinnedStartWidth),td=q($.bodyWidth),Kb=q($.bodyHeight),nd=q($.pinnedEndOffset),od=q($.pinnedEndWidth),Bb=q($.computedVisibleColumnsCount);function Bl(o,e){let t="auto",n=o.computedVisibleIndex;return o.computedPinned?o.computedPinned==="start"?t=e.pinnedStartColsCount-o.computedVisibleIndexInCategory:o.computedPinned==="end"&&(t=e.visibleColsCount+o.computedVisibleIndexInCategory):t=-n*10,typeof t=="number"?`calc( var(${rd}) `+(t<0?"-":"+")+` ${Math.abs(t)} )`:"auto"}function id(o){let e=Sn(),{computed:t,state:n,actions:r,getState:i}=J(),{focused:a,focusedWithin:l,domRef:s,scrollerDOMRef:c,onBlurWithin:u,onFocusWithin:d,onSelfFocus:p,onSelfBlur:f,bodySize:m,activeCellIndex:g,wrapRowsHorizontally:b}=n,{computedPinnedStartColumnsWidth:h,computedPinnedEndColumnsWidth:y,computedPinnedStartColumns:S,computedPinnedEndColumns:C,computedVisibleColumns:T,computedUnpinnedColumnsWidth:v,scrollbars:w}=t,I=[],R=T.reduce((D,F)=>{let N=F.computedVisibleIndex;D[Se.columnWidths.varName.get(N)]=F.computedWidth+"px",D[Se.columnOffsets.varName.get(N)]=F.computedPinned==="start"?`calc( ${F.computedOffset}px + var(${Ju}) )`:F.computedPinned==="end"?`calc( var(${nd}) ${I.length?"+":""} ${I.map(L=>Se.columnWidths.get(L.computedVisibleIndex)).join(" + ")} + var(${Ju}) )`:`${F.computedOffset}px`;let W=Bl(F,{pinnedStartColsCount:S.length,visibleColsCount:T.length});return D[`${Vb}-${N}`]=`${W}`,F.computedPinned==="end"&&I.push(F),D},{});if(m.width&&(R[Tr.browserScrollbarWidth.name]=`${Sn()}px`),R[Tr.bodyWidth.name]=`calc(${$.bodyWidth} - ${$.scrollbarWidthVertical})`,R[Tr.totalVisibleColumnsWidthValue.name]=`${h+y+v}px`,R[Tr.totalVisibleColumnsWidthVar.name]=`calc(${T.map((D,F)=>`var(${zb}-${F})`).join(" + ")})`,R[Tr.visibleColumnsCount.name]=T.length,g!=null){R[Gb]=Se.columnWidths.get(g[1]);let D=Se.columnOffsets.get(g[1]);if(n.brain.isHorizontalLayoutBrain){let F=n.brain.getPageIndexForRow(g[0]);R[ed]=F?`calc( ${ue.runtime.totalVisibleColumnsWidthVar} * ${F} + ${D})`:D}else R[ed]=D}R[Bb]=T.length,R[kb]=w.horizontal?`${e}px`:"0px",R[Qu]=w.vertical?`${e}px`:"0px",R[Hb]="calc( "+S.map(D=>Se.columnWidths.get(D.computedVisibleIndex)).join(" + ")+")",R[od]="calc( "+C.map(D=>Se.columnWidths.get(D.computedVisibleIndex)).join(" + ")+")",R[rd]=T.length*10,R[nd]=`calc( var(${td}) - var(${od}) - var(${Qu}) )`,R[td]=`${m.width}px`,R[Kb]=`${m.height}px`;let x=Kl(D=>{r.focused=D}),E=Kl(D=>{r.focusedWithin=D}),P={...o,onFocus:D=>{if(o?.onFocus?.(D),D.target===s.current||D.target===c.current){if(i().focused)return;x(!0),p?.(D),l&&(E(!1),u?.(D));return}l||(E(!0),d?.(D))},onBlur:D=>{if(o?.onBlur?.(D),D.target===s.current||D.target===c.current){if(!i().focused)return;x(!1),f?.(D),l&&(E(!1),u?.(D));return}s.current?.contains(D.relatedTarget)||(E(!1),u?.(D))}},_=Z(qt,Yu,b?`${qt}--horizontal-layout`:null,P?.className,h?`${qt}--has-pinned-start ${Xu}`:null,y?`${qt}--has-pinned-end ${qu}`:null,a?`${qt}--focused`:null,l?`${qt}--focused-within`:null,a&&n.focusedClassName?n.focusedClassName:null,l&&n.focusedWithinClassName?n.focusedWithinClassName:null,t.computedPinnedStartOverflow?`${qt}--has-pinned-start-overflow`:null,t.computedPinnedEndOverflow?`${qt}--has-pinned-end-overflow`:null,Zu({horizontalLayout:!!b,hasPinnedStart:!!h,hasPinnedEnd:!!y,focused:a,focusedWithin:l}));return P.className=_,P.style={...o?.style,...R},a&&n.focusedStyle&&Object.assign(P.style,n.focusedStyle),l&&n.focusedWithinStyle&&Object.assign(P.style,n.focusedWithinStyle),P}var md=G(Bn());function Ii(o){return o.map(e=>e instanceof vn?e:new vn(null,[e]))}var vn=class o{constructor(e,t=[]){this.__operands=[];this.__operation=null;this.__operands=t,this.__operation=e}add(...e){return new o("+",[this,...e])}subtract(...e){return new o("-",[this,...e])}minus(...e){return this.subtract(...e)}multiply(...e){return new o("*",[this,...e])}divide(...e){return new o("/",[this,...e])}__get(e){let{__operation:t,__operands:n}=this,r=n.map(a=>Wb(a,this)).join(` ${t} `);return(n.length<=1?!0:e?.__operation==="+"||e?.__operation==="-")?r:`(${r})`}done(){let e=this.__get();return`calc${e.startsWith("(")&&e.endsWith(")")?e:`(${e})`}`}};function Wb(o,e){return typeof o=="string"||typeof o=="number"?`${o}`:e?o.__get(e):o.done()}var jb=(...o)=>new vn("+",Ii(o)),ld=(...o)=>new vn("-",Ii(o)),$b=(...o)=>new vn("*",Ii(o)),Ub=(...o)=>new vn("/",Ii(o)),Sr={add:jb,subtract:ld,minus:ld,multiply:$b,divide:Ub};var Wn=(o,e,t)=>{if(o=[...o],e===t||o[e]===void 0||o[t]===void 0)return o;let n=o[e];return t<e,o.splice(e,1),o.splice(t,0,n),o};var Le=we().requestAnimationFrame||(o=>setTimeout(o,16)),Lt=we().cancelAnimationFrame||(o=>clearTimeout(o));var sd=o=>{let e=null,t=null;return{stop(){e!==null&&Lt(e),t!=null&&Lt(t)},scroll(n){e!==null&&Lt(e),t!=null&&Lt(t);let r={offset:100,scrollAmountsPerRaf:[1,1,2,4,6,8,11,15],...o,...n},i=this;function a(){let s=r.scrollOffsetStart+r.offset-r.mousePosition.clientX;if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft-p,e=Le(()=>{i.scroll(n)}),!0}function l(){let s=r.mousePosition.clientX-(r.scrollOffsetEnd-r.offset);if(!(s>0&&s<=r.offset))return!1;let u=r.scrollAmountsPerRaf.length,d=Math.round(r.offset/u),p=0;for(let f=0;f<u;f++)s>(f+1)*d&&(p=r.scrollAmountsPerRaf[f]);return n.scrollLeft=n.scrollLeft+p,t=Le(()=>{i.scroll(n)}),!0}return!!(a()||l())}}};var Ge=class o{constructor(e){this.top=0;this.left=0;this.left=e.left,this.top=e.top}static clone(e){return new o(e)}static from(e){return new o(e)}shift(e){return e.top!=null&&(this.top+=e.top),e.left!=null&&(this.left+=e.left),this}getDistanceToPoint(e){let t=e.top-this.top,n=e.left-this.left;return{top:t,left:n}}};function cd(o,e){let t=Math.atan2(o.top-e.top,o.left-e.left);return t<=0&&(t=2*Math.PI+t),t}function ud(o,e){return Math.sqrt((e.top-o.top)**2+(e.left-o.left)**2)}function Yb(o,e,t){let n=cd(o,t),r=cd(e,t);return n===r?ud(t,e)-ud(t,o):n-r}function dd(o){if(o.length<3)return o;let[...e]=o,t={top:0,left:0};return o.forEach(n=>{t.top+=n.top,t.left+=n.left}),t.top/=o.length,t.left/=o.length,e.sort((n,r)=>Yb(n,r,t)),e}function qb(o){if(o.length<2)return!1;let e=o[0].left,t=o[0].top,n={left:!1,top:!1};for(let r=1,i=o.length;r<i;r++){if(n.left&&n.top)return!1;o[r].left!==e&&(n.left=!0),o[r].top!==t&&(n.top=!0)}return!(n.left&&n.top)}function Xb(o,e){if(o.length<2)return o[0]?o[0].left===e.left&&o[0].top===e.top:!1;o=dd(o);let t=o[0],n=o[o.length-1];return t.left===n.left?e.left===t.left&&e.top>=Math.min(t.top,n.top)&&e.top<=Math.max(t.top,n.top):e.top===t.top&&e.left>=Math.min(t.left,n.left)&&e.left<=Math.max(t.left,n.left)}function pd(o,e){if(qb(o))return Xb(o,e);o=dd(o);let[t]=o;for(let n=1,r=o.length-1;n<r;n++){let i=o[n],a=o[n+1];if(Zb([t,i,a],e))return!0}return!1}function Zb(o,e){let[t,n,r]=o,i=e,a=(n.left-t.left)*(r.top-t.top)-(n.top-t.top)*(r.left-t.left);return a*((n.left-t.left)*(i.top-t.top)-(n.top-t.top)*(i.left-t.left))>=0&&a*((r.left-n.left)*(i.top-n.top)-(r.top-n.top)*(i.left-n.left))>=0&&a*((t.left-r.left)*(i.top-r.top)-(t.top-r.top)*(i.left-r.left))>=0}var Ro=class{containsPoint(e){return pd(this.getPoints(),e)}contains(e){let t=e.getPoints();for(let n=0,r=t.length;n<r;n++)if(!this.containsPoint(t[n]))return!1;return!0}intersects(e){return this.privateIntersects(e,!1)}privateIntersects(e,t){let n=e.getPoints();for(let r=0,i=n.length;r<i;r++)if(this.containsPoint(n[r]))return!0;return t?!1:e.privateIntersects(this,!0)}};var xo=class o extends Ro{static clone(e){return new o(e)}constructor(e){super(),this.points=e.map(Ge.clone)}getPoints(){return this.points}shift(e){return this.points.forEach(t=>{t.shift(e)}),this}};function Qb(o,e){let t=Math.min(o.left,e.left),n=Math.min(o.top,e.top),r=o.left+o.width,i=e.left+e.width,a=Math.max(r,i),l=o.top+o.height,s=e.top+e.height,c=Math.max(l,s);return new Ce({top:n,left:t,width:a-t,height:c-n})}var Ce=class o extends Ro{constructor(t){super();this.top=0;this.left=0;this.width=0;this.height=0;this.top=t.top,this.left=t.left,typeof t.width=="number"?(this.width=t.width,this.height=t.height):(this.width=t.right-t.left,this.height=t.bottom-t.top)}static fromDOMRect(t){return new o(t)}static clone(t){return new o(t)}static from(t){return o.clone(t)}static fromPoint(t){return o.from({top:t.top,left:t.left,width:0,height:0})}getMinimumBoundingRectangle(...t){let n=this;for(let r of t)n=Qb(n,r);return n}toDOMRect(){return{top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top,toJSON:()=>({top:this.top,left:this.left,bottom:this.top+this.height,right:this.left+this.width,height:this.height,width:this.width,x:this.left,y:this.top})}}containsPoint(t){return new xo(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(Ge.from)}shift(t){return t.top!=null&&(this.top+=t.top),t.left!=null&&(this.left+=t.left),this}};var fd=10,Jb=q($.pinnedStartWidth);function gd(o){let{computedVisibleColumns:e,computedVisibleColumnsMap:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,dragColumnId:i,infiniteDOMNode:a,brain:l,dragColumnHeaderTargetRect:s,draggableColumnsRestrictTo:c,tableRect:u,acceptDropToReorderRect:d,allowColumnHideOnDrag:p,setProxyPosition:f,setDragColumnOutside:m,getCurrentDragSourceAndTarget:g,api:b,horizontalLayoutPageIndex:h,pageWidth:y}=o;function S(k){let B=k==="start"?N:W;return _===F?B:F===k?B+M.computedWidth:_===k?B-M.computedWidth:B}function C(k){if(k.columnIndex===P||h!=null)return!0;let B=e[k.columnIndex];if(B.computedPinned)return!0;let O=l.getScrollPosition().scrollLeft,oe=B.computedOffset+(h!=null&&y!=null?y*h:0);return oe>=O+S("start")&&oe+B.computedWidth<=O+u.width-S("end")}let T=(k,B)=>{let{restrictToParentGroup:O,dragColumn:oe}=B,te=[];if(k.forEach(de=>{if(de.computedVisibleIndex===P)return;let ee={columnId:de.id,columnIndex:de.computedVisibleIndex,offsetX:de.computedOffset+Math.round(de.computedWidth/2)};C(ee)&&te.push(ee)}),O){let ee=function(re,Re,xe){let _e=k[re];_e&&(_e.columnGroup!==oe.columnGroup&&xe.add(_e.id),ee(re+Re,Re,xe))};var he=ee;let de=oe.computedVisibleIndex,j=new Set;ee(de-1,-1,j),ee(de+1,1,j),te=te.filter(re=>!j.has(re.columnId))}return te},w=r.length,I={clientX:Math.round(o.initialMousePosition.clientX),clientY:Math.round(o.initialMousePosition.clientY)},R={left:I.clientX-u.left-(I.clientX-s.left)+fd,top:I.clientY-u.top-(I.clientY-s.top)+fd},x=l.getScrollPosition(),E=e.map(k=>k.computedVisibleIndex),A=E,M=t.get(i),P=M.computedVisibleIndex,_=M?.computedPinned,D=P,F=_,N=l.getFixedStartColsWidth(),W=l.getFixedEndColsWidth(),L=I,X={x:0,y:0},le=1,ae=0;function H(k){let B=Math.round(k.clientX),O=Math.round(k.clientY);if(B===L.clientX&&O===L.clientY)return Ce.from(s).shift({left:X.x,top:X.y});L={clientX:B,clientY:O};let te=l.getScrollPosition().scrollLeft-x.scrollLeft;return X.x=L.clientX-I.clientX,X.y=L.clientY-I.clientY,ae=X.x+te,le=ae<0?-1:1,f({left:R.left+X.x,top:R.top+X.y}),Ce.from(s).shift({left:X.x,top:X.y})}function U(k){let B=0;_?_==="start"&&k.forEach((O,oe)=>{B||e[O]?.computedPinned!=="start"&&(B=oe)}):k.forEach((O,oe)=>{e[O]?.computedPinned==="start"&&(B=oe+1)}),w=B,ie("start",k,B)}function ie(k,B,O){if(k==="start"){let oe=0;for(let te=0;te<O;te++){let he=B[te],de=e[he];oe+=de.computedWidth}Yt(Jb,`${oe}px`,a)}}function se(k){if(k==null||k===D)return;if(D===-1&&k!==-1&&(yr(P,"",a),m(!1)),D=k,k===-1){pe(P);return}let B=Wn(E,P,D>P?D-1:D);w=0;let oe=new Set;return B.forEach((te,he)=>{let de=A[he];te!==de&&oe.add(te),U(B)}),A=B,fe(oe),{newColumnIndexes:B,indexesWithTransition:oe,pinnedStartCount:w}}function pe(k){A=A.filter(O=>O!==k),e.forEach(O=>{let oe=O.computedVisibleIndex,te=oe>k;Gl(oe,a);let he="";te&&(he=Sr.minus(Se.columnOffsets.get(oe),Se.columnWidths.get(k)).done()),Io(oe,he,a)}),yr(k,"hidden",a),m(!0)}function fe(k){e.forEach(B=>{let O=B.computedVisibleIndex;k.has(O)?Gl(O,a):vi(O,a);let oe=O===P,te=le===-1?O<D||O>P:O<P||O>=D,he="";le===-1?he=oe?Se.columnOffsets.get(D):te?Se.columnOffsets.get(O):Sr.add(Se.columnOffsets.get(O),Se.columnWidths.get(P)).done():he=te?Se.columnOffsets.get(O):oe?Sr.add(Se.columnOffsets.get(D-1),Se.columnWidths.get(D-1)).minus(Se.columnWidths.get(P)).done():Sr.minus(Se.columnOffsets.get(O),Se.columnWidths.get(P)).done(),Io(O,he,a)})}let ne=u.left+S("start"),ge=u.right-S("end"),K=sd({scrollOffsetStart:ne,scrollOffsetEnd:ge});return H(I),{speedScroller:K,stop(){K.stop()},onMove(k){let B=H(k);if(g().dropTargetListId==="grouping-toolbar"||p&&!d.containsPoint(B.getCenter()))return p&&se(-1),null;K.scroll({mousePosition:L,get scrollLeft(){return l.getScrollPosition().scrollLeft},set scrollLeft(ee){b.scrollLeft=ee}});let O=T(e,{dragColumn:M,restrictToParentGroup:c==="group"}),oe=le===-1?M.computedOffset+ae:M.computedOffset+M.computedWidth+ae,te=(0,md.default)(O,oe,({offsetX:ee},j)=>ee<j?-1:ee>j?1:0);te<0&&(te=~te),O.length?te=O[te]?O[te].columnIndex:O[O.length-1].columnIndex+1:(e.length>1&&console.error("No breakpoints available, something is wrong!"),te=0),te===P+1&&(te=P),se(te);let he={};n.forEach(ee=>{he[ee.id]="end"});for(let ee=0;ee<w;ee++){let j=A[ee],re=e[j];he[re.id]="start"}let de=A.map(ee=>e[ee].id);return{columnPinning:he,columnOrder:de}}}}function At(o,e,t){if(o===e)return!0;if(!o||!e)return!1;var n=Object.keys(o),r=Object.keys(e);t&&(n=n.filter(s=>!t.has(s)),r=r.filter(s=>!t.has(s)));var i=n.length;if(r.length!==i)return!1;for(var a=0;a<i;a++){var l=n[a];if(!(t&&t.has(l))&&(o[l]!==e[l]||!Object.prototype.hasOwnProperty.call(e,l)))return!1}return!0}function Wl(o){let{newColumnOrder:e,visibleColumnOrder:t,existingColumnOrder:n,dragColumnId:r}=o;if(t.length!==e.length)return console.warn("new column order cannot contain less columns than the visible column order"),e;let i=t.indexOf(r),a=e.indexOf(r);if(i===a)return n;if(a>i){let l=e.indexOf(r),s=e[l-1],c=n.indexOf(s),u=n.indexOf(r);return Wn(n,u,c)}else{let l=e.indexOf(r),s=e[l+1],c=n.indexOf(s),u=n.indexOf(r);return Wn(n,u,c)}return e}var pt=G(require("react"));var jn=class{constructor(e){this.listeners={};e&&Object.keys(e).forEach(t=>{this.on(t,e[t])})}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}once(e,t){let n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&n.splice(r,1)}emit(e,...t){let n=this.listeners[e];n&&n.slice().forEach(r=>{try{r(...t)}catch(i){console.error(`Error in event handler for event '${String(e)}':`,i)}})}clear(e){this.listeners[e]&&(this.listeners[e]=[])}clearAll(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}};var hd=G(Bn());var bd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,draggableItems:i,listId:a,listRectangle:l}=e.getData(),{dragItem:s,listId:c,dragIndex:u,dragRectangle:d}=n,p=c===a,f=Ge.from(d.getCenter());if(!l.containsPoint(f))return null;e.activeDragSourcePosition="inside";let m=p?r==="horizontal"?t.left>0?1:-1:t.top>0?1:-1:1,g=d.toDOMRect(),b=e.breakpoints,h=Math.round(m===1?r==="horizontal"?g.right-(p?0:g.width/2):g.bottom-(p?0:g.height/2):r==="horizontal"?g.left+(p?0:g.width/2):g.top+(p?0:g.height/2)),y=(0,hd.default)(b,h,(w,I)=>w-I);y<0&&(y=~y),m===1&&y===u+1&&p&&y--;let S=Math.min(u,y),C=Math.max(u,y),T=p?i.map((w,I)=>{if(I===u&&p)return t;if(I<S||I>=C)return{left:0,top:0};let R=y<=I?1:-1;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}):i.map((w,I)=>{let R=y<=I?1:0;return r==="horizontal"?{left:Math.round(R*g.width),top:0}:{left:0,top:Math.round(R*g.height)}}),v={offset:t,dropIndex:y,dragSourceListId:c,dropTargetListId:a,dragIndex:u,outside:!1,items:i,dragItem:s,offsetsForItems:T,dragRect:g,status:"accepted"};return e.acceptsDrop(v)?{event:v,error:null,success:!0}:(v.status="rejected",{event:v,error:"rejected by interaction target",success:!1})},yd=(o,e)=>{let{offset:t,activeDragSource:n}=o,{orientation:r,listId:i,listRectangle:a,draggableItems:l}=e.getData(),{dragRectangle:s,dragItem:c,listId:u}=n,d=Ge.from(s.getCenter()),p=u===i,f=a.containsPoint(d);if(f&&!(p&&!e.acceptsSelfDrops())||e.activeDragSourcePosition==="outside"&&!p)return null;e.activeDragSourcePosition="outside";let m=p?n.dragIndex:-1,g=s.toDOMRect(),b={offset:t,dropIndex:-1,dragIndex:m,dragItem:c,outside:!f,items:l,dragSourceListId:u,dropTargetListId:i,offsetsForItems:p?l.map((h,y)=>h.id===c.id?t:f?{left:0,top:0}:y>m?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 Ee=class Ee{static startDrag(e,t){let n=e instanceof Po?e:new Po(e),r=new jl({activeDragSource:n,startPoint:t});return r.on("start",Ee.onDragStart),r.on("move",Ee.onDragMove),r.on("drop",Ee.onDragDrop),r.start(),r}static emit(e,...t){Ee.emitter.emit(e,...t)}static on(e,t){return Ee.emitter.on(e,t)}static registerDragInteractionTarget(e){if(Ee.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} already registered`);return}return Ee.dragInteractionTargetsMap.set(e.listId,e),Ee.emit("register",e),()=>{Ee.unregisterDragInteractionTarget(e)}}static unregisterAll(){Ee.dragInteractionTargetsMap.forEach(e=>{Ee.unregisterDragInteractionTarget(e)})}static unregisterDragInteractionTarget(e){if(e){if(!Ee.dragInteractionTargetsMap.has(e.listId)){console.warn(`DragInteractionTarget with listId ${e.listId} not found`);return}Ee.dragInteractionTargetsMap.delete(e.listId),e.unregister(),Ee.emit("unregister",e)}}static onDragStart(e){let{dragItem:t,dragIndex:n}=e.activeDragSource,r=e.activeDragSource.listId,a=Ee.dragInteractionTargetsMap.get(r)?.getData().acceptDropsFrom,s=!a||a.includes(r)?r:null;Ee.dragInteractionTargetsMap.forEach(c=>{let u=c.getData();c.start({dragIndex:u.listId===r?n:-1,dragItem:t,dragSourceListId:r,dropTargetListId:s})}),Ee.emitter.emit("drag-start",{dragSourceListId:r,dropTargetListId:s,dragItem:t,dragIndex:n})}static withDragMove(e,t){let{activeDragSource:n}=e,{listId:r}=n,i=[],a=!0,l=Ee.dragInteractionTargetsMap.get(r);l&&(a=l.acceptsSelfDrops(),a&&i.push(Ee.dragInteractionTargetsMap.get(r))),Ee.dragInteractionTargetsMap.forEach(s=>{s.listId!==r&&i.push(s)});for(let s of i){let c=bd(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=yd(e,s);c&&t(s,c)}}static onDragMove(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Ee.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;Ee.emit("drag-move",{dragSourceListId:n,dropTargetListId:s,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1})}static onDragDrop(e){let{activeDragSource:t}=e,{listId:n,dragItem:r}=t,i=null,a=[];Ee.withDragMove(e,(s,{event:c})=>{s.drop(c),a.push(c),c.outside||(i=c)});let l=i??a[0]??null;Ee.emit("drag-drop",{dragSourceListId:n,dropTargetListId:l?.dropTargetListId??null,items:l?.items??[],dragItem:r,status:l?.status??"accepted",dragIndex:l?.dragIndex??-1,dropIndex:l?.dropIndex??-1}),Ee.unregisterAll()}};Ee.dragInteractionTargetsMap=new Map,Ee.emitter=new jn;var St=Ee,Po=class o{static clone(e){let t=e.getData();return new o(t)}constructor(e){this.setData(e)}get listId(){return this.data.listId}get dragIndex(){return this.data.dragIndex??-1}get dragItem(){return this.data.dragItem}setData(e){At(this.data,e)||(this.data=e,this.dragRectangle=new Ce(this.data.dragItem.rect))}getData(){return this.data}static shift(e,t){let n=o.clone(e),r=Ce.from(n.dragRectangle);return r.shift(t),n.dragRectangle=r,n}},jl=class extends jn{constructor(t){super(t.listeners);this.phase="start";this.currentOffset={top:0,left:0};this.initialDragSource=Po.clone(t.activeDragSource),this.activeDragSource=this.initialDragSource,this.startPoint={top:Math.round(t.startPoint.top),left:Math.round(t.startPoint.left)}}get offset(){return this.currentOffset}start(){let{listId:t,dragItem:n}=this.activeDragSource,r={dragSourceListId:t,dragItemId:n.id,startPoint:this.startPoint};return this.emit("start",this,r),r}drop(){this.phase="drop",this.emit("drop",this)}move(t){if(this.phase!=="start"&&this.phase!=="move")return;this.phase="move";let n={top:Math.round(t.top-this.startPoint.top),left:Math.round(t.left-this.startPoint.left)};this.activeDragSource=Po.shift(this.initialDragSource,n),this.currentOffset=n,this.emit("move",this)}};globalThis.DragManager=St;var Td=require("react"),Sd=pt.createContext({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted",updateDragOperationSourceAndTarget:o=>{},getCurrentDragSourceAndTarget:()=>({dragSourceListId:null,dropTargetListId:null,status:"accepted",dragItemId:""})}),$n=()=>pt.useContext(Sd),$l=o=>{let[e,t]=pt.useState({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"}),n=pt.useRef(e);n.current=e;let r=pt.useCallback(()=>{let a=n.current;return{dragSourceListId:a.dragSourceListId,dropTargetListId:a.dropTargetListId,dragItemId:a.dragItemId,status:a.status}},[]),i=pt.useMemo(()=>({dragSourceListId:e.dragSourceListId,dropTargetListId:e.dropTargetListId,dragItemId:e.dragItemId,status:e.status,updateDragOperationSourceAndTarget:t,getCurrentDragSourceAndTarget:r}),[e,t]);return(0,Td.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=n.current,d={dragSourceListId:c.dragSourceListId,dropTargetListId:c.dropTargetListId,dragItemId:c.dragItem.id,status:c.status};JSON.stringify(u)!==JSON.stringify(d)&&t(d)}),s=St.on("drag-drop",()=>{t({dragSourceListId:null,dropTargetListId:null,dragItemId:"",status:"accepted"})});return()=>{a(),l(),s()}},[St,t]),pt.createElement(Sd.Provider,{value:i},typeof o.children=="function"?o.children(i):o.children)};var Ul=`${lt}Body`,Cd=o=>o.querySelector(`.${Ul}`);var Un=`${lt}HeaderCell`,Yl=`${lt}HeaderWrapper`,wd=o=>Array.from(o.querySelectorAll(`.${Yl}`));function Ri(o){if(!o)return!1;let e=o.tagName;return e==="INPUT"||e==="BUTTON"}var ey=q($.baseZIndexForCells),ty=(o,e)=>{let t=!o||Object.keys(o).length===0,n=!e||Object.keys(e).length===0;return t&&n?!0:!!o!=!!e?!1:At(o,e)},vd=({columnId:o,domRef:e,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n})=>{let[r,i]=(0,Do.useState)(null),[a,l]=(0,Do.useState)(!1),{getCurrentDragSourceAndTarget:s}=$n(),{actions:c,computed:u,getComputed:d,getState:p,api:f,state:{domRef:m}}=J(),g=(0,Do.useCallback)(h=>{let y=d().computedVisibleColumnsMap.get(o);if(!y||!y.computedSortable)return;let{multiSortBehavior:S}=p();f.toggleSortingForColumn(o,{multiSortBehavior:S==="replace"&&(h.ctrlKey||h.metaKey)?"append":S})},[]),b=(0,Do.useCallback)(h=>{if(Ri(h.target))return;let{brain:y,draggableColumnsRestrictTo:S}=p(),{computedVisibleColumns:C,computedVisibleColumnsMap:T,computedPinnedStartColumns:v,computedUnpinnedColumns:w,computedPinnedEndColumns:I}=d(),R=T.get(o);if(!R.computedDraggable){g(h);return}let x=e.current,E=x.getBoundingClientRect(),A=m.current.getBoundingClientRect(),M=y.getAvailableSize(),P=R.computedVisibleIndex,_=y.getVirtualColIndex(R.computedVisibleIndex,{pageIndex:t||0}),D=y.isHorizontalLayoutBrain?y.getPageWidth():null,F=x.style.cursor??"auto",N=!1,W=m.current,L=Ce.from(Cd(W).getBoundingClientRect()),X=wd(W).map(ne=>Ce.from(ne.getBoundingClientRect())),le=L.getMinimumBoundingRectangle(...X),ae=gd({brain:y,horizontalLayoutPageIndex:t,allowColumnHideOnDrag:n,pageWidth:D,draggableColumnsRestrictTo:S,computedPinnedEndColumns:I,computedPinnedStartColumns:v,computedUnpinnedColumns:w,computedVisibleColumns:C,computedVisibleColumnsMap:T,dragColumnHeaderTargetRect:E,dragColumnId:o,getCurrentDragSourceAndTarget:s,api:f,infiniteDOMNode:m.current,setProxyPosition:i,setDragColumnOutside:l,tableRect:A,acceptDropToReorderRect:le,initialMousePosition:{clientX:h.clientX,clientY:h.clientY}}),H=null,U,ie;function se(ne){let{columnPinning:ge,columnOrder:K}=ne;ty(p().columnPinning,ge)||(c.columnPinning=ge);let k=d().computedColumnOrder;JSON.stringify(K,k)&&(C.forEach(B=>{Io(B.computedVisibleIndex,"",m.current)}),c.columnOrder=Wl({newColumnOrder:K,visibleColumnOrder:d().computedVisibleColumns.map(B=>B.id),existingColumnOrder:k,dragColumnId:o}))}let pe=ne=>{let{headerBrain:ge,brain:K}=p();if(!N){N=!0;let k=K.keepColumnRendered(_),B=ge.keepColumnRendered(_);if(K.isHorizontalLayoutBrain){let oe=K.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),te=ge.extendRenderRange({start:!0,end:!0,direction:"horizontal"});ie=()=>{oe(),te()}}U=()=>{k(),B()},c.columnReorderDragColumnId=R.id,t!=null&&(c.columnReorderInPageIndex=t),Vl(P,`calc( var(${ey}) + 10000 )`,m.current),m.current?.classList.add(Hl),x.style.cursor="grabbing"}H=ae.onMove(ne)},fe=ne=>{let ge=ne.pointerId;requestAnimationFrame(()=>{let{multiSortBehavior:K}=p(),k=e.current;m.current?.classList.remove(Hl),ae.stop(),y.update({...M}),U?.(),ie?.(),C.forEach(O=>{vi(O.computedVisibleIndex,m.current),yr(O.computedVisibleIndex,"",m.current),Io(O.computedVisibleIndex,"",m.current)}),Vl(P,Bl(R,{pinnedStartColsCount:v.length,visibleColsCount:C.length}),m.current),k.style.cursor=F,k.releasePointerCapture(ge),k.removeEventListener("pointermove",pe),k.removeEventListener("pointerup",fe),i(null);let B=f.getColumnApi(R.id)?.isSortable()??!1;!N&&B&&f.toggleSortingForColumn(R.id,{multiSortBehavior:K==="replace"&&(ne.ctrlKey||ne.metaKey)?"append":K}),H?se(H):N&&n&&f.setVisibilityForColumn(R.id,!1),c.columnReorderDragColumnId=!1,t!=null&&(c.columnReorderInPageIndex=null)})};x.addEventListener("pointermove",pe),x.addEventListener("pointerup",fe),x.setPointerCapture(h.pointerId)},[o,t]);return{onPointerDown:u.computedVisibleColumnsMap.get(o)?.computedDraggable?b:g,dragColumnOutside:a,proxyPosition:r}};var Eo=G(require("react"));var ye=G(require("react")),Ue=require("react");var qn=G(require("react"));var Id=o=>o.dataSourceHasGrouping&&o.isGroupRow&&o.childrenLoading||!o.selfLoaded;var Cr=G(require("react")),Pd=require("react");var Rd="_6rdmyg0 _16lm1iw1d _16lm1iwk _16lm1iw9",xd=me({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 xi=`${Tt}-expand-collapse`;function Yn(o){let{size:e=24,direction:t="start",disabled:n=!1}=o,[r,i]=(0,Pd.useState)(o.expanded??o.defaultExpanded),a=()=>{o.onChange?.(!r),bn("expanded",o)||i(!r)};Cr.useEffect(()=>{bn("expanded",o)&&i(o.expanded)},[o.expanded]);let l=r?"expanded":"collapsed";return Cr.createElement("svg",{"data-name":"expand-collapse-icon","data-state":l,"data-disabled":n,xmlns:"http://www.w3.org/2000/svg",height:`${e}px`,viewBox:"0 0 24 24",width:`${e}px`,style:o.style,onClick:n?void 0:a,className:Z(o.className,Rd,xd({direction:t||"start",expanded:r,disabled:n}),`${Tt}`,`${xi}`,`${xi}--${l}`,`${xi}--${t==="end"?"end":"start"}`,n?`${xi}--disabled`:"")},Cr.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))}var Pi=G(require("react"));var Dd="_16lm1iwb _16lm1iw1d _16lm1iwk";var Md=o=>Pi.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{margin:"auto",display:"block",shapeRendering:"auto"},width:"24px",height:"24px",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:Z(o.className,Dd,"InfiniteIcon","InfiniteIcon-loading")},Pi.createElement("circle",{cx:"50",cy:"50",fill:"none",strokeWidth:"10",r:"35",strokeDasharray:"164.93361431346415 56.97787143782138"},Pi.createElement("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"})));var{rootClassName:ny}=Fe,Xt=`${ny}ColumnCell`;var Ed=me({defaultClassName:"_7pupv01",variantClassNames:{align:{start:"_7pupv02",center:"_7pupv03",end:"_7pupv04"}},defaultVariants:{},compoundVariants:[]}),Ad="_7pupv00",_d=me({defaultClassName:"_7pupv05",variantClassNames:{align:{start:"_7pupv06",center:"_7pupv07",end:"_7pupv08"}},defaultVariants:{},compoundVariants:[]});function Od({rowInfo:o}){return{[q(ue.components.Row.groupNesting)]:o.dataSourceHasGrouping?o.isGroupRow?o.groupNesting-1:o.groupNesting:0}}function Di({groupIndexForColumn:o,groupRenderStrategy:e}){return t=>{let{rowInfo:n,renderBag:r,column:i,align:a}=t,{value:l,groupIcon:s,selectionCheckBox:c}=r,u=n,d=Z(ho.flex,i.align==="end"?mr.rowReverse:mr.row,Nc.center,`${Xt}Expander`,e==="single-column"||e==="multi-column"&&(!n.isGroupRow||c)?Ed({align:a}):null);if(e==="multi-column"){if(o+1!==u.groupNesting&&u.isGroupRow)return c?qn.createElement("div",{className:d},c):null}else e==="single-column"&&u.isGroupRow;return qn.createElement("div",{className:d},s,c,qn.createElement("div",{className:Ut},l??null))}}function Mi({groupIndexForColumn:o,groupRenderStrategy:e,toggleGroupRow:t,initialRenderGroupIcon:n}){return r=>{let{rowInfo:i,value:a,rootGroupBy:l,pivotBy:s,column:c}=r,u=e!=="inline"?i:i.isGroupRow&&i.parents?.[o]||i;if(!u)return null;let d=u.collapsed;if(e==="inline"){if(u.groupCount===1)return a;if(u.groupNesting===o&&d)return null}else if(!u.isGroupRow||e==="multi-column"&&o+1!==u.groupNesting)return null;let p=u.groupKeys,f=null,m=s?(u.groupKeys?.length||0)<l?.length:(u.groupKeys?.length||0)<=l?.length;return Id(u)?f=qn.createElement(Md,null):m&&(f=qn.createElement(Yn,{expanded:!d,direction:c.align==="end"?"end":"start",onChange:()=>{t(p)}})),n&&(r.renderBag.groupIcon=f,f=qn.createElement(ft,{render:n,renderParam:r})),f}}function Fd(o,e,t){let{groupByForColumn:n,groupIndexForColumn:r,groupRenderStrategy:i}=o,a=n.column?{...n.column}:{},l={header:`Group by ${n.field||n.groupField}`,groupByForColumn:n,render:Di({groupIndexForColumn:r,groupRenderStrategy:i}),...a,renderGroupIcon:Mi({initialRenderGroupIcon:a?.renderGroupIcon,groupIndexForColumn:r,toggleGroupRow:e,groupRenderStrategy:i})};return t&&(typeof t=="function"?l={...l,...t(o,e)}:l={...l,...t}),l}function Nd(o,e,t){let n=typeof t=="function"?t(o,e):t,r={};return o.sortable!=null&&(r.sortable=o.sortable),{...r,header:"Group",groupByForColumn:o.groupBy,renderSelectionCheckBox:o.selectionMode==="multi-row",render:Di({groupIndexForColumn:0,groupRenderStrategy:"single-column"}),...n,renderGroupIcon:Mi({initialRenderGroupIcon:n?.renderGroupIcon,groupIndexForColumn:0,toggleGroupRow:e,groupRenderStrategy:"single-column"})}}function Ld(o,e){let t=[];for(let n in o)o.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&t.push(o[n]);return t}var kd="_1eexc2a7 _1eexc2a6",zd=me({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"]]}),Vd=me({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 Gd="_1eexc2a5",Ei=me({defaultClassName:"_1eexc2aa",variantClassNames:{direction:{up:"_1eexc2ab",down:"_1eexc2ac",neutral:"_1eexc2ad"}},defaultVariants:{},compoundVariants:[]}),Ai="_1eexc2a8";var _i=G(require("react")),Oi=require("react");var Hd="qz8ht90 _16lm1iwk";function oy(){return{checked:1,disabled:o=>o??!1,domProps:1}}var{ManagedComponentContextProvider:ry}=Et({forwardProps:oy,mappedCallbacks:{checked:o=>({callbackName:"onChange",callbackParams:[o]})},debugName:"InfiniteCheckBox"});function iy(){let{componentState:o,componentActions:e}=$e(),{checked:t,domProps:n,disabled:r}=o,i=(0,Oi.useRef)(null);return(0,Oi.useEffect)(()=>{i.current.indeterminate=t==null},[t]),_i.createElement("input",{...n,className:Z("InfiniteCheckBox",Hd,n?.className),type:"checkbox",ref:i,checked:!!t,disabled:r,onChange:()=>{r||(e.checked=!t)}})}function rn(o){return _i.createElement(ry,{...o},_i.createElement(iy,null))}function ay(o){return typeof o.field=="string"}function Kd(o){let{column:e,rowInfo:t,fieldsToColumn:n}=o,r;if(e.groupByForColumn){if(t.isGroupRow){let i=t.groupBy[t.groupBy.length-1];r=i?n.get(i.field||i.groupField):void 0}!r&&e.field&&(r=n.get(e.field))}return r}function Ct(o){let{getComputed:e,getDataSourceState:t,getState:n,rowIndex:r,columnId:i,api:a,dataSourceApi:l}=o,{dataArray:s}=t(),c=s[r],{isGroupRow:u,isTreeNode:d}=c,p=e().computedColumnsMap.get(i),{activeRowIndex:f,keyboardNavigation:m,isRowDetailEnabled:g}=n(),b=r===f&&m==="row",h=!g||typeof g=="function"&&!g(c)?!1:a.rowDetailApi.isRowDetailExpanded(c.id)?"expanded":"collapsed",{formattedValue:y,formattedValueContext:{rawValue:S}}=Mo({column:p,rowInfo:c,rowDetailState:h,columnsMap:e().computedColumnsMap,context:o}),C=st(p.id,o);return u?{api:a,dataSourceApi:l,column:p,columnApi:C,isParentNode:!1,isGroupRow:!0,isTreeNode:!1,rowDetailState:!1,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}:d?c.isParentNode?{api:a,dataSourceApi:l,columnApi:C,column:p,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:C,column:p,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:C,column:p,isTreeNode:!1,isParentNode:!1,isGroupRow:!1,rowDetailState:h,data:c.data,rowActive:b,rowInfo:c,rowSelected:c.rowSelected,value:y,rawValue:S}}function Bd(o){return jd(o.column,o.rowInfo)}function Wd(o){let{column:e,context:t,rowInfo:n,visibleColumnsIds:r}=o,i=Kd({rowInfo:n,column:e,fieldsToColumn:o.fieldsToColumn,groupRenderStrategy:t.getState().groupRenderStrategy}),{getState:a}=t,{editingCell:l}=a(),s=Mo(o),{formattedValueContext:c}=s,u=t.api.isEditorVisibleForCell({columnId:e.id,rowIndex:n.indexInAll}),d=Object.assign({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,inEdit:u,rowHasSelectedCells:!1},c,{editError:l&&l.primaryKey===n.id&&l.columnId===e.id&&!l.active&&l.accepted instanceof Error?l.accepted:void 0});Object.defineProperty(d,"rowHasSelectedCells",{get(){return n.hasSelectedCells(r)}});let p=typeof e.align=="function"?e.align({isHeader:!1,...d}):e.align??"start",f=typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!1,...d}):e.verticalAlign??"center";return{inEdit:u,stylingParam:d,formattedValueContext:c,renderFunctions:{renderGroupIcon:e.renderGroupIcon||i?.renderGroupIcon,renderSelectionCheckBox:e.renderSelectionCheckBox,renderRowDetailIcon:e.renderRowDetailIcon,renderTreeIcon:e.renderTreeIcon,renderTreeIconForParentNode:e.renderTreeIconForParentNode,renderTreeIconForLeafNode:e.renderTreeIconForLeafNode,renderValue:e.renderValue||i?.renderValue,renderGroupValue:e.renderGroupValue||i?.renderGroupValue,renderLeafValue:e.renderLeafValue||i?.renderLeafValue},renderParams:ly({rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,column:o.column,rowInfo:o.rowInfo,visibleColumnsIds:o.visibleColumnsIds,columnsMap:o.columnsMap,fieldsToColumn:o.fieldsToColumn,context:o.context,align:p,verticalAlign:f,formattedValueContext:c}),groupByColumnReference:i}}function ly(o){let{column:e,context:t,rowInfo:n,align:r,verticalAlign:i,visibleColumnsIds:a,columnsMap:l,fieldsToColumn:s,formattedValueContext:c}=o,{value:u}=c,{api:d,getDataSourceState:p,getState:f,dataSourceApi:m}=t,{editingCell:g}=f(),{indexInAll:b}=n,h=p(),{selectionMode:y,cellSelection:S}=h,C=Kd({rowInfo:n,column:e,fieldsToColumn:s,groupRenderStrategy:t.getState().groupRenderStrategy}),T=d.toggleGroupRow,v=S?.isCellSelected(n.id,e.id)??!1,w={column:e,columnsMap:l,fieldsToColumn:s,align:r,verticalAlign:i,cellSelected:v,rowHasSelectedCells:!1,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,rowIndexInHorizontalLayoutPage:o.rowIndexInHorizontalLayoutPage,...c,editError:g&&g.primaryKey===n.id&&g.columnId===e.id&&!g.active&&g.accepted instanceof Error?g.accepted:void 0,groupByColumn:C,selectionMode:y,api:d,dataSourceApi:m,toggleCurrentRowDetails:()=>d.rowDetailApi.toggleRowDetail(n.id),toggleRowDetails:d.rowDetailApi.toggleRowDetail,expandRowDetails:d.rowDetailApi.expandRowDetail,collapseRowDetails:d.rowDetailApi.collapseRowDetail,toggleCurrentTreeNode:()=>{m.treeApi.toggleNode(n.nodePath)},toggleTreeNode:m.treeApi.toggleNode,expandTreeNode:m.treeApi.expandNode,collapseTreeNode:m.treeApi.collapseNode,selectTreeNode:m.treeApi.selectNode,deselectTreeNode:m.treeApi.deselectNode,toggleTreeNodeSelection:m.treeApi.toggleNodeSelection,toggleCurrentTreeNodeSelection:()=>{n.isTreeNode&&m.treeApi.toggleNodeSelection(n.nodePath)},selectRow:d.rowSelectionApi.selectRow,deselectRow:d.rowSelectionApi.deselectRow,toggleRowSelection:d.rowSelectionApi.toggleRowSelection,toggleGroupRowSelection:d.rowSelectionApi.toggleGroupRowSelection,selectCell:()=>{d.cellSelectionApi.selectCell({rowId:n.id,colId:e.id})},deselectCell:()=>{d.cellSelectionApi.deselectCell({rowId:n.id,colId:e.id})},renderBag:{all:null,value:typeof u=="boolean"?`${u}`:u,selectionCheckBox:null,groupIcon:null,treeIcon:null},selectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.selectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},deselectCurrentRow:()=>{if(!n.isTreeNode)return d.rowSelectionApi.deselectRow(n.id,n.dataSourceHasGrouping?n.groupKeys:void 0)},rowIndex:b,toggleGroupRow:T,toggleCurrentGroupRow:()=>{n.isGroupRow&&T(n.groupKeys)},toggleCurrentRowSelection:()=>{if(!(n.isGroupRow||n.isTreeNode))return d.rowSelectionApi.toggleRowSelection(n.id)},toggleCurrentGroupRowSelection:()=>{if(n.isGroupRow)return d.rowSelectionApi.toggleGroupRowSelection(n.isGroupRow?n.groupKeys:[])},rootGroupBy:h.groupBy,pivotBy:h.pivotBy};return Object.defineProperty(w,"rowHasSelectedCells",{get(){return n.hasSelectedCells(a)}}),w}function jd(o,e){let{data:t,isGroupRow:n,dataSourceHasGrouping:r}=e,i=r?e.groupBy:void 0,a=n&&i&&o.groupByForColumn&&(Array.isArray(o.groupByForColumn)||o.groupByForColumn===i[i.length-1])?e.value:ay(o)?t?.[o.field]:null;return o.field&&e.isGroupRow&&e.reducerData&&e.reducerData[o.field]!=null&&(a=e.reducerData[o.field]),o.valueGetter&&!e.isGroupRow&&e.data&&(a=o.valueGetter({data:e.data,field:o.field})),a}function sy(o,e,t,n,r){let{rowSelected:i,indexInAll:a}=t,{activeRowIndex:l,keyboardNavigation:s}=n.getState(),c=a===l&&s==="row";return t.isGroupRow?{rowInfo:t,isGroupRow:!0,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:!1,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:t.isTreeNode?t.isParentNode?{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!0,nodeExpanded:t.nodeExpanded,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!0,isParentNode:!1,nodeExpanded:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}:{rowInfo:t,isGroupRow:!1,isTreeNode:!1,isParentNode:!1,data:t.data,rowDetailState:r,rowSelected:i,rowActive:c,value:o,rawValue:o,field:e.field}}function Mo(o){let{column:e,rowInfo:t,context:n,rowDetailState:r}=o,i=jd(e,t),a=sy(i,e,t,n,r),l=e.valueFormatter?e.valueFormatter(a):i;return a.value=l,{formattedValue:l,formattedValueContext:a}}var an=G(require("react"));var{rootClassName:$d}=Fe,Xn=`${$d}Cell`,ql=`${$d}Cell_content`,cy=q($.columnWidthAtIndex),uy=q($.columnReorderEffectDurationAtIndex);function dy(o){let{cssEllipsis:e=!0,virtualized:t=!0,skipColumnShifting:n=!1,contentStyle:r,column:i,domRef:a,width:l,contentClassName:s,rowId:c,afterChildren:u,beforeChildren:d,cellType:p,cssPosition:f,renderChildren:m,horizontalLayoutPageIndex:g,...b}=o,h=typeof m=="function"?m():m,y={width:`var(${cy}-${i.computedVisibleIndex})`,transition:`transform var(${uy}-${i.computedVisibleIndex}, 0s)`,...b.style},S={...b,style:y,"data-column-id":i.id,"data-z-index":y.zIndex,className:Z(b.className,Xn,kd),children:an.createElement(an.Fragment,null,d,an.createElement("div",{className:Z(ql,e?Ut:Hc.hidden,s),style:r},h),u)};c!=null&&(S["data-row-id"]=`${c}`);let C=p==="body"?i.components?.ColumnCell:i.components?.HeaderCell;return C?an.createElement(C,{...S,ref:a}):an.createElement("div",{...S,ref:a})}var Fi=an.memo(dy);var Zn=G(require("react")),wr=require("react");function Ud(){let{initialValue:o,setValue:e,confirmEdit:t,cancelEdit:n,readOnly:r}=Ni(),i=(0,wr.useRef)(null),a=Zn.useCallback(s=>{i.current=s,s&&s.focus()},[]),l=(0,wr.useCallback)(s=>{let{key:c}=s;c==="Enter"||c==="Tab"?t():c==="Escape"?n():s.stopPropagation()},[]);return Zn.createElement(Zn.Fragment,null,Zn.createElement("input",{readOnly:r,ref:a,onKeyDown:l,onBlur:()=>t(),className:Z(Fc,Gc.none),type:"text",defaultValue:o,onChange:(0,wr.useCallback)(s=>{e(s.target.value)},[])}))}var py=q($.columnZIndexAtIndex),fy=q($.columnVisibilityAtIndex);function my({rowInfo:o}){return{[q(ue.components.Row.groupNesting)]:o.isTreeNode?o.isParentNode?o.treeNesting:o.treeNesting+1:0}}var vr=ye.createContext(null),gy=o=>{let{toggleCurrentRowDetails:e,rowDetailState:t}=o;return ye.createElement(Yn,{style:{visibility:t===!1?"hidden":"visible"},expanded:t==="expanded",onChange:e})},hy={display:"inline-block",visibility:"visible"},Xl=o=>{let{rowInfo:e,toggleCurrentTreeNode:t,nodeExpanded:n,api:r}=o,i=r.getDataSourceState().isNodeReadOnly;return ye.createElement(Yn,{disabled:e.isTreeNode&&e.isParentNode?i(e):!1,style:hy,expanded:n,onChange:t})},by=o=>{let{rowInfo:e,selectCurrentRow:t,deselectCurrentRow:n,toggleCurrentGroupRowSelection:r,column:i,dataSourceApi:a,api:l}=o;e.isGroupRow&&i.groupByForColumn;let{components:s}=l.getState(),c=l.getDataSourceState().isNodeSelectable,u=s?.CheckBox||rn;return ye.createElement(u,{domProps:{className:Ai},disabled:e.isTreeNode?!c(e):!1,onChange:d=>{if(e.isTreeNode){a.treeApi.setNodeSelection(e.nodePath,d??!1);return}if(e.isGroupRow){r();return}d?t():n()},checked:e.rowSelected})};function Zl(o,e){return o?typeof o=="function"?o(e):o:void 0}function Ql(o,e,t){return typeof e=="function"?{...o,...e(t)}:{...o,...e}}function yy(o){let{rowInfo:e,rowStyle:t,rowClassName:n,rowIndexInHorizontalLayoutPage:r,horizontalLayoutPageIndex:i,getData:a,cellStyle:l,cellClassName:s,rowDetailState:c,width:u,column:d,onMouseLeave:p,onMouseEnter:f,onRowMouseEnter:m,onRowMouseLeave:g,rowIndex:b,rowHeight:h,columnsMap:y,fieldsToColumn:S,domRef:C,hidden:T,showZebraRows:v}=o,w=ye.useRef(null),I=(0,Ue.useCallback)(Ae=>{w.current=Ae,C&&C(Ae)},[C]);if(!d)return ye.createElement("div",{ref:I},"no column");let{rowSelected:R}=e,{getState:x,actions:E,computed:A,api:M,getDataSourceMasterContext:P}=J(),{componentState:_,getState:D,api:F,componentActions:N}=De(),{activeRowIndex:W,keyboardNavigation:L,columnReorderInPageIndex:X}=x(),le=b===W&&L==="row",ae={getState:x,getDataSourceState:D,getDataSourceMasterContext:P,actions:E,dataSourceActions:N,api:M,dataSourceApi:F},H=e.rowDisabled,U=A.computedVisibleColumns.map(Ae=>Ae.id),ie=Wd({horizontalLayoutPageIndex:i,rowIndexInHorizontalLayoutPage:r,column:d,rowInfo:e,rowDetailState:c,columnsMap:y,visibleColumnsIds:U,fieldsToColumn:S,context:ae}),{stylingParam:se,renderParams:pe,formattedValueContext:fe,renderFunctions:ne,groupByColumnReference:ge,inEdit:K}=ie,{align:k,verticalAlign:B}=pe,O=pe,oe=ye.useRef(O),te=m&&f?Ae=>{let nn={...fe,rowIndex:b};m(nn,Ae),f(Ae)}:f,he=g&&p?Ae=>{let it={...fe,rowIndex:b,rowInfo:e};g(it,Ae),p(Ae)}:p,de=(0,Ue.useCallback)(Ae=>{let it=d.computedVisibleIndex;x().cellClick({rowIndex:b,colIndex:it,event:Ae})},[b,d.computedVisibleIndex,L]),ee=(0,Ue.useCallback)(Ae=>{let it=d.computedVisibleIndex;if(x().cellMouseDown({rowIndex:b,colIndex:it,event:Ae}),L==="row"){H||(E.activeRowIndex=b);return}L==="cell"&&(E.activeCellIndex=[b,it])},[b,H,d.computedVisibleIndex,L]),{selectionMode:j,cellSelection:re,isNodeReadOnly:Re}=_,xe=O.cellSelected;O.domRef=I,O.htmlElementRef=w,O.toggleCurrentTreeNode=(0,Ue.useCallback)(O.toggleCurrentTreeNode,[e]),O.selectCell=(0,Ue.useCallback)(O.selectCell,[e]),O.deselectCell=(0,Ue.useCallback)(O.deselectCell,[e]),O.selectCurrentRow=(0,Ue.useCallback)(O.selectCurrentRow,[e]),O.deselectCurrentRow=(0,Ue.useCallback)(O.deselectCurrentRow,[e]),O.toggleCurrentGroupRow=(0,Ue.useCallback)(O.toggleCurrentGroupRow,[e]),O.toggleCurrentRowSelection=(0,Ue.useCallback)(O.toggleCurrentRowSelection,[e]),O.toggleCurrentGroupRowSelection=(0,Ue.useCallback)(O.toggleCurrentGroupRowSelection,[e]),O.toggleCurrentTreeNodeSelection=(0,Ue.useCallback)(O.toggleCurrentTreeNodeSelection,[e]);let _e=d.components?.Editor??Ud,Be=K?ye.createElement(qd,{contextValue:O},ye.createElement(_e,null)):null,Oe=(0,Ue.useCallback)(at(()=>{if(T||K)return null;if(oe.current=O,ne.renderGroupIcon&&(O.renderBag.groupIcon=ye.createElement(ft,{render:ne.renderGroupIcon,renderParam:{...O,renderBag:{...O.renderBag}}})),ne.renderSelectionCheckBox&&j=="multi-row"&&(O.renderBag.selectionCheckBox=ye.createElement(ft,{render:by,renderParam:O}),ne.renderSelectionCheckBox!==!0&&(O.renderBag.selectionCheckBox=ye.createElement(ft,{render:ne.renderSelectionCheckBox,renderParam:{...O,renderBag:{...O.renderBag}}}))),e.isTreeNode){let{isParentNode:nn}=e,ke;ke=(nn?ne.renderTreeIconForParentNode:ne.renderTreeIconForLeafNode)||typeof ne.renderTreeIcon=="function"?ne.renderTreeIcon:nn&&ne.renderTreeIcon===!0?Xl:void 0,ke===!0?ke=Xl:ke&&(O.renderBag.treeIcon=ye.createElement(ft,{render:Xl,renderParam:O})),ke&&(O.renderBag.treeIcon=ye.createElement(ft,{render:ke,renderParam:{...O,renderBag:{...O.renderBag}}}))}ne.renderRowDetailIcon&&(O.renderBag.rowDetailsIcon=ye.createElement(ft,{render:gy,renderParam:{...O,renderBag:{...O.renderBag}}}),typeof ne.renderRowDetailIcon=="function"&&(O.renderBag.rowDetailsIcon=ye.createElement(ft,{render:ne.renderRowDetailIcon,renderParam:{...O,renderBag:{...O.renderBag}}}))),ne.renderValue&&(O.renderBag.value=ye.createElement(ft,{render:ne.renderValue,renderParam:{...O,renderBag:{...O.renderBag}}})),e.isGroupRow&&ne.renderGroupValue&&(O.renderBag.value=ye.createElement(ft,{render:ne.renderGroupValue,renderParam:{...O,renderBag:{...O.renderBag}}})),!e.isGroupRow&&ne.renderLeafValue&&(O.renderBag.value=ye.createElement(ft,{render:ne.renderLeafValue,renderParam:{...O,renderBag:{...O.renderBag}}})),oe.current=O;let Ae=O.renderBag.value;Ae instanceof Date&&(Ae=Ae.toLocaleDateString());let it=ye.createElement(ye.Fragment,null,k!=="end"?O.renderBag.treeIcon:null,k!=="end"?O.renderBag.groupIcon:null,k!=="end"?O.renderBag.rowDetailsIcon:null,k!=="end"?O.renderBag.selectionCheckBox:null,Ae,k==="end"?O.renderBag.selectionCheckBox:null,k==="end"?O.renderBag.rowDetailsIcon:null,k==="end"?O.renderBag.groupIcon:null,k==="end"?O.renderBag.treeIcon:null);return d.render?ye.createElement(ft,{render:d.render,renderParam:{...O,renderBag:{...O.renderBag,all:it}}}):it}),[d,T,K,c,d.renderTreeIcon||d.renderTreeIconForParentNode?Re:!1,...Ld(O,{renderBag:!0,selectCell:!0,deselectCell:!0,selectCurrentRow:!0,deselectCurrentRow:!0,toggleCurrentGroupRow:!0,toggleCurrentRowDetails:!0,toggleCurrentRowSelection:!0,toggleCurrentGroupRowSelection:!0,toggleCurrentTreeNodeSelection:!0,toggleCurrentTreeNode:!0,rowHasSelectedCells:!0})]),Ze=A.computedVisibleColumns.map(Ae=>Ae.id),et=A.computedColumnOrder,ut={...fe,visibleColumnIds:Ze,allColumnIds:et,rowIndex:b,rowHasSelectedCells:!1};Object.defineProperty(ut,"rowHasSelectedCells",{get(){return e.hasSelectedCells(Ze)}});let Ft=e.isTreeNode&&(d.renderTreeIcon||d.renderTreeIconForLeafNode||d.renderTreeIconForParentNode),Nt=typeof n=="function"?n(ut):n,V;ge?.className&&(V=Zl(ge.className,se)),s&&(V=Z(V,Zl(s,se))),d.className&&(V=Z(V,Zl(d.className,se))),Ft&&(V=Z(V,_d({align:k})));let Y;e.dataSourceHasGrouping&&d.groupByForColumn&&(Y=Od({rowInfo:e})),Ft&&(Y=my({rowInfo:e})),t&&(Y=typeof t=="function"?{...Y,...t(ut)}:{...Y,...t}),l&&(Y=Ql(Y,l,se)),ge?.style&&(Y=Ql(Y,ge.style,se)),d.style&&(Y=Ql(Y,d.style,se)),Y=Y||{},Y.height=h,Y.zIndex=`var(${py}-${d.computedVisibleIndex})`,Y.visibility=`var(${fy}-${d.computedVisibleIndex}, visible)`;let ce=(0,Ue.useMemo)(()=>Y,[Y?JSON.stringify(Y):null]),Te=r!=null?r%2===1:(e.indexInAll!=null?e.indexInAll:b)%2===1,Qe=v?Te?"odd":"even":!1,z=!1,We=!1,jt=!1,bt=!1;if(re&&xe){let Ae=a(),it=Ae[e.indexInAll-1],nn=Ae[e.indexInAll+1],ke=A.computedVisibleColumns[d.computedVisibleIndex+1],mo=A.computedVisibleColumns[d.computedVisibleIndex-1];z=it?!re.isCellSelected(it.id,d.id):!0,d.computedPinned==="end"&&d.computedFirstInCategory?We=!0:We=mo?!re.isCellSelected(e.id,mo.id):!0,d.computedPinned==="start"&&d.computedLastInCategory?jt=!0:jt=ke?!re.isCellSelected(e.id,ke.id):!0,bt=nn?!re.isCellSelected(nn.id,d.id):!0}let Pt=re&&xe?{top:z,left:We,right:jt,bottom:bt}:null,$t=X!=null?i!==X:!1,Qa=Be,Ja=Oe(),ir={domRef:I,cellType:"body",column:d,width:u,rowId:e.id,horizontalLayoutPageIndex:i,style:ce,onMouseLeave:he,onMouseEnter:te,onClick:de,afterChildren:Qa,onMouseDown:ee,cssEllipsis:d.cssEllipsis??!0,className:Z(Pt?Vd(Pt):"",wi(d,[Xt,Xn],zd,{dragging:!1,insideDisabledDraggingPage:$t,zebra:Qe,align:k,verticalAlign:B,rowDisabled:H,rowActive:le,cellSelected:xe,rowSelected:R,treeNode:e.isTreeNode?e.isParentNode?"parent":"leaf":!1,firstRow:e.indexInAll===0,firstRowInHorizontalLayoutPage:r===0,groupRow:e.isGroupRow,groupCell:e.isGroupRow?!!d.groupByForColumn:!1,rowExpanded:e.isGroupRow?!e.collapsed:!1}),V,Nt),renderChildren:(0,Ue.useCallback)(()=>Ja,[Oe])},Qr=vr.Provider;return ye.createElement(Qr,{value:oe.current},ye.createElement(Fi,{...ir}))}var Yd=ye.memo(yy);function Ir(){return(0,Ue.useContext)(vr)}function Ni(){let{api:o,state:{editingValueRef:e,editingCell:t}}=J(),{column:n,rowInfo:r}=Ir(),[i]=ye.useState(()=>t?.value),[a,l]=ye.useState(i),s=t?!t.active&&!!t.waiting:!1,c=ye.useCallback(f=>{e.current=f,l(f)},[]);ye.useLayoutEffect(()=>{e.current=i},[]);let u=o.confirmEdit,d=o.cancelEdit,p=o.rejectEdit;return{api:o,initialValue:i,value:a,readOnly:s,column:n,rowInfo:r,setValue:c,confirmEdit:u,cancelEdit:d,rejectEdit:p}}function Rr(o){return o.render(o.renderParam)??null}function ft(o){let e=vr.Provider;return Eo.createElement(e,{value:o.renderParam},Eo.createElement(Rr,{render:o.render,renderParam:o.renderParam}))}function qd(o){let e=vr.Provider;return Eo.createElement(e,{value:o.contextValue},o.children)}function In(o){let e=Li.Provider;return Eo.createElement(e,{value:o.renderParam},Eo.createElement(Rr,{render:o.render,renderParam:o.renderParam}))}var Rn=G(require("react"));var Ty={width:"100%",pointerEvents:"none"},Jl=`${Tt}-menu`,es=mi({"data-name":""}),ts={[es["data-name"]]:"menu-icon"};function xr(o){let{style:e,className:t,domProps:n,reserveSpaceWhenHidden:r,menuVisible:i,children:a}=o,l={...Ty,borderTop:`${ue.components.HeaderCell.menuIconLineWidth} solid currentColor`,...o.lineStyle};return Rn.createElement("div",{...n,style:e,...ts,onPointerDown:s=>s.stopPropagation(),className:Z(t,Cu({menuVisible:i,reserveSpaceWhenHidden:r}),Tt,`${Tt}-menu`)},a??Rn.createElement(Rn.Fragment,null,Rn.createElement("div",{className:Jl,style:l}),Rn.createElement("div",{className:Jl,style:l}),Rn.createElement("div",{className:Jl,style:l})))}var Ao=G(require("react")),Pr=require("react");var Xd="_1ek6mqy0 _16lm1iw1p _16lm1iw2f _16lm1iw1 _16lm1iw32";var Sy={transition:"width 0.25s, opacity 0.25s"};function ki(o){let[e,t]=(0,Pr.useState)(!0),[n,r]=(0,Pr.useState)(0),{direction:i,lineWidth:a=1,style:l,className:s,index:c}=o,u=c!=null&&c>0,d=o.size??16,p=Math.floor(d/4),f=i?[d-3*p,d-2*p,d-p]:[0,0,0];i===-1&&f.reverse();let m={...Sy,borderTop:`${a}px solid currentColor`,...o.lineStyle,opacity:n};(0,Pr.useEffect)(()=>{let h=i!=0?1:0;if(!e&&h&&t(!0),h!==n){let y=requestAnimationFrame(()=>{r(h)});return()=>{cancelAnimationFrame(y)}}return()=>{}},[i,e]);let g=()=>{let y=!(n===0&&i===0);y!==e&&t(y)};if(!e&&!o.forceSize)return null;let b={};return i===-1&&(b.top="100%"),Ao.createElement("div",{"data-name":"sort-icon",style:{...l,width:d},className:Z(s,Tt,Xd,`${Tt}-sort`)},u?Ao.createElement("div",{"data-name":"index",style:b,className:Iu},c):null,Ao.createElement("div",{style:{width:f[0],...m},onTransitionEnd:g}),Ao.createElement("div",{style:{width:f[1],...m}}),Ao.createElement("div",{style:{width:f[2],...m}}))}var ep=G(require("react")),ns=require("react");var Dr=require("react"),Mr=G(require("react"));function Zd(o,{columns:e,shareSpaceOnResize:t,domRef:n}){let r=e[o];return{resize(i){Se.columnWidths.set(o,r.computedWidth+i,n.current);let a=o+1;if(t){let l=e[a];if(!l)return;Se.columnWidths.set(a,l.computedWidth-i,n.current),l.computedPinned==="start"?zl(l,i,n.current):Se.columnOffsets.set(a,l.computedOffset+i,n.current);return}if(r.computedPinned!=="end"){if(r.computedPinned==="start"){for(let l=a,s=e.length;l<s;l++){let c=e[l];if(c.computedPinned==="start"){zl(c,i,n.current);continue}c.computedPinned!=="end"&&Se.columnOffsets.set(l,c.computedOffset+i,n.current)}return}for(let l=a,s=e.length;l<s;l++){let c=e[l];c.computedPinned||Se.columnOffsets.set(l,c.computedOffset+i,n.current)}}}}}function Qd(o,e){let t=o[o.length-1];return{resize(n){let{columns:r,domRef:i}=e,a=r[o[0]],l=a.computedOffset,s=0,c=i.current;if(n.forEach((u,d)=>{s+=u;let p=o[d],f=r[p],m=f.computedWidth+u;Se.columnWidths.set(p,m,c),f.computedPinned!=="end"&&(l&&Se.columnOffsets.set(p,l,c),l+=m)}),a.computedPinned!=="end")for(let u=t+1;u<r.length;u++){let d=r[u];d.computedPinned!=="end"&&Se.columnOffsets.set(u,d.computedOffset+s,c)}}}}var zi="zneyzh0 _16lm1iw2 _16lm1iw23 _16lm1iw2c _16lm1iw2a _16lm1iwm _16lm1iw35",Vi=me({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"]]}),Gi=me({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:Cy}=Fe,wy=`${Cy}HeaderCell_ResizeHandle`;function vy(o){let{state:{brain:e,headerBrain:t}}=J(),n=(0,Dr.useRef)(null),[r,i]=(0,Dr.useState)(!1),a=(0,Dr.useRef)(r);a.current=r;let l=o.columns[o.columnIndex],s=o.horizontalLayoutPageIndex;if(!l)return null;let c=l.computedPinned,u=l.computedFirstInCategory,d=l.computedLastInCategory,p=()=>{},f=g=>{g.stopPropagation();let b=!!g.shiftKey,h=g.pointerId,y=g.clientX,S=g.target;if(e.isHorizontalLayoutBrain){let I=e.extendRenderRange({start:!0,end:!0,direction:"horizontal"}),R=t.extendRenderRange({start:!0,end:!0,direction:"horizontal"});p=()=>{I(),R()}}S.setPointerCapture(h);let C=Zd(o.columnIndex,{columns:o.columns,shareSpaceOnResize:b,domRef:n}),T=(I,{done:R}={})=>{s&&(I=I/(s+1),R&&(I=Math.round(I))),c==="end"&&(I*=-1);let{adjustedDiff:x,constrained:E}=o.computeResize({diff:I,shareSpaceOnResize:b});return a.current!==E&&i(E),C.resize(x),x},v=I=>{T(Math.round(I.clientX-y))},w=I=>{S.releasePointerCapture(h),S.removeEventListener("pointermove",v),S.removeEventListener("pointerup",w);let R=Math.round(I.clientX-y),x=T(R,{done:!0});p(),o.onResize({diff:x,shareSpaceOnResize:b})};S.addEventListener("pointermove",v),S.addEventListener("pointerup",w)},m=(c===!1||c==="start")&&d?{right:c==="start"?void 0:0}:c==="end"&&u?{right:void 0}:void 0;return Mr.createElement("div",{ref:n,className:`${wy} ${zi} ${Gi({computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}`,onPointerDown:f},Mr.createElement("div",{style:m,className:Vi({constrained:r,computedPinned:c,computedFirstInCategory:u,computedLastInCategory:d})}))}var Jd=Mr.memo(vy);function tp(o,e){let{computed:{computedVisibleColumns:t},getState:n,getComputed:r,actions:i}=J(),a=(0,ns.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let d=n(),{columnSizing:p,viewportReservedWidth:f,bodySize:m}=d,g=r().computedVisibleColumns,b=!1,h=g.reduce((C,T)=>(T.computedFlex&&(C[T.id]={...p[T.id],flex:T.computedWidth},b=!0),C),{}),y=b?{...p,...h}:p;return Ml({shareSpaceOnResize:u,availableSize:m.width,reservedWidth:f||0,dragHandleOffset:c,dragHandlePositionAfter:o.computedVisibleIndex,columnSizing:y,items:g.map(C=>({id:C.id,computedFlex:C.computedFlex,computedWidth:C.computedWidth,computedMinWidth:C.computedMinWidth,computedMaxWidth:C.computedMaxWidth}))})},[o]),l=(0,ns.useCallback)(({diff:c,shareSpaceOnResize:u})=>{let{columnSizing:d,reservedWidth:p}=a({diff:c,shareSpaceOnResize:u});u||(i.viewportReservedWidth=p),i.columnSizing=d},[a]);return o.computedResizable?ep.createElement(Jd,{horizontalLayoutPageIndex:e.horizontalLayoutPageIndex,columns:t,columnIndex:o.computedVisibleIndex,computeResize:a,onResize:l}):null}var nt=G(require("react"));var Pn=require("react");var np=me({defaultClassName:"_16lm1iw3a _16lm1iw1",variantClassNames:{dragging:{true:"_16lm1iwn _16lm1iw1x"}},defaultVariants:{},compoundVariants:[]}),op=me({defaultClassName:"_16lm1iw3a _16lm1iw1 _16lm1iwo",variantClassNames:{active:{true:"_3dmbka5 _16lm1iw1k _3dmbka2"},draggingInProgress:{true:"_16lm1iw1x"}},defaultVariants:{},compoundVariants:[[{active:!1,draggingInProgress:!0},"_3dmbka3"]]});function rp(o,e){return At(o,e)}var Hi=class extends jn{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 rp(this.data,t)?!1:(this.data=t,!0)}getData(){return this.data}isEqual(t){return rp(this.data,t.getData())}acceptsSelfDrops(){return!this.data.acceptDropsFrom||this.data.acceptDropsFrom.includes(this.data.listId)}acceptsDrop(t){let n=!0;return typeof this.data.shouldAcceptDrop=="function"&&(n=this.data.shouldAcceptDrop(t)),n=!!n,n!==this.previousAcceptsDropResult&&(this.previousAcceptsDropResult=n,n?this.emit("accept-feedback",t):this.emit("reject-feedback",t)),n}move(t){this.emit("move",t)}unregister(){this.emit("unregister",this)}start(t){let n=t.dragSourceListId===this.data.listId,{draggableItems:r}=this.data,i=r.length;this.breakpoints=r.map((a,l)=>n||l===i-1?this.data.orientation==="horizontal"?a.rect.left+a.rect.width/2:a.rect.top+a.rect.height/2:this.data.orientation==="horizontal"?a.rect.right:a.rect.bottom),this.activeDragSourcePosition=n?"inside":"outside",this.emit("start",t)}drop(t){let{dropIndex:n,dragIndex:r,items:i,dragSourceListId:a,dropTargetListId:l,dragItem:s,outside:c}=t,u=Array.from({length:i.length},(f,m)=>m),d=[];n===-1?d=u.filter(f=>f!==r):d=Wn(u,r,n>r?n-1:n);let p={dragIndex:r,dropIndex:n,dragItem:s,items:i,dragSourceListId:a,dropTargetListId:l,sortedIndexes:d,outside:c,status:t.status};this.emit("drop",p)}};var ap=nt.createContext({dragItemId:null,onDragItemPointerDown:()=>{},draggingInProgress:!1,dragListId:"",status:"accepted",dragSourceListId:null,dropTargetListId:null}),Er=()=>nt.useContext(ap),Iy=o=>{let{node:e,offset:t}=o;if(!t){e.style.transform="none";return}e.style.transform=`translate3d(${t.left}px, ${t.top}px, 0px)`},Ry=o=>`${o.getAttribute(xn)}`;function xy(o){let e=o.current?.querySelectorAll(Ki)??[];return!e||e.length,Array.from(e).map(n=>{let r=Ry(n),i=n.getBoundingClientRect();return{id:r,rect:i}})}function Py(o){let{domRef:e,orientation:t,dragListId:n}=o,r=Ce.from(e.current.getBoundingClientRect());return{draggableItems:xy(e),orientation:t,listId:n,listRectangle:r,acceptDropsFrom:o.acceptDropsFrom,shouldAcceptDrop:o.shouldAcceptDrop,initial:o.initial}}function lp(o){return new Hi(Py(o))}function Dy(o,e){let t=Me(e),[n,r]=nt.useState(null),i=(0,Pn.useCallback)(l=>{if(l)St.registerDragInteractionTarget(l);else{let s=a();s&&St.unregisterDragInteractionTarget(s)}r(l)},[]),a=Me(n);return(0,Pn.useEffect)(()=>St.on("register",l=>{let{dragListId:s,acceptDropsFrom:c,orientation:u,shouldAcceptDrop:d}=t(),p=l.getData();if(p.initial&&p.listId!==s&&c?.includes(p.listId)){let f=lp({domRef:o,orientation:u,dragListId:s,initial:!1,acceptDropsFrom:c,shouldAcceptDrop:d});l.once("unregister",()=>{i(null)}),i(f)}}),[t]),{interactionTarget:n,setInteractionTarget:i,getInteractionTarget:a}}var Qn=o=>{let e=nt.useRef(null),{dropTargetListId:t,dragSourceListId:n}=$n(),{updateDragOperationSourceAndTarget:r,dragItemId:i,status:a}=$n(),l=Me(o.onDrop),s=Me(o.onAcceptDrop),c=Me(o.onRemove),u=Me(o.updatePosition??Iy),{interactionTarget:d,setInteractionTarget:p}=Dy(e,o);(0,Pn.useEffect)(()=>{let T=document.querySelector(`[${ip}="${o.dragListId}"]`);T?e.current=T:console.warn(`DragList with id "${o.dragListId}" not found. You're probably not spreading the domProps to the parent element. Make sure you also include the "className" prop.`)},[o.dragListId]),(0,Pn.useEffect)(()=>{if(d){let T=o.dragListId,v=d.on("start",({dragItem:R,dragSourceListId:x,dropTargetListId:E})=>{r({dragSourceListId:x,dropTargetListId:E,dragItemId:R.id,status:"accepted"})}),w=d.on("move",({offsetsForItems:R,items:x,status:E})=>{if(E==="rejected")return;let A=m(),M=u();x.forEach((P,_)=>{let D=R[_],F=A[_];F&&M({id:P.id,node:F,offset:D})})}),I=d.on("drop",R=>{let{sortedIndexes:x,dragIndex:E,dropIndex:A,dragItem:M,items:P,dragSourceListId:_,dropTargetListId:D,outside:F,status:N}=R,W=m();f.current=[];let L=s(),X=c(),le=l(),ae=u();P.forEach((ie,se)=>{let pe=W[se];pe&&ae({id:ie.id,node:pe,offset:null})}),T===D&&_!==T&&L&&N==="accepted"&&L({dragItemId:M.id,dragSourceListId:_,dropTargetListId:D,dragIndex:E,dropIndex:A,dropItemId:P[A]?.id});let U=null;A===-1&&_===T&&D===T&&F&&(U=X),A!==-1&&D===T&&_===T&&(U=le),U&&U?.(x,{dragIndex:E,dropIndex:A,dragItemId:P[E].id,dropItemId:P[A]?.id})});return()=>{v(),w(),I()}}},[d,o.dragListId]);let f=nt.useRef([]),m=(0,Pn.useCallback)(()=>{let T=f.current;return(!T||T.length===0)&&(T=Array.from(e.current?.querySelectorAll(Ki)??[]),f.current=T),T},[]),g=(0,Pn.useCallback)(T=>{let v=T.currentTarget,w=v.getAttribute(xn);if(w==null){let F=wn(v,Ki);F&&(w=F.getAttribute(xn))}if(w==null){console.warn("Could not find drag item id for element",v,`Make sure you have a parent element with a ${xn} attribute`);return}w=`${w}`;let I=null,R=Array.from(e.current?.querySelectorAll(Ki)??[]);f.current=R;let x=lp({domRef:e,orientation:o.orientation,dragListId:o.dragListId,acceptDropsFrom:o.acceptDropsFrom,initial:!0}),E=x.getData().draggableItems,A=E.findIndex(F=>F.id===w),M=E[A];p(x);let P={left:T.clientX,top:T.clientY},_=F=>{I||(I=St.startDrag({listId:o.dragListId,dragItem:M,dragIndex:A},P)),I.move({left:F.clientX,top:F.clientY})},D=()=>{if(we().removeEventListener("pointermove",_),!I){p(null);return}I.drop(),I=null};we().addEventListener("pointermove",_),we().addEventListener("pointerup",D,{once:!0})},[o.orientation,o.dragListId,o.acceptDropsFrom,o.removeOnDropOutside]),b=T=>T===void 0?i!=null:`${T}`===i,h=!!i,y=nt.useMemo(()=>({dragItemId:i,onDragItemPointerDown:g,dragSourceListId:n,dropTargetListId:t,status:a,dragListId:o.dragListId,draggingInProgress:h}),[i,g,b,h,n,t,o.dragListId]),S={className:Z("DragList",h?"DragList--dragging":"",np({dragging:h})),[ip]:o.dragListId},C=typeof o.children=="function"?o.children(S,y):o.children;return nt.createElement(ap.Provider,{value:y},C)},ip="data-drag-list-id",xn="data-drag-item-id",Ki=`[${xn}]`,My=nt.createContext({dragItemId:"",dragListId:"",active:!1,draggingInProgress:!1,dragSourceListId:"",dropTargetListId:""}),Ey=o=>{let{onDragItemPointerDown:e,draggingInProgress:t,dragListId:n,dragItemId:r,dragSourceListId:i,dropTargetListId:a}=Er(),l=i===n&&r===`${o.id}`,s=nt.useMemo(()=>({dragItemId:o.id,active:l,dragListId:n,draggingInProgress:t,dragSourceListId:i,dropTargetListId:a}),[o.id,l,t,i,a]),c={"data-drag-item-id":`${o.id}`,onPointerDown:e,className:Z("DraggableItem",l?"DraggableItem--active":"",op({active:l,draggingInProgress:t}))},u=typeof o.children=="function"?o.children(c,s):o.children;return nt.createElement(My.Provider,{value:s},u)};Qn.DraggableItem=Ey;var os=G(require("react")),sp=o=>os.createElement(Ne,{...o,viewBox:"0 -960 960 960"},os.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=G(require("react"));function cp(){return{}}var up=o=>({allowColumnHideWhileDragging:e=>e??!0});var dp=require("react"),Ay=(0,dp.createContext)(null);function rs(){return Ay}var zt=G(require("react"));var to=G(require("react")),kt=require("react");var Bi=G(require("react"));function _y(o){let{height:e,width:t,count:n}=o;return Bi.createElement("div",{"data-count":n,"data-placeholder-width":void 0,"data-placeholder-height":void 0,"data-name":"SpacePlaceholder",style:{height:e,width:t,zIndex:-1,opacity:0,pointerEvents:"none",contain:"strict"}})}var pp=Bi.memo(_y);var fp="mlx2t3";var Wi=G(require("react")),Cp=require("react");var mp=require("react"),gp=(o,e)=>{(0,mp.useEffect)(()=>{let t=o?.current,n=i=>{let a=i.target;e?.({scrollTop:a.scrollTop,scrollLeft:a.scrollLeft})},r={passive:!1};return t?.addEventListener("scroll",n,r),()=>{t?.removeEventListener("scroll",n)}},[e,o?.current])};var hp={true:"_1ueijco2",false:"_1ueijco3",visible:"_1ueijco4",auto:"_1ueijco5",hidden:"_1ueijco6"},bp={true:"_1ueijco7",false:"_1ueijco8",visible:"_1ueijco9",auto:"_1ueijcoa",hidden:"_1ueijcob"},yp={true:"_1ueijcoc",false:"_1ueijcod",visible:"_1ueijcoe",auto:"_1ueijcof",hidden:"_1ueijcog"},is="_1ueijco1",Tp="_1ueijco0 _16lm1iw0";var Sp=o=>{let e="";return typeof o=="boolean"||typeof o=="string"?e=hp[`${o}`]:e=Z(bp[`${o.horizontal}`],yp[`${o.vertical}`]),e};var Oy="InfiniteVirtualScrollContainer";var wp=Wi.forwardRef(function(e,t){let{children:n,scrollable:r=!0,onContainerScroll:i,className:a,tabIndex:l,style:s,autoFocus:c}=e,u=t??(0,Cp.useRef)(null);return gp(u,i),Wi.createElement("div",{ref:u,style:s,autoFocus:c,tabIndex:l,className:Z(a,Oy,Tp,Sp(r))},n)});var Ji=G(require("react")),Lo=require("react");var vp=G(require("react")),as=require("react-dom"),_o=require("react");function Fy(o){let[e,t]=(0,_o.useState)(o.updater.get),n=(0,_o.useRef)(null);return(0,_o.useLayoutEffect)(()=>{function r(a){o.useraf?(n.current!=null&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{queueMicrotask(()=>{(0,as.flushSync)(()=>{t(a)})})})):queueMicrotask(()=>{(0,as.flushSync)(()=>{t(a)})})}let i=o.updater.onChange(r);return()=>{n.current!=null&&cancelAnimationFrame(n.current),i()}},[o.updater,o.useraf]),e??null}var Dn=vp.memo(Fy);var Ip=G(Bn());var ls=(o,e)=>o-e,ln={horizontal:!0,vertical:!0};function ji(o,e){let t=e.length;if(!t)return 0;let n=-1;for(let r=0;r<t;r++){let i=0,a=0;if(t-r<=n)break;for(let l=r;l<t;l++)if(i+=e[l],a++,i>o){a>n&&(n=a);break}}return n<0?t:Math.min(n,t)}var ss="DebugID=";function Mn(o,e){return e&&e.startsWith(ss)?e:e?`${ss}${o}:${e}`:`${ss}${o}`}var $i={start:0,end:0},cs=o=>{o()},us=o=>{let{start:e,end:t}=o,[n,r]=e,[i,a]=t,l=i-n,s=a-r;return l*s},Rp=o=>{let{start:e,end:t}=o,[n]=e,[r]=t;return r-n},Ar=typeof window<"u"?requestAnimationFrame:o=>setTimeout(o,0);function Ny(o){return o.horizontalChange||o.verticalChange}var Jn=class extends dt{constructor(t){let n=Mn(t,`${t}:MatrixBrain`);super(n);this.scrolling=!1;this.RENDER_COUNT_SAFETY_MARGIN_START=1;this.RENDER_COUNT_SAFETY_MARGIN_END=1;this.availableWidth=0;this.availableRenderWidth=0;this.isHorizontalLayoutBrain=!1;this.name="";this.availableHeight=0;this.availableRenderHeight=0;this.cols=0;this.rows=0;this.alwaysRenderedColumns=new Set;this._rowsPerPage=0;this.rowHeight=0;this.colWidth=0;this.verticalTotalSize=0;this.horizontalTotalSize=0;this.horizontalRenderCount=void 0;this.verticalRenderCount=void 0;this.maxHorizontalRenderCount=0;this.maxVerticalRenderCount=0;this.horizontalExtendRangeBy=$i;this.verticalExtendRangeBy=$i;this.horizontalRenderRange={startIndex:0,endIndex:0};this.verticalRenderRange={startIndex:0,endIndex:0};this.extraSpanCells=[];this.scrollPosition={scrollLeft:0,scrollTop:0};this.onScrollFns=[];this.onRenderRangeChangeFns=new Set;this.onVerticalRenderRangeChangeFns=new Set;this.onHorizontalRenderRangeChangeFns=new Set;this.onDestroyFns=[];this.destroyed=!1;this.onRenderCountChangeFns=new Set;this.onAvailableSizeChangeFns=new Set;this.onScrollStartFns=[];this.onScrollStopFns=[];this.scrollTimeoutId=0;this.scrollStopDelay=250;this.fixedColsStart=0;this.fixedColsEnd=0;this.fixedRowsStart=0;this.fixedRowsEnd=0;this.setScrollStopDelay=t=>{this.scrollStopDelay=t};this.getRowCount=()=>this.rows;this.getColCount=()=>this.cols;this.setScrolling=t=>{let n=this.scrolling;this.scrolling=t,t&&(this.scrollTimeoutId&&clearTimeout(this.scrollTimeoutId),this.scrollTimeoutId=setTimeout(()=>{this.setScrolling(!1),this.scrollTimeoutId=0},this.scrollStopDelay)),t!==n&&(t?this.notifyScrollStart():this.notifyScrollStop())};this.notifyScrollStart=()=>{if(this.destroyed)return;let t=this.onScrollStartFns;for(let n=0,r=t.length;n<r;n++)t[n]()};this.notifyScrollStop=()=>{if(this.destroyed)return;let t=this.onScrollStopFns,n=this.scrollPosition,r=this.getRenderRange();for(let i=0,a=t.length;i<a;i++)t[i](n,r)};this.notifyAvailableSizeChange=()=>{if(this.destroyed)return;let t=this.onAvailableSizeChangeFns,n=this.getAvailableSize();t.forEach(r=>{Ar(()=>{this.destroyed||t.has(r)&&r(n)})})};this.notifyVerticalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onVerticalRenderRangeChangeFns,r=this.verticalRenderRange,i=t?cs:Ar;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.notifyHorizontalRenderRangeChange=(t=!1)=>{if(this.destroyed)return;let n=this.onHorizontalRenderRangeChangeFns,r=this.horizontalRenderRange,i=t?cs:Ar;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a([r.startIndex,r.endIndex])})})};this.isColFixedEnd=t=>this.fixedColsEnd?t>=this.cols-this.fixedColsEnd:!1;this.isColFixedStart=t=>this.fixedColsStart?t<this.fixedColsStart:!1;this.isRowFixedEnd=t=>this.fixedRowsEnd?t>=this.rows-this.fixedRowsEnd:!1;this.isRowFixedStart=t=>this.fixedRowsStart?t<this.fixedRowsStart:!1;this.isColFixed=t=>this.isColFixedStart(t)||this.isColFixedEnd(t);this.isRowFixed=t=>this.isRowFixedStart(t)||this.isRowFixedEnd(t);this.getFixedEndColsWidth=()=>{if(!this.fixedColsEnd)return 0;let t=0;for(let n=this.cols-this.fixedColsEnd;n<this.cols;n++)t+=this.getColWidth(n);return t};this.getFixedEndColsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedColsEnd)return[];let{scrollLeft:n}=this.scrollPosition,{width:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=this.getColWidth(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.cols-this.fixedColsEnd;u<this.cols;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedEndRowsOffsets=({skipScroll:t}={skipScroll:!1})=>{if(!this.fixedRowsEnd)return[];let{scrollTop:n}=this.scrollPosition,{height:r}=this.getAvailableSize(),i=[],a=[],l=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=this.getRowHeight(u);a.push(d),l+=d}let s=r-l+(t?0:n);l=0;let c=0;for(let u=this.rows-this.fixedRowsEnd;u<this.rows;u++){let d=s+l;i[u]=d,l+=a[c],c++}return i};this.getFixedStartColsWidth=()=>{if(!this.fixedColsStart)return 0;let t=0;for(let n=0;n<this.fixedColsStart;n++)t+=this.getColWidth(n);return t};this.getFixedEndRowsHeight=()=>{if(!this.fixedRowsEnd)return 0;let t=0;for(let n=this.rows-this.fixedRowsEnd;n<this.rows;n++)t+=this.getRowHeight(n);return t};this.getFixedStartRowsHeight=()=>{if(!this.fixedRowsStart)return 0;let t=0;for(let n=0;n<this.fixedRowsStart;n++)t+=this.getRowHeight(n);return t};this.computeRenderCount=(t=ln)=>{let n=t.horizontal,r=t.vertical,i=this.horizontalRenderCount||0,a=this.verticalRenderCount||0;return n&&(i=this.computeDirectionalRenderCount("horizontal",this.colWidth,this.cols,this.getAvailableRenderSize())),r&&(a=this.computeDirectionalRenderCount("vertical",this.rowHeight,this.rows,this.getAvailableRenderSize())),{horizontal:i,vertical:a}};this.setRenderCount=({horizontal:t,vertical:n})=>{t===void 0&&(t=this.horizontalRenderCount),n===void 0&&(n=this.verticalRenderCount);let r=t===this.horizontalRenderCount,i=n===this.verticalRenderCount;r&&i||(this.horizontalRenderCount=t,this.verticalRenderCount=n,this.updateRenderRange({horizontal:!r,vertical:!i}),this.notifyRenderCountChange())};this.updateFixedCells=t=>{t.fixedColsStart!=this.fixedColsStart&&(this.fixedColsStart=t.fixedColsStart||0),t.fixedColsEnd!=this.fixedColsEnd&&(this.fixedColsEnd=t.fixedColsEnd||0),t.fixedRowsStart!=this.fixedRowsStart&&(this.fixedRowsStart=t.fixedRowsStart||0),t.fixedRowsEnd!=this.fixedRowsEnd&&(this.fixedRowsEnd=t.fixedRowsEnd||0)};this.getFixedCellInfo=()=>{let{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}=this;return{fixedRowsStart:t,fixedColsStart:n,fixedRowsEnd:r,fixedColsEnd:i}};this.updateRenderRange=(t=ln)=>{this.setRenderRange(this.computeRenderRange(t))};this.getExtraSpanCellsForRange=({horizontal:t,vertical:n})=>{let{colspan:r,rowspan:i}=this,a=[];if(i){let l=n.startIndex,s=t.startIndex,c=t.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(l,u,"vertical");let d=this.rowspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([p,u])}}}if(r){let l=t.startIndex,s=n.startIndex,c=n.endIndex;for(let u=s;u<c;u++){this.computeItemSpanUpTo(u,l,"horizontal");let d=this.colspanParent.get(u);if(d[l]!=l){let p=l;for(;d[p]!=p;)p--;a.push([u,p])}}}return a};this.computeRenderRange=(t=ln)=>{let n=t.horizontal?this.computeDirectionalRenderRange("horizontal"):this.horizontalRenderRange,r=t.vertical?this.computeDirectionalRenderRange("vertical"):this.verticalRenderRange;return{horizontal:n,vertical:r,extraCells:this.getExtraSpanCellsForRange({horizontal:n,vertical:r})}};this.computeDirectionalRenderRange=t=>{let n=t==="horizontal"?this.colWidth:this.rowHeight,r=t==="horizontal"?this.horizontalRenderCount:this.verticalRenderCount,i=t==="horizontal"?this.cols:this.rows;if(!r)return{startIndex:0,endIndex:0};let a=(t==="horizontal"?this.fixedColsStart:this.fixedRowsStart)||0,l=t==="horizontal"?this.scrollPosition.scrollLeft:this.scrollPosition.scrollTop;l+=this.getFixedStartSize(t);let s=typeof n!="function",c=t==="horizontal"?this.horizontalExtendRangeBy:this.verticalExtendRangeBy,u=this.getItemAt(l,t),d=c.start||0,p=c.end||0;s||(d+=this.RENDER_COUNT_SAFETY_MARGIN_START,p+=this.RENDER_COUNT_SAFETY_MARGIN_END),d&&(u=Math.max(0,u-d),r+=d),p&&(r+=p);let f=u+r,m=Math.max(a,i-(t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd));return f>m&&(f=m,u=Math.max(a,f-r)),{startIndex:u,endIndex:f}};this.getItemAt=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.cols:this.rows;if(typeof r!="function")return Math.min(Math.max(0,Math.floor(t/r)),i-1);let a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n==="horizontal"?this.colWidthCache:this.rowHeightCache,s=a.length-1,c=l.length-1,u=a[s],d;for(;u<t;)if(s>=i||(c+=1,this.computeCacheFor(c,n),d=u,u=a[c],d===u&&d!=0))return i-1;let p=(0,Ip.default)(a,t,ls);return p>=0?p:~p-1};this.computeCacheFor=(t,n)=>{let r=n==="horizontal"?this.colWidth:this.rowHeight,i=n==="horizontal"?this.colWidthCache:this.rowHeightCache,a=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache;if(typeof r!="function")return;let l=r(t);if(i[t]=l,t>0){let s=a[t-1],c=i[t-1];s==null&&console.error(`Offset was not available for ${n==="horizontal"?"col":"row"} ${t-1}`),c==null&&console.error(`Size was not available for ${n==="horizontal"?"col":"row"} ${t-1}`);let u=s+c;a[t]=u}};this.computeItemSpanUpTo=(t,n,r)=>{let i=r==="horizontal"?n:t,a=r==="horizontal"?t:n,l=r==="horizontal"?this.cols:this.rows,s=r==="horizontal"?this.colspan:this.rowspan;if(!s)return;let c=r==="horizontal"?this.colspanParent:this.rowspanParent;c.has(a)||c.set(a,[]);let u=r==="horizontal"?this.colspanValue:this.rowspanValue;u.has(a)||u.set(a,[]);let d=c.get(a),p=u.get(a);if(d[i]===void 0){let f=d.length,m=l?Math.min(i,l-1):0,g={rowIndex:t,colIndex:n};for(;f<=m;f++)if(d[f]===void 0){g[r==="horizontal"?"colIndex":"rowIndex"]=f;let b=s(g);d[f]=f,p[f]=b;let h=f;for(;b>1;)h+=1,d[h]=f,p[h]=0,b-=1}}};this.getCellSpan=(t,n,r)=>{let i=r==="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return 1;let s=r==="horizontal"?this.colspanValue:this.rowspanValue,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]||1};this.getRowspan=(t,n)=>this.getCellSpan(t,n,"vertical");this.getColspan=(t,n)=>this.getCellSpan(t,n,"horizontal");this.getRowspanParent=(t,n)=>this.getItemSpanParent(t,n,"vertical");this.getColspanParent=(t,n)=>this.getItemSpanParent(t,n,"horizontal");this.getItemSpanParent=(t,n,r)=>{let i=r=="horizontal"?this.colspan:this.rowspan,a=r==="horizontal"?n:t,l=r==="horizontal"?t:n;if(!i)return a;let s=r==="horizontal"?this.colspanParent:this.rowspanParent,c=s.get(l);return(!c||c[a]===void 0)&&this.computeItemSpanUpTo(t,n,r),c||(c=s.get(l)),c[a]};this.getRowHeightWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"vertical");this.getColWidthWithSpan=(t,n,r)=>this.getItemSizeWithSpan(t,n,r,"horizontal");this.getItemSizeWithSpan=(t,n,r,i)=>{let a=i==="horizontal"?n:t,l=this.getItemSize(a,i);for(;r>1;)a+=1,r-=1,l+=this.getItemSize(a,i);return l};this.getRowHeight=t=>this.getItemSize(t,"vertical");this.getColWidth=t=>this.getItemSize(t,"horizontal");this.getItemSize=(t,n)=>{let r=n==="horizontal"?this.cols:this.rows,i=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof i!="function")return i;let a=this.getItemSizeCacheFor(t,n),l=n==="horizontal"?this.colWidthCache:this.rowHeightCache;if(a===void 0){let s=l.length,c=Math.min(t,r-1);for(;s<=c;s++)this.computeCacheFor(s,n);a=this.getItemSizeCacheFor(t,n)}return a};this.keepColumnRendered=t=>(this.alwaysRenderedColumns.add(t),()=>{this.alwaysRenderedColumns.delete(t)});this.getAlwaysRenderedColumns=()=>Array.from(this.alwaysRenderedColumns);this.setRenderRange=({horizontal:t,vertical:n,extraCells:r})=>{let i=!1;(t.startIndex!==this.horizontalRenderRange.startIndex||t.endIndex!==this.horizontalRenderRange.endIndex)&&(this.horizontalRenderRange=t,i=!0);let a=!1;(n.startIndex!==this.verticalRenderRange.startIndex||n.endIndex!==this.verticalRenderRange.endIndex)&&(this.verticalRenderRange=n,a=!0),this.extraSpanCells=r||[],(i||a)&&this.notifyRenderRangeChange(),a&&this.notifyVerticalRenderRangeChange(),i&&this.notifyHorizontalRenderRangeChange()};this.getRenderRangeCellCount=us;this.getMaxCellCount=()=>this.maxHorizontalRenderCount*this.maxVerticalRenderCount;this.getExtraCells=()=>this.extraSpanCells;this.getScrollPosition=()=>this.scrollPosition;this.getRenderRange=()=>({start:[this.verticalRenderRange.startIndex,this.horizontalRenderRange.startIndex],end:[this.verticalRenderRange.endIndex,this.horizontalRenderRange.endIndex]});this.onScroll=t=>(this.onScrollFns.push(t),()=>{this.onScrollFns=this.onScrollFns.filter(n=>n!==t)});this.onScrollStart=t=>(this.onScrollStartFns.push(t),()=>{this.onScrollStartFns=this.onScrollStartFns.filter(n=>n!==t)});this.onScrollStop=t=>(this.onScrollStopFns.push(t),()=>{this.onScrollStopFns=this.onScrollStopFns.filter(n=>n!==t)});this.onRenderRangeChange=t=>(this.onRenderRangeChangeFns.add(t),()=>{this.onRenderRangeChangeFns.delete(t)});this.onVerticalRenderRangeChange=t=>(this.onVerticalRenderRangeChangeFns.add(t),()=>{this.onVerticalRenderRangeChangeFns.delete(t)});this.onHorizontalRenderRangeChange=t=>(this.onHorizontalRenderRangeChangeFns.add(t),()=>{this.onHorizontalRenderRangeChangeFns.delete(t)});this.onRenderCountChange=t=>(this.onRenderCountChangeFns.add(t),()=>{this.onRenderCountChangeFns.delete(t)});this.onAvailableSizeChange=t=>(this.onAvailableSizeChangeFns.add(t),()=>{this.onAvailableSizeChangeFns.delete(t)});this.onDestroy=t=>(this.onDestroyFns.push(t),()=>{this.onDestroyFns=this.onDestroyFns.filter(n=>n!==t)});this.getAvailableSize=()=>({width:this.availableWidth,height:this.availableHeight});this.getAvailableRenderSize=()=>({width:this.availableRenderWidth??this.availableWidth,height:this.availableRenderHeight??this.availableHeight});this.name=n,this.update=this.update.bind(this),this.destroy=this.destroy.bind(this),this.getCellOffset=this.getCellOffset.bind(this),this.reset()}set rowsPerPage(t){t!=this._rowsPerPage&&(this._rowsPerPage=t)}get rowsPerPage(){return this._rowsPerPage}reset(t=ln){t.vertical&&this.resetVertical(),t.horizontal&&this.resetHorizontal(),this.extraSpanCells=[]}resetVertical(){this.rowspanParent=new Map,this.rowspanValue=new Map,this.rowHeightCache=[],this.rowOffsetCache=[0],this.verticalRenderCount=void 0,this.verticalTotalSize=0,this.verticalRenderRange={startIndex:0,endIndex:0}}resetHorizontal(){this.colspanParent=new Map,this.colspanValue=new Map,this.colWidthCache=[],this.colOffsetCache=[0],this.horizontalRenderCount=void 0,this.horizontalTotalSize=0,this.horizontalRenderRange={startIndex:0,endIndex:0}}getVirtualColIndex(t,n){return t}update(t,n){let{rows:r,cols:i,rowHeight:a,colWidth:l,width:s,height:c}=t,u=typeof s=="number",d=typeof c=="number",p=u&&s!==this.availableWidth,f=d&&c!==this.availableHeight;p&&(this.availableWidth=s,this.availableRenderWidth=s),f&&(this.availableHeight=c,this.availableRenderHeight=c),(p||f)&&this.notifyAvailableSizeChange();let m=typeof r=="number",g=typeof i=="number",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,C=y&&a!==this.rowHeight,T=S&&l!==this.colWidth;y&&(this.rowHeight=a),S&&(this.colWidth=l);let v=t.rowspan!=null,w=t.colspan!=null,I=v&&t.rowspan!=this.rowspan,R=w&&t.colspan!=this.colspan;I&&(this.rowspan=t.rowspan),R&&(this.colspan=t.colspan);let x=h||T||p||R,E=b||C||f||I;(n||Ny)({horizontalChange:x,verticalChange:E,colsChanged:h,colWidthChanged:T,widthChanged:p,colspanChanged:R,rowsChanged:b,rowHeightChanged:C,heightChanged:f,rowspanChanged:I})&&this.updateRenderCount({horizontal:x,vertical:E})}extendRenderRange(t){let{direction:n}=t,r=n==="horizontal",i=r?this.horizontalRenderCount||this.getInitialCols():this.verticalRenderCount||this.getInitialRows(),a=typeof t.start=="number"?t.start:t.start===!0?i:0,l=typeof t.end=="number"?t.end:t.end===!0?i:0;return r?this.horizontalExtendRangeBy={start:a,end:l}:this.verticalExtendRangeBy={start:a,end:l},this.updateRenderRange({horizontal:r,vertical:!r}),()=>{this.extendRenderRange({start:0,end:0,direction:n})}}updateRenderCount(t=ln){this.reset(t),this.doUpdateRenderCount(t)}doUpdateRenderCount(t=ln){if(!this.availableWidth||!this.availableHeight){let n={horizontal:void 0,vertical:void 0};this.availableWidth||(n.horizontal=0),this.availableHeight||(n.vertical=0),this.setRenderCount(n)}this.setRenderCount(this.computeRenderCount(t))}get scrollTopMax(){return this.getVirtualizedContentSize().height-this.availableHeight}get scrollLeftMax(){return this.getVirtualizedContentSize().width-this.availableWidth}setScrollPosition(t,n){this.setScrolling(!0);let r=t.scrollLeft!==this.scrollPosition.scrollLeft,i=t.scrollTop!==this.scrollPosition.scrollTop;this.scrollPosition=t,(r||i)&&(n?.(t),this.updateRenderRange({horizontal:r,vertical:i}),this.notifyScrollChange())}notifyRenderRangeChange(t=!1){if(this.destroyed)return;let n=this.onRenderRangeChangeFns,r=this.getRenderRange(),i=t?cs:Ar;n.forEach(a=>{i(()=>{this.destroyed||n.has(a)&&a(r)})})}notifyScrollChange(){if(this.destroyed)return;let{scrollPosition:t}=this,n=this.onScrollFns;for(let r=0,i=n.length;r<i;r++)n[r](t)}computeDirectionalRenderCount(t,n,r,i){let a=0,l=t==="horizontal"?i.width:i.height;if(l-=this.getFixedSize(t),l<=0)return 0;let s=t==="horizontal"?this.fixedColsStart:this.fixedRowsStart,c=t==="horizontal"?this.fixedColsEnd:this.fixedRowsEnd;if(typeof n=="function"){let u=[],d=0,p=r;d+=s,p-=c;for(let f=d;f<p;f++)u.push(this.getItemSize(f,t));a=ji(l,u)}else a=(n?Math.ceil(l/n):0)+1;return a+=s+c,t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getFixedSize(t){return t==="horizontal"?this.getFixedStartColsWidth()+this.getFixedEndColsWidth():this.getFixedStartRowsHeight()+this.getFixedEndRowsHeight()}getFixedStartSize(t){return t==="horizontal"?this.getFixedStartColsWidth():this.getFixedStartRowsHeight()}getFixedEndSize(t){return t==="horizontal"?this.getFixedEndColsWidth():this.getFixedEndRowsHeight()}notifyRenderCountChange(){if(this.destroyed)return;let{horizontalRenderCount:t,verticalRenderCount:n}=this,r={horizontal:t,vertical:n},i=this.onRenderCountChangeFns;i.forEach(a=>{Ar(()=>{this.destroyed||i.has(a)&&a(r)})})}getCellOffset(t,n){return{x:this.getItemOffsetFor(n,"horizontal"),y:this.getItemOffsetFor(t,"vertical")}}getInitialRowHeight(){return this.rowHeight}getInitialCols(){return this.cols}getInitialRows(){return this.rows}getItemOffsetFor(t,n){let r=n==="horizontal"?this.colWidth:this.rowHeight;if(typeof r!="function")return t*r;let i=n==="horizontal"?this.colOffsetCache:this.rowOffsetCache,a=n==="horizontal"?this.colWidthCache:this.rowHeightCache,l=i[t];if(l==null){let s=a.length-1;for(;s<t;)s+=1,this.computeCacheFor(s,n);l=i[t]}return l}getItemSizeCacheFor(t,n){return(n==="horizontal"?this.colWidthCache:this.rowHeightCache)[t]}getRowIndexInPage(t){return t}getPageIndexForRow(t){return 0}getVirtualizedContentSize(){return{height:this.getVirtualizedContentSizeFor("vertical"),width:this.getVirtualizedContentSizeFor("horizontal")}}getVirtualizedContentSizeFor(t){let n=t==="horizontal"?this.cols:this.rows,r=t==="horizontal"?this.colWidth:this.rowHeight,i=t==="horizontal"?this.horizontalTotalSize:this.verticalTotalSize;if(typeof r!="function")return r*n;if(i!==0&&!isNaN(i))return i;let a=t==="horizontal"?this.colOffsetCache:this.rowOffsetCache,l=n?this.getItemSize(n-1,t):0,s=n?a[n-1]:0,c=l+s;return t==="horizontal"?this.horizontalTotalSize=c:this.verticalTotalSize=c,c}notifyDestroy(){let t=this.onDestroyFns;for(let n=0,r=t.length;n<r;n++)t[n]()}destroy(){this.destroyed||(this.notifyDestroy(),this.reset(),this.rowspanParent.clear(),this.colspanParent.clear(),this.alwaysRenderedColumns.clear(),this.horizontalExtendRangeBy=$i,this.verticalExtendRangeBy=$i,this.destroyed=!0,this.onDestroyFns=[],this.onScrollFns=[],this.onScrollStartFns=[],this.onScrollStopFns=[],this.onRenderCountChangeFns.clear(),this.onRenderRangeChangeFns.clear(),this.onVerticalRenderRangeChangeFns.clear(),this.onHorizontalRenderRangeChangeFns.clear())}};var ps=G(Bn());function xp(...o){if(!o.length)return new Set;let[e,...t]=o;return new Set([...e].filter(n=>t.every(r=>r.has(n))))}function Pp(o,e){let t=new Set;for(let n of o)e(n)&&t.add(n);return t}function _r(o,e){for(let t of o)if(e(t))return t}var Mp=G(require("react"));var Dp=new Map,Ly=()=>{},ds=class{constructor(e,t){this.element=null;this.mounted=!1;this.mountSubscription=be();let n=Dp.get(e)??0,r=`${e}:GridCellReact:${n}`;Dp.set(e,n+1),this.debugId=r,this.cellInfo=t,this.updater=be(),this.node=Mp.createElement(Dn,{key:r,name:r,updater:this.updater}),this.ref=i=>{this.element=i,i?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=Ly,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}},Oo=class Oo extends dt{constructor(t){super(`${t}:GridCellPoolForReact`);this.debugId=t;this.cellRemoveSubscription=be();this.cellAttachmentChangeSubscription=be();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 ds(this.debugId);return this.detachedCells.add(t),this.allCellsOrdered.add(t),t}removeCell(t){this.detachedCells.delete(t),this.attachedCells.delete(t),this.allCellsOrdered.delete(t),t.destroy(),this.cellRemoveSubscription(t)}attachCell(t){return t&&this.attachedCells.has(t)||(t||(t=this.getDetachedCell()),this.detachedCells.delete(t),this.attachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!0})),t}detachCell(t){return this.detachedCells.has(t)?!1:(this.attachedCells.delete(t),this.detachedCells.add(t),this.cellAttachmentChangeSubscription({cell:t,attached:!1}),!0)}getDetachedCell(){let{detachedCells:t}=this,n=t.values().next().value;return n||(this.poolSize+=Oo.POOL_SIZE_INCREMENT,n=t.values().next().value),n||this.error("No cells available in the pool!"),n}get attachedSize(){return this.attachedCells.size}get detachedSize(){return this.detachedCells.size}get poolSize(){return this.allCellsOrdered.size}set poolSize(t){t=Math.ceil(t/Oo.POOL_SIZE_INCREMENT)*Oo.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedCells:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more cells than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeCell(l),i--}}else for(i=-i;i>0;)this.createCell(),i--}};Oo.POOL_SIZE_INCREMENT=1;var Ui=Oo;var Yi=(o,e)=>o-e,qi=class extends dt{constructor(t){super(`${t}:GridCellManager`);this.matrix=new Q;this.rowsWithCellsHistory=new Map;this.columnsWithCellsHistory=new Map;this.cellToMatrixPosition=new WeakMap;this.getCellsOutsideRenderRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r,c=new Set;return this.matrix.visit(({value:u},d)=>{if(!u)return;let[p,f]=d,m=p<i,g=p>=l,b=f<a,h=f>=s;(m||g||b||h)&&c.add(u)}),c};this.debugId=t,this.pool=new Ui(t),this.offRemoveCell=this.pool.onRemoveCell(n=>this.onRemoveCell(n))}onRemoveCell(t){let n=this.cellToMatrixPosition.get(t);this.cellToMatrixPosition.delete(t),n&&this.clearCellFromMatrix(t,n,{skipHistory:!1})}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedCell(){return this.pool.getDetachedCell()}clearCellFromMatrix(t,n,r){if(this.matrix.delete(n),r.skipHistory)return;let[i,a]=n,l=this.rowsWithCellsHistory.get(i),s=this.columnsWithCellsHistory.get(a);l&&(l.delete(t),l.size===0&&this.rowsWithCellsHistory.delete(i)),s&&(s.delete(t),s.size===0&&this.columnsWithCellsHistory.delete(a))}addCellToMatrix(t,n){let[r,i]=n;this.matrix.set(n,t),this.cellToMatrixPosition.set(t,n);let a=this.rowsWithCellsHistory.get(r),l=this.columnsWithCellsHistory.get(i);a?a.add(t):(a=new Set,a.add(t),this.rowsWithCellsHistory.set(r,a)),l?l.add(t):(l=new Set,l.add(t),this.columnsWithCellsHistory.set(i,l))}setCellPositionInMatrix(t,n){let r=this.cellToMatrixPosition.get(t);if(n==null){r&&this.clearCellFromMatrix(t,r,{skipHistory:!0});return}let[i,a]=n,l=r&&r[0]===i&&r[1]===a;r&&!l&&this.clearCellFromMatrix(t,r,{skipHistory:!1}),this.addCellToMatrix(t,n)}renderNodeAtCell(t,n,r,i){let a=this.getCellAt(r);return a&&a!==n&&this.detachCellAt(r),this.pool.attachCell(n),this.setCellPositionInMatrix(n,r),n.update(t,i),n}getCellPosition(t){let n=this.cellToMatrixPosition.get(t);return!n||this.getCellAt(n)!=t?null:n}getCellAt(t){return this.matrix.get(t)}getCellFor(t,n){let r=this.getCellAt(t);if(r)return r;let[i,a]=t;if(n==="row"){let l=this.rowsWithCellsHistory.get(i);l&&(r=_r(l,s=>!this.isCellAttached(s)))}if(n==="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 n=this.getCellAt(t);return n?this.isCellAttached(n):!1}getMatrix(){let t=this.getRowsWithCells().pop()??-1,n=this.getColumnsWithCells().pop()??-1;return Array.from({length:t+1},(i,a)=>Array.from({length:n+1},(s,c)=>{let u=[a,c],d=this.getCellAt(u);return d?d.getNode():null}))}getAllCells(){return[...this.pool.getAllCells()]}getCellsForRow(t){return this.matrix.getKeysStartingWith([t]).map(n=>this.getCellAt(n)).filter(Boolean)}getOneAttachedCell(){return this.pool.getAttachedCells().values().next().value}getRowsWithCells(){return this.matrix.rawKeysAt([]).sort(Yi)}getColumnsWithCells(){let t=this.matrix.getKeysOfFirstChildOnEachBranchStartingWith([],{excludeSelf:!0});return[...new Set(t.map(r=>r[1])).values()].sort(Yi)}isRowAttached(t){return this.getRowsWithCells().includes(t)}isColumnAttached(t){return this.getColumnsWithCells().includes(t)}detachRow(t){this.matrix.getKeysStartingWith([t]).forEach(r=>this.detachCellAt(r))}detachCol(t){this.matrix.visit((n,r)=>{r[1]===t&&this.detachCellAt(r)})}detachCell(t){return t?(this.pool.detachCell(t)&&this.setCellPositionInMatrix(t,null),!0):!1}detachCells(t){t.forEach(n=>this.detachCell(n))}detachRowsStartingWith(t){let n=this.getRowsWithCells().sort(),r=(0,ps.default)(n,t,Yi);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRow(a))}detachColsStartingWith(t){let n=this.getColumnsWithCells().sort(),r=(0,ps.default)(n,t,Yi);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachCol(a))}detachCellsStartingAt(t){let[n,r]=t;this.matrix.visit((i,a)=>{let[l,s]=a;l>n&&this.detachCellAt(a),l===n&&s>=r&&this.detachCellAt(a)})}detachCellAt(t){let n=this.getCellAt(t);return n?this.detachCell(n):!1}onCellAttachmentChange(t){return this.pool.onCellAttachmentChange(t)}getCellFromListForRow(t,n){return _r(t,r=>this.getCellPosition(r)?.[0]===n)}getCellFromListForColumn(t,n){return _r(t,r=>this.getCellPosition(r)?.[1]===n)}getCellCountInMatrix(){return this.matrix.size}destroy(){this.reset()}reset(){this.pool.reset(),this.matrix.clear(),this.rowsWithCellsHistory.clear(),this.columnsWithCellsHistory.clear(),this.offRemoveCell(),this.offRemoveCell=()=>{}}makeDetachedCellsEmpty(){this.pool.getDetachedCells().forEach(t=>{t.update(null)})}withDetachedCells(t){this.pool.getDetachedCells().forEach(t)}};var _p=G(Bn());var Ap=G(require("react"));var Ep=new Map,ky=()=>{},fs=class{constructor(e){this.element=null;this.mounted=!1;this.mountSubscription=be();let t=Ep.get(e)??0,n=`${e}:ListRowReact:${t}`;Ep.set(e,t+1),this.debugId=n,this.updater=be(),this.node=Ap.createElement(Dn,{key:`detail-row-${n}`,name:`detail-row-${n}`,updater:this.updater}),this.ref=r=>{this.element=r,r?(this.mounted=!0,this.mountSubscription(this)):this.mounted=!1}}isMounted(){return this.mounted}onMount(e){return this.mountSubscription.onChange(n=>{n!=null&&e(n)})}destroy(){this.mountSubscription.destroy(),this.updater.destroy(),this.ref=ky,this.element=null,this.node=null}getNode(){return this.node}update(e){this.updater(e)}getElement(){return this.element}},Fo=class Fo extends dt{constructor(t){super(`${t}:ListRowPoolForReact`);this.debugId=t;this.rowRemoveSubscription=be();this.rowAttachmentChangeSubscription=be();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 fs(this.debugId);return this.detachedRows.add(t),this.allRowsOrdered.add(t),t}removeRow(t){this.detachedRows.delete(t),this.attachedRows.delete(t),this.allRowsOrdered.delete(t),t.destroy(),this.rowRemoveSubscription(t)}attachRow(t){return t&&this.attachedRows.has(t)||(t||(t=this.getDetachedRow()),this.detachedRows.delete(t),this.attachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!0})),t}detachRow(t){return this.detachedRows.has(t)?!1:(this.attachedRows.delete(t),this.detachedRows.add(t),this.rowAttachmentChangeSubscription({row:t,attached:!1}),!0)}getDetachedRow(){let{detachedRows:t}=this,n=t.values().next().value;return n||(this.poolSize+=Fo.POOL_SIZE_INCREMENT),n=t.values().next().value,n||this.error("No rows available in the pool!"),n}get attachedSize(){return this.attachedRows.size}get detachedSize(){return this.detachedRows.size}get poolSize(){return this.allRowsOrdered.size}set poolSize(t){t=Math.ceil(t/Fo.POOL_SIZE_INCREMENT)*Fo.POOL_SIZE_INCREMENT;let n=this.poolSize;if(t===n)return;let{detachedRows:r}=this,i=n-t;if(i>0){i>r.size&&(i=r.size,this.debug("Trying to destroy more rows than are currently detached!"));let a=r.values();for(;i>0;){let l=a.next().value;this.removeRow(l),i--}}else for(i=-i;i>0;)this.createRow(),i--}};Fo.POOL_SIZE_INCREMENT=1;var Xi=Fo;var Zi=class extends dt{constructor(t){super(`${t}:ListRowManager`);this.indexToRow=new Map;this.rowToIndex=new WeakMap;this.debugId=t,this.pool=new Xi(t),this.offRemoveRow=this.pool.onRemoveRow(n=>this.onRemoveRow(n))}onRemoveRow(t){let n=this.rowToIndex.get(t);n!=null&&(this.rowToIndex.delete(t),this.indexToRow.delete(n))}set poolSize(t){this.pool.poolSize=t}get poolSize(){return this.pool.poolSize}getDetachedRow(){return this.pool.getDetachedRow()}getRowFor(t){return this.getRowAt(t)??this.getDetachedRow()}setRowIndexInList(t,n){let r=this.rowToIndex.get(t);r!=null&&this.indexToRow.delete(r),n==null?this.rowToIndex.delete(t):(this.rowToIndex.set(t,n),this.indexToRow.set(n,t))}detachStartingWith(t){let n=this.getAttachedIndexes(),r=(0,_p.default)(n,t,(a,l)=>a-l);r<0&&(r=~r),n.slice(r).forEach(a=>this.detachRowAt(a))}getRowAt(t){return this.indexToRow.get(t)}getRowIndex(t){return this.rowToIndex.get(t)}isRowAttached(t){return this.getRowIndex(t)!=null}isRowAttachedAt(t){return!!this.getRowAt(t)}getList(){let t=Math.max(...this.indexToRow.keys());return Array.from({length:t+1},(r,i)=>{let a=this.indexToRow.get(i);return a?a.getNode():null})}getAttachedCount(){return this.indexToRow.size}forEachAttachedRow(t){this.indexToRow.forEach(t)}getAttachedIndexes(){return Array.from(this.indexToRow.keys()).sort()}getAllRows(){return[...this.pool.getAllRows()]}detachRowAt(t){let n=this.getRowAt(t);n&&(this.setRowIndexInList(n,null),this.pool.detachRow(n))}detachRow(t){let n=this.getRowIndex(t);n!=null&&this.detachRowAt(n)}renderNodeAtRow(t,n,r){let i=this.getRowAt(r);return i&&i!==n&&this.detachRowAt(r),this.pool.attachRow(n),this.setRowIndexInList(n,r),n.update(t),n}makeDetachedRowsEmpty(){this.pool.getDetachedRows().forEach(t=>{t.update(null)})}onRowAttachmentChange(t){return this.pool.onRowAttachmentChange(t)}withDetachedRows(t){this.pool.getDetachedRows().forEach(t)}destroy(){this.reset()}reset(){this.pool.reset(),this.indexToRow.clear(),this.offRemoveRow(),this.offRemoveRow=()=>{}}};var Op=!0,eo=q($.y),Fp=q($.scrollTop),WM=q($.columnOffsetAtIndex),ms=q($.columnOffsetAtIndexWhileReordering),No=class extends dt{constructor(t,n){n=n||"ReactHeadlessTableRenderer";super(n);this.debugId="";this.destroyed=!1;this.scrolling=!1;this.cellHoverClassNames=[];this.cellDetachedClassNames=[];this.lastEnteredRow=-1;this.lastExitedRow=-1;this.hoverRowUpdatesInProgress=new Map;this.infiniteNode=null;this.setDetailTransform=(t,n,{y:r,scrollTop:i,scrollLeft:a})=>{t.style.setProperty(eo,i?`calc( ${r}px + var(${Fp}) )`:`${r}px`),t.style.transform=`translate3d(${a||0}px, var(${eo}), 0)`};this.setTransform=(t,n,r,{x:i,y:a,scrollLeft:l,scrollTop:s},c)=>{let u=Se.columnOffsets.get(r),d=`${ms}-${r}`,p=s?`calc( ${a}px + var(${Fp}) )`:`${a}px`;t.__currentTransformY!==p&&(t.__currentTransformY=p,t.style.setProperty(eo,p));let f=`translate3d(var(${d}, ${u}), var(${eo}), 0)`;t.__transformValue!==f&&(t.__transformValue=f,t.style.transform=f),c!=null};this.getFullyVisibleRowsRange=()=>{let{start:[t],end:[n]}=this.brain.getRenderRange();for(;!this.isRowFullyVisible(t);)if(t++,t===n)return null;for(;!this.isRowFullyVisible(n);)if(n--,n===t)return null;return{start:t,end:n}};this.getScrollPositionForScrollRowIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=i.scrollLeft,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isRowFullyVisible(t)&&!l)return i;let c=r.getItemOffsetFor(t,"vertical"),u=r.getItemSize(t,"vertical"),d=r.getFixedStartRowsHeight(),p=r.getFixedEndRowsHeight(),f=i.scrollTop,m=r.getAvailableSize();if(!m.height)return null;let g=f+m.height;l||(l=c>g-p?"end":c<f+d?"start":"end");let b=i.scrollTop;if(l==="center"?b=c-Math.floor((r.getAvailableSize().height-d-p)/2):l==="start"?(s=-s,b+=c-f+s-d):(s+=u,b+=c-g+s+p),this.brain.isHorizontalLayoutBrain){let h=n.colIndex??Math.ceil(this.brain.getInitialCols()/2),y=this.getScrollPositionForScrollColumnIntoView(h,{...n,horizontalLayoutPageIndex:this.brain.getPageIndexForRow(t)});y&&(a=y.scrollLeft)}return{scrollLeft:a,scrollTop:b}};this.getScrollPositionForScrollColumnIntoView=(t,n={offset:0})=>{if(this.destroyed)return null;let{brain:r}=this,i=r.getScrollPosition(),a=n.horizontalLayoutPageIndex!=null?{horizontalLayoutPageIndex:n.horizontalLayoutPageIndex}:void 0,{scrollAdjustPosition:l,offset:s=0}=n;if(this.isColumnFullyVisible(t,void 0,a)&&!l)return i;a&&(t=r.getInitialCols()*a.horizontalLayoutPageIndex+t);let c=r.getItemOffsetFor(t,"horizontal"),u=r.getItemSize(t,"horizontal"),d=r.getFixedStartColsWidth(),p=r.getFixedStartColsWidth(),f=i.scrollLeft,m=r.getAvailableSize();if(!m.width)return null;let g=f+m.width;l||(l=c>g-p?"end":c<f+d?"start":"end");let b=i.scrollLeft;return l==="center"?b=c-Math.floor((r.getAvailableSize().width-d-p)/2):l==="start"?(s=-s,b+=c-f+s-d):(s+=u,b+=c-g+s+p),{...i,scrollLeft:b}};this.getScrollPositionForScrollCellIntoView=(t,n,r={offsetLeft:0,offsetTop:0})=>{if(this.destroyed)return null;let i=this.getScrollPositionForScrollColumnIntoView(n,{scrollAdjustPosition:r.colScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetLeft}),a=this.getScrollPositionForScrollRowIntoView(t,{scrollAdjustPosition:r.rowScrollAdjustPosition||r.scrollAdjustPosition,offset:r.offsetTop});if(!i||!a)return null;let{scrollLeft:l}=i,{scrollTop:s}=a;return{scrollLeft:l,scrollTop:s}};this.isRowFullyVisible=(t,n=2)=>this.isRowVisible(t,this.brain.getRowHeight(t)-n);this.isRowVisible=(t,n=10)=>{if(!this.isRowRendered(t))return!1;t=this.brain.getPageIndexForRow(t)&&this.brain.rowsPerPage?t%this.brain.rowsPerPage:t;let{brain:i}=this;if(i.isRowFixed(t))return!0;let{start:[a],end:[l]}=this.brain.getRenderRange(),s=Math.floor((a+l)/2);if(t<a||t>=l)return!1;if(t>=s){let c=i.getItemAt(i.getAvailableSize().height+i.getScrollPosition().scrollTop-n,"vertical");return t<=c}if(t<s){let c=i.getItemAt(i.getScrollPosition().scrollTop+n,"vertical");return t>=c}return!0};this.isRowRendered=t=>{if(!this.brain.isHorizontalLayoutBrain)return this.cellManager.isRowAttached(t);let n=t;return t=this.brain.rowsPerPage?t%this.brain.rowsPerPage:t,this.cellManager.getCellsForRow(t).filter(r=>r.getAdditionalInfo()?.renderRowIndex===n).length>0};this.isCellVisible=(t,n)=>this.isRowVisible(t)&&this.isColumnVisible(n);this.isCellFullyVisible=(t,n,r)=>this.isRowFullyVisible(t)&&this.isColumnVisible(n,void 0,r);this.isColumnFullyVisible=(t,n=2,r)=>this.isColumnVisible(t,this.brain.getColWidth(t)-n,r);this.isColumnVisible=(t,n=10,r)=>{if(!this.isColumnRendered(t,r))return!1;let{brain:i}=this;if(i.isColFixed(t))return!0;r&&r.horizontalLayoutPageIndex!=null&&(t=i.getVirtualColIndex(t,{pageIndex:r.horizontalLayoutPageIndex}));let{start:[a,l],end:[s,c]}=i.getRenderRange();if(t<l||t>=c)return!1;let u=Math.floor((l+c)/2);if(t>=u){let d=i.getItemAt(i.getAvailableSize().width+i.getScrollPosition().scrollLeft-n-i.getFixedEndColsWidth(),"horizontal");return t<=d}if(t<u){let d=i.getItemAt(i.getScrollPosition().scrollLeft+n+i.getFixedStartColsWidth(),"horizontal");return t>=d}return!0};this.isCellRendered=(t,n,r)=>this.isRowRendered(t)&&this.isColumnRendered(n,r);this.isColumnRendered=(t,n)=>{let{start:[r]}=this.brain.getRenderRange();return n?.horizontalLayoutPageIndex!=null&&(t=this.brain.getInitialCols()*n.horizontalLayoutPageIndex+t),this.cellManager.isCellAttachedAt([r,t])};this.getExtraSpanCellsForRange=t=>{let{start:n,end:r}=t,[i,a]=n,[l,s]=r;return this.brain.getExtraSpanCellsForRange({horizontal:{startIndex:a,endIndex:s},vertical:{startIndex:i,endIndex:l}})};this.getFixedRanges=t=>{let{fixedRowsStart:n,fixedRowsEnd:r,fixedColsStart:i,fixedColsEnd:a}=this.brain.getFixedCellInfo();if(!n&&!i&&!r&&!a)return[];let l=this.brain.getColCount(),s=this.brain.getRowCount(),{start:c,end:u}=t,[d,p]=c,[f,m]=u,g=[];if(i&&(n&&g.push({rowFixed:"start",colFixed:"start",start:[0,0],end:[n,i]}),r&&g.push({rowFixed:"end",colFixed:"start",start:[s-r,0],end:[s,i]}),g.push({rowFixed:!1,colFixed:"start",start:[d,0],end:[f,i]})),a&&(n&&g.push({colFixed:"end",rowFixed:"start",start:[0,l-a],end:[n,l]}),r&&g.push({colFixed:"end",rowFixed:"end",start:[s-r,l-a],end:[s,l]}),g.push({colFixed:"end",rowFixed:!1,start:[d,l-a],end:[f,l]})),n){let b={start:[0,p],end:[n,m],rowFixed:"start",colFixed:!1};g.push(b)}if(r){let b={rowFixed:"end",colFixed:!1,start:[s-r,p],end:[s,m]};g.push(b)}return g};this.isCellFixed=(t,n)=>{let{fixedRowsStart:r,fixedRowsEnd:i,fixedColsStart:a,fixedColsEnd:l}=this.brain.getFixedCellInfo(),s=this.brain.getColCount(),c=this.brain.getRowCount(),u=!1,d=!1,p=!1;if(t<r&&(u=!0,p="start"),i&&!u){let f=c-i;t>=f&&(u=!0,p="end")}if(n<a&&(d=!0,p="start"),l&&!d){let f=s-l;n>=f&&(d=!0,p="end")}return{row:u?p:!1,col:d?p:!1}};this.isCellCovered=(t,n)=>{let r=this.brain.getRowspanParent(t,n),i=this.brain.getColspanParent(t,n),a=r!=t,l=i!=n;return a||l?[r,i]:!1};this.onMouseEnter=t=>{this.lastEnteredRow=t,this.lastExitedRow=-1,!this.scrolling&&t!=-1&&this.addHoverClass(t)};this.addHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.add(i)})})};this.onMouseLeave=t=>{this.lastExitedRow=t,this.lastEnteredRow=-1,!this.scrolling&&t!=-1&&this.removeHoverClass(t)};this.removeHoverClass=t=>{this.cellManager.getCellsForRow(t).forEach(n=>{let r=n.getElement();r&&this.cellHoverClassNames.forEach(i=>{r.classList.remove(i)})})};this.updateHoverClassNamesForRow=t=>{if(this.scrolling||this.hoverRowUpdatesInProgress.has(t))return;this.hoverRowUpdatesInProgress.set(t,!0);let n=()=>{!this.scrolling&&this.lastEnteredRow!=-1&&(this.lastEnteredRow===t?this.addHoverClass(t):this.removeHoverClass(t))};Le(()=>{this.destroyed||(n(),this.hoverRowUpdatesInProgress.delete(t))})};this.updateElementPosition=(t,n)=>{if(this.destroyed)return;let r=t.getElement(),i=this.cellManager.getCellPosition(t);if(!i)return;let[a,l]=i,s=this.brain.getCellOffset(a,l);if(s==null)return;let{x:c,y:u}=s;if(r){this.updateHoverClassNamesForRow(a);let d=this.getCellRealCoordinates(a,l);if(r.dataset.rowIndex=d.rowIndex,r.dataset.colIndex=d.colIndex,Op){this.setTransform(r,a,l,{x:c,y:u},null),r.style.willChange="transform",r.style.backfaceVisibility="hidden";let f=(n?n.hidden:!!this.isCellCovered(a,l))?"-1":r.dataset.zIndex||"auto";r.__zIndex!==f&&(r.__zIndex=f,r.style.zIndex=f)}else r.style.display="",r.style.left=`${c}px`,r.style.top=`${u}px`}};this.updateDetailElementPosition=t=>{if(this.destroyed)return;let n=t.getElement(),r=this.rowManager.getRowIndex(t);if(r==null)return;let i=this.brain.getItemOffsetFor(r,"vertical");if(i==null)return;let a=i;n&&(n.dataset.detailRowIndex=r,Op&&(this.setDetailTransform(n,r,{y:a,scrollLeft:this.brain.getScrollPosition().scrollLeft}),n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.style.zIndex=n.dataset.zIndex||"auto"))};this.onScrollStart=()=>{this.scrolling=!0,this.lastEnteredRow!=-1&&this.removeHoverClass(this.lastEnteredRow)};this.onScrollStop=()=>{this.scrolling=!1,this.lastEnteredRow!=-1&&this.addHoverClass(this.lastEnteredRow),this.lastExitedRow!=-1&&this.removeHoverClass(this.lastExitedRow)};this.adjustFixedElementsOnScroll=(t=this.brain.getScrollPosition())=>{let{brain:n,cellManager:r,rowManager:i}=this,a=this.brain.getColCount(),l=this.brain.getRowCount(),{fixedColsStart:s,fixedColsEnd:c,fixedRowsStart:u,fixedRowsEnd:d}=this.brain.getFixedCellInfo();if(i.getAttachedCount()&&i.forEachAttachedRow(P=>{let _=i.getRowIndex(P);if(_!=null){let D=this.brain.getItemOffsetFor(_,"vertical");if(D==null)return;let F=P.getElement();if(!F)return;this.setDetailTransform(F,_,{y:D,scrollLeft:t.scrollLeft})}}),!s&&!c&&!u&&!d)return;let p=this.cellManager.getOneAttachedCell();p&&$u(t,this.getInfiniteNode(p.getElement()));let f=this.brain.getFixedEndColsOffsets({skipScroll:!0}),m=this.brain.getFixedEndRowsOffsets({skipScroll:!0}),{start:g,end:b}=this.brain.getRenderRange(),[h,y]=g,[S,C]=b;function T(P,_,D){let F=r.getCellAt([P,_]);if(F==null)return;let N=n.getCellOffset(P,_),W=F.getElement();W&&N&&D(P,_,W,N)}let v=(P,_,D,{x:F,y:N})=>{this.setTransform(D,P,_,{x:F,y:N,scrollLeft:!0},s-_)},w=(P,_,D,F)=>{this.setTransform(D,P,_,{x:F.x,y:F.y,scrollTop:!0},u-P)},I=(P,_,D,{y:F})=>{let N=f[_];this.setTransform(D,P,_,{x:N,y:F,scrollLeft:!0},a-_)},R=(P,_,D,F)=>{this.setTransform(D,P,_,{x:F.x,y:m[P],scrollTop:!0},l-P)},x=(P,_,D,{x:F,y:N})=>{this.setTransform(D,P,_,{x:F,scrollLeft:!0,y:N,scrollTop:!0},1e5)},E=(P,_,D,{x:F})=>{this.setTransform(D,P,_,{x:F,scrollLeft:!0,y:m[P],scrollTop:!0},2e5)},A=(P,_,D,F)=>{this.setTransform(D,P,_,{x:f[_],y:F.y,scrollLeft:!0,scrollTop:!0},3e5)},M=(P,_,D)=>{this.setTransform(D,P,_,{x:f[_],y:m[P],scrollLeft:!0,scrollTop:!0},4e5)};if(s||c)for(let P=h;P<S;P++){for(let _=0;_<s;_++)T(P,_,v);if(c){let _=a-c;for(let D=_;D<a;D++)T(P,D,I)}}if(u||d)for(let P=y;P<C;P++){for(let _=0;_<u;_++)T(_,P,w);if(d){let _=l-d;for(let D=_;D<l;D++)T(D,P,R)}}if(s&&u)for(let P=0;P<u;P++)for(let _=0;_<s;_++)T(P,_,x);if(s&&d){let P=l-d;for(let _=P;_<l;_++)for(let D=0;D<s;D++)T(_,D,E)}if(c&&u){let P=a-c;for(let _=0;_<u;_++)for(let D=P;D<a;D++)T(_,D,A)}if(c&&d){let P=l-d,_=a-c;for(let D=P;D<l;D++)for(let F=_;F<a;F++)T(D,F,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=n,this.cellManager=new qi(n),this.cellManager.onCellAttachmentChange((s,c)=>{c?this.onCellAttached(s):this.onCellDetached(s)}),this.rowManager=new Zi(n),this.rowManager.onRowAttachmentChange((s,c)=>{c?this.onRowAttached(s):this.onRowDetached(s)}),this.renderRange=this.renderRange.bind(this);let r=t.onScroll(this.adjustFixedElementsOnScroll),i=t.onAvailableSizeChange(()=>{this.adjustFixedElementsOnScroll(),Le(()=>{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=Ll(t)),this.infiniteNode}onCellAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onCellDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}onRowAttached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.remove(r)})}}onRowDetached(t){if(this.cellDetachedClassNames.length){let n=t.getElement();n&&this.cellDetachedClassNames.forEach(r=>{n.classList.add(r)})}}isCellRenderedAndMappedCorrectly(t,n){let r=!!this.cellManager.getCellAt([t,n]);return{rendered:r,mapped:r}}renderRange(t,{renderCell:n,renderDetailRow:r,force:i,onRender:a}){if(this.destroyed)return[];let{start:l,end:s}=t,c=this.brain.isHorizontalLayoutBrain,{rowManager:u,cellManager:d}=this,p=this.getFixedRanges(t),f=[t,...p],m=this.brain.getAlwaysRenderedColumns();if(m.length>0){let x=t.start[1],E=t.end[1];m.forEach(A=>{x<=A&&A<E||f.push({start:[t.start[0],A],end:[t.end[0],A+1]})})}let g=new Map,b=f.map(this.getExtraSpanCellsForRange).flat();b&&b.forEach(([x,E])=>{g.set(`${x}:${E}`,!0)});let h=f.reduce((x,E)=>x+us(E),0),y=r?f.reduce((x,E)=>x+Rp(E),0):0,S=this.brain.getRowCount(),C=this.brain.getColCount();d.detachCellsStartingAt([S,C]);let T=Math.min(S*C,h);r&&(u.detachStartingWith(this.brain.getRowCount()),u.poolSize>y&&(u.poolSize=y));let v=xp(...f.map(x=>d.getCellsOutsideRenderRange(x)));v=Pp(v,x=>{let E=d.getCellPosition(x);return!(E&&g.has(`${E[0]}:${E[1]}`))}),d.detachCells(v),d.poolSize=T;let w=new Map,I=new Map;f.forEach(x=>{let{start:E,end:A}=x,[M,P]=E,[_,D]=A;for(let F=M;F<_;F++){for(let W=P;W<D;W++){let L=`${F}:${W}`;if(w.has(L))continue;w.set(L,!0);let{rendered:X,mapped:le}=this.isCellRenderedAndMappedCorrectly(F,W);if(F===M||W===P){let H=this.isCellCovered(F,W);if(H&&g.has(`${H[0]}:${H[1]}`)){let U=d.getCellAt([F,W]);U!=null&&d.detachCell(U);continue}}if(X&&!i&&le)continue;let ae;X?ae=d.getCellAt([F,W]):ae=d.getCellFor([F,W],c?"row":"column"),ae==null&&(ae=d.getDetachedCell()),this.renderCellAt(F,W,ae,n)}!r||I.has(F)||(I.set(F,!0),u.isRowAttachedAt(F)&&!i)||this.renderDetailRowAtElement(F,this.rowManager.getRowFor(F),r)}}),b.forEach(([x,E])=>{let{rendered:A,mapped:M}=this.isCellRenderedAndMappedCorrectly(x,E);if(A){if(i||!M){let _=[x,E],D=d.getCellAt(_);this.renderCellAt(x,E,D,n)}return}let P=d.getCellFor([x,E],c?"row":"column");P!=null&&this.renderCellAt(x,E,P,n)});let R=d.getAllCells().map(x=>x.getNode());return r&&u.getAllRows().forEach(x=>{R.push(x.getNode())}),this.adjustFixedElementsOnScroll(),a&&a(R),R}renderDetailRowAtElement(t,n,r){if(this.destroyed)return;let i=!1,a=this.brain.getRowHeight(t),l=this.brain.isRowFixedStart(t)?"start":this.brain.isRowFixedEnd(t)?"end":!1,c=r({rowIndex:t,height:a,rowFixed:l,hidden:!!i,onMouseEnter:()=>{},onMouseLeave:()=>{},domRef:n.ref});if(n.isMounted()||n.onMount(u=>{let d=u.getElement();d&&(d.style.position="absolute",d.style.left="0px"),this.updateDetailElementPosition(u)}),!c){this.rowManager.detachRow(n);return}this.rowManager.renderNodeAtRow(c,n,t),this.updateDetailElementPosition(n)}getCellRealCoordinates(t,n){return{rowIndex:t,colIndex:n}}renderCellAt(t,n,r,i){if(this.destroyed)return;let a=this.isCellCovered(t,n),l=this.brain.getRowHeight(t),s=this.brain.getColWidth(n),c=this.brain.getRowspan(t,n),u=this.brain.getColspan(t,n),d=c===1?l:this.brain.getRowHeightWithSpan(t,n,c),p=u===1?s:this.brain.getColWidthWithSpan(t,n,u),{row:f,col:m}=this.isCellFixed(t,n),g=!!a,{rowIndex:b,colIndex:h}=this.getCellRealCoordinates(t,n),y=i({rowIndex:b,colIndex:h,height:l,width:s,rowspan:c,colspan:u,rowFixed:f,colFixed:m,hidden:g,heightWithRowspan:d,widthWithColspan:p,onMouseEnter:this.onMouseEnter.bind(null,t),onMouseLeave:this.onMouseLeave.bind(null,t),domRef:r.ref});r.isMounted()||r.onMount(C=>{let T=C.getElement();T&&(T.style.position="absolute",T.style.left="0px",T.style.top="0px"),this.updateElementPosition(C)});let S=this.brain.isHorizontalLayoutBrain?{renderRowIndex:b,renderColIndex:h}:void 0;if(!y){this.brain.isHorizontalLayoutBrain?this.cellManager.detachCell(r):this.cellManager.detachCell(r);return}this.cellManager.renderNodeAtCell(y,r,[t,n],S),this.updateElementPosition(r,{hidden:g,rowspan:c,colspan:u})}reset(){this.cellManager.reset(),this.rowManager.reset()}};var Qi=class extends No{constructor(t,n){super(t,n);this.setTransform=(t,n,r,i,a)=>{let l=this.getCellRealCoordinates(n,r),{y:s}=i,c=Math.floor(l.rowIndex/this.brain.rowsPerPage),u=ue.runtime.totalVisibleColumnsWidthVar,d=c?`calc(${u} * ${c})`:"0px",p=Se.columnOffsets.get(l.colIndex),f=`${ms}-${l.colIndex}`,m=`${s}px`;t.__currentTransformY!==m&&(t.__currentTransformY=m,t.style.setProperty(eo,m));let g=`calc(var(${f}, ${p}) + ${d})`,b=`var(${eo})`,h=`translate3d(${g}, ${b}, 0px)`;t.__transformValue!==h&&(t.__transformValue=h,t.style.transform=h)};this.brain=t}getCellRealCoordinates(t,n){return this.brain.getHorizontalLayoutPositionFromMatrixCoordinates({rowIndex:t,colIndex:n})}isCellRenderedAndMappedCorrectly(t,n){let r=this.cellManager.getCellAt([t,n]),i=!!r;if(!i)return{rendered:i,mapped:!1};let a=r.getAdditionalInfo();if(!a)return{rendered:i,mapped:!1};let l=this.getCellRealCoordinates(t,n),s=l.colIndex===a.renderColIndex&&l.rowIndex===a.renderRowIndex;return{rendered:i,mapped:s}}};function Or(o){let e=o.isHorizontalLayoutBrain?new Qi(o,`${o.name}:HorizontalLayoutTableRenderer`):new No(o,`${o.name}:ReactHeadlessTableRenderer`),t=be();return o.onDestroy(()=>{e.destroy(),t.destroy()}),{renderer:e,onRenderUpdater:t}}function zy(o){let{brain:e,renderCell:t,renderDetailRow:n,forceRerenderTimestamp:r}=o,{renderer:i,onRenderUpdater:a}=(0,Lo.useMemo)(()=>o.onRenderUpdater&&o.renderer?{renderer:o.renderer,onRenderUpdater:o.onRenderUpdater}:Or(e),[e,o.onRenderUpdater,o.renderer]);return(0,Lo.useLayoutEffect)(()=>{i.cellHoverClassNames=o.cellHoverClassNames||[]},[i,o.cellHoverClassNames]),(0,Lo.useLayoutEffect)(()=>{i.cellDetachedClassNames=o.cellDetachedClassNames||[]},[i,o.cellDetachedClassNames]),(0,Lo.useLayoutEffect)(()=>{let l=e.getRenderRange();return i.renderRange(l,{onRender:a,force:!0,renderCell:t,renderDetailRow:n}),e.onRenderRangeChange(c=>{i.renderRange(c,{force:!1,onRender:u=>{let d=a.get();d&&u&&d.length===u.length||a(u)},renderCell:t,renderDetailRow:n})})},[i,e,t,n,a,r]),Ji.createElement(Dn,{updater:a})}var ea=Ji.memo(zy);var Fr=G(require("react")),ko=require("react");var Np=me({defaultClassName:"nxbq1c1 _16lm1iwz _16lm1iw2",variantClassNames:{visible:{true:"nxbq1c3",false:"nxbq1c4"}},defaultVariants:{},compoundVariants:[]}),ta="nxbq1c0 _16lm1iwz _16lm1iw4 _16lm1iw26 _16lm1iw23 _16lm1iw1y _16lm1iw1k";var Lp=me({defaultClassName:"j26lrx0 _16lm1iwz _16lm1iw2 _16lm1iw23 _16lm1iw26",variantClassNames:{active:{true:"j26lrx2",false:"j26lrx3"}},defaultVariants:{},compoundVariants:[]});var{rootClassName:Vy}=Fe,Gy=`${Vy}-ActiveRowIndicator`,Hy=`calc(${$.activeCellRowOffsetX} + var(${q($.scrollLeftForActiveRowWhenHorizontalLayout)}, 0px))`,Ky={[q($.activeCellOffsetY)]:$.activeCellRowOffset,transform:`translate3d(${Hy}, calc( ${$.activeCellOffsetY} + var(${q($.scrollTopForActiveRow)}, 0px)), 0px)`,height:$.activeCellRowHeight,maxWidth:ue.runtime.totalVisibleColumnsWidthVar},By=o=>{let{brain:e}=o,t=(0,ko.useRef)(null),n=o.activeRowIndex!=null&&e.getInitialRows()>o.activeRowIndex,[r,i]=Mt();return(0,ko.useLayoutEffect)(()=>{if(o.activeRowIndex==null)return;let a="0px",l=o.activeRowIndex;if(e.isHorizontalLayoutBrain&&e.rowsPerPage){let p=e.getPageIndexForRow(l);p>0&&(a=`calc(${ue.runtime.totalVisibleColumnsWidthVar} * ${p})`),l=l%e.rowsPerPage}let s=e.getRowHeight(l),c=e.getItemOffsetFor(l,"vertical"),u=t.current,d={activeCellRowHeight:`${s}px`,activeCellRowOffset:`${c}px`,activeCellRowOffsetX:a};vo(d,u)},[o.activeRowIndex,e]),(0,ko.useEffect)(()=>{let a=c=>{vo({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]),Fr.createElement("div",{className:ta,"data-name":"active-row"},Fr.createElement("div",{ref:t,"data-name":"active-row-indicator",className:`${Gy} ${Lp({active:n})}`,style:n?Ky:void 0}))},kp=Fr.memo(By);var Nr=G(require("react")),zo=require("react");var{rootClassName:Wy}=Fe,jy=`${Wy}-ActiveCellIndicator`,$y=q($.columnZIndexAtIndex),Uy=(o,e,t,n)=>{if(e==null)return;let[r]=e;o.isHorizontalLayoutBrain&&o.rowsPerPage&&(r=r%o.rowsPerPage);let i=typeof t=="function"?t(r):t??o.getRowHeight(r),a=o.getItemOffsetFor(r,"vertical"),l=n.current;vo({activeCellRowHeight:`${i}px`,activeCellRowOffset:`${a}px`},l)},Yy=o=>{let{brain:e}=o,[t,n]=Mt(),r=(0,zo.useRef)(null),i=o.activeCellIndex!=null&&e.getInitialRows()>o.activeCellIndex[0];return(0,zo.useLayoutEffect)(()=>{Uy(e,o.activeCellIndex,o.rowHeight,r)},[o.activeCellIndex,o.rowHeight,e]),(0,zo.useEffect)(()=>{let a=e.onRenderCountChange(()=>{n()});return()=>{a()}},[e]),Nr.createElement("div",{className:ta,ref:r,"data-name":"active-cell",style:i?{zIndex:`var(${$y}-${o.activeCellIndex[1]})`}:void 0},Nr.createElement("div",{"data-name":"active-cell-indicator",className:`${jy} ${Np({visible:i})}`}))},zp=Nr.memo(Yy);var na=[Gd,`${lt}DetachedCell`];function oa(o,e,t){t&&(t.fixedColsStart||t.fixedColsEnd||t.fixedRowsStart||t.fixedRowsEnd)&&o.updateFixedCells({fixedColsStart:t.fixedColsStart,fixedColsEnd:t.fixedColsEnd,fixedRowsStart:t.fixedRowsStart,fixedRowsEnd:t.fixedRowsEnd}),o.update({height:e.height,width:e.width,cols:e.cols,rows:e.rows,colWidth:e.colWidth,rowHeight:e.rowHeight,rowspan:e.rowspan,colspan:e.colspan})}var qy=Z(fp,is);function Vp(o){let{brain:e,scrollerDOMRef:t,scrollStopDelay:n,renderCell:r,renderDetailRow:i,activeCellRowHeight:a,cellHoverClassNames:l,renderer:s,activeRowIndex:c,activeCellIndex:u,onRenderUpdater:d,wrapRowsHorizontally:p,forceRerenderTimestamp:f,scrollVarHostRef:m,...g}=o,{autoFocus:b}=g,h=(0,kt.useRef)(null),[y,S]=(0,kt.useState)({width:0,height:0});(0,kt.useEffect)(()=>{n!=null&&e.setScrollStopDelay(n)},[n,e]),(0,kt.useEffect)(()=>{let v=h.current?.parentNode;return v?(b&&document.activeElement!==v&&v.focus(),ur(v,()=>{let R={height:v.clientHeight,width:v.clientWidth};e.update(R)},{debounce:50})):void 0},[p,e]);let C=(0,kt.useCallback)(v=>{requestAnimationFrame(()=>{h.current&&h.current.style.setProperty("transform",`translate3d(${-v.scrollLeft}px, ${-v.scrollTop}px, 0px)`)})},[]),T=(0,kt.useCallback)(v=>{e.setScrollPosition(v,C)},[e,C]);return(0,kt.useEffect)(()=>{let v=e.onRenderCountChange(()=>{S(e.getVirtualizedContentSize())});return S(e.getVirtualizedContentSize()),C(e.getScrollPosition()||{scrollLeft:0,scrollTop:0}),v},[e]),to.createElement(wp,{onContainerScroll:T,...g,ref:t},to.createElement("div",{ref:h,className:qy,"data-name":"scroll-transform-target"},to.createElement(ea,{forceRerenderTimestamp:f,renderer:s,onRenderUpdater:d,renderCell:r,renderDetailRow:i,brain:e,cellHoverClassNames:l,cellDetachedClassNames:na}),u!=null?to.createElement(zp,{brain:e,rowHeight:a,activeCellIndex:u}):null),c!=null?to.createElement(kp,{brain:e,activeRowIndex:c}):null,to.createElement(pp,{width:y.width,height:y.height}))}function Gp(o,e,t,n){let r=new Map,i=new Map,a=new Map;o.forEach((u,d)=>{let p=u.id,f=o[d-1],m=f?.id??"",g=new Set,b=f?.computedPinned!==u.computedPinned?new Set:a.get(m)??new Set;a.set(p,g);let h={type:"column",id:p,ref:u,groupOffset:0,computedPinned:u.computedPinned,computedWidth:u.computedWidth,depth:u.columnGroup?(t.get(u.columnGroup)??0)+1:0};r.set([p],h);let y=u.columnGroup,S,C=h;for(;y;){let T=e[y];if(T){g.add(y);let v=[p,...g];S=b.has(y)?i.get(y):void 0,S||(S={id:y,type:"group",ref:T,columnItems:[],children:[],groupOffset:0,uniqueGroupId:[y],computedWidth:0,computedPinned:h.computedPinned,depth:t.get(y)??0},r.set(v,S),i.set(y,S)),S.columnItems.push(h),S.uniqueGroupId.push(h.id),C&&!b.has(C.id)&&S.children.push(C),C=S,y=T.columnGroup}else break}});let l=[],s=new Q,c=0;return r.forEach(u=>{if(!u.ref.columnGroup){let d=u.type==="column"?u.ref.computedWidth:u.columnItems.reduce((p,f)=>p+f.ref.computedWidth,0);u.groupOffset=c,u.computedWidth=d,u.type==="group"&&Hp(u.children),l.push(u),c+=d}if(u.type==="group")u.columnItems.forEach(d=>{s.set([u.depth,d.ref.computedVisibleIndex],u)});else for(let d=u.depth;d<=n+1;d++)s.set([d,u.ref.computedVisibleIndex],u)}),r.clear(),i.clear(),{tree:l,pathsToCells:s}}function Hp(o,e=0){o.forEach(t=>{let n=t.type==="column"?t.ref.computedWidth:t.columnItems.reduce((r,i)=>r+i.ref.computedWidth,0);t.computedWidth=n,t.groupOffset=e,t.type==="group"&&Hp(t.children),e+=n})}var En=G(require("react")),no=require("react");var hs=G(require("react"));var Bp=G(require("react")),gs=require("react");var Lr=require("react"),kr=G(require("react"));var{rootClassName:Xy}=Fe,Zy=`${Xy}HeaderCell_ResizeHandle`;function Qy(o){let e=(0,Lr.useRef)(null),[t,n]=(0,Lr.useState)(!1),r=(0,Lr.useRef)(t);r.current=t;let i=o.groupColumns[0];if(!i)return null;let a=i.computedPinned,l=i.computedFirstInCategory,s=i.computedLastInCategory,c=d=>{d.stopPropagation();let p=d.pointerId,f=d.clientX,m=d.target;m.setPointerCapture(p);let g=!0,b=Qd(o.groupColumns.map(C=>C.computedVisibleIndex),{columns:o.columns,domRef:e}),h=C=>{a==="end"&&(C*=-1);let{constrained:T,adjustedDiffs:v,adjustedDiff:w}=o.computeResize(C);return r.current!==T&&n(T),b.resize(v),w},y=C=>{if(g){let T=o.groupColumns.reduce((I,R)=>I+R.computedWidth-R.computedMinWidth,0),v=o.brain.getAvailableSize(),w={width:v.width+T,height:v.height};o.brain.update(w),g=!1}h(Math.round(C.clientX-f))},S=C=>{m.releasePointerCapture(p),m.removeEventListener("pointermove",y),m.removeEventListener("pointerup",S);let T=Math.round(C.clientX-f),v=h(T);o.onResize(v)};m.addEventListener("pointermove",y),m.addEventListener("pointerup",S)},u=(a===!1||a==="start")&&s?{right:a==="start"?void 0:ue.components.HeaderCell.resizeHandleWidth}:a==="end"&&l?{right:void 0}:void 0;return kr.createElement("div",{ref:e,className:`${Zy} ${zi} ${Gi({computedPinned:a,computedFirstInCategory:l,computedLastInCategory:s})}`,onPointerDown:c},kr.createElement("div",{style:{...u,...o.style},className:Vi({constrained:t})}))}var Kp=kr.memo(Qy);function Wp(o,e){let{bodyBrain:t,groupHeight:n,columnGroup:r,columnGroupsMaxDepth:i}=e,{computed:{computedVisibleColumns:a},getState:l,getComputed:s,actions:c}=J(),u=o[o.length-1],d=(0,gs.useCallback)(g=>{let b=l(),{columnSizing:h,viewportReservedWidth:y,bodySize:S}=b,C=s().computedVisibleColumns,T=!1,v=C.reduce((R,x)=>(x.computedFlex&&(R[x.id]={...h[x.id],flex:x.computedWidth},T=!0),R),{}),w=T?{...h,...v}:h;return Mu({availableSize:S.width,reservedWidth:y||0,dragHandleOffset:g,dragHandlePositionAfter:u.computedVisibleIndex,columnSizing:w,columnGroupSize:o.length,items:C.map(R=>({id:R.id,resizable:R.computedResizable,computedFlex:R.computedFlex,computedWidth:R.computedWidth,computedMinWidth:R.computedMinWidth,computedMaxWidth:R.computedMaxWidth}))})},[u]),p=(0,gs.useCallback)(g=>{let{columnSizing:b,reservedWidth:h}=d(g);c.viewportReservedWidth=h,c.columnSizing=b},[d]);return o.some(g=>g.computedResizable)?Bp.createElement(Kp,{brain:t,style:{height:n*(i-r.depth+2)},columns:a,groupColumns:o,computeResize:d,onResize:p}):null}var jp=`${lt}HeaderGroup`,$p=q($.columnWidthAtIndex),Jy=q($.columnZIndexAtIndex);function Up(o){let{columnGroup:e,height:t,columns:n,bodyBrain:r,columnGroupsMaxDepth:i}=o,{header:a,style:l}=e;a instanceof Function&&(a=a({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}));let s=Wp(n,{bodyBrain:r,groupHeight:t,columnGroup:e,columnGroupsMaxDepth:i}),c=n[0],u=n.length>1?"calc( "+n.map(f=>`var(${$p}-${f.computedVisibleIndex})`).join(" + ")+" )":`var(${$p}-${c.computedVisibleIndex})`,d=`calc(var(${Jy}-${c.computedVisibleIndex}) + ${i-e.depth})`,p=typeof l=="function"?l({columnGroup:e,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex}):l;return p=p&&typeof p=="object"?p:{},p.width=u,p.height=t,hs.createElement("div",{ref:o.domRef,"data-group-id":e.uniqueGroupId,className:Z(Su,jp),style:p,"data-z-index":d},hs.createElement("div",{className:Z(`${jp}__header-content`,Ut)},a),s)}var{rootClassName:eT}=Fe,tT=[],Yp=`${eT}Header`,nT=gu({overflow:!1}),qp=()=>{};function oT(o){let{bodyBrain:e,columns:t,style:n,className:r,columnHeaderHeight:i,columnAndGroupTreeInfo:a,columnGroupsMaxDepth:l}=o,{computed:s,getState:c,state:{headerBrain:u,headerOptions:d,showColumnFilters:p,headerRenderer:f,headerOnRenderUpdater:m}}=J(),{computedColumnsMap:g}=s,b=(0,no.useRef)(null),h=(0,no.useCallback)(C=>{b.current&&(b.current.style.transform=`translate3d(-${C.scrollLeft}px, 0px, 0px)`)},[]);(0,no.useEffect)(()=>{let C=u.onScroll(h);return h(u.getScrollPosition()||{scrollLeft:0,scrollTop:0}),C},[u]);let y={ref:b,className:Z(Yp,`${Yp}--virtualized`,r,nT),style:{...n,height:i}},S=(0,no.useCallback)(C=>{let{rowIndex:T,colIndex:v,domRef:w,height:I,widthWithColspan:R,heightWithRowspan:x,hidden:E}=C,A=t[v];if(!A||E)return null;let M=u.isHorizontalLayoutBrain?u.getPageIndexForRow(T):null,P=a?a.pathsToCells.get([T,v]):null;if(P&&P.type==="group"){let _=P.columnItems.map(N=>N.ref),D={...P.ref,id:P.id,uniqueGroupId:P.uniqueGroupId,depth:P.depth,columns:_.map(N=>N.id),computedWidth:P.computedWidth,groupOffset:P.groupOffset};return c().columnGroupVisibility[P.id]!==!1?En.createElement(Up,{horizontalLayoutPageIndex:M,bodyBrain:e,columnGroupsMaxDepth:l,domRef:w,columns:_,width:R,height:I,columnGroup:D}):null}return En.createElement(Zp,{domRef:w,column:A,horizontalLayoutPageIndex:M,headerOptions:d,width:R,height:x,columnsMap:g})},[d,t,i,a,l,p,u]);return En.createElement(Qn,{orientation:"horizontal",dragListId:"header",onDrop:qp,updatePosition:qp},C=>En.createElement("div",{...C,...y,className:Z(C.className,y.className)},En.createElement(ea,{name:"header",renderCell:S,brain:u,renderer:f,onRenderUpdater:m,cellHoverClassNames:tT,cellDetachedClassNames:na})))}var Xp=En.memo(oT);function Qp(o){let{headerBrain:e,bodyBrain:t,scrollbars:n}=o,r=J(),{computedPinnedStartColumns:i,computedPinnedEndColumns:a,computedVisibleColumns:l,columnSize:s}=r.computed,{state:{columnHeaderHeight:c,columnGroupsDepthsMap:u,columnGroupsMaxDepth:d,computedColumnGroups:p,showColumnFilters:f}}=r,m=!p||!Object.keys(p).length?1:d+2,g=m*c+(f?c:0),b=zt.useMemo(()=>{if(!(!p||!Object.keys(p).length))return Gp(l,p,u,d)},[l,p,u]),h=zt.useCallback(({rowIndex:w,colIndex:I})=>{let R=l[I],x=1,E=1;if(!R||!b)return{rowspan:x,colspan:E};let A=b.pathsToCells.get([w,I]);if(!A)return{rowspan:x,colspan:E};if(A.type==="column")return{colspan:E,rowspan:m-A.depth};let M=A.columnItems.findIndex(P=>P.id===R.id);return{rowspan:x,colspan:M===0?A.columnItems.length:1}},[p,d,l,b,m,u]),y=zt.useCallback(({rowIndex:w,colIndex:I})=>h({rowIndex:w,colIndex:I}).rowspan,[h]),S=zt.useCallback(({rowIndex:w,colIndex:I})=>h({rowIndex:w,colIndex:I}).colspan,[h]),C=zt.useCallback(w=>f?w<m-1?c:2*c:c,[m,f,c]);oa(e,{colWidth:s,rowHeight:C,rows:m,cols:l.length,height:g,rowspan:y,colspan:S},{fixedColsEnd:a.length,fixedColsStart:i.length});let T=zt.createElement(Xp,{columns:l,headerBrain:e,bodyBrain:t,columnHeaderHeight:g,columnGroupsMaxDepth:d,columnAndGroupTreeInfo:b}),v=n.vertical&&Sn()?zt.createElement("div",{className:wu,style:{zIndex:1e3,width:Sn()}}):null;return zt.createElement("div",{className:`${Yl} ${xu}`,style:{height:g}},T,v)}var{ManagedComponentContextProvider:rT}=Et({initSetupState:cp,forwardProps:up,Context:rs()});function bs(o){let e=J(),{state:t,getComputed:n}=e,{header:r,brain:i,headerBrain:a,wrapRowsHorizontally:l}=t,{scrollbars:s}=n();return r?zr.createElement(rT,{...o},zr.createElement(Qp,{wrapRowsHorizontally:!!l,bodyBrain:i,headerBrain:a,scrollbars:s})):null}function Jp(){return zr.useContext(rs()).componentState}var iT=o=>{let{allRowsSelected:e,someRowsSelected:t,api:n,dataSourceApi:r}=o,i=e?!0:t?null:!1,{components:a,isTree:l}=n.getState(),s=a?.CheckBox||rn;return ve.createElement(s,{domProps:{className:Ai},onChange:c=>{if(l){c?r.treeApi.selectAll():r.treeApi.deselectAll();return}c?n.rowSelectionApi.selectAll():n.rowSelectionApi.deselectAll()},checked:i})},Li=ve.createContext(null);var aT=q($.columnZIndexAtIndex),lT=q($.columnVisibilityAtIndex),ys=ve.createElement("div",{className:pi[1]}),tf=mi({"data-name":"","data-field":"","data-header-align":"","data-column-id":"","data-sort":"","data-sort-index":"",[xn]:""});function Zp(o){let e=o.column,{allowColumnHideWhileDragging:t}=Jp(),{onDragItemPointerDown:n}=Er(),{api:r,getComputed:i,getState:a,actions:l,state:{showColumnFilters:s,components:c,portalDOMRef:u,columnHeaderHeight:d,columnReorderDragColumnId:p,columnMenuVisibleForColumnId:f,columnReorderInPageIndex:m},getDataSourceMasterContext:g}=J(),{api:b,componentActions:h,getState:y,componentState:{filterDelay:S,filterTypes:C}}=De(),{allRowsSelected:T,someRowsSelected:v,selectionMode:w}=on(),I=o.horizontalLayoutPageIndex,R=p===e.id,x=m!=null?I!==m:!1,{onResize:E,height:A,width:M,headerOptions:P,columnsMap:_}=o,D=e.computedSortInfo,F=e.header,N=(0,sn.useCallback)(z=>{K.current=z,o.domRef?.(z)},[o.domRef]),W=P.alwaysReserveSpaceForSortIcon,L=e.headerAlign??e.align,X=(typeof L=="function"?L({isHeader:!0,column:e}):L)??"start",le=(typeof e.verticalAlign=="function"?e.verticalAlign({isHeader:!0,column:e}):e.verticalAlign)??"center",ae=st(e,{actions:l,api:r,dataSourceActions:h,dataSourceApi:b,getComputed:i,getDataSourceState:y,getDataSourceMasterContext:g,getState:a}),H=ae.isSortable(),U=H&&(e.computedSorted||W)?ve.createElement(ki,{index:e.computedMultiSort?e.computedSortIndex+1:void 0,style:{marginInlineStart:ue.spacing[2],marginInlineEnd:ue.spacing[2]},className:`${Un}__sort-icon ${vu} ${Ru({align:X})}`,direction:e.computedSorted?e.computedSortedAsc?1:-1:0}):null,se=e.computedFilterable&&e.computedFiltered?ve.createElement(To,null):null,pe=e.headerCssEllipsis??e.cssEllipsis??!0,fe={reserveSpaceWhenHidden:X==="center",menuVisible:f===e.id,style:X==="end"?{marginInlineStart:`calc(${ue.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineEnd:ue.spacing[2]}:{marginInlineEnd:`calc(${ue.components.HeaderCell.resizeHandleActiveAreaWidth} / 2)`,marginInlineStart:ue.spacing[2]},domProps:{onMouseDown:z=>{z.stopPropagation(),ae.toggleContextMenu(z.target)}}},ne=e.components?.MenuIcon||c?.MenuIcon||xr,ge=ve.createElement(ne,{...fe}),K=(0,sn.useRef)(null),k={horizontalLayoutPageIndex:I,dragging:R,domRef:N,htmlElementRef:K,renderLocation:"column-header",column:e,columnsMap:_,columnSortInfo:D,columnFilterValue:e.computedFilterValue,filtered:e.computedFiltered,someRowsSelected:v,allRowsSelected:T,selectionMode:w,api:r,dataSourceApi:b,columnApi:ae,renderBag:{sortIcon:U,filterIcon:se,menuIcon:ge,menuIconProps:fe,selectionCheckBox:null,header:e.header&&typeof e.header!="function"?e.header:e.name}},B=k,O=B.renderBag.header,oe=()=>{let z={...k,renderBag:{...k.renderBag}};if(e.renderSortIcon&&(z.renderBag.sortIcon=ve.createElement(In,{render:e.renderSortIcon,renderParam:{...z,renderBag:{...z.renderBag}}})),e.renderFilterIcon&&(z.renderBag.filterIcon=ve.createElement(In,{render:e.renderFilterIcon,renderParam:{...z,renderBag:{...z.renderBag}}})),typeof e.renderMenuIcon=="function"&&(z.renderBag.menuIcon=ve.createElement(In,{render:Pt=>{if(typeof e.renderMenuIcon!="function")return null;let $t=e.renderMenuIcon(Pt);return $t?$t.type===ne||$t.type===xr?$t:ve.createElement(ne,{...fe},$t):null},renderParam:{...z,renderBag:{...z.renderBag}}})),e.renderSelectionCheckBox&&w==="multi-row"){z.renderBag.selectionCheckBox=ve.createElement(In,{render:iT,renderParam:{...z,renderBag:{...z.renderBag}}});let Pt=e.renderHeaderSelectionCheckBox??e.renderSelectionCheckBox;Pt&&Pt!==!0&&(z.renderBag.selectionCheckBox=ve.createElement(In,{render:Pt,renderParam:{...z,renderBag:{...z.renderBag}}}))}F instanceof Function&&(z.renderBag.header=O=ve.createElement(In,{render:F,renderParam:{...z,renderBag:{...z.renderBag}}}));let We=e.renderMenuIcon===!1?null:z.renderBag.menuIcon,jt=pe?ve.createElement("div",{className:Ut},z.renderBag.header):z.renderBag.header,bt=ve.createElement(ve.Fragment,null,X==="center"?ys:null,z.renderBag.selectionCheckBox,jt,z.renderBag.sortIcon,z.renderBag.filterIcon,X==="center"?ys:null,X!=="center"?ys:null,We);return e.renderHeader?ve.createElement(In,{render:e.renderHeader,renderParam:{...z,renderBag:{...z.renderBag,all:bt}}}):bt};(0,sn.useEffect)(()=>{let z=null,We=K.current;return E&&We&&(z=ur(We,E)),()=>{z?.()}},[K.current,o.onResize]);let te={height:A};e.headerStyle&&(te=typeof e.headerStyle=="function"?{...te,...e.headerStyle(B)||{}}:{...te,...e.headerStyle});let he=typeof e.headerClassName=="function"?e.headerClassName(B):e.headerClassName,{onPointerDown:de,proxyPosition:ee,dragColumnOutside:j}=vd({columnId:e.id,domRef:K,horizontalLayoutPageIndex:I,allowColumnHideOnDrag:t}),re=null,Re=Li.Provider,xe={filtered:e.computedFiltered,verticalAlign:le,align:X},_e=ve.useMemo(()=>{let z=We=>{r.setColumnFilter(e.id,We)};return S>0?Dt(z,{wait:S}):z},[S,e.id]),Be=e.computedFilterType,Oe=C[Be],Ze=e.computedFilterable?e.computedFilterValue?.filter.operator??Oe?.defaultOperator:void 0,et=e.computedFilterable&&Oe?Oe.operators.find(z=>z.name===Ze):void 0,ut=et?.components?.FilterEditor||Oe?.components?.FilterEditor||e.components?.FilterEditor||wo,Ft=Oe?.components?.FilterOperatorSwitch||e.components?.FilterOperatorSwitch,Nt=tp(e,{horizontalLayoutPageIndex:I}),V=`var(${aT}-${e.computedVisibleIndex})`;te.zIndex=V,te.visibility=`var(${lT}-${e.computedVisibleIndex}, visible)`;let Y={"data-field":`${e.field||""}`,"data-column-id":e.id,[xn]:e.id,"data-header-align":X,"data-name":"HeaderCell","data-sort":e.computedSortedAsc?"asc":e.computedSortedDesc?"desc":"none","data-sort-index":`${e.computedSortIndex??-1}`},ce=e.computedFilterable?ve.createElement(ku,{horizontalLayoutPageIndex:I,filterEditor:ut,filterOperatorSwitch:Ft??zu,operator:et,filterTypes:C,onChange:_e,columnFilterType:Be,columnLabel:e.field||e.name||e.id,columnFilterValue:e.computedFilterValue,columnHeaderHeight:d}):ve.createElement(Vu,null);B.renderBag.filterEditor=ce;let Te=(0,sn.useCallback)(z=>{de(z),n(z)},[de,n]),Qe=oe();return R&&ee&&(re=ve.createElement("div",{key:e.id,className:`${Un}Proxy ${pu}`,style:{height:A,width:M,left:ee.left??0,top:ee.top??0}},ve.createElement("div",{className:fu({visible:j})},ve.createElement(sp,{size:16})),O),re=(0,ef.createPortal)(re,u.current)),ve.createElement(Re,{value:B},ve.createElement(Fi,{domRef:N,horizontalLayoutPageIndex:o.horizontalLayoutPageIndex,cellType:"header",column:e,...Y,"data-z-index":V,style:te,width:M,onPointerDown:Te,contentClassName:Z(du(xe),zc[X]),contentStyle:s?{height:A/2}:void 0,className:Z(Un,Bc.none,H?Lc.pointer:"",he,wi(e,[Un,Xn],mu,{dragging:R,insideDisabledDraggingPage:x,align:X,verticalAlign:le,rowSelected:!1,cellSelected:!1,rowDisabled:!1,zebra:!1,rowActive:!1,firstRow:!0,firstRowInHorizontalLayoutPage:!0,treeNode:!1,groupCell:!1,groupRow:!1,rowExpanded:!1}),uu),cssEllipsis:pe,afterChildren:ve.createElement(ve.Fragment,null,s?ce:null,Nt),renderChildren:Qe}),re)}function br(){return(0,sn.useContext)(Li)}var cn=G(require("react")),af=require("react");function nf(o,e){let{separator:t}=e??{separator:"-"};return o.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(new RegExp("("+t+"[A-Z])([A-Z])","g"),"$1"+t+"$2").toLowerCase()}var of={padding:ue.spacing[2],textAlign:"end",opacity:"1",visibility:"visible",display:"block",fontSize:"0.85rem",background:"white",color:"black"},sT={opacity:1,visibility:"visible",display:"inline-block",pointerEvents:"all",color:"black",textDecoration:"underline"},rf=(o,e)=>{if(o)for(let[t,n]of Object.entries(e))o.style.setProperty(nf(t),n,"important")},lf=cn.forwardRef(function(e,t){let{rootClassName:n}=di(),r=cn.useRef(null),i=cn.useCallback(a=>{r.current=a,t&&(typeof t=="function"?t(a):t.current=a)},[]);return(0,af.useEffect)(()=>{let a=()=>{setTimeout(()=>{rf(r.current,of),rf(r.current?.firstElementChild,sT)})};a();let l=setInterval(a,1e3);return()=>{clearInterval(l)}},[]),cn.createElement("div",{ref:i,...e,className:Z(`${n}-Footer`,Uu,e.className),style:of},"Powered by"," ",cn.createElement("a",{href:"https://infinite-table.com",rel:"noopener noreferrer",role:"link",target:"_blank"},"Infinite Table"))});function Ts(o){return o.map(Zt)}function Zt(o){if(we().structuredClone)return we().structuredClone(o);if(o===null||typeof o!="object")return o;if(Array.isArray(o))return Ts(o);if(o instanceof Date)return new Date(o);if(o instanceof Set)return new Set(Ts(Array.from(o)));if(o instanceof Map)return new Map(Ts(Array.from(o)));let e={};for(let t in o)o.hasOwnProperty(t)&&(e[t]=Zt(o[t]));return e}function Vr(o){return o}var oo=Object.seal({data:null,field:null});var _n="____root____",cf="____not_loaded_yet____";function An(){return!1}function Ss(o){if(!o||!Object.keys(o).length)return{};let e={};for(let t in o)if(o.hasOwnProperty(t)){let n=o[t].initialValue;e[t]=typeof n=="function"?n():n}return e}function ra(o,e,t,n,r){if(!(!t||!Object.keys(t).length)){for(let i in t)if(t.hasOwnProperty(i)){let a=t[i];if(typeof a.reducer!="function")continue;let l=n[i],s=a.getter?a.getter(o)??null:a.field?o[a.field]:null;n[i]=a.reducer(l,s,o,e,r)}}}function uf(o,e){let{marker:t,reducers:n={},pivot:r,groupBy:i,indexer:a,toPrimaryKey:l,cache:s,mappings:c}=o;t&&t.start();let u=new Q;function d(h,y,S,C=0,T=[]){let v=!S.length||C===S.length-1,w=y[c?.values||"values"]||{};for(let I in w)if(w.hasOwnProperty(I)){let R=I;T.push(R),p.set(T,!0),h.set(T,{reducerResults:w[I][c?.totals||"totals"]||{},items:[]}),v||d(h,w[I],S,C+1,T),T.pop()}}let p=r?new Q:void 0,f=[],m=Ss(n),g=Zt(m);e.visitDepthFirst((h,y,S,C)=>{let[T,...v]=y,w=h.children,I=u.get(v);if(I&&(I.cache=h.cache,I.childrenLoading=h.childrenLoading,I.childrenAvailable=h.childrenAvailable,I.error=h.error),v.length==i.length&&i.length){if(I){I.items=w;for(let x=0,E=v.length;x<E;x++){let A=v.slice(0,x),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 C?.()}for(let R=0,x=w.length;R<x;R++){if(!w[R]){let P={items:[],reducerResults:{},cache:!1,childrenLoading:!1,childrenAvailable:!1,isTree:!1,isGroupBy:!0};u.set([...v,`${cf}${R}`],P);continue}let E=w[R].data,A=w[R].keys||[];if(A.length){let P=A[A.length-1];v.push(P)}let M={items:[],cache:!1,childrenLoading:!1,childrenAvailable:!1,commonData:E,totalChildrenCount:w[R].totalChildrenCount,reducerResults:w[R].aggregations||{},isTree:!1,isGroupBy:!0};if(u.set(v,M),r){let P=M.pivotDeepMap=new Q,_=w[R].pivot;d(P,_,r,0,f)}A.length&&v.pop()}C?.()});let b={deepMap:u,groupParams:o,initialData:e,reducerResults:g};return r&&(b.topLevelPivotColumns=p,b.pivot=r),t&&t.end({details:[{name:"Group by fields",value:i.map(h=>h.field).join(", ")}]}),b}function sf(o,e,t,n,r,i,a,l,s,c=Vr){let{items:u,reducerResults:d,pivotDeepMap:p}=o.get(e);if(u.push(n),a&&ra(n,r,a,d,e),i){for(let f=0,m=i.length;f<m;f++){let{field:g,valueGetter:b,toKey:h}=i[f],y=g?n[g]:null;b&&(oo.data=n,oo.field=g,y=b(oo));let S=(h||c)(y,n);t.push(S),p.has(t)||(l.set(t,!0),p?.set(t,{reducerResults:Zt(s),items:[]}));let{reducerResults:C,items:T}=p.get(t);T.push(n),a&&ra(n,r,a,C,e)}t.length=0}}function df(o,e,t,n,r,i,a,l){let{isLeafNode:s,getNodeChildren:c,toKey:u}=o,d=u(r),p=[...n,d],f=s(r);if(t.set(p,!0),f){for(let h=0,y=n.length;h<=y;h++){let S=n.slice(0,h),C=e.get(S),{reducerResults:T,items:v}=C;v.push(r),C.leavesAvailableCount++,C.totalLeafNodesCount++,a&&ra(r,i,a,T,S)}return}let m=Zt(l),g=[];e.set(p,{items:g,isTree:!0,isGroupBy:!1,node:r,reducerResults:m,cache:!1,childrenLoading:!1,childrenAvailable:!0,totalLeafNodesCount:0,leavesAvailableCount:0,treeNesting:n.length});let b=c(r);if(!(!b||!Array.isArray(b))){for(let h=0,y=b.length;h<y;h++){let S=b[h];df(o,e,t,p,S,h,a,l)}a&&Gr(a,m,g)}}function Cs(o,e){let{reducers:t,marker:n}=o;if(n){let c=Object.keys(t??{});n.start({details:c.length>0?[{name:"Reducers",value:c.join(", ")}]:void 0})}let r=Ss(t),i=Zt(r),a=new Q,l=new Q;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++)df(o,a,l,[],e[c],c,t,r);t&&Gr(t,i,e);let s={deepMap:a,treeParams:o,treePaths:l,initialData:e,reducerResults:i};return n&&n.end(),s}function aa(o,e){let{marker:t,groupBy:n,defaultToKey:r=Vr,pivot:i,reducers:a}=o;t&&t.start();let l=n.length,s=i?new Q:void 0,c=new Q,u=[],d=[],p=Ss(a),f=Zt(p);if(!l){let g={items:[],isTree:!1,isGroupBy:!0,cache:!1,childrenLoading:!1,childrenAvailable:!1,reducerResults:Zt(p)};i&&(g.pivotDeepMap=new Q),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:C,groupField:T,valueGetter:v,toKey:w}=n[S],I=C?h[C]:null;v&&(oo.data=h,oo.field=C,I=v(oo));let R=(w||r)(I,h);if(y[C||T]=R,u.push(R),!c.has(u)){let x={items:[],isTree:!1,isGroupBy:!0,cache:!1,commonData:{...y},childrenLoading:!1,childrenAvailable:!1,reducerResults:Zt(p)};i&&(x.pivotDeepMap=new Q),c.set(u,x)}sf(c,u,d,h,g,i,a,s,p,r)}l||sf(c,u,d,h,g,i,a,s,p,r),a&&ra(h,g,a,f,u),u.length=0}a&&(c.visitDepthFirst((g,b,h,y)=>{Gr(a,g.reducerResults,g.items),i&&g.pivotDeepMap.visitDepthFirst(({items:S,reducerResults:C},T,v,w)=>{Gr(a,C,S),w?.()}),y?.()}),Gr(a,f,e));let m={deepMap:c,groupParams:o,initialData:e,reducerResults:f};return i&&(m.topLevelPivotColumns=s,m.pivot=i),t&&t.end({details:[{name:"Group by fields",value:n.map(g=>g.field).join(", ")}]}),m}function pf(o){let{groupParams:e,deepMap:t}=o,n=e.groupBy.length,r=[];return t.topDownKeys().reduce((i,a)=>{if(a.length===n){let l=t.get(a).items;i.push(...l)}return i},r),r}function cT(o,e){let{groupBy:t,groupKeys:n,parents:r,reducers:i,lazyLoad:a}=o,l=n.length,{items:s,reducerResults:c,pivotDeepMap:u,commonData:d}=e,p=d??null,f;if(Object.keys(c).length>0){p={...d},f={};for(let y in i)if(i.hasOwnProperty(y)){let C=i[y].field;C&&(f[C]=c[y]),C&&p[C]==null&&(p[C]=c[y])}}let m=!0,g=n[n.length-1],b=g;if(p!=null){let y=t[n.length-1];y&&y.field&&(b=p[y.field]),y&&y.toKey&&(b=y.toKey(b,p)),b=b??g}return typeof b=="string"&&b.startsWith(cf)&&(m=!1,b=null),{data:p,reducerData:f,groupCount:s.length,groupData:s,groupKeys:n,isTreeNode:!1,rowSelected:!1,selectedChildredCount:0,deselectedChildredCount:0,id:`${n}`,collapsed:!1,dataSourceHasGrouping:!0,rowDisabled:!1,isCellSelected:An,hasSelectedCells:An,selfLoaded:m,error:o.error,parents:r,deepRowInfoArray:[],collapsedChildrenCount:0,collapsedGroupsCount:0,totalChildrenCount:o.totalChildrenCount,childrenAvailable:a?o.childrenAvailable:!0,childrenLoading:o.childrenLoading,indexInParentGroups:o.indexInParentGroups,indexInGroup:o.indexInGroup,indexInAll:o.indexInAll,directChildrenCount:o.directChildrenCount,directChildrenLoadedCount:a?o.directChildrenLoadedCount:o.directChildrenCount,value:b,rootGroupBy:t,groupBy:l===t.length?t:t.slice(0,l),isGroupRow:!0,pivotValuesMap:u,groupNesting:l,reducerResults:c}}function ia(o,e,t){return{...o,id:`duplicate_row_on_page_${t}_for__${o.id}`,indexInAll:e,duplicateOf:o.id}}function Gr(o,e,t){if(o){for(let n in o)if(o.hasOwnProperty(n)){let r=o[n];r.done&&(e[n]=r.done(e[n],t))}}return e}function ff(o,e,t,n,r,i){let a=e.length,{isLeafNode:l,getNodeChildren:s}=r.treeParams,{toPrimaryKey:c,treeResult:u,isRowDisabled:d,isNodeSelected:p,withRowInfo:f,isNodeExpanded:m,treeSelectionState:g,repeatWrappedGroupRows:b,rowsPerPage:h}=r,{deepMap:y}=u,S=o.length,C=t[t.length-1],T=C?C.nodeExpanded:!0;for(let v=0;v<S;v++){let w=o[v],I=c(w,v),R=[...e,I];if(l(w)){let D={id:I,nodePath:R,isGroupRow:!1,data:w,treeNesting:a,totalLeafNodesCount:0,collapsedLeafNodesCount:0,isTreeNode:!0,isParentNode:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:An,hasSelectedCells:An,dataSourceHasGrouping:!1,parentNodes:Array.from(t),indexInParentNodes:[...n,v],indexInParent:v,indexInAll:T?i.length:-1};p&&(D.rowSelected=p(D)),d&&(D.rowDisabled=d(D)),f&&f(D);let F=b&&h!=null&&h>0&&D.indexInAll%h===0?D.indexInAll/h:null;for(let N=0,W=t.length;N<W;N++){let L=t[N];if(T||(L.collapsedLeafNodesCount+=1),L.deepRowInfoArray.push(D),F!=null&&T){if(typeof b=="function"&&b(L)!==!0)continue;let X=ia(L,D.indexInAll,F);i[X.indexInAll]=X,D.indexInAll++}}T&&(i[D.indexInAll]=D);continue}let A=y.get(R)?.totalLeafNodesCount??0,M={dataSourceHasGrouping:!1,nodeExpanded:!1,selfExpanded:!1,nodePath:R,id:I,data:w,indexInAll:i.length,indexInParent:v,indexInParentNodes:[...n,v],totalLeafNodesCount:A,treeNesting:a,selfLoaded:!0,isParentNode:!0,isTreeNode:!0,isGroupRow:!1,deepRowInfoArray:[],parentNodes:Array.from(t),collapsedLeafNodesCount:0,rowSelected:!1,rowDisabled:!1,isCellSelected:An,hasSelectedCells:An,selectedLeafNodesCount:0,deselectedLeafNodesCount:0};if(p&&(M.rowSelected=p(M),g)){let D=g.getSelectionCountFor(M.nodePath);M.selectedLeafNodesCount=D.selectedCount,M.deselectedLeafNodesCount=D.deselectedCount}d&&(M.rowDisabled=d(M)),f&&f(M);let P=!0;if(m&&(M.selfExpanded=P=m(M)),T||(P=!1),M.nodeExpanded=P,T&&b&&h!=null&&h>0){let D=M.indexInAll,F=M.parentNodes;if(F.length>0&&D%h===0){let N=D/h,W=0;F.forEach(L=>{typeof b=="function"&&b(L)!==!0||(i.push(ia(L,D+W,N)),W++,M.indexInAll++)})}}T&&(i[M.indexInAll]=M);let _=s(w);Array.isArray(_)&&ff(_,R,[...t,M],M.indexInParentNodes,r,i)}return i}function mf(o){let{dataArray:e,marker:t}=o;t&&t.start();let n=[];return ff(e,[],[],[],o,n),t&&t.end(),{data:n}}function gf(o){let{marker:e,lazyLoad:t,groupResult:n,rowsPerPage:r,repeatWrappedGroupRows:i,withRowInfo:a,toPrimaryKey:l,groupRowsState:s,isRowDisabled:c,isRowSelected:u,rowSelectionState:d,generateGroupRows:p,reducers:f={}}=o,{groupParams:m,deepMap:g,pivot:b}=n,{groupBy:h}=m;e&&e.start({details:[{name:"Group by fields",value:h.map(v=>v.field).join(", ")}]});let y=[],S=[],C=[],T=[];return g.visitDepthFirst((v,w,I,R)=>{let x=v.items,E=w.length,A=s?.isGroupRowCollapsed(w)??!1;T.push(I);let M=cT({lazyLoad:t,groupBy:h,parents:Array.from(C),reducers:f,indexInGroup:I,indexInParentGroups:Array.from(T),indexInAll:y.length,groupKeys:w,error:v.error,totalChildrenCount:v.totalChildrenCount,childrenLoading:(v.childrenLoading||!A&&!v.childrenAvailable)&&t,childrenAvailable:v.childrenAvailable,directChildrenCount:w.length===h.length?v.items.length:g.getDirectChildrenSizeFor(w),directChildrenLoadedCount:0},v);if(u&&(M.rowSelected=u(M),d)){let N=d.getSelectionCountFor(M.groupKeys);M.selectedChildredCount=N.selectedCount,M.deselectedChildredCount=N.deselectedCount}c&&(M.rowDisabled=c(M));let P=C[C.length-1],_=P?.collapsed??!1;_&&(A=!0),M.collapsed=A;let D=p||A;if(_&&(D=!1),D){if(i&&r!=null&&r>0){let N=M.indexInAll,W=M.parents;if(W.length>0&&N%r===0){let L=N/r,X=0;W.forEach(le=>{typeof i=="function"&&i(le)!==!0||(y.push(ia(le,N+X,L)),X++,M.indexInAll++)})}}y.push(M),S.push(y.length-1)}M.collapsedChildrenCount=0,C.forEach(N=>{N.deepRowInfoArray.push(M),N.collapsedGroupsCount+=A?1:0}),P&&M.selfLoaded&&t&&(P.directChildrenLoadedCount+=1),a&&a(M),C.push(M);let F=!0;if(F){if(R)R();else if(!b){let N=y.length;A||(y.length+=x.length);let W=0;for(let L=0,X=x.length;L<X;L++){let le=x[L];if(!A&&i&&r!=null&&r>0){let ie=N+L+W;if(ie%r===0){let se=ie/r;C.forEach(pe=>{if(typeof i=="function"&&i(pe)!==!0)return;let fe=N+L+W;y[fe]=ia(pe,fe,se),W++,y.length++})}}let ae=N+L+W,U={id:le?l(le,ae):`${w}-${L}`,data:le,isCellSelected:An,hasSelectedCells:An,dataSourceHasGrouping:!0,isTreeNode:!1,isGroupRow:!1,selfLoaded:!!le,rowSelected:!1,rowDisabled:!1,rootGroupBy:h,collapsed:A,groupKeys:w,parents:Array.from(C),indexInParentGroups:[...T,L],indexInGroup:L,indexInAll:ae,groupBy:h,groupNesting:E+1,groupCount:M.groupCount};u&&(U.rowSelected=u(U)),c&&(U.rowDisabled=c(U)),a&&a(U),C.forEach((ie,se)=>{se===C.length-1&&le&&(ie.directChildrenLoadedCount+=1),A&&(ie.collapsedChildrenCount+=1),ie.deepRowInfoArray.push(U)}),A||(y[N+L+W]=U)}}}C.pop(),T.pop()}),e&&e.end(),{data:y,groupRowsIndexes:S}}var Jf=G(require("react"));var uT=()=>{};function hf(o,e){let t=new Q,n=e.nodesKey??"children",r=e.emptyGroup??{},i=typeof e.pathKey=="function"?e.pathKey:l=>l[e.pathKey];for(let l of o){let s=i(l);for(let c=0;c<s.length;c++){let u=s.slice(0,c);t.has(u)||t.set(u,void 0)}t.set(s,l)}function a(l,s){let c=t.getKeysStartingWith(l,{excludeSelf:!0,depthLimit:1});for(let u of c){let d=[...l,u[u.length-1]],p=t.get(d),f=p?p[n]??[]:[];a(d,f),f.length&&(p||(p=typeof r=="function"?r(d,f):r),p[n]=f),s.push(p)}return s}return a([],[])}function bf(o,e,t,n){let{isLeafNode:r,getNodeChildren:i,toKey:a}=o,{onParentNode:l,onNode:s,onLeafNode:c}=e,u=a(n),d=[...t,u],p=r(n),f=at(()=>{let m=i(n);if(!(!m||!Array.isArray(m)))for(let g=0,b=m.length;g<b;g++){let h=m[g];bf(o,e,d,h)}});p?(c?.(n),s?.(n,uT)):(l?.(n,f,i(n)),s?.(n,f))}function yf(o,e,t){for(let n=0,r=t.length;n<r;n++)bf(o,e,[],t[n])}var dT=function(o,e){return o-e},pT=function(o,e){return o=`${o}`,e=`${e}`,o.localeCompare(e)},fT=function(o,e){return o-e},mT={number:dT,string:pT,date:fT},Hr=mT;function Tf(o){return o.map(t=>Array.isArray(t.field)?t.field.map((n,r)=>{let i=Array.isArray(t.type)?t.type[r]??t.type[0]:t.type;return typeof n=="function"?{...t,valueGetter:n,field:void 0,type:i}:{...t,type:i,field:n}}):t).flat()}var Qt=(o,e,t)=>{let n=typeof t=="function"?t:t?.get,r=t&&typeof t=="object"?t.marker:void 0;return r&&r.start(),e.sort(Sf(Tf(o),n)),r&&r.end(),e},la=(o,e,t)=>{let{marker:n}=t;n&&n.start();let r=Sf(Tf(o),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 yf({isLeafNode:t.isLeafNode??u,getNodeChildren:t.getNodeChildren??c,toKey:s},{onParentNode:(d,p,f)=>{if(i&&p(),Array.isArray(f)){let m=a?f.sort(r):[...f].sort(r);d[l]=m}i||p()}},e),i&&(a?e.sort(r):e=[...e].sort(r)),n&&n.end(),e};Qt.knownTypes=Hr;var gT=o=>{if(!o)return;let e=o.field,t=o.valueGetter,n=o.dir<0?-1:o.dir>0?1:0;if(!n)return;let r=o.fn;if(!r&&o.type){let i=Array.isArray(o.type)?o.type[0]:o.type;r=Qt.knownTypes[i],r||console.warn(`Unknown sort type "${o.type}" - please pass one of ${Object.keys(Qt.knownTypes).join(", ")}`)}return r||(r=Hr.string),(i,a)=>{let l=t?t(i):e?i[e]:i,s=t?t(a):e?a[e]:a,c=r(l,s);return c===0?c:n*c}},hT=o=>o.map(gT).filter(e=>e instanceof Function),Sf=(o,e)=>{let t=hT(o);return(n,r)=>{e&&(n=e(n),r=e(r));let i=0,a=0,l,s=t.length;for(;a<s;a++)if(l=t[a],!!l&&(i=l(n,r),i!==0))return i;return i}};var sa=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";n!==!0&&(this.negativeMap?(this.negativeMap.clear(),this.negativeMap.fill(n.map(r=>[r,!0]))):this.negativeMap=new Q(n.map(r=>[r,!0])),this.positiveMap&&this.positiveMap.clear()),t!==!0&&(this.positiveMap?(this.positiveMap.clear(),this.positiveMap.fill(t.map(r=>[r,!0]))):this.positiveMap=new Q(t.map(r=>[r,!0])),this.negativeMap&&this.negativeMap.clear())}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e.join(",")} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e.join(",")} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var mt=class extends sa{constructor(e){super(e)}getState(){return{expandedRows:this.allPositive?!0:this.positiveMap?.topDownKeys()??[],collapsedRows:this.allNegative?!0:this.negativeMap?.topDownKeys()??[]}}getPositiveFromState(e){return e.expandedRows}getNegativeFromState(e){return e.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isGroupRowExpanded(e){return this.isItemPositive(e)}isGroupRowCollapsed(e){return!this.isGroupRowExpanded(e)}setGroupRowExpanded(e,t){return this.setItemValue(e,t)}collapseGroupRow(e){this.setGroupRowExpanded(e,!1)}expandGroupRow(e){this.setGroupRowExpanded(e,!0)}toggleGroupRow(e){this.toggleItem(e)}};function Vo(o,e){return e.reduce((t,n)=>{let{field:r,valueGetter:i,toKey:a}=n,l=r?o[r]:i?.({data:o,field:r}),s=(a||Vr)(l,o);return t.push(s),t},[])}var Pe=class o{constructor(e,t,n){this.selectedRows=null;this.deselectedRows=null;this.defaultSelection=!1;this.selectedMap=new Q;this.deselectedMap=new Q;this.onlyUsePrimaryKeys=!1;this.selectionCache=new Q;this.selectionCountCache=new Q;this.mapSet=(e,t)=>{Array.isArray(t)||(this.onlyUsePrimaryKeys?t=[t]:t=[...this.getGroupKeysForPrimaryKey(t),t]),this.xcache(),e==="selected"?this.selectedMap.set(t,!0):this.deselectedMap.set(t,!0)};this._selectedMapSet=e=>{this.mapSet("selected",e)};this._deselectedMapSet=e=>{this.mapSet("deselected",e)};let r=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;this.getConfig=t,this.onlyUsePrimaryKeys=t().onlyUsePrimaryKeys,n&&Object.assign(this,n),this.update(r)}getGroupKeysForPrimaryKey(e){let{indexer:t,groupBy:n}=this.getConfig(),r=t.getDataForPrimaryKey(e);return r?Vo(r,n):[]}getGroupDeepMap(){return this.getConfig().groupDeepMap}getGroupCount(e){if(e.length==0)return this.getConfig().totalCount;let n=this.getGroupDeepMap()?.get(e);return n?n.totalChildrenCount??(n.items.length||0):0}getGroupKeysDirectlyInsideGroup(e){let{groupDeepMap:t}=this.getConfig();return t?.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1})||[]}getAllPrimaryKeysInsideGroup(e){let{groupDeepMap:t}=this.getConfig();if(!e.length)return(t?.getKeysStartingWith([],{excludeSelf:!0,depthLimit:1})||[]).map(i=>this.getAllPrimaryKeysInsideGroup(i)).flat();let n=t?.get(e);return n?n.items.map(this.getConfig().toPrimaryKey):[]}getGroupByLength(){return this.getConfig().groupBy.length}static from(e,t,n){return new o(e,t,n)}update(e){this.selectedRows=e.selectedRows||null,this.deselectedRows=e.deselectedRows||null,this.selectedMap.clear(),this.deselectedMap.clear(),this.selectedRows?.forEach(this._selectedMapSet),this.deselectedRows?.forEach(this._deselectedMapSet),this.defaultSelection=e.defaultSelection,this.xcache()}xcache(){this.selectionCache.clear(),this.selectionCountCache.clear()}getState(){let e=r=>{let i=this.getGroupByLength();return r.map(a=>this.onlyUsePrimaryKeys?a[0]:a.length>i?a.pop():a)},t=e(this.selectedMap.topDownKeys()),n=e(this.deselectedMap.topDownKeys());return{defaultSelection:this.defaultSelection,selectedRows:t,deselectedRows:n}}deselectAll(){this.update({defaultSelection:!1,selectedRows:[],deselectedRows:[]})}selectAll(){this.update({defaultSelection:!0,deselectedRows:[],selectedRows:[]})}isRowDefaultSelected(){return this.defaultSelection===!0}isRowDefaultDeselected(){return this.defaultSelection===!1}isRowSelected(e,t){if(this.onlyUsePrimaryKeys)return this.defaultSelection?!this.deselectedMap.has([e]):this.selectedMap.has([e]);t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e],r=this.selectionCache.get(n);if(r!==void 0)return r;let i=this.selectedMap.has(n),a=this.deselectedMap.has(n);if(i)return this.selectionCache.set(n,!0),!0;if(a)return this.selectionCache.set(n,!1),!1;if(this.selectedMap.has(t))return this.selectionCache.set(n,!0),!0;if(this.deselectedMap.has(t))return this.selectionCache.set(n,!1),!1;for(t=[...t];t.length;){t.pop();let l=this.selectedMap.has(t),s=this.deselectedMap.has(t);if(l)return this.selectionCache.set(n,!0),!0;if(s)return this.selectionCache.set(n,!1),!1}return this.selectionCache.set(n,this.defaultSelection),this.defaultSelection}isRowDeselected(e,t){return!this.isRowSelected(e,t)}setRowSelected(e,t,n){t?this.setRowAsSelected(e,n):this.setRowAsDeselected(e,n)}getGroupRowSelectionState(e){let t=this.selectionCache.get(e);if(t!==void 0)return t;let{selectedCount:n,deselectedCount:r}=this.getSelectionCountFor(e,this.onlyUsePrimaryKeys?void 0:this.getGroupRowBooleanSelectionStateFromParent(e)),i=n&&r?null:!!n;return this.selectionCache.set(e,i),i}getGroupRowBooleanSelectionStateFromParent(e){if(!e.length)return this.defaultSelection;let t=[...e],n=this.deselectedMap.has(t),r=this.selectedMap.has(t),i=r&&!n?!0:n&&!r?!1:void 0;if(i===void 0)for(;t.length;){if(t.pop(),this.deselectedMap.has(t)){i=!1;break}if(this.selectedMap.has(t)){i=!0;break}}return i===void 0&&(i=this.defaultSelection),i}isGroupRowPartlySelected(e){return this.getGroupRowSelectionState(e)===null}isGroupRowSelected(e){return this.getGroupRowSelectionState(e)===!0}isGroupRowDeselected(e){return this.getGroupRowSelectionState(e)===!1}selectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!0?this.deselectedMap.delete([i]):this._selectedMapSet(i)}),this.xcache();return}this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.selectedMap.delete(r)}),e.length===1&&this.defaultSelection===!0||this._selectedMapSet(e),this.deselectedMap.getKeysStartingWith(e).forEach(r=>{this.deselectedMap.delete(r)})}deselectGroupRow(e){if(this.onlyUsePrimaryKeys){this.getAllPrimaryKeysInsideGroup(e).forEach(i=>{this.defaultSelection===!1?this.selectedMap.delete([i]):this._deselectedMapSet(i)}),this.xcache();return}this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0}).forEach(r=>{this.deselectedMap.delete(r)}),e.length===1&&this.defaultSelection===!1||this._deselectedMapSet(e),this.selectedMap.getKeysStartingWith(e).forEach(r=>{this.selectedMap.delete(r)})}setRowAsSelected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this.deselectedMap.delete([e]):this._selectedMapSet(e),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.deselectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!0&&(this._selectedMapSet(n),this.getGroupRowSelectionState(t)===!0&&this.selectGroupRow(t))}setRowAsDeselected(e,t){if(this.onlyUsePrimaryKeys){this.defaultSelection?this._deselectedMapSet(e):this.selectedMap.delete([e]),this.xcache();return}t=t||this.getGroupKeysForPrimaryKey(e);let n=[...t,e];this.selectedMap.delete(n),this.xcache(),this.getGroupRowSelectionState(t)!==!1&&(this._deselectedMapSet(n),this.getGroupRowSelectionState(t)===!1&&this.deselectGroupRow(t))}deselectRow(e,t){this.setRowSelected(e,!1,t)}selectRow(e,t){this.setRowSelected(e,!0,t)}toggleGroupRowSelection(e){this.getGroupRowSelectionState(e)===!0?this.deselectGroupRow(e):this.selectGroupRow(e)}toggleRowSelection(e,t){this.isRowSelected(e,t)?this.deselectRow(e,t):this.selectRow(e,t)}getSelectedCount(){return this.getSelectionCountFor([]).selectedCount}getDeselectedCount(){return this.getSelectionCountFor([]).deselectedCount}getSelectionCountFor(e=[],t){let n=this.selectionCountCache.get(e);if(n!=null)return n;let r=this.getGroupByLength();if(e.length>r){let c=this.isRowSelected(e)?{selectedCount:1,deselectedCount:0}:{selectedCount:0,deselectedCount:1};return this.selectionCountCache.set(e,c),c}if(r&&this.onlyUsePrimaryKeys){let c=this.getAllPrimaryKeysInsideGroup(e),u=0,d=0;c.forEach(f=>{if(this.defaultSelection){if(this.deselectedMap.has([f])){d++;return}u++}else{if(this.selectedMap.has([f])){u++;return}d++}});let p={selectedCount:u,deselectedCount:d};return this.selectionCountCache.set(e,p),p}t=t??this.getGroupRowBooleanSelectionStateFromParent(e);let i=this.getGroupKeysDirectlyInsideGroup(e);if(e.length===this.getGroupByLength()){let c=this.selectedMap.has(e)?!0:this.deselectedMap.has(e)?!1:t,u=this.getGroupCount(e),d=this.selectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,p=this.deselectedMap.getKeysStartingWith(e,{excludeSelf:!0,depthLimit:1}).length,f=u-(d+p),m={selectedCount:d+(c?f:0),deselectedCount:p+(c?0:f)};return this.selectionCountCache.set(e,m),m}let a=0,l=0;if(this.getConfig().lazyLoad&&!i.length){let c=this.getConfig().groupDeepMap?.get(e)?.totalChildrenCount||0;t?(a=c,l=this.deselectedMap.getAllChildrenSizeFor(e),l===c&&(a=0)):(l=c,a=this.selectedMap.getAllChildrenSizeFor(e),a===c&&(l=0))}i.forEach(c=>{let u=this.selectedMap.get(c),d=this.deselectedMap.get(c),p=u?!0:d?!1:t,{selectedCount:f,deselectedCount:m}=this.getSelectionCountFor(c,p);a+=f,l+=m});let s={selectedCount:a,deselectedCount:l};return this.selectionCountCache.set(e,s),s}};var bT="*",He=class{constructor(e){this.wildcard=bT;this.cache=new Q;this.selectedRowsToColumns=new Map;this.selectedColumnsToRows=new Map;this.deselectedRowsToColumns=new Map;this.deselectedColumnsToRows=new Map;this.defaultSelection=!1;this.debugId="";this.deselectAll=()=>{this.update({defaultSelection:!1,selectedCells:[]})};this.selectAll=()=>{this.update({defaultSelection:!0,deselectedCells:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}selectCell(e,t){this.setCellSelected(e,t,!0)}deselectCell(e,t){this.setCellSelected(e,t,!1)}selectColumn(e){this.setCellSelected(this.wildcard,e,!0)}deselectColumn(e){this.setCellSelected(this.wildcard,e,!1)}setCellSelected(e,t,n){let r=e===this.wildcard,i=t===this.wildcard;if(this.isCellSelected_Internal(e,t)===n)return;let l=[];if(r){let c=this.deselectedColumnsToRows.get(t),u=this.selectedColumnsToRows.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(d,t,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(d,t,!1)}),[...this.cache.keys()].forEach(d=>{let[p,f]=d;f===t&&l.push([p,t])})}if(i){let c=this.deselectedRowsToColumns.get(t),u=this.selectedRowsToColumns.get(t);c?.forEach(d=>{d!==this.wildcard&&this.setCellInDeselection(e,d,!1)}),u?.forEach(d=>{d!==this.wildcard&&this.setCellInSelection(e,d,!1)}),[...this.cache.keys()].forEach(d=>{let[p]=d;p===e&&l.push([e,t])})}let s=[e,t];if(l.forEach(c=>{this.cache.delete(c)}),this.cache.delete(s),n)if(this.defaultSelection){let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1);let u=this.deselectedRowsToColumns.get(this.wildcard),d=this.deselectedColumnsToRows.get(this.wildcard);(u?.has(t)||d?.has(e))&&this.setCellInSelection(e,t,!0)}else{let c=this.deselectedRowsToColumns.get(e);c&&c.has(t)&&this.setCellInDeselection(e,t,!1),this.setCellInSelection(e,t,!0)}else if(this.defaultSelection)this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1),this.setCellInDeselection(e,t,!0);else{this.selectedRowsToColumns.get(e)?.has(t)&&this.setCellInSelection(e,t,!1);let u=this.selectedRowsToColumns.get(this.wildcard),d=this.selectedColumnsToRows.get(this.wildcard);if(u?.has(t)||d?.has(e)){this.setCellInDeselection(e,t,!0);return}}}setCellInDeselection(e,t,n){if(n){let r=this.deselectedRowsToColumns.get(e)||new Set;r.add(t),this.deselectedRowsToColumns.set(e,r)}else{let r=this.deselectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.deselectedRowsToColumns.delete(e))}if(n){let r=this.deselectedColumnsToRows.get(t)||new Set;r.add(e),this.deselectedColumnsToRows.set(t,r)}else{let r=this.deselectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.deselectedColumnsToRows.delete(t))}}setCellInSelection(e,t,n){if(e===this.wildcard&&t===this.wildcard)throw new Error("rowId and colId cannot be used as a wildcard at the same time!");if(n){let r=this.selectedRowsToColumns.get(e)||new Set;r.add(t),this.selectedRowsToColumns.set(e,r)}else{let r=this.selectedRowsToColumns.get(e);r&&(r.delete(t),r.size===0&&this.selectedRowsToColumns.delete(e))}if(n){let r=this.selectedColumnsToRows.get(t)||new Set;r.add(e),this.selectedColumnsToRows.set(t,r)}else{let r=this.selectedColumnsToRows.get(t);r&&(r.delete(e),r.size===0&&this.selectedColumnsToRows.delete(t))}}update(e){let t=e.selectedCells||null,n=e.deselectedCells||null;this.selectedRowsToColumns.clear(),this.selectedColumnsToRows.clear(),this.deselectedRowsToColumns.clear(),this.deselectedColumnsToRows.clear(),this.cache.clear(),t&&t.forEach(([r,i])=>{this.setCellInSelection(r,i,!0)}),n&&n.forEach(([r,i])=>{this.setCellInDeselection(r,i,!0)}),this.defaultSelection=e.defaultSelection}isCellSelectionInRow(e,t){if(this.defaultSelection){let r=this.deselectedRowsToColumns.get(e);if(r){if(r.has(this.wildcard)){let i=this.selectedRowsToColumns.get(e);return i&&i.size>0?t.some(a=>i.has(a)):!1}return t.some(i=>!r.has(i))}return!0}let n=this.selectedRowsToColumns.get(e);if(n){if(n.has(this.wildcard)){let r=this.deselectedRowsToColumns.get(e);return r&&r.size>0?!t.every(a=>r.has(a)):!0}return t?t.some(r=>n.has(r)):!1}return!1}error(e){gn(`${this.debugId}:CellSelectionState`)(e)}isCellSelected(e,t){return e===this.wildcard||t===this.wildcard?(this.error("CellSelectionState.isCellSelected should not be called with wildcard"),!1):this.isCellSelected_Internal(e,t)}isCellSelected_Internal(e,t){let n=[e,t],{cache:r}=this,i=r.get(n);if(i!=null)return i;let a=()=>(r.set(n,!1),!1),l=()=>(r.set(n,!0),!0),s=this.deselectedColumnsToRows.get(this.wildcard),c=this.deselectedRowsToColumns.get(this.wildcard),u=this.selectedColumnsToRows.get(this.wildcard),d=this.selectedRowsToColumns.get(this.wildcard);if(this.defaultSelection){let m=this.deselectedRowsToColumns.get(e);return m&&m.has(t)?a():s?.has(e)||c?.has(t)?this.selectedRowsToColumns.get(e)?.has(t)?l():a():l()}let f=this.selectedRowsToColumns.get(e);return f&&f.has(t)?l():u?.has(e)||d?.has(t)?this.deselectedRowsToColumns.get(e)?.has(t)?a():l():a()}getState(){let e=[],t=[];return this.deselectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{e.push([r,i])})}),this.selectedRowsToColumns.forEach((n,r)=>{n.forEach(i=>{t.push([r,i])})}),{defaultSelection:this.defaultSelection,deselectedCells:e,selectedCells:t}}};var yT=Ke("IT:InfiniteTable"),TT="#dc3545",ST="#eb9316";var wf="Warn",vf="Error",CT="Info",wT="Success",vT="Logs",ca=yT.extend(vT),oO=ca.extend(CT),IT=ca.extend(wf),RT=ca.extend(vf),rO=ca.extend(wT);var xT=ST,PT=TT;var DT=(o,e)=>{e=e?e.extend?e.extend(wf):e:IT,e(typeof e.color=="function"?e.color(xT,o):o)},MT=(o,e)=>{e=e?e.extend?e.extend(vf):e:RT,e(typeof e.color=="function"?e.color(PT,o):o)};var Cf=new Q,If=(o,...e)=>{Cf.has(e)||(Cf.set(e,!0),o())};var Go=(o,e=o,t)=>{If(()=>DT(o,t),e,"warn")},Rf=(o,e=o,t)=>{If(()=>MT(o,t),e,"error")};function ua(o,e){return new Pe(o,ct(e))}function ct(o){return()=>{let e=typeof o=="function"?o():o;return{lazyLoad:!!e.lazyLoad,toPrimaryKey:e.toPrimaryKey,onlyUsePrimaryKeys:!e.useGroupKeysForMultiRowSelection,groupBy:e.groupBy,groupDeepMap:e.groupDeepMap,indexer:e.indexer,totalCount:e.unfilteredCount}}}function xf(o){let{getDataSourceState:e,dataSourceActions:t}=o;return{get allRowsSelected(){return e().allRowsSelected},selectAll(){let{rowSelection:r,selectionMode:i}=e();if(i!=="multi-row")throw"Selection mode is not multi-row";if(!(r instanceof Pe))throw"Invalid row selection";let a=new Pe(r,ct(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 Pe))throw"Invalid row selection";let a=new Pe(r,ct(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 Pe))throw"Invalid row selection";if(!i){let u=s.getDataForPrimaryKey(r);i=u?Vo(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 Pe))throw"Invalid row selection";if(!i){let d=s.getDataForPrimaryKey(r);i=d?Vo(d,c):[]}let u=new Pe(a,ct(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 Pe))throw"Invalid row selection";if(a==="multi-row"){if(!i){let d=s.getDataForPrimaryKey(r);i=d?Vo(d,c):[]}let u=new Pe(l,ct(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 Pe))throw"Invalid row selection";let s=new Pe(a,ct(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 Pe))throw"Invalid row selection";let s=new Pe(a,ct(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 Pe))throw"Invalid row selection";let s=new Pe(a,ct(e));s.toggleGroupRowSelection(r),t.rowSelection=s},getGroupRowSelectionState(r,i){let a=e(),{selectionMode:l,groupBy:s}=a,c=i?new Pe(i,ct(a)):a.rowSelection;if(l!=="multi-row")throw'Selection mode should be "multi-row"';if(!s)throw"No grouping specified";if(!(c instanceof Pe))throw"Invalid row selection";return c.getGroupRowSelectionState(r)},getSelectedPrimaryKeys:r=>{let i=e(),a=r?new Pe(r,ct(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,ET=o=>o;function Pf(o,e=50,t){ws.set(o,{lastCallTime:0,lastCallArg:null});let n=t??ET;return r=>{let{lastCallTime:i,lastCallArg:a}=ws.get(o)||{lastCallTime:0,lastCallArg:null},l=Date.now(),s=l-i,c=At(n(a),n(r));s<e&&c||(ws.set(o,{lastCallTime:l,lastCallArg:r}),o(r))}}var da=class{constructor(){this.primaryKeyToData=new Map;this.nodePathsToData=new Q;this.removeNodePath=(e,t)=>{if(this.nodePathsToData.delete(e),this.remove(e[e.length-1]),!t)return;let n=this.nodePathsToData.get(e);if(n){let r=t.getNodeChildren?t.getNodeChildren(n):t.nodesKey?n[t.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,t.toPrimaryKey(l)];this.removeNodePath(s,t)}}};this.remove=e=>{this.primaryKeyToData.delete(e)};this.add=(e,t)=>{this.primaryKeyToData.set(e,t)};this.addNodePath=(e,t,n)=>{if(this.nodePathsToData.set(e,t),this.add(e[e.length-1],t),!n)return;let r=n.getNodeChildren?n.getNodeChildren(t):n.nodesKey?t[n.nodesKey]:null;if(r&&Array.isArray(r))for(let i=0,a=r.length;i<a;i++){let l=r[i],s=[...e,n.toPrimaryKey(l)];this.addNodePath(s,l,n)}};this.clear=()=>{this.primaryKeyToData.clear(),this.nodePathsToData.clear()};this.getDataForPrimaryKey=e=>this.primaryKeyToData.get(e);this.getDataForNodePath=e=>this.nodePathsToData.get(e);this.indexArray=(e,t)=>{let{cache:n,toPrimaryKey:r,getNodeChildren:i,isLeafNode:a,nodesKey:l}=t,s=!!i&&!!a;n&&n.shouldResetDataSource()&&(this.clear(),e=[]);let c=n&&!n.isEmpty();if(c&&(e=e.concat()),!e.length&&n){if(!n.isEmpty()){let u=[...n.getMutationsArray(),...n.getTreeMutationsArray()];for(let d=0,p=u.length;d<p;d++){let f=u[d];if(f.type==="insert"){let m=r(f.data);s?this.addNodePath([m],f.data,t):this.add(m,f.data),e.push(f.data)}}n?.removeInfo(void 0)}}else{let u=(d,p)=>{for(let f=0;f<d.length;f++){let m=d[f];c&&s&&Array.isArray(m[l])&&(m=d[f]={...m});let g=!1;if(m!=null){let b=r(m),h=s?[...p,b]:void 0,y=s&&!!h,S=y?n?.getMutationsForNodePath(h):n?.getMutationsForPrimaryKey(b);if(S&&S.length){for(let C=0,T=S.length;C<T;C++){let v=S[C];if(v.type==="delete"&&!g&&(y?this.removeNodePath(h,t):this.remove(b),g=!0,d.splice(f,1),f--),v.type==="update"&&!g&&(m={...m,...v.data},d[f]=m),v.type==="update-children"&&!g){let w=v.children(m[l],m);m={...m},w!==void 0?m[l]=w:delete m[l],d[f]=m}v.type==="insert"&&(v.position==="before"?(d.splice(f,0,v.data),f--):d.splice(f+1,0,v.data))}y?n?.removeNodePathInfo(h):n?.removeInfo(b)}if(!g)if(y){this.addNodePath(h,m);let C=a(m),T=C?null:i(m);!C&&Array.isArray(T)&&(p.push(b),c&&(m[l]=T=T.concat()),u(T,p),p.pop())}else this.add(b,m)}}};u(e,[])}return e}}};var Je=require("react");var _t=require("react");function ro(o,e){let t=(0,_t.useRef)({}),n=(0,_t.useRef)({}),r=n.current,i=(0,_t.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,_t.useEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function AT(o,e){let t=(0,_t.useRef)({}),n=(0,_t.useRef)({}),r=n.current,i=(0,_t.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,_t.useLayoutEffect)(()=>{let s=i.current,c;return Object.keys(s).length!==0&&(c=o(s,r)),i.current={},n.current={},c},l)}function _T(o,e){let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);(0,_t.useEffect)(o,t)}function vs(...o){return(...t)=>{o.forEach(n=>{typeof n=="function"&&n(...t)})}}function Is(o){let{pivotByAtIndex:e,pivotAggregator:t}=o;return e?.column&&(typeof e.column=="function"?Object.assign(o,e.column({column:o})):Object.assign(o,e.column)),t?.pivotColumn&&(typeof t.pivotColumn=="function"?Object.assign(o,t.pivotColumn({column:o})):Object.assign(o,t.pivotColumn)),o}function Rs(o){let{pivotByAtIndex:e}=o;return e?.columnGroup&&(typeof e.columnGroup=="function"?Object.assign(o,e.columnGroup({columnGroup:o})):Object.assign(o,e.columnGroup)),o}function Df({deepMap:o,pivotBy:e,pivotTotalColumnPosition:t,pivotGrandTotalColumnPosition:n,reducers:r={},showSeparatePivotColumnForSingleAggregation:i=!1}){let a=e.length,l=Object.keys(r).map(f=>({...r[f],id:f}));l.length||(i=!0,n=!1,t=!1,l.push({id:"__empty-aggregation-reducer__",name:"-",initialValue:null,reducer:()=>null}));let s={},c={},u=at(function(){l.forEach((f,m)=>{s[`total:${f.id}`]=Is({header:`${f.name||f.id} total`,pivotBy:e,pivotColumn:!0,pivotTotalColumn:!0,pivotAggregator:f,pivotAggregatorIndex:m,pivotGroupKeys:[],pivotGroupKey:"",pivotIndex:-1,valueFormatter:({rowInfo:g})=>g.isGroupRow?g.reducerResults?.[f.id]:null})})});(!a&&t==="start"||n==="start")&&u();let d=!i&&l.length===1;return o.visitDepthFirst((f,m,g,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 C=S;S=m.join("/");let T=m[m.length-1];c[S]=Rs({header:`${T}`,columnGroup:C,pivotBy:e,pivotGroupKeys:m,pivotByAtIndex:h,pivotIndex:m.length-1,pivotGroupKey:T})}l.forEach((C,T)=>{let v=d?`${m[m.length-1]}`:C.name||C.id,w=Is({pivotBy:e,pivotColumn:!0,pivotTotalColumn:!1,pivotAggregator:C,pivotAggregatorIndex:T,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotIndex:m.length-1,pivotByAtIndex:h,defaultSortable:!1,columnGroup:S,header:v,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[C.id]:null}),I=`${C.id}:${m.join("/")}`;s[I]=w})}else{let h=m.join("/"),y=m.slice(0,-1);if(c[h]=Rs({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],C=y.length?y.join("/"):void 0;if(!d){let T=C;C=`total:${m.join("/")}`,c[C]=Rs({header:`${m[m.length-1]} total`,columnGroup:T,pivotBy:e,pivotTotalColumnGroup:!0,pivotGroupKeys:m,pivotIndex:m.length-1,pivotByAtIndex:S,pivotGroupKey:m[m.length-1]})}l.forEach((T,v)=>{let w=d?`${m[m.length-1]} total `:`${T.name||T.id} total`,I=Is({columnGroup:C,header:w,pivotAggregator:T,pivotAggregatorIndex:v,pivotColumn:!0,pivotTotalColumn:!0,pivotGroupKeys:m,pivotGroupKey:m[m.length-1],pivotByAtIndex:S,pivotIndex:m.length-1,pivotBy:e,defaultSortable:!1,valueFormatter:({rowInfo:R})=>R.isGroupRow?R.pivotValuesMap?.get(m)?.reducerResults[T.id]:null});s[`total:${T.id}:${m.join("/")}`]=I})}}(t==="start"||t===!1)&&b?.()}),(!a&&t==="end"||n==="end")&&u(),{columns:s,columnGroups:c}}var Mf=Symbol("CLEAR"),io=class o{constructor(e){this.affectedFields=new Set;this.allFieldsAffected=!1;this.primaryKeyToData=new Map;this.nodePathToData=new Q;this.getAffectedFields=()=>this.allFieldsAffected?!0:this.affectedFields;this.delete=(e,t,n)=>{this.allFieldsAffected=!0;let r=e,i=this.primaryKeyToData.get(r)||[];i.push({type:"delete",primaryKey:e,originalData:t,metadata:n}),this.primaryKeyToData.set(r,i)};this.deleteNodePath=(e,t,n)=>{this.allFieldsAffected=!0;let r=this.nodePathToData.get(e)||[];r.push({type:"delete",nodePath:e,originalData:t,metadata:n}),this.nodePathToData.set(e,r)};this.insert=(e,t,n,r)=>{let i=e,a=this.primaryKeyToData.get(i)||[];this.allFieldsAffected=!0,a.push({type:"insert",primaryKey:e,data:t,position:n,originalData:null,metadata:r}),this.primaryKeyToData.set(i,a)};this.insertNodePath=(e,t,n,r)=>{let i=this.nodePathToData.get(e)||[];this.allFieldsAffected=!0,i.push({type:"insert",nodePath:e,data:t,position:n,originalData:null,metadata:r}),this.nodePathToData.set(e,i)};this.update=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(s=>this.affectedFields.add(s)));let i=e,a=this.primaryKeyToData.get(i)||[];a.push({type:"update",primaryKey:e,data:t,originalData:n,metadata:r}),this.primaryKeyToData.set(e,a)};this.updateNodePath=(e,t,n,r)=>{this.allFieldsAffected||(this.nodesKey&&Array.isArray(t[this.nodesKey])?this.allFieldsAffected=!0:Object.keys(t).forEach(l=>this.affectedFields.add(l)));let i=this.nodePathToData.get(e)||[];i.push({type:"update",nodePath:e,data:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.updateChildren=(e,t,n,r)=>{this.allFieldsAffected=!0;let i=this.nodePathToData.get(e)||[];i.push({type:"update-children",nodePath:e,children:t,originalData:n,metadata:r}),this.nodePathToData.set(e,i)};this.resetDataSource=e=>{this.clear(),this.allFieldsAffected=!0;let t=Mf,n=this.primaryKeyToData.get(t)||[];n.push({type:"clear-all",primaryKey:void 0,metadata:e}),this.primaryKeyToData.set(t,n)};this.shouldResetDataSource=()=>this.primaryKeyToData.has(Mf);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=()=>Q.clone(this.nodePathToData);this.getMutationsArray=()=>Array.from(this.primaryKeyToData.values()).flat();this.getTreeMutationsArray=()=>Array.from(this.nodePathToData.values()).flat();this.nodesKey=e.nodesKey}static clone(e,{light:t=!1}={}){let n=new o({nodesKey:e.nodesKey});return n.allFieldsAffected=e.allFieldsAffected,n.affectedFields=new Set(e.affectedFields),n.primaryKeyToData=t?e.primaryKeyToData:new Map(e.primaryKeyToData),n.nodePathToData=t?e.nodePathToData:Q.clone(e.nodePathToData),n}};function On(o,e){return e().dataArray[o]}function pa(o){return o().dataArray}var ot=class{constructor(e){this.collapsedPathsMap=new Q;this.expandedPathsMap=new Q;this.collapsedIdsMap=new Map;this.expandedIdsMap=new Map;this._mode="path";this.defaultExpanded=!1;this.expandAll=()=>{this.update({defaultExpanded:!0,collapsedPaths:[]})};this.collapseAll=()=>{this.update({defaultExpanded:!1,expandedPaths:[]})};let t=e&&e instanceof Object.getPrototypeOf(this).constructor?e.getState():e;t&&this.update(t)}get mode(){return this._mode}reset(){this.collapsedPathsMap.clear(),this.expandedPathsMap.clear(),this.collapsedIdsMap.clear(),this.expandedIdsMap.clear()}destroy(){this.reset()}expandNode(e){this.setNodeExpanded(e,!0)}collapseNode(e){this.setNodeExpanded(e,!1)}setNodeExpanded(e,t){let{collapsedPathsMap:n,collapsedIdsMap:r,expandedPathsMap:i,expandedIdsMap:a,defaultExpanded:l,_mode:s}=this;s==="id"&&Array.isArray(e)&&(e=e[e.length-1]),t===l?t?s==="path"&&Array.isArray(e)?n.delete(e):r.delete(e):s==="path"&&Array.isArray(e)?i.delete(e):a.delete(e):t?s==="path"&&Array.isArray(e)?i.set(e,!0):a.set(e,!0):s==="path"&&Array.isArray(e)?n.set(e,!0):r.set(e,!0)}isNodeExpandedByPath(e){return this.isNodeExpanded(e)}isNodeExpandedById(e){return this.isNodeExpanded(e)}isNodeExpanded(e){if(this._mode==="id"&&Array.isArray(e)&&(e=e[e.length-1]),this._mode==="id"&&Array.isArray(e))throw`You try to check if a node is expanded by id (${e}) but your TreeExpandState is configured to use node paths.`;if(this._mode==="path"&&!Array.isArray(e))throw`You try to check if a node is expanded by path (${e}) but your TreeExpandState is configured to use node ids.`;return this.defaultExpanded?this._mode==="path"&&Array.isArray(e)?!this.collapsedPathsMap.has(e):!this.collapsedIdsMap.has(e):this._mode==="path"&&Array.isArray(e)?this.expandedPathsMap.has(e):this.expandedIdsMap.has(e)}update(e){if(this.defaultExpanded=e.defaultExpanded,this.reset(),e.expandedPaths||e.collapsedPaths){this._mode="path";let r=e.expandedPaths||null,i=e.collapsedPaths||null;if(r)for(let a=0,l=r.length;a<l;a++)this.expandedPathsMap.set(r[a],!0);if(i)for(let a=0,l=i.length;a<l;a++)this.collapsedPathsMap.set(i[a],!0);return}this._mode="id";let t=e.expandedIds||null,n=e.collapsedIds||null;if(t)for(let r=0,i=t.length;r<i;r++)this.expandedIdsMap.set(t[r],!0);if(n)for(let r=0,i=n.length;r<i;r++)this.collapsedIdsMap.set(n[r],!0)}getState(){if(this._mode==="path"){let n=Array.from(this.collapsedPathsMap.keys()),r=Array.from(this.expandedPathsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedPaths:n,expandedPaths:r}}let e=Array.from(this.collapsedIdsMap.keys()),t=Array.from(this.expandedIdsMap.keys());return{defaultExpanded:this.defaultExpanded,collapsedIds:e,expandedIds:t}}};var OT=(o,e)=>o.length-e.length,Xe=class o{constructor(e,t){this.selectedPaths=null;this.deselectedPaths=null;this.defaultSelection=!1;this.selectionMap=new Q;this.cache=new Q;this.strictMode=!1;let n=e instanceof Object.getPrototypeOf(this).constructor,r=n?e.getState():e;this.setConfig(t||(n?e.config:{treePaths:new Q})),this.disableStrictMode(),this.update(r),this.config.strictCheckPaths&&this.enableStrictMode()}getTreePaths(e){return e?Array.isArray(e)?new Q(e.map(t=>[t,!0])):e:this.config.treePaths}withTreePaths(e,t){let n=this.config.treePaths;t=this.getTreePaths(t);let r=t!==n;r&&this.xcache(),this.config.treePaths=t;let i=e(t);return this.config.treePaths=n,r&&this.xcache(),i}getLeafNodePaths(e=[],t){return this.withTreePaths(n=>n.getKeysForLeafNodesStartingWith(e),t)}forEachLeafNodePath(e,t=[],n){let r={selected:!1};this.withTreePaths(i=>{i.getLeafNodesStartingWith(t,a=>{r.selected=this.isNodeSelected(a.keys)===!0,e(a.keys,r)})},n)}getSelectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)&&n.push(i.keys)})},t),n}getDeselectedLeafNodePaths(e=[],t){let n=[];return this.withTreePaths(r=>{r.getLeafNodesStartingWith(e,i=>{this.isNodeSelected(i.keys)||n.push(i.keys)})},t),n}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 o(e,t)}setConfig(e){let t=typeof e=="function"?e():e;this.config={treePaths:Array.isArray(t.treePaths)?new Q(t.treePaths.map(n=>[n,!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:n,deselectedPaths:r}=this;t.clear(),n?.forEach(i=>this.setSelectionForPath(i,!0)),r?.forEach(i=>this.setSelectionForPath(i,!1)),this.defaultSelection=e.defaultSelection,this.xcache()}setSelectionForPath(e,t){this.isPathAvailable(e)&&this.selectionMap.set(e,t)}getState(){let e=[],t=[];return this.selectionMap.topDownEntries().forEach(([n,r])=>{r?e.push(n):t.push(n)}),{defaultSelection:this.defaultSelection,selectedPaths:e,deselectedPaths:t}}deselectAll(){this.update({defaultSelection:!1,selectedPaths:[],deselectedPaths:[]})}selectAll(){this.update({defaultSelection:!0,deselectedPaths:[],selectedPaths:[]})}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 n=this.cache.get(e);if(n)return n;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(OT);if(this.strictMode&&(l=l.filter(d=>this.isPathAvailable(d))),!l.length){if(i!==null){let p=r?i:!1;return this.cacheIt(e,{selected:p,selectedCount:p?r:0,deselectedCount:p?0:r,leafCount:r})}let d=this.getNodeBooleanSelectionStateFromParent(e);return this.cacheIt(e,{selected:d,selectedCount:d?r:0,deselectedCount:d?0:r,leafCount:r})}let s=0,c=0,u=this.getNodeBooleanSelectionStateFromParent(e);u?s+=r:c+=r;for(let d=0,p=l.length;d<p;d++){let f=l[d],{selectedCount:m,deselectedCount:g}=this.getSelectionStateForNode(f);if(u?(s-=g,c+=g):(c-=m,s+=m),t&&m>0&&g>0)return this.cacheIt(e,{selected:null,leafCount:r,selectedCount:s,deselectedCount:c})}if(!s&&!c)return this.cacheIt(e,{selected:u,selectedCount:u?r:0,deselectedCount:u?0:r,leafCount:r});if(s){let d=s===r?!0:null;return this.cacheIt(e,{selected:d,selectedCount:s,deselectedCount:c,leafCount:r})}return this.cacheIt(e,{selected:!1,selectedCount:0,deselectedCount:r,leafCount:r})}isPathSelected(e){return this.isPathAvailable(e)?this.getSelectionStateForNode(e,!0).selected:!1}getNodeBooleanSelectionStateFromParent(e){let{defaultSelection:t,selectionMap:n}=this;if(!e.length)return t;let r=[...e];do{let i=n.get(r);if(i!==void 0)return i;r.pop()}while(r.length);return t}setNodeSelection(e,t){if(!e.length)return;if(this.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:n}=this.getSelectionStateForNode(e);return{selectedCount:t,deselectedCount:n}}destroy(){this.config=void 0,this.xcache(),this.selectionMap.clear()}};function ma(o,e){return new Xe(o,Ho(e))}function Ho(o){return()=>({treePaths:(typeof o=="function"?o():o).treePaths})}var fa=class{constructor(e){this.setNodeSelection=(e,t,n)=>{let{treeSelectionState:r,selectionMode:i}=this.getState();if(!this.isNodeSelectable(e)&&!n?.force)return;if(i==="single-row"){this.actions.treeSelection=t?e[e.length-1]:null;return}if(i!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(r instanceof Xe))throw"Invalid tree selection";let a=new Xe(r,Ho(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(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getSelectedLeafNodePaths(e?.rootNodePath,t):[]}getDeselectedLeafNodePaths(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;return n?n.getDeselectedLeafNodePaths(e?.rootNodePath,t):[]}getSelectedLeafRowInfos(e){let{treePaths:t}=this.getState(),n=e?.treeSelectionState||this.getState().treeSelectionState;if(!t||!n)return[];let r=e?.rootNodePath||[],i=[];return t.getLeafNodesStartingWith(r,a=>{if(n.isNodeSelected(a.keys)){let l=this.getRowInfoByPath(a.keys);l&&i.push(l)}},{excludeSelf:!0}),i}get allRowsSelected(){return this.getState().allRowsSelected}isNodeReadOnly(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeReadOnly;return t&&t.isTreeNode&&t.isParentNode&&n?n(t):!1}isNodeSelectable(e){let t=this.getRowInfoByPath(e),n=this.getState().isNodeSelectable;return t&&t.isTreeNode?n(t):!1}isNodeExpanded(e){let t=this.getState(),{isNodeExpanded:n,isNodeCollapsed:r,treeExpandState:i}=t,a=this.getRowInfoByPath(e);if(a){if(!a.isTreeNode||!a.isParentNode)return!1;if(r)return!n(a,i);if(n)return n(a,i)}return i.isNodeExpanded(e)}expandAll(){let e=new ot({defaultExpanded:!0,collapsedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:null},this.actions.treeExpandState=e}collapseAll(){let e=new ot({defaultExpanded:!1,expandedPaths:[]});this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},this.actions.treeExpandState=e}expandNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ot(n.treeExpandState);r.expandNode(e),this.getState().lastExpandStateInfoRef.current={state:"expanded",nodePath:e},this.actions.treeExpandState=r,n.onNodeExpand?.(e,this.getCallbackParam(e))}collapseNode(e,t){if(this.isNodeReadOnly(e)&&!t?.force)return;let n=this.getState(),r=new ot(n.treeExpandState);r.collapseNode(e),this.getState().lastExpandStateInfoRef.current={state:"collapsed",nodePath:e},this.actions.treeExpandState=r,n.onNodeCollapse?.(e,this.getCallbackParam(e))}toggleNode(e,t){let n=this.getState(),r=new ot(n.treeExpandState),i=!this.isNodeExpanded(e);this.isNodeReadOnly(e)&&!t?.force||(r.setNodeExpanded(e,i),this.getState().lastExpandStateInfoRef.current={state:i?"expanded":"collapsed",nodePath:e},this.actions.treeExpandState=r,i?n.onNodeExpand?.(e,this.getCallbackParam(e)):n.onNodeCollapse?.(e,this.getCallbackParam(e)))}getNodeDataByPath(e){if(!e.length)return null;let t=this.getRowInfoByPath(e);return t?t.data:null}getRowInfoByPath(e){let{pathToIndexMap:t}=this.getState(),n=t.get(e);return n!==void 0?On(n,this.getState):null}selectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Xe))throw"Invalid node selection";let n=new Xe(e,Ho(this.getState));n.selectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}deselectAll(){let{treeSelectionState:e,selectionMode:t}=this.getState();if(t!=="multi-row")throw"Selection mode is not multi-row";if(!(e instanceof Xe))throw"Invalid node selection";let n=new Xe(e,Ho(this.getState));n.deselectAll(),this.getState().lastSelectionUpdatedNodePathRef.current=null,this.actions.treeSelection=n}isNodeSelected(e){let{treeSelectionState:t,treeSelection:n,selectionMode:r}=this.getState();if(r==="single-row"){let i=e[e.length-1];return Array.isArray(n)?treeSelection.join(",")===e.join(","):n===i}if(r!=="multi-row")throw"Selection mode is not multi-row or single-row";if(!(t instanceof Xe))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 Ko=class{constructor(e){let t=e instanceof Object.getPrototypeOf(this).constructor?e.getState():e,n=this.getPositiveFromState(t),r=this.getNegativeFromState(t);this.update({negativeItems:r,positiveItems:n})}getInitialState(){return this.initialState}destroy(){this.positiveMap?.clear(),this.negativeMap?.clear(),delete this.positiveMap,delete this.negativeMap}update(e){let{positiveItems:t,negativeItems:n}=e;if(this.allNegative=n===!0,this.allPositive=t===!0,this.allNegative&&this.allPositive)throw"Cannot have both negativeItems and positiveItems be true!";if(n&&n!==!0){this.negativeMap||(this.negativeMap=new Map),this.negativeMap.clear();for(let r of n)this.negativeMap.set(r,!0);this.positiveMap&&this.positiveMap.clear()}if(t&&t!==!0){this.positiveMap||(this.positiveMap=new Map),this.positiveMap.clear();for(let r of t)this.positiveMap.set(r,!0);this.negativeMap&&this.negativeMap.clear()}}isDefaultNegativeSelection(){return this.allNegative}isDefaultPositiveSelection(){return this.allPositive}areAllNegative(){return this.allNegative&&(this.positiveMap?this.positiveMap.size===0:!0)}areAllPositive(){return this.allPositive&&(this.negativeMap?this.negativeMap.size===0:!0)}makeAllNegative(){this.update({negativeItems:!0,positiveItems:[]})}makeAllPositive(){this.update({positiveItems:!0,negativeItems:[]})}isItemPositive(e){if(this.allPositive===!0){if(this.allNegative===!0)throw'Cannot have both positiveItems and negativeItems be "true"';return!this.negativeMap?.has(e)}return!!this.positiveMap?.has(e)}isItemNegative(e){return!this.isItemPositive(e)}setItemValue(e,t){if(t!==this.isItemPositive(e)){if(t){if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be positive`;this.positiveMap.set(e,!0)}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be positive`;this.negativeMap.delete(e)}}else if(this.allPositive===!0){if(!this.negativeMap)throw`No negativeMap found when trying to set item ${e} be negative`;this.negativeMap.set(e,!0)}else if(this.allNegative===!0){if(!this.positiveMap)throw`No positiveMap found when trying to set item ${e} be negative`;this.positiveMap?.delete(e)}}}makeItemNegative(e){this.setItemValue(e,!1)}makeItemPositive(e){this.setItemValue(e,!0)}toggleItem(e){this.setItemValue(e,!this.isItemPositive(e))}};var gt=class extends Ko{constructor(t){super(t);this.isRowEnabled=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{enabledRows:t,disabledRows:n}}getPositiveFromState(t){return t.enabledRows}getNegativeFromState(t){return t.disabledRows}areAllDisabled(){return this.areAllNegative()}areAllEnabled(){return this.areAllPositive()}disableAll(){this.makeAllNegative()}enableAll(){this.makeAllPositive()}isRowDisabled(t){return!this.isRowEnabled(t)}setRowEnabled(t,n){return this.setItemValue(t,n)}disableRow(t){this.setRowEnabled(t,!1)}enableRow(t){this.setRowEnabled(t,!0)}toggleRow(t){this.toggleItem(t)}};var xs=1e3;function Ef(o){return new Ps(o)}var Ps=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=()=>pa(this.getState);this.getRowInfoByIndex=e=>On(e,this.getState)??null;this.getRowInfoByPrimaryKey=e=>{let t=this.getIndexByPrimaryKey(e);return this.getRowInfoByIndex(t)};this.getRowInfoByNodePath=e=>{let t=this.getIndexByNodePath(e);return this.getRowInfoByIndex(t)};this.getIndexByPrimaryKey=e=>this.getState().idToIndexMap.get(e)??-1;this.getIndexByNodePath=e=>this.getState().pathToIndexMap.get(e)??-1;this.getNodePathById=e=>this.getState().idToPathMap.get(e)??null;this.getNodePathByIndex=e=>{let t=this.getRowInfoByIndex(e);return t&&t.isTreeNode?t.nodePath:null};this.getPrimaryKeyByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.id:void 0};this.getOriginalDataArray=()=>this.getState().originalDataArray;this.getDataByIndex=e=>{let t=this.getRowInfoByIndex(e);return t?t.data:null};this.getDataByPrimaryKey=e=>{let{indexer:t}=this.getState();return t.getDataForPrimaryKey(e)??null};this.isNodePathAvailable=e=>this.getState().indexer.getDataForNodePath(e)!==void 0;this.getDataByNodePath=e=>{let{indexer:t}=this.getState(),n=t.getDataForNodePath(e);return n||null};this.replaceAllData=(e,t)=>(this.batchOperation({type:"replace-all",array:e,metadata:t?.metadata}),this.addDataArray(e,t));this.clearAllData=e=>this.replaceAllData([],e);this.updateData=(e,t)=>this.updateDataArray([e],t);this.updateDataArray=(e,t)=>{let n=this.getState().isTree,r=n?void 0:e.map(l=>this.toPrimaryKey(l)),i=n?e.map(l=>this.getNodePathById(this.toPrimaryKey(l))||[]):null,a=r?this.batchOperation({type:"update",array:e,primaryKeys:e.map(l=>this.toPrimaryKey(l)),metadata:t?.metadata}):this.batchOperation({type:"update",array:e,nodePaths:i||[],metadata:t?.metadata});return t?.flush&&this.commit(),a};this.withWaitForNode=(e,t,n)=>{let r=n?.waitForNode??!0;if(r===!0||typeof r=="number"){let a=r===!0?xs:r;return isNaN(a)||(a=xs),this.waitForNodePath(e,{timeout:a}).then(l=>{if(!l){let s=`Cannot find node path "${e.join("/")}" (we waited for it ${a}ms)`;return console.error(s),t({error:s,resolved:!1})}return t({resolved:!0})})}let i=t({resolved:void 0});return i instanceof Promise?i:Promise.resolve(i)};this.updateChildrenByNodePath=(e,t,n)=>this.withWaitForNode(t,({error:r})=>r?!1:this.updateChildrenByNodePath_Internal(e,t,n),n);this.updateChildrenByNodePath_Internal=(e,t,n)=>{let r=typeof e=="function"?e:()=>e;return this.updateDataArrayByNodePath_Internal([{nodePath:t,children:r}],n)};this.updateDataByNodePath=(e,t,n)=>this.isNodePathAvailable(t)?this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n):this.withWaitForNode(t,({error:r})=>r?!1:this.updateDataArrayByNodePath_Internal([{data:e,nodePath:t}],n),n);this.updateDataArrayByNodePath=(e,t)=>{if(t&&typeof t.waitForNode<"u"&&!t.waitForNode)return this.updateDataArrayByNodePath_Internal(e,t);let n=e.map(i=>i.nodePath);return Promise.allSettled(n.map(i=>this.withWaitForNode(i,({error:a})=>!a,t))).then(i=>i.every(Boolean)?this.updateDataArrayByNodePath_Internal(e,t):!1)};this.updateDataArrayByNodePath_Internal=(e,t)=>{let n=[],r=[];e.forEach(a=>{a.data?n.push(a.data):a.children&&n.push(a.children),r.push(a.nodePath)});let i=this.batchOperation({type:"update",array:n,nodePaths:r,metadata:t?.metadata});return t?.flush&&this.commit(),i};this.removeDataByPrimaryKey=(e,t)=>{if(this.getState().isTree)return this.removeDataByNodePath(this.getNodePathById(e)||[],t);let r=this.batchOperation({type:"delete",primaryKeys:[e],metadata:t?.metadata});return t?.flush&&this.commit(),r};this.removeDataByNodePath=(e,t)=>this.batchDeleteNodePaths([e],t);this.removeData=(e,t)=>{if(this.getState().isTree){let r=this.getNodePathById(this.toPrimaryKey(e));return this.removeDataByNodePath(r,t)}return this.batchDeletePrimaryKeys([this.toPrimaryKey(e)],t)};this.removeDataArrayByPrimaryKeys=(e,t)=>{if(this.getState().isTree){let r=e.map(i=>this.getNodePathById(i)||[]);return this.batchDeleteNodePaths(r,t)}return this.batchDeletePrimaryKeys(e,t)};this.batchDeleteNodePaths=(e,t)=>{let n=this.batchOperation({type:"delete",nodePaths:e||[],metadata:t?.metadata});return t?.flush&&this.commit(),n};this.batchDeletePrimaryKeys=(e,t)=>{let n=this.batchOperation({type:"delete",primaryKeys:e,metadata:t?.metadata});return t?.flush&&this.commit(),n};this.removeDataArray=(e,t)=>{if(this.getState().isTree){let i=e.map(a=>this.getNodePathById(this.toPrimaryKey(a))||[]);return this.batchDeleteNodePaths(i,t)}let r=e.map(this.toPrimaryKey);return this.batchDeletePrimaryKeys(r,t)};this.addData=(e,t)=>this.addDataArray([e],t);this.addDataArray=(e,t)=>this.insertDataArray(e,{...t,position:"end"});this.insertData=(e,t)=>this.insertDataArray([e],t);this.insertDataArray=(e,t)=>{let n=this.getState().isTree,r="before",i,a=t.nodePath;if(n&&a?.length)return this.withWaitForNode(a,({error:s})=>{if(s)return!1;if(t.position==="before"||t.position==="after")return this.batchTreeInsert(e,t.position,a,t);let c=u=>t.position==="start"?[...e,...u||[]]:[...u||[],...e];return this.updateChildrenByNodePath(c,a,t)},t);if(t.position==="before"||t.position==="after")r=t.position,i=t.primaryKey;else{let s=this.getOriginalDataArray();t.position==="start"?(r="before",s.length?i=this.toPrimaryKey(s[0]):i=void 0):(r="after",s.length?i=this.toPrimaryKey(s[s.length-1]):i=void 0)}let l=n?this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,nodePath:this.getNodePathById(i)||[]}):this.batchOperation({type:"insert",array:e,position:r,metadata:t?.metadata,primaryKey:i,nodePath:a});return t?.flush&&this.commit(),l};this.batchTreeInsert=(e,t,n,r)=>{if(n.length&&!this.isNodePathAvailable(n))return this.withWaitForNode(n,({error:a})=>{if(a)return!1;let l=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),l},r);let i=this.batchOperation({type:"insert",array:e,position:t,metadata:r?.metadata,nodePath:n});return r?.flush&&this.commit(),i};this.setSortInfo=e=>{let t=this.getState().multiSort;if(Array.isArray(e)){this.actions.sortInfo=e.length?t?e:e[0]:null;return}this.actions.sortInfo=e};this.setGroupBy=e=>{this.actions.groupBy=e};this.toggleGroupByField=e=>{let t=this.getState().groupBy;t.findIndex(r=>r.field===e)===-1?this.actions.groupBy=[...t,{field:e}]:this.actions.groupBy=t.filter(r=>r.field!==e)};this.isRowDisabledAt=e=>this.getRowInfoByIndex(e)?.rowDisabled??!1;this.isRowDisabled=e=>this.getRowInfoByPrimaryKey(e)?.rowDisabled??!1;this.setRowEnabledAt=(e,t)=>{let n=this.getState().rowDisabledState,r=n?new gt(n):new gt({enabledRows:!0,disabledRows:[]}),i=this.getRowInfoByIndex(e);i&&(r.setRowEnabled(i.id,t),this.actions.rowDisabledState=r)};this.setRowEnabled=(e,t)=>{let n=this.getRowInfoByPrimaryKey(e);n&&this.setRowEnabledAt(n.indexInAll,t)};this.enableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new gt({enabledRows:!0,disabledRows:[]});return}let t=new gt(e);t.enableAll(),this.actions.rowDisabledState=t};this.disableAllRows=()=>{let e=this.getState().rowDisabledState;if(!e){this.actions.rowDisabledState=new gt({disabledRows:!0,enabledRows:[]});return}let t=new gt(e);t.disableAll(),this.actions.rowDisabledState=t};this.areAllRowsEnabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllEnabled():!0};this.areAllRowsDisabled=()=>{let e=this.getState().rowDisabledState;return e?e.areAllDisabled():!1};this.getState=e.getState,this.getState().__apiRef.current=this,this.actions=e.actions,this.treeApi=new fa({...e,dataSourceApi:this})}getPendingOperationPromise(){return this.pendingPromise}batchOperation(e){if(!this.pendingPromise){this.pendingPromise=new Promise(n=>{this.resolvePendingPromise=n});let t=Math.max(0,this.getState().batchOperationDelay??0);t===0?this.batchOperationRafId=setTimeout(()=>{this.commit()}):this.batchOperationTimeoutId=setTimeout(()=>{this.batchOperationRafId=setTimeout(()=>{this.commit()})},t)}return e.type==="replace-all"&&(this.pendingOperations.length=0),this.pendingOperations.push(e),this.pendingPromise}commitOperations(e){if(!e.length)return;let t=this.getState().cache,{isTree:n,nodesKey:r}=this.getState(),i=t?io.clone(t,{light:!0}):new io({nodesKey:n?r:void 0});e.forEach(a=>{switch(a.type){case"update":a.array.forEach((u,d)=>{if(a.primaryKeys){let p=a.primaryKeys[d],f=this.getDataByPrimaryKey(p);f&&i.update(a.primaryKeys[d],u,f,a.metadata)}else if(a.nodePaths){let p=this.getDataByNodePath(a.nodePaths[d]);p&&(typeof u=="function"?i.updateChildren(a.nodePaths[d],u,p,a.metadata):i.updateNodePath(a.nodePaths[d],u,p,a.metadata))}});break;case"delete":a.primaryKeys?a.primaryKeys.forEach(u=>{let d=this.getDataByPrimaryKey(u);d&&i.delete(u,d,a.metadata)}):a.nodePaths&&a.nodePaths.forEach(u=>{let d=this.getDataByNodePath(u);d&&i.deleteNodePath(u,d,a.metadata)});break;case"insert":let l=a.primaryKey,s=a.position,c=a.nodePath;c?a.array.forEach(u=>{i.insertNodePath([...c],u,s,a.metadata),l=this.toPrimaryKey(u),c.pop(),c.push(l),s="after"}):a.array.forEach(u=>{i.insert(l,u,s,a.metadata),l=this.toPrimaryKey(u),s="after"});break;case"replace-all":i.resetDataSource(a.metadata);break}}),this.actions.cache=i}flush(){return this.commit()}waitForNodePath(e,t){let n=this.getState();if(this.isNodePathAvailable(e))return Promise.resolve(!0);let r=t?.timeout??xs,i=n.waitForNodePathPromises.get(e);if(i)return i.promise;let a=Date.now(),l=()=>{},s=new Promise(c=>{let u,d;l=p=>{clearTimeout(d),u=p,n.waitForNodePathPromises.delete(e),c(p)},d=setTimeout(()=>{u===void 0&&l(!1)},r)});return n.waitForNodePathPromises.set(e,{timestamp:a,promise:s,resolve:l}),s}commit(){this.commitOperations(this.pendingOperations),this.pendingOperations.length=0;let e=this.pendingPromise;if(e&&this.resolvePendingPromise){let t=this.resolvePendingPromise;requestAnimationFrame(()=>{t(!0)}),this.pendingPromise=null,this.resolvePendingPromise=null}return e||Promise.resolve(!0)}};function Af(o){let e=o.cache;if(!e)return{sortInfo:!1,groupBy:!1,tree:!1,filterValue:!1,aggregationReducers:!1};let t=!1,n=!1,r=!1,i=!1,a=!1,l=e.getAffectedFields(),{sortInfo:s,groupBy:c,filterValue:u,aggregationReducers:d,nodesKey:p,isTree:f}=o;if(s&&s.length)if(l===!0)t=!0;else for(let m of s){let g=m.field;if(g&&(g=Array.isArray(g)?g:[g],t=g.reduce((b,h)=>b||typeof h!="function"?l.has(h):!1,!1),t))break}if(c&&c.length){if(l===!0)n=!0;else for(let m of c)if(m.field&&l.has(m.field)){n=!0;break}}if(f&&(l===!0?r=!0:r=l.has(p)),u&&u.length)if(l===!0)i=!0;else for(let m of u){if(m.id){i=!0;break}if(m.field&&l.has(m.field)){i=!0;break}}if(d&&Object.keys(d).length){if(l===!0)a=!0;else for(let m in d)if(d.hasOwnProperty(m)){let g=d[m];if(g.field){if(l.has(g.field)){a=!0;break}}else{a=!0;break}}}return{sortInfo:t,groupBy:n,filterValue:i,aggregationReducers:a,tree:r}}function ga(o){if(!o)return;let e=Object.keys(o);if(!e.length)return;let t={};for(let n=0,r=e.length;n<r;n++){let i=e[n],a=o[i].initialValue;a!==void 0&&(t[i]=typeof a=="function"?a():a)}return t}function ha(o){let e=o.reducerKeys,t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].reducer;n[a]=l(n[a],o.rowInfo)}}function ba(o){let e=Object.keys(o.reducers||{});if(!e.length||!o.results)return o.results;let t=o.reducers,n=o.results;for(let r=0,i=e.length;r<i;r++){let a=e[r],l=t[a].done;typeof l=="function"&&(n[a]=l(n[a],o.array))}return n}var Ds=class o{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,n=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:n,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 o(e)}get startTimestamp(){return this.markerDetails.startTs}get track(){let e=this;return Object.keys(ya).reduce((t,n)=>{let r={start:e.start,end:i=>e.end({...i,track:ya[n].track,label:i.label}),get label(){let i=ya[n];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,n,{get:()=>{let i=ya[n];return e.markerDetails.track=i.track,r}}),t},{})}},ya={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"}},InfiniteTable:{track:"InfiniteTable",labels:{Render:"Rendering"}},MatrixBrain:{track:"Layout Computations",labels:{ComputeRenderRange:"Computing render range"}}};function ht(o){return Ds.create(o)}function Bo(o){if(o==null)return!1;let e=o;return!0}function Es(o,e){return o&&o.filter(t=>{let n=e[t.filter.type];return!(!n||n.emptyValues&&n.emptyValues.includes(t.filter.value))})}var Jt=(o,e,t)=>{for(let n=0,r=t.length;n<r;n++){let i=t[n],a=o[i],l=e[i];if(a!==l)return!0}return!1};function Ms(){return!1}function FT(o,e,t,n,r,i){let a={dataSourceHasGrouping:!1,isTreeNode:!1,data:o,id:e,indexInAll:t,isGroupRow:!1,selfLoaded:!0,rowSelected:!1,rowDisabled:!1,isCellSelected:Ms,hasSelectedCells:Ms};return n&&(a.rowSelected=n(a)),r&&(a.rowDisabled=r(a)),i&&(a.isCellSelected=l=>i.isCellSelected(a.id,l),a.hasSelectedCells=l=>i.isCellSelectionInRow(a.id,l)),a}var NT=at(()=>{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 Ef(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a}=o,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=Ef({...o,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],p=r(d),f=t({data:d,index:c,dataArray:e,primaryKey:n(d,c),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&_T(),l.push(f))}return l}function Ps(o){let{filterTypes:e,operatorsByFilterType:t,filterFunction:n,toPrimaryKey:r,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}=o,{dataArray:c}=o;n&&(c=c.filter((d,p,f)=>n({data:d,index:p,dataArray:f,primaryKey:r(d,p)}))),i&&(c=Ef({...o,treeFilterFunction:i,getNodeChildren:a,nodesKey:l,isLeafNode:s}));let u=xs(o.filterValue,e)||[];return u&&u.length?c.filter((d,p,f)=>{let m={data:d,index:p,dataArray:f,primaryKey:r(d,p),field:void 0};for(let g=0,h=u.length;g<h;g++){let b=u[g],{disabled:y,field:S,valueGetter:C,filter:{type:T,value:v,operator:w}}=b,I=e[T];if(y||!I)continue;let R=t[T]?.[w];if(!R)continue;let D=C||I.valueGetter||(({data:A,field:P})=>P?A[P]:A);m.field=S;let M=m;if(M.filterValue=v,M.currentValue=D(M),M.emptyValues=I.emptyValues,!R.fn(M))return!1}return!0}):c}function Mf(o){let{state:e,previousState:t}=o,n=Df(e),r=e.sortInfo,i=e.sortMode,a=r?.length?i==="local":!1;(e.lazyLoad||e.livePagination)&&(a=!1);let l=Zt(t,e,["refetchKey"]),s=Zt(t,e,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(e.data)&&l&&(s=!0),!1&&(e.originalLazyGroupData=new ee,s=!0);let u=e.cache?io.clone(e.cache):void 0;u&&!u.isEmpty()&&(s=!0);let d=e.toPrimaryKey,p=e.nodesKey,f=e.isTree,m=p?K=>K[p]:void 0,g=p?K=>K[p]===void 0:void 0,h,b;s&&(e.indexer.clear(),e.lazyLoad||(h=u?.getMutations(),b=u?.getTreeMutations(),e.originalDataArray=e.indexer.indexArray(e.originalDataArray,{toPrimaryKey:d,cache:u,getNodeChildren:m,isLeafNode:g,nodesKey:p}),f&&e.waitForNodePathPromises.visit(({value:K},ne)=>{K&&e.indexer.getDataForNodePath(ne)!==void 0&&K.resolve(!0)}))),u&&(u.clear(),e.cache=void 0);let{filterFunction:S,treeFilterFunction:C,filterValue:T,filterTypes:v,operatorsByFilterType:w}=e,I=!!S||!!C||Array.isArray(T)&&T.length,R=I&&e.filterMode==="local",x=Zt(t,e,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),D=s||x,M=Zt(t,e,["sortInfo"]),A=s||x||M,P=e.filterMode==="local"&&(D||!e.lastFilterDataArray),O=a&&(A||!e.lastSortDataArray||n.sortInfo),E=e.groupBy,_=e.pivotBy,N=!f&&(E.length>0||!!_),H=f,B=Zt(t,e,["rowDisabledState","isRowDisabled"]),U=Zt(t,e,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),de=Zt(t,e,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),pe=s||A||Zt(t,e,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),k=s||A||Zt(t,e,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),Y=Zt(t,e,["rowInfoReducers"]),ae=N&&(pe||!e.lastGroupDataArray||n.groupBy)||U||B||Y,se=H&&(k||n.tree||!e.lastTreeDataArray)||de||B||Y,le=Date.now(),re=e.originalDataArray;if(H&&se){let K={isLeafNode:g,getNodeChildren:m,toKey:d};e.unfilteredTreePaths=ys(K,re).treePaths}if(I||(e.unfilteredCount=re.length),R){e.unfilteredCount=re.length;let K=le;P?(e.devToolsDetected&&(K=Date.now()),re=Ps({getNodeChildren:m,isLeafNode:g,nodesKey:p,treeFilterFunction:C,dataArray:re,toPrimaryKey:d,filterTypes:v,operatorsByFilterType:w,filterFunction:S,filterValue:T}),e.devToolsDetected&&e.debugTimings.set("filter",Date.now()-K)):re=e.lastFilterDataArray,e.lastFilterDataArray=re,e.filteredAt=le}if(e.filteredCount=re.length,e.postFilterDataArray=re,a){let K=Xt.knownTypes;if(Xt.knownTypes={...K,...e.sortTypes},O){let ne=le;if(e.devToolsDetected&&(ne=Date.now()),e.sortFunction?re=e.sortFunction(r,[...re]):f?re=ia(r,re,{inplace:!1,isLeafNode:g,getNodeChildren:m,toKey:d,nodesKey:p}):re=Xt(r,[...re]),e.devToolsDetected){let q=Date.now()-ne;e.debugTimings.set("sort",q)}}else re=e.lastSortDataArray;Xt.knownTypes=K,e.lastSortDataArray=re,e.sortedAt=le}e.postSortDataArray=re;let Z=e.dataArray,be=e.rowSelection instanceof Re?e.rowSelection:void 0,oe=e.treeExpandState instanceof ot?e.treeExpandState:void 0,G=e.cellSelection instanceof ze?e.cellSelection:void 0;be?.xcache();let W=e.selectionMode==="single-row"?K=>K.id===e.rowSelection:e.selectionMode==="multi-row"?K=>{let ne=be;return K.isGroupRow?ne.getGroupRowSelectionState(K.groupKeys):ne.isRowSelected(K.id,K.dataSourceHasGrouping?K.groupKeys:void 0)}:void 0,F=e.isRowDisabled||Rs;e.isRowSelected&&e.selectionMode==="multi-row"&&(W=K=>e.isRowSelected(K,be,e.selectionMode));let ie;e.isNodeExpanded&&(ie=K=>e.isNodeExpanded(K,oe)),e.isNodeCollapsed&&(ie=K=>!e.isNodeExpanded(K,oe)),ie||(ie=ne=>oe.isNodeExpanded(ne.nodePath));let j=e.rowInfoReducers;if(N){if(ae){let K=le;e.devToolsDetected&&(K=Date.now());let ne=e.aggregationReducers,q=e.lazyLoad?lf({groupBy:E,pivot:_,mappings:e.pivotMappings,reducers:ne,indexer:e.indexer,toPrimaryKey:d,cache:u},e.originalLazyGroupData):ra({groupBy:E,pivot:_,reducers:ne},re);e.groupDeepMap=q.deepMap,be&&(be.getConfig=ct(e));let ue=Object.keys(j||{}),me=fa(j),He={reducers:j,results:me,reducerKeys:ue,rowInfo:{}},Me=me?Ye=>{He.rowInfo=Ye,ma(He)}:void 0,Ke=G?Ye=>{Ye.isCellSelected=xt=>G.isCellSelected(Ye.id,xt)}:void 0,Je=Me||Ke?Ss(Me,Ke):void 0,Ve=pf({groupResult:q,lazyLoad:!!e.lazyLoad,reducers:ne,toPrimaryKey:d,isRowSelected:W,rowSelectionState:be,withRowInfo:Je,repeatWrappedGroupRows:e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1,rowsPerPage:e.rowsPerPage,groupRowsState:e.groupRowsState,generateGroupRows:e.generateGroupRows});Z=Ve.data,e.rowInfoReducerResults=ga({reducers:j,results:me,array:Z}),e.groupRowsIndexesInDataArray=Ve.groupRowsIndexes,e.reducerResults=q.reducerResults;let et=_?Rf({deepMap:q.topLevelPivotColumns,pivotBy:_,pivotTotalColumnPosition:e.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:e.pivotGrandTotalColumnPosition??!1,reducers:e.aggregationReducers,showSeparatePivotColumnForSingleAggregation:e.showSeparatePivotColumnForSingleAggregation}):void 0;e.pivotColumns=et?.columns,e.pivotColumnGroups=et?.columnGroups,e.devToolsDetected&&e.debugTimings.set("group-and-pivot",Date.now()-K)}else Z=e.lastGroupDataArray;e.lastGroupDataArray=Z,e.groupedAt=le}else if(H){if(se){let K=le;e.devToolsDetected&&(K=Date.now());let ne=e.aggregationReducers,q={isLeafNode:g,getNodeChildren:m,toKey:d,reducers:ne},ue=ys(q,re);e.treeDeepMap=ue.deepMap,e.treePaths=ue.treePaths;let me=e.selectionMode==="multi-row"?Af(e.treeSelection,e.selectionMode,e):void 0;e.treeSelectionState=me;let He=Object.keys(j||{}),Me=fa(j),Ke={reducers:j,results:Me,reducerKeys:He,rowInfo:{}},Je=Me?gt=>{Ke.rowInfo=gt,ma(Ke)}:void 0,Ve=G?gt=>{gt.isCellSelected=V=>G.isCellSelected(gt.id,V)}:void 0,et=Je||Ve?Ss(Je,Ve):void 0,Ye=e.selectionMode==="single-row"?gt=>gt.id===e.treeSelection:e.selectionMode==="multi-row"?gt=>me.isNodeSelected(gt.nodePath):void 0,xt=e.rowsPerPage!=null?e.repeatWrappedGroupRows:!1;Z=df({treeResult:ue,treeParams:q,dataArray:re,reducers:ne,toPrimaryKey:d,isNodeSelected:Ye,isNodeExpanded:ie,treeSelectionState:me,withRowInfo:et,repeatWrappedGroupRows:xt,rowsPerPage:e.rowsPerPage}).data,e.rowInfoReducerResults=ga({reducers:j,results:Me,array:Z}),e.reducerResults=ue.reducerResults,e.totalLeafNodesCount=ue.deepMap.get([])?.totalLeafNodesCount??0,e.treeAt=le,e.devToolsDetected&&e.debugTimings.set("tree",Date.now()-K)}else Z=e.lastTreeDataArray;e.lastTreeDataArray=Z}else if(e.groupDeepMap=void 0,e.pivotColumns=void 0,e.groupRowsIndexesInDataArray=void 0,t.postSortDataArray!=e.postSortDataArray||pe||U||B||Y){let ne=Object.keys(j||{}),q=fa(j),ue={reducers:j,results:q,reducerKeys:ne,rowInfo:{}};Z=re.map((me,He)=>{let Me=AT(me,me?d(me):He,He,W,F,G);return q&&(ue.rowInfo=Me,ma(ue)),Me}),e.rowInfoReducerResults=ga({reducers:j,results:q,array:Z})}if(e.postGroupDataArray=Z,Z!==e.dataArray&&(e.updatedAt=le),e.dataArray=Z,e.reducedAt=le,e.selectionMode==="multi-row")if(N&&e.lazyLoad){let K=!0,ne=!1;e.dataArray.forEach(q=>{if(!q.isTreeNode&&q.isGroupRow&&q.groupKeys.length===1){let{rowSelected:ue}=q;ue!==!0&&(K=!1),(ue===!0||ue===null)&&(ne=!0)}}),e.allRowsSelected=K,e.someRowsSelected=ne}else{let K=e.isTree?e.totalLeafNodesCount:e.filteredCount,ne=e.isTree?e.treeSelectionState?e.treeSelectionState.getSelectedCount():0:e.rowSelection.getSelectedCount();e.allRowsSelected=K===ne,e.someRowsSelected=ne>0}return e.originalDataArrayChanged=s,s&&(e.originalDataArrayChangedInfo={timestamp:le,mutations:h?.size?h:void 0,treeMutations:b?.size?b:void 0}),e}function kt(){let o=we().performance?.now();return`${Date.now()}:${o}`}function OT(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
13
+ `)});function _f(o){let{dataArray:e,treeFilterFunction:t,toPrimaryKey:n,getNodeChildren:r,isLeafNode:i,nodesKey:a}=o,l=[],s=c=>{let u=r(c);if(i(c)||!Array.isArray(u))return c;let d=_f({...o,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],p=r(d),f=t({data:d,index:c,dataArray:e,primaryKey:n(d,c),filterTreeNode:s});f&&(f===!0?f=d:typeof f=="object"&&f===d&&p!==r(f)&&NT(),l.push(f))}return l}function As(o){let{filterTypes:e,marker:t,operatorsByFilterType:n,filterFunction:r,toPrimaryKey:i,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}=o,{dataArray:u}=o;t?.start({details:[{name:"Count before",value:u.length}]}),r&&(u=u.filter((p,f,m)=>r({data:p,index:f,dataArray:m,primaryKey:i(p,f)}))),a&&(u=_f({...o,treeFilterFunction:a,getNodeChildren:l,nodesKey:s,isLeafNode:c}));let d=Es(o.filterValue,e)||[];if(d&&d.length){let p=u.filter((f,m,g)=>{let b={data:f,index:m,dataArray:g,primaryKey:i(f,m),field:void 0};for(let h=0,y=d.length;h<y;h++){let S=d[h],{disabled:C,field:T,valueGetter:v,filter:{type:w,value:I,operator:R}}=S,x=e[w];if(C||!x)continue;let E=n[w]?.[R];if(!E)continue;let M=v||x.valueGetter||(({data:_,field:D})=>D?_[D]:_);b.field=T;let P=b;if(P.filterValue=I,P.currentValue=M(P),P.emptyValues=x.emptyValues,!E.fn(P))return!1}return!0});return t?.end({details:[{name:"Count after",value:p.length}]}),p}return t?.end({details:[{name:"Count after",value:u.length}]}),u}function Of(o){let e,{state:t,previousState:n}=o,r=t.debugId,i;r&&(i=ht(r).track.DataSource.label.PrepareData.start());let a=Af(t),l=t.sortInfo,s=t.sortMode,c=l?.length?s==="local":!1;(t.lazyLoad||t.livePagination)&&(c=!1);let u=Jt(n,t,["refetchKey"]),d=Jt(n,t,["cache","originalDataArray","originalLazyGroupDataChangeDetect"]);Array.isArray(t.data)&&u&&(d=!0),!1&&(t.originalLazyGroupData=new Q,d=!0);let f=t.cache?io.clone(t.cache):void 0;f&&!f.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,C;d&&(t.indexer.clear(),t.lazyLoad||(S=f?.getMutations(),C=f?.getTreeMutations(),t.originalDataArray=t.indexer.indexArray(t.originalDataArray,{toPrimaryKey:m,cache:f,getNodeChildren:h,isLeafNode:y,nodesKey:g}),b&&t.waitForNodePathPromises.visit(({value:j},re)=>{j&&t.indexer.getDataForNodePath(re)!==void 0&&j.resolve(!0)}))),f&&(f.clear(),t.cache=void 0);let{filterFunction:v,treeFilterFunction:w,filterValue:I,filterTypes:R,operatorsByFilterType:x}=t,E=!!v||!!w||Array.isArray(I)&&I.length,A=E&&t.filterMode==="local",M=Jt(n,t,["filterFunction","treeFilterFunction","filterValue","filterTypes"]),P=d||M,_=Jt(n,t,["sortInfo"]),D=d||M||_,F=t.filterMode==="local"&&(P||!t.lastFilterDataArray),N=c&&(D||!t.lastSortDataArray||a.sortInfo),W=t.groupBy,L=t.pivotBy,X=!b&&(W.length>0||!!L),le=b,ae=Jt(n,t,["rowDisabledState","isRowDisabled"]),H=Jt(n,t,["rowSelection","cellSelection","isRowSelected","originalLazyGroupDataChangeDetect"]),U=Jt(n,t,["treeSelection","cellSelection","isNodeSelected","originalLazyGroupDataChangeDetect"]),ie=d||D||Jt(n,t,["generateGroupRows","originalLazyGroupData","originalLazyGroupDataChangeDetect","groupBy","groupRowsState","pivotBy","aggregationReducers","pivotTotalColumnPosition","pivotGrandTotalColumnPosition","showSeparatePivotColumnForSingleAggregation","repeatWrappedGroupRows","rowsPerPage"]),se=d||D||Jt(n,t,["originalLazyGroupData","originalLazyGroupDataChangeDetect","treeExpandState","isNodeExpanded","isNodeCollapsed","aggregationReducers","repeatWrappedGroupRows","rowsPerPage"]),pe=Jt(n,t,["rowInfoReducers"]),fe=X&&(ie||!t.lastGroupDataArray||a.groupBy)||H||ae||pe,ne=le&&(se||a.tree||!t.lastTreeDataArray)||U||ae||pe,ge=Date.now(),K=t.originalDataArray;if(le&&ne){let j={marker:r?ht(r).track.DataSource.label.TreeUnfilteredTreePaths.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m};t.unfilteredTreePaths=Cs(j,K).treePaths}if(E||(t.unfilteredCount=K.length),A){t.unfilteredCount=K.length;let j=ge;F?(t.devToolsDetected&&(j=Date.now()),K=As({marker:r?ht(r).track.DataSource.label.Filter.start():void 0,getNodeChildren:h,isLeafNode:y,nodesKey:g,treeFilterFunction:w,dataArray:K,toPrimaryKey:m,filterTypes:R,operatorsByFilterType:x,filterFunction:v,filterValue:I}),t.devToolsDetected&&t.debugTimings.set("filter",Date.now()-j)):K=t.lastFilterDataArray,t.lastFilterDataArray=K,t.filteredAt=ge}if(t.filteredCount=K.length,t.postFilterDataArray=K,c){let j=Qt.knownTypes;if(Qt.knownTypes={...j,...t.sortTypes},N){let re=ge;if(t.devToolsDetected&&(re=Date.now()),r&&(e=ht(r).track.DataSource.label.Sort.start({details:[{name:"Count",value:K.length}]})),t.sortFunction?(K=t.sortFunction(l,[...K]),e&&(e.end(),e=void 0)):b?K=la(l,K,{marker:e,inplace:!1,isLeafNode:y,getNodeChildren:h,toKey:m,nodesKey:g}):K=Qt(l,[...K],{marker:e}),r&&(e?.end(),e=void 0),t.devToolsDetected){let Re=Date.now()-re;t.debugTimings.set("sort",Re)}}else K=t.lastSortDataArray;Qt.knownTypes=j,t.lastSortDataArray=K,t.sortedAt=ge}t.postSortDataArray=K;let k=t.dataArray,B=t.rowSelection instanceof Pe?t.rowSelection:void 0,O=t.treeExpandState instanceof ot?t.treeExpandState:void 0,oe=t.cellSelection instanceof He?t.cellSelection:void 0;B?.xcache();let te=t.selectionMode==="single-row"?j=>j.id===t.rowSelection:t.selectionMode==="multi-row"?j=>{let re=B;return j.isGroupRow?re.getGroupRowSelectionState(j.groupKeys):re.isRowSelected(j.id,j.dataSourceHasGrouping?j.groupKeys:void 0)}:void 0,he=t.isRowDisabled||Ms;t.isRowSelected&&t.selectionMode==="multi-row"&&(te=j=>t.isRowSelected(j,B,t.selectionMode));let de;t.isNodeExpanded&&(de=j=>t.isNodeExpanded(j,O)),t.isNodeCollapsed&&(de=j=>!t.isNodeExpanded(j,O)),de||(de=re=>O.isNodeExpanded(re.nodePath));let ee=t.rowInfoReducers;if(X){if(fe){let j=ge;t.devToolsDetected&&(j=Date.now());let re=t.aggregationReducers,Re=t.lazyLoad?uf({groupBy:W,pivot:L,mappings:t.pivotMappings,reducers:re,indexer:t.indexer,toPrimaryKey:m,cache:f,marker:r?ht(r).track.DataSource.label.LazyGroup.start():void 0},t.originalLazyGroupData):aa({groupBy:W,pivot:L,reducers:re,marker:r?ht(r).track.DataSource.label.Group.start():void 0},K);t.groupDeepMap=Re.deepMap,B&&(B.getConfig=ct(t));let xe=Object.keys(ee||{}),_e=ga(ee),Be={reducers:ee,results:_e,reducerKeys:xe,rowInfo:{}},Oe=_e?Nt=>{Be.rowInfo=Nt,ha(Be)}:void 0,Ze=oe?Nt=>{Nt.isCellSelected=V=>oe.isCellSelected(Nt.id,V)}:void 0,et=Oe||Ze?vs(Oe,Ze):void 0,ut=gf({marker:r?ht(r).track.DataSource.label.FlattenTree.start():void 0,groupResult:Re,lazyLoad:!!t.lazyLoad,reducers:re,toPrimaryKey:m,isRowSelected:te,rowSelectionState:B,withRowInfo:et,repeatWrappedGroupRows:t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1,rowsPerPage:t.rowsPerPage,groupRowsState:t.groupRowsState,generateGroupRows:t.generateGroupRows});k=ut.data,t.rowInfoReducerResults=ba({reducers:ee,results:_e,array:k}),t.groupRowsIndexesInDataArray=ut.groupRowsIndexes,t.reducerResults=Re.reducerResults;let Ft=L?Df({deepMap:Re.topLevelPivotColumns,pivotBy:L,pivotTotalColumnPosition:t.pivotTotalColumnPosition??"end",pivotGrandTotalColumnPosition:t.pivotGrandTotalColumnPosition??!1,reducers:t.aggregationReducers,showSeparatePivotColumnForSingleAggregation:t.showSeparatePivotColumnForSingleAggregation}):void 0;t.pivotColumns=Ft?.columns,t.pivotColumnGroups=Ft?.columnGroups,t.devToolsDetected&&t.debugTimings.set("group-and-pivot",Date.now()-j)}else k=t.lastGroupDataArray;t.lastGroupDataArray=k,t.groupedAt=ge}else if(le){if(ne){let j=ge;t.devToolsDetected&&(j=Date.now());let re=t.aggregationReducers,Re={marker:r?ht(r).track.DataSource.label.Tree.start():void 0,isLeafNode:y,getNodeChildren:h,toKey:m,reducers:re},xe=Cs(Re,K);t.treeDeepMap=xe.deepMap,t.treePaths=xe.treePaths;let _e=t.selectionMode==="multi-row"?Ff(t.treeSelection,t.selectionMode,t):void 0;t.treeSelectionState=_e;let Be=Object.keys(ee||{}),Oe=ga(ee),Ze={reducers:ee,results:Oe,reducerKeys:Be,rowInfo:{}},et=Oe?ce=>{Ze.rowInfo=ce,ha(Ze)}:void 0,ut=oe?ce=>{ce.isCellSelected=Te=>oe.isCellSelected(ce.id,Te)}:void 0,Ft=et||ut?vs(et,ut):void 0,Nt=t.selectionMode==="single-row"?ce=>ce.id===t.treeSelection:t.selectionMode==="multi-row"?ce=>_e.isNodeSelected(ce.nodePath):void 0,V=t.rowsPerPage!=null?t.repeatWrappedGroupRows:!1;k=mf({marker:r?ht(r).track.DataSource.label.FlattenTree.start():void 0,treeResult:xe,treeParams:Re,dataArray:K,reducers:re,toPrimaryKey:m,isNodeSelected:Nt,isNodeExpanded:de,treeSelectionState:_e,withRowInfo:Ft,repeatWrappedGroupRows:V,rowsPerPage:t.rowsPerPage}).data,t.rowInfoReducerResults=ba({reducers:ee,results:Oe,array:k}),t.reducerResults=xe.reducerResults,t.totalLeafNodesCount=xe.deepMap.get([])?.totalLeafNodesCount??0,t.treeAt=ge,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,n.postSortDataArray!=t.postSortDataArray||ie||H||ae||pe){let re=Object.keys(ee||{}),Re=ga(ee),xe={reducers:ee,results:Re,reducerKeys:re,rowInfo:{}};k=K.map((_e,Be)=>{let Oe=FT(_e,_e?m(_e):Be,Be,te,he,oe);return Re&&(xe.rowInfo=Oe,ha(xe)),Oe}),t.rowInfoReducerResults=ba({reducers:ee,results:Re,array:k})}if(t.postGroupDataArray=k,k!==t.dataArray&&(t.updatedAt=ge),t.dataArray=k,t.reducedAt=ge,t.selectionMode==="multi-row")if(X&&t.lazyLoad){r&&(e=ht(r).track.DataSource.label.ComputeSelectionCountLazy.start());let j=!0,re=!1;t.dataArray.forEach(Re=>{if(!Re.isTreeNode&&Re.isGroupRow&&Re.groupKeys.length===1){let{rowSelected:xe}=Re;xe!==!0&&(j=!1),(xe===!0||xe===null)&&(re=!0)}}),t.allRowsSelected=j,t.someRowsSelected=re,r&&(e?.end(),e=void 0)}else{r&&(e=ht(r).track.DataSource.label.ComputeSelectionCount.start());let j=t.isTree?t.totalLeafNodesCount:t.filteredCount,re=t.isTree?t.treeSelectionState?t.treeSelectionState.getSelectedCount():0:t.rowSelection.getSelectedCount();t.allRowsSelected=j===re,t.someRowsSelected=re>0,r&&(e?.end(),e=void 0)}return t.originalDataArrayChanged=d,d&&(t.originalDataArrayChangedInfo={timestamp:ge,mutations:S?.size?S:void 0,treeMutations:C?.size?C:void 0}),i&&i?.track.DataSource.label.PrepareData.end({details:[F||N||fe||ne?{name:"Performed operations",value:[F?"filter":null,N?"sort":null,fe?"group":null,ne?"tree":null].filter(Bo).join(", ")}:null,u?{name:"Refetch key",value:`Old ${n.refetchKey} -> New ${t.refetchKey}`}:null,d?{name:"Original data array changed",value:""}:null,{name:"Unfiltered data length",value:t.originalDataArray.length}].filter(Bo)}),t}function Vt(){let o=we().performance?.now();return`${Date.now()}:${o}`}function LT(o,e,t){return e=e.replaceAll("$ERR_CODE",o),e=`${e}
14
14
 
15
15
  ERROR_CODE = ${o}
16
16
 
17
- See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function _f(o){return Object.entries(o).reduce((e,[t,n])=>{let r=t,i=OT(r,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return e[r]=i,e},{})}function FT(o){return{message:o.join(""),type:"warning"}}function NT(o){return{message:o.join(""),type:"error"}}var LT=_f({DS001:FT`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.`}),kT=_f({CSS001_CSS:NT`It appears you have not loaded the CSS file for InfiniteTable.
17
+ See http://infinite-table.com/docs/reference/error-codes#${o} for more info.`,{code:o,message:e,type:t??"error"}}function Nf(o){return Object.entries(o).reduce((e,[t,n])=>{let r=t,i=LT(r,typeof n=="string"?n:n.message,typeof n=="string"?void 0:n.type);return e[r]=i,e},{})}function kT(o){return{message:o.join(""),type:"warning"}}function zT(o){return{message:o.join(""),type:"error"}}var VT=Nf({DS001:kT`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.`}),GT=Nf({CSS001_CSS:zT`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
- `}),Of={...LT,...kT};var sn=new Map,cn=new Map,_n=new Map,un=new Map;var Ot=new Map,Ff=o=>{Ot.delete(o),_n.delete(o),sn.delete(o),un.delete(o),cn.delete(o)};function Ds(o,e,t){let n=Ot.get(o);if(!n)return;let r=_n.get(o);(!r||!Object.hasOwn(r,e))&&_n.set(o,{...r||{},[e]:n.getState()[e]}),sn.set(o,{...sn.get(o)||{},[e]:t}),n.actions[e]=t}function ha(o,e,t){let n=Ot.get(o);if(!n)return;let r=un.get(o);(!r||!Object.hasOwn(r,e))&&un.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),cn.set(o,{...cn.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var zT=o=>{let e=o.type==="error"?fn(o.debugId):bt(o.debugId),t=o.type==="error"?wf:Vo,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
22
+ `}),Lf={...VT,...GT};var un=new Map,dn=new Map,Fn=new Map,pn=new Map;var Ot=new Map,kf=o=>{Ot.delete(o),Fn.delete(o),un.delete(o),pn.delete(o),dn.delete(o)};function _s(o,e,t){let n=Ot.get(o);if(!n)return;let r=Fn.get(o);(!r||!Object.hasOwn(r,e))&&Fn.set(o,{...r||{},[e]:n.getState()[e]}),un.set(o,{...un.get(o)||{},[e]:t}),n.actions[e]=t}function Ta(o,e,t){let n=Ot.get(o);if(!n)return;let r=pn.get(o);(!r||!Object.hasOwn(r,e))&&pn.set(o,{...r||{},[e]:n.getDataSourceState()[e]}),dn.set(o,{...dn.get(o)||{},[e]:t}),n.dataSourceActions[e]=t}var HT=o=>{let e=o.type==="error"?gn(o.debugId):yt(o.debugId),t=o.type==="error"?Rf:Go,n=o.debugId?`${o.code}-${o.debugId}`:o.code,r=o.message;o.debugId&&(r=`${r}
23
23
 
24
- Component DEBUG_ID = "${o.debugId}"`),t(r,n,e)},Gr=o=>{let{debugId:e,key:t}=o,n=Of[t];if(n&&(zT({...n,debugId:e}),e&&t)){let r=Ot.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Hr(e))}};globalThis.logDevToolsWarning=Gr;var Hr=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Ot.get(o);t&&e(o,t)};var Nf=!0,VT=()=>new Promise(o=>{Oe(o)}),GT={originalDataArray:!0,changes:!0},HT={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function dn(o,e,t){let n=o.multiSort?o.sortInfo:o.sortInfo?.[0]??null,r={append:!1,originalDataArray:o.originalDataArray,sortInfo:n,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(r.livePaginationCursor=o.livePaginationCursor,r.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=o.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=kf(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=o.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!GT[l]){let s=l,c=HT[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function ao(o,e,t,n,r){let i=dn(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[Mn,...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,p=d.length,f=!0;for(let m=0;m<p;m++)if(d[m]==null){f=!1;break}if(f)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:Nf,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=kt()}typeof o=="function"&&(o=o(i));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(o).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let p=s;if(c=p.data,p.livePaginationCursor!==void 0&&(t.livePaginationCursor=p.livePaginationCursor),p.mappings&&(t.pivotMappings=p.mappings),p.totalCountUnfiltered&&(t.unfilteredCount=p.totalCountUnfiltered),e.lazyLoad){let m=function(g,h,b){let y=[Mn,...g],S=h.data,C={cache:h.cache??Nf,childrenLoading:!1,childrenAvailable:!0,totalCount:h.totalCount??S.length,totalCountUnfiltered:h.totalCount??S.length,children:S,error:h.error},T=[];if(i.lazyLoadBatchSize&&!b){let w=f.get(y),I=!w,R=Mu({children:!0},w||{},C);I&&(R.chidren=[]),R.children.length=R.totalCount;let x=i.lazyLoadStartIndex??0,D=Math.min(h.totalCount??S.length,x+i.lazyLoadBatchSize);for(let M=x;M<D;M++){let A=C.children[M-x];if(!A)throw`lazily loaded item not found at index ${M-x}`;R.children[M]=A,A.dataset&&T.push({keys:A.keys,dataset:A.dataset})}I&&f.set(y,R)}else C.children.forEach(w=>{w&&w.dataset&&T.push({keys:w.keys,dataset:w.dataset})}),C.children.length=C.totalCount,f.set(y,C);let v=!1;if(!g||!g.length){let w=f.get([Mn]);t.originalDataArray=[...w.children],v=!0}if(v||(t.originalLazyGroupDataChangeDetect=kt()),T.length){let w=g;T.forEach(({keys:I,dataset:R})=>{m(I,R,w)})}};var d=m;let f=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],p)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function kf(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(xs(o,e)||[]).map(n=>{let r={...n};return delete r.valueGetter,r})}function Lf(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function zf(o){let{getComponentState:e,componentActions:t,componentState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:h,cursorId:b}=n,[y,S]=(0,Qe.useState)({vertical:!1,horizontal:!1}),C=(0,Qe.useRef)(y);(0,Qe.useEffect)(()=>(a.onChange(x=>{x&&(C.current=x,S(x))}),()=>a.destroy()),[a]),(0,Qe.useEffect)(()=>{if(!m)return;let x=requestAnimationFrame(()=>{C.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(x)},[g]),(0,Qe.useEffect)(()=>{if(!m||g!==void 0)return;let x=requestAnimationFrame(()=>{C.current?.vertical||b!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(x)},[i.length,g]),(0,Qe.useEffect)(()=>{let x=e(),{livePaginationCursor:D,livePagination:M,dataArray:A}=x;!y.vertical&&M&&(D?t.cursorId=D:D===void 0&&A.length&&(t.cursorId=A.length))},[y.vertical]);let T=(0,Qe.useMemo)(()=>kf(p,{filterTypes:h,filterMode:f}),[p,f,h]),v={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?T:null,cursorId:m?b:null},w=(0,Qe.useRef)(!0);KT(o,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?b:null});let I=Pe(Le()),R=(0,Qe.useRef)([]);ro(()=>{let x=e(),D=I(),{isDetail:M,isDetailReady:A}=Lf(D,e);if(M&&!A)return;let P=Date.now(),O=R.current;O.length>=10&&O.splice(0,1),O.push(P),P-O[0]<200&&O.length>=10&&Gr({debugId:x.debugId,key:"DS001"}),typeof x.data!="function"&&ao(x.data,x,t,void 0,D)},{data:r}),ro(x=>{let D=Object.keys(x),M=!1;if(D.length===1){if(M=!!x.cursorId,x.filterValue&&e().filterMode==="local")return;let _=e().data;if(Array.isArray(_)&&x.refetchKey){t.originalDataArray=_;return}}let A=I(),{isDetail:P,isDetailReady:O}=Lf(A,e);if(P&&!O)return;let E=e();typeof E.data=="function"&&ao(E.data,E,t,{append:M},A)},{...v,data:r}),ro(()=>{let x=e();if(w.current){w.current=!1;let D=dn(x,void 0,I());t.dataParams=D}},v)}function KT(o,e){let{getComponentState:t,componentActions:n,componentState:r}=o;(0,Qe.useEffect)(()=>{n.lazyLoadCacheOfLoadedBatches=new ee},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,p=(0,Qe.useRef)(null),f=(g,h,b=t().lazyLoadCacheOfLoadedBatches)=>{let y=t();if(g=g||p.current,!g)return;let{renderStartIndex:S,renderEndIndex:C}=g,{lazyLoadBatchSize:T,lazyLoad:v}=y;v&&((!T||T<=0)&&(!y.groupBy||y.groupBy.length===0)||BT({startIndex:S,endIndex:C,lazyLoadBatchSize:T,componentState:y,componentActions:n,dismissLoadedRows:h?.dismissLoadedRows??!1},b))},m=(0,Qe.useMemo)(()=>Dt(f,{wait:d}),[d]);ro(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),f(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&f(s.get()),s.onChange(h=>{p.current=h,f(h)})},{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,Qe.useEffect)(()=>{i&&i>0&&m()},[c])}function BT(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new ee,p=["_______xxx______"];for(let g=t;g<=n;g++){let h=s[g];if(!h)continue;let b=c(g),y=h.dataSourceHasGrouping&&h.groupKeys?[...h.groupKeys]:[];h.isGroupRow&&h.dataSourceHasGrouping&&h.groupKeys&&y.pop();let S=y.length?y:p,C=h.dataSourceHasGrouping?h.indexInGroup:h.indexInAll;if(h.isGroupRow&&!h.collapsed&&!h.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:h.groupKeys,append:u},v=h.groupKeys,w=d.get(v);if(!w?.[h.id]){let I=!w;w=w||{},w[h.id]||(w[h.id]=T),I&&d.set(v,w)}}if(!b&&r!=null){let T=d.get(S),v=Math.floor(C/r)*r,w=C-v,I=s[h.indexInAll-w].indexInAll,R=c(I),x=s[I].id;if(R||T?.[x])continue;let D=!T;T=T||{};let M={lazyLoadStartIndex:v,lazyLoadBatchSize:r,groupKeys:y,append:u};T[x]||(T[x]=M),D&&d.set(S,T)}}let f=Promise.resolve(!0),m=[];d.topDownValues().forEach(g=>{m.push(...Object.values(g))}),m.reduce((g,h)=>{let b=[...h.groupKeys,h.lazyLoadStartIndex];if(e&&e.has(b))return g;e?.set(b,!0);let y=[i.data,i,a,h];return g.then(()=>VT()).then(()=>ao(...y))},f)}var WT=Object.freeze([]),Vf=(o,e)=>{let t=o??WT,n=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===n.length)return r}return e&&t&&e.set(t,n),n};var jT=Symbol("cursorId"),Gf=o=>o.totalLeafNodesCount===0,$T=o=>o.isParentNode?!Gf(o):!0;function Hf(o){let e=Date.now(),t=[],n=[],r=new ee;return{logger:bt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,indexer:new ca,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 ee,waitForNodePathPromises:new ee,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new ee,dataParams:void 0,onCleanup:ge(),notifyScrollbarsChange:ge(),notifyScrollStop:ge(),notifyRenderRangeChange:ge(),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:n,unfilteredCount:n.length,filteredCount:n.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(o){let e={...o};return delete e.originalDataArray,e}var YT=[],Kf=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear()},Bf=(o,e)=>({onDataParamsChange:t=>t?If(t,100,UT):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Gf,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=>({...Tn,...t}),sortTypes:t=>({...Vr,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,n)=>{let r={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(n.idToPathMap.set(s.id,s.nodePath),e.debugId&&n.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),n.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 mt)return t;let n=o.propsCache.get("rowDisabledState")??zt,r=n.get(t);return r||(r=new mt(t),n.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=>Vf(t,o.propsCache.get("sortInfo")),groupBy:t=>t??YT});function qT(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}var zt=new WeakMap;function XT(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let e={};return o.filterValue!=null&&(e.filterValue=o.filterValue),o.sortInfo!=null&&(e.sortInfo=o.sortInfo),o.groupBy!=null&&(e.groupBy=o.groupBy),o.pivotBy!=null&&(e.pivotBy=o.pivotBy),e}var ZT={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Af(o,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 = "${o.debugId}"`),t(r,n,e)},Kr=o=>{let{debugId:e,key:t}=o,n=Lf[t];if(n&&(HT({...n,debugId:e}),e&&t)){let r=Ot.get(e);r&&r.getState().devToolsDetected&&n&&(r.getState().debugWarnings.set(t,{...n,debugId:e,status:"new"}),Br(e))}};globalThis.logDevToolsWarning=Kr;var Br=o=>{let e=window.__INFINITE_TABLE_DEVTOOLS_HOOK__;if(!e)return;let t=Ot.get(o);t&&e(o,t)};var zf=!0,KT=()=>new Promise(o=>{Le(o)}),BT={originalDataArray:!0,changes:!0},WT={filterValue:(o,e)=>JSON.stringify(o)===JSON.stringify(e),groupRowsState:(o,e)=>JSON.stringify(o)===JSON.stringify(e)};function fn(o,e,t){let n=o.multiSort?o.sortInfo:o.sortInfo?.[0]??null,r={append:!1,originalDataArray:o.originalDataArray,sortInfo:n,refetchKey:o.refetchKey,groupBy:o.groupBy,pivotBy:o.pivotBy,filterValue:o.filterValue,aggregationReducers:o.aggregationReducers};if(t&&(r.masterRowInfo=t.masterRowInfo),r.groupBy&&(r.groupRowsState=o.groupRowsState.getState()),o.livePagination!==void 0&&(r.livePaginationCursor=o.livePaginationCursor,r.__cursorId=o.cursorId),o.lazyLoad&&(o.lazyLoadBatchSize!=null&&o.lazyLoadBatchSize>0&&(r.lazyLoadBatchSize=o.lazyLoadBatchSize,r.lazyLoadStartIndex=0),r.groupKeys=[]),e&&Object.assign(r,e),r.filterValue&&r.filterValue.length){let l=Gf(r.filterValue,{filterMode:o.filterMode,filterTypes:o.filterTypes});l&&l.length&&(r.filterValue=l)}let i={},a=o.dataParams||{};for(let l in r)if(r.hasOwnProperty(l)&&!BT[l]){let s=l,c=WT[s],u=r[s],d=a[s];(c?c(u,d):u===d)||(i[s]=!0)}return r.changes=i,r}function ao(o,e,t,n,r){let i=fn(e,n,r),a=i.append;if(e.lazyLoad){let s=e.originalLazyGroupData,c=[_n,...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,p=d.length,f=!0;for(let m=0;m<p;m++)if(d[m]==null){f=!1;break}if(f)return Promise.resolve(!0)}u?u.childrenLoading||(u.childrenLoading=!0):s.set(c,{error:void 0,children:[],childrenLoading:!0,childrenAvailable:!1,cache:zf,totalCount:0,totalCountUnfiltered:0}),t.originalLazyGroupDataChangeDetect=Vt()}typeof o=="function"&&(o=o(i));let l=typeof o=="object"&&typeof o.then=="function";return l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!0),Promise.resolve(o).then(s=>{let c=[],u=!1;if(Array.isArray(s.data)){let p=s;if(c=p.data,p.livePaginationCursor!==void 0&&(t.livePaginationCursor=p.livePaginationCursor),p.mappings&&(t.pivotMappings=p.mappings),p.totalCountUnfiltered&&(t.unfilteredCount=p.totalCountUnfiltered),e.lazyLoad){let m=function(g,b,h){let y=[_n,...g],S=b.data,C={cache:b.cache??zf,childrenLoading:!1,childrenAvailable:!0,totalCount:b.totalCount??S.length,totalCountUnfiltered:b.totalCount??S.length,children:S,error:b.error},T=[];if(i.lazyLoadBatchSize&&!h){let w=f.get(y),I=!w,R=Ou({children:!0},w||{},C);I&&(R.chidren=[]),R.children.length=R.totalCount;let x=i.lazyLoadStartIndex??0,E=Math.min(b.totalCount??S.length,x+i.lazyLoadBatchSize);for(let A=x;A<E;A++){let M=C.children[A-x];if(!M)throw`lazily loaded item not found at index ${A-x}`;R.children[A]=M,M.dataset&&T.push({keys:M.keys,dataset:M.dataset})}I&&f.set(y,R)}else C.children.forEach(w=>{w&&w.dataset&&T.push({keys:w.keys,dataset:w.dataset})}),C.children.length=C.totalCount,f.set(y,C);let v=!1;if(!g||!g.length){let w=f.get([_n]);t.originalDataArray=[...w.children],v=!0}if(v||(t.originalLazyGroupDataChangeDetect=Vt()),T.length){let w=g;T.forEach(({keys:I,dataset:R})=>{m(I,R,w)})}};var d=m;let f=e.originalLazyGroupData;u=!0,m(i.groupKeys||[],p)}}else c=s;u||(t.originalDataArray=a?e.originalDataArray.concat(c):c),l&&(!e.lazyLoad||e.lazyLoad&&!a)&&(t.loading=!1)})}function Gf(o,{filterTypes:e,filterMode:t}){return t==="local"?o:(Es(o,e)||[]).map(n=>{let r={...n};return delete r.valueGetter,r})}function Vf(o,e){let t=!!o,{stateReadyAsDetails:n}=e(),r=t&&o.shouldRestoreState?n:!0;return{isDetail:t,isDetailReady:r}}function Hf(o){let{getComponentState:e,componentActions:t,componentState:n}=o,{data:r,dataArray:i,notifyScrollbarsChange:a,refetchKey:l,sortInfo:s,shouldReloadData:c,groupBy:u,pivotBy:d,filterValue:p,filterMode:f,livePagination:m,livePaginationCursor:g,filterTypes:b,cursorId:h}=n,[y,S]=(0,Je.useState)({vertical:!1,horizontal:!1}),C=(0,Je.useRef)(y);(0,Je.useEffect)(()=>(a.onChange(x=>{x&&(C.current=x,S(x))}),()=>a.destroy()),[a]),(0,Je.useEffect)(()=>{if(!m)return;let x=requestAnimationFrame(()=>{C.current?.vertical||g&&(t.cursorId=g)});return()=>cancelAnimationFrame(x)},[g]),(0,Je.useEffect)(()=>{if(!m||g!==void 0)return;let x=requestAnimationFrame(()=>{C.current?.vertical||h!=null&&i.length&&(t.cursorId=i.length)});return()=>cancelAnimationFrame(x)},[i.length,g]),(0,Je.useEffect)(()=>{let x=e(),{livePaginationCursor:E,livePagination:A,dataArray:M}=x;!y.vertical&&A&&(E?t.cursorId=E:E===void 0&&M.length&&(t.cursorId=M.length))},[y.vertical]);let T=(0,Je.useMemo)(()=>Gf(p,{filterTypes:b,filterMode:f}),[p,f,b]),v={sortInfo:c.sortInfo?s:null,groupBy:c.groupBy?u:null,pivotBy:c.pivotBy?d:null,refetchKey:l,filterValue:c.filterValue?T:null,cursorId:m?h:null},w=(0,Je.useRef)(!0);jT(o,{sortInfo:s,groupBy:u,pivotBy:d,filterValue:p,refetchKey:l,cursorId:m?h:null});let I=Me(Ve()),R=(0,Je.useRef)([]);ro(()=>{let x=e(),E=I(),{isDetail:A,isDetailReady:M}=Vf(E,e);if(A&&!M)return;let P=Date.now(),_=R.current;_.length>=10&&_.splice(0,1),_.push(P),P-_[0]<200&&_.length>=10&&Kr({debugId:x.debugId,key:"DS001"}),typeof x.data!="function"&&ao(x.data,x,t,void 0,E)},{data:r}),ro(x=>{let E=Object.keys(x),A=!1;if(E.length===1){if(A=!!x.cursorId,x.filterValue&&e().filterMode==="local")return;let F=e().data;if(Array.isArray(F)&&x.refetchKey){t.originalDataArray=F;return}}let M=I(),{isDetail:P,isDetailReady:_}=Vf(M,e);if(P&&!_)return;let D=e();if(typeof D.data=="function"){let F;D.debugId&&(F=ht(D.debugId).track.DataSource.label.RemoteDataLoad.start()),ao(D.data,D,t,{append:A},M).then(()=>{F?.end()})}},{...v,data:r}),ro(()=>{let x=e();if(w.current){w.current=!1;let E=fn(x,void 0,I());t.dataParams=E}},v)}function jT(o,e){let{getComponentState:t,componentActions:n,componentState:r}=o;(0,Je.useEffect)(()=>{n.lazyLoadCacheOfLoadedBatches=new Q},[r.data,r.dataParams]);let{lazyLoadBatchSize:i,lazyLoad:a,originalLazyGroupDataChangeDetect:l,notifyRenderRangeChange:s,dataArray:c,groupRowsState:u,scrollStopDelayUpdatedByTable:d}=r,p=(0,Je.useRef)(null),f=(g,b,h=t().lazyLoadCacheOfLoadedBatches)=>{let y=t();if(g=g||p.current,!g)return;let{renderStartIndex:S,renderEndIndex:C}=g,{lazyLoadBatchSize:T,lazyLoad:v}=y;v&&((!T||T<=0)&&(!y.groupBy||y.groupBy.length===0)||$T({startIndex:S,endIndex:C,lazyLoadBatchSize:T,componentState:y,componentActions:n,dismissLoadedRows:b?.dismissLoadedRows??!1},h))},m=(0,Je.useMemo)(()=>Dt(f,{wait:d}),[d]);ro(g=>{if(a)return g.sortInfo||g.filterValue||g.groupBy||g.pivotBy||g.refetchKey||g.cursorId?(t().lazyLoadCacheOfLoadedBatches.clear(),t().originalLazyGroupData.clear(),f(s.get(),{dismissLoadedRows:!0})):(g.originalLazyGroupDataChangeDetect||g.groupRowsState)&&f(s.get()),s.onChange(b=>{p.current=b,f(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,Je.useEffect)(()=>{i&&i>0&&m()},[c])}function $T(o,e){let{startIndex:t,endIndex:n,lazyLoadBatchSize:r,componentState:i,componentActions:a,dismissLoadedRows:l}=o,{dataArray:s}=i,c=l?()=>!1:g=>s[g].data!=null,u=!l,d=new Q,p=["_______xxx______"];for(let g=t;g<=n;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:p,C=b.dataSourceHasGrouping?b.indexInGroup:b.indexInAll;if(b.isGroupRow&&!b.collapsed&&!b.childrenAvailable){let T={lazyLoadStartIndex:0,lazyLoadBatchSize:r,groupKeys:b.groupKeys,append:u},v=b.groupKeys,w=d.get(v);if(!w?.[b.id]){let I=!w;w=w||{},w[b.id]||(w[b.id]=T),I&&d.set(v,w)}}if(!h&&r!=null){let T=d.get(S),v=Math.floor(C/r)*r,w=C-v,I=s[b.indexInAll-w].indexInAll,R=c(I),x=s[I].id;if(R||T?.[x])continue;let E=!T;T=T||{};let A={lazyLoadStartIndex:v,lazyLoadBatchSize:r,groupKeys:y,append:u};T[x]||(T[x]=A),E&&d.set(S,T)}}let f=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(()=>KT()).then(()=>ao(...y))},f)}var UT=Object.freeze([]),Kf=(o,e)=>{let t=o??UT,n=Array.isArray(t)?t:[t];if(e&&e.has(t)){let r=e.get(t);if(r&&r.length===n.length)return r}return e&&t&&e.set(t,n),n};var YT=Symbol("cursorId"),Bf=o=>o.totalLeafNodesCount===0,qT=o=>o.isParentNode?!Bf(o):!0;function Wf(o){let e=Date.now(),t=[],n=[],r=new Q;return{logger:yt(`${o.debugId}:DataSource`),debugTimings:new Map,debugWarnings:new Map,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,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 Q,waitForNodePathPromises:new Q,getDataSourceMasterContextRef:{current:()=>{}},cache:void 0,detailDataSourcesStateToRestore:new Map,stateReadyAsDetails:!1,originalDataArrayChanged:!1,originalDataArrayChangedInfo:{timestamp:0,mutations:void 0},rowsPerPage:null,lazyLoadCacheOfLoadedBatches:new Q,dataParams:void 0,onCleanup:be(),notifyScrollbarsChange:be(),notifyScrollStop:be(),notifyRenderRangeChange:be(),pivotTotalColumnPosition:"end",pivotGrandTotalColumnPosition:!1,scrollStopDelayUpdatedByTable:100,originalLazyGroupData:r,originalLazyGroupDataChangeDetect:0,originalDataArray:t,cursorId:YT,showSeparatePivotColumnForSingleAggregation:!1,propsCache:new Map([["sortInfo",new WeakMap],["rowDisabledState",new WeakMap]]),rowInfoReducerResults:void 0,pivotMappings:void 0,pivotColumns:void 0,pivotColumnGroups:void 0,dataArray:n,unfilteredCount:n.length,filteredCount:n.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 XT(o){let e={...o};return delete e.originalDataArray,e}var ZT=[],jf=o=>{o.destroyedRef.current=!0,o.__apiRef.current=null,o.lastSelectionUpdatedNodePathRef.current=null,o.lastExpandStateInfoRef.current={state:"collapsed",nodePath:null},o.treeExpandState?.destroy(),o.treePaths?.clear(),o.unfilteredTreePaths?.clear(),o.waitForNodePathPromises.clear(),o.pathToIndexMap?.clear(),o.rowDisabledState?.destroy(),o.groupRowsState?.destroy(),o.treeSelectionState?.destroy(),o.idToPathMap.clear(),o.idToIndexMap.clear()},$f=(o,e)=>({onDataParamsChange:t=>t?Pf(t,100,XT):void 0,lazyLoad:t=>!!t,isNodeReadOnly:t=>t??Bf,isNodeSelectable:t=>t??qT,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=>({...Cn,...t}),sortTypes:t=>({...Hr,...t}),sortFunction:1,onReady:1,rowInfoReducers:(t,n)=>{let r={initialValue:()=>{n.idToIndexMap.clear()},reducer:(a,l)=>{e.debugId&&!e.nodesKey&&n.idToIndexMap.has(l.id)&&console.warn(`Duplicate id found in data source: ${l.id}`),n.idToIndexMap.set(l.id,l.indexInAll)}},i=t?{...t,__idToIndex:r}:{__idToIndex:r};if(e.nodesKey){let a={initialValue:()=>{n.idToPathMap.clear(),n.pathToIndexMap.clear()},reducer:(l,s)=>{s.isTreeNode&&(n.idToPathMap.set(s.id,s.nodePath),e.debugId&&n.pathToIndexMap.has(s.nodePath)&&console.warn(`Duplicate node path found in data source (debugId: ${e.debugId||"none"}): ${s.nodePath}`),n.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 gt)return t;let n=o.propsCache.get("rowDisabledState")??Gt,r=n.get(t);return r||(r=new gt(t),n.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=>Kf(t,o.propsCache.get("sortInfo")),groupBy:t=>t??ZT});function QT(o,e){return typeof o=="function"?o({array:e.originalDataArray,length:e.originalDataArray.length,lastItem:e.originalDataArray[e.originalDataArray.length-1]}):o}var Gt=new WeakMap;function JT(o){if(typeof o=="boolean")return{filterValue:o,sortInfo:o,groupBy:o,pivotBy:o};let e={};return o.filterValue!=null&&(e.filterValue=o.filterValue),o.sortInfo!=null&&(e.sortInfo=o.sortInfo),o.groupBy!=null&&(e.groupBy=o.groupBy),o.pivotBy!=null&&(e.pivotBy=o.pivotBy),e}var eS={selectedPaths:[],deselectedPaths:[],defaultSelection:!1};function Ff(o,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 n=Go(t);if(o instanceof Xe)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??ZT,i=zt.get(r);return i&&i.setConfig(n),i=i??new Xe(r,n),zt.set(r,i),i}function Wf(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=dr(e.sortInfo),a=dr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((P,O)=>{let E=l[O].operators;P[O]=P[O]||{};let _=P[O];return E.forEach(N=>{_[N.name]=N}),P},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let P=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(P!==void 0&&(P&&typeof P=="object"?u="multi-row":u="single-row"),!u){let O=c.treeSelection??c.defaultTreeSelection;O!==void 0&&(u=typeof O=="object"?"multi-row":"single-row")}u=u??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(f===null?d=u==="single-row"?null:new Re({selectedRows:[],deselectedRows:[],defaultSelection:!1},ct(t)):u==="single-row"||f instanceof Re?d=f:d=new Re(f,ct(t))),u==="single-cell"||u==="multi-cell"))if(m===null)p=u==="single-cell"?null:new ze;else if(m instanceof ze)p=m;else{let P=zt.get(m)??new ze(m);zt.set(m,P),p=P}let g=t.primaryKey,h=typeof g=="function"?P=>g(P):P=>P[g],b=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(b&&!(b instanceof ot)){let P=zt.get(b)??new ot(b);zt.set(b,P),b=P}b=b||new ot({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof ft)){let P=zt.get(y)??new ft(y);zt.set(y,P),y=P}y=y||new ft(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=XT(e.shouldReloadData||{}),C=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,v=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&Vo('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&Vo('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&Vo('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let w=typeof e.data=="function"?C??"local":"local",I=e.sortFunction?"local":T??(i?"remote":"local"),R=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":v??(typeof e.data=="function"?"remote":"local"),x=S.pivotBy?"remote":"local",D=t.rowDisabledState,M=e.isRowDisabled;if(!M&&D){let P=zt.get(D);P?M=P:(M=O=>D.isRowDisabled(O.id),zt.set(D,M))}let A={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:b,treeExpandMode:b.mode,shouldReloadData:{filterValue:S?.filterValue??R==="remote",sortInfo:S?.sortInfo??I==="remote",groupBy:S?.groupBy??w==="remote",pivotBy:S?.pivotBy??x==="remote"},isRowDisabled:M,rowSelection:d,cellSelection:p,groupMode:w,sortMode:I,filterMode:R,pivotMode:x,toPrimaryKey:h,operatorsByFilterType:s,controlledSort:i,controlledFilter:a,multiSort:Array.isArray(i?e.sortInfo:e.defaultSortInfo),lazyLoadBatchSize:typeof e.lazyLoad=="object"?e.lazyLoad.batchSize:void 0};if(e.livePagination){let P=!n||n.originalDataArray!==t.originalDataArray,O=typeof e.livePaginationCursor=="function"?P?qT(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;A.livePaginationCursor=O}if(t.devToolsDetected&&t.debugId){let P=cn.get(t.debugId);P&&(A={...A,...P})}return A}var QT=bt("DataSource:fullLazyLoad");function jf(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&QT('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new ft({collapsedRows:!0,expandedRows:[]})))}function $f(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let t=e.__apiRef.current,n=t.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:n}]}},treeExpandState:(o,e)=>({callbackParams:[o.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof ze?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function Uf(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=dn(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Oe(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=dn(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Oe(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=dn(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Oe(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=dn(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Oe(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=dn(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=dn(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>At(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(bt(Pn(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function Yf(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}var Ct=z(require("react"));function Ko(o){let e=Le(),t=Pe(e),n=!!e,r=n?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=Es(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Pe(s),[d]=(0,Ct.useState)(()=>Pf({getState:u,actions:l})),p={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:u,assignState:c,api:d},f=Pe(i),m=Pe(p),g=ur(),h=(0,Ct.useCallback)(({children:b})=>(typeof b=="function"&&(b=b(u())),Ct.default.createElement(a.Provider,{key:r,value:f()},Ct.default.createElement(g.Provider,{value:m()},b))),[a,n,r]);return(0,Ct.useLayoutEffect)(()=>{e&&e.registerDetail(p)},[]),(0,Ct.useLayoutEffect)(()=>()=>{let b=u();b.onCleanup(b)},[]),zf({componentState:s,componentActions:l,getComponentState: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:h,state:p.componentState}}var wt=class extends Ho{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var ya=class ya{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??ya.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};ya.DEFAULT_SIZE=10;var ba=ya;var Ms=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},Ta=class{constructor(e){this.storage=new ba(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)}},As=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)}},Bo=class{constructor(e){this.cacheStorage=e===!1?new Ms:e===!0?new As:typeof e=="number"?new Ta(e):new Ta(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 qf=(e=>(e.INIT="INIT",e))(qf||{});var{useManagedComponent:Es}=Mt({debugName:"DataSource",initSetupState:Hf,forwardProps:Bf,concludeReducer:Mf,mapPropsToState:Wf,onPropChange:jf,cleanup:Kf,interceptActions:Uf(),mappedCallbacks:$f()});function JT(o){let{DataSource:e}=Ko(o);return Xf.createElement(e,null,o.children??null)}function eS(){let{rowInfoReducerResults:o}=tn();return o}function tS(){let o=Le();if(o)return o.masterRowInfo}function _s(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[c+f*m],h=a.get(g);if(h&&h.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,p;for(;!p&&u<l.length&&(u++,p=s(u,d),p||(d*=-1,p=s(u,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function Os(o){if(o==null)return!1;let e=o;return!0}function Sa(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function Fs(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function Zf(o,e,t){if(Fs(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/n),p=Math.floor(c/n),f=l%n,m=c%n,g=Math.min(f,m),h=Math.max(f,m),b=[];for(let y=d;y<=p;y++)for(let S=g;S<=h;S++){let C=y*n+S;if(y===d)for(let T=s;T<r;T++)b.push({rowIndex:C,colIndex:T});else if(y===p)for(let T=0;T<=u;T++)b.push({rowIndex:C,colIndex:T});else for(let T=0;T<r;T++)b.push({rowIndex:C,colIndex:T})}return b}function nS(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var Ns=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??An(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new ze(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=An(l,this.getDataSourceState),h=An(c,this.getDataSourceState);if(!g||!h)return;let b=g.indexInAll,y=h.indexInAll,[S,C]=Sa({rowIndex:b,colIndex:f},{rowIndex:y,colIndex:m});for(let T=S.rowIndex;T<=C.rowIndex;T++)for(let v=S.colIndex;v<=C.colIndex;v++){let w={rowIndex:T,colIndex:v},[I,R]=this.getCellSelectionPosition(w);n?a.selectCell(I,R):a.deselectCell(I,R)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=ua(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=nS(Array.from(a),i),u=l.map(d=>c.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new ze(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new ze(t);n.debugId=e.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new ze:new ze(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new ze(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new ze(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new ze(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function Qf(o){return new Ns(o)}function Jf(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new wt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new wt({expandedRows:!0,collapsedRows:[]})},isRowDetailCollapsed(i){let a=t().isRowDetailExpanded;if(!a)return!0;let l=e.getRowInfoByPrimaryKey(i);return l?!a(l):!0},isRowDetailEnabledForRow(i){let{isRowDetailEnabled:a}=t();if(!a)return!1;if(typeof a=="function"){let l=e.getRowInfoByPrimaryKey(i);return l?a(l):!1}return!0},isRowDetailExpanded(i){return!r.isRowDetailCollapsed(i)},collapseRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot collapse row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new wt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new wt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function On(o,e,t){return Math.min(Math.max(o,e),t)}function Ca(o,e,t){let n=o().dataArray,r=0,i=n.length-1,a=e;do{a+=t;let l=n[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return On(a,r,i)}function oS(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:p}=u;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,h=m-f-1,b=0,y=c-1,S={ArrowDown:()=>{p=Ca(n,p,1)},ArrowUp:()=>{p=Ca(n,p,-1)},ArrowLeft:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let v=d.rowsPerPage;p-v>=b?p=p-v:S.ArrowUp();return}return T&&T.isGroupRow?i.collapseGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let v=d.rowsPerPage;p+v<=y?p=p+v:S.ArrowDown();return}return T&&T.isGroupRow?i.expandGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=s[p];return T&&T.isGroupRow?i.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{p=Math.min(p+h,c-1)},PageUp:()=>{p=Math.max(p-h,b)},End:()=>{p=y},Home:()=>{p=b}},C=S[l];return C?(C(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Ls(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,c=i().dataArray,u=n(),{activeCellIndex:d,brain:p}=u;if(!d)return!1;let[f,m]=d,{start:[g,h],end:[b,y]}=p.getRenderRange(),S=b-g-1,C=y-h-1,T=i().dataArray.length-1,v=r().computedVisibleColumns.length-1,w=0,I=0;f=On(f,0,T),m=On(m,0,v);let R={ArrowDown:()=>{f=On(f+1,w,T)},ArrowUp:()=>{f=On(f-1,w,T)},ArrowLeft:()=>{if(m===I)if(f!==w&&(m=v),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f-D>=w?f=f-D:R.ArrowUp()}else R.ArrowUp();else m=On(m-1,I,v)},ArrowRight:()=>{if(m===v)if(f!==T&&(m=I),p.isHorizontalLayoutBrain){let D=p.rowsPerPage;f+D<=T?f=f+D:R.ArrowDown()}else R.ArrowDown();else m=On(m+1,I,v)},Enter:()=>{let D=c[f];return D&&D.isGroupRow?t.toggleGroupRow(D.groupKeys):D&&D.isTreeNode&&D.isParentNode?a.treeApi.toggleNode(D.nodePath):D&&t.rowDetailApi.isRowDetailEnabledForRow(D.id)?t.rowDetailApi.toggleRowDetail(D.id):!1},PageDown:()=>{s?m=Math.min(m+C,v):f=Math.min(f+S,T)},PageUp:()=>{s?m=Math.max(m-C,I):f=Math.max(f-S,w)},End:()=>{s?m=v:f=T},Home:()=>{s?m=I:f=w}},x=R[l];return x?(x(),[f,m]):!1}function rS(o,e){let t=Ls(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var iS={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function em(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!iS[t]?!1:i!=null&&l==="row"?oS(o,e):a!=null&&l==="cell"?rS(o,e):!1}var ks=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:n}=this.param,{activeRowIndex:r,keyboardNavigation:i}=n();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Ca(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,n=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Ls(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function tm(o){return new ks(o)}function nm(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var zs=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...St({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;n.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),c;try{c=await s(a)}catch(d){c=d}let u=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:u},Promise.resolve(u)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...St({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let c=l.computedEditable(St({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>st(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=Do({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new ft(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),n=new ft(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[Mn,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||ao(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=ee.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=kt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let g=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>p+(n.offset||0);return f&&m?!1:(c.scrollLeft!==u.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=vf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=tm({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=Jf({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=Qf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(_s(t),e?.()),setTimeout(()=>{this.isDestroyed()||(_s(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Gd({column:u,rowInfo:d}),f=p;u.getValueToEdit&&(p=await u.getValueToEdit(St({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,n){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,n);return}let l=i.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(f=>f.valueGetter?m=>f.valueGetter({data:m,field:f.field}):f.field?f.field:f.groupField??void 0).filter(Os);u.length&&(s=u);let d=i.computedSortType;c.length&&d===To&&(d=c.flatMap(m=>{let g=m.field??m.groupField,h=g?r.get(g):null;return h?h.computedSortType:To}));let p={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(p.valueGetter=f=>i.valueGetter({data:f,field:i.field})),this.setSortInfoForColumn(e,p,n)}setSortInfoForColumn(e,t,n){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!nm(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:nm(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;n.computedFilterValue?(u={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(u.field=n.field)),u.id=n.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],c=n.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,p=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:p}}}return a}).filter(Os),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n={...this.getState().columnVisibility};t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current.scrollLeft=Math.max(e,0)}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current.scrollTop=Math.max(e,0)}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=n.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(n.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),c=n.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function om(o){return new zs(o)}var lo=require("react");var aS=10;function lS(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${Xn} > .${$l}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${Un}`);if(t===!1&&d)return;let p=u.getAttribute("data-column-id"),f=c.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...jt.split(" ")),f.style.position="absolute",f.style.width="auto",u.appendChild(f);let m=f.offsetWidth;if(u.removeChild(f),!s[p]){let g=we().getComputedStyle(u);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+aS}if(m+=s[p],d){let g=0;u.childNodes.forEach(h=>{if(h!==c){let b=h,y=Math.max(b.offsetWidth,parseInt(b.style.width,10));if(isNaN(y)&&(y=0),g+=y,y>0){let S=we().getComputedStyle(b);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function rm(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=je(),[a,l]=(0,lo.useState)(0),s=typeof r=="object"?r.key:r,c=Pe(s),u=(0,lo.useRef)(null);(0,lo.useEffect)(()=>{if(c()==null)return;let{current:p}=u,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,lo.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=lS(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),h=Object.keys(g);if(!h.length)return;let b=o().columnSizing,y={...b},S=!1;h.forEach(C=>{y[C]={width:g[C]},S=S||y[C].width!==b[C]?.width}),S&&(e.columnSizing=y)},[s,n,a])}var jo=require("react");var wa=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,n,r){if(r.horizontalLayout&&!Fs(e,t,r)){Zf(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=Sa(e,t),l=this.getCellSelectionPosition(i),s=this.getCellSelectionPosition(a);if(!(!l||!s))for(let c=i.rowIndex;c<=a.rowIndex;c++)for(let u=i.colIndex;u<=a.colIndex;u++){let d=this.getCellSelectionPosition({rowIndex:c,colIndex:u});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function im(o,e){return o<e?[o,e]:[e,o]}var va=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[n,r]=im(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[n,r]=im(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let n;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))n=r;else break}this.multiSelectEndIndex=n}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};var am=require("react");function lm(o){let{getState:e}=xe();return(0,am.useMemo)(()=>o.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,c=o[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}var sm=require("react");var QL=bt("useColumnSizeFn");function cm(o){return(0,sm.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Vt=require("react");var Fn=require("react");var sS={scrollLeft:0,scrollTop:0},Kr=class{constructor(){this.scrollPosition=sS;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let n=0,r=t.length;n<r;n++)t[n](e)}};function um(o,e){let t=new Map;function n(r){return e[r]!==!1}return Object.keys(o).forEach(r=>{let a=o[r].columnGroup,l=0;for(n(r)||(l=-1);a;){let s=o[a];if(!s)break;n(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var dm=z(require("react"));function pm(o){return(e,t)=>dm.createElement(o,{key:e.id,rowInfo:e,cache:t})}var Br=class extends Jn{constructor(t,n){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,n,r,i){if(t==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(t,n,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=Bi(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,p=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,h=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&h&&(this.initialCols=r,this.cols=r);let b=i!=null,y=a!=null,S=b&&i!==this.rowHeight,C=y&&a!==this.initialColWidth;b&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=g||S||p,v=h||C||d||T;(v||T)&&this.updateRenderCount({horizontal:v,vertical:T})}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=rn){let n=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/n);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(n=>{Oe(()=>{this.destroyed||t.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(t,n){return this.initialCols*(n?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var fm={};function Vs(o){return`.${Yt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Gs(o,e){let t=Pn(o),n=e?new Br(t,{isHeader:!1}):new Jn(t),r=`${t}:header`,i=e?new Br(r,{isHeader:!0,masterBrain:n}):new Jn(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Ar(n),{renderer:s,onRenderUpdater:c}=Ar(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function mm({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Gs(o,!!e),c=(0,Fn.createRef)();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:u=>{if(!c.current)return null;let d=Vs(u);return c.current.querySelector(d)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:(0,Fn.createRef)(),editingValueRef:(0,Fn.createRef)(),scrollerDOMRef:(0,Fn.createRef)(),portalDOMRef:(0,Fn.createRef)(),focusDetectDOMRef:(0,Fn.createRef)(),activeCellIndicatorDOMRef:(0,Fn.createRef)(),onColumnMenuClick:ge(),cellContextMenu:ge(),contextMenu:ge(),onFilterOperatorMenuClick:ge(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:ge(),onRowHeightCSSVarChange:ge(),onRowDetailHeightCSSVarChange:ge(),onColumnHeaderHeightCSSVarChange:ge(),cellClick:ge(),cellMouseDown:ge(),keyDown:ge(),bodySize:{width:0,height:0},scrollPosition:{scrollTop:0,scrollLeft:0},columnReorderDragColumnId:!1,columnReorderInPageIndex:null,ready:!1,focused:!1,focusedWithin:!1,columnsWhenGrouping:t,columnVisibilityForGrouping:{},pinnedStartScrollListener:new Kr,pinnedEndScrollListener:new Kr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var gm=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,cellClassName:1,repeatWrappedGroupRows:1,pinnedStartMaxWidth:1,pinnedEndMaxWidth:1,pivotColumn:1,pivotColumnGroups:1,getFilterOperatorMenuItems:1,onScrollbarsChange:1,autoSizeColumnsKey:1,wrapRowsHorizontally:1,columnDefaultFlex:1,draggableColumnsRestrictTo:e=>e??!1,columnMenuRealignDelay:e=>e??50,scrollStopDelay:e=>e??250,viewportReservedWidth:e=>e??0,resizableColumns:e=>e??!0,rowDetailCache:e=>new Bo(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??fm,columnGroupVisibility:e=>e??fm,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 cS(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var hm=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function bm(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var Ia=new WeakMap;function ym(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var Tm=o=>{let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=n?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=n?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=n?.pivotColumnGroups?um(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=cS({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let h=Ia.get(d);h||(h=pm(d),Ia.set(d,h)),u=h}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof wt)&&(c=new wt(c)),c=c||new wt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=c?e.isRowDetailExpanded:void 0;!f&&c&&(f=Ia.get(c),f||(f=h=>c.isRowDetailsExpanded(h.id),typeof c=="object"&&Ia.set(c,f)));let m=u?e.isRowDetailEnabled||!0:!1,g={isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||ce.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let h=sn.get(t.debugId);h&&(g={...g,...h})}return g};function Sm(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function Cm(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(c=Math.max(c,f.groupNesting-1),c===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var wm=require("react");function Hs(){let{getState:o,componentActions:e,getDataSourceMasterContext:t}=xe();return(0,wm.useCallback)(r=>{let i=o(),a=new ft(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[Mn,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||ao(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=ee.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=kt())}},[])}function uS(o){return(0,Vt.useMemo)(()=>bm(o),[o])}function vm(){let{componentState:{groupBy:o},componentActions:e}=xe(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:n,pivotGrandTotalColumnPosition:r}}=je();(0,Vt.useEffect)(()=>{e.generateGroupRows=t!=="inline"},[t]),(0,Vt.useEffect)(()=>{e.pivotTotalColumnPosition=n},[n]),(0,Vt.useEffect)(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=uS(o);dS(i);let{toggleGroupRow:a}=pS();return fS(i),{toggleGroupRow:a}}function dS(o){let e=Hs(),{componentActions:t,componentState:{columns:n,groupRenderStrategy:r,isTree:i}}=je();function a(l,s,c,u){let d={};if(c==="inline")return Object.keys(l).forEach(p=>{let f=l[p],m={},g=s.get(f.field);if(g&&c==="inline"){let{groupIndex:b}=g;m={groupByForColumn:g.groupBy,field:g.groupBy?.field,valueGetter:g.groupBy?.valueGetter,valueFormatter:({rowInfo:y})=>y.isGroupRow?y.groupKeys?.[b]:y.value,rowspan:({rowInfo:y,dataArray:S})=>{if(y.isTreeNode||!y.isGroupRow)return 1;let C=S[y.indexInAll-1]||{indexInParentGroups:[]};if(!C||!C.dataSourceHasGrouping)return 1;let T=C.indexInParentGroups||[],v=y.indexInParentGroups||[],w=!1;for(let x=0;x<=b;x++){let D=T[x];if(v[x]!==D){w=!0;break}}if(!w)return 1;let I=y.parents[b];return I?I.groupCount-(I.collapsedChildrenCount||0)+(I.collapsedGroupsCount||0):1},renderGroupIcon:Pi({groupIndexForColumn:b,groupRenderStrategy:c,toggleGroupRow:u,initialRenderGroupIcon:f.renderGroupIcon}),render:xi({groupIndexForColumn:b,groupRenderStrategy:c})}}let h={...m,...f};d[p]=h}),Object.keys(d).length===0?void 0:d}(0,Vt.useEffect)(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(n,o,r,e)})()},[n,o,r,e])}function pS(){let{componentState:{groupBy:o,pivotBy:e,selectionMode:t}}=xe(),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:p}=je(),f=Hs();return(0,Vt.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:h}=mS({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let b=p().columnOrder;if(h.length&&Array.isArray(b)){let y=new Set(b),S=!1;h.forEach(C=>{y.has(C)||(S=!0,b=[C,...b])}),S&&(n.columnOrder=b)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:f}}function fS(o){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:n,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=xe(),{getComponentState:l,componentActions:s,componentState:{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=je();(0,Vt.useLayoutEffect)(()=>{if(f!=="multi-column")return;let m=l(),g=Sm(u,o),h=Cm({computedGroupColumns:g,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:n,groupByMap:o});At(m.columnVisibility,h)||(s.columnVisibility=h)},[a,f,i,n,o,u,p?e:null,p?r:null,p?t:null,p]),(0,Vt.useEffect)(()=>{let m=n.length>0,g=l(),{columnVisibility:h,columnVisibilityForGrouping:b,hideColumnWhenGrouped:y}=g,S={...h},C={...b},T=!1,v=new Set,w=new Set;Object.keys(u).forEach(I=>{let R=u[I];if(R.defaultHiddenWhenGroupedBy||y!=null)if(R.defaultHiddenWhenGroupedBy==="*"&&m||(R.defaultHiddenWhenGroupedBy===!0||y)&&R.field&&o.get(R.field)||typeof R.defaultHiddenWhenGroupedBy=="string"&&o.get(R.defaultHiddenWhenGroupedBy)||typeof R.defaultHiddenWhenGroupedBy=="object"&&Object.keys(R.defaultHiddenWhenGroupedBy).reduce((D,M)=>D||o.has(M),!1)){if(C[I]!==!1){if(h[I]===!1)return;C[I]=!1,T=!0,v.add(I)}}else C[I]===!1&&(delete C[I],T=!0,w.add(I))}),T&&(s.columnVisibilityForGrouping=C,w.forEach(I=>{delete S[I]}),v.forEach(I=>{S[I]=!1}),s.columnVisibility=S)},[u,c,n,o,d])}function mS(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=o;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(c==="multi-column")t.forEach((m,g,h)=>{let b=Ad({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:h.length,groupRenderStrategy:c,selectionMode:r},u,i),y=b.id||`group-by-${m.field||m.groupField}`;f.push(y),p[y]=b});else if(c==="single-column"&&t.length){let m=_d({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";f.push(g),p[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let h=d[g];h.field&&(m[h.field]=h)}),Object.keys(e).forEach(g=>{let h=e[g],b=h.pivotTotalColumn&&h.columnGroup,y=h.pivotTotalColumn&&!h.columnGroup;if(b&&a===!1||y&&l===!1)return;let S={...h};s&&(typeof s=="function"?S={...S,...s({column:S,pivotBy:n,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=C=>S.renderValue(C)),p[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];p[m]=g});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var Im=require("react");var Rm=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:p,filterValue:f,filterTypes:m,columnOrder:g,columnPinning:h,editable:b,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:T,scrollbarWidth:v,columnTypes:w,pinnedEndMaxWidth:I,pinnedStartMaxWidth:R,viewportReservedWidth:x,resizableColumns:D,columnVisibility:M,columnVisibilityAssumeVisible:A,columnSizing:P,groupBy:O})=>{let{computedRemainingSpace:_,computedColumnOrder:N,computedVisibleColumns:H,computedVisibleColumnsMap:B,computedPinnedStartColumns:U,computedPinnedEndColumns:de,computedUnpinnedColumns:pe,computedPinnedStartColumnsWidth:k,computedPinnedEndColumnsWidth:Y,computedUnpinnedColumnsWidth:ae,computedUnpinnedOffset:se,computedPinnedEndOffset:le,computedPinnedEndWidth:re,computedPinnedStartWidth:Z,renderSelectionCheckBox:be,computedColumnsMap:oe,computedColumnsMapInInitialOrder:G,fieldsToColumn:W}=(0,Im.useMemo)(()=>Au({columns:o,scrollbarWidth:v,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:x,resizableColumns:D,filterValue:f,filterTypes:m,sortable:a,sortInfo:d,multiSort:p,pinnedEndMaxWidth:I,pinnedStartMaxWidth:R,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:h,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:T,editable:b,columnSizing:P,columnTypes:w,columnVisibility:M,columnVisibilityAssumeVisible:A??!0,groupBy:O}),[o,e.width,t,n,r,x,v,a,d,p,f,m,g,M,A,u,c,D,I,R,P,w,h,y,S,C,b,O,1]);return{renderSelectionCheckBox:be,columns:o,computedColumnsMap:oe,computedPinnedEndWidth:re,computedPinnedStartWidth:Z,computedRemainingSpace:_,computedUnpinnedOffset:se,computedPinnedEndOffset:le,computedPinnedStartColumnsWidth:k,computedPinnedEndColumnsWidth:Y,computedUnpinnedColumnsWidth:ae,computedPinnedStartColumns:U,computedPinnedEndColumns:de,computedUnpinnedColumns:pe,computedVisibleColumns:H,computedVisibleColumnsMap:B,computedColumnOrder:N,computedColumnsMapInInitialOrder:G,fieldsToColumn:W}};var xm=require("react"),Ks=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function gS(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],p=d?n(d):0;return e&&e.rowHeight.set(u,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,m)),p+m}}function Pm(o){return(0,xm.useMemo)(()=>{let e=new Ks;return{computedRowHeight:gS(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}},[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var Wo=require("react");var hS={vertical:!1,horizontal:!1};function Dm(o){let{getComponentState:e}=je(),{getState:t}=xe(),[n,r]=(0,Wo.useState)(hS);return(0,Wo.useEffect)(()=>o.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=o;r({vertical:i>0,horizontal:a>0})}),[o]),(0,Wo.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function Em(){let{componentActions:o,componentState:e}=je(),{componentActions:t,componentState:n,getState:r,api:i}=xe(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:c,editable:u,columnDefaultEditable:d,columnDefaultFilterable:p,columnDefaultGroupable:f,columnTypes:m,rowHeight:g,rowDetailHeight:h,isRowDetailExpanded:b,isRowDetailEnabled:y,brain:S,bodySize:C,showSeparatePivotColumnForSingleAggregation:T}=e;(0,jo.useState)(()=>{e.onRowHeightCSSVarChange.onChange(q=>{q&&(o.rowHeight=q)}),e.onFlashingDurationCSSVarChange.onChange(q=>{let ue=q?q*1:null;ue!=null&&!isNaN(ue)&&(o.flashingDurationCSSVarValue=ue)}),e.onRowDetailHeightCSSVarChange.onChange(q=>{q&&(o.rowDetailHeight=q)}),e.onColumnHeaderHeightCSSVarChange.onChange(q=>{q&&(o.columnHeaderHeight=q)})}),(0,jo.useEffect)(()=>{t.showSeparatePivotColumnForSingleAggregation=T},[T]);let{multiSort:v,filterValue:w,filterTypes:I,groupBy:R}=n,{toggleGroupRow:x}=vm(),D=e.computedColumns,{computedColumnOrder:M,computedVisibleColumns:A,computedVisibleColumnsMap:P,computedPinnedStartColumns:O,computedPinnedEndColumns:E,computedUnpinnedColumns:_,computedPinnedStartColumnsWidth:N,computedPinnedEndColumnsWidth:H,computedUnpinnedColumnsWidth:B,computedUnpinnedOffset:U,computedPinnedEndOffset:de,computedRemainingSpace:pe,computedPinnedStartWidth:k,computedPinnedEndWidth:Y,renderSelectionCheckBox:ae,computedColumnsMap:se,computedColumnsMapInInitialOrder:le,fieldsToColumn:re}=Rm({columns:D,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:C,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:n.sortInfo??void 0,multiSort:v,groupBy:R,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:u,columnDefaultEditable:d,columnDefaultFilterable:p,columnDefaultGroupable:f,filterValue:w,filterTypes:I,columnSizing:c,columnTypes:m}),Z=lm(A),be=cm(A),oe=Dm(S),G=k?N>k:!1,W=Y?H>Y:!1,[F]=(0,jo.useState)(()=>new va({isRowDisabledAt:ue=>r().dataArray[ue]?.rowDisabled??!1,getIdForIndex:ue=>r().dataArray[ue]?.id??-1})),ie=Pe(A),[j]=(0,jo.useState)(()=>new wa({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:q=>ie()[q]?.id||""})),{computedRowHeight:K,computedRowSizeCacheForDetails:ne}=Pm({rowDetailHeight:h,rowHeight:g,isRowDetailsExpanded:b,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:F,multiCellSelector:j,computedRowSizeCacheForDetails:ne,computedRowHeight:K,scrollbars:oe,columnSize:be,rowspan:Z,toggleGroupRow:x,computedColumnsMap:se,computedColumnsMapInInitialOrder:le,renderSelectionCheckBox:ae,computedPinnedStartOverflow:G,computedPinnedEndOverflow:W,computedPinnedStartWidth:k,computedPinnedEndWidth:Y,computedVisibleColumns:A,computedColumnOrder:M,computedRemainingSpace:pe,computedVisibleColumnsMap:P,computedPinnedStartColumns:O,computedPinnedEndColumns:E,computedUnpinnedColumns:_,computedPinnedStartColumnsWidth:N,computedPinnedEndColumnsWidth:H,computedUnpinnedColumnsWidth:B,computedUnpinnedOffset:U,computedPinnedEndOffset:de,fieldsToColumn:re}}var _m=require("react");function bS(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function yS(){return 4294967295}function TS(o,e,t){return e=e>>>8^o[t^e&255],e}function SS(o){return o=~o,o=o<0?4294967295+o+1:o,o}function Bs(o,e=3988292384){var t=bS(e),n=0,r;for(n=yS(),r=0;r<o.length;r++)n=TS(t,n,o.charCodeAt(r));return n=SS(n),`${n}`}var CS=o=>{let e=o.reduce((n,r)=>(n.set(r.name,r.value),n),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Mm=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+8,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},Am=(o="",e,t)=>{let n;try{n=wS(o)}catch{return Mm(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(n.end);return i<r?(Mm([`
27
+ `);let n=Ho(t);if(o instanceof Xe)return o.setConfig(n),o;(o==null||typeof o!="object")&&(o=void 0);let r=o??eS,i=Gt.get(r);return i&&i.setConfig(n),i=i??new Xe(r,n),Gt.set(r,i),i}function Uf(o){let{props:e,state:t,oldState:n}=o,r=!!t.nodesKey,i=fr(e.sortInfo),a=fr(e.filterValue),{filterTypes:l}=t,s=Object.keys(l).reduce((P,_)=>{let D=l[_].operators;P[_]=P[_]||{};let F=P[_];return D.forEach(N=>{F[N.name]=N}),P},{}),c=e,u=e.selectionMode;if(u===void 0)if(e.cellSelection!==void 0||e.defaultCellSelection!==void 0)u="multi-cell";else{let P=e.rowSelection!==void 0?e.rowSelection:e.defaultRowSelection;if(P!==void 0&&(P&&typeof P=="object"?u="multi-row":u="single-row"),!u){let _=c.treeSelection??c.defaultTreeSelection;_!==void 0&&(u=typeof _=="object"?"multi-row":"single-row")}u=u??!1}let d=null,p=null,f=e.rowSelection!==void 0?e.rowSelection:t.rowSelection===void 0?e.defaultRowSelection!==void 0?e.defaultRowSelection:null:t.rowSelection,m=e.cellSelection!==void 0?e.cellSelection:t.cellSelection===void 0?e.defaultCellSelection!==void 0?e.defaultCellSelection:null:t.cellSelection||null;if(!r&&(u!==!1&&(u==="single-row"||u==="multi-row")&&(f===null?d=u==="single-row"?null:new Pe({selectedRows:[],deselectedRows:[],defaultSelection:!1},ct(t)):u==="single-row"||f instanceof Pe?d=f:d=new Pe(f,ct(t))),u==="single-cell"||u==="multi-cell"))if(m===null)p=u==="single-cell"?null:new He;else if(m instanceof He)p=m;else{let P=Gt.get(m)??new He(m);Gt.set(m,P),p=P}let g=t.primaryKey,b=typeof g=="function"?P=>g(P):P=>P[g],h=c.treeExpandState||t.treeExpandState||c.defaultTreeExpandState;if(h&&!(h instanceof ot)){let P=Gt.get(h)??new ot(h);Gt.set(h,P),h=P}h=h||new ot({defaultExpanded:!0,collapsedPaths:[]});let y=e.groupRowsState||t.groupRowsState||e.defaultGroupRowsState;if(y&&!(y instanceof mt)){let P=Gt.get(y)??new mt(y);Gt.set(y,P),y=P}y=y||new mt(t.lazyLoad?{expandedRows:[],collapsedRows:!0}:{expandedRows:!0,collapsedRows:[]});let S=JT(e.shouldReloadData||{}),C=e.groupMode??(S.groupBy!=null?S.groupBy?"remote":"local":void 0),T=e.sortMode??S.sortInfo!=null?S.sortInfo?"remote":"local":void 0,v=e.filterMode??S.filterValue!=null?S.filterValue?"remote":"local":void 0;e.groupMode&&Go('"groupMode" prop is deprecated for the <DataSource />, use "shouldReloadData.groupBy: true|false" instead',"groupMode deprecated",t.logger),e.sortMode&&Go('"sortMode" prop is deprecated for the <DataSource />, use "shouldReloadData.sortInfo: true|false" instead',"sortMode deprecated",t.logger),e.filterMode&&Go('"filterMode" prop is deprecated for the <DataSource />, use "shouldReloadData.filterValue: true|false" instead',"filterMode deprecated",t.logger);let w=typeof e.data=="function"?C??"local":"local",I=e.sortFunction?"local":T??(i?"remote":"local"),R=typeof e.filterFunction=="function"||typeof e.treeFilterFunction=="function"?"local":v??(typeof e.data=="function"?"remote":"local"),x=S.pivotBy?"remote":"local",E=t.rowDisabledState,A=e.isRowDisabled;if(!A&&E){let P=Gt.get(E);P?A=P:(A=_=>E.isRowDisabled(_.id),Gt.set(E,A))}let M={debugId:t.debugId??e.debugId,isTree:r,selectionMode:u,groupRowsState:y,treeExpandState:h,treeExpandMode:h.mode,shouldReloadData:{filterValue:S?.filterValue??R==="remote",sortInfo:S?.sortInfo??I==="remote",groupBy:S?.groupBy??w==="remote",pivotBy:S?.pivotBy??x==="remote"},isRowDisabled:A,rowSelection:d,cellSelection:p,groupMode:w,sortMode:I,filterMode:R,pivotMode:x,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 P=!n||n.originalDataArray!==t.originalDataArray,_=typeof e.livePaginationCursor=="function"?P?QT(e.livePaginationCursor,t):t.livePaginationCursor:e.livePaginationCursor;M.livePaginationCursor=_}if(t.devToolsDetected&&t.debugId){let P=dn.get(t.debugId);P&&(M={...M,...P})}return M}var tS=yt("DataSource:fullLazyLoad");function Yf(o,e,t){let{name:n,newValue:r}=o;n==="data"&&typeof r=="function"&&!e.groupRowsState&&(e.lazyLoad&&tS('"data" function prop has changed'),e.collapseGroupRowsOnDataFunctionChange!==!1&&(t.groupRowsState=new mt({collapsedRows:!0,expandedRows:[]})))}function qf(){return{rowSelection:(o,e)=>e.selectionMode==="single-row"?{callbackParams:[o,"single-row"]}:{callbackParams:[o.getState(),"multi-row"]},treeSelection:(o,e)=>{if(e.selectionMode==="single-row")return{callbackParams:[o,{selectionMode:"single-row"}]};let t=e.__apiRef.current,n=t.treeApi;return{callbackParams:[o.getState(),{treeSelectionState:o,prevTreeSelectionState:e.treeSelectionState,selectionMode:"multi-row",lastUpdatedNodeInfo:e.lastSelectionUpdatedNodePathRef.current,unfilteredTreePaths:e.unfilteredTreePaths,dataSourceApi:t,treeApi:n}]}},treeExpandState:(o,e)=>({callbackParams:[o.getState(),{nodeState:e.lastExpandStateInfoRef.current.state,nodePath:e.lastExpandStateInfoRef.current.nodePath,dataSourceApi:e.__apiRef.current}]}),cellSelection:(o,e)=>e.selectionMode==="single-cell"?{callbackParams:[o instanceof He?o.getState().selectedCells:null,"single-cell"]}:{callbackParams:[o.getState(),"multi-cell"]}}}function Xf(){return{sortInfo:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=fn(t,{sortInfo:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Le(()=>{e.livePaginationCursor=null})},groupBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=fn(t,{groupBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Le(()=>{e.livePaginationCursor=null})},pivotBy:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=fn(t,{pivotBy:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Le(()=>{e.livePaginationCursor=null})},filterValue:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=fn(t,{filterValue:o,livePaginationCursor:null},n());e.dataParams=r,t.livePagination&&Le(()=>{e.livePaginationCursor=null})},cursorId:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=fn(t,{__cursorId:o},n());e.dataParams=r},livePaginationCursor:(o,{actions:e,state:t})=>{let n=t.getDataSourceMasterContextRef.current,r=fn(t,{livePaginationCursor:o},n());e.dataParams=r},dataParams:(o,{state:e})=>At(o,e.dataParams,new Set(["changes","originalDataArray","masterRowInfo"]))?!1:(yt(Mn(e.debugId,"DataSource:dataParams"))("onDataParamsChange triggered because the following values have changed",o?.changes),!0)}}function Zf(o){return{originalDataArray:o.originalDataArray,groupRowsState:o.groupRowsState,groupBy:o.groupBy,pivotBy:o.pivotBy,sortInfo:o.sortInfo,filterValue:o.filterValue,livePaginationCursor:o.livePaginationCursor}}var wt=G(require("react"));function Wo(o){let e=Ve(),t=Me(e),n=!!e,r=n?e.masterRowInfo.id:"master",{contextValue:i,ContextComponent:a}=Os(o),{componentActions:l,componentState:s,assignState:c}=i;s.getDataSourceMasterContextRef.current=t;let u=Me(s),[d]=(0,wt.useState)(()=>Ef({getState:u,actions:l})),p={componentState:s,componentActions:l,getDataSourceMasterContext:t,getState:u,assignState:c,api:d},f=Me(i),m=Me(p),g=pr(),b=(0,wt.useCallback)(({children:h})=>(typeof h=="function"&&(h=h(u())),wt.default.createElement(a.Provider,{key:r,value:f()},wt.default.createElement(g.Provider,{value:m()},h))),[a,n,r]);return(0,wt.useLayoutEffect)(()=>{e&&e.registerDetail(p)},[]),(0,wt.useLayoutEffect)(()=>()=>{let h=u();h.onCleanup(h)},[]),Hf({componentState:s,componentActions:l,getComponentState:u}),(0,wt.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,wt.useEffect)(()=>{s.onReady?.(d)},[]),{DataSource:b,state:p.componentState}}var vt=class extends Ko{constructor(t){super(t);this.isRowDetailsExpanded=t=>!!this.isItemPositive(t)}getState(){let t=this.allPositive?!0:[...this.positiveMap?.keys()??[]],n=this.allNegative?!0:[...this.negativeMap?.keys()??[]];return{expandedRows:t,collapsedRows:n}}getPositiveFromState(t){return t.expandedRows}getNegativeFromState(t){return t.collapsedRows}areAllCollapsed(){return this.areAllNegative()}areAllExpanded(){return this.areAllPositive()}collapseAll(){this.makeAllNegative()}expandAll(){this.makeAllPositive()}isRowDetailsCollapsed(t){return!this.isRowDetailsExpanded(t)}setRowDetailsExpanded(t,n){return this.setItemValue(t,n)}collapseRowDetails(t){this.setRowDetailsExpanded(t,!1)}expandRowDetails(t){this.setRowDetailsExpanded(t,!0)}toggleRowDetails(t){this.toggleItem(t)}};var Ca=class Ca{constructor(e,t){this.keysInOrder=[];if(typeof e=="number")this.maxSize=e,this.currentMap=new Map;else if(this.maxSize=t??Ca.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentMap=new Map,n.forEach(([r,i])=>{this.set(r,i)})}else this.currentMap=new Map}values(){return this.currentMap.values()}get size(){return this.currentMap.size}delete(e){return this.currentMap.has(e)?(this.currentMap.delete(e),this.keysInOrder=this.keysInOrder.filter(t=>t!==e),!0):!1}has(e){return this.currentMap.has(e)}get(e){return this.currentMap.get(e)}set(e,t){if(this.has(e)&&this.delete(e),this.maxSize-this.currentMap.size<=0){let[r]=this.keysInOrder.splice(0,1);r!=null&&this.currentMap.delete(r)}return this.keysInOrder.push(e),this.currentMap.set(e,t),this}};Ca.DEFAULT_SIZE=10;var Sa=Ca;var Fs=class{add(e,t){}get(e){}delete(e){}has(e){return!1}},wa=class{constructor(e){this.storage=new Sa(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)}},Ns=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)}},jo=class{constructor(e){this.cacheStorage=e===!1?new Fs:e===!0?new Ns:typeof e=="number"?new wa(e):new wa(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 Qf=(e=>(e.INIT="INIT",e))(Qf||{});var{useManagedComponent:Os}=Et({debugName:"DataSource",initSetupState:Wf,forwardProps:$f,concludeReducer:Of,mapPropsToState:Uf,onPropChange:Yf,cleanup:jf,interceptActions:Xf(),mappedCallbacks:qf()});function nS(o){let{DataSource:e}=Wo(o);return Jf.createElement(e,null,o.children??null)}function oS(){let{rowInfoReducerResults:o}=on();return o}function rS(){let o=Ve();if(o)return o.masterRowInfo}function Ls(o){let{getComputed:e,getState:t,actions:n}=o,r=t().columnMenuVisibleForColumnId;if(!r)return;let i=e(),a=i.computedVisibleColumnsMap,l=i.computedColumnOrder;if(a.has(r)){n.columnMenuVisibleKey=Date.now();return}function s(f,m){let g=l[c+f*m],b=a.get(g);if(b&&b.renderMenuIcon!==!1)return g}let c=l.indexOf(r),u=0,d=-1,p;for(;!p&&u<l.length&&(u++,p=s(u,d),p||(d*=-1,p=s(u,d)),!p););return p&&(n.columnMenuVisibleForColumnId=p),p}function va(o,e){let{rowIndex:t,colIndex:n}=o,{rowIndex:r,colIndex:i}=e,[a,l]=n>i?[i,n]:[n,i],[s,c]=t>r?[r,t]:[t,r];return[{rowIndex:s,colIndex:a},{rowIndex:c,colIndex:l}]}function ks(o,e,t){let{rowsPerPage:n}=t;return n?Math.floor(o.rowIndex/n)===Math.floor(e.rowIndex/n):!0}function em(o,e,t){if(ks(o,e,t))throw"You should not call this when the positions are in the same page";let{rowsPerPage:n,columnsPerSet:r}=t;if(n===0)throw"rowsPerPage cannot be 0";let i=o,a=e;Math.floor(o.rowIndex/n)>Math.floor(e.rowIndex/n)&&(i=e,a=o);let{rowIndex:l,colIndex:s}=i,{rowIndex:c,colIndex:u}=a,d=Math.floor(l/n),p=Math.floor(c/n),f=l%n,m=c%n,g=Math.min(f,m),b=Math.max(f,m),h=[];for(let y=d;y<=p;y++)for(let S=g;S<=b;S++){let C=y*n+S;if(y===d)for(let T=s;T<r;T++)h.push({rowIndex:C,colIndex:T});else if(y===p)for(let T=0;T<=u;T++)h.push({rowIndex:C,colIndex:T});else for(let T=0;T<r;T++)h.push({rowIndex:C,colIndex:T})}return h}function iS(o,e){let t=new Set(o);return e.map(n=>t.has(n)?n:null).filter(n=>n!=null)}var zs=class{constructor(e){this.getCellSelectionPosition=e=>{let t=e.rowId??On(e.rowIndex,this.getDataSourceState)?.id,n=e.colId??this.getComputed().computedVisibleColumns[e.colIndex].id;return[t,n]};this.setRangeSelected=(e,t,n)=>{let r=this.getDataSourceState(),i=r.cellSelection;if(!i)return;let a=new He(i);a.debugId=r.debugId??"";let[l,s]=this.getCellSelectionPosition(e),[c,u]=this.getCellSelectionPosition(t),d=this.getComputed().computedVisibleColumnsMap.get(s),p=this.getComputed().computedVisibleColumnsMap.get(u);if(!d||!p)return;let f=d.computedVisibleIndex,m=p.computedVisibleIndex,g=On(l,this.getDataSourceState),b=On(c,this.getDataSourceState);if(!g||!b)return;let h=g.indexInAll,y=b.indexInAll,[S,C]=va({rowIndex:h,colIndex:f},{rowIndex:y,colIndex:m});for(let T=S.rowIndex;T<=C.rowIndex;T++)for(let v=S.colIndex;v<=C.colIndex;v++){let w={rowIndex:T,colIndex:v},[I,R]=this.getCellSelectionPosition(w);n?a.selectCell(I,R):a.deselectCell(I,R)}this.dataSourceActions.cellSelection=a};this.getCellSelectionPositionsWithFn=(e,t)=>{let n=pa(this.getDataSourceState),{computedVisibleColumns:r}=this.getComputed(),i=r.map(d=>d.id),a=new Set,l=[],s=new Set;n.filter(d=>{r.forEach(p=>{this.isCellSelected({rowId:d.id,colId:p.id})&&(a.has(p.id)||a.add(p.id),s.has(d.id)||(s.add(d.id),l.push(d)))})});let c=iS(Array.from(a),i),u=l.map(d=>c.map(p=>this.isCellSelected({rowId:d.id,colId:p})?e(d,p):t));return{columnIds:c,positions:u}};this.getAllCellSelectionPositions=()=>this.getCellSelectionPositionsWithFn((e,t)=>[e.id,t],null);this.mapCellSelectionPositions=(e,t)=>this.getCellSelectionPositionsWithFn(e,t);this.deselectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new He(t);n.debugId=e.debugId??"",n.deselectAll(),this.dataSourceActions.cellSelection=n};this.clear=()=>{this.deselectAll()};this.selectAll=()=>{let e=this.getDataSourceState(),t=e.cellSelection;if(!t)return;let n=new He(t);n.debugId=e.debugId??"",n.selectAll(),this.dataSourceActions.cellSelection=n};this.selectRange=(e,t)=>{this.setRangeSelected(e,t,!0)};this.deselectRange=(e,t)=>{this.setRangeSelected(e,t,!1)};this.isCellSelected=e=>{let[t,n]=this.getCellSelectionPosition(e);return this.getDataSourceState().cellSelection?.isCellSelected(t,n)??!1};this.selectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=e.clear?new He:new He(n);a.debugId=t.debugId??"",a.selectCell(r,i),this.dataSourceActions.cellSelection=a};this.deselectCell=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let[r,i]=this.getCellSelectionPosition(e),a=new He(n);a.debugId=t.debugId??"",a.deselectCell(r,i),this.dataSourceActions.cellSelection=a};this.selectColumn=(e,t)=>{t?.clear&&this.deselectAll();let n=this.getDataSourceState(),r=n.cellSelection;if(!r)return;let i=new He(r);i.debugId=n.debugId??"",i.selectColumn(e),this.dataSourceActions.cellSelection=i};this.deselectColumn=e=>{let t=this.getDataSourceState(),n=t.cellSelection;if(!n)return;let r=new He(n);r.debugId=t.debugId??"",r.deselectColumn(e),this.dataSourceActions.cellSelection=r};this.getComputed=e.getComputed,this.getDataSourceState=e.getDataSourceState,this.dataSourceActions=e.dataSourceActions}};function tm(o){return new zs(o)}function nm(o){let{dataSourceApi:e,getState:t,actions:n}=o,r={collapseAllDetails(){n.rowDetailState=new vt({collapsedRows:!0,expandedRows:[]})},expandAllDetails(){n.rowDetailState=new vt({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 vt(l);s.collapseRowDetails(i),a.lastRowToExpandRef.current=null,a.lastRowToCollapseRef.current=i,n.rowDetailState=s},expandRowDetail(i){let a=t(),l=a.rowDetailState;if(!l){console.error("Cannot expand row details via rowDetailState, as no props.rowDetailState is provided.");return}let s=new vt(l);s.expandRowDetails(i),a.lastRowToCollapseRef.current=null,a.lastRowToExpandRef.current=i,n.rowDetailState=s},toggleRowDetail(i){r.isRowDetailExpanded(i)?r.collapseRowDetail(i):r.expandRowDetail(i)}};return r}function Nn(o,e,t){return Math.min(Math.max(o,e),t)}function Ia(o,e,t){let n=o().dataArray,r=0,i=n.length-1,a=e;do{a+=t;let l=n[a];if(!l)return a<r?r:i;if(!l.rowDisabled)return a}while(a>=r&&a<=i);return Nn(a,r,i)}function aS(o,e){let{getState:t,getDataSourceState:n,actions:r,api:i,dataSourceApi:a}=o,{key:l}=e,s=n().dataArray,c=s.length,u=t(),{brain:d}=u,{activeRowIndex:p}=u;if(p==null)return!1;let{start:[f],end:[m]}=d.getRenderRange(),g=p,b=m-f-1,h=0,y=c-1,S={ArrowDown:()=>{p=Ia(n,p,1)},ArrowUp:()=>{p=Ia(n,p,-1)},ArrowLeft:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let v=d.rowsPerPage;p-v>=h?p=p-v:S.ArrowUp();return}return T&&T.isGroupRow?i.collapseGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.collapseRowDetail(T.id):!1},ArrowRight:()=>{let T=s[p];if(d.isHorizontalLayoutBrain){let v=d.rowsPerPage;p+v<=y?p=p+v:S.ArrowDown();return}return T&&T.isGroupRow?i.expandGroupRow(T.groupKeys):T&&i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.expandRowDetail(T.id):!1},Enter:()=>{let T=s[p];return T&&T.isGroupRow?i.toggleGroupRow(T.groupKeys):T&&T.isTreeNode&&T.isParentNode?a.treeApi.toggleNode(T.nodePath):i.rowDetailApi.isRowDetailEnabledForRow(T.id)?i.rowDetailApi.toggleRowDetail(T.id):!1},PageDown:()=>{p=Math.min(p+b,c-1)},PageUp:()=>{p=Math.max(p-b,h)},End:()=>{p=y},Home:()=>{p=h}},C=S[l];return C?(C(),g!==p?(r.activeRowIndex=p,!0):!1):!1}function Vs(o,e){let{api:t,getState:n,getComputed:r,getDataSourceState:i,dataSourceApi:a}=o,{key:l,shiftKey:s}=e,c=i().dataArray,u=n(),{activeCellIndex:d,brain:p}=u;if(!d)return!1;let[f,m]=d,{start:[g,b],end:[h,y]}=p.getRenderRange(),S=h-g-1,C=y-b-1,T=i().dataArray.length-1,v=r().computedVisibleColumns.length-1,w=0,I=0;f=Nn(f,0,T),m=Nn(m,0,v);let R={ArrowDown:()=>{f=Nn(f+1,w,T)},ArrowUp:()=>{f=Nn(f-1,w,T)},ArrowLeft:()=>{if(m===I)if(f!==w&&(m=v),p.isHorizontalLayoutBrain){let E=p.rowsPerPage;f-E>=w?f=f-E:R.ArrowUp()}else R.ArrowUp();else m=Nn(m-1,I,v)},ArrowRight:()=>{if(m===v)if(f!==T&&(m=I),p.isHorizontalLayoutBrain){let E=p.rowsPerPage;f+E<=T?f=f+E:R.ArrowDown()}else R.ArrowDown();else m=Nn(m+1,I,v)},Enter:()=>{let E=c[f];return E&&E.isGroupRow?t.toggleGroupRow(E.groupKeys):E&&E.isTreeNode&&E.isParentNode?a.treeApi.toggleNode(E.nodePath):E&&t.rowDetailApi.isRowDetailEnabledForRow(E.id)?t.rowDetailApi.toggleRowDetail(E.id):!1},PageDown:()=>{s?m=Math.min(m+C,v):f=Math.min(f+S,T)},PageUp:()=>{s?m=Math.max(m-C,I):f=Math.max(f-S,w)},End:()=>{s?m=v:f=T},Home:()=>{s?m=I:f=w}},x=R[l];return x?(x(),[f,m]):!1}function lS(o,e){let t=Vs(o,e);return t?(o.actions.activeCellIndex=t,!0):!1}var sS={ArrowUp:!0,ArrowDown:!0,ArrowLeft:!0,ArrowRight:!0,PageUp:!0,PageDown:!0,Home:!0,End:!0,Enter:!0," ":!0};function om(o,e){let{key:t}=e,{getState:n}=o,r=n(),{activeRowIndex:i,activeCellIndex:a,keyboardNavigation:l,cellContextMenuVisibleFor:s,contextMenuVisibleFor:c}=r;return s||c||!sS[t]?!1:i!=null&&l==="row"?aS(o,e):a!=null&&l==="cell"?lS(o,e):!1}var Gs=class{constructor(e){this.param=e}setKeyboardNavigation(e){this.param.actions.keyboardNavigation=e}setActiveCellIndex(e){this.param.actions.activeCellIndex=e}setActiveRowIndex(e){this.param.actions.activeRowIndex=e}gotoRowWithDirection(e){let{getDataSourceState:t,getState:n}=this.param,{activeRowIndex:r,keyboardNavigation:i}=n();if(i!=="row")return console.error("Keyboard navigation is not enabled for rows"),!1;if(r==null)return!1;let a=Ia(t,r,e);return a!==r?(this.param.actions.activeRowIndex=a,a):!1}gotoRow(e){return this.gotoRowWithDirection(e)}gotoNextRow(){return this.gotoRow(1)}gotoPreviousRow(){return this.gotoRow(-1)}gotoCell(e){let{direction:t}=e,n=t=="top"?"ArrowUp":t=="bottom"?"ArrowDown":t=="left"?"ArrowLeft":"ArrowRight",r=Vs(this.param,{key:n,shiftKey:!1});return r===!1?!1:(this.param.actions.activeCellIndex=r,r)}};function rm(o){return new Gs(o)}function im(o,e){return o.id?o.id===e.id:!!(o.field&&o.field===e.field)}var Hs=class{constructor(e){this.hideFilterOperatorMenu=()=>{this.actions.filterOperatorMenuVisibleForColumnId=null};this.setGroupRenderStrategy=e=>{this.actions.groupRenderStrategy=e};this.getColumnOrder=()=>this.getComputed().computedColumnOrder;this.getComputedColumnById=e=>this.getComputed().computedColumnsMap.get(e);this.getVisibleColumnOrder=()=>{let e=this.getColumnOrder(),t=this.getComputed().computedVisibleColumnsMap;return e.filter(n=>t.has(n))};this.persistEdit=async e=>{e=e??{};let{editingCell:t,editingValueRef:n}=this.getState();if(!t)return Promise.resolve(new Error("no edit in progress"));await new Promise(d=>requestAnimationFrame(d));let r=this.getComputed().computedColumnsMap.get(t.columnId),i=e.value??t.value;!t.active&&t.waiting!=="persist"&&(this.actions.editingCell={...t,active:!1,waiting:"persist"});let a={...Ct({rowIndex:t.rowIndex,columnId:t.columnId,...this.context,api:this}),value:i,initialValue:t.initialValue},l=i;n.current=null,r.getValueToPersist&&(l=await r.getValueToPersist(a)),a.value=l,t.value=l;let s=this.getState().persistEdit??(()=>{if(!a.column.field)return i;let d=this.getDataSourceState().primaryKey,p=a.data&&typeof d=="string"?{[d]:a.data[d],[a.column.field]:l}:{...a.data,[a.column.field]:l};return this.context.dataSourceApi.updateData(p)}),c;try{c=await s(a)}catch(d){c=d}let u=c instanceof Error?c:!0;return this.actions.editingCell={...t,active:!1,accepted:!1,waiting:!1,persisted:u},Promise.resolve(u)};this.clearEditInfo=()=>{this.actions.editingCell=null};this.isEditInProgress=()=>{let{editingCell:e}=this.getState();return e?e.active:!1};this.isEditorVisibleForCell=e=>{let{rowIndex:t,columnId:n}=e,{dataArray:r}=this.getDataSourceState(),{editingCell:i}=this.getState(),a=r[t];return!a||!i?!1:i.columnId===n&&i.primaryKey===a.id&&!!(i.active||i.waiting)};this.confirmEdit=e=>this.stopEdit({value:e});this.stopEdit=async e=>{let t=this.getState(),{editingCell:n,editingValueRef:r}=t;if(!n)return!0;e||(e={});let i=e.value??r.current;if(!e.cancel&&!e.reject){let{rowIndex:a,columnId:l}=n;this.actions.editingCell={...t.editingCell,value:i,active:!1,waiting:"accept"};let{computedColumnsMap:s}=this.getComputed(),c=s.get(l),u=t.shouldAcceptEdit??c.shouldAcceptEdit,d=u?u({...Ct({...this.context,api:this,dataSourceApi:this.context.dataSourceApi,columnId:l,rowIndex:a}),value:i,initialValue:n.initialValue}):!0;return await new Promise(p=>requestAnimationFrame(p)),Promise.resolve(d).then(p=>{if(p===!0)return this.actions.editingCell={...t.editingCell,active:!1,accepted:!0,persisted:!1,waiting:"persist",value:i},!0;throw p}).catch(p=>(p instanceof Error||(p=new Error(`Edit rejected: ${p}`)),this.actions.editingCell={...n,value:i,persisted:!1,active:!1,waiting:!1,accepted:p},{reject:p,value:i}))}return e.cancel&&n?.active?(this.actions.editingCell={...n,active:!1,cancelled:!0,waiting:!1,persisted:!1},{cancel:!0,value:i}):e.reject&&n?.active?(this.actions.editingCell={...n,value:i,active:!1,persisted:!1,waiting:!1,accepted:e.reject},{reject:e.reject,value:i}):!0};this.cancelEdit=()=>this.stopEdit({cancel:!0});this.rejectEdit=e=>this.stopEdit({reject:e});this.getColumnAtIndex=e=>this.getComputed().computedVisibleColumns[e]??null;this.isCellEditable=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,i=t??this.context.dataSourceApi.getIndexByPrimaryKey(n),{computedColumnsMap:a}=this.getComputed(),l=a.get(r);if(!l||!l.computedEditable||l.groupByForColumn)return Promise.resolve(!1);let s=this.getDataSourceState().dataArray[i];if(!s||s.isGroupRow)return Promise.resolve(!1);if(l.computedEditable===!0)return Promise.resolve(!0);let c=l.computedEditable(Ct({...this.context,api:this,columnId:r,rowIndex:i}));return typeof c=="boolean"?Promise.resolve(c):c};this.getColumnApi=e=>st(e,{...this.context,api:this});this.isColumnSortable=e=>this.getColumnApi(e)?.isSortable()??!1;this.getCellValue=e=>this.getCellValues(e)?.value??null;this.getCellValues=e=>{let{rowIndex:t,primaryKey:n,columnId:r}=e,{dataSourceApi:i,getState:a}=this.context,{computedColumnsMap:l}=this.getComputed(),s=t??i.getIndexByPrimaryKey(n),c=l.get(r),u=i.getRowInfoByIndex(s),d=u?.id;if(!u||!c)return c||console.warn(`No column found with id: "${r}"`),u||console.warn(`No row found with index: "${s}" or primary key: "${d}"`),null;let p=this,{isRowDetailEnabled:f}=a(),m=!f||typeof f=="function"&&!f(u)?!1:this.rowDetailApi.isRowDetailExpanded(u.id)?"expanded":"collapsed",g=Mo({column:c,rowInfo:u,columnsMap:l,context:{...this.context,api:p},rowDetailState:m});return{value:g.formattedValueContext.value,formattedValue:g.formattedValue,rawValue:g.formattedValueContext.rawValue}};this.getVerticalRenderRange=()=>{let e=this.getState().brain.getRenderRange();return{renderStartIndex:e.start[0],renderEndIndex:e.end[0]}};this.setColumnOrder=e=>{this.actions.columnOrder=e};this.setVisibilityForColumnGroup=(e,t)=>{let n={...this.getState().columnGroupVisibility};t?delete n[e]:n[e]=!1,this.actions.columnGroupVisibility=n};this.collapseAllGroupRows=()=>{let e=this.getDataSourceState(),t=new mt(e.groupRowsState);t.collapseAll(),this.dataSourceActions.groupRowsState=t};this.collapseGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowExpanded(e)?(this.toggleGroupRow(e),!0):!1;this.expandGroupRow=e=>this.getDataSourceState().groupRowsState.isGroupRowCollapsed(e)?(this.toggleGroupRow(e),!0):!1;this.toggleGroupRow=e=>{let t=this.getDataSourceState(),n=new mt(t.groupRowsState);if(n.toggleGroupRow(e),this.dataSourceActions.groupRowsState=n,t.lazyLoad){let r=[_n,...e],i=t.originalLazyGroupData.get(r);n.isGroupRowExpanded(e)?i?.cache||ao(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=Q.clone(t.lazyLoadCacheOfLoadedBatches),t.originalLazyGroupData.delete(r),this.dataSourceActions.originalLazyGroupDataChangeDetect=Vt())}};this.toggleSortingForColumn=(e,t)=>{if(!this.getComputed().computedColumnsMap.get(e))return;let r=this.getSortingForColumn(e);r===null?r=1:r=r===1?-1:null,this.setSortingForColumn(e,r,t)};this.getState=()=>this.context.getState();this.getComputed=()=>this.context.getComputed();this.getDataSourceState=()=>this.context.getDataSourceState();this.scrollCellIntoView=(e,t,n={offset:0})=>{let r=this.getState(),i=this.getComputed(),a=t;if(typeof t=="string"){let g=i.computedVisibleColumnsMap.get(t);if(!g)return!1;a=g.computedVisibleIndex}if(r.brain.isHorizontalLayoutBrain){n=n||{};let g=r.brain.getPageIndexForRow(e);n.horizontalLayoutPageIndex=g||0}let l=r.renderer.getScrollPositionForScrollColumnIntoView(a,n),s=r.renderer.getScrollPositionForScrollRowIntoView(e,n);if(!l||!s)return!1;let c={scrollLeft:l.scrollLeft,scrollTop:s.scrollTop},u=r.brain.getScrollPosition(),d=r.brain.scrollLeftMax,p=r.brain.scrollTopMax;if(d<0&&p<0)return!0;let f=c.scrollLeft>d+(n.offset||0),m=c.scrollTop>p+(n.offset||0);return f&&m?!1:(c.scrollLeft!==u.scrollLeft&&!f&&(r.scrollerDOMRef.current.scrollLeft=c.scrollLeft),c.scrollTop!==u.scrollTop&&!m&&(r.scrollerDOMRef.current.scrollTop=c.scrollTop),!0)};this.context=e,this.rowSelectionApi=xf({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState}),this.keyboardNavigationApi=rm({getState:e.getState,getDataSourceState:e.getDataSourceState,actions:e.actions,getComputed:e.getComputed,api:this,dataSourceApi:e.dataSourceApi}),this.rowDetailApi=nm({getState:e.getState,actions:e.actions,dataSourceApi:e.dataSourceApi}),this.cellSelectionApi=tm({dataSourceActions:e.dataSourceActions,getDataSourceState:e.getDataSourceState,getComputed:e.getComputed})}get actions(){return this.context.actions}get dataSourceActions(){return this.context.dataSourceActions}get dataSourceApi(){return this.context.dataSourceApi}focus(){this.getState().scrollerDOMRef.current?.focus()}hideContextMenu(){this.actions.contextMenuVisibleFor=null,this.actions.cellContextMenuVisibleFor=null}realignColumnContextMenu(e){let t={actions:this.actions,getState:this.getState,getComputed:this.getComputed},n=this.getState().columnMenuRealignDelay;(!n||n<0)&&(Ls(t),e?.()),setTimeout(()=>{this.isDestroyed()||(Ls(t),e?.())},n)}isDestroyed(){return!this.getState().domRef.current}async startEdit(e){let{columnId:t,rowIndex:n,primaryKey:r,value:i}=e,a=n??this.context.dataSourceApi.getIndexByPrimaryKey(r);return this.isCellEditable({rowIndex:a,columnId:t}).then(async l=>{if(l){let s=this.getDataSourceState().dataArray,u=this.getComputed().computedColumnsMap.get(t),d=s[a],p=i??Bd({column:u,rowInfo:d}),f=p;u.getValueToEdit&&(p=await u.getValueToEdit(Ct({...this.context,rowIndex:a,columnId:t,api:this}))),this.actions.editingCell={active:!0,accepted:!1,persisted:!1,columnId:t,value:p,initialValue:f,rowIndex:a,primaryKey:s[a]?.id}}return l})}setSortingForColumn(e,t,n){let{computedColumnsMap:r}=this.getComputed(),i=r.get(e);if(!i||this.getSortingForColumn(e)===t&&this.getDataSourceState().multiSort===!1)return;if(t===null){this.setSortInfoForColumn(e,null,n);return}let l=i.groupByForColumn,s=i.field,c=l?Array.isArray(l)?l:[l]:[],u=c.map(f=>f.valueGetter?m=>f.valueGetter({data:m,field:f.field}):f.field?f.field:f.groupField??void 0).filter(Bo);u.length&&(s=u);let d=i.computedSortType;c.length&&d===So&&(d=c.flatMap(m=>{let g=m.field??m.groupField,b=g?r.get(g):null;return b?b.computedSortType:So}));let p={dir:t,id:i.id,field:s,type:d};i.valueGetter&&(p.valueGetter=f=>i.valueGetter({data:f,field:i.field})),this.setSortInfoForColumn(e,p,n)}setSortInfoForColumn(e,t,n){let r=this.getDataSourceState(),i=this.getComputed().computedColumnsMap.get(e);if(!i)return;if(!r.multiSort){this.dataSourceApi.setSortInfo(t?[t]:null);return}let a=i.field,l={id:e,field:a},s=r.sortInfo?.slice()??[];if(t===null){s=s.filter(d=>!im(d,l)),this.dataSourceApi.setSortInfo(s);return}let c=!1;if((n?.multiSortBehavior??this.getState().multiSortBehavior)==="replace"){this.dataSourceApi.setSortInfo([t]);return}s=s.map(d=>c?d:im(d,l)?(c=!0,t):d),c||s.push(t),this.dataSourceApi.setSortInfo(s)}getSortTypeForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortType:null}getSortInfoForColumn(e){let t=this.getComputed().computedColumnsMap.get(e);return t?t.computedSortInfo:null}getSortingForColumn(e){let t=this.getSortInfoForColumn(e);return t?t.dir:null}setPinningForColumn(e,t){let n={...this.getState().columnPinning};t===!1?delete n[e]:n[e]=t,this.actions.columnPinning=n}setColumnFilter(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a;if(n.computedFilterValue)a={...n.computedFilterValue,filter:{...n.computedFilterValue.filter}};else{let l=n.computedFilterType;if(!i[l])return;let s={filter:{type:l,value:t,operator:i[l].defaultOperator},valueGetter:n.valueGetter};(n.field||typeof n.groupByForColumn=="string")&&(s.field=n.field||n.groupByForColumn),a=s}a.id=n.id,a.filter.value=t,this.setFilterValueForColumn(e,a)}setColumnFilterOperator(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let r=this.getDataSourceState(),{filterTypes:i}=r,a=n.computedFilterType,l=i[a].operators,s=l.find(d=>d.name===t)??l.find(d=>d.name===i[a].defaultOperator),c=s.name,u;n.computedFilterValue?(u={...n.computedFilterValue,filter:{...n.computedFilterValue.filter,operator:c}},s.defaultFilterValue!==void 0&&(u.filter.value=s.defaultFilterValue)):(u={filter:{operator:c,type:a,value:s.defaultFilterValue!==void 0?s.defaultFilterValue:[...i[a].emptyValues.values()][0]},valueGetter:n.valueGetter},n.field&&(u.field=n.field)),u.id=n.id,this.setFilterValueForColumn(e,u)}setFilterValueForColumn(e,t){let n=this.getComputed().computedColumnsMap.get(e);if(!n)return;let i=this.getDataSourceState().filterValue??[],a=!1;i=i.map(l=>l===n.computedFilterValue?(a=!0,t):l),a||i.push(t),this.dataSourceActions.filterValue=i}removeColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let r=this.getDataSourceState().filterValue??[],i=!1;r=r.filter(a=>a===t.computedFilterValue?(i=!0,!1):!0),i&&(this.dataSourceActions.filterValue=r)}clearColumnFilter(e){let t=this.getComputed().computedColumnsMap.get(e);if(!t)return;let n=this.getDataSourceState(),r=n.filterValue??[],i=!1;r=r.map(a=>{if(a===t.computedFilterValue){let l=t.computedFilterValue.filter.type,s=n.operatorsByFilterType[l],c=n.filterTypes[l];if(i=!0,!c)return null;let u=a.filter.operator??c?.defaultOperator,p=s[u].defaultFilterValue??(c.emptyValues||[])[0]??void 0;return{...a,filter:{...a.filter,operator:u,value:p}}}return a}).filter(Bo),i&&(this.dataSourceActions.filterValue=r)}setVisibilityForColumn(e,t){let n={...this.getState().columnVisibility};t?delete n[e]:n[e]=!1,this.actions.columnVisibility=n}getVisibleColumnsCount(){return this.getComputed().computedVisibleColumns.length}setColumnVisibility(e){this.actions.columnVisibility=e}get scrollContainer(){return this.getState().scrollerDOMRef.current}get scrollLeftMax(){return this.getState().brain.scrollLeftMax}get scrollTopMax(){return this.getState().brain.scrollTopMax}get scrollLeft(){return this.getState().brain.getScrollPosition().scrollLeft}set scrollLeft(e){let t=this.getState();t.scrollerDOMRef.current.scrollLeft=Math.max(e,0)}get scrollTop(){return this.getState().brain.getScrollPosition().scrollTop}set scrollTop(e){let t=this.getState();t.scrollerDOMRef.current.scrollTop=Math.max(e,0)}scrollRowIntoView(e,t={offset:0}){let n=this.getState(),r=this.getComputed(),i=n.brain.getScrollPosition(),a=t.columnId,l;!a&&n.brain.isHorizontalLayoutBrain&&r.computedVisibleColumns.length>0&&(a=r.computedVisibleColumns[Math.ceil(r.computedVisibleColumns.length/2)].id,l=r.computedVisibleColumnsMap.get(a)?.computedVisibleIndex);let s=n.renderer.getScrollPositionForScrollRowIntoView(e,{...t,colIndex:l});if(!s)return!1;let c=n.brain.scrollTopMax,u=s.scrollLeft!==i.scrollLeft,d=s.scrollTop<=c+(t.offset||0);return!d&&!u?!1:(d&&s.scrollTop!==i.scrollTop&&(n.scrollerDOMRef.current.scrollTop=s.scrollTop),u&&(n.scrollerDOMRef.current.scrollLeft=s.scrollLeft),!0)}scrollColumnIntoView(e,t={offset:0}){let n=this.getState(),i=this.getComputed().computedVisibleColumnsMap.get(e);if(!i)return!1;let a=i.computedVisibleIndex,l=n.renderer.getScrollPositionForScrollColumnIntoView(a,t);if(!l)return!1;let s=n.brain.getScrollPosition(),c=n.brain.scrollLeftMax;return l.scrollLeft>c+(t.offset||0)?!1:(l.scrollLeft!==s.scrollLeft&&(n.scrollerDOMRef.current.scrollLeft=l.scrollLeft),!0)}};function am(o){return new Hs(o)}var lo=require("react");var cS=10;function uS(o,e){let{includeHeader:t,columnsToResize:n,columnsToSkip:r}=e,i=`.${Xn} > .${ql}`,a=o.current?.querySelectorAll(i),l={},s={};return a&&a.length&&a.forEach(c=>{let u=c.parentElement,d=u.matches(`.${Un}`);if(t===!1&&d)return;let p=u.getAttribute("data-column-id"),f=c.cloneNode(!0);f.style.visibility="hidden",f.style.pointerEvents="none",f.classList.remove(...Ut.split(" ")),f.style.position="absolute",f.style.width="auto",u.appendChild(f);let m=f.offsetWidth;if(u.removeChild(f),!s[p]){let g=we().getComputedStyle(u);s[p]=parseInt(g.paddingLeft,10)+parseInt(g.paddingRight,10)+parseInt(g.borderLeftWidth,10)+parseInt(g.borderRightWidth,10)+cS}if(m+=s[p],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=we().getComputedStyle(h);g+=parseInt(S.marginLeft,10)+parseInt(S.marginRight,10)}}}),m+=g}r&&r.has(p)||n&&!n.has(p)||(l[p]=Math.max(m,l[p]||0))}),l}function lm(){let{getComponentState:o,componentActions:e,componentState:{domRef:t,ready:n,autoSizeColumnsKey:r,brain:i}}=$e(),[a,l]=(0,lo.useState)(0),s=typeof r=="object"?r.key:r,c=Me(s),u=(0,lo.useRef)(null);(0,lo.useEffect)(()=>{if(c()==null)return;let{current:p}=u,f=()=>{r!==p&&l(a+1)};return i.onRenderRangeChange(f)},[i]),(0,lo.useEffect)(()=>{if(s==null)return;let{autoSizeColumnsKey:d}=o(),p,f,m=!0;typeof d=="object"&&(d.columnsToResize&&(p=new Set(d.columnsToResize)),d.columnsToSkip&&(f=new Set(d.columnsToSkip)),m=d.includeHeader??m),u.current=s;let g=uS(t,{includeHeader:m,columnsToResize:p,columnsToSkip:f}),b=Object.keys(g);if(!b.length)return;let h=o().columnSizing,y={...h},S=!1;b.forEach(C=>{y[C]={width:g[C]},S=S||y[C].width!==h[C]?.width}),S&&(e.columnSizing=y)},[s,n,a])}var Uo=require("react");var Ra=class{constructor(e){this.multiSelectStartPosition={rowIndex:0,colIndex:0};this.getPrimaryKeyByIndex=e.getPrimaryKeyByIndex,this.getColumnIdByIndex=e.getColumnIdByIndex}getCellSelectionPosition(e){let{rowIndex:t,colIndex:n}=e,r=this.getPrimaryKeyByIndex(t),i=this.getColumnIdByIndex(n);if(!(r===void 0||!i))return[r,i]}set cellSelectionState(e){this._cellSelectionState=e}get cellSelectionState(){return this._cellSelectionState}resetClick(e){this.cellSelectionState.deselectAll();let t=this.getCellSelectionPosition(e);t&&(this.cellSelectionState.deselectAll(),this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0)}singleAddClick(e){let t=this.getCellSelectionPosition(e);if(t)if(this.cellSelectionState.isCellSelected(...t)){this.cellSelectionState.deselectCell(...t);let n={rowIndex:e.rowIndex+1,colIndex:e.colIndex};this.getCellSelectionPosition(n)&&(this.multiSelectStartPosition=n)}else this.cellSelectionState.selectCell(...t),this.multiSelectStartPosition=e,this.multiSelectEndPosition=void 0}multiSelectClick(e,t){!this.multiSelectStartPosition||!this.getCellSelectionPosition(e)||(this.multiSelectEndPosition&&this.deselectRange(this.multiSelectStartPosition,this.multiSelectEndPosition,t),this.selectRange(this.multiSelectStartPosition,e,t),this.multiSelectEndPosition=e)}setRangeSelected(e,t,n,r){if(r.horizontalLayout&&!ks(e,t,r)){em(e,t,{rowsPerPage:r.rowsPerPage,columnsPerSet:r.columnsPerSet}).forEach(u=>{let d=this.getCellSelectionPosition({rowIndex:u.rowIndex,colIndex:u.colIndex});d&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))});return}let[i,a]=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&&(n?this.cellSelectionState.selectCell(...d):this.cellSelectionState.deselectCell(...d))}}deselectRange(e,t,n){this.setRangeSelected(e,t,!1,n)}selectRange(e,t,n){this.setRangeSelected(e,t,!0,n)}};function sm(o,e){return o<e?[o,e]:[e,o]}var xa=class{constructor(e){this.multiSelectStartIndex=0;this.getIdForIndex=e.getIdForIndex,this.isRowDisabledAt=e.isRowDisabledAt}set rowSelectionState(e){this._rowSelectionState=e}get rowSelectionState(){return this._rowSelectionState}selectRange(e,t){let[n,r]=sm(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.selectRow(l)}}deselectRange(e,t){let[n,r]=sm(e,t),i=this.rowSelectionState;for(let a=n;a<=r;a++){let l=this.getIdForIndex(a);this.isRowDisabledAt(a)||i.deselectRow(l)}}resetClick(e){this.rowSelectionState.deselectAll();let t=this.getIdForIndex(e);this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e,this.multiSelectEndIndex=void 0}singleAddClick(e){let t=this.getIdForIndex(e);if(this.rowSelectionState.isRowSelected(t))this.rowSelectionState.deselectRow(t),this.rowSelectionState.isRowSelected(this.getIdForIndex(e+1))&&(this.multiSelectStartIndex=e+1);else{this.rowSelectionState.selectRow(t),this.multiSelectStartIndex=e;let n;for(let r=e-1;r>=0;r--){let i=this.getIdForIndex(r);if(this.rowSelectionState.isRowSelected(i))n=r;else break}this.multiSelectEndIndex=n}}multiSelectClick(e){this.multiSelectEndIndex!=null&&this.deselectRange(this.multiSelectStartIndex,this.multiSelectEndIndex),this.selectRange(this.multiSelectStartIndex,e),this.multiSelectEndIndex=e}};var cm=require("react");function um(o){let{getState:e}=De();return(0,cm.useMemo)(()=>o.filter(r=>typeof r.rowspan=="function").length?({rowIndex:r,colIndex:i})=>{let a=e().dataArray,l=a[r];if(!l)return 1;let s=l.data,c=o[i];return!c||!c.rowspan?1:c.rowspan({column:c,data:s,dataArray:a,rowInfo:l,rowIndex:r})}:void 0,[o])}var dm=require("react");var sk=yt("useColumnSizeFn");function pm(o){return(0,dm.useCallback)(t=>{let n=o[t];return n?n.computedWidth:0},[o])}var Ht=require("react");var Ln=require("react");var dS={scrollLeft:0,scrollTop:0},Wr=class{constructor(){this.scrollPosition=dS;this.onScrollFns=[];this.getScrollPosition=()=>this.scrollPosition;this.onScroll=e=>(this.onScrollFns.push(e),()=>{this.onScrollFns=this.onScrollFns.filter(t=>t!==e)});this.setScrollPosition=e=>{this.scrollPosition=e,this.notifyScrollChange()};this.destroy=()=>{this.onScrollFns=[]}}notifyScrollChange(){let{scrollPosition:e}=this,t=this.onScrollFns;for(let n=0,r=t.length;n<r;n++)t[n](e)}};function fm(o,e){let t=new Map;function n(r){return e[r]!==!1}return Object.keys(o).forEach(r=>{let a=o[r].columnGroup,l=0;for(n(r)||(l=-1);a;){let s=o[a];if(!s)break;n(a)&&l++,a=s.columnGroup}t.set(r,l)}),t}var mm=G(require("react"));function gm(o){return(e,t)=>mm.createElement(o,{key:e.id,rowInfo:e,cache:t})}var jr=class extends Jn{constructor(t,n){super(`${t}:HorizontalLayout`);this.visiblePageCount=0;this.isHorizontalLayoutBrain=!0;this._totalPageCount=0;this.pageWidth=0;this.initialCols=0;this.initialRows=0;this.initialColWidth=0;this.colWidth=()=>10;this.getColWidth=t=>typeof this.initialColWidth=="number"?this.initialColWidth:this.initialColWidth(t%this.initialCols);this.onTotalPageCountChangeFns=new Set;this.onTotalPageCountChange=t=>(this.onTotalPageCountChangeFns.add(t),()=>{this.onTotalPageCountChangeFns.delete(t)});this.options=n,this.options.masterBrain&&this.options.masterBrain.onTotalPageCountChange(()=>{this.updateRenderCount({horizontal:!0,vertical:!0})})}computeDirectionalRenderCount(t,n,r,i){if(t==="vertical"||typeof n=="number")return super.computeDirectionalRenderCount(t,n,r,i);let a=0,l=i.width,s=Math.floor(l/this.pageWidth);a+=s*this.initialCols;let c=l-s*this.pageWidth,u=[];for(let d=0;d<this.initialCols;d++)u.push(this.getItemSize(d,t));return a+=ji(c,u.concat(u)),t==="horizontal"?this.maxHorizontalRenderCount=a:this.maxVerticalRenderCount=a,a=Math.min(r,a),a}getRowIndexInPage(t){return this.rowsPerPage?t%this.rowsPerPage:t}getInitialCols(){return this.initialCols}getInitialRows(){return this.initialRows}getPageIndexForRow(t){return Math.floor(t/this.rowsPerPage)}getMatrixCoordinatesForHorizontalLayoutPosition(t){let n=t.rowIndex,r=t.colIndex;return t.rowIndex>=this.rowsPerPage&&this.rowsPerPage>0&&(n=t.rowIndex%this.rowsPerPage,r=Math.floor(t.rowIndex/this.rowsPerPage)*this.initialCols+r),{rowIndex:n,colIndex:r}}getHorizontalLayoutPositionFromMatrixCoordinates(t){let n=t.rowIndex,r=t.colIndex;if(t.colIndex>=this.initialCols&&this.initialCols>0){let i=Math.floor(t.colIndex/this.initialCols);r=t.colIndex-i*this.initialCols,n=this.rowsPerPage*i+t.rowIndex}return{colIndex:Math.min(r,this.initialCols),rowIndex:this.options.isHeader?n:Math.min(n,this.initialRows)}}update(t){let{rows:n,cols:r,rowHeight:i,colWidth:a,width:l,height:s}=t,c=typeof l=="number",u=typeof s=="number",d=c&&l!==this.availableWidth,p=u&&s!==this.availableHeight;d&&(this.availableWidth=l,this.availableRenderWidth=l),p&&(this.availableHeight=s,this.availableRenderHeight=s),(d||p)&&this.notifyAvailableSizeChange();let f=typeof n=="number",m=typeof r=="number",g=f&&n!==this.initialRows,b=m&&r!==this.initialCols;f&&g&&(this.initialRows=n,this.rows=n),m&&b&&(this.initialCols=r,this.cols=r);let h=i!=null,y=a!=null,S=h&&i!==this.rowHeight,C=y&&a!==this.initialColWidth;h&&(this.rowHeight=i),y&&(this.initialColWidth=a,this.colWidth=this.getColWidth);let T=g||S||p,v=b||C||d||T;(v||T)&&this.updateRenderCount({horizontal:v,vertical:T})}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=ln){let n=this.getInitialRowHeight(),r=0;for(let a=0;a<this.initialCols;a++)r+=this.getColWidth(a);this.pageWidth=r,this.rowsPerPage=Math.floor(this.availableHeight/n);let i=!1;if(!this.options.masterBrain){let a=this.totalPageCount;this.totalPageCount=this.rowsPerPage?Math.ceil(this.initialRows/this.rowsPerPage):0,a!=this.totalPageCount&&(i=!0)}this.visiblePageCount=this.totalPageCount&&this.pageWidth?Math.max(Math.ceil(this.availableWidth/this.pageWidth),1):1,this.availableRenderHeight=this.visiblePageCount*this.rowsPerPage*n,this.cols=Math.max(this.totalPageCount*this.initialCols,this.initialCols),this.rows=this.rowsPerPage,super.doUpdateRenderCount(t),i&&this.notifyTotalPageCountChange()}notifyTotalPageCountChange(){if(this.destroyed)return;let t=this.onTotalPageCountChangeFns;t.forEach(n=>{Le(()=>{this.destroyed||t.has(n)&&n(this.totalPageCount)})})}getVirtualColIndex(t,n){return this.initialCols*(n?.pageIndex??0)+t}destroy(){this.destroyed||(super.destroy(),this.options.masterBrain=void 0,this.onTotalPageCountChangeFns.clear())}getVirtualizedContentSizeFor(t){return t==="vertical"?this.getInitialRowHeight()*this.rowsPerPage:this.pageWidth*this.totalPageCount}};var hm={};function Ks(o){return`.${Xt}[data-row-index${o?`="${o.rowIndex}"`:""}][data-col-index${o?`="${o.colIndex}"`:""}]`}function Bs(o,e){let t=Mn(o),n=e?new jr(t,{isHeader:!1}):new Jn(t),r=`${t}:header`,i=e?new jr(r,{isHeader:!0,masterBrain:n}):new Jn(r);n.onScroll(u=>{i.setScrollPosition({scrollLeft:u.scrollLeft,scrollTop:0})});let{renderer:a,onRenderUpdater:l}=Or(n),{renderer:s,onRenderUpdater:c}=Or(i);return n.onAvailableSizeChange(u=>{i.update({width:u.width})}),{brain:n,headerBrain:i,renderer:a,onRenderUpdater:l,headerRenderer:s,headerOnRenderUpdater:c}}function bm({debugId:o,wrapRowsHorizontally:e}){let t={},{brain:n,headerBrain:r,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s}=Bs(o,!!e),c=(0,Ln.createRef)();return{debugWarnings:new Map,renderer:i,onRenderUpdater:a,headerRenderer:l,headerOnRenderUpdater:s,devToolsDetected:!!globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__,propsCache:new Map([]),lastRowToCollapseRef:{current:null},lastRowToExpandRef:{current:null},cellContextMenuVisibleFor:null,contextMenuVisibleFor:null,columnMenuVisibleForColumnId:null,columnMenuVisibleKey:0,filterOperatorMenuVisibleForColumnId:null,getDOMNodeForCell:u=>{if(!c.current)return null;let d=Ks(u);return c.current.querySelector(d)||null},brain:n,headerBrain:r,domRef:c,columnMenuTargetRef:(0,Ln.createRef)(),editingValueRef:(0,Ln.createRef)(),scrollerDOMRef:(0,Ln.createRef)(),portalDOMRef:(0,Ln.createRef)(),focusDetectDOMRef:(0,Ln.createRef)(),activeCellIndicatorDOMRef:(0,Ln.createRef)(),onColumnMenuClick:be(),cellContextMenu:be(),contextMenu:be(),onFilterOperatorMenuClick:be(),flashingDurationCSSVarValue:null,onFlashingDurationCSSVarChange:be(),onRowHeightCSSVarChange:be(),onRowDetailHeightCSSVarChange:be(),onColumnHeaderHeightCSSVarChange:be(),cellClick:be(),cellMouseDown:be(),keyDown:be(),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 Wr,pinnedEndScrollListener:new Wr,columnsWhenInlineGroupRenderStrategy:void 0,editingCell:null,forceBodyRerenderTimestamp:0}}var ym=o=>({debugId:1,scrollTopKey:1,components:1,id:1,loadingText:1,pivotColumns:1,groupColumn:1,onReady:1,domProps:1,onKeyDown:1,onCellClick:1,onCellDoubleClick:1,focusedClassName:1,focusedWithinClassName:1,focusedStyle:1,focusedWithinStyle:1,onSelfFocus:1,onFocusWithin:1,onSelfBlur:1,onBlurWithin:1,onContextMenu:1,onCellContextMenu:1,onRenderRangeChange:1,onRowMouseEnter:1,onRowMouseLeave:1,onScrollToTop:1,onScrollToBottom:1,onScrollStop:1,scrollToBottomOffset:1,getColumnMenuItems:1,getCellContextMenuItems:1,getContextMenuItems:1,columnPinning:1,editable:1,columnDefaultEditable:1,columnDefaultFilterable:1,columnDefaultGroupable:1,columnDefaultSortable:1,keyboardShortcuts:1,rowStyle:1,cellStyle:1,rowProps:1,rowClassName:1,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 jo(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??hm,columnGroupVisibility:e=>e??hm,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 pS(o){let{groupBy:e,groupColumn:t,groupRenderStrategy:n}=o;return n||(t!=null&&typeof t=="object"?"single-column":(e.filter(i=>i.column).length,"multi-column"))}var Tm=o=>{o.brain.destroy(),o.headerBrain.destroy(),o.renderer.destroy(),o.headerRenderer.destroy(),o.onRenderUpdater.destroy(),o.headerOnRenderUpdater.destroy(),o.onFlashingDurationCSSVarChange.destroy(),o.onRowHeightCSSVarChange.destroy(),o.onColumnHeaderHeightCSSVarChange.destroy(),o.onColumnMenuClick.destroy(),o.onFilterOperatorMenuClick.destroy(),o.domRef.current=null,o.columnMenuTargetRef.current=null,o.scrollerDOMRef.current=null,o.portalDOMRef.current=null,o.onRowDetailHeightCSSVarChange.destroy(),o.pinnedEndScrollListener.destroy(),o.pinnedStartScrollListener.destroy()};function Sm(o){return o.reduce((e,t,n)=>{let r={groupBy:t,groupIndex:n};return t.field?e.set(t.field,r):t.groupField&&e.set(t.groupField,r),e},new Map)}var Pa=new WeakMap;function Cm(){return{rowDetailState:(o,e)=>({callbackParams:[o,{expandRow:e.lastRowToExpandRef.current,collapseRow:e.lastRowToCollapseRef.current}]})}}var wm=o=>{let{props:e,state:t,oldState:n,parentState:r}=o,i=t.pivotColumnGroups||t.columnGroups,a=t.columnGroups&&t.columnGroups!=n?.columnGroups||t.columnGroups&&t.columnGroupVisibility!=n?.columnGroupVisibility||t.pivotColumnGroups&&t.pivotColumnGroups!=n?.pivotColumnGroups?fm(i,t.columnGroupVisibility):t.columnGroupsDepthsMap,l=r?.groupBy,s=pS({groupRenderStrategy:e.groupRenderStrategy,groupBy:l,groupColumn:e.groupColumn}),c,u=e.rowDetailRenderer,d=e.components?.RowDetail;if(!u&&d){let b=Pa.get(d);b||(b=gm(d),Pa.set(d,b)),u=b}u&&(c=e.rowDetailState||t.rowDetailState||e.defaultRowDetailState,c&&!(c instanceof vt)&&(c=new vt(c)),c=c||new vt({expandedRows:[],collapsedRows:!0}));let p=t.columnsWhenGrouping||t.columnsWhenInlineGroupRenderStrategy||t.columns,f=c?e.isRowDetailExpanded:void 0;!f&&c&&(f=Pa.get(c),f||(f=b=>c.isRowDetailsExpanded(b.id),typeof c=="object"&&Pa.set(c,f)));let m=u?e.isRowDetailEnabled||!0:!1,g={isTree:r.isTree,rowDetailRenderer:u,rowDetailState:c,isRowDetailExpanded:f,isRowDetailEnabled:m,showColumnFilters:e.showColumnFilters??!!r.filterValue,controlledColumnVisibility:!!e.columnVisibility,groupRenderStrategy:s,groupBy:l,computedColumns:p,initialColumns:e.columns,keyboardNavigation:e.keyboardNavigation??(t.activeCellIndex!=null?"cell":t.activeRowIndex!=null?"row":"cell"),columnHeaderCssEllipsis:e.columnHeaderCssEllipsis??e.columnCssEllipsis??!0,columnGroupsDepthsMap:a,columnGroupsMaxDepth:a!=t.columnGroupsDepthsMap?Math.max(...a.values(),-1):t.columnGroupsMaxDepth,computedColumnGroups:i,rowHeightCSSVar:typeof e.rowHeight=="string"?e.rowHeight:"",rowDetailHeightCSSVar:typeof e.rowDetailHeight=="string"?e.rowDetailHeight:"",columnHeaderHeightCSSVar:typeof e.columnHeaderHeight=="string"?e.columnHeaderHeight||ue.components.Header.columnHeaderHeight:""};if(t.devToolsDetected&&t.debugId){let b=un.get(t.debugId);b&&(g={...g,...b})}return g};function vm(o,e){let t={};return Object.keys(o).forEach(n=>{let r=o[n],i=r;if(!i.groupByForColumn||Array.isArray(i.groupByForColumn))return;let{groupByForColumn:a}=i,l=a.field||a.groupField;l&&e.get(l)&&(t[n]=r)}),t}function Im(o){let{hideEmptyGroupColumns:e,groupByMap:t,computedGroupColumns:n,groupRowsIndexesInDataArray:r,dataArray:i,groupBy:a}=o,l={...o.columnVisibility};if(!e)return Object.keys(n).forEach(d=>{l[d]===!1&&delete l[d]}),l;if(!r||!r.length)return l;let s=a.length,c=0,u=r.length;for(let d=0;d<u;d++){let p=r[d],f=i[p];if(!f.isTreeNode&&f.isGroupRow&&(c=Math.max(c,f.groupNesting-1),c===s-1))break}return Object.keys(n).forEach(d=>{let p=n[d],{groupByForColumn:f}=p;if(Array.isArray(f))return;let m=f.field||f.groupField;if(!m)return;t.get(m).groupIndex>c&&e?l[d]!==!1&&(l[d]=!1):l.hasOwnProperty(d)&&delete l[d]}),l}var Rm=require("react");function Ws(){let{getState:o,componentActions:e,getDataSourceMasterContext:t}=De();return(0,Rm.useCallback)(r=>{let i=o(),a=new mt(i.groupRowsState);if(a.toggleGroupRow(r),e.groupRowsState=a,i.lazyLoad){let l=[_n,...r],s=i.originalLazyGroupData.get(l);a.isGroupRowExpanded(r)?s?.cache||ao(i.data,i,e,{groupKeys:r},t()):s?.cache||(i.lazyLoadCacheOfLoadedBatches.getKeysStartingWith(r).forEach(u=>{i.lazyLoadCacheOfLoadedBatches.delete(u)}),e.lazyLoadCacheOfLoadedBatches=Q.clone(i.lazyLoadCacheOfLoadedBatches),i.originalLazyGroupData.delete(l),e.originalLazyGroupDataChangeDetect=Vt())}},[])}function fS(o){return(0,Ht.useMemo)(()=>Sm(o),[o])}function xm(){let{componentState:{groupBy:o},componentActions:e}=De(),{componentState:{groupRenderStrategy:t,pivotTotalColumnPosition:n,pivotGrandTotalColumnPosition:r}}=$e();(0,Ht.useEffect)(()=>{e.generateGroupRows=t!=="inline"},[t]),(0,Ht.useEffect)(()=>{e.pivotTotalColumnPosition=n},[n]),(0,Ht.useEffect)(()=>{r!=null&&(e.pivotGrandTotalColumnPosition=r)},[r]);let i=fS(o);mS(i);let{toggleGroupRow:a}=gS();return hS(i),{toggleGroupRow:a}}function mS(o){let e=Ws(),{componentActions:t,componentState:{columns:n,groupRenderStrategy:r,isTree:i}}=$e();function a(l,s,c,u){let d={};if(c==="inline")return Object.keys(l).forEach(p=>{let f=l[p],m={},g=s.get(f.field);if(g&&c==="inline"){let{groupIndex:h}=g;m={groupByForColumn:g.groupBy,field:g.groupBy?.field,valueGetter:g.groupBy?.valueGetter,valueFormatter:({rowInfo:y})=>y.isGroupRow?y.groupKeys?.[h]:y.value,rowspan:({rowInfo:y,dataArray:S})=>{if(y.isTreeNode||!y.isGroupRow)return 1;let C=S[y.indexInAll-1]||{indexInParentGroups:[]};if(!C||!C.dataSourceHasGrouping)return 1;let T=C.indexInParentGroups||[],v=y.indexInParentGroups||[],w=!1;for(let x=0;x<=h;x++){let E=T[x];if(v[x]!==E){w=!0;break}}if(!w)return 1;let I=y.parents[h];return I?I.groupCount-(I.collapsedChildrenCount||0)+(I.collapsedGroupsCount||0):1},renderGroupIcon:Mi({groupIndexForColumn:h,groupRenderStrategy:c,toggleGroupRow:u,initialRenderGroupIcon:f.renderGroupIcon}),render:Di({groupIndexForColumn:h,groupRenderStrategy:c})}}let b={...m,...f};d[p]=b}),Object.keys(d).length===0?void 0:d}(0,Ht.useEffect)(()=>{(()=>{t.columnsWhenInlineGroupRenderStrategy=i?void 0:a(n,o,r,e)})()},[n,o,r,e])}function gS(){let{componentState:{groupBy:o,pivotBy:e,selectionMode:t}}=De(),{componentActions:n,componentState:{columns:r,groupColumn:i,hideColumnWhenGrouped:a,groupRenderStrategy:l,pivotColumns:s,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d},getComponentState:p}=$e(),f=Ws();return(0,Ht.useEffect)(()=>{(()=>{let{columns:g,groupColumnIds:b}=bS({columns:r,groupColumn:i,pivotColumn:c,pivotTotalColumnPosition:u,pivotGrandTotalColumnPosition:d,groupRenderStrategy:l==="inline"?"single-column":l,groupBy:o,pivotBy:e,pivotColumns:s,toggleGroupRow:f,selectionMode:t});n.columnsWhenGrouping=g;let h=p().columnOrder;if(b.length&&Array.isArray(h)){let y=new Set(h),S=!1;b.forEach(C=>{y.has(C)||(S=!0,h=[C,...h])}),S&&(n.columnOrder=h)}})()},[r,o,e,t,a,i,l,s,u,c]),{toggleGroupRow:f}}function hS(o){let{componentState:{dataArray:e,groupRowsIndexesInDataArray:t,groupBy:n,groupRowsState:r,originalLazyGroupDataChangeDetect:i},getState:a}=De(),{getComponentState:l,componentActions:s,componentState:{columnTypes:c,computedColumns:u,hideColumnWhenGrouped:d,hideEmptyGroupColumns:p,groupRenderStrategy:f}}=$e();(0,Ht.useLayoutEffect)(()=>{if(f!=="multi-column")return;let m=l(),g=vm(u,o),b=Im({computedGroupColumns:g,columnVisibility:m.columnVisibility,hideEmptyGroupColumns:p,groupRowsIndexesInDataArray:t,dataArray:e,groupBy:n,groupByMap:o});At(m.columnVisibility,b)||(s.columnVisibility=b)},[a,f,i,n,o,u,p?e:null,p?r:null,p?t:null,p]),(0,Ht.useEffect)(()=>{let m=n.length>0,g=l(),{columnVisibility:b,columnVisibilityForGrouping:h,hideColumnWhenGrouped:y}=g,S={...b},C={...h},T=!1,v=new Set,w=new Set;Object.keys(u).forEach(I=>{let R=u[I];if(R.defaultHiddenWhenGroupedBy||y!=null)if(R.defaultHiddenWhenGroupedBy==="*"&&m||(R.defaultHiddenWhenGroupedBy===!0||y)&&R.field&&o.get(R.field)||typeof R.defaultHiddenWhenGroupedBy=="string"&&o.get(R.defaultHiddenWhenGroupedBy)||typeof R.defaultHiddenWhenGroupedBy=="object"&&Object.keys(R.defaultHiddenWhenGroupedBy).reduce((E,A)=>E||o.has(A),!1)){if(C[I]!==!1){if(b[I]===!1)return;C[I]=!1,T=!0,v.add(I)}}else C[I]===!1&&(delete C[I],T=!0,w.add(I))}),T&&(s.columnVisibilityForGrouping=C,w.forEach(I=>{delete S[I]}),v.forEach(I=>{S[I]=!1}),s.columnVisibility=S)},[u,c,n,o,d])}function bS(o){let{pivotColumns:e,groupBy:t,pivotBy:n,selectionMode:r,groupColumn:i,pivotTotalColumnPosition:a,pivotGrandTotalColumnPosition:l,pivotColumn:s,groupRenderStrategy:c,toggleGroupRow:u,columns:d}=o;if(c==="inline")return{columns:void 0,groupColumnIds:[]};let p={},f=[];if(c==="multi-column")t.forEach((m,g,b)=>{let h=Fd({groupByForColumn:m,groupBy:t,pivotBy:n,groupIndexForColumn:g,groupCount:b.length,groupRenderStrategy:c,selectionMode:r},u,i),y=h.id||`group-by-${m.field||m.groupField}`;f.push(y),p[y]=h});else if(c==="single-column"&&t.length){let m=Nd({groupCount:t.length,groupBy:t,pivotBy:n,groupRenderStrategy:c,selectionMode:r},u,i),g=m.id||"group-by";f.push(g),p[g]=m}if(e){let m={};Object.keys(d).forEach(g=>{let 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:n,groupBy:t})}:S={...S,...s}),S.inheritFromColumn!==!1&&(S={...typeof S.inheritFromColumn=="string"?d[S.inheritFromColumn]:S.pivotAggregator?.field?m[S.pivotAggregator?.field]:void 0,...S}),!S.render&&S.renderValue&&(S.render=C=>S.renderValue(C)),p[g]=S})}else Object.keys(d).forEach(m=>{let g=d[m];p[m]=g});return{columns:Object.keys(p).length?p:void 0,groupColumnIds:f}}var Pm=require("react");var Dm=({columns:o,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,sortable:a,columnCssEllipsis:l,columnHeaderCssEllipsis:s,draggableColumns:c,columnDefaultDraggable:u,sortInfo:d,multiSort:p,filterValue:f,filterTypes:m,columnOrder:g,columnPinning:b,editable:h,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:T,scrollbarWidth:v,columnTypes:w,pinnedEndMaxWidth:I,pinnedStartMaxWidth:R,viewportReservedWidth:x,resizableColumns:E,columnVisibility:A,columnVisibilityAssumeVisible:M,columnSizing:P,groupBy:_})=>{let{computedRemainingSpace:F,computedColumnOrder:N,computedVisibleColumns:W,computedVisibleColumnsMap:L,computedPinnedStartColumns:X,computedPinnedEndColumns:le,computedUnpinnedColumns:ae,computedPinnedStartColumnsWidth:H,computedPinnedEndColumnsWidth:U,computedUnpinnedColumnsWidth:ie,computedUnpinnedOffset:se,computedPinnedEndOffset:pe,computedPinnedEndWidth:fe,computedPinnedStartWidth:ne,renderSelectionCheckBox:ge,computedColumnsMap:K,computedColumnsMapInInitialOrder:k,fieldsToColumn:B}=(0,Pm.useMemo)(()=>Fu({columns:o,scrollbarWidth:v,bodySize:e,columnMinWidth:t,columnMaxWidth:n,columnDefaultWidth:r,columnDefaultFlex:i,columnCssEllipsis:l,columnHeaderCssEllipsis:s,viewportReservedWidth:x,resizableColumns:E,filterValue:f,filterTypes:m,sortable:a,sortInfo:d,multiSort:p,pinnedEndMaxWidth:I,pinnedStartMaxWidth:R,draggableColumns:c,columnDefaultDraggable:u,columnOrder:g,columnPinning:b,columnDefaultEditable:y,columnDefaultFilterable:S,columnDefaultGroupable:C,columnDefaultSortable:T,editable:h,columnSizing:P,columnTypes:w,columnVisibility:A,columnVisibilityAssumeVisible:M??!0,groupBy:_}),[o,e.width,t,n,r,x,v,a,d,p,f,m,g,A,M,u,c,E,I,R,P,w,b,y,S,C,h,_,1]);return{renderSelectionCheckBox:ge,columns:o,computedColumnsMap:K,computedPinnedEndWidth:fe,computedPinnedStartWidth:ne,computedRemainingSpace:F,computedUnpinnedOffset:se,computedPinnedEndOffset:pe,computedPinnedStartColumnsWidth:H,computedPinnedEndColumnsWidth:U,computedUnpinnedColumnsWidth:ie,computedPinnedStartColumns:X,computedPinnedEndColumns:le,computedUnpinnedColumns:ae,computedVisibleColumns:W,computedVisibleColumnsMap:L,computedColumnOrder:N,computedColumnsMapInInitialOrder:k,fieldsToColumn:B}};var Mm=require("react"),js=class{constructor(){this.rowHeight=new Map;this.rowDetailHeight=new Map;this.getRowHeight=e=>this.rowHeight.get(e)??0;this.getRowDetailHeight=e=>this.rowDetailHeight.get(e)??0}getTotalRowHeight(e){return this.getRowHeight(e)+this.getRowDetailHeight(e)}getSize(e){let t=this.getRowHeight(e),n=this.getRowDetailHeight(e);return{rowHeight:t,rowDetailHeight:n,totalRowHeight:t+n}}};function yS(o,e){let t=o.rowDetailHeight,n=o.rowHeight,{isRowDetailsExpanded:r,isRowDetailsEnabled:i,getDataSourceState:a}=o;if(!r)return typeof n=="function"?u=>{if(e&&e.rowHeight.has(u))return e.rowHeight.get(u);let d=a().dataArray[u],p=d?n(d):0;return e&&e.rowHeight.set(u,p),p}:n;let l=typeof n=="function",s=typeof t=="function";return u=>{if(e&&e.rowHeight.has(u)&&e.rowDetailHeight.has(u))return e.rowHeight.get(u)+e.rowDetailHeight.get(u);let d=a().dataArray[u];if(!d)return e&&(e.rowHeight.set(u,0),e.rowDetailHeight.set(u,0)),0;let p=l?n(d):n;if(!!(!i||typeof i=="function"&&i(d)===!1)||!r(d))return e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,0)),p;let m=0;return s?m=t(d):m=t,e&&(e.rowHeight.set(u,p),e.rowDetailHeight.set(u,m)),p+m}}function Em(o){return(0,Mm.useMemo)(()=>{let e=new js;return{computedRowHeight:yS(o,e),computedRowSizeCacheForDetails:o.isRowDetailsExpanded?e:void 0}},[o.rowHeight,o.rowDetailHeight,o.isRowDetailsExpanded,o.isRowDetailsEnabled,o.getDataSourceState])}var $o=require("react");var TS={vertical:!1,horizontal:!1};function Am(o){let{getComponentState:e}=$e(),{getState:t}=De(),[n,r]=(0,$o.useState)(TS);return(0,$o.useEffect)(()=>o.onRenderCountChange(()=>{let{scrollTopMax:i,scrollLeftMax:a}=o;r({vertical:i>0,horizontal:a>0})}),[o]),(0,$o.useLayoutEffect)(()=>{let i=t(),{onScrollbarsChange:a}=e(),{notifyScrollbarsChange:l}=i;a&&i.updatedAt&&i.dataArray.length&&a(n),l(n)},[n]),n}function _m(){let{componentActions:o,componentState:e}=$e(),{componentActions:t,componentState:n,getState:r,api:i}=De(),{columnOrder:a,columnVisibility:l,columnPinning:s,columnSizing:c,editable:u,columnDefaultEditable:d,columnDefaultFilterable:p,columnDefaultGroupable:f,columnTypes:m,rowHeight:g,rowDetailHeight:b,isRowDetailExpanded:h,isRowDetailEnabled:y,brain:S,bodySize:C,showSeparatePivotColumnForSingleAggregation:T}=e;(0,Uo.useState)(()=>{e.onRowHeightCSSVarChange.onChange(ee=>{ee&&(o.rowHeight=ee)}),e.onFlashingDurationCSSVarChange.onChange(ee=>{let j=ee?ee*1:null;j!=null&&!isNaN(j)&&(o.flashingDurationCSSVarValue=j)}),e.onRowDetailHeightCSSVarChange.onChange(ee=>{ee&&(o.rowDetailHeight=ee)}),e.onColumnHeaderHeightCSSVarChange.onChange(ee=>{ee&&(o.columnHeaderHeight=ee)})}),(0,Uo.useEffect)(()=>{t.showSeparatePivotColumnForSingleAggregation=T},[T]);let{multiSort:v,filterValue:w,filterTypes:I,groupBy:R}=n,{toggleGroupRow:x}=xm(),E=e.computedColumns,{computedColumnOrder:A,computedVisibleColumns:M,computedVisibleColumnsMap:P,computedPinnedStartColumns:_,computedPinnedEndColumns:D,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:N,computedPinnedEndColumnsWidth:W,computedUnpinnedColumnsWidth:L,computedUnpinnedOffset:X,computedPinnedEndOffset:le,computedRemainingSpace:ae,computedPinnedStartWidth:H,computedPinnedEndWidth:U,renderSelectionCheckBox:ie,computedColumnsMap:se,computedColumnsMapInInitialOrder:pe,fieldsToColumn:fe}=Dm({columns:E,scrollbarWidth:void 0,columnCssEllipsis:e.columnCssEllipsis,columnHeaderCssEllipsis:e.columnHeaderCssEllipsis,columnMinWidth:e.columnMinWidth,columnMaxWidth:e.columnMaxWidth,columnDefaultWidth:e.columnDefaultWidth,columnDefaultFlex:e.columnDefaultFlex,columnDefaultSortable:e.columnDefaultSortable,columnDefaultDraggable:e.columnDefaultDraggable,pinnedStartMaxWidth:e.pinnedStartMaxWidth,pinnedEndMaxWidth:e.pinnedEndMaxWidth,bodySize:C,viewportReservedWidth:e.viewportReservedWidth,resizableColumns:e.resizableColumns,sortable:e.sortable,draggableColumns:e.draggableColumns,sortInfo:n.sortInfo??void 0,multiSort:v,groupBy:R,columnOrder:a,columnVisibility:l,columnVisibilityAssumeVisible:!0,columnPinning:s,editable:u,columnDefaultEditable:d,columnDefaultFilterable:p,columnDefaultGroupable:f,filterValue:w,filterTypes:I,columnSizing:c,columnTypes:m}),ne=um(M),ge=pm(M),K=Am(S),k=H?N>H:!1,B=U?W>U:!1,[O]=(0,Uo.useState)(()=>new xa({isRowDisabledAt:j=>r().dataArray[j]?.rowDisabled??!1,getIdForIndex:j=>r().dataArray[j]?.id??-1})),oe=Me(M),[te]=(0,Uo.useState)(()=>new Ra({getPrimaryKeyByIndex:i.getPrimaryKeyByIndex,getColumnIdByIndex:ee=>oe()[ee]?.id||""})),{computedRowHeight:he,computedRowSizeCacheForDetails:de}=Em({rowDetailHeight:b,rowHeight:g,isRowDetailsExpanded:h,isRowDetailsEnabled:y,getDataSourceState:r});return{multiRowSelector:O,multiCellSelector:te,computedRowSizeCacheForDetails:de,computedRowHeight:he,scrollbars:K,columnSize:ge,rowspan:ne,toggleGroupRow:x,computedColumnsMap:se,computedColumnsMapInInitialOrder:pe,renderSelectionCheckBox:ie,computedPinnedStartOverflow:k,computedPinnedEndOverflow:B,computedPinnedStartWidth:H,computedPinnedEndWidth:U,computedVisibleColumns:M,computedColumnOrder:A,computedRemainingSpace:ae,computedVisibleColumnsMap:P,computedPinnedStartColumns:_,computedPinnedEndColumns:D,computedUnpinnedColumns:F,computedPinnedStartColumnsWidth:N,computedPinnedEndColumnsWidth:W,computedUnpinnedColumnsWidth:L,computedUnpinnedOffset:X,computedPinnedEndOffset:le,fieldsToColumn:fe}}var Nm=require("react");function SS(o=3988292384){var e=new Array,t,n,r;for(t=0;t<256;t++){for(r=t,n=8;n>0;n--)(r&1)==1?r=r>>>1^o:r=r>>>1;e[t]=r}return e}function CS(){return 4294967295}function wS(o,e,t){return e=e>>>8^o[t^e&255],e}function vS(o){return o=~o,o=o<0?4294967295+o+1:o,o}function $s(o,e=3988292384){var t=SS(e),n=0,r;for(n=CS(),r=0;r<o.length;r++)n=wS(t,n,o.charCodeAt(r));return n=vS(n),`${n}`}var IS=o=>{let e=o.reduce((n,r)=>(n.set(r.name,r.value),n),new Map);return{distribution:e.get("Type")==="distribution",count:e.get("DevCount")?Number(e.get("DevCount")):0,start:new Date(e.get("StartDate")),end:new Date(e.get("EndDate")),owner:e.get("Owner"),type:e.get("Type"),timestamp:e.get("TS")?Number(e.get("TS")):0,trial:e.get("Trial")==="true",ref:e.get("Ref")??""}},Om=(o,e=console.error.bind(console))=>{o=["* * * infinite-table.com * * *",...o];let t=Math.max(Math.max(...o.map(n=>n.length))+8,60);o.forEach(n=>{let r=(t-n.length)/2-1,i=0;r!==Math.round(r)&&(i=-1,r=Math.round(r));let a=r+i,l=r;e("*".repeat(a)+" "+n+" "+"*".repeat(l))}),e("*".repeat(t))},Fm=(o="",e,t)=>{let n;try{n=RS(o)}catch{return Om(["You don't have a valid Infinite Table license","Please visit infinite-table.com to purchase a license.","Thank you for playing fair!"],t),!1}let r=new Date(e.publishedAt),i=new Date(n.end);return i<r?(Om([`
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},wS=o=>{let e="",t=o.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if(Bs(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if(Bs(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),CS(t)};var vS=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,IS=/(https):\/\/\S+(\.csb\.app)/g,Om=typeof window<"u"?window.location.origin:"",RS=()=>{let[o,e,t]=Array.from(vS.exec(Om)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},xS=()=>{let[o,e,t]=Array.from(IS.exec(Om)||[]);return e==="https"&&t===".csb.app"},PS=xS()||RS(),Fm=(o="")=>{let t=!!Le();return(0,_m.useMemo)(()=>{if(t)return!0;let r=Am(o,{publishedAt:1624970570587,version:"7.3.5"});return!o&&!r&&PS?!0:r},[o,t])};var $o=require("react");var DS=10;function Nm(o,e,t){let n=(0,$o.useRef)(!1),r=(0,$o.useRef)(null);(0,$o.useEffect)(()=>{o!=null&&(n.current=!1,Ft(r.current))},[o]),(0,$o.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,Ft(r.current),r.current=Oe(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<DS&&a(l)})};var i=a;a()}return()=>{Ft(r.current)}},[o,e])}var Uo=require("react"),ES=10;function Lm(o,e,t){let n=(0,Uo.useRef)(!1),r=(0,Uo.useRef)(null);(0,Uo.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,Uo.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<ES&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}var km=o=>`--infinite-${o}`;var Yo=require("react");function zm(o,e){Ws(o,e),AS(o,e),e.detail===2&&MS(o,e),o.getState().onCellClick?.(o,e)}function MS(o,e){if(vi(e.target))return;let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function AS(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,h=p.length,b=new ze(u);b.debugId=m??"",d.cellSelectionState=b;let y={rowIndex:i,colIndex:a};if(e.metaKey||e.ctrlKey)d.singleAddClick(y);else if(e.shiftKey){let S=!!n().wrapRowsHorizontally;d.multiSelectClick(y,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:h}:{horizontalLayout:S})}else d.resetClick(y);l.cellSelection=b}function Ws(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=n(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=u;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection:h}=u;if(h=l(h),s.rowSelectionState=h,h&&typeof h=="object")return e.shiftKey?s.multiSelectClick(t):e.metaKey||e.ctrlKey?s.singleAddClick(t):s.resetClick(t),i.rowSelection=h,!0}else if(d==="single-row"){let b=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(b):a.rowSelectionApi.selectRow(b)}return!1}function Vm(o,e){e.detail!==2&&void 0}var _S={Enter:!0," ":!0,a:!0};function Gm(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:c,ctrlKey:u,metaKey:d}=e;if(!_S[c])return!1;let p=t(),f=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:h,keyboardSelection:b}=p,{selectionMode:y,groupBy:S,rowSelection:C,treeSelectionState:T,isTree:v}=f;if(b===!1)return!1;let w=h==="row"&&m!=null?m:h==="cell"&&g!=null?g[0]:null,I=w!=null?f.dataArray[w]:null;if(!I||w==null)return!1;if(y==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(I.id),!0;if(y!=="multi-row")return!1;if(c==="a"&&(u||d)){if(v&&T){let x=s(T);return x.selectAll(),r.treeSelection=x,!0}let R=l(C);return R.selectAll(),r.rowSelection=R,!0}if(c===" "){if(S.length)return I.isGroupRow&&I.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(I.groupKeys):i.rowSelectionApi.toggleRowSelection(I.id),!0;if(v){if(I.isTreeNode&&I.nodePath)return a.treeApi.toggleNodeSelection(I.nodePath),!0}else{let R={...e},{renderSelectionCheckBox:x}=o.getComputed();return x&&(R.metaKey=!1,R.ctrlKey=!0),Ws({...o,rowIndex:w},R)}}return!1}var Hm=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),Km=o=>Array.from(o.querySelectorAll(Hm)).filter(t=>!!t.offsetParent),Ra=o=>o.querySelector(Hm);var Wm=z(Bn());async function Bm(o,e=10,t=300){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})}var OS=10,FS=(o,e)=>o-e;function xa(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=c[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=st(p.id,e);return p.contentFocusable({column:p,...Do({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function js(o,e,t){let n=t.getState().editingCell;return NS(o,e,t,{isCellFocusable:xa,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function jm(o,e,t){let n=(0,Wm.default)(t,o+e,FS);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=jm;function NS(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:jm(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 $m(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=xa(e,o)?e:js(e,-1,o);if(t){await $s([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;Ra(n)?.focus()}}async function $s([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=OS,l=null,s=!1;function c(u=0){u++,Ft(l),l=Oe(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await Bm(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var LS=`.${Yt}`;function Um(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:Sn(n,LS),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=o.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&xa({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:js({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=Km(document.body),d=o.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return $s([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;Ra(u)?.focus()}),!0}var Ym={control:"ctrl"},qm={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},kS={esc:"escape"},Zm={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},Qm=Object.keys(Zm),Us=new Set(Qm),zS=new Set(["shift","alt"]);function Pa(o,e){return Array.isArray(e)?e.some(t=>Xm(o,t)):Xm(o,e)}function Xm(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>qm[p]),i=n.map(p=>Ym[p]||qm[p]||kS[p]||p),a=i.filter(p=>Us.has(p)),l=i.filter(p=>!Us.has(p)),s=Qm.reduce((p,f)=>(p[f]=Zm[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!zS.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||Us.has(t)||t==="meta"||Ym[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function Jm(o,e){let t={...o,cloneRowSelection:a=>sa(a,o.getDataSourceState),cloneTreeSelection:a=>pa(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&Gm(t,e)&&e.preventDefault(),(Um(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&em(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,c=o.getComputed().computedVisibleColumns[s];c.computedEditable&&o.api.startEdit({rowIndex:l,columnId:c.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!Pa(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function VS(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=te(),{getState:i,componentActions:a,api:l}=xe();return(0,Yo.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>pa(u,i),cloneRowSelection:u=>sa(u,i)}),[o,e,i,a,t,l,n])}function GS(){let o=VS();(0,Yo.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{Jm(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=st(s.id,o);zm({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=o.getComputed().computedVisibleColumns[c],d=st(u.id,o);Vm({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function HS(){let{getState:o}=te();return{onKeyDown:(0,Yo.useCallback)(t=>{o().keyDown(t)},[])}}function eg(){return GS(),HS()}var Js=require("react");var Ne=z(require("react")),vt=require("react"),ig=require("react-dom");function Ys(o){return!!o.tagName}function og(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Se.from(Ys(e)?e.getBoundingClientRect():e),a=Se.from(Ys(t)?t.getBoundingClientRect():t),l=n?Se.from(Ys(n)?n.getBoundingClientRect():n):null;if(!l)return{...tg({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=tg({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 tg(o){let e=Se.from(o.targetRect),t=Se.from(o.anchorRect),n=o.constrainRect?Se.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=ng(e,i),s=ng(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function ng(o,e){return e==="TopLeft"?ke.from({top:o.top,left:o.left}):e==="TopCenter"?ke.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?ke.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?ke.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?ke.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?ke.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?ke.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?ke.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):ke.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}var Da="__is_infinite_menu_component";function KS(o){return o&&typeof o.then=="function"||o instanceof Promise}function ag(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function rg(o){return typeof o=="function"&&(o=o()),KS(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&ag(o)&&(o=o.getBoundingClientRect()),o?Se.from(o):null}async function BS(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),ag(n)&&(r=n),r||null}return t(await e)}function WS(o){return Ne.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function jS(o){let e=Ne.useRef(null);return(0,vt.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&qs(e.current,t)}),[o.realign]),Ne.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,vt.useCallback)(t=>{t&&qs(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}async function qs(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await rg(t)||void 0,a=n?await rg(n):void 0,l=Se.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=og({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function lg(o,e){let[t,n]=(0,vt.useState)(null);return(0,vt.useLayoutEffect)(()=>{async function r(){let i=e?await BS(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?(0,ig.createPortal)(o,t):Ne.createElement(Ne.Fragment,null):e===null||e===!1?o:Ne.createElement(WS,null,o)}function $S(o){if(Ne.Children.count(o)===1){let e=Ne.Children.only(o);if(Ne.isValidElement(e))return e.props.id||e.key}return null}function US(o,e,t){if(Ne.Children.count(o)===1){let n=Ne.Children.only(o);if(Ne.isValidElement(n)&&n.type[Da]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),Ne.cloneElement(n,r)}}return o}function Qt(o){let e=o,[t]=(0,vt.useState)(()=>new Map),[n,r]=(0,vt.useState)(null),[i,a]=(0,vt.useState)(0),l=(0,vt.useCallback)(()=>{let m=[];for(let[g,h]of t)m.push(Ne.createElement(jS,{...h,key:h.key}));return m},[]),[s,c]=Et(),u=lg(l(),o.portalContainer),d=(0,vt.useCallback)((m,g)=>{let b=`${g.id||$S(m)||kt()}`,y=t.get(b),S=v=>()=>{let w=typeof v=="function"?v():v;return US(w,e.portalContainer,g.constrainTo??e.constrainTo)},C=S(m),T=(v,w)=>{if(!y)return;let I=S(v);Object.assign(y,{children:I}),c(),!!!w?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),T(m),T):(y={key:b,children:C,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:ge()},t.set(y.key,y),c(),T)},[t,e.portalContainer,c]);Ne.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},f=()=>{t.clear(),c()};return Ne.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}var Cg=z(require("react"));var Zo=z(require("react"));var qo=z(require("react"));var Wr=z(require("react"));function Ea(o){return null}Ea.defaultProps={__is_menu_item:!0};var sg="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",cg=fe({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"]]}),ug="db3arf1",dg="db3arfd";var YS="-";function qS(){return Wr.createElement("hr",{className:dg})}var Ma=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===YS?Wr.createElement(qS,null):r:null;return i!=null?{type:"item",parentMenuId:n,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}};function pg(o,e){return Wr.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===Ea)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Ma(o,n)}return Ma(o,t)})||[]}var fg="submenu";function mg(){let o=qo.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:kt(),focused:!1,destroyed:!1,domRef:o}}var gg=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),XS=[{name:"label"}],hg=o=>{let{props:e,state:t}=o,{activeItemKey:n,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||XS],d={columns:u,keyboardActiveItemKey:r,activeItemKey:n,menuId:c},p=[];i?p=i.map(Ma.bind(null,d)):!i&&typeof a!="function"&&(p=pg(d,a)),l&&p.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==fg)&&u.push({name:fg,render:({domProps:g,item:h})=>h.menu?qo.createElement("div",{...g},qo.createElement(Yn,{expanded:!1})):qo.createElement("div",{...g})});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:u,menuId:c}};var Gt=z(require("react")),rt=require("react");var jr=class extends Ro{constructor(e){super(e.slice(0,3))}};var ZS=250;function QS(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}Oe(i)};Oe(()=>{i()})})}var JS=we(),Aa=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||ZS;this.getPointerMoveTarget=()=>document.documentElement||JS;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 ke({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 jr([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new jr([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,QS(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new ke({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};var _a=require("react"),Xs=(0,_a.createContext)(null);function Zs(){return(0,_a.useContext)(Xs)}var Xo=require("react");function bg(){let o=(0,Xo.useRef)(!0);return(0,Xo.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,Xo.useCallback)(()=>o.current,[])}function eC(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=o.menu;return u?(typeof u=="function"&&(u=u()),Gt.createElement(Ht,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),n(p)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function tC(o,e){let t=yg(o,e);if(!t.length)return null;let n=Se.from(t[0]?.getBoundingClientRect()),r=Se.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function yg(o,e){let t=Sn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function nC(o,e){let t=yg(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}function oC({onItemActivate:o}){let{getState:e}=Zs(),[{onItemEnter:t,onItemLeave:n}]=(0,rt.useState)(()=>new Aa({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?Se.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,rt.useCallback)(t,[]),onItemLeave:(0,rt.useCallback)(n,[])}}function Tg(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:h,getState:b}=Zs(),y=(0,rt.useCallback)(k=>{h.keyboardActiveItemKey=k},[]),S=(0,rt.useCallback)(k=>{h.activeItemKey=k},[]),C=bg(),[T,v]=(0,rt.useState)(null),w=null;(0,rt.useLayoutEffect)(()=>{let{runtimeItems:k}=b(),Y=k.filter(ae=>ae.type==="item"&&i===ae.key)[0];if(!Y||!Y.menu){v(null),D();return}if(Y){let ae=tC(r,Y.key);ae&&R(()=>eC(Y,{constrainTo:l,setSubmenuApi:v,setActiveItemKey:S,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:B,api:U}),{id:`${r}-submenu`,alignTo:ae,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let I=(k,Y)=>{y(Y.key),S(Y.key),Y.originalMenuItem.onClick&&Y.originalMenuItem.onClick(k);let ae={key:Y.key,item:Y.originalMenuItem,hideMenu:B};Y.originalMenuItem.onAction&&Y.originalMenuItem.onAction(ae),c&&c(ae),Y.originalMenuItem.hideMenuOnAction&&B()},{showOverlay:R,portal:x,clearAll:D}=Qt({portalContainer:!1}),{onItemEnter:M,onItemLeave:A}=oC({onItemActivate:k=>{if(!C())return;let Y=k?k.key:null;S(Y)}});w=n.map((k,Y)=>Gt.createElement(rC,{key:k.type==="item"?k.key:Y,onItemEnter:(ae,se)=>{M(ae.key,se)},onItemLeave:(ae,se)=>{A(ae.key,se)},columns:t,active:k.type==="item"&&k.key===i,keyboardActive:k.type==="item"&&k.key===a,item:k,index:Y,onClick:I}));let P=t.map(k=>k.width||(typeof k.flex=="number"?`${k.flex}fr`:k.flex)||"auto").join(" "),O={...e.style,gridTemplateColumns:P,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(O.whiteSpace="nowrap");function E(k){let{runtimeItems:Y,runtimeSelectableItems:ae}=b(),se=Y.findIndex(oe=>oe.type==="item"&&oe.key===a),le=a,re=Y[se],Z={ArrowUp:()=>{let oe=Y.slice(0,se).filter(G=>G.type==="item"&&!G.disabled).pop();oe&&oe.type==="item"&&oe.key&&(le=oe.key)},ArrowDown:()=>{let oe=Y.slice(se+1).filter(G=>G.type==="item"&&!G.disabled)[0];oe&&oe.type==="item"&&oe.key&&(le=oe.key)},Home:()=>{Z.PageUp()},End:()=>{Z.PageDown()},PageUp:()=>{le=ae[0].key},PageDown:()=>{le=ae[ae.length-1].key},ArrowLeft:()=>{S(null),b().parentMenuId&&(h.destroyed=!0)},ArrowRight:()=>{re&&(S(re.key),Oe(()=>{C()&&T&&T.getParentMenuId()===b().menuId&&T.focus()}))},Enter:()=>{if(re)if(re.originalMenuItem?.menu){if(re&&re.originalMenuItem.menu&&T){Z.ArrowLeft();return}re&&S(re.key)}else I(k,re)}," ":()=>{if(!re)return;re.originalMenuItem.menu||I(k,re);let oe=nC(r,re.key);oe&&oe.click()},Escape:()=>{Z.ArrowLeft();let oe=b();oe.parentMenuId||oe.onHideIntent?.(oe)}},be=Z[k.key];be&&(be(),k.preventDefault()),le!=a&&y(le)}function _(){h.focused=!1}let N=(0,rt.useCallback)(function(){h.focused=!0,setTimeout(()=>{H.current&&g.current&&g.current===document.activeElement&&b().keyboardActiveItemKey==null&&y(b().runtimeSelectableItems[0]?.key??null)})},[]),H=(0,rt.useRef)(!0),B=(0,rt.useCallback)(()=>{let k=b();k.onHideIntent?.(k)},[b]),[U]=(0,rt.useState)(()=>({hideMenu:B,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),N())},getMenuId:()=>b().menuId,getParentMenuId:()=>b().parentMenuId})),de=(0,rt.useCallback)(k=>{k?(g.current=k,d?.(b(),U),f&&U.focus()):(p?.(b()),g.current=k)},[]),pe=Gt.createElement("div",{className:go.contents},Gt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:de,onKeyDown:k=>{e.onKeyDown?.(k),E(k)},onMouseDown:k=>{H.current=!1,e.onMouseDown?.(k)},onMouseUp:k=>{H.current=!0,e.onMouseUp?.(k)},onFocus:N,onBlur:_,className:J(sg,e.className,"InfiniteMenu"),style:O},w),x);return s?null:pe}function rC(o){let[e,t]=Gt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=Gt.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,h=g+r.span;if(g<u)return null;u=h;let y={style:{...d.style,...r.style,gridColumnStart:g,gridColumnEnd:h},"data-menu-column-id":`${r.parentMenuId}-col-${d.name}`,"data-menu-col-name":`${d.name}`,"data-menu-row-id":`${r.parentMenuId}-row-${i}`,"data-menu-row-index":`${i}`,"data-menu-item-key":`${r.key}`,className:J(cg({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:S=>{r.disabled||o.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||o.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||o.onClick(S,r)}};return d.render?Gt.createElement(vr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:y}}):Gt.createElement("div",{key:`${s}-${m}`,...y},f[m])}).filter(Boolean)}return Gt.createElement("div",{className:ug},c)}var{ManagedComponentContextProvider:iC}=Mt({initSetupState:mg,forwardProps:gg,mapPropsToState:hg,layoutEffect:!0});function aC(o){let{componentActions:e,componentState:t}=je(),n=Pe(t);return Zo.createElement(Xs.Provider,{value:{componentActions:e,componentState:t,getState:n}},Zo.createElement(Tg,{domProps:o.domProps}))}function Ht(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:h,__is_infinite_menu_component:b,...y}=o;return Zo.createElement(iC,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},Zo.createElement(aC,{domProps:y}))}Ht[Da]=!0;var Qs=z(require("react"));function Sg(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a}=e,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=Kn(p,e,"column-menu");u.push({key:f,label:m,check:Qs.createElement(nn,{key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let h=!!g;i.setVisibilityForColumn(p.id,h),requestAnimationFrame(()=>{i.realignColumnContextMenu()})}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}},"-",{key:"group-by",label:"Group by",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{if(p.groupByForColumn)return;let m=Kn(p,e,"column-menu");u.push({key:f,label:m,check:Qs.createElement(nn,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function wg(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Ht,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:st(s.id,e),...e},u=Sg([],c),d=a?a(u,c):u,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:Cg.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var lC=`[${Zl["data-name"]}="${Ql["data-name"]}"]`;function sC(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){n(),a.columnMenuVisibleForColumnId=null}let u=o.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${Qp["data-column-id"]}="${e}"] ${lC}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>wg(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function vg(){let o=te(),e=Le(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});(0,Js.useEffect)(()=>{let{actions:c,getState:u}=o,d=u();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,c.contextMenuVisibleFor=null,c.cellContextMenuVisibleFor=null,c.filterOperatorMenuVisibleForColumnId=null,c.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return(0,Js.useEffect)(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=t();if(c){let p=function(f){f.__insideMenu!==!0&&(a(),n.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),sC({columnId:c,context:o,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else u.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}var Ig=z(require("react")),Rg=require("react");var cC={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function xg(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=te(),{getState:a,getDataSourceMasterContext:l}=xe(),{focusDetectDOMRef:s}=o(),c=(0,Rg.useCallback)(async()=>{$m({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return Ig.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:cC})}var Qo=require("react");function uC(){let o=te(),{getState:e}=o,{editingCell:t}=e(),n=t&&!t.active?t.cancelled:void 0;(0,Qo.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...St({rowIndex:r,columnId:i,...o}),initialValue:a})}},[n])}function dC(){let o=te(),{getState:e,state:{editingCell:t}}=o,n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,Qo.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...St({rowIndex:r,columnId:i,...o}),value:a,error:n,initialValue:l})}},[n])}function pC(){let o=te(),{state:{editingCell:e}}=o,t=e?.active,n=bn(t);(0,Qo.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function fC(){let o=te(),{state:{editingCell:e},getState:t}=o,n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,Qo.useEffect)(()=>{if(n){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...St({rowIndex:a,columnId:l,...o}),value:i,initialValue:s};t().onEditAccepted?.(c),o.api.persistEdit({value:i})}},[n])}function mC(){let o=te(),{state:{editingCell:e},getState:t}=o,n=e?e.persisted:void 0;(0,Qo.useEffect)(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...St({rowIndex:l,columnId:s,...o}),value:c,initialValue:u};n instanceof Error?i?.({...d,error:n}):a?.(d)}},[n])}function Pg(){uC(),dC(),fC(),mC(),pC()}var nc=require("react");var Nn=z(require("react"));var ec=z(require("react")),Oa=o=>ec.createElement(_e,{...o},ec.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 tc=z(require("react")),Dg=o=>tc.createElement(_e,{...o},tc.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 Eg(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),p=u?.Menu??Ht,f=n().computedColumnsMap.get(o);if(!f)return null;let m=w=>{w.__insideMenu=!0},g=w=>{w.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:h}=i(),b=h[f.computedFilterType];if(!b)return null;let y=b.operators.map(w=>{let I=w.name,R=f.computedFilterValue?f.computedFilterValue.filter.operator===I:I===b.defaultOperator,x=w.components?.Icon??yo;return{key:I,icon:Nn.createElement(x,null),label:Nn.createElement(Nn.Fragment,null,w.label??w.name),onAction:()=>{c.setColumnFilterOperator(o,I)},checked:R?Nn.createElement(Dg,{size:16}):null}}),C=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:Nn.createElement(Oa,null),disabled:!f.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...y],T={column:f,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:h},v=d?d(C,T):C;return Nn.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:v,onShow:w=>{w.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:w=>{g(w),t?.()}})}var Fa=10;function Mg(){let o=te(),e=Le(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,nc.useEffect)(()=>{let{actions:l,getState:s}=o;return s().onFilterOperatorMenuClick.onChange(u=>{if(!u)return;let{target:d,column:p}=u;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,g=Se.from(m.getBoundingClientRect());g.top-=Fa,g.left-=Fa,g.width+=2*Fa,g.height+=2*Fa,r(()=>Eg(p.id,o,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:g,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),(0,nc.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var $r=require("react");var ac=z(require("react"));var oc=z(require("react"));function Na(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function rc(o){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),o.onHideIntent?.()}}}function ic(o,e,t){if(!o)return null;let n=ge();return o.then(r=>{let{items:i,columns:a}=Na(r);i&&i.length&&n(oc.createElement(t,{...e,items:i||[],columns:a}))}),oc.createElement(xn,{updater:n})}function Ag(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Ht,{computedColumnsMap:d}=a(),p=d.get(n),f={...St({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!c)return{cellContext:f,menu:null,preventDefault:!1};let m=rc({onHideIntent:t}),g=c(f,e),h=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:ic(g,m,u),preventDefault:h};let{items:b,columns:y}=Na(g);return!b||!b.length?{cellContext:f,menu:null,preventDefault:Array.isArray(b)}:{preventDefault:h,menu:ac.createElement(u,{...m,columns:y,items:b}),cellContext:f}}function _g(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??Ht,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...St({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=rc({onHideIntent:t}),p=a(u,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:u,menu:ic(p,d,l),preventDefault:f};let{items:m,columns:g}=Na(p);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:ac.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var La=5,Og=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function Fg(){let o=te(),e=Le(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,$r.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:c}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:h}=Ag(d,o,f),b=Se.fromPoint({top:p.clientY,left:p.clientX});b.width+=La,b.height+=La,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:b,alignPosition:Og}),h&&p.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},p)})},[]),(0,$r.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function Ng(){let o=te(),e=Le(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=Qt({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,$r.useEffect)(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=_g(u,o,p),h={top:d.clientY,left:d.clientX},b=Se.fromPoint(h);b.width+=La,b.height+=La,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:b,alignPosition:Og}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:h,...u};let{onContextMenu:y}=s();y&&y({...o,...m},d)})},[]),(0,$r.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var Lg=require("react"),kg=z(require("react"));var ka=require("react");function za(o,e){let{state:{brain:t}}=te(),n=(0,ka.useCallback)(o,e);(0,ka.useEffect)(()=>t.onScroll(n),[t,n])}var lc="yzx0vj0";function zg(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,Lg.useRef)(null);za(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=ce.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ce.runtime.bodyWidth),n==="column"?l.minWidth=ce.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=ce.runtime.bodyWidth),t==="column"?l.maxWidth=ce.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ce.runtime.bodyWidth),kg.createElement("div",{ref:a,...i,className:i.className?J(i.className,lc):lc,style:l},i.children)}var gC=X($.columnWidthAtIndex),hC=X($.columnOffsetAtIndex);function Vg(){return te().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${gC}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${hC}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Va="InfiniteTable";var Gg=require("react");function Hg(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=te(),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,Gg.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,h=l.rowsPerPage,b=(r&&r.length>0||i)&&h>0?h:null;return f!=b&&(t.rowsPerPage=b,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}var so=require("react");var Ur=fe({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),Kg="_143ofgf5",Bg="_143ofgf3";var bC=X(ce.loaded),sc={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Wg(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...sc,url:cc(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...sc,url:cc(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var cc=at(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function yC(o){window.postMessage(o)}var TC=at(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){Ot.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(Wg({type:"update",debugId:e},t))}else Ff(e),window.postMessage(Wg({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Ge.onLogIntent("IT:*",e=>{yC({...sc,url:cc(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let n="";try{n=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return n}return String(t)}),timestamp:e.timestamp}})}),o});function jg(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=te(),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(bC)!==`${zu}`&&Gr({debugId:i,key:"CSS001_CSS"}),(0,so.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),wC()}var Ga=ge(),SC={revertAll:o=>{let e=Ot.get(o.debugId);if(e){let t=_n.get(o.debugId);_n.delete(o.debugId),sn.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=un.get(o.debugId);un.delete(o.debugId),cn.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=Ot.get(o.debugId);if(e){let t=o.property,n=sn.get(o.debugId),r=_n.get(o.debugId),i=cn.get(o.debugId),a=un.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=un.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=Ot.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Hr(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Hr(o.debugId))}}},discardAllWarnings:o=>{let e=Ot.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Hr(o.debugId))},setColumnVisibility:o=>{Ds(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{ha(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{Ds(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{ha(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{ha(o.debugId,"multiSort",o.multiSort)},highlight:o=>{let e=Ot.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${Ur.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(Ur.classNames.base),r.innerHTML=[`<div class="${Bg}"></div>`,`<div class="${Kg}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(Ur.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(Ur.classNames.variants.active.true)}}}}};function CC(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(TC(),Ga(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=SC[e];t&&t(o.data.payload)}})}CC();function wC(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=te(),s=o().debugId,c=(0,so.useRef)(s);return c.current=s,(0,so.useEffect)(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=Ga.get();if(p){d(p);return}return Ga.onChange(f=>{f&&d(f)})},[]),(0,so.useEffect)(()=>{let u=c.current;if(!u)return;let d=Ga.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,so.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function $g(){let o=Le(),e=o?o.getMasterState():null,t=te().getState();return(e||t).portalDOMRef.current}var It=z(require("react")),eh=require("react");var Ug="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Yg=fe({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),qg="hs68h81",Xg=fe({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 co=z(require("react"));function Zg(o){return co.createElement("div",{...o.domProps})}function Qg(o){let{active:e}=o;return co.createElement("div",{className:qg},e?"Drop to group":"Drag columns to group")}function Jg(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return co.createElement("div",{...o.domProps},o.label,co.createElement("div",{className:ui[1]}),co.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:Ug,onKeyDown:e,onMouseDown:o.onClear},co.createElement(Oa,{size:20})))}var vC=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};we().addEventListener("mousemove",i,{once:!0}),we().addEventListener("mouseup",()=>{r||(we().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function IC(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=Dr(),c=l===Jo,u=te(),d=(e?Kn(e.id,u,"grouping-toolbar"):r)??i,p=e?It.createElement(Ni,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=It.createElement(It.Fragment,null,d,p),m=s===i&&l===Jo,g=J(Yg({draggingInProgress:c,active:m}),o.domProps?.className),h=vC(a,o.domProps?.onMouseDown),b={...o.domProps,className:g,onMouseDown:h},y=n?.ToolbarItem??Jg;return It.createElement(y,{active:m,domProps:b,column:e,field:r,label:f,onClear:t})}var Jo="grouping-toolbar";function th(o){let{groupBy:e}=tn(),{getComputed:t,dataSourceApi:n,api:r}=te(),{dropTargetListId:i,dragSourceListId:a}=$n(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===Jo,u=a===Jo,d=o.components?.Placeholder??Qg,p=o.components?.Host??Zg,f=e.length?It.createElement(It.Fragment,null,e.map((S,C)=>{let T=S.field?l.get(S.field):void 0,v=`${S.field??`idx-${C}`}`;return It.createElement(Qn.DraggableItem,{key:v,id:v},w=>It.createElement(IC,{id:v,components:o.components,domProps:w,field:S.field,column:T,toggleSorting:()=>{T&&r.toggleSortingForColumn(T.id)},onClear:()=>{let I=e.filter(R=>R!==S).filter(Boolean);n.setGroupBy(I)}}))})):It.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let C=S.map(T=>e[T]);n.setGroupBy(C)},g=S=>{let{dragItemId:C}=S,T=C,v=s.get(T);if(!v||!v.field||!v.computedGroupable)return;let w=[...e];w.splice(S.dropIndex,0,{field:v.field}),n.setGroupBy(w)},h=(0,eh.useCallback)(S=>{let{computedColumnsMap:C}=t(),T=S.dragItem.id,v=C.get(T);return!(!v||!v.computedGroupable||e.some(w=>w.field===v.field))},[e]),b=o.orientation??"horizontal",{domProps:y}=o;return It.createElement(Qn,{orientation:b,dragListId:Jo,acceptDropsFrom:["header",Jo],onDrop:m,onAcceptDrop:g,shouldAcceptDrop:h},(S,{draggingInProgress:C,status:T})=>{let v=J(Xg({active:c,orientation:b,draggingInProgress:C,dropRejected:T==="rejected"}),S.className,y?.className),w={...S,...y,className:v,children:f};return It.createElement(p,{active:c,rejectDrop:T==="rejected",domProps:w,orientation:b})})}var tr=z(require("react"));var ah=require("react"),Kt=require("react"),Ha=z(require("react"));function nh(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return ta(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var qr=z(require("react"));var oh=fe({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var Yr=require("react");function RC(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function xC(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=Yf(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(o,l),r.detailDataSourcesStateToRestore=a}function PC(o,e){let t=(0,Yr.useRef)(!1);return{currentRowCache:(0,Yr.useMemo)(()=>({getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)}),[e,o]),cacheCalledByRowDetailRenderer:t}}function rh(o){let{rowDetailsCache:e,rowInfo:t}=o,{getState:n,componentActions:r}=xe(),{getState:i}=te(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=PC(t.id,e),s=(0,Yr.useMemo)(()=>{let c=n().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:at(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}RC(t.id,{masterState:n(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&xC(t.id,{detailState:d.getState(),masterActions:r,masterState:n(),cacheEntryForRow:p})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:DC}=Ae,EC=`${DC}RowDetail`;function MC(o){let e=ri(),{domRef:t,rowDetailRenderer:n,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=o,{masterDetailContextValue:s,currentRowCache:c}=rh({rowDetailsCache:l,rowInfo:i});return qr.createElement(e.Provider,{value:s},qr.createElement("div",{ref:t,className:J(EC,oh({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${$.bodyWidth} - ${$.scrollbarWidthVertical})`,height:r}},n(i,c)))}var ih=qr.memo(MC);var AC=1;function lh(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,state:i,getState:a}=te(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedColumnsMap:u,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:g,columnSize:h}=e,{componentState:b,getState:y,componentActions:S,api:C}=xe(),{dataArray:T,isNodeReadOnly:v}=b,w=Pe(T),{rowHeight:I,rowDetailHeight:R,onRowMouseEnter:x,onRowMouseLeave:D,groupRenderStrategy:M,brain:A,showZebraRows:P,rowDetailRenderer:O,isRowDetailExpanded:E,isRowDetailEnabled:_,cellClassName:N,cellStyle:H,rowStyle:B,rowDetailCache:U,rowClassName:de,onScrollToTop:pe,onScrollToBottom:k,onScrollStop:Y,scrollToBottomOffset:ae,wrapRowsHorizontally:se,ready:le}=i,re=b.updatedAt;nh({columnSize:h,brain:A,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedRowHeight:d,dataArray:T,bodySize:t,rowspan:m});let Z=(0,Kt.useRef)(0);(0,Kt.useEffect)(()=>A.onRenderCountChange(()=>{Z.current=A.scrollTopMax}),[A]),(0,Kt.useEffect)(()=>A.onRenderRangeChange(W=>{a().onRenderRangeChange?.(W)}),[A]),(0,Kt.useEffect)(()=>A.onScrollStop(W=>{let{scrollTop:F,scrollLeft:ie}=W;if(F===0&&pe?.(),F+(ae??AC)>=Z.current){k?.();let{livePagination:ne,livePaginationCursor:q,dataArray:ue}=y();ne&&(S.cursorId=q!==void 0?Date.now():ue.length)}if(Y){let ne=A.getRenderRange();Y({scrollTop:F,scrollLeft:ie,renderRange:ne,viewportSize:a().bodySize,firstVisibleRowIndex:ne.start[0],lastVisibleRowIndex:ne.end[0],firstVisibleColIndex:ne.start[1],lastVisibleColIndex:ne.end[1]})}}),[A,pe,k,Y]),(0,Kt.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,Kt.useEffect)(()=>{let{onReady:W}=a();W&&W({api:n,dataSourceApi:C})},[le]);let[,be]=Et();(0,Kt.useEffect)(()=>{be()},[b]);let oe=(0,Kt.useCallback)(W=>{let{rowIndex:F,colIndex:ie,heightWithRowspan:j,domRef:K,hidden:ne,width:q,onMouseLeave:ue,onMouseEnter:me}=W,Me=w()[F],Ke=c[ie];if(!Me||!Ke)return null;let Je=p?p.getRowHeight(F):j,Ve=!1;!_||typeof _=="function"&&!_(Me)?Ve=!1:E&&(Ve=E(Me)?"expanded":"collapsed");let et=se?A.getRowIndexInPage(F):null,Ye=se?A.getPageIndexForRow(F):null;return Ha.createElement(jd,{...{getData:w,virtualized:!0,showZebraRows:P,groupRenderStrategy:M,rowIndexInHorizontalLayoutPage:et,horizontalLayoutPageIndex:Ye,rowIndex:F,rowInfo:Me,hidden:ne,toggleGroupRow:g,rowHeight:Je,rowDetailState:Ve,onMouseEnter:me,onMouseLeave:ue,onRowMouseEnter:x,onRowMouseLeave:D,domRef:K,width:q,column:Ke,columnsMap:u,fieldsToColumn:f,rowStyle:B,rowClassName:de,cellStyle:H,cellClassName:N}})},[I,R,x,D,p,d,E,w,c,u,f,M,se,g,P,A,re,v,B,de,N,H]),G=(0,ah.useMemo)(()=>{if(E)return W=>{let{rowIndex:F,domRef:ie}=W,K=w()[F];if(!K||!E(K)||!p)return Ha.createElement("div",{ref:ie,className:Hc.hidden});let{rowDetailHeight:ne,rowHeight:q}=p.getSize(F);return Ha.createElement(ih,{rowInfo:K,rowDetailsCache:U,rowIndex:F,domRef:ie,detailOffset:q,rowDetailHeight:ne,rowDetailRenderer:O})}},[le,oe,O,R,E,U]);return{renderCell:oe,renderDetailRow:G}}var sh=require("react");function ch(){let{state:o,getState:e,actions:t}=te(),{wrapRowsHorizontally:n}=o,r=bn(n);(0,sh.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Gs(Va,!!n);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,n])}var ph=z(require("react"));var uh="_16lm1iw1 _16lm1iw1c _16lm1iwe";var dh=J(uh,Wl);function fh(o){return ph.createElement("div",{...o,className:o.className?J(dh,o.className):dh})}var er=z(require("react"));var mh={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},gh="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hh="qy58ya4";var{rootClassName:_C}=Ae,uc=`${_C}-LoadMask`;function OC(o){let{visible:e,children:t="Loading"}=o;return er.createElement("div",{className:`${mh[e?"visible":"hidden"]} ${uc}`},er.createElement("div",{className:`${gh} ${uc}-Overlay`}),er.createElement("div",{className:`${hh} ${uc}-Text`},t))}var Ka=er.memo(OC);var bh=require("react"),FC=[Dd,`${Yt}--hovered`];function Ln(o){let e=te(),t=Le(),{state:n,getComputed:r,api:i}=e,{renderer:a,onRenderUpdater:l,debugId:s,keyboardNavigation:c,activeRowIndex:u,loadingText:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:h,activeCellIndex:b,rowDetailRenderer:y,showHoverRows:S,wrapRowsHorizontally:C,domProps:T,domRef:v}=n,w=g?.LoadMask??Ka,I=r(),{computedRowHeight:R,computedRowSizeCacheForDetails:x}=I,D=x?.getRowHeight||R,{componentState:{loading:M}}=xe(),A=tr.useCallback(H=>{let B=e.getState(),U=H.target;if(!t&&H._from_row_detail)return;t&&(H._from_row_detail=!0);let de=ku(U,Vs(),B.domRef.current),pe,k,Y,ae;de&&(k=Number(de.dataset.colIndex),ae=Number(de.dataset.rowIndex),pe=e.getComputed().computedVisibleColumns[k].id,Y=e.dataSourceApi.getRowInfoArray()[ae].id);let se={columnId:pe,colIndex:k,rowId:Y,rowIndex:ae,event:H,target:de??H.target};de&&B.cellContextMenu(se),B.contextMenu(se)},[]),{renderCell:P,renderDetailRow:O}=lh({imperativeApi:i,getComputed:r,domRef:v,bodySize:h,computed:I}),{autoFocus:E,tabIndex:_}=T??{};ch();let N=(0,bh.useMemo)(()=>{if(S)return o.rowHoverClassNames?Array.isArray(o.rowHoverClassNames)?[...Ln.rowHoverClassNames,...o.rowHoverClassNames]:[...Ln.rowHoverClassNames,o.rowHoverClassNames]:Ln.rowHoverClassNames},[S,o.rowHoverClassNames,Ln.rowHoverClassNames]);return tr.createElement(fh,{onContextMenu:A},tr.createElement(Lp,{forceRerenderTimestamp:n.forceBodyRerenderTimestamp,debugId:s,tabIndex:_??0,autoFocus:E??void 0,activeRowIndex:n.ready&&c==="row"?u:null,activeCellIndex:n.ready&&c==="cell"&&!n.columnReorderDragColumnId?b:null,scrollStopDelay:p,renderer:a,wrapRowsHorizontally:C,onRenderUpdater:l,brain:f,activeCellRowHeight:D,renderCell:P,renderDetailRow:y?O:void 0,cellHoverClassNames:N,scrollerDOMRef:m,scrollVarHostRef:v}),tr.createElement(w,{visible:M},d))}Ln.rowHoverClassNames=FC;var Ut=Ae.rootClassName,{ManagedComponentContextProvider:NC}=Mt({initSetupState:mm,forwardProps:gm,mapPropsToState:Tm,cleanup:hm,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:ym(),getParentState:()=>tn(),debugName:o=>Pn(o.debugId,Va)}),yh=Ie.memo(function(){let e=te(),t=Le(),{state:n,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=xe(),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:h,columnHeaderHeightCSSVar:b,scrollStopDelay:y,brain:S,activeRowIndex:C,activeCellIndex:T}=n,{licenseKey:v}=n;!v&&Jt.licenseKey&&(v=Jt.licenseKey),Lm(C,a.length,r),Nm(T,a.length,r);let{onKeyDown:w}=eg();Ie.useEffect(()=>{let H=l(),B=Dt(U=>{H.notifyRenderRangeChange({renderStartIndex:U[0],renderEndIndex:U[1]})},{wait:y});return S.onVerticalRenderRangeChange(B)},[S,y]);let I=Fm(v),{autoFocus:R,tabIndex:x,...D}=n.domProps??{},M=nd(D);Ie.useEffect(()=>{S.setScrollStopDelay(y),s.scrollStopDelayUpdatedByTable=y},[y]),rm(),Hg(),Pg();let{menuPortal:A}=vg(),{menuPortal:P}=Fg(),{menuPortal:O}=Ng(),{menuPortal:E}=Mg();Ie.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(n.id,n.ready,e.api,e)},[n.ready]);let _=jg();Ie.useEffect(()=>{t&&(u.current=t.getMasterState().portalDOMRef.current)},[]);let N=i??Ie.createElement(Ie.Fragment,null,Ie.createElement(ms,null),Ie.createElement(Ln,null));return Ie.createElement("div",{"data-debug-id":_,onKeyDown:w,ref:c,...M},N,Ie.createElement("div",{ref:u,className:J(`${lt}Portal`,Kc[1e7],di.absolute,Vc[0],Lc[0])},A,P,O,E),g?Ie.createElement(cr,{key:"row-height",varName:g,onChange:d}):null,Ie.createElement(cr,{key:"flashing-duration",allowInts:!0,varName:ce.components.Cell.flashingDuration,onChange:p}),h?Ie.createElement(cr,{key:"row-detail-height",varName:h,onChange:f}):null,b?Ie.createElement(cr,{key:"column-header-height",varName:b,onChange:m}):null,I?null:Ie.createElement(of,null),Ie.createElement(xg,null))});function LC({children:o}){let{componentActions:e,componentState:t}=je(),{scrollerDOMRef:n,scrollTopKey:r}=t,i=Em(),a=Pe(i),l=Pe(t),s=Le(),{getState:c,componentActions:u,getDataSourceMasterContext:d,api:p}=xe(),[f]=Ie.useState(()=>om({getComputed:a,getState:l,getDataSourceState:c,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:u})),m={actions:e,state:t,computed:i,dataSourceActions:u,getDataSourceMasterContext:d,getDataSourceState:c,getComputed:a,getState:l,api:f,dataSourceApi:p,children:o};oi(n,h=>{let b={width:h.width,height:h.height};e.bodySize=b},{earlyAttach:!0,debounce:50}),Ie.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[r,n]);let g=ho();return Ie.createElement(g.Provider,{value:m},Ie.createElement(yh,null))}var kC=40,zC=km(Vu),Jt=function(o){return Ie.createElement(NC,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:kC,columnHeaderHeight:zC,...o},Ie.createElement(Bl,null,Ie.createElement(LC,{children:o.children})))};Jt.Header=ms;Jt.Body=Ln;Jt.HScrollSyncContent=zg;Jt.Footer=()=>Ie.createElement(Wc,null);Jt.GroupingToolbar=th;var Th=z(require("react"));function VC(o){let{DataSource:e}=Ko({nodesKey:"children",...o});return Th.createElement(e,null,o.children??null)}var Sh=z(require("react"));function Ch(o){return Sh.createElement(Jt,{...o})}var wh=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Xe(i,{treePaths:n});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()};o(c)};var Ba=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,n(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Ge(`IT:${e}:DataQuery`)}};function uo(o){if(Array.isArray(o))return o.map(uo);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=uo(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var pn=class pn{constructor(e){this.queryCache=new ee;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=uo(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new Ba(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=uo(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=uo(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=uo(e);this.queryCache.delete(t)};if(this.options=e,pn.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)}pn.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=pn.clients.get(e);t&&t.destroy()}static destroyAll(){pn.clients.forEach(e=>{pn.destroy(e.name)})}destroy(){pn.clients.delete(this.options.name)}};pn.clients=new Map;var dc=pn;var GC={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},vh={instantEdit:GC};var HC=require("react");function Ih(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var ja=class ja{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??ja.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};ja.DEFAULT_SIZE=10;var Wa=ja;var Ua=class Ua{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ua.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};Ua.DEFAULT_SIZE=10;var $a=Ua;var po=require("react"),KC=(o,e)=>o.every((t,n)=>t===e[n]),Rh=(o,e)=>{let t=(0,po.useRef)(e),n=KC(e,t.current),r=(0,po.useRef)(!0);t.current=e;let i=(0,po.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,po.useRef)(o);l.current=o,(0,po.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var kn=require("react"),xh=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),Ya=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,kn.useRef)(t),a=(0,kn.useRef)(n),l=xh(t,i.current,r),s=!xh(n,a.current,r),c=(0,kn.useRef)(!0);i.current=t,a.current=n;let u=(0,kn.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=(0,kn.useRef)(o);p.current=o,l&&s&&(c.current=!1),(0,kn.useEffect)(()=>{if(!c.current)return p.current()},d)};var Rt=z(require("react"));var Ph=X($.currentFlashingDuration),BC=({children:o})=>Rt.createElement(Rt.Fragment,null,o),Dh=1e3,Eh={up:Di({direction:"up"}).split(" "),down:Di({direction:"down"}).split(" "),neutral:Di({direction:"neutral"}).split(" ")},pc=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=BC}=o;return Rt.forwardRef((i,a)=>{let l=wr(),{state:{flashingDurationCSSVarValue:s}}=te(),c=typeof s=="number"?s??e??Dh:e??Dh,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,h=p.id,b=Rt.useRef(!0),y=Rt.useRef(d),S=b.current?null:y.current;b.current=!1;let C=Rt.useRef(void 0),T=Rt.useRef(void 0),v=Rt.useRef(void 0);return Ya(()=>{if(d===y.current)return;let w=()=>{let D=m.current;if(C.current&&(clearTimeout(C.current),C.current=void 0),v.current&&(clearTimeout(v.current),v.current=void 0),T.current&&D){let M=T.current,A=Eh[M];D.classList.remove(...t?[t,...A]:A),D.style.removeProperty(Ph),T.current=void 0}};y.current=d;let I=m.current;if(!I)return;w();let R=typeof d=="number"?d>S?"up":"down":"neutral",x=Eh[R];return I.style.setProperty(Ph,`${c}`),I.classList.add(...t?[t,...x]:x),T.current=R,C.current=setTimeout(w,c),w},{same:[h,g],different:[d]}),Rt.createElement("div",{ref:u,...i,className:J(i.className)},n({children:i.children,oldValue:S}))})},Mh=pc();var Ue=z(require("react")),nr=require("react");var Ah=require("react-dom");function _h(o){let[e,t]=Ue.useState(null);return(0,nr.useEffect)(()=>{let{debugTarget:n}=o,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[n]){let i=globalThis.INFINITE[n].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[o.debugTarget]),typeof e=="function"?Ue.createElement(Oh.Provider,{value:{getState:e}},Ue.createElement(WC,null)):null}var Oh=Ue.createContext({getState:()=>null});function WC(){let o=Ue.useContext(Oh),{getState:e}=o,[,t]=Et(),n=e().renderer.cellManager;(0,nr.useEffect)(()=>{let s=Dt(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,nr.useRef)(null),l=(0,nr.useRef)(null);return Ue.createElement("div",{style:{overflow:"auto"}},(0,Ah.createPortal)(Ue.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),Ue.createElement("table",{style:{borderCollapse:"collapse"}},Ue.createElement("thead",null,Ue.createElement("tr",null,i.map(s=>Ue.createElement("th",{key:s,"data-col-index":s},s)))),Ue.createElement("tbody",null,r.map(s=>Ue.createElement("tr",{key:s,"data-row-index":s},i.map(c=>Ue.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},Ue.createElement("button",{onClick:()=>{let u=n.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 jC={CheckBox:nn,LoadMask:Ka,MenuIcon:Ir,StringFilterEditor:Co,NumberFilterEditor:Ti};0&&(module.exports={CellSelectionState,DataClient,DataSource,DataSourceActionType,DeepMap,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createFlashingColumnCellComponent,debounce,debug,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceInternal,useDataSourceState,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},RS=o=>{let e="",t=o.split("|").map(l=>{let[s,c]=l.split("=");return s==="C"&&(e=c),{name:s,value:c}});if(!e)throw"Invalid license";let n=e.split(",").reverse(),r=n.pop();n.forEach((l,s)=>{let c=t[s];if($s(c.value)!==l)throw"Invalid license"});let i=[...t];i.pop();let a=i.map(l=>`${l.name}=${l.value}`).join("|");if($s(a)!==r)throw"Invalid license";return t=t.map(l=>({...l,value:decodeURI(l.value)})),IS(t)};var xS=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,PS=/(https):\/\/\S+(\.csb\.app)/g,Lm=typeof window<"u"?window.location.origin:"",DS=()=>{let[o,e,t]=Array.from(xS.exec(Lm)||[]);return e==="https"&&t==="sandpack.codesandbox.io"},MS=()=>{let[o,e,t]=Array.from(PS.exec(Lm)||[]);return e==="https"&&t===".csb.app"},ES=MS()||DS(),km=(o="")=>{let t=!!Ve();return(0,Nm.useMemo)(()=>{if(t)return!0;let r=Fm(o,{publishedAt:1624970570587,version:"7.4.0"});return!o&&!r&&ES?!0:r},[o,t])};var Yo=require("react");var AS=10;function zm(o,e,t){let n=(0,Yo.useRef)(!1),r=(0,Yo.useRef)(null);(0,Yo.useEffect)(()=>{o!=null&&(n.current=!1,Lt(r.current))},[o]),(0,Yo.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,Lt(r.current),r.current=Le(()=>{n.current=t.scrollCellIntoView(o[0],o[1],{offset:30}),!n.current&&l<AS&&a(l)})};var i=a;a()}return()=>{Lt(r.current)}},[o,e])}var qo=require("react"),_S=10;function Vm(o,e,t){let n=(0,qo.useRef)(!1),r=(0,qo.useRef)(null);(0,qo.useEffect)(()=>{o!=null&&(n.current=!1,cancelAnimationFrame(r.current))},[o]),(0,qo.useEffect)(()=>{if(o!=null&&!n.current){let a=function(l=0){l++,r.current=requestAnimationFrame(()=>{n.current=t.scrollRowIntoView(o,{offset:0}),!n.current&&l<_S&&a(l)})};var i=a;a()}return()=>{cancelAnimationFrame(r.current)}},[o,e])}var Gm=o=>`--infinite-${o}`;var Xo=require("react");function Hm(o,e){Us(o,e),FS(o,e),e.detail===2&&OS(o,e),o.getState().onCellClick?.(o,e)}function OS(o,e){if(Ri(e.target))return;let{onCellDoubleClick:t}=o.getState(),n={preventEdit:!1};if(t){let a=t(o,e);a&&typeof a=="object"&&(n={...n,...a})}if(n.preventEdit)return;let i=o.getComputed().computedVisibleColumns[o.colIndex];o.api.startEdit({rowIndex:o.rowIndex,columnId:i.id})}function FS(o,e){let{getDataSourceState:t,getState:n,getComputed:r,rowIndex:i,colIndex:a,dataSourceActions:l}=o,s=t(),{selectionMode:c,cellSelection:u}=s;if(!u||c!=="multi-cell")return;let{multiCellSelector:d,computedVisibleColumns:p}=r(),{brain:f,debugId:m}=n(),{rowsPerPage:g}=f,b=p.length,h=new He(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=!!n().wrapRowsHorizontally;d.multiSelectClick(y,S?{horizontalLayout:S,rowsPerPage:g,columnsPerSet:b}:{horizontalLayout:S})}else d.resetClick(y);l.cellSelection=h}function Us(o,e){let{rowIndex:t,getDataSourceState:n,getComputed:r,dataSourceActions:i,api:a,cloneRowSelection:l}=o,{multiRowSelector:s,renderSelectionCheckBox:c}=r(),u=n(),{selectionMode:d,groupBy:p,dataArray:f,isTree:m}=u;if(p.length||m||f[t]?.rowDisabled)return!1;if(d==="multi-row"){if(c&&!e.key)return!1;let{rowSelection: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=f[t].id;e.metaKey||e.ctrlKey?a.rowSelectionApi.toggleRowSelection(h):a.rowSelectionApi.selectRow(h)}return!1}function Km(o,e){e.detail!==2&&void 0}var NS={Enter:!0," ":!0,a:!0};function Bm(o,e){let{getState:t,getDataSourceState:n,dataSourceActions:r,api:i,dataSourceApi:a,cloneRowSelection:l,cloneTreeSelection:s}=o,{key:c,ctrlKey:u,metaKey:d}=e;if(!NS[c])return!1;let p=t(),f=n(),{activeRowIndex:m,activeCellIndex:g,keyboardNavigation:b,keyboardSelection:h}=p,{selectionMode:y,groupBy:S,rowSelection:C,treeSelectionState:T,isTree:v}=f;if(h===!1)return!1;let w=b==="row"&&m!=null?m:b==="cell"&&g!=null?g[0]:null,I=w!=null?f.dataArray[w]:null;if(!I||w==null)return!1;if(y==="single-row"&&c===" ")return i.rowSelectionApi.toggleRowSelection(I.id),!0;if(y!=="multi-row")return!1;if(c==="a"&&(u||d)){if(v&&T){let x=s(T);return x.selectAll(),r.treeSelection=x,!0}let R=l(C);return R.selectAll(),r.rowSelection=R,!0}if(c===" "){if(S.length)return I.isGroupRow&&I.groupKeys?i.rowSelectionApi.toggleGroupRowSelection(I.groupKeys):i.rowSelectionApi.toggleRowSelection(I.id),!0;if(v){if(I.isTreeNode&&I.nodePath)return a.treeApi.toggleNodeSelection(I.nodePath),!0}else{let R={...e},{renderSelectionCheckBox:x}=o.getComputed();return x&&(R.metaKey=!1,R.ctrlKey=!0),Us({...o,rowIndex:w},R)}}return!1}var Wm=["input","textarea","select","[tabindex]","a[href]","button","object"].join(", "),jm=o=>Array.from(o.querySelectorAll(Wm)).filter(t=>!!t.offsetParent),Da=o=>o.querySelector(Wm);var Um=G(Bn());async function $m(o,e=10,t=300){return new Promise((n,r)=>{let i=Date.now();function a(){if(Date.now()-i>t)return r(!1);if(!o()){setTimeout(a,e);return}n(!0)}a()})}var LS=10,kS=(o,e)=>o-e;function Ma(o,e){let{getComputed:t,getDataSourceState:n,getState:r,api:i,dataSourceApi:a}=e,{editingCell:l,isRowDetailEnabled:s}=r(),{dataArray:c}=n(),{computedVisibleColumns:u,computedColumnsMap:d}=t(),p=u[o.colIndex];if(!p)return!1;if(l&&l.columnId===p.id&&l.rowIndex===o.rowIndex)return!0;if(!p.contentFocusable)return!1;if(p.contentFocusable===!0)return!0;let f=c[o.rowIndex],m=!s||typeof s=="function"&&!s(f)?!1:i.rowDetailApi.isRowDetailExpanded(f.id)?"expanded":"collapsed",g=st(p.id,e);return p.contentFocusable({column:p,...Mo({column:p,rowInfo:f,columnsMap:d,context:e,rowDetailState:m}).formattedValueContext,columnApi:g,api:i,dataSourceApi:a})}function Ys(o,e,t){let n=t.getState().editingCell;return zS(o,e,t,{isCellFocusable:Ma,isColumnElligible:i=>n&&n.columnId===i.id?!0:!!i.contentFocusable})}function Ym(o,e,t){let n=(0,Um.default)(t,o+e,kS);return n<0&&(n=~n,e>0&&n>=t.length||e<0&&n===0)?null:t[n]??null}globalThis.getNextCol=Ym;function zS(o,e,t,n){let{isColumnElligible:r,isCellFocusable:i}=n,a=t.getComputed().computedVisibleColumns.filter(r).reduce((d,p)=>(d.push(p.computedVisibleIndex),d),[]);if(!a.length)return null;let{getDataSourceState:l}=t,{dataArray:s}=l(),c=o.rowIndex,u=o.colIndex;for(;c!=null||u!=null;){if(u=u===null?a[e===-1?a.length-1:0]:Ym(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 qm(o){let e={rowIndex:o.getDataSourceState().dataArray.length-1,colIndex:o.getComputed().computedVisibleColumns.length-1},t=Ma(e,o)?e:Ys(e,-1,o);if(t){await qs([t.rowIndex,t.colIndex],o);let n=o.getState().getDOMNodeForCell(t);if(!n)return;Da(n)?.focus()}}async function qs([o,e],t){let{api:n}=t;return new Promise((r,i)=>{let a=LS,l=null,s=!1;function c(u=0){u++,Lt(l),l=Le(async()=>{if(s=n.scrollCellIntoView(o,e,{offset:30}),!s&&u<a&&c(u),s){try{await $m(()=>!!t.getState().getDOMNodeForCell({rowIndex:o,colIndex:e}))}catch(d){i(d);return}r(!0)}})}c()})}var VS=`.${Xt}`;function Xm(o,e){if(e.key!=="Tab")return!1;let t=e.shiftKey?-1:1,n=e.target,r=o.getState().scrollerDOMRef.current,i=document.activeElement===r||n===r;if(!r||i&&t===-1)return!1;let a=i?null:wn(n,VS),l=null,s=null;if(a)l=Number(a.getAttribute("data-row-index")),s=Number(a.getAttribute("data-col-index"));else if(i){let{activeCellIndex:u}=o.getState();[l,s]=u||[0,0]}if(l==null||s==null||isNaN(l)||isNaN(s))return!1;let c=i&&Ma({colIndex:s,rowIndex:l},o)?{rowIndex:l,colIndex:s}:Ys({rowIndex:l,colIndex:s},t,o);if(!c){if(t===-1)r.focus();else{let u=jm(document.body),d=o.getState().focusDetectDOMRef.current,p=u.findIndex(m=>m===d);u[p+1]?.focus()}return!0}return qs([c.rowIndex,c.colIndex],o).then(()=>{let u=o.getState().getDOMNodeForCell(c);if(!u)return;Da(u)?.focus()}),!0}var Zm={control:"ctrl"},Qm={"control|cmd":"ctrl","cmd|control":"ctrl","ctrl|cmd":"ctrl","cmd|ctrl":"ctrl"},GS={esc:"escape"},eg={cmd:o=>o.metaKey,alt:o=>o.altKey,ctrl:o=>o.ctrlKey,shift:o=>o.shiftKey},tg=Object.keys(eg),Xs=new Set(tg),HS=new Set(["shift","alt"]);function Ea(o,e){return Array.isArray(e)?e.some(t=>Jm(o,t)):Jm(o,e)}function Jm(o,e){let t=o.key.toLowerCase(),n=e.split("+").map(p=>p.toLowerCase().trim()),r=n.find(p=>Qm[p]),i=n.map(p=>Zm[p]||Qm[p]||GS[p]||p),a=i.filter(p=>Xs.has(p)),l=i.filter(p=>!Xs.has(p)),s=tg.reduce((p,f)=>(p[f]=eg[f](o),p),{});r&&s.cmd&&(s.cmd=!1,s.ctrl=!0);let c=Object.keys(s).filter(p=>s[p]);if(!a.every(p=>s[p]===!0))return!1;if(l.includes("*")){if(c.length<a.length||c.filter(f=>!HS.has(f)).length)return!1}else if(a.length!=c.length)return!1;return!l.length||Xs.has(t)||t==="meta"||Zm[t]?!1:l.reduce((p,f)=>p?f==="*"||t===f:!1,!0)}async function ng(o,e){let t={...o,cloneRowSelection:a=>ua(a,o.getDataSourceState),cloneTreeSelection:a=>ma(a,o.getDataSourceState)},{onKeyDown:n}=o.getState(),r={preventEdit:!1,preventEditStop:!1,preventDefaultForTabKeyWhenEditing:!0,preventSelection:!1,preventNavigation:!1};if(n){let a=n(o,e);a&&typeof a=="object"&&(r={...r,...a})}if(!r.preventSelection&&Bm(t,e)&&e.preventDefault(),(Xm(t,e)||!o.getState().focusedWithin&&!r.preventNavigation&&om(t,e))&&e.preventDefault(),!r.preventEdit&&e.key==="Enter"&&!o.api.isEditInProgress()){let{activeCellIndex:a}=o.getState();if(a){let[l,s]=a,c=o.getComputed().computedVisibleColumns[s];c.computedEditable&&o.api.startEdit({rowIndex:l,columnId:c.id})}}o.api.isEditInProgress()&&(e.key==="Escape"&&!r.preventEditStop&&o.api.stopEdit({cancel:!0}),e.key==="Tab"&&r.preventDefaultForTabKeyWhenEditing&&e.preventDefault());let{keyboardShortcuts:i}=o.getState();if(i)for await(let a of i){if(!Ea(e,a.key)||a.when&&!await a.when(o))continue;let l=await a.handler(o,e);if(l&&l.stopNext)break}}function KS(){let{getState:o,actions:e,api:t,getComputed:n,getDataSourceMasterContext:r}=J(),{getState:i,componentActions:a,api:l}=De();return(0,Xo.useMemo)(()=>({getComputed:n,getDataSourceMasterContext:r,dataSourceApi:l,api:t,getState:o,actions:e,getDataSourceState:i,dataSourceActions:a,cloneTreeSelection:u=>ma(u,i),cloneRowSelection:u=>ua(u,i)}),[o,e,i,a,t,l,n])}function BS(){let o=KS();(0,Xo.useEffect)(()=>{let e=o.getState().keyDown.onChange(a=>{ng(o,a)});function t(a){if(!a)return;let l=a.event,s=o.getComputed().computedVisibleColumns[a.colIndex],c=st(s.id,o);Hm({...o,rowIndex:a.rowIndex,colIndex:a.colIndex,column:s,columnApi:c},{...l,key:""})}let n=o.getState().cellClick.onChange(t);function r(a){if(!a)return;let{event:l,rowIndex:s,colIndex:c}=a,u=o.getComputed().computedVisibleColumns[c],d=st(u.id,o);Km({...o,rowIndex:s,colIndex:c,column:u,columnApi:d},l)}let i=o.getState().cellMouseDown.onChange(r);return()=>{e(),n(),i()}},[])}function WS(){let{getState:o}=J();return{onKeyDown:(0,Xo.useCallback)(t=>{o().keyDown(t)},[])}}function og(){return BS(),WS()}var nc=require("react");var ze=G(require("react")),It=require("react"),sg=require("react-dom");function Zs(o){return!!o.tagName}function ag(o){let{alignTarget:e,alignAnchor:t,constrainTo:n,alignPosition:r}=o,i=Ce.from(Zs(e)?e.getBoundingClientRect():e),a=Ce.from(Zs(t)?t.getBoundingClientRect():t),l=n?Ce.from(Zs(n)?n.getBoundingClientRect():n):null;if(!l)return{...rg({anchorRect:a,targetRect:i,position:r[0]}),index:0};let s=null;for(let c=0,u=r.length;c<u;c++){let d=rg({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 rg(o){let e=Ce.from(o.targetRect),t=Ce.from(o.anchorRect),n=o.constrainRect?Ce.from(o.constrainRect):null,{position:r}=o,[i,a]=r,l=ig(e,i),s=ig(t,a),c=l.getDistanceToPoint(s);e.shift(c);let u=n?n.contains(e):!0;return{alignPosition:r,alignedRect:e,valid:u,distance:c}}function ig(o,e){return e==="TopLeft"?Ge.from({top:o.top,left:o.left}):e==="TopCenter"?Ge.from({top:o.top,left:o.left+(o.width>0?Math.round(o.width/2):0)}):e==="TopRight"?Ge.from({top:o.top,left:o.left+o.width}):e==="BottomLeft"?Ge.from({left:o.left,top:o.top+o.height}):e==="BottomCenter"?Ge.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+o.height}):e==="BottomRight"?Ge.from({left:o.left+o.width,top:o.top+o.height}):e==="CenterLeft"?Ge.from({left:o.left,top:o.top+(o.height>0?Math.round(o.height/2):0)}):e==="CenterRight"?Ge.from({left:o.left+o.width,top:o.top+(o.height>0?Math.round(o.height/2):0)}):Ge.from({left:o.left+(o.width>0?Math.round(o.width/2):0),top:o.top+(o.height>0?Math.round(o.height/2):0)})}var Aa="__is_infinite_menu_component";function jS(o){return o&&typeof o.then=="function"||o instanceof Promise}function cg(o){return o==null||typeof o=="string"?!1:typeof o.tagName=="string"}async function lg(o){return typeof o=="function"&&(o=o()),jS(o)&&(o=await o),typeof o=="string"&&(o=document.querySelector(o)),o&&cg(o)&&(o=o.getBoundingClientRect()),o?Ce.from(o):null}async function $S(o){let e=null;typeof o=="function"?e=o():e=o;function t(n){let r=null;return typeof n=="string"&&(r=document.querySelector(n)),cg(n)&&(r=n),r||null}return t(await e)}function US(o){return ze.createElement("div",{style:{position:"fixed",top:0,left:0}},o.children)}function YS(o){let e=ze.useRef(null);return(0,It.useEffect)(()=>o.realign.onChange(t=>{e.current&&t&&Qs(e.current,t)}),[o.realign]),ze.createElement("div",{style:{position:"absolute",top:0,left:0},ref:(0,It.useCallback)(t=>{t&&Qs(t,o),e.current=t},[])},typeof o.children=="function"?o.children():o.children)}async function Qs(o,e){let{constrainTo:t,alignTo:n,alignPosition:r}=e;Object.keys(n).length===2&&n.top!==void 0&&n.left!==void 0&&(n={...n,width:0,height:0}),typeof t=="boolean"&&(t=t?document.documentElement.getBoundingClientRect():void 0);let i=t&&await lg(t)||void 0,a=n?await lg(n):void 0,l=Ce.from(o.getBoundingClientRect());if(!a)return;let{alignedRect:s}=ag({constrainTo:i,alignAnchor:a,alignTarget:l,alignPosition:r});o.style.transform=`translate3d(${s.left}px,${s.top}px, 0px)`;let c=o.getBoundingClientRect();if(c.left!==s.left||c.top!==s.top){let u=o.offsetParent;if(u){let d=u.getBoundingClientRect(),p=d.left,f=d.top,m=s.left-p,g=s.top-f;o.style.transform=`translate3d(${m}px,${g}px, 0px)`}}}function ug(o,e){let[t,n]=(0,It.useState)(null);return(0,It.useLayoutEffect)(()=>{async function r(){let i=e?await $S(e):null;i!=null&&n(i)}e&&r()},[e]),e?t?(0,sg.createPortal)(o,t):ze.createElement(ze.Fragment,null):e===null||e===!1?o:ze.createElement(US,null,o)}function qS(o){if(ze.Children.count(o)===1){let e=ze.Children.only(o);if(ze.isValidElement(e))return e.props.id||e.key}return null}function XS(o,e,t){if(ze.Children.count(o)===1){let n=ze.Children.only(o);if(ze.isValidElement(n)&&n.type[Aa]){let r={};return n.props.portalContainer===void 0&&(r.portalContainer=e),n.props.constrainTo===void 0&&(r.constrainTo=t),ze.cloneElement(n,r)}}return o}function en(o){let e=o,[t]=(0,It.useState)(()=>new Map),[n,r]=(0,It.useState)(null),[i,a]=(0,It.useState)(0),l=(0,It.useCallback)(()=>{let m=[];for(let[g,b]of t)m.push(ze.createElement(YS,{...b,key:b.key}));return m},[]),[s,c]=Mt(),u=ug(l(),o.portalContainer),d=(0,It.useCallback)((m,g)=>{let h=`${g.id||qS(m)||Vt()}`,y=t.get(h),S=v=>()=>{let w=typeof v=="function"?v():v;return XS(w,e.portalContainer,g.constrainTo??e.constrainTo)},C=S(m),T=(v,w)=>{if(!y)return;let I=S(v);Object.assign(y,{children:I}),c(),!!!w?.skipRealign&&(r(y.key),a(Date.now()))};return y?(Object.assign(y,g),T(m),T):(y={key:h,children:C,alignPosition:g.alignPosition,alignTo:g.alignTo,constrainTo:g.constrainTo,realign:be()},t.set(y.key,y),c(),T)},[t,e.portalContainer,c]);ze.useEffect(()=>{if(n){let m=t.get(n);m&&m.realign(m)}},[n,i]);let p=m=>{m=`${m}`,t.has(m)&&(t.delete(m),c())},f=()=>{t.clear(),c()};return ze.useEffect(()=>{},[]),{portal:u,hideOverlay:p,clearAll:f,rerenderOverlays:c,showOverlay:d}}var Ig=G(require("react"));var Jo=G(require("react"));var Zo=G(require("react"));var $r=G(require("react"));function _a(o){return null}_a.defaultProps={__is_menu_item:!0};var dg="db3arf0 _16lm1iw0 _16lm1iw1 _16lm1iw1w _16lm1iw2f _16lm1iw8",pg=me({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"]]}),fg="db3arf1",mg="db3arfd";var ZS="-";function QS(){return $r.createElement("hr",{className:mg})}var Oa=({columns:o,keyboardActiveItemKey:e,activeItemKey:t,menuId:n},r)=>{let i=r&&(r.key!=null||r.label!=null)?r:null,a=i===null?r===ZS?$r.createElement(QS,null):r:null;return i!=null?{type:"item",parentMenuId:n,disabled:!!i.disabled,keyboardActive:i.key===e,active:i.key===t,value:i,span:i.span||1,key:i.key,menu:i.menu||null,style:i.style,className:i.className,originalMenuItem:i}:{type:"decoration",value:a,span:o.length,style:{gridColumnStart:1,gridColumnEnd:o.length+10}}};function gg(o,e){return $r.Children.map(e,t=>{if(t&&(t.props.__is_menu_item||t.type===_a)){let n={...t.props};return n.key||(n.key=t.key),n.description||(n.description=t.props.children),n.label||(n.label=n.children),Oa(o,n)}return Oa(o,t)})||[]}var hg="submenu";function bg(){let o=Zo.createRef();return{keyboardActiveItemKey:null,activeItemKey:null,generatedId:Vt(),focused:!1,destroyed:!1,domRef:o}}var yg=()=>({parentMenuId:1,parentMenuItemKey:1,onHideIntent:1,constrainTo:1,onAction:1,onShow:1,onHide:1,autoFocus:1,wrapLabels:1}),JS=[{name:"label"}],Tg=o=>{let{props:e,state:t}=o,{activeItemKey:n,keyboardActiveItemKey:r}=t,{items:i,children:a,addSubmenuColumnIfNeeded:l,parentMenuId:s}=e,c=e.id||t.generatedId;s&&(c=`${s}-${c}`);let u=[...e.columns||JS],d={columns:u,keyboardActiveItemKey:r,activeItemKey:n,menuId:c},p=[];i?p=i.map(Oa.bind(null,d)):!i&&typeof a!="function"&&(p=gg(d,a)),l&&p.filter(g=>g.type==="item"&&g.menu!=null).length>0&&!u.find(g=>g.name==hg)&&u.push({name:hg,render:({domProps:g,item:b})=>b.menu?Zo.createElement("div",{...g},Zo.createElement(Yn,{expanded:!1})):Zo.createElement("div",{...g})});let f=p.filter(m=>m.type==="item"&&!m.disabled);return{runtimeItems:p,runtimeSelectableItems:f,columns:u,menuId:c}};var Kt=G(require("react")),rt=require("react");var Ur=class extends xo{constructor(e){super(e.slice(0,3))}};var eC=250;function tC(o,e=100){let t=Date.now();return new Promise(n=>{let r,i=()=>{if(r=o(),r!==void 0){n(r);return}if(Date.now()-t>e){n(void 0);return}Le(i)};Le(()=>{i()})})}var nC=we(),Fa=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||eC;this.getPointerMoveTarget=()=>document.documentElement||nC;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 Ge({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 Ur([this.activeItemLeavePoint,this.activeItemMenuRect.getTopLeft(),this.activeItemMenuRect.getBottomLeft()]):new Ur([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,tC(()=>this.activeItem!=e?!1:this.params.getMenuRectFor(e)).then(n=>{this.activeItem==e&&n&&(this.activeItemMenuRect=n)})}};this.onItemChange=(e,t,n)=>{if(clearTimeout(this.menuLeaveTimeoutId),clearTimeout(this.mouseMoveTimeoutId),!e){this.removePointerMoveListener(),t===this.activeItem&&(this.activeItemLeavePoint=new Ge({left:n.clientX,top:n.clientY})),this.setupMenuLeaveTracking();return}if(this.currentHoveredItem=t,!this.activeItem||!this.params.itemHasSubMenu(this.activeItem)){this.setActiveItem(t,n.target);return}this.onPointerMoveWhileActiveItem(),this.getPointerMoveTarget().addEventListener("pointermove",this.onPointerMoveWhileActiveItem)};this.getHandlers=()=>({onItemEnter:(e,t)=>{this.onItemChange(!0,e,t)},onItemLeave:(e,t)=>{this.onItemChange(!1,e,t)}});this.params=e}};var Na=require("react"),Js=(0,Na.createContext)(null);function ec(){return(0,Na.useContext)(Js)}var Qo=require("react");function Sg(){let o=(0,Qo.useRef)(!0);return(0,Qo.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]),(0,Qo.useCallback)(()=>o.current,[])}function oC(o,e){let{parentMenuId:t,setSubmenuApi:n,setActiveItemKey:r,setKeyboardActiveItemKey:i,constrainTo:a,onHideIntent:l,api:s}=e,c=`${t}-submenu`,u=o.menu;return u?(typeof u=="function"&&(u=u()),Kt.createElement(Bt,{key:c,parentMenuItemKey:o.key,parentMenuId:t,constrainTo:a,...u,autoFocus:!1,onShow:(d,p)=>{u?.onShow?.(d,p),n(p)},onHideIntent:d=>{u?.onHideIntent?.(d),l(d)},onHide:d=>{d.focused&&(r(null),i(o.key),s.focus())}})):null}function rC(o,e){let t=Cg(o,e);if(!t.length)return null;let n=Ce.from(t[0]?.getBoundingClientRect()),r=Ce.from(t[t.length-1].getBoundingClientRect()),i=n;return i.width=r.left+r.width-n.left,i}function Cg(o,e){let t=wn(document.querySelector(`[data-menu-id="${o}"] [data-menu-item-key="${e}"]`),`[data-menu-id="${o}"]`);if(!t)return[];let n=t.querySelectorAll(`[data-menu-item-key="${e}"]`);return Array.from(n)}function iC(o,e){let t=Cg(o,e);if(!t.length)return null;for(let n of t){let r=n.querySelector('input[type="checkbox"]');if(r)return r}return null}function aC({onItemActivate:o}){let{getState:e}=ec(),[{onItemEnter:t,onItemLeave:n}]=(0,rt.useState)(()=>new Fa({parentMenuId:e().parentMenuId,onItemActivate:r=>{if(!r){o(null);return}let i=e().runtimeItems.filter(a=>a.type==="item"&&a.key===r)[0];o(i)},itemHasSubMenu:r=>!!e().runtimeItems.filter(a=>a.type==="item"&&a.key===r&&a.menu)[0],getMenuRectFor:r=>{let i=`[data-submenu-for="${r}"]`,a=document.querySelector(i);return a?Ce.from(a.getBoundingClientRect()):void 0}}).getHandlers());return{onItemEnter:(0,rt.useCallback)(t,[]),onItemLeave:(0,rt.useCallback)(n,[])}}function wg(o){let{domProps:e}=o,{componentState:{columns:t,runtimeItems:n,menuId:r,activeItemKey:i,keyboardActiveItemKey:a,constrainTo:l,destroyed:s,onAction:c,wrapLabels:u,onShow:d,onHide:p,autoFocus:f,parentMenuItemKey:m,domRef:g},componentActions:b,getState:h}=ec(),y=(0,rt.useCallback)(H=>{b.keyboardActiveItemKey=H},[]),S=(0,rt.useCallback)(H=>{b.activeItemKey=H},[]),C=Sg(),[T,v]=(0,rt.useState)(null),w=null;(0,rt.useLayoutEffect)(()=>{let{runtimeItems:H}=h(),U=H.filter(ie=>ie.type==="item"&&i===ie.key)[0];if(!U||!U.menu){v(null),E();return}if(U){let ie=rC(r,U.key);ie&&R(()=>oC(U,{constrainTo:l,setSubmenuApi:v,setActiveItemKey:S,setKeyboardActiveItemKey:y,parentMenuId:r,onHideIntent:L,api:X}),{id:`${r}-submenu`,alignTo:ie,alignPosition:[["TopLeft","TopRight"],["TopRight","TopLeft"]],constrainTo:l});return}},[i]);let I=(H,U)=>{y(U.key),S(U.key),U.originalMenuItem.onClick&&U.originalMenuItem.onClick(H);let ie={key:U.key,item:U.originalMenuItem,hideMenu:L};U.originalMenuItem.onAction&&U.originalMenuItem.onAction(ie),c&&c(ie),U.originalMenuItem.hideMenuOnAction&&L()},{showOverlay:R,portal:x,clearAll:E}=en({portalContainer:!1}),{onItemEnter:A,onItemLeave:M}=aC({onItemActivate:H=>{if(!C())return;let U=H?H.key:null;S(U)}});w=n.map((H,U)=>Kt.createElement(lC,{key:H.type==="item"?H.key:U,onItemEnter:(ie,se)=>{A(ie.key,se)},onItemLeave:(ie,se)=>{M(ie.key,se)},columns:t,active:H.type==="item"&&H.key===i,keyboardActive:H.type==="item"&&H.key===a,item:H,index:U,onClick:I}));let P=t.map(H=>H.width||(typeof H.flex=="number"?`${H.flex}fr`:H.flex)||"auto").join(" "),_={...e.style,gridTemplateColumns:P,gridTemplateRows:n.map(()=>"auto").join(" ")};u||(_.whiteSpace="nowrap");function D(H){let{runtimeItems:U,runtimeSelectableItems:ie}=h(),se=U.findIndex(K=>K.type==="item"&&K.key===a),pe=a,fe=U[se],ne={ArrowUp:()=>{let K=U.slice(0,se).filter(k=>k.type==="item"&&!k.disabled).pop();K&&K.type==="item"&&K.key&&(pe=K.key)},ArrowDown:()=>{let K=U.slice(se+1).filter(k=>k.type==="item"&&!k.disabled)[0];K&&K.type==="item"&&K.key&&(pe=K.key)},Home:()=>{ne.PageUp()},End:()=>{ne.PageDown()},PageUp:()=>{pe=ie[0].key},PageDown:()=>{pe=ie[ie.length-1].key},ArrowLeft:()=>{S(null),h().parentMenuId&&(b.destroyed=!0)},ArrowRight:()=>{fe&&(S(fe.key),Le(()=>{C()&&T&&T.getParentMenuId()===h().menuId&&T.focus()}))},Enter:()=>{if(fe)if(fe.originalMenuItem?.menu){if(fe&&fe.originalMenuItem.menu&&T){ne.ArrowLeft();return}fe&&S(fe.key)}else I(H,fe)}," ":()=>{if(!fe)return;fe.originalMenuItem.menu||I(H,fe);let K=iC(r,fe.key);K&&K.click()},Escape:()=>{ne.ArrowLeft();let K=h();K.parentMenuId||K.onHideIntent?.(K)}},ge=ne[H.key];ge&&(ge(),H.preventDefault()),pe!=a&&y(pe)}function F(){b.focused=!1}let N=(0,rt.useCallback)(function(){b.focused=!0,setTimeout(()=>{W.current&&g.current&&g.current===document.activeElement&&h().keyboardActiveItemKey==null&&y(h().runtimeSelectableItems[0]?.key??null)})},[]),W=(0,rt.useRef)(!0),L=(0,rt.useCallback)(()=>{let H=h();H.onHideIntent?.(H)},[h]),[X]=(0,rt.useState)(()=>({hideMenu:L,focus:()=>{g.current&&(g.current.focus(),setTimeout(()=>{g.current&&g.current!==document.activeElement&&g.current.focus()},10),N())},getMenuId:()=>h().menuId,getParentMenuId:()=>h().parentMenuId})),le=(0,rt.useCallback)(H=>{H?(g.current=H,d?.(h(),X),f&&X.focus()):(p?.(h()),g.current=H)},[]),ae=Kt.createElement("div",{className:ho.contents},Kt.createElement("div",{...e,"data-menu-id":r,"data-submenu-for":m,tabIndex:0,ref:le,onKeyDown:H=>{e.onKeyDown?.(H),D(H)},onMouseDown:H=>{W.current=!1,e.onMouseDown?.(H)},onMouseUp:H=>{W.current=!0,e.onMouseUp?.(H)},onFocus:N,onBlur:F,className:Z(dg,e.className,"InfiniteMenu"),style:_},w),x);return s?null:ae}function lC(o){let[e,t]=Kt.useState(!1),{columns:n,item:r,index:i,active:a,keyboardActive:l}=o,s=r.type==="item"?r.value.key:i,c=null;if(r.type==="decoration")c=Kt.createElement("div",{style:r.style},r.value);else{let u=0;c=n.map((d,p)=>{let f=r.value,m=d.field||d.name,g=p+1,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:Z(pg({active:a,disabled:!!r.disabled,keyboardActive:l,pressed:e||o.active}),r.className),onPointerEnter:S=>{r.disabled||o.onItemEnter?.(r,S)},onPointerLeave:S=>{r.disabled||o.onItemLeave?.(r,S)},onMouseDown:()=>{r.disabled||t(!0)},onMouseUp:()=>{r.disabled||t(!1)},onClick:S=>{r.disabled||o.onClick(S,r)}};return d.render?Kt.createElement(Rr,{key:`${s}-${m}`,render:d.render,renderParam:{item:f,column:d,value:f[m],domProps:y}}):Kt.createElement("div",{key:`${s}-${m}`,...y},f[m])}).filter(Boolean)}return Kt.createElement("div",{className:fg},c)}var{ManagedComponentContextProvider:sC}=Et({initSetupState:bg,forwardProps:yg,mapPropsToState:Tg,layoutEffect:!0});function cC(o){let{componentActions:e,componentState:t}=$e(),n=Me(t);return Jo.createElement(Js.Provider,{value:{componentActions:e,componentState:t,getState:n}},Jo.createElement(wg,{domProps:o.domProps}))}function Bt(o){let{children:e,portalContainer:t,items:n,parentMenuId:r,addSubmenuColumnIfNeeded:i=!0,bubbleActionsFromSubmenus:a=!0,onShow:l,onHide:s,wrapLabels:c=!1,onAction:u,constrainTo:d,columns:p,parentMenuItemKey:f,autoFocus:m,id:g,onHideIntent:b,__is_infinite_menu_component:h,...y}=o;return Jo.createElement(sC,{addSubmenuColumnIfNeeded:i,bubbleActionsFromSubmenus:a,wrapLabels:c,...o},Jo.createElement(cC,{domProps:y}))}Bt[Aa]=!0;var tc=G(require("react"));function vg(o,e){let{columnApi:t,column:n,getComputed:r,api:i,dataSourceApi:a}=e,s=t.isSortable()?[{key:"sort-asc",label:"Sort Ascending",disabled:n.computedSortedAsc,onAction:()=>{i.setSortingForColumn(n.id,1)}},{key:"sort-desc",label:"Sort Descending",disabled:n.computedSortedDesc,onAction:()=>{i.setSortingForColumn(n.id,-1)}},{key:"sort-none",label:"Unsort",disabled:!n.computedSorted,onAction:()=>{i.setSortingForColumn(n.id,null)}},"-"]:[];return[...n.groupByForColumn?[{key:"collapse-all",label:"Collapse All",onAction:()=>{i.collapseAllGroupRows()}},"-"]:[],...s,n.computedFilterable?{key:"clear-filter",label:"Clear Filter",disabled:!n.computedFiltered,onAction:()=>{i.clearColumnFilter(n.id)}}:null,n.computedFilterable?"-":null,{key:"pin-start",label:"Pin to start",disabled:n.computedPinned==="start",onAction:()=>{i.setPinningForColumn(n.id,"start")}},{key:"unpin",label:"Unpin",disabled:!n.computedPinned,onAction:()=>{i.setPinningForColumn(n.id,!1)}},"-",{key:"columns",label:"Columns",menu:()=>{let u=[];return r().computedColumnsMapInInitialOrder.forEach((p,f)=>{let m=Kn(p,e,"column-menu");u.push({key:f,label:m,check:tc.createElement(rn,{key:p.id,disabled:p.computedVisible&&i.getVisibleColumnsCount()===1,checked:p.computedVisible,onChange:g=>{let b=!!g;i.setVisibilityForColumn(p.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((p,f)=>{if(p.groupByForColumn)return;let m=Kn(p,e,"column-menu");u.push({key:f,label:m,check:tc.createElement(rn,{key:p.id,disabled:!p.computedGroupable,checked:p.computedGroupedBy,onChange:()=>{a.toggleGroupByField(p.field)}})})}),{columns:[{name:"check"},{name:"label"}],items:u}}}].filter(u=>!!u)}function Rg(o,e,t){if(o==null)return null;let{getComputed:n,getState:r}=e,{components:i,getColumnMenuItems:a}=r(),l=i?.Menu??Bt,s=n().computedColumnsMap.get(o);if(!s)return null;let c={column:s,columnApi:st(s.id,e),...e},u=vg([],c),d=a?a(u,c):u,p=m=>{m.__insideMenu=!0},f=m=>{m.domRef.current?.parentNode?.removeEventListener("mousedown",p)};return!d||!d.length?null:Ig.createElement(l,{autoFocus:!0,items:d,onShow:m=>{m.domRef.current?.parentNode?.addEventListener("mousedown",p)},onHide:f,onHideIntent:m=>{f(m),t?.()}})}var uC=`[${es["data-name"]}="${ts["data-name"]}"]`;function dC(o){let{columnId:e,context:t,clearAll:n,showOverlay:r}=o,{getState:i,actions:a}=t,{columnMenuTargetRef:l,domRef:s}=i();function c(){n(),a.columnMenuVisibleForColumnId=null}let u=o.target;if(u||(u=l.current??void 0,u&&!s.current.contains(u)&&(u=void 0)),!u){let d=`[${tf["data-column-id"]}="${e}"] ${uC}`;u=i().domRef.current.querySelector(d)}if(!u){console.warn(`Cannot show column menu for column "${e}"`);return}l.current=null,r(()=>Rg(e,t,c),{constrainTo:s.current,id:"column-menu",alignTo:u,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]})}function xg(){let o=J(),e=Ve(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=en({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});(0,nc.useEffect)(()=>{let{actions:c,getState:u}=o,d=u();return d.onColumnMenuClick.onChange(p=>{p&&(d.columnMenuTargetRef.current=p.target,c.contextMenuVisibleFor=null,c.cellContextMenuVisibleFor=null,c.filterOperatorMenuVisibleForColumnId=null,c.columnMenuVisibleForColumnId=p.column.id)})},[]);let{columnMenuVisibleForColumnId:l,columnMenuVisibleKey:s}=t();return(0,nc.useEffect)(()=>{let{columnMenuVisibleForColumnId:c,columnMenuTargetRef:u}=t();if(c){let p=function(f){f.__insideMenu!==!0&&(a(),n.columnMenuVisibleForColumnId=null)};var d=p;return document.documentElement.addEventListener("mousedown",p),dC({columnId:c,context:o,clearAll:a,showOverlay:r}),()=>{document.documentElement.removeEventListener("mousedown",p)}}else u.current=null,a();return()=>{}},[l,s]),{menuPortal:i}}var Pg=G(require("react")),Dg=require("react");var pC={width:0,height:0,overflow:"hidden",pointerEvents:"none",outline:"none",zIndex:-1};function Mg(){let{getState:o,api:e,actions:t,getComputed:n,dataSourceApi:r,dataSourceActions:i}=J(),{getState:a,getDataSourceMasterContext:l}=De(),{focusDetectDOMRef:s}=o(),c=(0,Dg.useCallback)(async()=>{qm({getDataSourceState:a,getDataSourceMasterContext:l,getComputed:n,actions:t,dataSourceActions:i,api:e,getState:o,dataSourceApi:r})},[]);return Pg.createElement("div",{onFocus:c,ref:s,tabIndex:0,style:pC})}var er=require("react");function fC(){let o=J(),{getState:e}=o,{editingCell:t}=e(),n=t&&!t.active?t.cancelled:void 0;(0,er.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,initialValue:a}=e().editingCell,{onEditCancelled:l}=e();l?.({...Ct({rowIndex:r,columnId:i,...o}),initialValue:a})}},[n])}function mC(){let o=J(),{getState:e,state:{editingCell:t}}=o,n=t&&!t.active&&t.accepted instanceof Error?t.accepted:void 0;(0,er.useEffect)(()=>{if(n){let{rowIndex:r,columnId:i,value:a,initialValue:l}=e().editingCell,{onEditRejected:s}=e();s?.({...Ct({rowIndex:r,columnId:i,...o}),value:a,error:n,initialValue:l})}},[n])}function gC(){let o=J(),{state:{editingCell:e}}=o,t=e?.active,n=Tn(t);(0,er.useEffect)(()=>{!t&&n&&o.api.focus()},[t,n])}function hC(){let o=J(),{state:{editingCell:e},getState:t}=o,n=e&&!e.active&&!e.cancelled&&e.accepted===!0;(0,er.useEffect)(()=>{if(n){let{editingCell:r}=t(),{value:i,rowIndex:a,columnId:l,initialValue:s}=r,c={...Ct({rowIndex:a,columnId:l,...o}),value:i,initialValue:s};t().onEditAccepted?.(c),o.api.persistEdit({value:i})}},[n])}function bC(){let o=J(),{state:{editingCell:e},getState:t}=o,n=e?e.persisted:void 0;(0,er.useEffect)(()=>{if(n){let{editingCell:r,onEditPersistError:i,onEditPersistSuccess:a}=t();if(!r)return;let{rowIndex:l,columnId:s,value:c,initialValue:u}=r,d={...Ct({rowIndex:l,columnId:s,...o}),value:c,initialValue:u};n instanceof Error?i?.({...d,error:n}):a?.(d)}},[n])}function Eg(){fC(),mC(),hC(),bC(),gC()}var ic=require("react");var kn=G(require("react"));var oc=G(require("react")),La=o=>oc.createElement(Ne,{...o},oc.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=G(require("react")),Ag=o=>rc.createElement(Ne,{...o},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 _g(o,e,t){if(o==null)return null;let{getComputed:n,getState:r,getDataSourceState:i,actions:a,dataSourceApi:l,dataSourceActions:s,api:c}=e,{components:u,getFilterOperatorMenuItems:d}=r(),p=u?.Menu??Bt,f=n().computedColumnsMap.get(o);if(!f)return null;let m=w=>{w.__insideMenu=!0},g=w=>{w.domRef.current?.parentNode?.removeEventListener("mousedown",m)},{filterTypes:b}=i(),h=b[f.computedFilterType];if(!h)return null;let y=h.operators.map(w=>{let I=w.name,R=f.computedFilterValue?f.computedFilterValue.filter.operator===I:I===h.defaultOperator,x=w.components?.Icon??To;return{key:I,icon:kn.createElement(x,null),label:kn.createElement(kn.Fragment,null,w.label??w.name),onAction:()=>{c.setColumnFilterOperator(o,I)},checked:R?kn.createElement(Ag,{size:16}):null}}),C=[...[{key:"close",label:"Close Menu",icon:null,onAction:()=>{c.hideFilterOperatorMenu()}},{key:"reset",label:"Reset",icon:kn.createElement(La,null),disabled:!f.computedFiltered,onAction:()=>{c.clearColumnFilter(o)}},"-"],...y],T={column:f,api:c,getState:r,getDataSourceState:i,getComputed:n,actions:a,dataSourceApi:l,dataSourceActions:s,columnFilterValue:f.computedFilterValue,filterTypes:b},v=d?d(C,T):C;return kn.createElement(p,{autoFocus:!0,columns:[{name:"icon"},{name:"label"},{name:"checked"}],items:v,onShow:w=>{w.domRef.current?.parentNode?.addEventListener("mousedown",m)},onHide:g,onHideIntent:w=>{g(w),t?.()}})}var ka=10;function Og(){let o=J(),e=Ve(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=en({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,ic.useEffect)(()=>{let{actions:l,getState:s}=o;return s().onFilterOperatorMenuClick.onChange(u=>{if(!u)return;let{target:d,column:p}=u;function f(){a(),l.filterOperatorMenuVisibleForColumnId=null}let m=d?.parentElement||d,g=Ce.from(m.getBoundingClientRect());g.top-=ka,g.left-=ka,g.width+=2*ka,g.height+=2*ka,r(()=>_g(p.id,o,f),{constrainTo:s().domRef.current,id:"filter-operator-menu",alignTo:g,alignPosition:[["TopLeft","BottomLeft"],["TopRight","BottomRight"]]}),l.contextMenuVisibleFor=null,l.cellContextMenuVisibleFor=null,l.columnMenuVisibleForColumnId=null,l.filterOperatorMenuVisibleForColumnId=p.id})},[]),(0,ic.useEffect)(()=>{let{filterOperatorMenuVisibleForColumnId:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.filterOperatorMenuVisibleForColumnId=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().filterOperatorMenuVisibleForColumnId]),{menuPortal:i}}var Yr=require("react");var cc=G(require("react"));var ac=G(require("react"));function za(o){let e=o?Array.isArray(o)?o:o.items:null,t=o&&!Array.isArray(o)?o.columns:void 0;return{items:e,columns:t}}function lc(o){let e=r=>{r.__insideMenu=!0},t=r=>{r.domRef.current?.parentNode?.removeEventListener("mousedown",e)};return{columns:[],items:[],autoFocus:!0,onShow:r=>{r.domRef.current?.parentNode?.addEventListener("mousedown",e)},onHide:t,onHideIntent:r=>{t(r),o.onHideIntent?.()}}}function sc(o,e,t){if(!o)return null;let n=be();return o.then(r=>{let{items:i,columns:a}=za(r);i&&i.length&&n(ac.createElement(t,{...e,items:i||[],columns:a}))}),ac.createElement(Dn,{updater:n})}function Fg(o,e,t){let{columnId:n,rowIndex:r,event:i}=o,{getComputed:a,getState:l}=e,{components:s,getCellContextMenuItems:c}=l(),u=s?.Menu??Bt,{computedColumnsMap:d}=a(),p=d.get(n),f={...Ct({...e,rowIndex:r,columnId:p.id}),event:i};if(!p||!c)return{cellContext:f,menu:null,preventDefault:!1};let m=lc({onHideIntent:t}),g=c(f,e),b=g instanceof Promise||Array.isArray(g)?!0:!!(g&&Array.isArray(g.items));if(g instanceof Promise)return{cellContext:f,menu:sc(g,m,u),preventDefault:b};let{items:h,columns:y}=za(g);return!h||!h.length?{cellContext:f,menu:null,preventDefault:Array.isArray(h)}:{preventDefault:b,menu:cc.createElement(u,{...m,columns:y,items:h}),cellContext:f}}function Ng(o,e,t){let{getState:n,getComputed:r}=e,{components:i,getContextMenuItems:a}=n(),l=i?.Menu??Bt,{computedColumnsMap:s}=r(),c=o.columnId?s.get(o.columnId):void 0,u=c?{...o,...Ct({...e,rowIndex:o.rowIndex,columnId:c.id})}:o;if(!a)return{cellContext:u,menu:null,preventDefault:!1};let d=lc({onHideIntent:t}),p=a(u,e),f=p instanceof Promise||Array.isArray(p)?!0:!!(p&&Array.isArray(p.items));if(p instanceof Promise)return{cellContext:u,menu:sc(p,d,l),preventDefault:f};let{items:m,columns:g}=za(p);return!m||!m.length?{cellContext:u,menu:null,preventDefault:Array.isArray(m)}:{preventDefault:f,menu:cc.createElement(l,{...d,columns:g,items:m}),cellContext:u}}var Va=5,Lg=[["TopLeft","BottomLeft"],["TopRight","BottomRight"],["BottomLeft","BottomLeft"],["BottomRight","BottomRight"],["TopCenter","TopLeft"],["BottomCenter","TopLeft"],["CenterLeft","TopLeft"],["CenterRight","TopLeft"]];function kg(){let o=J(),e=Ve(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=en({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,Yr.useEffect)(()=>{let{actions:l,getState:s,getDataSourceState:c}=o;return s().cellContextMenu.onChange(d=>{if(!d)return;let{event:p}=d;function f(){a(),l.cellContextMenuVisibleFor=null}let{menu:m,cellContext:g,preventDefault:b}=Fg(d,o,f),h=Ce.fromPoint({top:p.clientY,left:p.clientX});h.width+=Va,h.height+=Va,r(m,{constrainTo:s().domRef.current,id:"cell-context-menu",alignTo:h,alignPosition:Lg}),b&&p.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},p)})},[]),(0,Yr.useEffect)(()=>{let{cellContextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.cellContextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().cellContextMenuVisibleFor]),{menuPortal:i}}function zg(){let o=J(),e=Ve(),{getState:t,actions:n}=o,{showOverlay:r,portal:i,clearAll:a}=en({portalContainer:e?e.getMasterState().portalDOMRef.current:!1});return(0,Yr.useEffect)(()=>{let{actions:l,getState:s}=o;return s().contextMenu.onChange(u=>{if(!u)return;let{event:d}=u;function p(){a(),l.contextMenuVisibleFor=null}let{menu:f,cellContext:m,preventDefault:g}=Ng(u,o,p),b={top:d.clientY,left:d.clientX},h=Ce.fromPoint(b);h.width+=Va,h.height+=Va,r(f,{constrainTo:s().domRef.current,id:"table-context-menu",alignTo:h,alignPosition:Lg}),g&&d.preventDefault(),l.contextMenuVisibleFor={point:b,...u};let{onContextMenu:y}=s();y&&y({...o,...m},d)})},[]),(0,Yr.useEffect)(()=>{let{contextMenuVisibleFor:l}=t();if(l){let c=function(u){u.__insideMenu!==!0&&(a(),n.contextMenuVisibleFor=null)};var s=c;return document.documentElement.addEventListener("mousedown",c),()=>{document.documentElement.removeEventListener("mousedown",c)}}else a();return()=>{}},[t().contextMenuVisibleFor]),{menuPortal:i}}var Vg=require("react"),Gg=G(require("react"));var Ga=require("react");function Ha(o,e){let{state:{brain:t}}=J(),n=(0,Ga.useCallback)(o,e);(0,Ga.useEffect)(()=>t.onScroll(n),[t,n])}var uc="yzx0vj0";function Hg(o){let{width:e,maxWidth:t,minWidth:n,scrollable:r,...i}=o,a=(0,Vg.useRef)(null);Ha(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=ue.runtime.totalVisibleColumnsWidthValue:e==="viewport"&&(l.width=ue.runtime.bodyWidth),n==="column"?l.minWidth=ue.runtime.totalVisibleColumnsWidthValue:n==="viewport"&&(l.minWidth=ue.runtime.bodyWidth),t==="column"?l.maxWidth=ue.runtime.totalVisibleColumnsWidthValue:t==="viewport"&&(l.maxWidth=ue.runtime.bodyWidth),Gg.createElement("div",{ref:a,...i,className:i.className?Z(i.className,uc):uc,style:l},i.children)}var yC=q($.columnWidthAtIndex),TC=q($.columnOffsetAtIndex);function Kg(){return J().computed.computedVisibleColumns.map(e=>({id:e.id,width:e.computedWidth,cssVarForWidth:`var(${yC}-${e.computedVisibleIndex})`,offset:e.computedOffset,cssVarForOffset:`var(${TC}-${e.computedVisibleIndex})`,pinned:e.computedPinned}))}var Ka="InfiniteTable";var Bg=require("react");function Wg(){let{getState:o,actions:e,dataSourceActions:t,getDataSourceState:n}=J(),{groupBy:r,isTree:i}=n(),a=o(),{brain:l,wrapRowsHorizontally:s}=a,c=a.repeatWrappedGroupRows;s||(c=!1),(0,Bg.useEffect)(()=>{if(!s){n().repeatWrappedGroupRows&&(t.repeatWrappedGroupRows=!1);return}let u=()=>{let{rowsPerPage:f,repeatWrappedGroupRows:m}=n(),g=!1,b=l.rowsPerPage,h=(r&&r.length>0||i)&&b>0?b:null;return f!=h&&(t.rowsPerPage=h,g=!0),m!=c&&(t.repeatWrappedGroupRows=c??!1,g=!0),g};u();let d,p=l.onVerticalRenderRangeChange(()=>{u()&&(d=setTimeout(()=>{e.forceBodyRerenderTimestamp=Date.now()}))});return()=>{d&&clearTimeout(d),p()}},[l,s,r,i,c])}var so=require("react");var qr=me({defaultClassName:"_143ofgf0",variantClassNames:{active:{true:"_143ofgf1",false:"_143ofgf2"}},defaultVariants:{},compoundVariants:[]}),jg="_143ofgf5",$g="_143ofgf3";var SC=q(ue.loaded),dc={source:"infinite-table-page",target:"infinite-table-devtools-background"};function Ug(o,e){let{type:t,debugId:n}=o;if(t==="unmount")return{...dc,url:pc(),type:t,payload:{debugId:n}};let r=e,i=r.getComputed(),a=r.getDataSourceState(),l=r.getState();return{...dc,url:pc(),type:t,payload:{debugId:n,columnVisibility:l.columnVisibility,columnOrder:i.computedColumnOrder,visibleColumnIds:i.computedVisibleColumns.map(c=>c.id),selectionMode:a.selectionMode,columns:Object.fromEntries(i.computedVisibleColumns.map(c=>[c.id,{field:c.field,dataType:c.computedDataType,sortType:c.computedSortType,filtered:c.computedFiltered,sorted:c.computedSorted,width:c.computedWidth}])),groupRenderStrategy:l.groupRenderStrategy,groupBy:a.groupBy.map(c=>c.field?`${c.field}`:"<fn>"),sortInfo:(a.sortInfo||[]).filter(c=>typeof c.field=="string").map(c=>({field:`${c.field}`,dir:c.dir,type:Array.isArray(c.type)?c.type[0]:c.type??"string"})),multiSort:a.multiSort,devToolsDetected:l.devToolsDetected,debugTimings:Object.fromEntries(a.debugTimings),debugWarnings:{...Object.fromEntries(a.debugWarnings),...Object.fromEntries(l.debugWarnings)}}}}var pc=at(function(){let o=new URL(window.location.href);return o.origin+o.pathname});function CC(o){window.postMessage(o)}var wC=at(()=>{console.log("Infinite Table DevTools detected!");let o=(e,t)=>{if(t){Ot.set(e,t);let{devToolsDetected:n}=t.getState();n||(t.actions.devToolsDetected=!0);let r=t.getDataSourceState();r.debugId!==e&&(t.dataSourceActions.debugId=e),r.devToolsDetected||(t.dataSourceActions.devToolsDetected=!0),window.postMessage(Ug({type:"update",debugId:e},t))}else kf(e),window.postMessage(Ug({type:"unmount",debugId:e},null))};return window.__INFINITE_TABLE_DEVTOOLS_HOOK__=o,Ke.onLogIntent("IT:*",e=>{CC({...dc,url:pc(),type:"log",payload:{debugId:void 0,channel:e.channel,color:e.color,args:e.args.map(t=>{if(typeof t=="object"&&t!==null){let n="";try{n=JSON.stringify(t)}catch{console.error("Cannot stringify arg in global log interceptor",t)}return n}return String(t)}),timestamp:e.timestamp}})}),o});function Yg(){let{getState:o,getDataSourceState:e,dataSourceActions:t}=J(),n=o(),{domRef:r,debugId:i}=n;return i&&r.current&&getComputedStyle(r.current).getPropertyValue(SC)!==`${Hu}`&&Kr({debugId:i,key:"CSS001_CSS"}),(0,so.useEffect)(()=>{e().debugId!==i&&(t.debugId=i)},[i]),RC()}var Ba=be(),vC={revertAll:o=>{let e=Ot.get(o.debugId);if(e){let t=Fn.get(o.debugId);Fn.delete(o.debugId),un.delete(o.debugId),t&&Object.keys(t).forEach(r=>{e.actions[r]=t[r],delete t[r]});let n=pn.get(o.debugId);pn.delete(o.debugId),dn.delete(o.debugId),n&&Object.keys(n).forEach(r=>{e.dataSourceActions[r]=n[r],delete n[r]})}},revertProperty:o=>{let e=Ot.get(o.debugId);if(e){let t=o.property,n=un.get(o.debugId),r=Fn.get(o.debugId),i=dn.get(o.debugId),a=pn.get(o.debugId),l=t;r&&n&&n[l]!==void 0&&(delete n[l],e.actions[l]=r[l],delete r[l]);let s=t;if(a&&i&&i[s]!==void 0){let c=pn.get(o.debugId)||{};delete i[s],e.dataSourceActions[s]=c[s],delete c[s]}}},discardWarning:o=>{let e=Ot.get(o.debugId);if(e){let t=o.warning,n=e.getDataSourceState().debugWarnings;if(n.get(t))n.delete(t),Br(o.debugId);else{let i=o.warning,a=e.getState().debugWarnings;a.get(i)&&(a.delete(i),Br(o.debugId))}}},discardAllWarnings:o=>{let e=Ot.get(o.debugId);e&&(e.getDataSourceState().debugWarnings.clear(),e.getState().debugWarnings.clear(),Br(o.debugId))},setColumnVisibility:o=>{_s(o.debugId,"columnVisibility",o.columnVisibility)},setGroupBy:o=>{Ta(o.debugId,"groupBy",o.groupBy)},setGroupRenderStrategy:o=>{_s(o.debugId,"groupRenderStrategy",o.groupRenderStrategy)},setSortInfo:o=>{Ta(o.debugId,"sortInfo",o.sortInfo)},setMultiSort:o=>{Ta(o.debugId,"multiSort",o.multiSort)},highlight:o=>{let e=Ot.get(o.debugId);if(e){let t=e.getState().domRef.current;if(t){let n=t.getBoundingClientRect(),r=document.querySelector(`.${qr.classNames.base}`);r||(r=document.createElement("div"),r.classList.add(qr.classNames.base),r.innerHTML=[`<div class="${$g}"></div>`,`<div class="${jg}"></div>`].join(""),document.body.appendChild(r));let i=r.firstElementChild;if(r){r.style.left=`${n.left}px`,r.style.top=`${n.top}px`,r.style.width=`${n.width}px`,r.style.height=`${n.height}px`,i.innerHTML=o.debugId;let a=r.lastElementChild,l=()=>{r.classList.remove(qr.classNames.variants.active.true),a.removeEventListener("animationend",l)};a.addEventListener("animationend",l),r.classList.add(qr.classNames.variants.active.true)}}}}};function IC(){typeof window<"u"&&window.addEventListener("message",o=>{if(o&&o.data&&typeof o.data.source=="string"&&typeof o.data.target=="string"&&o.data.target==="infinite-table-page"&&o.data.source.startsWith("infinite-table-devtools-contentscript")&&(window.__INFINITE_TABLE_DEVTOOLS_HOOK__||(wC(),Ba(window.__INFINITE_TABLE_DEVTOOLS_HOOK__)),typeof o.data.type=="string")){let e=o.data.type,t=vC[e];t&&t(o.data.payload)}})}IC();function RC(){let{getState:o,getComputed:e,getDataSourceState:t,dataSourceActions:n,actions:r,dataSourceApi:i,api:a}=J(),s=o().debugId,c=(0,so.useRef)(s);return c.current=s,(0,so.useEffect)(()=>{let u=c.current;if(!u)return;let d=f=>{f(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})},p=Ba.get();if(p){d(p);return}return Ba.onChange(f=>{f&&d(f)})},[]),(0,so.useEffect)(()=>{let u=c.current;if(!u)return;let d=Ba.get();d&&d(u,{getState:o,getDataSourceState:t,getComputed:e,dataSourceActions:n,actions:r,api:a,dataSourceApi:i})}),(0,so.useEffect)(()=>{if(s)return()=>{let u=globalThis.__INFINITE_TABLE_DEVTOOLS_HOOK__;u&&u(s,null)}},[s]),s}function qg(){let o=Ve(),e=o?o.getMasterState():null,t=J().getState();return(e||t).portalDOMRef.current}var Rt=G(require("react")),oh=require("react");var Xg="hs68h8j _16lm1iwk _16lm1iwx _16lm1iw2n",Zg=me({defaultClassName:"hs68h8e _16lm1iw12 _16lm1iw1x _16lm1iw2j _16lm1iw1p",variantClassNames:{active:{true:"hs68h8f _16lm1iwn _16lm1iw1h",false:"_16lm1iwo"},draggingInProgress:{true:"hs68h8h",false:"hs68h8i"}},defaultVariants:{},compoundVariants:[]}),Qg="hs68h81",Jg=me({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 co=G(require("react"));function eh(o){return co.createElement("div",{...o.domProps})}function th(o){let{active:e}=o;return co.createElement("div",{className:Qg},e?"Drop to group":"Drag columns to group")}function nh(o){let e=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),o.onClear?.())};return co.createElement("div",{...o.domProps},o.label,co.createElement("div",{className:pi[1]}),co.createElement("div",{tabIndex:0,role:"button","aria-label":`Clear grouping by ${o.field}`,className:Xg,onKeyDown:e,onMouseDown:o.onClear},co.createElement(La,{size:20})))}var xC=(o,e)=>t=>{e&&e(t);let n=Date.now(),r=!1,i=()=>{r=!0};we().addEventListener("mousemove",i,{once:!0}),we().addEventListener("mouseup",()=>{r||(we().removeEventListener("mousemove",i),Date.now()-n<200&&requestAnimationFrame(()=>{o()}))},{once:!0})};function PC(o){let{column:e,onClear:t,components:n,field:r,id:i,toggleSorting:a}=o,{dragSourceListId:l,dragItemId:s}=Er(),c=l===tr,u=J(),d=(e?Kn(e.id,u,"grouping-toolbar"):r)??i,p=e?Rt.createElement(ki,{forceSize:!0,size:20,direction:e.computedSortedAsc?1:e.computedSortedDesc?-1:0}):null,f=Rt.createElement(Rt.Fragment,null,d,p),m=s===i&&l===tr,g=Z(Zg({draggingInProgress:c,active:m}),o.domProps?.className),b=xC(a,o.domProps?.onMouseDown),h={...o.domProps,className:g,onMouseDown:b},y=n?.ToolbarItem??nh;return Rt.createElement(y,{active:m,domProps:h,column:e,field:r,label:f,onClear:t})}var tr="grouping-toolbar";function rh(o){let{groupBy:e}=on(),{getComputed:t,dataSourceApi:n,api:r}=J(),{dropTargetListId:i,dragSourceListId:a}=$n(),{fieldsToColumn:l,computedColumnsMap:s}=t(),c=i===tr,u=a===tr,d=o.components?.Placeholder??th,p=o.components?.Host??eh,f=e.length?Rt.createElement(Rt.Fragment,null,e.map((S,C)=>{let T=S.field?l.get(S.field):void 0,v=`${S.field??`idx-${C}`}`;return Rt.createElement(Qn.DraggableItem,{key:v,id:v},w=>Rt.createElement(PC,{id:v,components:o.components,domProps:w,field:S.field,column:T,toggleSorting:()=>{T&&r.toggleSortingForColumn(T.id)},onClear:()=>{let I=e.filter(R=>R!==S).filter(Boolean);n.setGroupBy(I)}}))})):Rt.createElement(d,{draggingInProgress:u,active:c,groupBy:e}),m=S=>{let C=S.map(T=>e[T]);n.setGroupBy(C)},g=S=>{let{dragItemId:C}=S,T=C,v=s.get(T);if(!v||!v.field||!v.computedGroupable)return;let w=[...e];w.splice(S.dropIndex,0,{field:v.field}),n.setGroupBy(w)},b=(0,oh.useCallback)(S=>{let{computedColumnsMap:C}=t(),T=S.dragItem.id,v=C.get(T);return!(!v||!v.computedGroupable||e.some(w=>w.field===v.field))},[e]),h=o.orientation??"horizontal",{domProps:y}=o;return Rt.createElement(Qn,{orientation:h,dragListId:tr,acceptDropsFrom:["header",tr],onDrop:m,onAcceptDrop:g,shouldAcceptDrop:b},(S,{draggingInProgress:C,status:T})=>{let v=Z(Jg({active:c,orientation:h,draggingInProgress:C,dropRejected:T==="rejected"}),S.className,y?.className),w={...S,...y,className:v,children:f};return Rt.createElement(p,{active:c,rejectDrop:T==="rejected",domProps:w,orientation:h})})}var or=G(require("react"));var ch=require("react"),Wt=require("react"),Wa=G(require("react"));function ih(o){let{dataArray:e,brain:t,computedPinnedEndColumns:n,computedPinnedStartColumns:r,computedVisibleColumns:i,computedRowHeight:a,columnSize:l,rowspan:s}=o;return oa(t,{colWidth:l,rowHeight:a,rows:e.length,cols:i.length,rowspan:s},{fixedColsEnd:n.length,fixedColsStart:r.length}),t}var Zr=G(require("react"));var ah=me({defaultClassName:"evqes20",variantClassNames:{},defaultVariants:{},compoundVariants:[]});var Xr=require("react");function DC(o,e){let{masterState:t,detailContext:n}=e,r=t.detailDataSourcesStateToRestore;if(r.has(o)){let i=r.get(o);return n.assignState(i),!0}return!1}function MC(o,e){let{detailState:t,masterState:n,masterActions:r,cacheEntryForRow:i}=e,a=new Map(n.detailDataSourcesStateToRestore),l=Zf(t);i.all||(i.groupBy||delete l.groupBy,i.sortInfo||delete l.sortInfo,i.filterValue||delete l.filterValue,i.data||delete l.originalDataArray),a.set(o,l),r.detailDataSourcesStateToRestore=a}function EC(o,e){let t=(0,Xr.useRef)(!1);return{currentRowCache:(0,Xr.useMemo)(()=>({getRowId:()=>o,add:r=>{t.current=!0,e.add(o,r)},get:()=>e.get(o),delete:()=>(t.current=!0,e.delete(o)),has:()=>e.has(o)}),[e,o]),cacheCalledByRowDetailRenderer:t}}function lh(o){let{rowDetailsCache:e,rowInfo:t}=o,{getState:n,componentActions:r}=De(),{getState:i}=J(),{currentRowCache:a,cacheCalledByRowDetailRenderer:l}=EC(t.id,e),s=(0,Xr.useMemo)(()=>{let c=n().detailDataSourcesStateToRestore.has(t.id)&&a.has();return{registerDetail:at(d=>{if(l.current||a.add({all:!0}),!a.has()){requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)});return}DC(t.id,{masterState:n(),detailContext:d}),requestAnimationFrame(()=>{d.componentState.destroyedRef.current||(d.componentActions.stateReadyAsDetails=!0)}),d.componentState.onCleanup.onChange(()=>{let p=a.get();p&&MC(t.id,{detailState:d.getState(),masterActions:r,masterState:n(),cacheEntryForRow:p})})}),shouldRestoreState:c}},[t.id,a]);return s.masterRowInfo=t,s.getMasterDataSourceState=n,s.getMasterState=i,{masterDetailContextValue:s,currentRowCache:a}}var{rootClassName:AC}=Fe,_C=`${AC}RowDetail`;function OC(o){let e=ai(),{domRef:t,rowDetailRenderer:n,rowDetailHeight:r,rowInfo:i,detailOffset:a,rowDetailsCache:l}=o,{masterDetailContextValue:s,currentRowCache:c}=lh({rowDetailsCache:l,rowInfo:i});return Zr.createElement(e.Provider,{value:s},Zr.createElement("div",{ref:t,className:Z(_C,ah({})),style:{position:"absolute",top:`${a}px`,left:0,width:`calc(${$.bodyWidth} - ${$.scrollbarWidthVertical})`,height:r}},n(i,c)))}var sh=Zr.memo(OC);var FC=1;function uh(o){let{computed:e,bodySize:t,imperativeApi:n}=o,{actions:r,state:i,getState:a}=J(),{computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedColumnsMap:u,computedRowHeight:d,computedRowSizeCacheForDetails:p,fieldsToColumn:f,rowspan:m,toggleGroupRow:g,columnSize:b}=e,{componentState:h,getState:y,componentActions:S,api:C}=De(),{dataArray:T,isNodeReadOnly:v}=h,w=Me(T),{rowHeight:I,rowDetailHeight:R,onRowMouseEnter:x,onRowMouseLeave:E,groupRenderStrategy:A,brain:M,showZebraRows:P,rowDetailRenderer:_,isRowDetailExpanded:D,isRowDetailEnabled:F,cellClassName:N,cellStyle:W,rowStyle:L,rowDetailCache:X,rowClassName:le,onScrollToTop:ae,onScrollToBottom:H,onScrollStop:U,scrollToBottomOffset:ie,wrapRowsHorizontally:se,ready:pe}=i,fe=h.updatedAt;ih({columnSize:b,brain:M,computedPinnedStartColumns:l,computedPinnedEndColumns:s,computedVisibleColumns:c,computedRowHeight:d,dataArray:T,bodySize:t,rowspan:m});let ne=(0,Wt.useRef)(0);(0,Wt.useEffect)(()=>M.onRenderCountChange(()=>{ne.current=M.scrollTopMax}),[M]),(0,Wt.useEffect)(()=>M.onRenderRangeChange(B=>{a().onRenderRangeChange?.(B)}),[M]),(0,Wt.useEffect)(()=>M.onScrollStop(B=>{let{scrollTop:O,scrollLeft:oe}=B;if(O===0&&ae?.(),O+(ie??FC)>=ne.current){H?.();let{livePagination:de,livePaginationCursor:ee,dataArray:j}=y();de&&(S.cursorId=ee!==void 0?Date.now():j.length)}if(U){let de=M.getRenderRange();U({scrollTop:O,scrollLeft:oe,renderRange:de,viewportSize:a().bodySize,firstVisibleRowIndex:de.start[0],lastVisibleRowIndex:de.end[0],firstVisibleColIndex:de.start[1],lastVisibleColIndex:de.end[1]})}}),[M,ae,H,U]),(0,Wt.useEffect)(()=>{t.height&&(r.ready=!0)},[!!t.height]),(0,Wt.useEffect)(()=>{let{onReady:B}=a();B&&B({api:n,dataSourceApi:C})},[pe]);let[,ge]=Mt();(0,Wt.useEffect)(()=>{ge()},[h]);let K=(0,Wt.useCallback)(B=>{let{rowIndex:O,colIndex:oe,heightWithRowspan:te,domRef:he,hidden:de,width:ee,onMouseLeave:j,onMouseEnter:re}=B,xe=w()[O],_e=c[oe];if(!xe||!_e)return null;let Be=p?p.getRowHeight(O):te,Oe=!1;!F||typeof F=="function"&&!F(xe)?Oe=!1:D&&(Oe=D(xe)?"expanded":"collapsed");let Ze=se?M.getRowIndexInPage(O):null,et=se?M.getPageIndexForRow(O):null;return Wa.createElement(Yd,{...{getData:w,virtualized:!0,showZebraRows:P,groupRenderStrategy:A,rowIndexInHorizontalLayoutPage:Ze,horizontalLayoutPageIndex:et,rowIndex:O,rowInfo:xe,hidden:de,toggleGroupRow:g,rowHeight:Be,rowDetailState:Oe,onMouseEnter:re,onMouseLeave:j,onRowMouseEnter:x,onRowMouseLeave:E,domRef:he,width:ee,column:_e,columnsMap:u,fieldsToColumn:f,rowStyle:L,rowClassName:le,cellStyle:W,cellClassName:N}})},[I,R,x,E,p,d,D,w,c,u,f,A,se,g,P,M,fe,v,L,le,N,W]),k=(0,ch.useMemo)(()=>{if(D)return B=>{let{rowIndex:O,domRef:oe}=B,he=w()[O];if(!he||!D(he)||!p)return Wa.createElement("div",{ref:oe,className:Wc.hidden});let{rowDetailHeight:de,rowHeight:ee}=p.getSize(O);return Wa.createElement(sh,{rowInfo:he,rowDetailsCache:X,rowIndex:O,domRef:oe,detailOffset:ee,rowDetailHeight:de,rowDetailRenderer:_})}},[pe,K,_,R,D,X]);return{renderCell:K,renderDetailRow:k}}var dh=require("react");function ph(){let{state:o,getState:e,actions:t}=J(),{wrapRowsHorizontally:n}=o,r=Tn(n);(0,dh.useEffect)(()=>{if(r!==n){let{brain:i,headerBrain:a,renderer:l,onRenderUpdater:s}=e();i.destroy(),a.destroy(),l.destroy(),s.destroy();let c=Bs(Ka,!!n);t.brain=c.brain,t.headerBrain=c.headerBrain,t.renderer=c.renderer,t.onRenderUpdater=c.onRenderUpdater,t.headerRenderer=c.headerRenderer,t.headerOnRenderUpdater=c.headerOnRenderUpdater}},[r,n])}var gh=G(require("react"));var fh="_16lm1iw1 _16lm1iw1c _16lm1iwe";var mh=Z(fh,Ul);function hh(o){return gh.createElement("div",{...o,className:o.className?Z(mh,o.className):mh})}var nr=G(require("react"));var bh={visible:"qy58ya1 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",hidden:"qy58ya2 qy58ya0 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a"},yh="qy58ya3 _16lm1iw2 _16lm1iw23 _16lm1iw26 _16lm1iw2c _16lm1iw2a",Th="qy58ya4";var{rootClassName:NC}=Fe,fc=`${NC}-LoadMask`;function LC(o){let{visible:e,children:t="Loading"}=o;return nr.createElement("div",{className:`${bh[e?"visible":"hidden"]} ${fc}`},nr.createElement("div",{className:`${yh} ${fc}-Overlay`}),nr.createElement("div",{className:`${Th} ${fc}-Text`},t))}var ja=nr.memo(LC);var Sh=require("react"),kC=[Ad,`${Xt}--hovered`];function zC(o){return Array.isArray(o)&&(o=o.join(" ")),o.split(" ").map(e=>e.trim()).filter(Boolean)}function uo(o){let e=J(),t=Ve(),{state:n,getComputed:r,api:i}=e,{renderer:a,onRenderUpdater:l,debugId:s,keyboardNavigation:c,activeRowIndex:u,loadingText:d,scrollStopDelay:p,brain:f,scrollerDOMRef:m,components:g,bodySize:b,activeCellIndex:h,rowDetailRenderer:y,showHoverRows:S,wrapRowsHorizontally:C,domProps:T,domRef:v,rowHoverClassName:w}=n,I=g?.LoadMask??ja,R=r(),{computedRowHeight:x,computedRowSizeCacheForDetails:E}=R,A=E?.getRowHeight||x,{componentState:{loading:M}}=De(),P=or.useCallback(L=>{let X=e.getState(),le=L.target;if(!t&&L._from_row_detail)return;t&&(L._from_row_detail=!0);let ae=Gu(le,Ks(),X.domRef.current),H,U,ie,se;ae&&(U=Number(ae.dataset.colIndex),se=Number(ae.dataset.rowIndex),H=e.getComputed().computedVisibleColumns[U].id,ie=e.dataSourceApi.getRowInfoArray()[se].id);let pe={columnId:H,colIndex:U,rowId:ie,rowIndex:se,event:L,target:ae??L.target};ae&&X.cellContextMenu(pe),X.contextMenu(pe)},[]),{renderCell:_,renderDetailRow:D}=uh({imperativeApi:i,getComputed:r,domRef:v,bodySize:b,computed:R}),{autoFocus:F,tabIndex:N}=T??{};ph();let W=(0,Sh.useMemo)(()=>{if(!S)return;let L=[];return w&&(L=L.concat(w)),o.rowHoverClassName&&(L=L.concat(o.rowHoverClassName)),uo.rowHoverClassName&&(L=L.concat(uo.rowHoverClassName)),zC(L)},[S,w,o.rowHoverClassName,uo.rowHoverClassName]);return or.createElement(hh,{onContextMenu:P},or.createElement(Vp,{forceRerenderTimestamp:n.forceBodyRerenderTimestamp,debugId:s,tabIndex:N??0,autoFocus:F??void 0,activeRowIndex:n.ready&&c==="row"?u:null,activeCellIndex:n.ready&&c==="cell"&&!n.columnReorderDragColumnId?h:null,scrollStopDelay:p,renderer:a,wrapRowsHorizontally:C,onRenderUpdater:l,brain:f,activeCellRowHeight:A,renderCell:_,renderDetailRow:y?D:void 0,cellHoverClassNames:W,scrollerDOMRef:m,scrollVarHostRef:v}),or.createElement(I,{visible:M},d))}uo.rowHoverClassName=kC;var qt=Fe.rootClassName,{ManagedComponentContextProvider:VC}=Et({initSetupState:bm,forwardProps:ym,mapPropsToState:wm,cleanup:Tm,allowedControlledPropOverrides:{rowHeight:!0,columnHeaderHeight:!0},mappedCallbacks:Cm(),getParentState:()=>on(),debugName:o=>Mn(o.debugId,Ka)}),Ch=Ie.memo(function(){let e=J(),t=Ve(),{state:n,api:r,children:i}=e,{componentState:{dataArray:a},getState:l,componentActions:s}=De(),{domRef:c,portalDOMRef:u,onRowHeightCSSVarChange:d,onFlashingDurationCSSVarChange:p,onRowDetailHeightCSSVarChange:f,onColumnHeaderHeightCSSVarChange:m,rowHeightCSSVar:g,rowDetailHeightCSSVar:b,columnHeaderHeightCSSVar:h,scrollStopDelay:y,brain:S,activeRowIndex:C,activeCellIndex:T}=n,{licenseKey:v}=n;!v&&tn.licenseKey&&(v=tn.licenseKey),Vm(C,a.length,r),zm(T,a.length,r);let{onKeyDown:w}=og();Ie.useEffect(()=>{let W=l(),L=Dt(X=>{W.notifyRenderRangeChange({renderStartIndex:X[0],renderEndIndex:X[1]})},{wait:y});return S.onVerticalRenderRangeChange(L)},[S,y]);let I=km(v),{autoFocus:R,tabIndex:x,...E}=n.domProps??{},A=id(E);Ie.useEffect(()=>{S.setScrollStopDelay(y),s.scrollStopDelayUpdatedByTable=y},[y]),lm(),Wg(),Eg();let{menuPortal:M}=xg(),{menuPortal:P}=kg(),{menuPortal:_}=zg(),{menuPortal:D}=Og();Ie.useEffect(()=>{typeof globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY=="function"&&globalThis.__DO_NOT_USE_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_IS_READY(n.id,n.ready,e.api,e)},[n.ready]);let F=Yg();Ie.useEffect(()=>{t&&(u.current=t.getMasterState().portalDOMRef.current)},[]);let N=i??Ie.createElement(Ie.Fragment,null,Ie.createElement(bs,null),Ie.createElement(uo,null));return Ie.createElement("div",{"data-debug-id":F,onKeyDown:w,ref:c,...A},N,Ie.createElement("div",{ref:u,className:Z(`${lt}Portal`,jc[1e7],fi.absolute,Kc[0],Vc[0])},M,P,_,D),g?Ie.createElement(dr,{key:"row-height",varName:g,onChange:d}):null,Ie.createElement(dr,{key:"flashing-duration",allowInts:!0,varName:ue.components.Cell.flashingDuration,onChange:p}),b?Ie.createElement(dr,{key:"row-detail-height",varName:b,onChange:f}):null,h?Ie.createElement(dr,{key:"column-header-height",varName:h,onChange:m}):null,I?null:Ie.createElement(lf,null),Ie.createElement(Mg,null))});function GC({children:o}){let{componentActions:e,componentState:t}=$e(),{scrollerDOMRef:n,scrollTopKey:r}=t,i=_m(),a=Me(i),l=Me(t),s=Ve(),{getState:c,componentActions:u,getDataSourceMasterContext:d,api:p}=De(),[f]=Ie.useState(()=>am({getComputed:a,getState:l,getDataSourceState:c,getDataSourceMasterContext:d,dataSourceApi:p,actions:e,dataSourceActions:u})),m={actions:e,state:t,computed:i,dataSourceActions:u,getDataSourceMasterContext:d,getDataSourceState:c,getComputed:a,getState:l,api:f,dataSourceApi:p,children:o};ii(n,b=>{let h={width:b.width,height:b.height};e.bodySize=h},{earlyAttach:!0,debounce:50}),Ie.useEffect(()=>{n.current&&(n.current.scrollTop=0)},[r,n]);let g=bo();return Ie.createElement(g.Provider,{value:m},Ie.createElement(Ch,null))}var HC=40,KC=Gm(Ku),tn=function(o){return Ie.createElement(VC,{repeatWrappedGroupRows:!!o.wrapRowsHorizontally,rowHeight:HC,columnHeaderHeight:KC,...o},Ie.createElement($l,null,Ie.createElement(GC,{children:o.children})))};tn.Header=bs;tn.Body=uo;tn.HScrollSyncContent=Hg;tn.Footer=()=>Ie.createElement(Uc,null);tn.GroupingToolbar=rh;var wh=G(require("react"));function BC(o){let{DataSource:e}=Wo({nodesKey:"children",...o});return wh.createElement(e,null,o.children??null)}var vh=G(require("react"));function Ih(o){return vh.createElement(tn,{...o})}var Rh=o=>(t,{unfilteredTreePaths:n,treeSelectionState:r,prevTreeSelectionState:i,lastUpdatedNodeInfo:a})=>{let l=new Xe(i,{treePaths:n});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()};o(c)};var $a=class{constructor(e){this.state="idle";this.result=void 0;this.error=void 0;this.doneAt=0;this.pendingPromise=void 0;this.debugName="";this.fetch=async(e,...t)=>{this.state="loading";let n=()=>{};try{this.logger(`Fetching query ${this.debugName}...`),this.pendingPromise=new Promise(r=>{n=r}),this.result=await e(...t),this.state="success"}catch(r){this.result=void 0,this.error=r,this.state="error"}return this.doneAt=Date.now(),this.pendingPromise=void 0,n(this),this.logger(`Fetched query ${this.debugName}. State: ${this.state}.`),this.getDoneSnapshot()};this.getCurrentSnapshot=()=>{let e={state:this.state,result:this.result,doneAt:this.doneAt,error:this.error,done:this.isDone()};return e.done||(e.promise=this.pendingPromise),e};this.getDoneSnapshot=async()=>{if(this.state==="idle")throw new Error("DataQuery is still idle");return this.pendingPromise&&await this.pendingPromise,{state:this.state,result:this.result,error:this.error,done:this.isDone(),doneAt:this.doneAt}};this.getResult=()=>{if(!this.isDone())throw new Error("DataQuery is not done yet");return this.result};this.isDone=()=>this.state==="success"||this.state==="error";this.isSuccess=()=>this.state==="success";this.debugName=e||"",this.logger=Ke(`IT:${e}:DataQuery`)}};function po(o){if(Array.isArray(o))return o.map(po);if(typeof o=="object"){if(o===null)return o;let e=o,t=Object.keys(e).sort((r,i)=>r.localeCompare(i)),n={};return t.forEach(r=>{let i=e[r];i!==void 0&&(n[r]=po(i))}),JSON.stringify(n)}return o instanceof Date?o.toISOString():o}var mn=class mn{constructor(e){this.queryCache=new Q;this.removeQueryIfErrored=(e,t)=>{if(e.getCurrentSnapshot().state!=="success"){let n=this.queryCache.get(t);if(e===n)return this.queryCache.delete(t),!0}return!1};this.fireQuery=e=>{let t=po(e.key),n=this.options.cache?this.queryCache.get(t):null;if(n!=null){let i=n.getCurrentSnapshot();if(i.state==="success")return{query:n,fromCache:!0};if(i.state==="loading")return{query:n,fromCache:!0};i.state==="error"&&this.removeQueryIfErrored(n,t)}let r=new $a(`${this.name}:${e.name}`);return this.queryCache.set(t,r),r.fetch(e.fn,e.key),r.getCurrentSnapshot().promise?.then(()=>{this.removeQueryIfErrored(r,t)}),{query:r,fromCache:!1}};this.query=e=>this.fireQuery(e).query.getCurrentSnapshot();this.awaitQuery=async e=>{let{query:t,fromCache:n}=this.fireQuery(e),r=t.getCurrentSnapshot();return r.promise&&(r=await t.getDoneSnapshot(),r.state==="error"&&n)?await this.fireQuery(e).query.getDoneSnapshot():r};this.isQueryInProgress=e=>{let t=po(e);return this.queryCache.get(t)?.getCurrentSnapshot().done??!1};this.hasQueryForKey=e=>{let t=po(e);return this.queryCache.has(t)};this.discardQueryForKey=e=>{let t=po(e);this.queryCache.delete(t)};if(this.options=e,mn.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)}mn.clients.set(e.name,this),this.name=e.name}static destroy(e){let t=mn.clients.get(e);t&&t.destroy()}static destroyAll(){mn.clients.forEach(e=>{mn.destroy(e.name)})}destroy(){mn.clients.delete(this.options.name)}};mn.clients=new Map;var mc=mn;var WC={key:"*",when:o=>{let{activeCellIndex:e}=o.getState();if(e){let[t,n]=e,r=o.api.getColumnAtIndex(n);return r?o.api.isCellEditable({rowIndex:t,columnId:r.id}):!1}return!1},handler:(o,e)=>{let{key:t}=e;if(t!="Escape"&&t.length===1){let{activeCellIndex:n}=o.getState();if(n){let[r,i]=n,a=o.api.getColumnAtIndex(i);if(!a)return;requestAnimationFrame(()=>{o.api.startEdit({rowIndex:r,value:t,columnId:a.id})})}}}},xh={instantEdit:WC};var jC=require("react");function Ph(o,e){let{set:t,delete:n,clear:r}=o;return e.set&&(o.set=(i,a)=>(t.call(o,i,a),e.set(i,a),o)),e.delete&&(o.delete=i=>{let a=n.call(o,i);return e.delete(i),a}),(e.clear||e.beforeClear)&&(o.clear=()=>{e.beforeClear&&e.beforeClear(o);let i=r.call(o);return e.clear&&e.clear(),i}),()=>{t&&(o.set=t),n&&(o.delete=n),r&&(o.clear=r)}}var Ya=class Ya{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Ya.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1);n&&this.currentSet.delete(n)}return this.orderRefs.push(e),this.currentSet.add(e),this}};Ya.DEFAULT_SIZE=10;var Ua=Ya;var Xa=class Xa{constructor(e,t){this.orderRefs=[];if(typeof e=="number")this.maxSize=e,this.currentSet=new Set;else if(this.maxSize=t??Xa.DEFAULT_SIZE,e){let n=Array.from(e);this.maxSize<n.length&&n.slice(n.length-this.maxSize),this.currentSet=new Set,n.forEach(r=>{this.add(r)})}else this.currentSet=new Set}values(){return this.currentSet.values()}get size(){return this.currentSet.size}delete(e){return this.currentSet.has(e)?(this.currentSet.delete(e),this.orderRefs=this.orderRefs.filter(t=>t.deref()!==e),!0):!1}has(e){return this.currentSet.has(e)}add(e){if(this.currentSet.has(e))return this;if(this.maxSize-this.currentSet.size<=0){let[n]=this.orderRefs.splice(0,1),r=n.deref();r&&this.currentSet.delete(r)}return this.orderRefs.push(new WeakRef(e)),this.currentSet.add(e),this}};Xa.DEFAULT_SIZE=10;var qa=Xa;var fo=require("react"),$C=(o,e)=>o.every((t,n)=>t===e[n]),Dh=(o,e)=>{let t=(0,fo.useRef)(e),n=$C(e,t.current),r=(0,fo.useRef)(!0);t.current=e;let i=(0,fo.useRef)(["same"]),a=n?[Date.now()]:i.current;i.current=a;let l=(0,fo.useRef)(o);l.current=o,(0,fo.useEffect)(()=>{if(r.current){r.current=!1;return}return l.current()},a)};var zn=require("react"),Mh=(o,e,t)=>o.every((n,r)=>t?t(n,e[r]):n===e[r]),Za=(o,e)=>{let{same:t,different:n,compare:r}=e,i=(0,zn.useRef)(t),a=(0,zn.useRef)(n),l=Mh(t,i.current,r),s=!Mh(n,a.current,r),c=(0,zn.useRef)(!0);i.current=t,a.current=n;let u=(0,zn.useRef)(["same"]),d=l&&s?[Date.now()]:u.current;u.current=d;let p=(0,zn.useRef)(o);p.current=o,l&&s&&(c.current=!1),(0,zn.useEffect)(()=>{if(!c.current)return p.current()},d)};var xt=G(require("react"));var Eh=q($.currentFlashingDuration),UC=({children:o})=>xt.createElement(xt.Fragment,null,o),Ah=1e3,_h={up:Ei({direction:"up"}).split(" "),down:Ei({direction:"down"}).split(" "),neutral:Ei({direction:"neutral"}).split(" ")},gc=(o={})=>{let{flashDuration:e,flashClassName:t,render:n=UC}=o;return xt.forwardRef((i,a)=>{let l=Ir(),{state:{flashingDurationCSSVarValue:s}}=J(),c=typeof s=="number"?s??e??Ah:e??Ah,{domRef:u,value:d,column:p,rowInfo:f,htmlElementRef:m}=l,g=f.id,b=p.id,h=xt.useRef(!0),y=xt.useRef(d),S=h.current?null:y.current;h.current=!1;let C=xt.useRef(void 0),T=xt.useRef(void 0),v=xt.useRef(void 0);return Za(()=>{if(d===y.current)return;let w=()=>{let E=m.current;if(C.current&&(clearTimeout(C.current),C.current=void 0),v.current&&(clearTimeout(v.current),v.current=void 0),T.current&&E){let A=T.current,M=_h[A];E.classList.remove(...t?[t,...M]:M),E.style.removeProperty(Eh),T.current=void 0}};y.current=d;let I=m.current;if(!I)return;w();let R=typeof d=="number"?d>S?"up":"down":"neutral",x=_h[R];return I.style.setProperty(Eh,`${c}`),I.classList.add(...t?[t,...x]:x),T.current=R,C.current=setTimeout(w,c),w},{same:[b,g],different:[d]}),xt.createElement("div",{ref:u,...i,className:Z(i.className)},n({children:i.children,oldValue:S}))})},Oh=gc();var Ye=G(require("react")),rr=require("react");var Fh=require("react-dom");function Nh(o){let[e,t]=Ye.useState(null);return(0,rr.useEffect)(()=>{let{debugTarget:n}=o,r=setInterval(()=>{if(globalThis.INFINITE&&globalThis.INFINITE[n]){let i=globalThis.INFINITE[n].getState;clearInterval(r),t(()=>i)}},100);return()=>{clearInterval(r)}},[o.debugTarget]),typeof e=="function"?Ye.createElement(Lh.Provider,{value:{getState:e}},Ye.createElement(YC,null)):null}var Lh=Ye.createContext({getState:()=>null});function YC(){let o=Ye.useContext(Lh),{getState:e}=o,[,t]=Mt(),n=e().renderer.cellManager;(0,rr.useEffect)(()=>{let s=Dt(()=>{console.log("rerender"),t()},{wait:500});return n.onCellAttachmentChange(s)},[n,t]);let r=n.getRowsWithCells(),i=n.getColumnsWithCells(),a=(0,rr.useRef)(null),l=(0,rr.useRef)(null);return Ye.createElement("div",{style:{overflow:"auto"}},(0,Fh.createPortal)(Ye.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),Ye.createElement("table",{style:{borderCollapse:"collapse"}},Ye.createElement("thead",null,Ye.createElement("tr",null,i.map(s=>Ye.createElement("th",{key:s,"data-col-index":s},s)))),Ye.createElement("tbody",null,r.map(s=>Ye.createElement("tr",{key:s,"data-row-index":s},i.map(c=>Ye.createElement("td",{key:c,style:{padding:5,border:"1px solid gray",background:n.getCellAt([s,c])?.getNode()?"rgba(0, 255, 0, 0.3)":"rgba(255, 0, 0, 0.3)"},"data-col-index":c},Ye.createElement("button",{onClick:()=>{let u=n.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 qC={CheckBox:rn,LoadMask:ja,MenuIcon:xr,StringFilterEditor:wo,NumberFilterEditor:Ci};0&&(module.exports={CellSelectionState,DataClient,DataSource,DataSourceActionType,DeepMap,FixedSizeSet,FlashingColumnCell,GroupRowsState,INTERNAL_MatrixDebugger,InfiniteTable,InfiniteTableClassName,InfiniteTableComponent,Menu,RowDetailCache,RowDetailState,RowDisabledState,RowSelectionState,TreeDataSource,TreeExpandState,TreeGrid,TreeSelectionState,WeakFixedSizeSet,alignNode,components,createFlashingColumnCellComponent,debounce,debug,defaultFilterTypes,eventMatchesKeyboardShortcut,filterDataArray,filterTypes,flatten,getComponentStateRoot,group,interceptMap,keyboardShortcuts,multisort,multisortNested,queryKeyToCacheKey,toTreeDataArray,useComponentState,useDataSourceInternal,useDataSourceState,useEffectWhen,useEffectWhenSameDeps,useEffectWithChanges,useEffectWithObject,useGridScroll,useInfiniteColumnCell,useInfiniteColumnEditor,useInfiniteColumnFilterEditor,useInfiniteHeaderCell,useInfinitePortalContainer,useLayoutEffectWithChanges,useManagedDataSource,useMasterRowInfo,useOverlay,useOverlayPortal,usePrevious,useRowInfoReducers,useVisibleColumnSizes,withSelectedLeafNodesOnly});
30
30
  //!collapsed || lazyLoad;